public class SLTranslationExceptionManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private int |
column |
private java.lang.String |
fileName |
private int |
line |
private Position |
offsetPos |
Constructor and Description |
---|
SLTranslationExceptionManager(org.antlr.runtime.Parser parser,
java.lang.String fileName,
Position offsetPos) |
Modifier and Type | Method and Description |
---|---|
SLTranslationException |
convertException(org.antlr.runtime.RecognitionException e)
Converts an ANTLRException into an SLTranslationException with the same
message and stack trace, and with current absolute position information.
|
SLTranslationException |
convertException(java.lang.String message,
org.antlr.runtime.RecognitionException e) |
private Position |
createAbsolutePosition(int relativeLine,
int relativeColumn) |
private Position |
createAbsolutePosition(Position pos) |
SLTranslationException |
createException(java.lang.String message)
Creates an SLTranslationException with current absolute position
information.
|
SLTranslationException |
createException(java.lang.String message,
java.lang.Throwable cause)
Creates an SLTranslationException with current absolute position
information.
|
SLTranslationException |
createException(java.lang.String message,
org.antlr.runtime.Token t)
Creates an SLTranslationException with the position information of the
passed token.
|
SLTranslationException |
createException(java.lang.String message,
org.antlr.runtime.Token t,
java.lang.Throwable cause)
Creates an SLTranslationException with the position information of the
passed token.
|
private java.lang.String |
createMessage(org.antlr.runtime.RecognitionException e,
Position pos)
Create a message from a
RecognitionException . |
PositionedString |
createPositionedString(java.lang.String text)
Creates a string with the current absolute position information
|
PositionedString |
createPositionedString(java.lang.String text,
Position pos)
Creates a string with position information from the given relative
position.
|
PositionedString |
createPositionedString(java.lang.String text,
org.antlr.runtime.Token t)
Creates a string with the position information of the passed token.
|
SLTranslationException |
createWarningException(java.lang.String message)
Creates an SLWarningException with current absolute position
information.
|
SLTranslationException |
createWarningException(java.lang.String message,
org.antlr.runtime.Token t) |
private final java.lang.String fileName
private final Position offsetPos
private final int line
private final int column
public SLTranslationExceptionManager(org.antlr.runtime.Parser parser, java.lang.String fileName, Position offsetPos)
private Position createAbsolutePosition(int relativeLine, int relativeColumn)
public PositionedString createPositionedString(java.lang.String text, org.antlr.runtime.Token t)
public PositionedString createPositionedString(java.lang.String text, Position pos)
text
- the String
pos
- the Position
text
as PositionedString
with absolute
position in the current filepublic PositionedString createPositionedString(java.lang.String text)
public SLTranslationException createException(java.lang.String message)
public SLTranslationException createException(java.lang.String message, org.antlr.runtime.Token t)
public SLTranslationException createException(java.lang.String message, java.lang.Throwable cause)
public SLTranslationException createException(java.lang.String message, org.antlr.runtime.Token t, java.lang.Throwable cause)
cause
- the exception which causes the new exception to be created.public SLTranslationException createWarningException(java.lang.String message)
public SLTranslationException createWarningException(java.lang.String message, org.antlr.runtime.Token t)
private java.lang.String createMessage(org.antlr.runtime.RecognitionException e, Position pos)
RecognitionException
. This needs to be
done manually because antlr exceptions are not designed to provide error
messages, see: http://www.antlr3.org/api/ActionScript/org/antlr/runtime/
RecognitionException.htmlpublic SLTranslationException convertException(org.antlr.runtime.RecognitionException e)
public SLTranslationException convertException(java.lang.String message, org.antlr.runtime.RecognitionException e)