THPDFContentSyntaxNode Record
링크드 자식과 lexeme 스팬을 갖춘, 토큰을 보존하는 콘텐츠 스트림 구문 트리의 컴팩트 노드 하나를 표현합니다
선언
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;
유닛
HPDFContentStream
필드
| 필드 | 목적 |
|---|---|
Kind | 노드 종류. csnkRoot, csnkOperation, csnkOperand, csnkArray, csnkDictionary, csnkProcedure, csnkInlineImage, csnkMalformed 중 하나 |
ParentIndex | 부모 노드의 인덱스. 부모가 없으면 -1 |
FirstChildIndex | 첫 자식 노드의 인덱스. 자식이 없으면 -1 |
LastChildIndex | 마지막 자식 노드의 인덱스 |
NextSiblingIndex | 다음 형제의 인덱스. 자식 목록의 끝이면 -1 |
ChildCount | 직계 자식 노드 수 |
FirstLexemeIndex | lexeme 배열에서 이 노드가 덮는 첫 lexeme |
LastLexemeIndex | 이 노드가 덮는 마지막 lexeme |
OperatorLexemeIndex | 연산 노드의 연산자를 담은 lexeme. 다른 노드 종류에서는 -1 |
StartOfs | 노드 소스 스팬이 시작하는 바이트 오프셋 |
EndOfs | 노드 소스 스팬 바로 다음의 바이트 오프셋 |
사용 참고 사항
- 연산 노드는 자신의 피연산자를 소유하고, 연산자 lexeme은
OperatorLexemeIndex로 별도 식별합니다 - 컨테이너 노드는 중첩된 배열, 사전, procedure를 원본 표기 그대로 유지하므로 편집이 토큰 보존을 지킵니다
- 내부 노드 배열을 직접 건드리지 말고
THPDFContentStreamAST.GetNode로 노드를 읽습니다