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 voiddefault voiddefault voiddefault voiddefault voidvoidvoiddefault voidappend(StringBuilder b, Token tok) default DocumentRange.BuilderasRange()default booleandefault booleancontainsIndex(int i) default booleancontainsLines(int winStartLine, int winEndLine) default intdistanceTo(int offset) default TokenfindToken(PositionOrBuilder requested) default intintgetId()default intintdefault voidinsertChild(Node child, int index) default booleanOverridden manually for nodes who can "have a cursor on them" with respect to autocomplete.default booleanbooleanjjtAccept(ChunkerVisitor visitor, Object data) Accept the visitor.voidjjtAddChild(Node n, int i) This method tells the node to add its argument to the node's list of children.voidjjtClose()This method is called after all the child nodes have been added.jjtGetChild(int i) This method returns a child node.intReturn the number of children the node has.voidjjtInsertChild(Node n, int i) This method inserts the specified node at the given index, shifting any existing items to the right.voidjjtOpen()This method is called after the node has been made the current node.voidjjtSetFirstToken(Token token) voidjjtSetLastToken(Token token) voidjjtSetParent(Node n) This pair of methods are used to inform the node of its parent.default voidvoidremoveChild(Node node) default Nodedefault voiddefault LinkedIterable<Token>tokens(boolean strict) default LinkedIterable<Token>tokensReversed(boolean strict) default StringtoSource()
-
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)
-