Class GrammarAST

java.lang.Object
org.antlr.runtime.tree.BaseTree
org.antlr.runtime.tree.CommonTree
org.antlr.v4.tool.ast.GrammarAST
All Implemented Interfaces:
org.antlr.runtime.tree.Tree
Direct Known Subclasses:
GrammarASTErrorNode, GrammarASTWithOptions, NotAST, OptionalBlockAST, PlusBlockAST, RangeAST, SetAST, StarBlockAST

public class GrammarAST extends org.antlr.runtime.tree.CommonTree
  • Field Details

    • g

      public Grammar g
      For error msgs, nice to know which grammar this AST lives in
    • atnState

      public ATNState atnState
      If we build an ATN, we make AST node point at left edge of ATN construct
    • textOverride

      public String textOverride
  • Constructor Details

    • GrammarAST

      public GrammarAST()
    • GrammarAST

      public GrammarAST(org.antlr.runtime.Token t)
    • GrammarAST

      public GrammarAST(GrammarAST node)
    • GrammarAST

      public GrammarAST(int type)
    • GrammarAST

      public GrammarAST(int type, org.antlr.runtime.Token t)
    • GrammarAST

      public GrammarAST(int type, org.antlr.runtime.Token t, String text)
  • Method Details

    • getChildrenAsArray

      public GrammarAST[] getChildrenAsArray()
    • getNodesWithType

      public List<GrammarAST> getNodesWithType(int ttype)
    • getAllChildrenWithType

      public List<GrammarAST> getAllChildrenWithType(int type)
    • getNodesWithType

      public List<GrammarAST> getNodesWithType(IntervalSet types)
    • getNodesWithTypePreorderDFS

      public List<GrammarAST> getNodesWithTypePreorderDFS(IntervalSet types)
    • getNodesWithTypePreorderDFS_

      public void getNodesWithTypePreorderDFS_(List<GrammarAST> nodes, IntervalSet types)
    • getNodeWithTokenIndex

      public GrammarAST getNodeWithTokenIndex(int index)
    • getOutermostAltNode

      public AltAST getOutermostAltNode()
    • getAltLabel

      public String getAltLabel()
      Walk ancestors of this node until we find ALT with alt!=null or leftRecursiveAltInfo!=null. Then grab label if any. If not a rule element, just returns null.
    • deleteChild

      public boolean deleteChild(org.antlr.runtime.tree.Tree t)
    • getFirstDescendantWithType

      public org.antlr.runtime.tree.CommonTree getFirstDescendantWithType(int type)
    • getFirstDescendantWithType

      public org.antlr.runtime.tree.CommonTree getFirstDescendantWithType(org.antlr.runtime.BitSet types)
    • setType

      public void setType(int type)
    • setText

      public void setText(String text)
    • dupNode

      public GrammarAST dupNode()
      Specified by:
      dupNode in interface org.antlr.runtime.tree.Tree
      Overrides:
      dupNode in class org.antlr.runtime.tree.CommonTree
    • dupTree

      public GrammarAST dupTree()
    • toTokenString

      public String toTokenString()
    • visit

      public Object visit(GrammarASTVisitor v)