Class ExtendedTerminalNode

java.lang.Object
org.antlr.v4.runtime.tree.TerminalNodeImpl
io.github.douira.glsl_transformer.tree.ExtendedTerminalNode
All Implemented Interfaces:
TreeMember, ParseTree, SyntaxTree, TerminalNode, Tree
Direct Known Subclasses:
ASTNode, EmptyTerminalNode

public class ExtendedTerminalNode extends TerminalNodeImpl implements TreeMember
The extended terminal node has additional functionality over the regular terminal node. Most importantly, it implements the functionality required to be a tree member.
  • Constructor Details

    • ExtendedTerminalNode

      public ExtendedTerminalNode(ParserRuleContext parent, Token symbol)
      Creates a new extended terminal node with a parent node and a token as the symbol.
      Parameters:
      parent - The parent node. This is a parser rule context because the parser passes a parser rule context when it creates new terminal nodes.
      symbol - The token to contain with this terminal node
    • ExtendedTerminalNode

      public ExtendedTerminalNode(ExtendedContext parent)
      Creates a null-token terminal node that has an extended context as a parent. This should only be used when the node is a placeholder for something. It will not be printed since the token is null.
      Parameters:
      parent - The parent node
    • ExtendedTerminalNode

      public ExtendedTerminalNode()
      Creates a null-token and parentless terminal node. This is to be used when the node is a placeholder and it will be added to a parse tree node. Adding it as a child using the node's method will attach it as a parent.
  • Method Details