[antlr-interest] On trees and JavaBeans, part 2: tree creation
Micheal J
open.zone at virgin.net
Tue Apr 19 01:18:53 PDT 2005
Assuming no ones chimes in with performance issues relating to the
TreeModel-style interface.
> 1) Have an ASTModel interface that defines the node
> navigation and necessary data access against Objects
+1
> 2) Define an ASTFactory interface that creates and
> manipulates just Objects
I suspect the ASTFactory interface also needs to accommodate the Payload
since this objects originate in (i.e. are created in) the lexer -
Token==Payload==TreeNode right?. The ASTModel only replaces Carriers.
+1
> 3) Define AST interface that represents an ANTLR AST node
Done.
> 4) Define a default implementation of ASTModel that
> translates model calls into AST node calls
+1
> 5) Define default implementation(s) of AST as needed by ANTLR
Done.
> 6) Define default implementation(s) of ASTFactory as needed by ANTLR
+1
> After that, anyone can use any AST they would like, not just
> at the node level.
>
> Nifty, eh?
Barring performance issues, yes.
Cheers,
Micheal
More information about the antlr-interest
mailing list