Class EmptyTerminalNode
java.lang.Object
org.antlr.v4.runtime.tree.TerminalNodeImpl
io.github.douira.glsl_transformer.tree.ExtendedTerminalNode
io.github.douira.glsl_transformer.cst.print.EmptyTerminalNode
- All Implemented Interfaces:
MoveCheckable,TreeMember,ParseTree,SyntaxTree,TerminalNode,Tree
The empty terminal node is a placeholder in parse tree children lists in
order to prevent exceptions from being thrown because the parse tree walker
expects child lists not to change length during iteration. The print visitor
ignores it during printing because it's token is null.
-
Field Summary
Fields inherited from class org.antlr.v4.runtime.tree.TerminalNodeImpl
parent, symbol -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new empty terminal node.EmptyTerminalNode(TreeMember previousNode) Creates a new empty terminal node with a given previous node. -
Method Summary
Methods inherited from class io.github.douira.glsl_transformer.tree.ExtendedTerminalNode
getParent, getPreviousNode, processRemoval, setPreviousNodeMethods inherited from class org.antlr.v4.runtime.tree.TerminalNodeImpl
accept, getChild, getChildCount, getPayload, getSourceInterval, getSymbol, getText, setParent, toString, toStringTree, toStringTreeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.antlr.v4.runtime.tree.ParseTree
accept, getChild, getText, setParent, toStringTreeMethods inherited from interface org.antlr.v4.runtime.tree.SyntaxTree
getSourceIntervalMethods inherited from interface org.antlr.v4.runtime.tree.Tree
getChildCount, getPayload, toStringTree
-
Constructor Details
-
EmptyTerminalNode
Creates a new empty terminal node with a given previous node. This method is not to be used productively as it is only for compactness in certain unusual situations (like in tests).- Parameters:
previousNode- The previous node to keep a reference to
-
EmptyTerminalNode
public EmptyTerminalNode()Creates a new empty terminal node. The previous node and parent node are set when it is inserted as a child.
-