com.sonar.sslr.api
Class RecognitionException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.sonar.sslr.api.RecognitionException
- All Implemented Interfaces:
- java.io.Serializable
public class RecognitionException
- extends java.lang.RuntimeException
If a parsing error is encountered, an exception which implements this RecognitionException is thrown by the Parser. This
RecognitionException allows to get some contextual information about the parsing error like the parsing stack trace.
- See Also:
- Serialized Form
Constructor Summary |
RecognitionException(com.sonar.sslr.impl.events.ExtendedStackTrace extendedStackTrace,
boolean isFatal)
|
RecognitionException(com.sonar.sslr.impl.LexerException e)
|
RecognitionException(com.sonar.sslr.impl.ParsingState parsingState,
boolean isFatal)
|
RecognitionException(java.lang.String message,
com.sonar.sslr.impl.ParsingState parsingState,
boolean isFatal,
java.lang.Throwable e)
|
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
RecognitionException
public RecognitionException(com.sonar.sslr.impl.ParsingState parsingState,
boolean isFatal)
RecognitionException
public RecognitionException(java.lang.String message,
com.sonar.sslr.impl.ParsingState parsingState,
boolean isFatal,
java.lang.Throwable e)
RecognitionException
public RecognitionException(com.sonar.sslr.impl.events.ExtendedStackTrace extendedStackTrace,
boolean isFatal)
RecognitionException
public RecognitionException(com.sonar.sslr.impl.LexerException e)
getLine
public int getLine()
- Line where the parsing error has occurred.
- Returns:
- line
isToRetryWithExtendStackTrace
public boolean isToRetryWithExtendStackTrace()
- Returns:
- Whether or not it is worth to retry the parsing with the extended stack trace enabled.
isFatal
public boolean isFatal()
- Returns:
- True if this recognition exception is a fatal one (i.e. not in recovery mode).
Copyright © 2012 SonarSource. All Rights Reserved.