[antlr-interest] Support for non-java special characters (\a)

Doug Holton doug.holton at comcast.net
Sun Apr 17 00:59:14 PDT 2005


I get an error trying to $setText("\a") using the C# antlr runtime.
"\a" is a special character for a console beep.
The error is "unexpected character: a".

Is there any way I can work around this in my grammar, or is this
something that could be added to the C# antlr version, so that
perhaps it could allow: $setText("\\a") and convert it to "\a".

I can manually change \\a to \a in the generated lexer source and the 
beep works.

Here's a list of all the special characters possible in C#, some of 
which are not supported in java:
\' \" \\ \0 \a \b \f \n \r \t \v

I imagine this would be an issue for the python antlr runtime, too.  You 
can print "\a" in python as well.


More information about the antlr-interest mailing list