Hi Kaleb,

Sorry for the late response, I have been away.

My question then is how do I put a 'tempate' into a scope so that I can use it
again.

If I have:
xpath: d+=declaration p+=path
       ->template(d=d, p=p) .. do stuff.

... (Lots of productions)

comp: ^('comparison' (op= ... // etc
       ->xmlWhere(declarations=d)

I need the 'd' template from the top production in xmlWhere which is a template
in a much lower production, how do I add the template to a scope in xpath so
that the same template is available as a parameter in xmlWhere.

I am sure that a scope will work. I have used the scopes before, but don't know
how to keep a template in the scope and use it again.
how do I reference the 'd' from 'd+=declaration' in the child production.

Thanks
Regards
Craig.


On Wed, Nov 11, 2009 at 9:00 PM,  <[email protected]> wrote:
> Hi,
>
> I have a grammar that I am using to generate sql. My question is: Is
> there any easy way to refer to a 'parent' template in a child production.

[...snip..]

> I need xmlWhere(declarations={$d}...) but it's not available.

I was going to say that you need to use scopes to make that available later in
your code, but it looks like you're already using scopes.
Can you elaborate a bit on what I may have missed that makes scopes insufficient
for your needs?

Thanks.

--
Kaleb Pederson

Blog - http://kalebpederson.com
Twitter - http://twitter.com/kalebpederson




----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/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].
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=.


Reply via email to