[antlr-interest] Path-based template selection

Ted Villalba ted.villalba at gmail.com
Sun Jul 29 15:45:07 PDT 2007


Hi,

I have question about path-dependent template selection...

I have a tree grammar rule to which there are two paths of arrival.
The template I call from that grammar rule will depend on from whence(?) it
arrived.
I tried passing scope fields upon which I hoped to base the template
selection, but they are not populated until after the fact.
What is a good approach to this undertaking?

Trying to simplify the grammar to make the point here, I hope it does so:

a : b ... //if I try to set a scope field here
   | c
b:  c
c: CHAR  call template1 //it will not exist here

vs

a : c
c: CHAR call template2



Thank you,
Ted
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070729/361bf8cc/attachment.html 


More information about the antlr-interest mailing list