Package io.deephaven.lang.generated
Interface Node
- All Known Subinterfaces:
ChunkerInvokable
,HasScope
,IsScope
- All Known Implementing Classes:
AbstractChunkerInvokable
,ChunkerAnnotation
,ChunkerArray
,ChunkerAssign
,ChunkerBinaryExpression
,ChunkerClosure
,ChunkerDocument
,ChunkerEof
,ChunkerIdent
,ChunkerInvoke
,ChunkerJavaClassDecl
,ChunkerMethodName
,ChunkerNew
,ChunkerNewline
,ChunkerNum
,ChunkerParam
,ChunkerStatement
,ChunkerString
,ChunkerTypedAssign
,ChunkerTypeDecl
,ChunkerTypeParam
,ChunkerTypeParams
,ChunkerWhitespace
,ScopedNode
,SimpleNode
public interface Node
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
default void
default void
default void
default void
void
void
default void
append
(StringBuilder b, Token tok) default DocumentRange.Builder
asRange()
default boolean
default boolean
containsIndex
(int i) default boolean
containsLines
(int winStartLine, int winEndLine) default int
distanceTo
(int offset) default Token
findToken
(PositionOrBuilder requested) default int
int
getId()
default int
int
default void
insertChild
(Node child, int index) default boolean
Overridden manually for nodes who can "have a cursor on them" with respect to autocomplete.default boolean
boolean
jjtAccept
(ChunkerVisitor visitor, Object data) Accept the visitor.void
jjtAddChild
(Node n, int i) This method tells the node to add its argument to the node's list of children.void
jjtClose()
This method is called after all the child nodes have been added.jjtGetChild
(int i) This method returns a child node.int
Return the number of children the node has.void
jjtInsertChild
(Node n, int i) This method inserts the specified node at the given index, shifting any existing items to the right.void
jjtOpen()
This method is called after the node has been made the current node.void
jjtSetFirstToken
(Token token) void
jjtSetLastToken
(Token token) void
jjtSetParent
(Node n) This pair of methods are used to inform the node of its parent.default void
void
removeChild
(Node node) default Node
default void
default LinkedIterable<Token>
tokens
(boolean strict) default LinkedIterable<Token>
tokensReversed
(boolean strict) default String
toSource()
-
Method Details
-
jjtOpen
void jjtOpen()This method is called after the node has been made the current node. It indicates that child nodes can now be added to it. -
jjtClose
void jjtClose()This method is called after all the child nodes have been added. -
jjtSetParent
This pair of methods are used to inform the node of its parent. -
jjtGetParent
Node jjtGetParent() -
jjtAddChild
This method tells the node to add its argument to the node's list of children. -
jjtInsertChild
This method inserts the specified node at the given index, shifting any existing items to the right. -
jjtGetChild
This method returns a child node. The children are numbered from zero, left to right. -
jjtGetNumChildren
int jjtGetNumChildren()Return the number of children the node has. -
getId
int getId() -
jjtGetFirstToken
Token jjtGetFirstToken() -
jjtSetFirstToken
-
jjtGetLastToken
Token jjtGetLastToken() -
jjtSetLastToken
-
tokens
-
tokensReversed
-
addToken
-
addToken
-
rescope
-
setScope
-
jjtAccept
Accept the visitor. -
adopt
-
containsIndex
default boolean containsIndex(int i) -
isChildOf
-
addJunk
-
toSource
-
append
-
getEndIndex
default int getEndIndex() -
getStartIndex
default int getStartIndex() -
getChildren
-
isAutocompleteTerminal
default boolean isAutocompleteTerminal()Overridden manually for nodes who can "have a cursor on them" with respect to autocomplete. If any part of an ast node collects tokens that are "leaf nodes" (i.e. there are cursor positions where your ast node will be the most derived child found), then it is a candidate to be a terminal autocomplete source. When encountering whitespace or . or , we might search left or right for interesting nodes, and those ast nodes who are autocomplete terminal will be preferred over their children. The normal search algorithm is a standard binary tree search, where the next-leftmost|rightmost leaf node is transversed. When an `isAutocompleteTerminal() == true` node is found, however, we stop there to continue searches.- Returns:
- true for nodes that the visitor in ChunkerCompleter will visit and generate results. This is not needed for always-terminal nodes, like ChunkerNum or ChunkerIdent, but is needed by terminal-nodes-with-children, like ChunkerInvoke or ChunkerNew.
-
isWellFormed
boolean isWellFormed() -
addChild
-
addChild
-
insertChild
-
addScope
-
addScope
-
maybeDetach
default void maybeDetach() -
removeChild
-
indexOf
-
asRange
-
containsLines
default boolean containsLines(int winStartLine, int winEndLine) -
contains
-
findToken
-
distanceTo
default int distanceTo(int offset)
-