THPDFContentSyntaxNode Record
Biểu diễn một node gọn trong cây cú pháp content stream bảo toàn token, với các node con liên kết và lexeme span
Khai báo
THPDFContentSyntaxNode= record
Kind: THPDFContentSyntaxNodeKind;
ParentIndex: Integer;
FirstChildIndex: Integer;
LastChildIndex: Integer;
NextSiblingIndex: Integer;
ChildCount: Integer;
FirstLexemeIndex: Integer;
LastLexemeIndex: Integer;
OperatorLexemeIndex: Integer;
StartOfs: Integer;
EndOfs: Integer;
end;
Đơn vị
HPDFContentStream
Các trường
| Trường | Mục đích |
|---|---|
Kind | Loại node: csnkRoot, csnkOperation, csnkOperand, csnkArray, csnkDictionary, csnkProcedure, csnkInlineImage, hoặc csnkMalformed |
ParentIndex | Chỉ số của node cha, -1 khi chưa đặt cha |
FirstChildIndex | Chỉ số của node con đầu tiên, -1 khi node không có con |
LastChildIndex | Chỉ số của node con cuối cùng |
NextSiblingIndex | Chỉ số của node anh em kế tiếp, -1 ở cuối danh sách con |
ChildCount | Số node con trực tiếp |
FirstLexemeIndex | Lexeme đầu tiên trong mảng lexeme mà node bao phủ |
LastLexemeIndex | Lexeme cuối cùng mà node bao phủ |
OperatorLexemeIndex | Lexeme chứa operator của một operation node, -1 với các loại node khác |
StartOfs | Byte offset nơi span nguồn của node bắt đầu |
EndOfs | Byte offset ngay sau span nguồn của node |
Ghi chú sử dụng
- Các operation node sở hữu operand của mình và nhận diện lexeme operator riêng qua
OperatorLexemeIndex - Các container node giữ nguyên array, dictionary và procedure lồng nhau mà không chuẩn hóa cách viết gốc, nên các chỉnh sửa vẫn bảo toàn token
- Đọc node qua
THPDFContentStreamAST.GetNodethay vì đụng thẳng vào mảng node nội bộ