[antlr-interest] C runtime question
    Dragos Tarcatu 
    tarcatu_dragosh at yahoo.com
       
    Sun Mar 15 09:49:25 PDT 2009
    
    
  
Hi,
I'm kind of new with the antlr C runtime and I know this question may sount a little stupid. I wrote a simple grammar for both C/java and observed that for C the usage of += operators inside rules turns into some ugly compilation errors. 
the grammar looks like this:
grammar test;
options
{
    language = C;
}
ids        
        :         (lst+=ID)+
        ;
                
ID        :        ('a'..'z')+;
and the errors I get are something like this:
gcc -o main main.c testLexer.c testLexer.h testParser.c testParser.h -I. -lantlr3c
testParser.c: In function ‘ids’:
testParser.c:383: error: ‘struct testParser_Ctx_struct’ has no member named ‘vectors’
testParser.c:383: error: ‘struct testParser_Ctx_struct’ has no member named ‘vectors’
Is this a limitation of the C runtime or something?
Thanks,
      Dragos
      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090315/4b6db5bb/attachment.html 
    
    
More information about the antlr-interest
mailing list