Class EmptyTerminalNode

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

public class EmptyTerminalNode extends ExtendedTerminalNode implements MoveCheckable
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

    Constructors
    Constructor
    Description
    Creates a new empty terminal node with a given previous node.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    replacesNode(org.antlr.v4.runtime.tree.ParseTree node)
    Checks if the implementing object was inserted into the tree to replace the given node.

    Methods inherited from class io.github.douira.glsl_transformer.generic.ExtendedTerminalNode

    getParent, omitTokens

    Methods inherited from class org.antlr.v4.runtime.tree.TerminalNodeImpl

    accept, getChild, getChildCount, getPayload, getSourceInterval, getSymbol, getText, setParent, toString, toStringTree, toStringTree

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.antlr.v4.runtime.tree.ParseTree

    accept, getChild, getText, setParent, toStringTree

    Methods inherited from interface org.antlr.v4.runtime.tree.SyntaxTree

    getSourceInterval

    Methods inherited from interface org.antlr.v4.runtime.tree.Tree

    getChildCount, getPayload, toStringTree
  • Constructor Details

    • EmptyTerminalNode

      public EmptyTerminalNode(TreeMember previousNode)
      Creates a new empty terminal node with a given previous node.
      Parameters:
      previousNode - The previous node to keep a reference to
  • Method Details

    • replacesNode

      public boolean replacesNode(org.antlr.v4.runtime.tree.ParseTree node)
      Description copied from interface: MoveCheckable
      Checks if the implementing object was inserted into the tree to replace the given node. This is used to check if an empty terminal node replaced this node in the parse tree.
      Specified by:
      replacesNode in interface MoveCheckable
      Parameters:
      node - The node to check for having been replaced by this node
      Returns:
      true if this node replaced the given node