Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.compilers > #2888
| Path | csiph.com!weretis.net!feeder6.news.weretis.net!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end |
|---|---|
| From | anton@mips.complang.tuwien.ac.at (Anton Ertl) |
| Newsgroups | comp.compilers |
| Subject | Re: Graphical representations of syntax trees? |
| Date | Mon, 07 Feb 2022 18:33:57 GMT |
| Organization | Institut fuer Computersprachen, Technische Universitaet Wien |
| Lines | 45 |
| Sender | news@iecc.com |
| Approved | comp.compilers@iecc.com |
| Message-ID | <22-02-009@comp.compilers> (permalink) |
| References | <22-02-004@comp.compilers> <22-02-006@comp.compilers> <22-02-008@comp.compilers> |
| Injection-Info | gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="88498"; mail-complaints-to="abuse@iecc.com" |
| Keywords | parse, tools |
| Posted-Date | 07 Feb 2022 14:13:03 EST |
| X-submission-address | compilers@iecc.com |
| X-moderator-address | compilers-request@iecc.com |
| X-FAQ-and-archives | http://compilers.iecc.com |
| Xref | csiph.com comp.compilers:2888 |
Show key headers only | View raw
Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.com> writes:
>On 2/6/2022 10:32 PM, Anton Ertl wrote:
>> Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.com> writes:
>>> Are there any resources, or papers, about the subject of representing
>>> syntax trees graphically?
>>
>> There are LaTeX modes for displaying trees. There is also the
>> graphviz package for visualizing graphs.
>
>Sure, these are packages. But no actual algorithms, or discussions of
>how to do these things by myself.
Seems pretty trivial to me. If a rule
A: B C
is used for parsing a part of the input, you generate a node for this
rule (e.g., labeled "A"), with nodes for B and C as children. If you
want it to look nice, you arrange for all the terminals to be at the
same (geometrical, not logical) level. I think that's not very hard
with graphviz. Then you get trees like:
E
/|\
F |F
/|\||
1*2+3
A web search for "bison dot files" resulted in
<https://www.gnu.org/software/bison/manual/html_node/Graphviz.html>,
but this describes a visual representation of the parser, not the
parse tree.
>[I suspect the practical problem is that for any but the tiniest programs
>the parse tree will be so large and bushy as to be unreadable. -John]
IIRC (only read about that part, and a long time ago) graphviz
contains a tool that supports folding/unfolding parts of the graph
interactively, exactly because of this problem.
- anton
--
M. Anton Ertl
anton@mips.complang.tuwien.ac.at
http://www.complang.tuwien.ac.at/anton/
Back to comp.compilers | Previous | Next — Previous in thread | Next in thread | Find similar
Graphical representations of syntax trees? Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.com> - 2022-02-04 20:20 +0000
Re: Graphical representations of syntax trees? gah4 <gah4@u.washington.edu> - 2022-02-06 13:07 -0800
Re: Graphical representations of syntax trees? Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2022-02-06 23:38 +0100
Re: Graphical representations of syntax trees? Steve Limb <stephenjohnlimb@gmail.com> - 2022-02-08 09:14 +0000
Re: Graphical representations of syntax trees? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2022-02-06 22:32 +0000
Re: Graphical representations of syntax trees? Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.com> - 2022-02-07 10:49 +0000
Re: Graphical representations of syntax trees? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2022-02-07 18:33 +0000
Re: Graphical representations of syntax trees? Jonathan Thornburg <jonathan@gold.bkis-orchard.net> - 2022-02-08 21:34 +0000
Re: Graphical representations of syntax trees? Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2022-02-11 21:16 +0000
Re: Graphical representations of syntax trees? "Alexei A. Frounze" <alexfrunews@gmail.com> - 2022-02-07 18:17 -0800
csiph-web