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(Token t)
      • GrammarAST

        public GrammarAST(int type,
                          Token t)
      • GrammarAST

        public GrammarAST(int type,
                          Token t,
                          String text)
    • Method Detail

      • 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 CommonTree getFirstDescendantWithType(int type)
      • getFirstDescendantWithType

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

        public void setType(int type)
      • setText

        public void setText(String text)
      • toTokenString

        public String toTokenString()