[antlr-interest] Query: customizing error messages

nilesh.kapile at tcs.com nilesh.kapile at tcs.com
Wed Mar 26 22:14:57 PDT 2008


Hello,

We are developing a translator for Business-aware language.

My query is related to Paraphrase for customizing error messages.

We can use  paraphrases in Rules to make error messages user-friendly, 
however, I could not  find a way to replace token names with user-friendly 
names.
e.g.:
 mismatched input ';' expecting ID. In this message, I want to replace ID 
with "an identifier".

ID :('a'..'z'|'A'..'Z'|'_')+('0'..'9')* ;

( options{ paraphrases = "an identifier"; } does not work. )

Any help will be highly appreciated. Thanks.

Regards,
Nilesh Sudhakar Kapile
Tata Consultancy Services
Mailto: nilesh.kapile at tcs.com
Website: http://www.tcs.com
____________________________________________
Experience certainty.   IT Services
                        Business Solutions
                        Outsourcing
____________________________________________
ForwardSourceID:NT0000EFAE 
ForwardSourceID:NT0000F00E 
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080327/aaefc8f4/attachment.html 


More information about the antlr-interest mailing list