antlr.debug

Class LLkDebuggingParser

public class LLkDebuggingParser extends LLkParser implements DebuggingParser

Field Summary
protected ParserEventSupportparserEventSupport
protected String[]ruleNames
protected String[]semPredNames
Constructor Summary
LLkDebuggingParser(int k_)
LLkDebuggingParser(ParserSharedInputState state, int k_)
LLkDebuggingParser(TokenBuffer tokenBuf, int k_)
LLkDebuggingParser(TokenStream lexer, int k_)
Method Summary
voidaddMessageListener(MessageListener l)
voidaddParserListener(ParserListener l)
voidaddParserMatchListener(ParserMatchListener l)
voidaddParserTokenListener(ParserTokenListener l)
voidaddSemanticPredicateListener(SemanticPredicateListener l)
voidaddSyntacticPredicateListener(SyntacticPredicateListener l)
voidaddTraceListener(TraceListener l)
voidconsume()
Get another token object from the token stream
protected voidfireEnterRule(int num, int data)
protected voidfireExitRule(int num, int data)
protected booleanfireSemanticPredicateEvaluated(int type, int num, boolean condition)
protected voidfireSyntacticPredicateFailed()
protected voidfireSyntacticPredicateStarted()
protected voidfireSyntacticPredicateSucceeded()
StringgetRuleName(int num)
StringgetSemPredName(int num)
voidgoToSleep()
booleanisDebugMode()
booleanisGuessing()
intLA(int i)
Return the token type of the ith token of lookahead where i=1 is the current token being examined by the parser (i.e., it has not been matched yet).
voidmatch(int t)
Make sure current lookahead symbol matches token type t.
voidmatch(BitSet b)
Make sure current lookahead symbol matches the given set Throw an exception upon mismatch, which is catch by either the error handler or by the syntactic predicate.
voidmatchNot(int t)
voidremoveMessageListener(MessageListener l)
voidremoveParserListener(ParserListener l)
voidremoveParserMatchListener(ParserMatchListener l)
voidremoveParserTokenListener(ParserTokenListener l)
voidremoveSemanticPredicateListener(SemanticPredicateListener l)
voidremoveSyntacticPredicateListener(SyntacticPredicateListener l)
voidremoveTraceListener(TraceListener l)
voidreportError(RecognitionException ex)
Parser error-reporting function can be overridden in subclass
voidreportError(String s)
Parser error-reporting function can be overridden in subclass
voidreportWarning(String s)
Parser warning-reporting function can be overridden in subclass
voidsetDebugMode(boolean value)
voidsetupDebugging(TokenBuffer tokenBuf)
voidsetupDebugging(TokenStream lexer)
protected voidsetupDebugging(TokenStream lexer, TokenBuffer tokenBuf)
User can override to do their own debugging
voidwakeUp()

Field Detail

parserEventSupport

protected ParserEventSupport parserEventSupport

ruleNames

protected String[] ruleNames

semPredNames

protected String[] semPredNames

Constructor Detail

LLkDebuggingParser

public LLkDebuggingParser(int k_)

LLkDebuggingParser

public LLkDebuggingParser(ParserSharedInputState state, int k_)

LLkDebuggingParser

public LLkDebuggingParser(TokenBuffer tokenBuf, int k_)

LLkDebuggingParser

public LLkDebuggingParser(TokenStream lexer, int k_)

Method Detail

addMessageListener

public void addMessageListener(MessageListener l)

addParserListener

public void addParserListener(ParserListener l)

addParserMatchListener

public void addParserMatchListener(ParserMatchListener l)

addParserTokenListener

public void addParserTokenListener(ParserTokenListener l)

addSemanticPredicateListener

public void addSemanticPredicateListener(SemanticPredicateListener l)

addSyntacticPredicateListener

public void addSyntacticPredicateListener(SyntacticPredicateListener l)

addTraceListener

public void addTraceListener(TraceListener l)

consume

public void consume()
Get another token object from the token stream

fireEnterRule

protected void fireEnterRule(int num, int data)

fireExitRule

protected void fireExitRule(int num, int data)

fireSemanticPredicateEvaluated

protected boolean fireSemanticPredicateEvaluated(int type, int num, boolean condition)

fireSyntacticPredicateFailed

protected void fireSyntacticPredicateFailed()

fireSyntacticPredicateStarted

protected void fireSyntacticPredicateStarted()

fireSyntacticPredicateSucceeded

protected void fireSyntacticPredicateSucceeded()

getRuleName

public String getRuleName(int num)

getSemPredName

public String getSemPredName(int num)

goToSleep

public void goToSleep()

isDebugMode

public boolean isDebugMode()

isGuessing

public boolean isGuessing()

LA

public int LA(int i)
Return the token type of the ith token of lookahead where i=1 is the current token being examined by the parser (i.e., it has not been matched yet).

match

public void match(int t)
Make sure current lookahead symbol matches token type t. Throw an exception upon mismatch, which is catch by either the error handler or by the syntactic predicate.

match

public void match(BitSet b)
Make sure current lookahead symbol matches the given set Throw an exception upon mismatch, which is catch by either the error handler or by the syntactic predicate.

matchNot

public void matchNot(int t)

removeMessageListener

public void removeMessageListener(MessageListener l)

removeParserListener

public void removeParserListener(ParserListener l)

removeParserMatchListener

public void removeParserMatchListener(ParserMatchListener l)

removeParserTokenListener

public void removeParserTokenListener(ParserTokenListener l)

removeSemanticPredicateListener

public void removeSemanticPredicateListener(SemanticPredicateListener l)

removeSyntacticPredicateListener

public void removeSyntacticPredicateListener(SyntacticPredicateListener l)

removeTraceListener

public void removeTraceListener(TraceListener l)

reportError

public void reportError(RecognitionException ex)
Parser error-reporting function can be overridden in subclass

reportError

public void reportError(String s)
Parser error-reporting function can be overridden in subclass

reportWarning

public void reportWarning(String s)
Parser warning-reporting function can be overridden in subclass

setDebugMode

public void setDebugMode(boolean value)

setupDebugging

public void setupDebugging(TokenBuffer tokenBuf)

setupDebugging

public void setupDebugging(TokenStream lexer)

setupDebugging

protected void setupDebugging(TokenStream lexer, TokenBuffer tokenBuf)
User can override to do their own debugging

wakeUp

public void wakeUp()