-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroot.dot
80 lines (73 loc) · 2.47 KB
/
root.dot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/* AST node diagram generator script collection for M2C, M2J and M2Sharp.
*
* Copyright (c) 2016 The Modula-2 Software Foundation
*
* Author & Maintainer: Benjamin Kowarsch <org.m2sf>
*
* @synopsis
*
* The M2C, M2J and M2Sharp compilers are multi-dialect Modula-2 translators
* and compilers respectively targeting C99, Java/JVM and C#/CLR, sharing a
* common abstract syntax tree (AST) specification.
*
* The AST node diagram generator script collection consists of Graphviz DOT
* descriptions for all AST node types of the common AST specification.
*
* The Graphviz dot utility is required to generate the diagrams.
* It may be obtained from http://www.graphviz.org/download.php.
*
* @repository
*
* https://github.com/m2sf/m2-ast-node-diagrams
*
* @file
*
* root.dot
*
* AST root node diagram.
*
* Usage: $ dot root.dot -Tps > root.ps
*
* @license
*
* This is free software: you can redistribute and/or modify it under the
* terms of the GNU Lesser General Public License (LGPL) either version 2.1
* or at your choice version 3 as published by the Free Software Foundation.
* However, you may not alter the copyright, author and license information.
*
* It is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. Read the license for more details.
*
* You should have received a copy of the GNU Lesser General Public License.
* If not, see <https://www.gnu.org/copyleft/lesser.html>.
*
* NB: Components in the domain part of email addresses are in reverse order.
*/
/*** AST Root Node ***/
digraph AST {
graph [orientation=landscape,fontname=helvetica];
node [fontname=helvetica,fontsize=10,shape=box,height=0.25];
node [style=solid];
edge [arrowhead=normal];
AST -> { FILENAME OPTIONS compilationUnit };
compilationUnit [style=rounded];
node [style=filled,fillcolor=lightgrey];
FILENAME -> { "\"filename\"" };
node [style=filled,fillcolor=lightgrey];
OPTIONS -> { opt0 opt1 opt2 };
edge [style=invis]; node [width=0]; nodesep=0;
OPTIONS -> ellipsis;
edge [style=solid]; node [width=0.75]; nodesep=0.25;
OPTIONS -> optN;
opt0 [label="\"opt-0\""];
opt1 [label="\"opt-1\""];
opt2 [label="\"opt-2\""];
ellipsis [label="..."];
ellipsis [shape=none,fillcolor=none];
optN [label="\"opt-N\""];
node [style=solid,fillcolor=none];
edge [arrowhead=none];
compilationUnit -> { DEFMOD IMPMOD };
}
/* END OF FILE */