[antlr-interest] Difference between foo and #foo?

Martin Probst mail at martin-probst.com
Wed Mar 15 05:44:51 PST 2006


> > In your case in a TreeParser (I assume) there is actually no difference
> > because the AST fragments are directly called "foo" and not "foo_AST" as in
> > the parser (where just using foo will give you a compile error).
> Thanks for your answer, in the meantime I sat down and tried to understand the 
> generated code---successfully :-) So no, it's not the same: foo == #foo_in! 
> So no wonder I didn't understand my results, in case you forget the '#', what 
> you get is not the output tree but the input tree for that rule.... creepy ;)

Ouch, sorry. I never had buildAST = true in an tree parser, so for my
case #foo was always == foo.

Martin



More information about the antlr-interest mailing list