org.antlr.tool
Class Message
java.lang.Object
org.antlr.tool.Message
- Direct Known Subclasses:
- GrammarAnalysisAbortedMessage, GrammarDanglingStateMessage, GrammarInsufficientPredicatesMessage, GrammarNonDeterminismMessage, GrammarSemanticsMessage, GrammarSyntaxMessage, GrammarUnreachableAltsMessage, LeftRecursionCyclesMessage, NonRegularDecisionMessage, RecursionOverflowMessage, ToolMessage
public abstract class Message
- extends java.lang.Object
The ANTLR code calls methods on ErrorManager to report errors etc...
Rather than simply pass these arguments to the ANTLRErrorListener directly,
create an object that encapsulates everything. In this way, the error
listener interface does not have to change when I add a new kind of
error message. I don't want to break a GUI for example every time
I update the error system in ANTLR itself.
To get a printable error/warning message, call toString().
Field Summary |
java.lang.Object |
arg
|
java.lang.Object |
arg2
|
int |
column
|
java.lang.Throwable |
e
|
java.lang.String |
file
|
int |
line
|
org.antlr.stringtemplate.StringTemplate |
locationST
|
org.antlr.stringtemplate.StringTemplate |
messageFormatST
|
int |
msgID
|
org.antlr.stringtemplate.StringTemplate |
msgST
|
org.antlr.stringtemplate.StringTemplate |
reportST
|
Constructor Summary |
Message()
|
Message(int msgID)
|
Message(int msgID,
java.lang.Object arg,
java.lang.Object arg2)
|
Method Summary |
org.antlr.stringtemplate.StringTemplate |
getLocationTemplate()
Return a new template instance for the location part of a Message. |
org.antlr.stringtemplate.StringTemplate |
getMessageTemplate()
Return a new template instance every time someone tries to print
a Message. |
void |
setColumn(int column)
|
void |
setLine(int line)
|
void |
setMessageID(int msgID)
|
java.lang.String |
toString(org.antlr.stringtemplate.StringTemplate messageST)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
msgST
public org.antlr.stringtemplate.StringTemplate msgST
locationST
public org.antlr.stringtemplate.StringTemplate locationST
reportST
public org.antlr.stringtemplate.StringTemplate reportST
messageFormatST
public org.antlr.stringtemplate.StringTemplate messageFormatST
msgID
public int msgID
arg
public java.lang.Object arg
arg2
public java.lang.Object arg2
e
public java.lang.Throwable e
file
public java.lang.String file
line
public int line
column
public int column
Message
public Message()
Message
public Message(int msgID)
Message
public Message(int msgID,
java.lang.Object arg,
java.lang.Object arg2)
setLine
public void setLine(int line)
setColumn
public void setColumn(int column)
setMessageID
public void setMessageID(int msgID)
getMessageTemplate
public org.antlr.stringtemplate.StringTemplate getMessageTemplate()
- Return a new template instance every time someone tries to print
a Message.
getLocationTemplate
public org.antlr.stringtemplate.StringTemplate getLocationTemplate()
- Return a new template instance for the location part of a Message.
TODO: Is this really necessary? -Kay
toString
public java.lang.String toString(org.antlr.stringtemplate.StringTemplate messageST)
Copyright © 2011. All Rights Reserved.