lib/keyword.c (kw_parseempty): Use correct variable scanning `kwval' list.
[sod] / src / sod.1.in
... / ...
CommitLineData
1.\" -*-nroff-*-
2.\"
3.\" The Sod translator
4.\"
5.\" (c) 2015 Straylight/Edgeware
6.\"
7.
8.\"----- Licensing notice ---------------------------------------------------
9.\"
10.\" This file is part of the Sensible Object Design, an object system for C.
11.\"
12.\" SOD is free software; you can redistribute it and/or modify
13.\" it under the terms of the GNU General Public License as published by
14.\" the Free Software Foundation; either version 2 of the License, or
15.\" (at your option) any later version.
16.\"
17.\" SOD is distributed in the hope that it will be useful,
18.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
19.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20.\" GNU General Public License for more details.
21.\"
22.\" You should have received a copy of the GNU General Public License
23.\" along with SOD; if not, write to the Free Software Foundation,
24.\" Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25.
26.\"--------------------------------------------------------------------------
27.so ../common/defs.man \" @@@PRE@@@
28.
29.\"--------------------------------------------------------------------------
30.TH sod 1 "11 October 2015" "Straylight/Edgeware" "Sensible Object Design"
31.
32.SH NAME
33sod \- Sensible Object Design translator
34.
35.\"--------------------------------------------------------------------------
36.SH SYNOPSIS
37.B sod
38.RB [ \-Mp ]
39.RB [ \-\-backtrace ]
40.RB [ \-\-builtins ]
41.RB [ \-I
42.IR dir ]
43.RB [ \-d
44.IR dir ]
45.if !t \{\
46. br
47 \c
48.\}
49.RB [ \-e
50.IR lisp ]
51.RB [ \-l
52.IR file ]
53.RB [ \-t
54.IR out-type ]
55.IR sources ...
56.
57.\"--------------------------------------------------------------------------
58.SH DESCRIPTION
59.
60The
61.B sod
62program reads input files describing Sod modules,
63containing class definitions and other items,
64and generates output files,
65such as C source and header files.
66.
67.SS Command line
68The following command-line options are recognized.
69.TP
70.B "\-h, \-\-help"
71Write command-line help text to standard output,
72and exit successfully.
73.TP
74.B "\-V, \-\-version"
75Write Sod's version number to standard output,
76and exit successfully.
77.TP
78.B "\-u, \-\-usage"
79Write a brief usage message to standard output,
80and exit successfully.
81.TP
82.B "\-\-backtrace"
83Generate a Lisp stack backtrace if an error is encountered.
84This is useful when debugging,
85if
86.B sod
87reports unusual errors, or
88is complaining unjustifiably about something.
89.TP
90.B "\-\-builtins"
91Generate output for to the built-in module,
92which defines the root classes
93.B SodObject
94and
95.BR SodClass .
96For the purpose of naming output files,
97the built-in module is named
98.BR sod-base .
99.TP
100.BI "\-I, \-\-include=" dir
101Look for imported modules and extension files in directory
102.IR dir .
103This option may be repeated:
104directories are searched in the order they were named.
105.TP
106.B "\-M, \-\-track-dependencies"
107For each output
108.I file
109produced,
110write a Makefile fragment listing the files it depends on
111to
112.IB file -dep \fR.
113Does nothing if
114.B \-p
115is in force.
116.TP
117.BI "\-d, \-\-directory=" dir
118Write output files to directory
119.IR dir ,
120instead of the current directory.
121.TP
122.B "\-e, \-\-eval=" lisp
123Evaluate the Lisp forms in
124.IR lisp ,
125in order.
126Nothing is printed:
127if you want output, write Lisp to print it.
128Forms are evaluated in the
129.B SOD-USER
130package.
131.TP
132.B "\-l, \-\-load=" file
133Load and evaluate Lisp code from
134.IR file .
135The file is loaded into the
136.B SOD-USER
137package.
138.TP
139.B "\-p, \-\-stdout"
140Write output to standard output,
141instead of to files.
142.TP
143.BI "\-t, \-\-type=" out-type
144Produce output of type
145.IR out-type .
146Output types can be defined by extensions.
147The built-in output types are described below.
148.PP
149Each
150.I source
151file named on the command-line
152is read and parsed as a Sod module:
153see
154.BR sod-module (5)
155for the built-in syntax.
156An output file is written for each module read,
157and the built-in module if the
158.B \-\-builtins
159option was given,
160and for each output type requested using the
161.B \-t
162option.
163At least one output type must be provided.
164.
165.SS Output types
166If a module is read from a file named
167.IB name . ext
168where
169.I ext
170doesn't contain a dot
171.RB (` . '),
172or if the file has a simple
173.I name
174which doesn't contain a dot
175(except possibly an initial one),
176then the module's name is
177.IR name .
178It is conventional for module files to be named
179.IB name .sod \fR.
180Output file names are determined by the module name,
181the output type,
182and the output directory
183.I dir
184specified by the
185.B \-d
186option.
187.PP
188The following output types are defined.
189.TP
190.B c
191Write C source,
192suitable for standalone compilation,
193defining the necessary direct and effective method functions
194and static tables
195for the classes defined in the module.
196The output file is named
197.IB dir / name .c \fR.
198.TP
199.B h
200Write a C header file,
201suitable for inclusion using
202.BR #include ,
203declaring the necessary data structures and functions
204for the classes defined in the module.
205The output file is named
206.IB dir / name .h \fR.
207.
208.\"--------------------------------------------------------------------------
209.SH SEE ALSO
210.BR sod (3),
211.BR sod-structs (3),
212.BR sod-module (5).
213.
214.\"--------------------------------------------------------------------------
215.SH AUTHOR
216Mark Wooding, <mdw@distorted.org.uk>
217.
218.\"----- That's all, folks --------------------------------------------------