[antlr-interest] Using paraphrase option when using the C target in ANTLR
Gavin Lambert
antlr at mirality.co.nz
Thu Jan 7 12:36:16 PST 2010
At 19:09 7/01/2010, Heiko Folkerts wrote:
>I am currently trying to improve the quality of our error
messages
>generated bvy our ANTLR generated parser. Since our error
messages
>are generally in german I'd like to take advance of the
paraphrase
>option for rules and tokens to assign a clear name to those
things.
>Unfortunately I get errors from ANTLR when using the following
>token definition:
>ALPHASTRING
>options { paraphrase="Zeichenkette";}
>: ('a'..'z' | 'A'..'Z' | '0'..'9' | '/' | '-' | '\u00c0' ..
>'\u00d6' | '\u00d8' .. '\u00fc')+;
>
>ANTLR reports: "unexpected token "Zeichenkette"
>
>So can't I use paraphrases in the C target? I am using antlr3.2.
The paraphrase option is a v2 option; there is no equivalent in
v3. If you want to change the text of the error messages then you
will need to alter the exception text yourself, using the error
reporting hooks (see the wiki).
More information about the antlr-interest
mailing list