[antlr-interest] Re: Anyone tried this ANTLR-inspired CC?
Terence Parr
parrt at cs.usfca.edu
Mon Nov 10 18:16:17 PST 2003
On Monday, November 10, 2003, at 06:10 PM, micheal_jor wrote:
> --- In antlr-interest at yahoogroups.com, Terence Parr <parrt at c...> wrote:
>>
>> On Sunday, November 9, 2003, at 05:37 PM, leung13512c wrote:
>>
>>> The thing that caused me to switch away from ANTLR syntax
>>> is because I prefer the tree building syntax of JJTree that always
>>> create imaginary nodes instead of a mix of both. And it mostly
>>> avoid having to create nodes within actions.
>>
>> Howdy. This is the old AST versus parse tree argument...Parse trees
>> are easy to generate (i.e., no cost to developer) but have way too
>> much
>> noise for tree transformation and also are sensitive to grammar
>> construction whereas ASTs are the canonical repr for a particular
>> language.
>
> Hmmm. If you are saying ANTLR generates a CST (aka. parse tree or
> concrete syntax tree) by default and the JJTree way is to generate an
> AST, you may be right Ter.
Actually, antlr likes ASTs not parse trees though you could of course
build one. In essence, I'm saying that ANTLR likes
+
/ \
3 4
for "3+4" without any rule nodes in there like a parse tree has.
Ter
--
Professor Comp. Sci., University of San Francisco
Creator, ANTLR Parser Generator, http://www.antlr.org
Co-founder, http://www.jguru.com
Co-founder, http://www.knowspam.net enjoy email again!
Co-founder, http://www.peerscope.com pure link sharing
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list