[antlr-interest] anybody get bitten by ANTLR's AST interface
requirement
Andy Tripp
antlr at jazillian.com
Thu Jan 19 07:53:51 PST 2006
Terence Parr wrote:
> Howdy, i'm working on tree parser error recovery over next few
> days...my efforts are hampered by my earlier decision to not require
> nodes to answer any interface...i use an adaptor for construction and
> navigation. No biggie. However, it sure would be nice to say "all
> antlr trees satisfy the Tree" interface. This is what v2 does (AST
> interface). Was this a huge problem for anyone?
>
> Ter
>
Not sure if this is on-topic, but...
There was that guy who had the complaint about the way the AST hierarchy is
currently structured. IIRC, his complaint was that BaseAST, as an
abstract class,
should not declare variables "down" and "right". He's prefer if you had
declared
abstract getDown() and getRight() methods in BaseAST, and implement
those methods
in CommonAST. He had ASTs that were huge, and he had some other
mechanism to
use lazy evaluation rather than allocate "down" and "right" for every
AST. But he couldn't
extend BaseAST and reuse its other functionality, he basically had to
modify BaseAST.
Also, I'd get rid of all the antlr.collections stuff and ASTIterator and
ASTPair and use
use the standard collections and generics.
More information about the antlr-interest
mailing list