Heiko Folkerts wrote:
Hello,
I have trouble compiling the generated C code from ANTLR with Visual Studio 2008. I get the following errors:
1>c:\Projekte\modelisar\trunk\vendorsrc\antlr-3.1.3\runtime\C\include\antlr3lexer.h(130) : error C2059: syntax error : '<L_TYPE_raw>'
1>c:\Projekte\modelisar\trunk\vendorsrc\antlr-3.1.3\runtime\C\include\antlr3lexer.h(130) : error C2238: unexpected token(s) preceding ';'

I try to link against the static libraries - but this is before linking so it shouldn't matter. 

The strange thing is, that I can't find any occurence of L_TYPE_RAW in my code or in the antlr headers.

I tried searching the docs and the web but nothing gave me a hint.
  
I suspect that you have include files mixed up with the antlr include files and that one of those is #defining, or otherwise defining something used in the ANTLR headers. Looking at that line in the header should help you and I suspect that it is the emit keyword that has been defined as something else in one of your own headers or the the headers you are including.

Generally:

1) Follow the examples for how to organize the headers - you see that they define one header file which controls the order in which the others are included;
2) Keep as much code as possible outside the grammar itself. The best thing to do is define an interface which the grammar actions call functions/methods against with the minimum of declarations, logic and so on in the actual grammar file;
3) Organize your headers rather than just include a whole bunch of them everywhere;
4) Look at the @sections to determine where in the include sequence external headers should be included in the generated code - they can be placed in the generated .h, before the generated .h is included and after the generated .h is included;

Search all the headers you are including for L_TYPE_raw and when you find it, you should see what your issue is.

Jim


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "il-antlr-interest" group.
To post to this group, send email to il-antlr-interest@googlegroups.com
To unsubscribe from this group, send email to il-antlr-interest+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

Reply via email to