[antlr-interest] Composed grammars and AST, pb with .h files; and "Bus error" with 'toStringTree'

Jim Idle jimi at temporal-wave.com
Wed Jul 30 10:29:47 PDT 2008


On Wed, 2008-07-30 at 15:55 +0200, Jean-Claude Durand wrote:

> I get a pb easy to fix when I use composed grammars with AST: the .h
> files include 
> 
> ~/Soft/Ariane-Y/V3Compilateur/ForAI: c++ -c Composed.c Composed_Id.c
> Composed_Int.c Lex.c main.c -I/usr/include/sys
> -I/usr/local/pkg/antlr-2008-06-26.17/runtime/C/include/ -I.
> ./Composed_Int.h:157: error: expected declaration before '}' token
> ./Composed.h:106: error: expected identifier before '*' token
> ./Composed.h:106: error: ISO C++ forbids declaration of
> 'Composed_Id_id_return' with no type
> ./Composed.h:106: error: 'Composed_Id_id_return' declared as function
> returning a function
> ./Composed.h:159: error: expected declaration before '}' token
> ./Composed.h:107: error: expected identifier before '*' token
> ./Composed.h:107: error: ISO C++ forbids declaration of
> 'Composed_Int_ent_return' with no type
> ./Composed.h:107: error: 'Composed_Int_ent_return' declared as
> function returning a function
> ./Composed.h:159: error: expected declaration before '}' token
> ./Composed_Int.h:157: error: expected declaration before '}' token
> ~/Soft/Ariane-Y/V3Compilateur/ForAI: 


OK - in fact I have already fxied this. It was a C.stg template change
however - are you sure you are using teh latest ANTLR beta 2 jar as this
is the error you will get if you are not. If you definately are then you
will see:

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080730/ca4c7137/attachment-0001.html 


More information about the antlr-interest mailing list