[antlr-interest] Invalid char literal

Gavin Lambert antlr at mirality.co.nz
Thu Jul 23 02:39:39 PDT 2009


At 16:29 23/07/2009, Bryan S Follins wrote:
>Does anyone know what the error "syntax error: invalid char 
>literal" means?

It means that you have something in 'quotes' in your grammar that 
isn't valid.

Most likely, you've put in a Unicode character.  ANTLR grammars 
are currently parsed by ANTLR v2, which can't cope with Unicode 
input (unlike the lexers v3 generates, which can).

You need to escape any Unicode characters in the grammar with a 
\uNNNN sequence.



More information about the antlr-interest mailing list