views:

780

answers:

1

I'm trying to build a grammar with the following:

NUMERIC: INTEGER | FLOAT | INFINITY | PI ... INFINITY: '∞' PI: 'π'

But Antlr refuses to load the grammar.

+2  A: 

Use the Java expression representing the Unicode character:

  • 'π' = '\u221E'
  • '∞' = '\u03C0'

That will work up to '\uFFFF'; Java doesn't support five-digit Unicode.

James A. Rosen