top-down and bottom-up

"Rob" <rjdepauw@xs4all.nl>
13 Apr 2003 12:41:24 -0400

          From comp.compilers

Related articles
top-down and bottom-up rjdepauw@xs4all.nl (Rob) (2003-04-13)
Re: top-down and bottom-up joachim_d@gmx.de (Joachim Durchholz) (2003-04-15)
Re: top-down and bottom-up haberg@matematik.su.se (2003-04-20)
Re: top-down and bottom-up JeffKenton@attbi.com (Jeff Kenton) (2003-04-20)
Re: top-down and bottom-up thp@cs.ucr.edu (2003-05-06)
| List of all articles for this month |
From: "Rob" <rjdepauw@xs4all.nl>
Newsgroups: comp.compilers
Date: 13 Apr 2003 12:41:24 -0400
Organization: @Home Benelux
Keywords: parse, question
Posted-Date: 13 Apr 2003 12:41:24 EDT

I would like to know if a parse tree created by a top-down parser
differs from a parse tree created by a bottom-up parser given that the
grammar is the same.


Furthermore, if I was using a top-down parser generator (LLgen for
example) and I was writing a rule set for a grammar that had a rule
like this:


expression -> term rest_expression


Where would I construct the expression node? If I understand correctly
the expression node would be constructed in the expression rule, after
that the term node would be constructed in the term rule and after
that the rest_expression node would be constructed.


If this is the case, what to do when it's only possible due to the
tree/node construction functions to construct a node AFTER the child nodes
are constructed. For example, with a function like this:


new_expression(term, rest_expression)


Thanks in advance,


Robert-Jan de Pauw


Post a followup to this message

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