bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bison-2.4.1 with more graph output


From: tys lefering
Subject: Re: bison-2.4.1 with more graph output
Date: Thu, 8 Apr 2010 12:38:57 +0200
User-agent: SquirrelMail/1.4.18

On Wed, April 7, 2010 16:00, Akim Demaille wrote:
>> Also created xml2gml.xsl but that did not result in nice
>> graph images with tulip (GPL) or yed (closed source java).
> Do you have any idea why?  Did you manage to improve it since then?

Started with easiest way of gml graph from xml.

With gml for tulip and yed, they do not automatic
scale the node bigger depending on the length and
height of the string for the node as dot, vcgview
does, but uses a small default node size. (30x30)

Then in the layout the nodes are too close to
each other and the node text is draw centered
on the nodes, also outside the node, and all
text onto each other into a unreadable graph.

Bison generates sometimes large strings for the
nodes and with multiple lines of text.
This is not a  problem with dot and vcgview.

Generated a gml graph like this:

Creator "Bison"
Version "2.4.1b"
graph
[
 hierarchic 1
 label ""
 directed 1
 node
 [
  id 0
  label "0
$accept -> . unit "end of file"
unit -> . assignments exp
assignments -> . assignments assignment
assignments -> ."
 ]
 ...
 edge
 [
  source 0
  target 1
  label "unit"
 ]
...
]

Assuming the gml graph nodes need extra info
for the textsize like this, tried with yed:

        node
        [
                id      0
                label   "0
$accept -> . unit "end of file"
unit -> . assignments exp
assignments -> . assignments assignment
assignments -> ."
                graphics
                [
                        w       300.0
                        h       300.0
                        type    "rectangle"
                        fill    "#CCCCFF"
                        outline "#000000"
                ]
                LabelGraphics
                [
                        text    "0
$accept -> . unit "end of file"
unit -> . assignments exp
assignments -> . assignments assignment
assignments -> ."
                        fontSize        12
                        fontName        "Dialog"
                        anchor  "c"
                ]
        ]

(and tulip only segfaulted today because of some error.)

In the xsl have to add some routine to determine
string length and amount of lines to calculate
area for the text in the node, the (w,h) settings.

started reading books about xslt programming now
and not yet improved the gml output.

ps:
Also looked at phpsyntaxtree
http://code.google.com/p/phpsyntaxtree/
which has a GNU GPL tree layout algorithm done
in php, maybe usable for parsetree visualization.

And at gephi http://gephi.org/ which is
GNU GPL version 3 java visualization software.

Thanks.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]