Package 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
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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.stringtemplate.v4.ST
Return a new template instance for the location part of a Message.org.stringtemplate.v4.ST
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) toString
(org.stringtemplate.v4.ST messageST)
-
Field Details
-
msgST
public org.stringtemplate.v4.ST msgST -
locationST
public org.stringtemplate.v4.ST locationST -
reportST
public org.stringtemplate.v4.ST reportST -
messageFormatST
public org.stringtemplate.v4.ST messageFormatST -
msgID
public int msgID -
arg
-
arg2
-
e
-
file
-
line
public int line -
column
public int column
-
-
Constructor Details
-
Message
public Message() -
Message
public Message(int msgID) -
Message
-
-
Method Details
-
setLine
public void setLine(int line) -
setColumn
public void setColumn(int column) -
setMessageID
public void setMessageID(int msgID) -
getMessageTemplate
public org.stringtemplate.v4.ST getMessageTemplate()Return a new template instance every time someone tries to print a Message. -
getLocationTemplate
public org.stringtemplate.v4.ST getLocationTemplate()Return a new template instance for the location part of a Message. TODO: Is this really necessary? -Kay -
toString
-