Re: Graphical representations of syntax trees?

gah4 <gah4@u.washington.edu>
Sun, 6 Feb 2022 13:07:00 -0800 (PST)

          From comp.compilers

Related articles
Graphical representations of syntax trees? johann@myrkraverk.com (Johann 'Myrkraverk' Oskarsson) (2022-02-04)
Re: Graphical representations of syntax trees? gah4@u.washington.edu (gah4) (2022-02-06)
Re: Graphical representations of syntax trees? anton@mips.complang.tuwien.ac.at (2022-02-06)
Re: Graphical representations of syntax trees? DrDiettrich1@netscape.net (Hans-Peter Diettrich) (2022-02-06)
Re: Graphical representations of syntax trees? johann@myrkraverk.com (Johann 'Myrkraverk' Oskarsson) (2022-02-07)
Re: Graphical representations of syntax trees? anton@mips.complang.tuwien.ac.at (2022-02-07)
Re: Graphical representations of syntax trees? christopher.f.clark@compiler-resources.com (Christopher F Clark) (2022-02-07)
Re: Graphical representations of syntax trees? alexfrunews@gmail.com (Alexei A. Frounze) (2022-02-07)
[3 later articles]
| List of all articles for this month |

From: gah4 <gah4@u.washington.edu>
Newsgroups: comp.compilers
Date: Sun, 6 Feb 2022 13:07:00 -0800 (PST)
Organization: Compilers Central
References: 22-02-004
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="48766"; mail-complaints-to="abuse@iecc.com"
Keywords: parse, tools
Posted-Date: 06 Feb 2022 16:40:44 EST
In-Reply-To: 22-02-004

On Sunday, February 6, 2022 at 10:28:41 AM UTC-8, Johann 'Myrkraverk' Oskarsson wrote:


> Are there any resources, or papers, about the subject of representing
> syntax trees graphically? Given the idea that a compiler reads syntax
> and generates code, all I have to do to "print" it, is to generate post-
> script. Surely this has been done before.


I think you mean what is sometimes called a parse tree. It might be that
syntax tree sometimes has other meanings.


For an undergraduate linguistics class, I wrote a program to do parse trees
for English sentences. (Drawn on a Tektronix 4010, as that was before
Postscript.) I believe at the same time I was taking the compilers class.


I added rules to the program, put some sentence into it, and printed out
the result. Added more rules, and printed out more. In the end, maybe
after I turned in the project, I found that it wouldn't correctly parse the
earlier ones. Note that there are many ambiguities in English, so one
should not be surprised when it finds the wrong tree.


The main complication with doing this, is positioning the items
on the page. If you have unlimited page width, it isn't so bad, but often
they come out wider than you might like. So you need extra logic to
make the page look nice to humans, which often isn't so natural.


I do remember knowing about programs to print out flow charts,
but that is different. But it also has the same problem of positioning
on the page.


Post a followup to this message

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