Methods Summary |
---|
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).
int la = super.LA(i);
parserEventSupport.fireLA(i, la);
return la;
|
public void | addMessageListener(persistence.antlr.debug.MessageListener l)
parserEventSupport.addMessageListener(l);
|
public void | addParserListener(persistence.antlr.debug.ParserListener l)
parserEventSupport.addParserListener(l);
|
public void | addParserMatchListener(persistence.antlr.debug.ParserMatchListener l)
parserEventSupport.addParserMatchListener(l);
|
public void | addParserTokenListener(persistence.antlr.debug.ParserTokenListener l)
parserEventSupport.addParserTokenListener(l);
|
public void | addSemanticPredicateListener(persistence.antlr.debug.SemanticPredicateListener l)
parserEventSupport.addSemanticPredicateListener(l);
|
public void | addSyntacticPredicateListener(persistence.antlr.debug.SyntacticPredicateListener l)
parserEventSupport.addSyntacticPredicateListener(l);
|
public void | addTraceListener(persistence.antlr.debug.TraceListener l)
parserEventSupport.addTraceListener(l);
|
public void | consume()Get another token object from the token stream
int la_1 = -99;
try {la_1 = LA(1);}
catch (TokenStreamException ignoreAnException) {}
super.consume();
parserEventSupport.fireConsume(la_1);
|
protected void | fireEnterRule(int num, int data)
if (isDebugMode())
parserEventSupport.fireEnterRule(num,inputState.guessing,data);
|
protected void | fireExitRule(int num, int data)
if (isDebugMode())
parserEventSupport.fireExitRule(num,inputState.guessing,data);
|
protected boolean | fireSemanticPredicateEvaluated(int type, int num, boolean condition)
if (isDebugMode())
return parserEventSupport.fireSemanticPredicateEvaluated(type,num,condition,inputState.guessing);
else
return condition;
|
protected void | fireSyntacticPredicateFailed()
if (isDebugMode())
parserEventSupport.fireSyntacticPredicateFailed(inputState.guessing);
|
protected void | fireSyntacticPredicateStarted()
if (isDebugMode())
parserEventSupport.fireSyntacticPredicateStarted(inputState.guessing);
|
protected void | fireSyntacticPredicateSucceeded()
if (isDebugMode())
parserEventSupport.fireSyntacticPredicateSucceeded(inputState.guessing);
|
public java.lang.String | getRuleName(int num)
return ruleNames[num];
|
public java.lang.String | getSemPredName(int num)
return semPredNames[num];
|
public synchronized void | goToSleep()
try {wait();}
catch (InterruptedException e) { }
|
public boolean | isDebugMode()
return !_notDebugMode;
|
public boolean | isGuessing()
return inputState.guessing > 0;
|
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.
String text = LT(1).getText();
int la_1 = LA(1);
try {
super.match(t);
parserEventSupport.fireMatch(t, text, inputState.guessing);
}
catch (MismatchedTokenException e) {
if (inputState.guessing == 0)
parserEventSupport.fireMismatch(la_1, t, text, inputState.guessing);
throw e;
}
|
public void | match(persistence.antlr.collections.impl.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.
String text = LT(1).getText();
int la_1 = LA(1);
try {
super.match(b);
parserEventSupport.fireMatch(la_1,b, text, inputState.guessing);
}
catch (MismatchedTokenException e) {
if (inputState.guessing == 0)
parserEventSupport.fireMismatch(la_1, b, text, inputState.guessing);
throw e;
}
|
public void | matchNot(int t)
String text = LT(1).getText();
int la_1 = LA(1);
try {
super.matchNot(t);
parserEventSupport.fireMatchNot(la_1, t, text, inputState.guessing);
}
catch (MismatchedTokenException e) {
if (inputState.guessing == 0)
parserEventSupport.fireMismatchNot(la_1, t, text, inputState.guessing);
throw e;
}
|
public void | removeMessageListener(persistence.antlr.debug.MessageListener l)
parserEventSupport.removeMessageListener(l);
|
public void | removeParserListener(persistence.antlr.debug.ParserListener l)
parserEventSupport.removeParserListener(l);
|
public void | removeParserMatchListener(persistence.antlr.debug.ParserMatchListener l)
parserEventSupport.removeParserMatchListener(l);
|
public void | removeParserTokenListener(persistence.antlr.debug.ParserTokenListener l)
parserEventSupport.removeParserTokenListener(l);
|
public void | removeSemanticPredicateListener(persistence.antlr.debug.SemanticPredicateListener l)
parserEventSupport.removeSemanticPredicateListener(l);
|
public void | removeSyntacticPredicateListener(persistence.antlr.debug.SyntacticPredicateListener l)
parserEventSupport.removeSyntacticPredicateListener(l);
|
public void | removeTraceListener(persistence.antlr.debug.TraceListener l)
parserEventSupport.removeTraceListener(l);
|
public void | reportError(persistence.antlr.RecognitionException ex)Parser error-reporting function can be overridden in subclass
parserEventSupport.fireReportError(ex);
super.reportError(ex);
|
public void | reportError(java.lang.String s)Parser error-reporting function can be overridden in subclass
parserEventSupport.fireReportError(s);
super.reportError(s);
|
public void | reportWarning(java.lang.String s)Parser warning-reporting function can be overridden in subclass
parserEventSupport.fireReportWarning(s);
super.reportWarning(s);
|
public void | setDebugMode(boolean value)
_notDebugMode = !value;
|
public void | setupDebugging(persistence.antlr.TokenBuffer tokenBuf)
setupDebugging(null, tokenBuf);
|
public void | setupDebugging(persistence.antlr.TokenStream lexer)
setupDebugging(lexer, null);
|
protected void | setupDebugging(persistence.antlr.TokenStream lexer, persistence.antlr.TokenBuffer tokenBuf)User can override to do their own debugging
setDebugMode(true);
// default parser debug setup is ParseView
try {
try {
Class.forName("javax.swing.JButton");
}
catch (ClassNotFoundException e) {
System.err.println("Swing is required to use ParseView, but is not present in your CLASSPATH");
System.exit(1);
}
Class c = Class.forName("antlr.parseview.ParseView");
Constructor constructor = c.getConstructor(new Class[] {LLkDebuggingParser.class, TokenStream.class, TokenBuffer.class});
constructor.newInstance(new Object[] {this, lexer, tokenBuf});
}
catch(Exception e) {
System.err.println("Error initializing ParseView: "+e);
System.err.println("Please report this to Scott Stanchfield, thetick@magelang.com");
System.exit(1);
}
|
public synchronized void | wakeUp()
notify();
|