-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsprut-4.html
224 lines (171 loc) · 8.57 KB
/
sprut-4.html
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="LinuxDoc-Tools 0.9.66">
<TITLE>SPRUT (internal representation description translator): SPRUT Usage</TITLE>
<LINK HREF="sprut-5.html" REL=next>
<LINK HREF="sprut-3.html" REL=previous>
<LINK HREF="sprut.html#toc4" REL=contents>
</HEAD>
<BODY>
<A HREF="sprut-5.html">Next</A>
<A HREF="sprut-3.html">Previous</A>
<A HREF="sprut.html#toc4">Contents</A>
<HR>
<H2><A NAME="s4">4.</A> <A HREF="sprut.html#toc4">SPRUT Usage</A></H2>
<P>
<BLOCKQUOTE><CODE>
<PRE>
SPRUT(1) User Manuals SPRUT(1)
NAME
sprut - internal representation description translator
SYNOPSIS
sprut [ -c++ -v -macro -only-macro -debug -pprefix -no-line -all
-access -set -new -free -free-graph -copy -copy-graph -equal -equal-
graph -check -check-graph -print -input -output -traverse -transform]
specification-file
DESCRIPTION
SPRUT (internal representation definition translator) generates stan‐
dard procedural interface ( SPI ) for work with internal representation
which is described in specification file. The specification file must
have suffix `.sprut'.
If the specification file is an extension (see language description)
of another specification file the later is also used to SPI generation
and so on.
SPI consists of interface and implementation files having the same
names as one of specification file and correspondingly suffixes `.h'
and `.c' (C code) or `.cpp' (C++ code).
Full documentation of SPRUT and SPI see in SPRUT User's manual.
OPTIONS
The options which are known for SPRUT are:
-c++ Output of C++ code instead of C code (which is default).
-v SPRUT outputs verbose warning information (about fields with the
same name in different node types, about repeated declaration of
a predefined type and so on) to standard error stream.
-statistics
SPRUT outputs statistic information (about number of (all,
abstract, double) node types, number of (all, double, synonym,
class, skeleton, others) fields) to standard output stream.
-flat SPRUT generates code for flat work with node fields. It means
that node fields declared in an abstract type are processed in
each place where fields of corresponding sub-type are processed.
By default SPRUT generates code which processes node fields
recursively (i.e. code for processing (e.g. copying) fields
declared in super types exists in one exemplar. The option
usage generates more fast code, but the code is considerably
bigger.
-flat-structure
SPRUT generates flat implementation of C/C++ structures corre‐
sponding to node types, i.e. node type is represented by C/C++
structure which contains members corresponding to all node
fields including fields declared in super types of given node
type. By default SPRUT generates the structures which contain
only members corresponding to fields declared only in given node
type and member whose type is structure corresponding to immedi‐
ate super type of given node type. This considerably decreases
number C/C++ declarations in interface file especially with many
node types with multi-level inheritance.
-fast This option forces to generate some tables as unpacked and as a
consequence to speed up code for access to fields. By default
the tables are generated as packed. This results in consider‐
able memory economy.
-long-node-size
IRTD generates many long tables which contain displacements rel‐
ative to begin of C/C++ structures which implement node types.
This option usage forces to represent the displacements as
unsigned long. As a consequence any size nodes can be used. By
default it is believed that size of structure implementing a
node is represented by byte, i.e. maximal size of C/C++ struc‐
tures which implement nodes is supposed to be not greater than
255 bytes and as a consequence much memory is economized. It
should be remember that function `IR_start' (see SPI) generated
in debugging mode checks correctness of real node sizes.
-short-node-size
This option usage forces to represent the displacements in
structures implementing node types as unsigned short. See also
option `-long-node-size'.
-macro SPRUT generates access macros and functions (see SPI). Only
option `-macro' or `only-macro' can be in SPRUT command line.
-only-macro
SPRUT generates macros instead of access functions (see SPI).
-debug SPRUT generates checking constraint determined by type sub-type
relations in node field declaration in modification functions
(see SPI). Also other checks (e.g. that a node has given field
and others) are fulfilled by SPI functions (but not macros) gen‐
erated under this option.
-pprefix
Generated SPI uses `prefix' instead of `IR_' for names of SPI
objects.
-no-line
SPRUT does not generate files containing numbered line direc‐
tives.
-all SPRUT generates all SPI functions. Its effect is equivalent to
presence of all subsequent options in the command line.
-access
SPRUT generates access functions (see SPI).
-set SPRUT generates modification functions (see SPI).
-new SPRUT generates node type specific creation functions (see SPI).
-free SPRUT generates function for deletion of nodes (see SPI).
-free-graph
SPRUT generates functions for deletion of graphs and nodes (see
SPI).
-copy SPRUT generates function for copying nodes (see SPI).
-copy-graph
SPRUT generates functions for copying graphs and nodes (see
SPI).
-equal SPRUT generates function for determination of nodes equality
(see SPI).
-equal-graph
SPRUT generates functions for determination of nodes and graphs
equality (see SPI).
-check SPRUT generates function for checking node constraints (see
SPI).
-check-graph
SPRUT generates functions for checking nodes and graphs con‐
straints (see SPI).
-print SPRUT generates function for printing nodes (see SPI).
-input SPRUT generates function for input of nodes (see SPI).
-output
SPRUT generates function for output of nodes (see SPI).
-traverse
SPRUT generates function for traversing graphs (see SPI).
-reverse-traverse
SPRUT generates function for reverse traversing graphs (see
SPI).
-transform
SPRUT generates functions for transforming acyclic graphs (see
SPI).
-no-node-name
SPRUT does not generate array containing node names (see SPI) if
it is not necessary. For example, the array is necessary when
function for print of nodes are generated.
FILES
file.sprut
SPRUT specification file
file.c
generated SPI implementation file
file.cpp
generated C++ implementation file
file.h
generated SPI interface file
There are no any temporary files used by SPRUT.
ENVIRONMENT
There are no environment variables which affect SPRUT behavior.
DIAGNOSTICS
SPRUT diagnostics is self-explanatory.
AUTHOR
Vladimir N. Makarov, [email protected]
SEE ALSO
msta(1), shilka(1), oka(1), nona(1). SPRUT manual.
BUGS
Please, report bugs to https://github.com/dino-lang/dino/issues.
COCOM 5 APR 2001 SPRUT(1)
</PRE>
</CODE></BLOCKQUOTE>
</P>
<HR>
<A HREF="sprut-5.html">Next</A>
<A HREF="sprut-3.html">Previous</A>
<A HREF="sprut.html#toc4">Contents</A>
</BODY>
</HTML>