3 .\" The Sod module syntax
5 .\" (c) 2015 Straylight/Edgeware
8 .\"----- Licensing notice ---------------------------------------------------
10 .\" This file is part of the Sensible Object Design, an object system for C.
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.
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.
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.
26 .\"--------------------------------------------------------------------------
27 .so ../common/defs.man \" @@@PRE@@@
29 .\"--------------------------------------------------------------------------
30 .TH sod 5 "11 October 2015" "Straylight/Edgeware" "Sensible Object Design"
33 sod-module \- Sensible Object Design module syntax
35 .\"--------------------------------------------------------------------------
37 This manual page provides a highly compressed description of the
39 For full details, consult the main manual.
42 Anywhere a simple nonterminal name
44 may appear in the grammar,
52 On the left-hand side of a production rule,
57 are variables which vary over all nonterminal and terminal symbols,
58 and the variables may also appear on the right-hand side
59 in place of a nonterminal.
60 Such a rule stands for a family of rules,
61 in which each variable is replaced by
62 each possible simple nonterminal or terminal symbol.
64 The letter \*e denotes the empty nonterminal
69 The following indexed productions are used throughout the grammar, some often
70 enough that they deserve special notation.
75 denoting an optional occurrence of
90 .IR zero-or-more [ x ],
91 denoting a sequence of zero or more occurrences of
97 .IR zero-or-more [ x ]
107 .IR one-or-more [ x ]
108 denoting a sequence of one or more occurrences of
114 .IR one-or-more [ x ]
121 denotes a sequence of one or more occurrences of
135 .SS Special nonterminals
138 an S-expression, as parsed by the Lisp reader
142 a sequence of C tokens, with matching brackets
144 .\"--------------------------------------------------------------------------
192 .I extended-alpha-char
198 .I nonzero-digit-char
200 .I nonzero-digit-char
208 The characters matched by
209 .I extended-alpha-char
210 depend on the locale and the host Lisp system.
212 .SS String and character literals
216 .IR string-literal-char \**
222 .IR char-literal-char \**
225 .I string-literal-char
227 any character other than
237 any character other than
260 .I nonzero-digit-char
267 .IR binary-digit-char \*+
279 .IR octal-digit-char \*+
293 .IR hex-digit-char \*+
326 any non-alphanumeric character
357 any character other than
362 any character other than
379 any character other than newline
381 .\"--------------------------------------------------------------------------
396 .I typename-definition
402 .SS Simple definitions
421 .I typename-definition
424 .IR list [ identifier ]
427 .SS Literal code fragments
444 .IR list [ constraint ]
459 .SS Class definitions
463 .I class-forward-declaration
465 .I full-class-definition
467 .I class-forward-declaration
473 .I full-class-definition
480 .IR list [ identifier ]
483 .IR properties-class-item \**
486 .I properties-class-item
508 .IR declaration-specifier \*+
509 .IR list [ init-declarator ]
521 .IR list [ slot-initializer ]
538 .IR declaration-specifier \*+
539 .IR list [ init-declarator ]
558 .IR declaration-specifier \*+
559 .IR keyword-declarator [ identifier ]
566 .IR declaration-specifier \*+
567 .IR keyword-declarator [ dotted-name ]
584 .IR list [ property ]
650 .I declaration-specifier
711 .IR declaration-specifier \*+
712 .I abstract-declarator
747 are defined in the built-in module.
757 Declaration specifiers may appear in any order.
758 However, not all combinations are permitted.
759 A declaration specifier must consist of
763 .IR storage-specifier s,
764 and one of the following, up to reordering.
778 .BR "unsigned char" ,
782 .BR "unsigned short" ,
786 .BR "unsigned short int" ,
787 .B "signed short int"
796 .BR "unsigned long" ,
800 .BR "unsigned long int" ,
804 .BR "unsigned long long" ,
805 .B "signed long long"
807 .BR "long long int" ,
808 .BR "unsigned long long int" ,
809 .B "signed long long int"
815 .BR "float _Imaginary" ,
816 .BR "double _Imaginary" ,
817 .B "long double _Imaginary"
819 .BR "float imaginary" ,
820 .BR "double imaginary" ,
821 .B "long double imaginary"
823 .BR "float _Complex" ,
824 .BR "double _Complex" ,
825 .B "long double _Complex"
827 .BR "float complex" ,
828 .BR "double complex" ,
829 .B "long double complex"
831 .IR declarator [ k ", " a ]
834 .IR primary-declarator [ k ", " a ]
836 .IR primary-declarator [ k ", " a ]
841 .IR primary-declarator [ k ", " a ]
844 .IR primary-declarator [ k ", " a ]
845 .IR declarator-suffix [ a ]
852 .IR declarator-suffix [ a ]
867 .IR list [ argument ]
873 .IR declaration-specifier \*+
874 .I argument-declarator
876 .I abstract-declarator
878 .IR declarator "[\*e, " argument-list ]
880 .I argument-declarator
882 .IR declarator [ identifier " | \*e, " argument-list ]
886 .IR declarator [ identifier ", " argument-list ]
894 .I keyword-argument-list
898 .I keyword-argument-list
900 .I method-argument-list
904 .I keyword-argument-list
912 .IR keyword-declarator [ k ]
914 .IR declarator [ k ", " method-argument-list ]
916 .\"--------------------------------------------------------------------------
922 .\"--------------------------------------------------------------------------
924 Mark Wooding, <mdw@distorted.org.uk>
926 .\"----- That's all, folks --------------------------------------------------