[antlr-interest] Re: summary of trip to Montreal/SableCC land

lgcraymer lgc at mail1.jpl.nasa.gov
Mon Nov 15 17:15:52 PST 2004



--- In antlr-interest at yahoogroups.com, Tom Verbeure <hombre at g...> wrote:
> > >  But I don't remember such situation in real life.
> > > In any case, context information can be passed through fields of
> > > visitor.
> > > It solves the problem.
> > 
> > Almost.  You need a stack of them.  Imagine that you need a reference
> > to the declarations for each {...} block.  Now if you set an instance
> > variable, what happens when you nest {..}?  Clearly you need a stack.
> > Why do this by hand?  Believe me, in my experience, you need context
> > and generally you need it to nest.
> 
> This is a very interesting discussion. Forgive me for interrupting
> with what may be a beginners question. :-)
> I understand that a stack is sometimes needed to retrieve information
> from nested context. What's not clear to me is how Antlr in particular
> makes it easier to access or manage this stack.
> Is this something that is currently already available in antlr 2.x? Or
> is this something new that will be added in 3.x? If it's the latter,
> then I'll just eagerly wait its release, if it's the latter, could you
> point me to an example that implements this?

Actually, the answer is "neither", although it is still possible that
 stacks could creep into 3.0 (i. e.:  3.0 is still in development and
anything could happen).  For ANTLR 2, context is provided by passing
arguments to rules.  For ANTLR 3, dynamic scoping of attributes is
planned to provide somewhat more functionality, but this approach is
still under exploration so don't look for Ter to have a definitive
answer (defined syntax with clearly defined behavior for attributes) soon.

--Loring

> Thanks,
> Tom





 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 





More information about the antlr-interest mailing list