[antlr-interest] Minor suggestion re. Java output

Olivier Lefevre lefevrol at yahoo.com
Tue Feb 5 08:35:04 PST 2008


I think you are overreacting and that you are definitely the one
stooping to innuendo when you write:

    "Your point might have been better phrased without the
     output=AST, which is superfluous to your question don't
     you think?"

Furthermore I am missing the point of your sarcasm. From a Test.g
grammar with

options {
     output = AST;
     ASTLabelType=CommonTree;
}

ANTLR will create a TestLexer.java and a TestParser.java, the
latter with methods like

     public static class prog_return extends ParserRuleReturnScope {
         CommonTree tree;
         public Object getTree() { return tree; }
     };

Thus my question makes sense, I think: I requested a CommonTree
type for AST nodes and that is what I got, so I don't see why you
say that tree nodes can be anything. And if they really can be
anything, then once again what is the point of "ASTLabelType=
CommonTree;"? If it is not here to constrain the node type, then
for some other purpose, I presume, and I was merely asking which
one. If is not my fault if you construe every question as a want
of what you'd probably call "proper respect".

> Your post here smacks a little of 'trying to catch someone out'.

No, you are inventing things. You seem to have a problem with people
who are persistent in trying to actually _understand_ the tool they
use instead of being content to hack until they find something that
works.

 > - Remember that the Java code target is 1.4;

Fine. I would suggest we leave it at that.

Regards,

-- O.L.



More information about the antlr-interest mailing list