Class ParserEx
- java.lang.Object
-
- org.antlr.runtime.BaseRecognizer
-
- org.antlr.runtime.Parser
-
- ru.ispras.microtesk.translator.antlrex.ParserEx
-
- All Implemented Interfaces:
ErrorReporter
- Direct Known Subclasses:
ParserBase
public class ParserEx extends org.antlr.runtime.Parser implements ErrorReporter
The ParserEx class is an extension of the ANTLR library class Parser that provides means of error reporting based on MicroTESK library classes facilitating logging.
-
-
Constructor Summary
Constructors Constructor Description ParserEx(org.antlr.runtime.TokenStream input, org.antlr.runtime.RecognizerSharedState state)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
assignLog(LogStore log)
protected void
checkNotNull(org.antlr.runtime.Token token, java.lang.Object object)
protected void
checkNotNull(org.antlr.runtime.Token token, java.lang.Object object, java.lang.String text)
void
emitErrorMessage(java.lang.String errorMessage)
int
getErrorCount()
boolean
isCorrect()
void
raiseError(Where where, java.lang.String what)
void
raiseError(Where where, ISemanticError error)
void
reportError(org.antlr.runtime.RecognitionException re)
void
reportError(SemanticException se)
void
resetErrorCount()
protected Where
where(org.antlr.runtime.Token token)
-
Methods inherited from class org.antlr.runtime.Parser
getCurrentInputSymbol, getMissingSymbol, getSourceName, getTokenStream, reset, setTokenStream, traceIn, traceOut
-
Methods inherited from class org.antlr.runtime.BaseRecognizer
alreadyParsedRule, beginResync, combineFollows, computeContextSensitiveRuleFOLLOW, computeErrorRecoverySet, consumeUntil, consumeUntil, displayRecognitionError, endResync, failed, getBacktrackingLevel, getErrorHeader, getErrorMessage, getGrammarFileName, getNumberOfSyntaxErrors, getRuleInvocationStack, getRuleInvocationStack, getRuleMemoization, getRuleMemoizationCacheSize, getTokenErrorDisplay, getTokenNames, match, matchAny, memoize, mismatchIsMissingToken, mismatchIsUnwantedToken, pushFollow, recover, recoverFromMismatchedSet, recoverFromMismatchedToken, setBacktrackingLevel, toStrings, traceIn, traceOut
-
-
-
-
Method Detail
-
assignLog
public void assignLog(LogStore log)
-
reportError
public final void reportError(org.antlr.runtime.RecognitionException re)
- Overrides:
reportError
in classorg.antlr.runtime.BaseRecognizer
-
reportError
public final void reportError(SemanticException se)
-
emitErrorMessage
public final void emitErrorMessage(java.lang.String errorMessage)
- Overrides:
emitErrorMessage
in classorg.antlr.runtime.BaseRecognizer
-
getErrorCount
public final int getErrorCount()
-
resetErrorCount
public final void resetErrorCount()
-
isCorrect
public final boolean isCorrect()
-
raiseError
public void raiseError(Where where, ISemanticError error) throws SemanticException
- Specified by:
raiseError
in interfaceErrorReporter
- Throws:
SemanticException
-
raiseError
public void raiseError(Where where, java.lang.String what) throws SemanticException
- Specified by:
raiseError
in interfaceErrorReporter
- Throws:
SemanticException
-
where
protected final Where where(org.antlr.runtime.Token token)
-
checkNotNull
protected final void checkNotNull(org.antlr.runtime.Token token, java.lang.Object object) throws SemanticException
- Throws:
SemanticException
-
checkNotNull
protected final void checkNotNull(org.antlr.runtime.Token token, java.lang.Object object, java.lang.String text) throws SemanticException
- Throws:
SemanticException
-
-