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
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidaddChild(Node child)default voidaddChild(Node child, int index)TokenaddJunk(Token junk)default voidaddScope(IsScope scope)default voidaddScope(java.util.List<IsScope> scope)default voidaddToken(Token token)voidaddToken(Token token, Node anchor)voidadopt(Node node)default voidappend(java.lang.StringBuilder b, Token tok)default io.deephaven.proto.backplane.script.grpc.DocumentRange.BuilderasRange()default booleancontains(io.deephaven.proto.backplane.script.grpc.Position pos)default booleancontainsIndex(int i)default booleancontainsLines(int winStartLine, int winEndLine)default intdistanceTo(int offset)default TokenfindToken(io.deephaven.proto.backplane.script.grpc.PositionOrBuilder requested)java.util.List<Node>getChildren()default intgetEndIndex()intgetId()default intgetStartIndex()intindexOf(Node node)default voidinsertChild(Node child, int index)default booleanisAutocompleteTerminal()Overridden manually for nodes who can "have a cursor on them" with respect to autocomplete.default booleanisChildOf(Node best)booleanisWellFormed()java.lang.ObjectjjtAccept(ChunkerVisitor visitor, java.lang.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.NodejjtGetChild(int i)This method returns a child node.TokenjjtGetFirstToken()TokenjjtGetLastToken()intjjtGetNumChildren()Return the number of children the node has.NodejjtGetParent()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 voidmaybeDetach()voidremoveChild(Node node)default Noderescope(java.util.List<IsScope> scope)default voidsetScope(java.util.List<IsScope> scope)default io.deephaven.web.shared.fu.LinkedIterable<Token>tokens(boolean strict)default io.deephaven.web.shared.fu.LinkedIterable<Token>tokensReversed(boolean strict)default java.lang.StringtoSource()
-
-
-
Method Detail
-
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
void jjtSetParent(Node n)
This pair of methods are used to inform the node of its parent.
-
jjtGetParent
Node jjtGetParent()
-
jjtAddChild
void jjtAddChild(Node n, int i)
This method tells the node to add its argument to the node's list of children.
-
jjtInsertChild
void jjtInsertChild(Node n, int i)
This method inserts the specified node at the given index, shifting any existing items to the right.
-
jjtGetChild
Node jjtGetChild(int i)
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
void jjtSetFirstToken(Token token)
-
jjtGetLastToken
Token jjtGetLastToken()
-
jjtSetLastToken
void jjtSetLastToken(Token token)
-
tokens
default io.deephaven.web.shared.fu.LinkedIterable<Token> tokens(boolean strict)
-
tokensReversed
default io.deephaven.web.shared.fu.LinkedIterable<Token> tokensReversed(boolean strict)
-
addToken
default void addToken(Token token)
-
setScope
default void setScope(java.util.List<IsScope> scope)
-
jjtAccept
java.lang.Object jjtAccept(ChunkerVisitor visitor, java.lang.Object data)
Accept the visitor.
-
adopt
void adopt(Node node)
-
containsIndex
default boolean containsIndex(int i)
-
isChildOf
default boolean isChildOf(Node best)
-
toSource
default java.lang.String toSource()
-
append
default void append(java.lang.StringBuilder b, Token tok)
-
getEndIndex
default int getEndIndex()
-
getStartIndex
default int getStartIndex()
-
getChildren
java.util.List<Node> 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
default void addChild(Node child)
-
addChild
default void addChild(Node child, int index)
-
insertChild
default void insertChild(Node child, int index)
-
addScope
default void addScope(IsScope scope)
-
addScope
default void addScope(java.util.List<IsScope> scope)
-
maybeDetach
default void maybeDetach()
-
removeChild
void removeChild(Node node)
-
indexOf
int indexOf(Node node)
-
asRange
default io.deephaven.proto.backplane.script.grpc.DocumentRange.Builder asRange()
-
containsLines
default boolean containsLines(int winStartLine, int winEndLine)
-
contains
default boolean contains(io.deephaven.proto.backplane.script.grpc.Position pos)
-
findToken
default Token findToken(io.deephaven.proto.backplane.script.grpc.PositionOrBuilder requested)
-
distanceTo
default int distanceTo(int offset)
-
-