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).