5

It seems that antlr-3.5.1-complete.jar and antlr-3.5.1-complete-no-st3.jar generates code targeting C runtime that has a lot of the "_empty" identifier in the DFA that is not defined anywhere.

antlr-3.4 generates the code using dfa31_T_empty which should be the correct id.

I could probably fix this by defining _empty as NULL but that's a hack.

Is there any antlr-3.5.2 or so available that fixes this error?

Cheers, Adrian Pop/

Adrian Pop
  • 4,034
  • 13
  • 16

1 Answers1

4

I have encountered this error too. The simplest and cleanest solution indeed seems to be to add this to your grammar:

@header
{
   #define _empty NULL
}

The other solution is to add this define to your compiler macro list (/D _empty=null seems to work in both GCC and MSVC).

Matěj Zábský
  • 16,909
  • 15
  • 69
  • 114