[antlr-interest] [3.1 C] Mulivalue Attribute is NULL in action after matching rule

Gavin Lambert antlr at mirality.co.nz
Sat Apr 12 19:18:30 PDT 2008


At 13:48 13/04/2008, Christian and Natalie Schladetsch wrote:
>grammar Fail;
>options { language=C; }
>@preincludes { #include <assert.h> }
>sequence  : num += (NUMBER+) { assert($num != 0); } ;
>NUMBER  :  ('0'..'9')+ ;

That other problem (with parentheses) has crept back in :)

>error C2039: 'vectors' : is not a member of 'PiParser_Ctx_struct'
>
>That is the complete parser. The line in question is 
>'list_num=ctx->vectors->newVector(ctx->vectors);'
>
>With regards of mismatched templates to runtime: I fear that the 
>work-around I used to get antlr built (by deleting files) results 
>in this. So my bad. I guess I need to go back to the drawing 
>board and make a new build of antlr 3.1 somehow.

Are you building your grammar with ANTLRworks or via the command 
line?  ANTLRworks contains embedded copies of all the ANTLR 
classes and templates, which you'll need to replace with the 3.1 
versions if you want to use the 3.1 runtime.

(I usually don't bother; if I need to use an intermediate build 
for some reason [and I've always used the prebuilt ones] then I'll 
just stop using ANTLRworks until it catches up.  Since I'm not 
targeting Java and it doesn't properly support Unicode input 
anyway, I've only found it of limited usefulness.)

Another thing to check is your include path; maybe it's finding 
one of the other versions of the C runtime before the one you 
actually want to use.



More information about the antlr-interest mailing list