[antlr-interest] anybody get bitten by ANTLR's AST interface
requirement
Terence Parr
parrt at cs.usfca.edu
Thu Jan 19 12:13:31 PST 2006
On Jan 19, 2006, at 7:53 AM, Andy Tripp wrote:
> 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.
Good to know. Though in his case he could still implement AST with
no ill effects.
> Also, I'd get rid of all the antlr.collections stuff and
> ASTIterator and ASTPair and use
> use the standard collections and generics.
Yup. :)
Ter
More information about the antlr-interest
mailing list