[antlr-interest] ASTFactory initialization inconsistencies in Parser & TreeParser

micheal_jor open.zone at virgin.net
Thu Nov 14 07:15:16 PST 2002


Hi,

Why do ANTLR Parsers initialize their ASTFactory appropriately whilst 
TreeParsers have to operate with an uninitialized factory?. One the 
guys had been investigating the use of reflection to create and use 
arbitary parsers/treeparsers but, the lack of factory initialization 
in generated treeparsers is proving to be somewhat of a pain. The 
factory fails on create()-ing/dup()-ping valid token ID (obtained 
from the Parser by reflection) when treeparser rules are invoked by 
reflection.

While I can simply try to add ASTFactory initialization code to 
treeparsers in the C# codegen and be done with it, I'm curious to why 
the factories aren't initialized currently - any of the current 
codegens. I suspect this might just be a case of "C++ doesn't have 
reflection really and Java's current factory implementation needs no 
initialization". Is this right?

Cheers,

Micheal



 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list