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/
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With