Hi friends,
Any ideas for my question?
Is there any solution for it or not ?
My Idea is to do action immediately.
So Can I have that facility in a grammar file like i can represent
(
print_statement: 'print' az bz cz { here i want to print all those
variables in print statement}
(where az bz cz are three variables)
)
my single variable grammar
print_statement: 'print' ID {print $ID.text} ;
where
ID : ('a'..'z'|'A'..'Z')+ ;
the above works for
print hello
but i want to make the following to work
print hello world example
here in this case ID will come at three times
so I can't represent the grammar like
print_statement: print ID ID ID {...}
I can't make it work and also it throws error too..
any solution ?
One final Question
Is it possible or I have to find sme other approach
If so plz guide me...
Thanks ...
Kiso
On Oct 26, 5:29 pm, lucky <[email protected]> wrote:
> Hi folks,
> I have a small issue with multiple variables of a statement.
>
> when i have one variable(ID) like the antlr grammar is
>
> statement: 'select' ID {print $ID.text}
>
> this is working fine.
>
> when i have multiple variables how to represent in grammar and how can
> i pass it as arguments to that print statement as above.
>
> plz help me....
>
> Thanks...
> Kiso
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---