[antlr-interest] Re: Porting from antlr 2.7.1 to 2.7.4
Sergey Bogdanov
serge.bogdanov at intel.com
Thu Jul 8 04:39:28 PDT 2004
Well, now it is really broken. Here is an example that cannot work
under current scheme and used to work OK in 2.7.1:
============================================
options {
language="Cpp";
genHashLines = false;
}
class MndParser extends Parser;
options {
buildAST = true;
}
world : rule1 | rule2;
rule1 : "int" <AST=IntAST>;
rule2 : "const"! "int" <AST=ConstIntAST>;
=============================================
Here is a fragment of the generated cpp code:
=============================================
void MndParser::initializeASTFactory( ANTLR_USE_NAMESPACE(antlr)
ASTFactory& factory )
{
factory.registerFactory(4, "ConstIntAST",
ConstIntAST::factory);
factory.setMaxNodeType(5);
}
=============================================
So, whatever rule you are in, the ConstIntAST will be created. Where
is my IntAST? :)
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/antlr-interest/
<*> To unsubscribe from this group, send an email to:
antlr-interest-unsubscribe at yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list