Re: Abstract Syntax Trees - binary tree or other, which is best?

Tom Payne <thp@roam-thp2.cs.ucr.edu>
8 Oct 2000 22:28:38 -0400

          From comp.compilers

Related articles
Abstract Syntax Trees - binary tree or other, which is best? ed_davis@my-deja.com (Ed Davis) (2000-10-01)
Re: Abstract Syntax Trees - binary tree or other, which is best? Joachim.Pimiskern@de.bosch.com (Joachim Pimiskern) (2000-10-08)
Re: Abstract Syntax Trees - binary tree or other, which is best? thp@roam-thp2.cs.ucr.edu (Tom Payne) (2000-10-08)
| List of all articles for this month |
From: Tom Payne <thp@roam-thp2.cs.ucr.edu>
Newsgroups: comp.compilers
Date: 8 Oct 2000 22:28:38 -0400
Organization: University of California, Riverside
References: 00-10-011
Keywords: AST

Ed Davis <ed_davis@my-deja.com> wrote:
> I have read a couple of texts where the author recommends using a
> binary tree for the abstract syntax tree. In many other texts, non-
> binary trees are used, with the tree being tailored to what is being
> stored at the time.


> Are there major advantages to using a binary tree? The second
> approach seems easier to me (as in Terry, Louden, and Watt), but I'm a
> neophyte in this area, so what do I know.


Abstract syntax trees are inherently non-binary, but one of the
standard data-structures tricks is to represent a general tree via a
binary tree wherein each node takes his oldest son (relative to the
general tree) as his left descendant and his next younger brother
(relative to the general tree) as his right descendant.


Tom Payne


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.