Hi, I'm using antlr 3.1.1 and evaluating
it against boost::spirit and I'm having
a pretty hard time coming up with even
simple examples that work.

I have a grammar like so:
--------------------
grammar Blah
options{ language = C; }
r
returns [char *s]
:w1=ID ' ' w2=ID{ $s = "blah"; };
ID: 'a'..'z'+;
------------------------

this will return me a "blah" but I'm having
trouble figuring out howto return the value of
w1 or w2;

I thought it was w1->getText() but that doesn't
seem to work.

preferably I'd just like to pass in a struct
and tack on w1 and w2 to it

I'm using the lexer/parser that this grammar
generates in a c++ program.

can anyone point me to some resources on this?
I've already looked through the examples tarball
from the site and didn't find anything that related
to these specific questions
 
thanks,
-ian

List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org:8080/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
-~----------~----~----~----~------~----~------~--~---

Reply via email to