THPDFContentSyntaxNode Record
Represents a single compact node of the token-preserving content stream syntax tree with linked children and lexeme spans
Declaration
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;
Unit
HPDFContentStream
Fields
| Field | Purpose |
|---|---|
Kind | Node class: csnkRoot, csnkOperation, csnkOperand, csnkArray, csnkDictionary, csnkProcedure, csnkInlineImage, or csnkMalformed |
ParentIndex | Index of the parent node, -1 when the node is without a parent |
FirstChildIndex | Index of the first child node, -1 when the node has no children |
LastChildIndex | Index of the last child node |
NextSiblingIndex | Index of the next sibling, -1 at the end of a child list |
ChildCount | Number of direct child nodes |
FirstLexemeIndex | First lexeme covered by the node in the lexeme array |
LastLexemeIndex | Last lexeme covered by the node |
OperatorLexemeIndex | Lexeme holding the operator of an operation node, -1 for other node kinds |
StartOfs | Byte offset at which the node's source span starts |
EndOfs | Byte offset immediately after the node's source span |
Usage notes
- Operation nodes own their operands and identify the operator lexeme separately through
OperatorLexemeIndex - Container nodes retain nested arrays, dictionaries and procedures without normalising their original spelling, so edits stay token preserving
- Read nodes through
THPDFContentStreamAST.GetNoderather than touching the internal node array directly