JSONPath Tools / @jsonpath-tools/jsonpath / SyntaxTreeNode
Class: abstract SyntaxTreeNode
Nonterminal symbols of the grammar.
Extends
Extended by
Constructors
new SyntaxTreeNode()
new SyntaxTreeNode(children): SyntaxTreeNodeParameters
children
(null | SyntaxTree)[]
Children.
Returns
SyntaxTreeNode
Overrides
Properties
_parent
_parent: null | SyntaxTreeNode = null;Internal
Inherited from
children
readonly children: SyntaxTree[];Children.
length
readonly length: number;Length in the text.
Inherited from
position
readonly position: number;Position in the text.
Inherited from
type
abstract readonly type: SyntaxTreeType;Type.
Inherited from
Accessors
parent
Get Signature
get parent(): null | SyntaxTreeNodeParent or null when no parent is assigned.
Returns
null | SyntaxTreeNode
Inherited from
skippedTextBefore
Get Signature
get skippedTextBefore(): stringText that was skipped during parsing.
Returns
string
Text that was skipped during parsing.
Overrides
textRange
Get Signature
get textRange(): TextRangeRange in the text.
Returns
Inherited from
textRangeWithoutSkipped
Get Signature
get textRangeWithoutSkipped(): TextRangeRange in the text excluding skipped text before.
Returns
Inherited from
SyntaxTree.textRangeWithoutSkipped
Methods
forEach()
forEach(action): voidExecutes the given action for this and all descendant trees in a pre-order tree traversal.
Parameters
action
(tree) => boolean | void
Action.
Returns
void
Overrides
getAtPosition()
getAtPosition(characterPosition): null | SyntaxTreeReturns the innermost subtree that spans the given character position or null when the position is outside of a range of the current tree.
Parameters
characterPosition
number
Position (character index).
Returns
null | SyntaxTree
Inherited from
getContainingAtPosition()
getContainingAtPosition(caretPosition): null | SyntaxTreeReturns the innermost subtree that fully contains the given caret position (not just touches) or null when the position is not contained in a range of the current tree.
Parameters
caretPosition
number
Position (caret position index).
Returns
null | SyntaxTree
Inherited from
SyntaxTree.getContainingAtPosition
getTouchingAtPosition()
getTouchingAtPosition(caretPosition): SyntaxTree[]Returns all innermost subtrees that touch the given caret position.
Parameters
caretPosition
number
Position (caret position index).