Hello all,
I am trying to generate more useful error messages when I get a file that
doesn't match the grammar. One of the complaints is that because I named my
tokens, the error messages look like this:
syntax error detected in file missing_semicolon.test at line number 6,
position 5; expecting SEMICOLON
To me, this seems obvious, but my customers don't like the token names, they'd
rather see:
syntax error detected in file fail_missing_colon.ext at line number 6,
position 2; expecting ';'
I prefer to have the names, though. Is there an easy way for me to reverse the
look up so the error can replace SEMICOLON with ';' (as well as all my other
tokens, of course)?
I can get the NAME of the token with:
recognizer->state->tokenNames[recognizer->state->exception->expecting]
I can't seem to see how to get the text of that token, though.
Thanks,
-JEEP
Joe Peterson
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---