request for simple example: parse tree generation

kendrac@ee.ubc.ca (kendra cooper)
3 Oct 1996 22:58:02 -0400

          From comp.compilers

Related articles
request for simple example: parse tree generation kendrac@ee.ubc.ca (1996-10-03)
Re: request for simple example: parse tree generation mac@coos.dartmouth.edu (1996-10-06)
Re: request for simple example: parse tree generation belinfan@cs.utwente.nl (1996-10-10)
Re: request for simple example: parse tree generation pjj@cs.man.ac.uk (1996-10-10)
| List of all articles for this month |
From: kendrac@ee.ubc.ca (kendra cooper)
Newsgroups: comp.compilers
Date: 3 Oct 1996 22:58:02 -0400
Organization: University of BC, Dept. of Electrical Engineering
Keywords: yacc, question, comment

Hello,


I'm looking for a *simple* example that shows how to generate
an explicit parse tree using yacc. Since the tool is used a lot,
I thought there would be some sort of "standard" way of doing this.


(what would be perfect is the example in the lex/yacc
book by Levine et al on pg 52 - it is the fred = 12 + 13
example)


I have built the basic lex/yacc components. Next, I need to build a parse tree
for processing by another module. The tool is going to transform
one syntax to another syntax.


I have searched the compiler web site, but have not found what I was
looking for.


Thank you,


Kendra
[Yeah, I wanted to put some examples of that in the book, but ran out of
time and pages. It's pretty straightforward, generate subtrees each time
you reduce a rule and splice them together as you go, ending up with one
big tree when the parse is done. -John]
--


Post a followup to this message

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