[antlr-interest] C++ code generation

vivek bhaskar vivek_bhaskar at hotmail.com
Mon Apr 28 03:34:03 PDT 2003


Hi,
I am working on antlr 2.7.1, to generate C++ code. Actually i had started 
with antlr 2.7.2, but even after repeated try, i was not able to produce 
static lib for c++ given in antlr/lib/cpp, due to one consistent error in 
code and thus shifted to 2.7.1.

Here, i tried to generate C++ code, in which i call a function say,
void  myfunction(string &mystruing)
and use a global variable
string myvar;

so i put both in header as
header{
#include ...

void  myfunction(string &mystruing);
string myvar;
}

But to my utter surprise it start throwing error as it doesnt' recognise 
"string" as a type, and so had to shift to char*. Although i am able to get 
correct result yet(i hope i will), but now it successfully compiled.

so, my question is this:
Is any body working on antlr, taking care of C++ features, as the current 
versions, support antlr only for namesake?


Lastly:
when in java parser i did,

left: r=right { use r}..it worked.

But when i tried same in parser, to generate C++, it gave error and
thus i had only choice, to use tree parser. Can anbody illustrate this 
problem?

vivek














_________________________________________________________________
Hot picks. Free downloads. http://www.msn.co.in/musicnew/musicshop Visit 
music shop


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 




More information about the antlr-interest mailing list