[antlr-interest] Tree-Parser Grammer Question

Ruslan Zasukhin sunshine at public.kherson.ua
Tue Nov 12 10:21:18 PST 2002


on 11/12/02 7:13 PM, mzukowski at yci.com at mzukowski at yci.com wrote:

> Note that your structure for the tree with IDENT as an optional root muddles
> things up.  You don't know from the start which of the tree alternatives you
> are looking at.  This will slow down your tree traversal as well.  Some
> people argue that tree grammars should avoid optional closures totally.
> Take for instance a for loop.  In C any of the three expressions are
> optional, but for my tree I don't want to decide based on content, so I
> added an imaginary NEmptyExpression alternative to my expr rule.  So now a
> missing expr in a for loop is forced in as an NEmptyExpression.  Imagine how
> to handle the tree grammar if I left those three exprs optional.  It's not
> pretty.  My simple tree grammar for "for" is this:
> 
>              #( "for"
>               expr expr expr
>               statement
>               )
> 
> OK, let's get ready for round two!

Hi Monty,

I always with great interest read your letters.
You are cool expert on parsing comparing e.g to me. :-)

I wonder

1) if exists any list of such TIPs as you describe above ?

2) if exists any example grammars written by you for public ?

3) May be you can send me/us some grammars that are not secret?
Especially interesting
    -- how you put symbols into symbol table.
    -- what C/c++ classes of symbol table you use
    -- tree parser that *and* its C++ actions.

ANTLR examples have few examples with Tree grammar,
But they do not have trees.

It is cool to see at least one tree grammar of real life project.
Let it cannot be compiled. Simply to see ...

-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list
send a letter to valentina-on at lists.macserve.net
-------------------------------------------------------------


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list