[antlr-interest] Re: updated "antlr 2 bashing list"

lgcraymer lgc at mail1.jpl.nasa.gov
Tue Mar 9 19:02:07 PST 2004


True about the return values--the fail flag would have to be added as
a field in the parser/lexer/treewalker objects instead.  That's still
pretty minor.

--Loring


--- In antlr-interest at yahoogroups.com, Terence Parr <parrt at c...> wrote:
> 
> On Mar 9, 2004, at 4:51 PM, lgcraymer wrote:
> 
> > Ter--
> >
> > I hate to say it, but I think that that's a cop out.  Building
> > exception objects and stack frames costs, and there is no point when
> > in guessing mode.
> 
> This never happens unless you fail and is a minor cost compared to the 
> cost of nested predicates, right?
> 
> >   They are also obnoxious when debugging (especially
> > C++)
> 
> Doesn't bother me in Java, but other languages might be a drag.
> 
> I can investigate not using exceptions to see what the code looks like. 
>   Actually somebody who has used JavaCC could tell us what it looks
like 
> ;)  They do not use exceptions.
> 
> > and hamper code generation for languages which do not have
> > exceptions.  It would be better to have a "synpredFailed flag as part
> > of the generated classes-the flag will always be in cache, so is not a
> > performance issue--or to have a return flag from rules and wrap rule
> > invocations (foo) in
> > if (foo() == false) return;
> >
> > and add
> > if (guessing)
> >     return false;
> > else {
> >     <throw exception>
> > }
> >
> > around the <throw exception>s in ANTLR.  Come to think of it,
> > implementing this with the current ANTLR runtime would be only about
> > 10 lines of code or so (maybe a little more--I think that each
> > exception would have to be fixed separately).
> 
> Uh...how you gonna redo return values in 10 lines ;)
> 
> Ter
> --
> Professor Comp. Sci., University of San Francisco
> Creator, ANTLR Parser Generator, http://www.antlr.org
> Cofounder, http://www.jguru.com
> Cofounder, http://www.knowspam.net enjoy email again!
> Cofounder, http://www.peerscope.com pure link sharing



 
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