|Forming an AST node for a sequence or list email@example.com (2004-06-09)|
|Re: Forming an AST node for a sequence or list firstname.lastname@example.org (Rodney M. Bates) (2004-06-12)|
|Re: Forming an AST node for a sequence or list TommyAtNumba-Tu.Comemail@example.com (Tommy Thorn) (2004-06-14)|
|Re: Forming an AST node for a sequence or list firstname.lastname@example.org (Jeff Lasslett) (2004-06-14)|
|Re: Forming an AST node for a sequence or list email@example.com (Hans Aberg) (2004-06-15)|
|From:||Jeff Lasslett <firstname.lastname@example.org>|
|Date:||14 Jun 2004 17:47:39 -0400|
|Posted-Date:||14 Jun 2004 17:47:39 EDT|
Rodney M. Bates wrote:
> Jeff Lasslett wrote:
>> I have a couple of grammar elements of the following form:
>>A -> Ab | b ( or in yacc form A : A "b" | "b"; )
>>I am planning to form strings matched by this type of rule into AST
>>nodes that look like this (given the input string "bbb"):-
>> b b b
> One traditional way is to represent the list node using the
> binary-tree-representation-of-n-ary-tree technique, i.e. the above
> example is physically linked as:
Thanks Rodney. This is exactly what I've done. It works beautifully.
My parser now builds a syntax tree. Now I have to decorate it with type
information and think about generating some code.
Return to the
Search the comp.compilers archives again.