[antlr-interest] bugs with 2.7.6? (answer to " A problem
withloading AST Node type occured")
Micheal J
open.zone at virgin.net
Fri Feb 10 12:11:52 PST 2006
> I did a small change in method loadNodeTypeObject() in
> class antlr.ASTFactory
>
> I changed nodeTypeName by prefixing it with
> NAMESPACE+".". I added on statement before "
> nodeTypeObject = assem.GetType(nodeTypeName);"
>
>
> if (nodeTypeName == "INTNode") nodeTypeName =
> "MiniJava." + nodeTypeName;
>
> so nodeTypeName becomes "MiniJava.INTNode".
If I understand you correctly, you've modified ASTFactory to check for a
specific unqualifed class name and then make it fully qualified. There is no
need to do that, supplying fully qualified names is a requirement for using
hetero asts. Just supply the fully qualified name in the ANTLR file like
this:
<AST=MiniJava.INTNode>
> I suppose antlr user should not use his own namespace
> if he want use hetero AST by default.
No, he must use the fully qualified name which includes the names of
enclosing namespace(s).
Cheers,
Micheal
More information about the antlr-interest
mailing list