[antlr-interest] ANTLR 2.7.5 problem(?) with #[...] construct

Bryan Ewbank ewbank at gmail.com
Tue May 3 12:37:28 PDT 2005


I have the following in my *.g file:
280   #( EXPR initval:value
281       {
282           RefTreeNode decl = #( #[DECL,"DECL"], #id, #t );
283           RefTreeNode init = #( #[ASGN, "="], copyTree(#id), #initval );
284           init = #( #[STMT,"STMT"], #( #[EXPR,"EXPR"], init ) );
285           decl->setNextSibling( RefAST(init) );
286           ## = decl;
287       }
288    )

The problem is that the #[EXPR,"EXPR"] is being detected as a hit for
the /EXPR/ node in the tree pattern, rather than as a directive to
create a new node.

Any suggestions?


More information about the antlr-interest mailing list