Package antlr.debug

Class ParseTreeDebugParser

java.lang.Object
antlr.Parser
antlr.LLkParser
antlr.debug.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 Details

    • currentParseTreeRoot

      protected 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 Details

    • ParseTreeDebugParser

      public ParseTreeDebugParser(int k_)
    • ParseTreeDebugParser

      public ParseTreeDebugParser(ParserSharedInputState state, int k_)
    • ParseTreeDebugParser

      public ParseTreeDebugParser(TokenBuffer tokenBuf, int k_)
    • ParseTreeDebugParser

      public ParseTreeDebugParser(TokenStream lexer, int k_)
  • Method Details