Custom error messages

18 views
Skip to first unread message

mv...@cin.ufpe.br

unread,
Jul 5, 2017, 4:43:33 PM7/5/17
to antlr-discussion
hello 
I am trying to do my own errors messages. but what I want is the same as the antlr already do for me.
Precisily, I can't get the messages for literals I am "expecting" like:

line 1:0 missing 'connectors' at 'connector' (this one was generate by antlr)

How can I do that? I need that "string" because I want to print it in a GUI I have developed.

thanks 

Mike Lischke

unread,
Jul 11, 2017, 7:11:10 AM7/11/17
to antlr-di...@googlegroups.com
Hi,

You could just look up the message construction in ANTLR's code. It's essentially a combination of token lookup and Vocabulary.getDisplayName().

--
You received this message because you are subscribed to the Google Groups "antlr-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to antlr-discussi...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages