Hi,
I've been using antlr for couple of years to do code generators for c++.
Before, to generate the output I was embedding the code to format the output
directly in the grammar file.
Now, I would like to use stringtemplate to gives the programmer the flexibility
to writes it's own output format using template files.
So the parser puts its output in predefined templates.
I'm in front of 2 problems:
First, a parser rule can only generate one template. Like this :
transition
: 'on' IDENT ('if' a+=identList)? b+=action
-> transition(tname={$IDENT.text}, conditions={$a}, actions={$b})
;
I would like also to generate a second template like this:
-> event(ename={$IDENT.text})
for the same rule above.
How can I achieve that?
Second, when the template file is missing a template definition, an exception
is thrown.
It can happen that the programmer (user) doesn't need all templates, is there a
way to not thrown these exception rather than putting empty templates?
Thanks you,
Vincent
_________________________________________________________________
Attention à tous les Humains. Nous sommes vos photos. Libérez-nous de vos
disques durs.
http://go.microsoft.com/?linkid=9666050
--~--~---------~--~----~------------~-------~--~----~
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