Hello,
I have a grammar with a parser rule as shown below
parserrule: (LEXERRULE);
LEXERRULE: (LEXERRULE1)(LEXERRULE2)(LEXERRULE3);
Whenever my parser rule is recognized I want to return the text identified for
LEXERRULE1,2,3 separately. But I believe that we cannot return values from a
lexer rule.
Is there a way so that I can get the LEXERRULE1,2,3 from LEXERRULE.
i.e. Something like
Parserrule return [x,y,z]: (LEXERRULE) {$x= LEXERRULE.LEXERRULE1;$y
=LEXERRULE.LEXERRULE2;$z=LEXERRULE.LEXERRULE3 };
LEXERRULE: (LEXERRULE1)(LEXERRULE2)(LEXERRULE3);
LEXERRULE1:'ab';
LEXERRULE2:'xy';
LEXERRULE3:'12';
The input for this parser is abxy12
The scenario is that whenver this text is recognized or matched then I want ab,
xy and 12 to be return back from the parser rule each separately.
Thanks a lot in advance.
The kind of support I got by antlr-interest is great and appreciable.
Thanks and Regards
Raghavendra
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-address