Class ASTNode
java.lang.Object
io.github.douira.glsl_transformer.ast.node.basic.ASTNode
- Direct Known Subclasses:
Identifier,InnerASTNode,VersionStatement
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract <R> Raccept(ASTVisitor<R> visitor) voidTo be called after removing this node from its parent.getFirstOfType(int limit, Class<? extends ASTNode> type) getFirstParentOfType(int limit, Class<? extends ASTNode> type) getNthParent(int n) getRoot()booleanbooleanreplaceInParent(ASTNode replacement) booleanSets the parent of this node and handles registration.<NodeType extends ASTNode>
NodeType<NodeType extends ASTNode>
voidupdateParents(NodeType currentNode, NodeType newNode, Consumer<? extends NodeType> setter)
-
Constructor Details
-
ASTNode
public ASTNode()
-
-
Method Details
-
accept
-
getParent
-
getParentSetter
-
replaceInParent
-
removeFromParent
public boolean removeFromParent() -
getNthParent
-
getFirstOfType
-
getFirstParentOfType
-
getRoot
-
setParent
Sets the parent of this node and handles registration.- Parameters:
parent- The parent value to set, cannot be null.- Returns:
trueif the parent was changed,falseotherwise.
-
detachFromParent
public void detachFromParent()To be called after removing this node from its parent. This unregisters it and all its children from the parent's root. Use a simplesetParent(ASTNode, Consumer)to move a subtree from one node to the other. -
setup
-
updateParents
-