Robert Soule wrote:
> Antlr 3.1.2 won't generate c++, but I have had no problems linking with
> c++ code. If you want your antlr grammar to output c++, such as in:
>
> myrule : a { cout << "a"; } b ;
>
> Then you will need to throw in some hacks to get the #includes right. I used:
>
> @header{
> #ifndef _MyLangauge_H
> #include <iostream>
> #include <string>
> using namespace std;
> #endif
> }
>
> where "_MyLangauge_H" is the include guard generated by the antlr tool.
>
> -Robert
>
Please read the API docs:
http://antlr.org/api/C/index.html
Look for the section about Using @sections. @header is not the palce to
put these, you probably want one of @include @preincludes or
@postinclude (probably the latter).
Jim
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---