LA
public int LA(int i)
throws TokenStreamException
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).
- LA in interface LLkParser
addMessageListener
public void addMessageListener(MessageListener l)
- addMessageListener in interface Parser
addParserListener
public void addParserListener(ParserListener l)
- addParserListener in interface Parser
addTraceListener
public void addTraceListener(TraceListener l)
- addTraceListener in interface Parser
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()
goToSleep
public void goToSleep()
isDebugMode
public boolean isDebugMode()
- isDebugMode in interface Parser
isGuessing
public boolean isGuessing()
match
public void match(int t)
throws MismatchedTokenException,
TokenStreamException
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 in interface Parser
removeMessageListener
public void removeMessageListener(MessageListener l)
- removeMessageListener in interface Parser
removeParserListener
public void removeParserListener(ParserListener l)
- removeParserListener in interface Parser
removeParserMatchListener
public void removeParserMatchListener(ParserMatchListener l)
- removeParserMatchListener in interface Parser
removeParserTokenListener
public void removeParserTokenListener(ParserTokenListener l)
- removeParserTokenListener in interface Parser
removeTraceListener
public void removeTraceListener(TraceListener l)
- removeTraceListener in interface Parser
reportError
public void reportError(String s)
Parser error-reporting function can be overridden in subclass
- reportError in interface Parser
reportError
public void reportError(RecognitionException ex)
Parser error-reporting function can be overridden in subclass
- reportError in interface Parser
reportWarning
public void reportWarning(String s)
Parser warning-reporting function can be overridden in subclass
- reportWarning in interface Parser
setDebugMode
public void setDebugMode(boolean value)
- setDebugMode in interface Parser
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()