[antlr-interest] On trees and JavaBeans, part 2: tree creation
open.zone at virgin.net
Tue Apr 19 01:18:53 PDT 2005
Assuming no ones chimes in with performance issues relating to the
> 1) Have an ASTModel interface that defines the node
> navigation and necessary data access against Objects
> 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.
> 3) Define AST interface that represents an ANTLR AST node
> 4) Define a default implementation of ASTModel that
> translates model calls into AST node calls
> 5) Define default implementation(s) of AST as needed by ANTLR
> 6) Define default implementation(s) of ASTFactory as needed by ANTLR
> After that, anyone can use any AST they would like, not just
> at the node level.
> Nifty, eh?
Barring performance issues, yes.
More information about the antlr-interest