The following example shows a typed syntax tree. This tree can either be drawn by the specialized algorithm for ``downward laid-out trees'' or by the normal algorithms. When the normal algorithms are used to draw a tree, it is advisable to increase the layout down factor in order to obtain good results (see Figure 22). If the layout down factor is not used, the incoming edges draw the nodes too much in the direction of the parent node.
A nice layout is achieved by the specialized tree algorithm with a tree factor of 0.9 (see Figure 23).
If an orthogonal layout is needed, the attribute smanhattan_edges can be used. For trees, this attribute is more appropriate than the standard Manhattan layout with manhattan_edges (see Figure 24).
Example 11: Syntax Tree
<>01 >graph: {
<>02 > title: "Typed Syntax Tree"
<>03 > node:
{ title:"503160" label: "Identifier\n
tst3 (0)" }
<>04 > node:
{ title:"503240" label: "Identifier\n
x (0)" }
<>05 > node:
{ title:"502952" label: "INTEGER" }
<>06 > node:
{ title:"503304" label: "VarDecl" }
<> > ...
<>29 > node:
{ title:"T0" label: "no type" }
<>30 > node:
{ title:"T1" label: "no type" }
<>31 > node:
{ title:"T2" label: "int" }
<> > ...
<>57 > edge: { sourcename:"503304" targetname:"503240" }
<>58 > edge: { sourcename:"503304" targetname:"502952" }
<> > ...
<>83 > nearedge: { sourcename:"503160" targetname:"T0" linestyle: dotted }
<>84 > nearedge: { sourcename:"503240" targetname:"T1" linestyle: dotted }
<>85 > nearedge: { sourcename:"502952" targetname:"T2" linestyle: dotted }
<> > ...
<>110 >}