Package antlr.debug

Class ParseTreeDebugParser


  • public class ParseTreeDebugParser
    extends LLkParser
    Override the standard matching and rule entry/exit routines to build parse trees. This class is useful for 2.7.3 where you can specify a superclass like class TinyCParser extends Parser(ParseTreeDebugParser);
    • Field Detail

      • currentParseTreeRoot

        protected java.util.Stack currentParseTreeRoot
        Each new rule invocation must have it's own subtree. Tokens are added to the current root so we must have a stack of subtree roots.
      • mostRecentParseTreeRoot

        protected ParseTreeRule mostRecentParseTreeRoot
        Track most recently created parse subtree so that when parsing is finished, we can get to the root.
      • numberOfDerivationSteps

        protected int numberOfDerivationSteps
        For every rule replacement with a production, we bump up count.
    • Constructor Detail

      • ParseTreeDebugParser

        public ParseTreeDebugParser​(int k_)
      • ParseTreeDebugParser

        public ParseTreeDebugParser​(TokenBuffer tokenBuf,
                                    int k_)
      • ParseTreeDebugParser

        public ParseTreeDebugParser​(TokenStream lexer,
                                    int k_)