[antlr-interest] Yet another idea for a completly generic TreeParser

Scott Stanchfield scott at javadude.com
Sun May 15 20:27:34 PDT 2005


A valid approach, and pretty similar to what I was proposing. The difference
is that you're doing  build-time translation (different code gen) rather
than a runtime gen (an AST model adapter).

Type safety is really the same either way; it's just in a different spot (in
the adapter vs in the code generator itself).

Performance of what you suggest should be a wee bit better, though
practically negligible.

I think this would be a tad harder to create and maintain than the adapter I
proposed, though, as you need to:

a) have the code generator allow a spec
b) understand the spec so you can write to it

vs just implementing a common ASTModel interface.

I'd be concerned that the code generator could have too many special cases
that are spread out and harder to test.

Both would satisfy what I'm looking for, though I think the adapter would be
a little easier overall.

Later,
-- Scott




More information about the antlr-interest mailing list