Class GrammarAST

    • Field Detail

      • 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 Detail

      • 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 Detail

      • getChildrenAsArray

        public GrammarAST[] getChildrenAsArray()
      • getNodesWithType

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

        public List<GrammarAST> getAllChildrenWithType​(int type)
      • 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
        dupNode in class org.antlr.runtime.tree.CommonTree
      • toTokenString

        public String toTokenString()