[antlr-interest] Re: a new paper on ANTLR style grammars

lgcraymer lgc at mail1.jpl.nasa.gov
Wed Nov 19 22:32:41 PST 2003


--- In antlr-interest at yahoogroups.com, Terence Parr <parrt at c...> 
wrote:
> 
> On Wednesday, November 19, 2003, at 05:30 PM, lgcraymer wrote:
> 
> > --- In antlr-interest at yahoogroups.com, Terence Parr <parrt at c...> 
wrote:
> > ...
> >> So, the actions are the problem for everyone :)
> >
> > Trees!  Trees! Ya gotta have trees.  Then actions aren't a 
problem.  
> > One real strength of a multi-pass recognizer is that you separate
> > syntactic analysis (parsing) from semantic interpretation 
(actions).  
> > Once you have gotten to a canonical tree, the recognizer has only
> > one token of lookahead so that actions always follow a (possibly 
> > semantically predicated) syntactic decision rather than being a 
part
> > of it.
> 
> Yeah, but his point is that you need semantics sometimes to parse 
> properly...even if you separate into multiple phases, *might* be 
> trouble.

If you mean "recognize" instead of "parse", I agree--that's 
consistent with what I wrote.  Or almost agree--mostly semantic 
information is maintained to prevent a grammar "explosion" (for 
example, if FOO is encountered as a local variable, it can be 
followed with a syntactic description that encapsulates that--it 
isn't theoretically necessary to maintain a symbol table, although 
it might be in practice).  It is, however, easier to build a tree 
whose structure makes it easy to extract the semantics.

--Loring

> Ter
> --
> Professor Comp. Sci., University of San Francisco
> Creator, ANTLR Parser Generator, http://www.antlr.org
> Co-founder, http://www.jguru.com
> Co-founder, http://www.knowspam.net enjoy email again!
> Co-founder, http://www.peerscope.com pure link sharing


 

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




More information about the antlr-interest mailing list