Re: translating textual BNF to BNF in graphical representation ?

Marko =?ISO-8859-1?Q?M=E4kel=E4?= <Marko.Makela@HUT.FI>
11 Dec 2002 22:21:43 -0500

          From comp.compilers

Related articles
translating textual BNF to BNF in graphical representation ? Ariel.Burbaickij@mni.fh-giessen.de (Ariel Burbaickij) (2002-12-07)
Re: translating textual BNF to BNF in graphical representation ? Marko.Makela@HUT.FI (Marko =?ISO-8859-1?Q?M=E4kel=E4?=) (2002-12-11)
Re: translating textual BNF to BNF in graphical representation ? kenarose@earthlink.net (Ken Rose) (2002-12-11)
Re: translating textual BNF to BNF in graphical representation ? nick.pomponio@gtri.SpamBegone.gatech.edu (Nick Pomponio) (2002-12-11)
Re: translating textual BNF to BNF in graphical representation ? jakacki@hotmail.com (2002-12-13)
Re: translating textual BNF to BNF in graphical representation ? nntp@bungisoft.com (Bungisoft, Inc.) (2002-12-22)
| List of all articles for this month |
From: Marko =?ISO-8859-1?Q?M=E4kel=E4?= <Marko.Makela@HUT.FI>
Newsgroups: comp.compilers
Date: 11 Dec 2002 22:21:43 -0500
Organization: Helsinki University of Technology, CS lab
References: 02-12-050
Keywords: parse
Posted-Date: 11 Dec 2002 22:21:43 EST

>>>>> "Ariel" == Ariel Burbaickij <Ariel.Burbaickij@mni.fh-giessen.de> writes:


Ariel> Does some tool exist that allow one to transfer textual
Ariel> representation of BNF to its graphical representation


Essentially, BNF represents a directed graph. I'm aware of
two freely available graph visualization tools:
GraphViz (http://www.graphviz.org/) and
VCG (http://rw4.cs.uni-sb.de/users/sander/html/gsvcg1.html).


You can write a simple sed or perl script that strips the code from
your bison file and transforms the grammar rules to a graph
description in the input language of the visualization tool.


One possible translation is to declare a graph node for each terminal
and non-terminal symbol, and an edge from each left-hand-side symbol
to each right-hand-side symbol of each grammar rule. In this way, the
graph probably won't indicate the order in which the symbols have to
appear in the input. If you want railroad diagrams, you will need a
different translation.


Ariel> preferably in postscript or png or some another patentfree format?


Both GraphViz and VCG can produce bitmaps and Adobe Postscript.


                Marko


Post a followup to this message

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