diff -Nru icmake-8.00.05/build icmake-8.01.00/build --- icmake-8.00.05/build 2015-12-17 17:45:54.000000000 +0000 +++ icmake-8.01.00/build 2016-02-01 14:36:51.000000000 +0000 @@ -31,7 +31,7 @@ ./icm_prepare $action fi -for dir in rss icm-comp icm-exec icm-pp icmun +for dir in rss icm-comp icm-exec icm-pp icmun icmake do cd $dir echo $dir diff -Nru icmake-8.00.05/changelog icmake-8.01.00/changelog --- icmake-8.00.05/changelog 2015-12-21 13:12:38.000000000 +0000 +++ icmake-8.01.00/changelog 2016-02-13 13:58:31.000000000 +0000 @@ -1,3 +1,47 @@ +icmake (8.01.00) + +* Added builtin functions 'strchr', 'listfind', and 'listunion'. See 'man + icmake' for details. + +* Fixed a bug in icmake's option handling due to which options could not be + forwarded to called scripts. + +* Fixed a bug in the compilation of ternary expressions: the condition wasn't + explicitly converted to bool, causing constructions like 'ret = fun() ? ...' + to fail. + +* The 'icmstart' script was modified, improving control over which files + should initially be installed (see 'man icmstart' and 'man icmstart.rc' for + details. + +* Icmake's predefined function stat(P_NOCHECK, entry) returns, if `entry' + does not exist, a list having two elements: list[0] == 0, list[1] == -1. + +* The builtin function 'getch()' now prints one newline character when the + user presses 'Enter' (previously 2 newlines were printed). + +* The main() function must have return type 'void' (this was already required + in earlier versions, but is now enforced). + +* When defining executable icmake scripts using + #!/usr/bin/icmake -t + -t. indicates that the temporary .bim file must be defined in icmake's + temporary directory, using icmake's pid and the .bim suffix as its filename. + +* When PARSER-related specifications are not used, they can all be removed + from 'icmconf' files. + +* When SCANNER-related specifications are not used, they can all be removed + from 'icmconf' files. + +* Support for using 'grambuild' (superfluous since 2008) was removed from + 'icmbuild' + +* Updated the manpages and examples (examples now use -t. + rather than -qt /tmp/...) + + -- Frank B. Brokken Sat, 13 Feb 2016 13:40:10 +0100 + icmake (8.00.05) * Fixed typo in the icmconf manpage: diff -Nru icmake-8.00.05/debian/changelog icmake-8.01.00/debian/changelog --- icmake-8.00.05/debian/changelog 2015-12-23 04:51:08.000000000 +0000 +++ icmake-8.01.00/debian/changelog 2016-02-14 18:26:32.000000000 +0000 @@ -1,3 +1,15 @@ +icmake (8.01.00-1) unstable; urgency=medium + + [ Frank B. Brokken ] + * New upstream release defines new builtin functions, extends the facilities + of the icmstart script, repairs some bugs, and implements various cosmetic + improvements. + + [ tony mancill ] + * Add manpage-typos.patch. + + -- tony mancill Sun, 14 Feb 2016 10:26:18 -0800 + icmake (8.00.05-1) unstable; urgency=medium [ Frank B. Brokken ] diff -Nru icmake-8.00.05/debian/patches/manpage-typos.patch icmake-8.01.00/debian/patches/manpage-typos.patch --- icmake-8.00.05/debian/patches/manpage-typos.patch 1970-01-01 00:00:00.000000000 +0000 +++ icmake-8.01.00/debian/patches/manpage-typos.patch 2016-02-14 18:26:32.000000000 +0000 @@ -0,0 +1,20 @@ +--- a/doc/icmake.1 ++++ b/doc/icmake.1 +@@ -504,7 +504,7 @@ + do not have to exist: if both don\(cq\&t exist 0 is returned; if \fIb\fP doesn\(cq\&t + exist, 1 is returned; if \fIa\fP doesn\(cq\&t exist 0 is returned; if they are + equally old 0 is returned\&. (the \fIexists()\fP predefined function (see below, +-section \fBPREDEFINED FUNCTIONS\fP) can be used to test explicity whether a file ++section \fBPREDEFINED FUNCTIONS\fP) can be used to test explicitly whether a file + exists)\&. + .IP + .IP o +@@ -672,7 +672,7 @@ + .br + A complementary \fIdo \&.\&.\&. while()\fP statement is not available\&. Note + that defining a variable, using an initialization expression means +-that the intialization expressing is executed at each iteration of the ++that the initialization expressing is executed at each iteration of the + \fIwhile\fP statement\&. So the following statement will never end, and + will display a never ending stream of values 10: + .nf diff -Nru icmake-8.00.05/debian/patches/series icmake-8.01.00/debian/patches/series --- icmake-8.00.05/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ icmake-8.01.00/debian/patches/series 2016-02-14 18:26:32.000000000 +0000 @@ -0,0 +1 @@ +manpage-typos.patch diff -Nru icmake-8.00.05/debian/watch icmake-8.01.00/debian/watch --- icmake-8.00.05/debian/watch 2015-12-23 04:51:08.000000000 +0000 +++ icmake-8.01.00/debian/watch 2016-02-14 18:26:32.000000000 +0000 @@ -1,3 +1,3 @@ version=3 -https://www.icce.rug.nl/debian/icmake/icmake_([\d\.]+)\.tar\.gz \ -debian uupdate +opts=filenamemangle=s/.+\/v?(\d\S*)\.tar\.gz/icmake-$1\.tar\.gz/ \ + https://github.com/fbb-git/icmake/tags .*/v?(\d\S*)\.tar\.gz diff -Nru icmake-8.00.05/doc/icmake.1 icmake-8.01.00/doc/icmake.1 --- icmake-8.00.05/doc/icmake.1 2015-12-21 13:14:30.000000000 +0000 +++ icmake-8.01.00/doc/icmake.1 2016-02-13 14:03:43.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "icmake" "1" "1992\-2015" "icmake\&.8\&.00\&.05\&.tar\&.gz" "A program maintenance utility" +.TH "icmake" "1" "1992\-2016" "icmake\&.8\&.01\&.00\&.tar\&.gz" "A program maintenance utility" .PP .SH "NAME" @@ -29,17 +29,17 @@ special operators as well as a set of support functions that have proven to be useful in program maintenance\&. .PP -The program \fBicmun\fP(1) can be used to disassemble the compiled -byte\-code (\&.bim) file\&. \fIIcmun\fP is primarily used for illustration, education -and debugging\&. +The program \fBicmun\fP(1) can be used to disassemble the compiled byte\-code +(\&.bim) file\&. \fIIcmun\fP is primarily used for illustration, education, and +debugging\&. .PP Traditional make\-utilities recompile sources once header files are modified\&. In the context of \fBC++\fP program development this is often a bad idea, as adding a new member to a class does not normally require you to -recompile the class\(cq\&s sources\&. To handle class dependencies in a more sensible -way, \fBicmbuld\fP(1) may inspect \fICLASSES\fP files that can be used to define -dependencies among classes\&. By default, class\-dependencies are not -interpreted\&. See also the \fBicmconf\fP(7) man\-page for further details\&. +recompile the class\(cq\&s sources\&. To handle class dependencies \fBicmbuld\fP(1) may +inspect \fICLASSES\fP files that can be used to define dependencies among +classes\&. By default, class\-dependencies are not interpreted\&. Refer to the +\fBicmconf\fP(7) man\-page for further details\&. .PP .SH "OPTIONS" @@ -49,94 +49,107 @@ .IP o \fIsource\fP: \fBicmake\fP script source file (default extension: \fI\&.im\fP)\&. .IP o -\fIdest\fP: binary \fBicmake\fP script file (default: \fI`source\(cq\&\&.bim\fP)\&. +\fIdest\fP: binary \fBicmake\fP script file (default: \fI`source\(cq\&\&.bim\fP, called +the `\&.bim file\(cq\& below)\&. .IP o -\fI\-\-\fP: \fBicmake\fP arguments separator for arguments passed to -\fIicm\-exec\fP -.br -\fIargs\fP: arguments following \fI\-\-\fP are passed to \fIicm\-exec\fP as\-is -as its arguments, and are available from \fBicmake\fP\-sctipt\(cq\&s -\fImain()\fP function\(cq\&s \fIlist argv\fP parameter (see below at -section \fBUSER DEFINED FUNCTIONS\fP)\&. - -.PP -the following options are available\&. The \fI\-h\fP option overrules all other -options, the \fI\-a\fP option overrules all other options except for \fI\-h\fP\&. Of -the remaining action options (\fI\-b, \-c, \-e, \-i, \-p\fP and \fI\-t\fP) only one may -be specified: +\fI\-\-\fP: \fBicmake\fP arguments separator separating \fBicmake\fP arguments from +arguments passed to the \&.bim filenl() +\fIargs\fP: arguments following \fI\-\-\fP are passed to the \&.bim file +as\-is, and are available from the \fIlist argv\fP parameter defined +as the \fBicmake\fP script\(cq\&s \fImain\fP function\(cq\&s second parameter (see +below at section \fBUSER DEFINED FUNCTIONS\fP)\&. For some options +(see below) the \fI\-\-\fP separator is not required\&. + +.PP +\fBIcmake\fP supports various options, described next\&. The \fI\-h\fP option +overrules all other options, the \fI\-a\fP option overrules all other options +except for \fI\-h\fP\&. Of the remaining action options (\fI\-b, \-c, \-e, \-i, \-p\fP and +\fI\-t\fP) only one may be specified: .IP o \fB\-a\fP .br -show information about \fBicmake\fP, overruled by \fI\-h\fP +show information about \fBicmake\fP, overruled by \fI\-h\fP; .IP o \fB\-b\fP .br -discontinued\&. Option \-e can be used instead +discontinued: use option \-e instead; .IP o \fB\-c\fP .br -the \fBicmake\fP source file is compiled +the \fBicmake\fP source file is compiled, generating a \&.bim file; .IP o \fB\-e\fP .br -execute the \fBicmake\fP \&.bim file, given as first argument +execute the \fBicmake\fP \&.bim file, given as \fBicmake\fP\(cq\&s first file +argument\&. Any additional arguments are passed to the \&.bim file as\-is, +and \fI\-\-\fP should not be specified; .IP o \fB\-F\fP .br the filenames and flags as well as an overview of all actions to -be performed by \fBicmake\fP are shown on the standard output stream +be performed by \fBicmake\fP are shown on the standard output stream; +.IP o +\fB\-h\fP +.br +provide usage info and end \fBicmake\fP; .IP o \fB\-i\fP .br -the first argument is the \fBicmake\fP source file, the default -binary file is constructed if necessary and all additional -arguments are passed to \fIicm\-exec\fP `as is\(cq\&\&. +the first argument is the \fBicmake\fP source file, the default binary +file is constructed if necessary\&. Any additional arguments are passed +to the \&.bim file as\-is, and \fI\-\-\fP should not be specified; .IP o \fB\-p\fP .br -the \fBicmake\fP source file is only preprocessed, output is the -preprocessed only the preprocessor is activated +the \fBicmake\fP source file is only preprocessed, and the preprocessed +file is written to \fBicmake\fP\(cq\&s second +file argument (by default \fI`source\(cq\&\&.pim\fP); .IP o \fB\-q\fP .br -ignored -.IP o -\fB\-T\fP -.br -this option must be provided with the name of a directory which -is used to store temporary files\&. E\&.g\&., when compiling an \fBicmake\fP -script, the output of \fBicmake\fP\(cq\&s preprocessor is a temporary file which -is removed on exit\&. By default \fI/tmp\fP is used, unless \fI/tmp\fP is -not a writable directory, in which case the current user\(cq\&s \fI$HOME\fP -directory is used\&. Implicit temporary filenames always start with the -process id of the current \fBicmake\fP process\&. +ignored, will be removed in a future \fBicmake\fP version; .IP o \fB\-t\fP .br -the argument following \fI\-t\fP is the name of a temporary \fI\&.bim\fP -file, which is removed after \fBicmake\fP\(cq\&s call\&. The next argument is the -name of the \fBicmake\fP script, and all additional arguments are passed as -arguments to the \fBicmake\fP script\&. After making an \fBicmake\fP\-script executable -(\fIchmod +x script\fP), and providing it with an initial line like -this: +the argument following \fI\-t\fP is the name of a temporary \&.bim +file, which is removed after \fBicmake\fP\(cq\&s call\&. When \fI\&.\fP is specified as +the name of the temporary \&.bim file then the default temporary +directory, followed by \fBicmake\fP\(cq\&s process\-id, followed by \fI\&.bim\fP is +used\&. +.IP +Following the name of the temporary \&.bim file the name of the \fBicmake\fP +source script must be specified\&. Any additional arguments are passed +to the \&.bim file as\-is, and \fI\-\-\fP should not be specified; After +setting the source script file\(cq\&s executable flag (\fIchmod +x +script\fP), and providing it with an initial line like this: .nf - #!/usr/bin/icmake \-t /tmp/script + #!/usr/bin/icmake \-t\&. .fi -the script can directly be called: +the \fBicmake\fP script can directly be called: .nf script arg1 arg2 .fi in which case the \fBicmake\fP script \fI`script\(cq\&\fP is executed while it -received the three arguments \fIscript arg1 arg2\fP\&. +receives the arguments \fIscript arg1 arg2\fP\&. .IP .IP o +\fB\-T\fP +.br +this option must be provided with the name of a directory which +is used to store temporary files\&. E\&.g\&., when compiling an \fBicmake\fP +script, the output of \fBicmake\fP\(cq\&s preprocessor is a temporary file which +is removed on exit\&. By default \fI/tmp\fP is used, unless \fI/tmp\fP is +not a writable directory, in which case the current user\(cq\&s \fI$HOME\fP +directory is used\&. Implicit temporary filenames always start with the +process id of the current \fBicmake\fP process\&. +.IP o \fB\-v\fP .br -displays \fBicmake\fP\(cq\&s version number, and ends \fBicmake\fP, +display \fBicmake\fP\(cq\&s version number, and end \fBicmake\fP, overruled by \fI\-h\fP .PP @@ -165,83 +178,94 @@ (without extension) contains .nf - #!/usr/bin/icmake \-qi + #!/usr/bin/icmake \-i .fi then \fIicm\fP may be issued as a command, thus executing .nf - /usr/bin/icmake \-qi icm \&.\&.\&. + /usr/bin/icmake \-i icm \&.\&.\&. .fi Alternatively, .nf - #! /usr/bin/icmake \-qt /tmp/icm + #!/usr/bin/icmake \-t /tmp/icm .fi may be used, resulting in the execution of .nf - #! /usr/bin/icmake \-qt /tmp/icm icm \&.\&.\&. + #!/usr/bin/icmake \-t /tmp/icm icm \&.\&.\&. .fi -In this case the binary file is removed on exit\&. The PID extension being -the process\-id of the \fBicmake\fP program executing \fIicm\fP\&. +In this case the binary file is removed on exit\&. +.IP .IP o \fI#include \(dq\&filename\(dq\&\fP .br The file \fIfilename\fP is included at the location of the directive +.IP .IP o \fI#include \fP .br -The file \fIfilename\fP is included at the -location of the \fI#include\fP directive; \fIfilename\fP is searched in -the colon\-separated directories specified by the \fIIM\fP environment -variable\&. The first occurrence of \fIfilename\fP in the directories -specified by the \fIIM\fP environment variable is used\&. +The file \fIfilename\fP is included at the location of the \fI#include\fP +directive; \fIfilename\fP is searched in the colon\-separated directories +specified by the \fIIM\fP environment variable\&. The first occurrence of +\fIfilename\fP in the directories specified by the \fIIM\fP environment +variable is used\&. +.IP .IP o \fI#define identifier [definition]\fP .br -The text \fIidentifier\fP will be -replaced by \fIdefinition\fP\&. The definition may contain references to -already defined identifiers, using the \fI${identifier}\fP format\&. If -the \fI${identifier}\fP hasn\(cq\&t been defined (yet), the text -\fI${identifier}\fP is literally kept\&. To prevent infinite recursion at -most 100 \fI${identifier}\fP replacements are allowed\&. -.IP -Definitions -continue at the next line if the last character on a line is a -backslash (\fI\e\fP) (which is not included in the definition)\&. Double -quoted strings in definitions are kept as is\&. Multiple blanks in -definitions are contracted to a single blank space\&. -.IP -A definition is optional\&. If omitted, the macro is defined, so it can -be used in \fI#if(n)def\fP directives (see below), but in they are not -replaced by any text in \fBicmake\fP code statements\&. +The text \fIidentifier\fP will be replaced by \fIdefinition\fP\&. The +definition may contain references to already defined identifiers, +using the \fI${identifier}\fP format\&. If the \fI${identifier}\fP hasn\(cq\&t +been defined (yet), the text \fI${identifier}\fP is literally kept\&. To +prevent infinite recursion at most 100 \fI${identifier}\fP replacements +are allowed\&. +.IP +Definitions continue at the next line if the last character on a line +is a backslash (\fI\e\fP)\&. (which is not included in the +definition)\&. The preprocessor concatenates double\-quuted strings, and +double quoted strings may not span multiple lines\&. Multiple blanks +(outside of double quoted strings) in definitions are contracted to a +single blank space\&. +.IP +The definition following the \fI#define\(cq\&s\fP identifier is optional\&. If +omitted, the macro is defined, so it can be used in \fI#if(n)def\fP +directives (see below), but they are not replaced by any text in +\fBicmake\fP code statements\&. +.IP .IP o \fI#ifdef identifier\fP .br -If the \fIidentifier\fP macro was defined the next block of code (until -a matching \fI#else\fP or \fI#endif\fP directive was detected) is +If the \fIidentifier\fP macro was defined the next block of code (until a +matching \fI#else\fP or \fI#endif\fP directive was read) is byte\-compiled\&. Otherwise, the block of code is ignored\&. +.IP .IP o \fI#ifndef identifier\fP .br If the \fIidentifier\fP macro was \fInot\fP defined the next block of code (until a matching \fI#else\fP or \fI#endif\fP directive was detected) is byte\-compiled\&. Otherwise, the block of code is ignored\&. +.IP .IP o \fI#else\fP .br Terminates a \fI#ifdef\fP and \fI#ifndef\fP directive, reversing the -acceptance decision about the following code\&. Only one \fI#else\fP +acceptance decision about the following code\&. Only one \fI#else\fP directive can be associated with \fI#if(n)def\fP directives\&. +.IP .IP o \fI#endif\fP .br Terminates the preprocessor block starting at the matching -\fI#ifdef\fP, \fI#ifndef\fP or \fI#else\fP directive\&. +\fI#ifdef\fP, \fI#ifndef\fP or \fI#else\fP directive\&. The \fI#endif\fP +directory and its matching \fI#if(n)def\fP directive must be specified +in the same file\&. +.IP .IP o \fI#undef identifier\fP .br @@ -254,7 +278,7 @@ .SH "DATA TYPES" .PP -\fBIcmake\fP supports three data types: +\fBIcmake\fP supports these data types: .IP o \fIASCII character constants\fP .br @@ -284,7 +308,7 @@ .br Text variables\&. String constants are delimited by double quotes\&. Multiple string constants may be concatenated, but a single -string constant may not extend over multiple lines\&. String constants +string constant may not span multiple lines\&. String constants separated by white space only (i\&.e\&., blanks, newlines, comment) are concatenated and represent one single string constant\&. To indicate an end\-of\-line in a string constant use the \fI\en\fP escape sequence\&. @@ -311,17 +335,17 @@ return a value\&. .PP -Variables may be defined at the global level as well as at any local level -within functions\&. When defined inside functions, the standard \fBC\fP scoping +Variables can be defined at the global level as well as at any local level +inside functions\&. When defined inside functions, the standard \fBC\fP scoping and visibility rules apply\&. E\&.g\&., local variables can only be used in their own or in more deeply nested blocks, their visibility is masked in more deeply nested blocks by defining an identically named variable inside those more -deeply nested blocks\&. Variables are strongly typed\&. A variable cannot have +deeply nested blocks\&. Variables are strongly typed, and cannot have type \fIvoid\fP\&. .PP -Variables may be initialized once they are defined\&. Initializations can -use expressions, using predefined functions, constant values and values of -variables that are visible at the point of definition\&. +Variables may be initialized when they are defined\&. Initializations are +expressions, that can use pre\- or user\-defined functions, constant values, and +values of variables that are visible at the point of definition\&. .PP .SH "PREDEFINED CONSTANTS" @@ -437,22 +461,25 @@ .PP \fBint\-typed operand(s):\fP .PP -All \fBC\fP operators (except for pointers, as \fBicmake\fP does not support -pointers) are supported, operating like their \fBC\fP counterparts on \fIint\fP -expressions\&. +All \fBC\fP operators are available (except for pointer operators, as \fBicmake\fP +does not support pointers)\&. They operate like their \fBC\fP\-programming language +counterparts\&. .PP \fBstring\-typed operand(s):\fP .PP -For \fIstring\fP type variables and/or values the following -operators are available: +For \fIstring\fP type variables and/or constants the following +operators are available (\fIa\fP and \fIb\fP represent \fIstring\fP variables or +constants): +.PP .IP o \fIa + b\fP: returns a new \fIstring\fP value containing the concatenation of \fIstring\fP values \fIa\fP and \fIb\fP\&. Note that \fIstring\fP constants may be -concatetated without using the \fI+\fP operator, e\&.g\&., +directly concatetated (without using the \fI+\fP operator), e\&.g\&., the following +two lines both define the string \fI\(dq\&hello world\(dq\&\fP: .nf - \(dq\&hello \(dq\& \(dq\&world\(dq\& - \(dq\&hello \(dq\& + \(dq\&world\(dq\& +\(dq\&hello \(dq\& \(dq\&world\(dq\& +\(dq\&hello \(dq\& + \(dq\&world\(dq\& .fi @@ -465,44 +492,48 @@ string comparisons: operators \fI== != <= >= < > !=\fP and \fI==\fP may be applied to \fIstring\fP values or variables, returning 1 if the comparison succeeds, otherwise 0\&. Comparison is case sensitively, and follows the -\fIASCII\fP character set\&. +ordering or characters as defined in the \fIASCII\fP character set\&. .IP .IP o -\fI!a\fP: the boolean \fI!\fP operator returns 1 if the \fIstring a\fP is +\fI!a\fP: the boolean \fI!\fP (not) operator returns 1 if the \fIstring a\fP is empty, otherwise 0 is returned\&. .IP .IP o \fIa younger b, a newer b\fP: returns 1 if file \fIa\fP is more recent than -file \fIb\fP\&. E\&.g\&., \fI\(dq\&source\&.cc\(dq\& newer \(dq\&source\&.o\(dq\&\fP\&. If \fIb\fP doesn\(cq\&t exist, 1 -is returned; if \fIa\fP doesn\(cq\&t exist 0 is returned; if neither \fIa\fP nor \fIb\fP -exists, 0 is returned; if they are of the same age, 0 is returned\&. Explicit -tests for the existence of a file can be performed using the \fIexists()\fP -predefined function (see below, section \fBPREDEFINED FUNCTIONS\fP)\&. +file \fIb\fP\&. E\&.g\&., \fI\(dq\&source\&.cc\(dq\& newer \(dq\&source\&.o\(dq\&\fP\&. The files \fIa\fP and \fIb\fP +do not have to exist: if both don\(cq\&t exist 0 is returned; if \fIb\fP doesn\(cq\&t +exist, 1 is returned; if \fIa\fP doesn\(cq\&t exist 0 is returned; if they are +equally old 0 is returned\&. (the \fIexists()\fP predefined function (see below, +section \fBPREDEFINED FUNCTIONS\fP) can be used to test explicity whether a file +exists)\&. .IP .IP o \fIa older b\fP: turns 1 if file \fIa\fP is older than file \fIb\fP\&. E\&.g\&., -\fI\(dq\&libprog\&.a\(dq\& older \(dq\&source\&.o\(dq\&\fP\&. If \fIa\fP doesn\(cq\&t exist, 1 is returned; if -\fIb\fP doesn\(cq\&t exist 0 is returned; if neither \fIa\fP nor \fIb\fP exists, 0 is -returned; if they are of the same age, 0 is returned\&. +\fI\(dq\&libprog\&.a\(dq\& older \(dq\&source\&.o\(dq\&\fP\&. The files \fIa\fP and \fIb\fP do not have to +exist: if both don\(cq\&t exist 0 is returned; if \fIa\fP doesn\(cq\&t exist, 1 is +returned; if \fIb\fP doesn\(cq\&t exist 0 is returned; if they are equally old 0 is +returned\&. .IP .IP o -\fI[]\fP: the index operator is defined as an alternative to the built\-in -function \fIelement\fP\&. It can only be applied (as holds true for \fIelement()\fP -as well) as so\-called \fIrvalue\fP\&. Therefore, constructions like: +\fI[]\fP: the index operator retrieves a character from a string variable +or constant: it returns a string as an \fIrvalue\fP\&. Therefore, the following +statement compiles OK: .nf - // assume str1 and str2 are strings - str1 = str2[3] + // assume str1 and str2 are strings +str1 = str2[3]; .fi -will be accepted, but the following construction will not be accepted: +but the following statement won\(cq\&t compile: .nf - str2[3] = str; // won\(cq\&t compile +str2[3] = \(dq\&a\(dq\&; .fi .IP +An empty string is returned if an invalid index value is provided\&. +.IP .IP o The `backtick` operator (\fI`string cmd`\fP) .br @@ -512,13 +543,13 @@ that the command could not be executed\&. A command that could be executed but did not produce any output returns a list containing one empty element\&. The command\(cq\&s standard error stream output is not -automatically collected\&. Standard shell redirection could be used to -collect the standard error stream\(cq\&s output as well\&. Example: +collected by the backtick operator\&. However, standard shell +redirection could be used to collect the standard error stream\(cq\&s +output\&. Example: .nf - string s = \(dq\&ls\(dq\&; - printf(`s`); // prints the elements in the current - // directory +printf(`\(dq\&ls\(dq\&`); // prints the elements in + // the current directory .fi The predefined function \fIeval(string cmd)\fP behaves exactly like the @@ -533,11 +564,13 @@ \fIa + b\fP: returns a new \fIlist\fP value containing the concatenation of \fIlist\fP values \fIa\fP and \fIb\fP\&. This is \fInot\fP a set operation: if an element appears both in \fIa\fP and in \fIb\fP, they will appear twice in the -resulting list\&. +resulting list (set\-addition is provided by the built\-in function +\fIlistunion\fP)\&. .IP .IP o \fIa \- b\fP: returns a new \fIlist\fP value containing the elements in \fIa\fP -that are not present in \fIb\fP\&. This \fIis\fP a set operation\&. +that are not present in \fIb\fP\&. This \fIis\fP a set\-difference operation: the +returned list contains all elements in \fIa\fP that are not elements of \fIb\fP\&. .IP .IP o \fIa += b\fP: elements in \fIb\fP are added to the elements in \fIa\fP, which @@ -545,34 +578,36 @@ .IP .IP o \fIa \-= b\fP: elements in \fIb\fP are removed from the elements in \fIa\fP, -which must be a \fIlist\fP variable\&. This \fIis\fP a set operation\&. +which must be a \fIlist\fP variable\&. This \fIis\fP a set operation: all elements +of \fIa\fP that are found in \fIb\fP are removed from \fIa\fP\&. .IP .IP o list equality comparisons: operators \fI!=\fP and \fI==\fP may be applied to \fIlist\fP values or variables\&. Operator \fI==\fP returns 1 if both lists have -element\-by\-element identical elements, 0 otherwise\&. Operator \fI!=\fP reverses -the result of \fI==\fP\&. +element\-by\-element identical elements, otherwise 0 is returned\&. Operator +\fI!=\fP reverses the result of \fI==\fP\&. .IP .IP o \fI!a\fP: the boolean \fI!\fP operator returns 1 if the \fIlist a\fP is empty, otherwise 0 is returned\&. .IP .IP o -\fI[]\fP: the index operator is defined as an alternative to the built\-in -function \fIelement\fP\&. It can only be applied (as holds true for \fIelement()\fP -as well) as so\-called \fIrvalue\fP\&. Therefore, constructions like: +\fI[]\fP: the index operator retrieves a list element from a list variable: +it returns a string as an \fIrvalue\fP\&. Therefore, the following statement +compiles OK: .nf - // assume lst is a list, str is a string - str = lst[3] + // assume lst is a list, str is a string +str = lst[3]; .fi -will be accepted, but the following construction will not be accepted: +but the following statement won\(cq\&t compile: .nf - lst[3] = str; // won\(cq\&t compile +lst[3] = str; .fi +An empty string is returned if an invalid index value is provided\&. .PP \fBCasting:\fP @@ -582,13 +617,13 @@ .IP o Strings to ints and vice versa (\fI(int)\(dq\&123\(dq\&, (string)55\fP) .IP o -Strings may be cast to lists (\fIlist lst = (list)\(dq\&hello\(dq\&\fP) +Strings to lists (\fIlist lst = (list)\(dq\&hello\(dq\&\fP) .PP .SH "FLOW CONTROL" .PP -\fBIcmake\fP offers the following subset of \fBC\fP\(cq\&s statement types\&. They can be +\fBIcmake\fP offers the following subset of \fBC\fP\(cq\&s statements\&. They can be used as in the \fBC\fP programming language\&. .IP o \fIexpression ;\fP @@ -605,7 +640,7 @@ .IP o \fIif (condition) statement\fP .br -A variable may be defined and initialized within the condition\&. E\&.g, +Inside the condition a variable may be defined and initialized\&. E\&.g, .nf if (string str = getText()) @@ -619,48 +654,64 @@ .IP o \fIif (condition) statement else statement\fP .br -As with the previous statement, a variable may be defined and -initialized within the condition\&. +As with the previous statement, inside the condition a variable may be +defined and initialized\&. .IP .IP o \fIfor (init; condition; increment) statement\fP .br Variables (of a single type) may be initialized (and optionally be defined) in the \fIinit\fP section\&. The \fIinit\fP, \fIcondition\fP and -\fIincrement\fP sections may be left empty\&. The empty condition section +\fIincrement\fP sections may remain empty\&. The empty condition section is interpreted as `always \fItrue\fP\(cq\&\&. .IP .IP o \fIwhile (condition) statement\fP .br -A variable may be defined and initialized within the condition\&. +Inside the condition a variable may be defined and initialized\&. .br -A complementary \fIdo \&.\&.\&. while()\fP statement is not available\&. +A complementary \fIdo \&.\&.\&. while()\fP statement is not available\&. Note +that defining a variable, using an initialization expression means +that the intialization expressing is executed at each iteration of the +\fIwhile\fP statement\&. So the following statement will never end, and +will display a never ending stream of values 10: +.nf + +while (int x = 10) + printf(x\-\-, \(dq\&\en\(dq\&); + +.fi + .IP .IP o -\fIreturn\fP +\fIreturn;\fP, and \fIreturn expression;\fP .br -Plain \fIreturn\fP statements can be used for \fIvoid\fP functions, -and \fIreturn expression\fP statements are used for other -functions\&. The function \fImain\fP by default returns 0; other functions -do not use default return values\&. +Plain \fIreturn\fP statements can be used in \fIvoid\fP functions, +and \fIreturn expression\fP statements are used in other type of +functions\&. The function \fImain\fP has return type \fIvoid\fP and so in +\fImain\fP only plain \fIreturn\fP statements can be used\&. +By default an \fBicmake\fP script\(cq\&s exit value equals 0\&. Use the built\-in +function \fIexit\fP (see below) to specify any other exit value\&. +.IP +\fBBe advised: \fP the behavior of non\-void functions not returning +values is undefined\&. .IP .IP o \fIbreak\fP .br -To leave \fIfor\fP and \fIwhile\fP statements, overruling the statement\(cq\&s +Leaves \fIfor\fP and \fIwhile\fP statements, overruling the statement\(cq\&s condition\&. .IP .IP o \fIcontinue\fP .br -To continue with the next iteration of a \fIfor\fP or \fIwhile\fP +Continues with the next iteration of a \fIfor\fP or \fIwhile\fP statement\&. .IP .IP o \fIexit(expression)\fP .br -To end the execution of an \fBicmake\fP\-script\&. The \fIexpression\fP must +Ends the execution of an \fBicmake\fP\-script\&. The \fIexpression\fP must evaluate to an \fIint\fP value, which becomes the script\(cq\&s exit value\&. .PP @@ -668,7 +719,7 @@ .PP \fBIcmake\fP offers the following predefined functions, which can be used -anywhere in \fBicmake\fP scripts\&. The function overview is ordered alphabetically +anywhere in \fBicmake\fP scripts\&. The following overview is ordered alphabetically by function name\&. .PP .IP o @@ -698,27 +749,6 @@ \fI\(dq\&A\(dq\&\fP; .IP .IP o -The `backtick` operator (\fI`\fP) -.br -A string placed between two backticks is executed by the \fIpopen\fP(3) -function\&. The standard output gererated by the command that is stored -in the string argument is returned as a list\&. An empty list indicates -that the command could not be executed\&. A command that could be -executed but did not produce any output returns a list containing one -empty element\&. The command\(cq\&s standard error stream output is not -automatically collected\&. Standard shell redirection could be used to -collect the standard error stream\(cq\&s output as well\&. Example: -.nf - - string s = \(dq\&ls\(dq\&; - printf(`s`); // prints the elements in the current - // directory - -.fi -The predefined function \fIeval(string cmd)\fP behaves exactly like the -backtick operator: they are synonyms\&. -.IP -.IP o \fIstring change_base(string file, string newbase)\fP .br Changes the basename of \fIfile\fP, returns the changed name\&. E\&.g, @@ -743,12 +773,12 @@ .br Changes the script\(cq\&s working directory, returns the previous dir as an absolute path\&. -.br -Use \fIchdir(\(dq\&\&.\(dq\&)\fP to get current working directory, \fIchdir(\(dq\&\(dq\&)\fP may -be used to obtain the startup working directory (this functionality -was broken in releases before than 7\&.00, but is now operational)\&. The -function terminates the \fBicmake\fP\-script if the specified \fInewdir\fP does -not exist\&. +.IP +Use \fIchdir(\(dq\&\&.\(dq\&)\fP to obtain the current working directory, +\fIchdir(\(dq\&\(dq\&)\fP may be used to obtain the startup working directory +(this functionality was broken in releases before than 7\&.00, but is +now operational)\&. The function terminates the \fBicmake\fP\-script if the +specified \fInewdir\fP does not exist\&. .IP .IP o \fIstring chdir(int checking, string newdir)\fP @@ -775,32 +805,24 @@ \fIecho(int opt)\fP .br Controls echoing of called programs (and their arguments), specify -\fIOFF\fP if echoing is not requested\&. By default \fION\fP is active\&. -.IP -.IP o -\fIstring element(int index, list lst)\fP -.br -Returns string \fIindex\fP (0\-based) from \fIlst\fP\&. An empty string is -returned if an unavailable index value is provided\&. See also the -\fI[]\fP operator in the section \fBOPERATORS\fP\&. +\fIOFF\fP if echoing is not requested\&. By default \fIecho(ON)\fP is used\&. .IP .IP o -\fIstring element(int index, string str)\fP +\fIstring element(int index, list (or string) var)\fP .br -Returns character \fIindex\fP (0\-based) from \fIstr\fP\&. An empty string is -returned if an unavailable index value is provided\&. See also the -\fI[]\fP operator in the section \fBOPERATORS\fP\&. +Acts identical to the index operator: refer to the index (\fI[]\fP) +operator in the section \fBOPERATORS\fP\&. .IP .IP o \fIlist eval(string str)\fP .br This function acts identically to the backtick operator\&. The example -shown at the description of the backtick operator could therefore also +provided with the backtick operator could therefore also have been written like this: .nf - printf(eval(\(dq\&ls\(dq\&)); // prints the elements in the current - // directory +printf(eval(\(dq\&ls\(dq\&)); // prints the elements in the current + // directory .fi @@ -831,12 +853,13 @@ \fIexecute(string cmd, string cmdhd, string arghd, \&.\&.\&., string argtl, string cmdtl)\fP .br -Same as \fIexec()\fP, but command head/tail and argument -head/tail must be specified\&. -The actually executed command starts with \fIcmd\fP, followed by -\fIcmdhd\fP\&. Next is a series of arguments follows, each -enclosed by \fIarghd\fP and \fIargtl\fP\&. The command terminates -with \fIcmdtl\fP\&. 0 is returned +Same as \fIexec()\fP, but command head/tail and argument head/tail must +be specified\&. +.IP +The actually executed command starts with \fIcmd\fP, followed by +\fIcmdhd\fP\&. Next is a series of arguments follows, each enclosed by +\fIarghd\fP and \fIargtl\fP\&. The command terminates with \fIcmdtl\fP\&. 0 is +returned .IP .IP o \fIexecute(int checking, string cmd, string cmdhd, @@ -855,22 +878,21 @@ .IP o \fIlist fgets(string file, list offset)\fP .br -\fBNOTE:\fP the prototype of this function changed from -\fIfgets(string file, int offset)\fP to \fIfgets(string file, list -offset)\fP at version 8\&.00\&.00\&. -.br - -.IP -The next line found at offet \fIoffset\fP is read from \fIfile\fP\&. It -returns a list \fIretlist\fP containing as its first element the -contents of the read line (without the \fI\en\fP line terminator), as its -second element the line\(cq\&s terminator `\fI\en\fP\(cq\& (if encountered), and as -its third element the string \fIOK\fP if a line was successfully read, -\fIFAIL\fP if reading from file failed\&. At EOF an empty list is -returned\&. The list may contain additional elements, which are -internally used by \fIfgets\fP\&. -.br - +\fBNOTE:\fP in \fBicmake\fP version 8\&.00\&.00 the prototype of this function was +changed from \fIlist fgets(string file, int offset)\fP to +\fIlist fgets(string file, list offset)\fP\&. +.IP +The next line found at the offset contained in \fIoffset\fP is read from +\fIfile\fP\&. Pass an empty list to \fIfgets\fP to read \fIfile\fP from its +beginning\&. +.IP +It returns a list containing as its first element the contents of the +read line (without the \fI\en\fP line terminator), as its second element +the line\(cq\&s terminator `\fI\en\fP\(cq\& (if encountered), and as its third +element the string \fIOK\fP if a line was successfully read, \fIFAIL\fP if +reading from file failed\&. When reading at EOF an empty list is +returned\&. The returned list may contain additional elements, which are +internally used by \fIfgets\fP when reading the next line\&. .IP To read multiple lines, start by passing an empty list as \fIgets\(cq\&s\fP second argument\&. To read subsequent lines, pass the previously @@ -879,14 +901,14 @@ Here is an example showing how to read a complete file: .nf - list ret; - while (1) - { - ret = fgets(\(dq\&filename\(dq\&, ret); - if (!ret) - break; - process(ret[0], ret[1]); - } +list ret; +while (1) +{ + ret = fgets(\(dq\&filename\(dq\&, ret); + if (!ret) + break; + process(ret[0], ret[1]); +} .fi @@ -902,11 +924,11 @@ .br Appends all (comma separated) arguments to the file \fIfilename\fP\&. Returns the number of printed arguments\&. -.br -If \fIformat\fP contains placeholders %1 \&.\&. %n the output is -formatted (see also \fIstrformat\fP)\&. Note that in this case -argument counting (also) starts beyond the format string: the -first argument following \fIformat\fP is referred to as \fI%1\fP\&. +.IP +If \fIformat\fP contains placeholders %1 \&.\&. %n the output is formatted +(see also \fIstrformat\fP)\&. Note that in this case argument counting +(also) starts beyond the format string: the first argument following +\fIformat\fP is referred to as \fI%1\fP\&. .IP .IP o \fIstring get_base(string file)\fP @@ -921,15 +943,14 @@ .IP o \fIstring getch()\fP .br -Returns the next pressed key as a string (no `Enter\(cq\& required for -ms\-dos and unix (incl\&. linux) systems)\&. +Returns the next pressed key as a string (pressing `Enter\(cq\& is not +required)\&. .IP .IP o \fIstring get_dext(string file)\fP .br Returns the extension of \fIfile\fP, including the separating dot\&. The -extension is all information starting at the final dot -in the filename\&. +extension is all information starting at the filename\(cq\&s final dot\&. .IP If no final dot is found, an empty string is returned\&. .IP @@ -942,8 +963,7 @@ the first element indicates whether the environment variable was defined (value \fI\(dq\&1\(dq\&\fP) or not (value \fI\(dq\&0\(dq\&\fP); .br -the second element -indicates the value of the environment variable\&. +the second element indicates the value of the environment variable\&. .IP Enivironment variables are of the form \fIvariable=value\fP, and if defined the list\(cq\&s second element contains \fIvalue\fP\&. If the value is @@ -953,16 +973,16 @@ \fIstring get_ext(string file)\fP .br Returns the extension of \fIfile\fP, except for the separating dot\&. The -extension is all information starting at the final dot -in the filename\&. +extension is all information starting at the final dot in the +filename\&. .IP If no final dot is found, an empty string is returned\&. .IP .IP o \fIint getpid()\fP .br -Returns the process\-id (UNIX) of the icmake byte -code interpreter \fBicm\-exec\fP\&. +Returns the process\-id of the icmake byte code interpreter +\fBicm\-exec\fP\&. .IP .IP o \fIstring gets()\fP @@ -981,16 +1001,35 @@ If no path is found, an empty strring is returned\&. .IP .IP o +\fIint listfind(list lst, string str)\fP +.br +Returns the first index in \fIlst\fP where the string \fIstr\fP is found, +or \-1 if \fIlst\fP does not contain \fIstr\fP\&. +.IP +.IP o \fIint listlen(list l)\fP .br Returns the number of elements in \fIlist\fP\&. .IP .IP o +\fIlist listunion(list lhs, list rhs)\fP +.br +Returns a list containing the union of the elements in \fIlhs\fP and +\fIrhs\fP\&. +.IP +.IP o +\fIlist listunion(list lst, string str)\fP +.br +Returns a list containing the union of the elements in \fIlst\fP and +\fIstr\fP\&. +.IP +.IP o \fIlist makelist(string mask)\fP .br Returns a list of all files matching \fImask\fP\&. E\&.g\&., \fImakelist(\(dq\&*\&.c\(dq\&)\fP returns a list containing all files ending in \fI\&.c\fP\&. +.IP .IP o \fIlist makelist(type, string mask)\fP .br @@ -1065,15 +1104,15 @@ Shows all (comma separated) arguments to screen (i\&.e\&., the standard output stream)\&. Returns the number of printed arguments (the \fIformat\fP string counts as one argument)\&. -.br +.IP If \fIformat\fP contains placeholders %1 \&.\&. %n the output is formatted (see also \fIstrformat\fP)\&. .IP .IP o \fIint putenv(string envvar)\fP .br -Adds \fIenvvar\fP to the current (\fBicmake\fP) environment -Use the format: \(dq\&VAR=value\(dq\&\&. Returns 0\&. +Adds \fIenvvar\fP to the current (\fBicmake\fP) environment Use the format: +\(dq\&VAR=value\(dq\&\&. Returns 0\&. .IP .IP o \fIstring resize(string str, int newlength)\fP @@ -1095,16 +1134,16 @@ .IP o \fIlist stat(string entry)\fP .br -Returns \fBstat\fP(2) information of directory entry \fIentry\fP as -a list\&. The returned list has two elements: element 0 is the +Returns \fBstat\fP(2) information of directory entry \fIentry\fP as a +list\&. The returned list has two elements: element 0 is the \fIattribute value\fP, element 1 contains the size of the file\&. .IP Attributes are returned as bit\-flags, composed from the following predefined constants: .nf - S_IFCHR S_IFDIR S_IFREG - S_IREAD S_IWRITE S_IEXEC +S_IFCHR S_IFDIR S_IFREG +S_IREAD S_IWRITE S_IEXEC .fi See the \fBstat\fP(2) manual page for the meanings of these constants\&. @@ -1117,17 +1156,25 @@ returns \fBstat\fP(2)\(cq\&s return value\&. .IP .IP o -\fIint strlen(string s)\fP +\fIint strchr(string str, string chars)\fP .br -Returns the number of characters in \fIs\fP (not counting the final 0)\&. +Returns the first index in \fIstr\fP where any of the characters in +\fIchars\fP is found, or \-1 if \fIstr\fP does not contain any of the +characters in \fIchars\fP\&. +.IP +.IP o +\fIint strlen(string str)\fP +.br +Returns the number of characters in \fIstr\fP (not counting the final 0)\&. .IP .IP o \fIint strfind(string haystack, string needle)\fP .br -Returns index in \fIhaystack\fP where \fIneedle\fP is found, or \-1 if +Returns index in \fIhaystack\fP where \fIneedle\fP is found, or \-1 if \fIneedle\fP is not contained in \fIhaystack\fP\&. .br -\fBThis function was called strstr() in versions before 7\&.00\fP\&. +\fBThis function was +called strstr() in versions before 7\&.00\fP\&. .IP .IP o \fIint strformat(string format,\&.\&.\&.)\fP @@ -1231,8 +1278,8 @@ \fIargc\fP represents the number of elements in \fIargv\fP; .IP .IP o -\fIargv\fP contains the arguments, with element 0 the compiled \fBicmake\fP script -(the `\fI\&.bim\fP\(cq\& file); +\fIargv\fP contains the arguments, with element 0 being equal to the +name of the \&.bim file; .IP .IP o \fIenvp\fP contains the `environment\(cq\& variables\&. The function \fIlistlen\fP @@ -1258,7 +1305,6 @@ if (getenv(\(dq\&dryrun\(dq\&)[0] == \(dq\&0\(dq\&) linking(element(2, argv)); } - exit (0); } .fi @@ -1277,16 +1323,17 @@ .PP User\-defined functions must have the following elements: .IP o -The function\(cq\&s return type\&. One of the available types must be -used explicitly, e\&.g\&., \fIvoid\fP\&. There is no default type\&. +The function\(cq\&s return type, which must be one of \fIvoid, int, +string\fP or \fIlist\fP\&. There is no default type\&. .IP .IP o The function\(cq\&s name, e\&.g\&., \fIcompile\fP\&. .IP .IP o A parameter list, defining zero or more comma\-separated -parameters\&. The parameters themselves consist of a type name followed by the -parameter\(cq\&s identifier\&. E\&.g\&., \fI(string outfile, string source)\fP\&. +parameters\&. The parameters themselves consist of a type name (\fIint, +string\fP, or \fIlist\fP) followed by the parameter\(cq\&s identifier\&. E\&.g\&., +\fI(string outfile, string source)\fP\&. .IP .IP o A \fIbody\fP surrounded by a pair of curly braces (\fI{\fP and \fI}\fP)\&. @@ -1305,10 +1352,14 @@ (and optionally initialized) anywhere inside functions, and also in \fIif, for\fP and \fIwhile\fP statements\&. .PP +The behavior of \fBicmake\fP\-scripts using non\-void functions that do not return +values is not defined\&. +.PP .SH "FILES" .PP -The mentioned paths are sugestive only and may be installation dependent: +The mentioned paths are sugestive only and may vary over different +\fBicmake\fP\-installations: .IP o \fB/usr/bin/icmake\fP: the main \fBicmake\fP program; .IP o diff -Nru icmake-8.00.05/doc/icmbuild.1 icmake-8.01.00/doc/icmbuild.1 --- icmake-8.00.05/doc/icmbuild.1 2015-12-21 13:14:30.000000000 +0000 +++ icmake-8.01.00/doc/icmbuild.1 2016-02-13 14:03:43.000000000 +0000 @@ -1,11 +1,11 @@ -.TH "icmbuild" "1" "1992\-2015" "icmake\&.8\&.00\&.05\&.tar\&.gz" "A generic program maintenance script" +.TH "icmbuild" "1" "1992\-2016" "icmake\&.8\&.01\&.00\&.tar\&.gz" "A generic program maintenance script" .PP .SH "NAME" icmbuild \- A generic, easy configurable, program maintenance script .PP .SH "SYNOPSIS" -\fBicmbuild\fP \fImode\fP +\fBicmbuild\fP [\-h] [\-c] \fIargs\fP .PP .SH "DESCRIPTION" @@ -13,57 +13,58 @@ The \fBicmbuild\fP script is a generic script that can be used to do program maintenance using \fBicmake\fP(1)\&. .PP -The script expects two files to be available in the directory where program -maintenance is required, and the \fBicmbuild\fP script should be available in your -path or it should be started as, e\&.g\&., \fI\&./icmbuild\fP -.PP -\fBIcmbuild\fP assumes that your sources exist in and below a directory in which the -files \fIicmconf\fP and \fICLASSES\fP live\&. The file \fICLASSES\fP contains the -names of all subdirectories in which class\-specific sources are kept\&. The file -\fIicmconf\fP in \fBicmake\fP(1)\(cq\&s distribution offers an example of the -configuration parameters that are used for program maintenance\&. In this latter -file it is assumed that \fBC++\fP sources are maintained, but the \fBicmbuild\fP script -is not restricted to do maintenance for \fBC++\fP programs\&. -.PP -\fBIcmbuild\fP compiles all sources in each of the subdirectories named in the file -\fICLASSES\fP, and then compiles all sources in the current working directory -(except for the source containing \fImain()\fP)\&. +\fBIcmbuild\fP requires that the file \fIicmconf\fP is available in the directory where +program maintenance is requested\&. .PP -The compiled sources result in object modules which are then kept in a +\fBIcmbuild\fP assumes that your sources exist in and below the current working +directory\&. The file \fIicmconf\fP in \fBicmake\fP(1)\(cq\&s distribution provides an +example of an \fIicmconf\fP file that can be used by \fBicmbuild\fP\&. In that example +\fIicmconf\fP file it is assumed that \fBC++\fP sources are maintained, but +program maintenance for, e\&.g\&., \fBC\fP sources can easily be configured\&. +.PP +\fBIcmbuild\fP() compiles all sources in each of the subdirectories named in the file +\fICLASSES\fP, and then compiles all sources in the current working directory\&. +.PP +The compiled sources result in object modules which may be kept in a library, against which the main\-object module is linked\&. It is also possible to specify additional libraries against which the program must be linked\&. .PP -Once a library is constructed it is kept up to date by the script\&. Changing a -source will result in replacing its former module by its new module in the -library\&. +If a library is constructed it is kept up to date by \fBicmbuild\fP\&. When a source is +successfully compiled its new object module will replace the old one that is +found in the library\&. At that point the object files are no longer required +and are removed by \fBicmbuild\fP\&. .PP .SH "KICK\-STARTING ICMBUILD" .PP -Normally, \fBicmbuild\fP is installed and used as follows: +To use \fBicmbuild\fP do as follows: .IP o Install \fBicmbuild\fP in your path; .IP o -copy \fIicmconf\fP and \fICLASSES\fP to your project\(cq\&s base directory -(i\&.e\&., the directory in which and where below the project\(cq\&s sources are -found); +copy \fIicmconf\fP (and probably the file \fICLASSES\fP) to your +project\(cq\&s base directory (i\&.e\&., the directory in which and where below +the project\(cq\&s sources are found); .IP o Modify the \fI#defines\fP in the file \fIicmconf\fP to taste; .IP o -List the subdirectories containing sources in the file \fICLASSES\fP +Enter the names of subdirectories containing sources on separate +lines in the file \fICLASSES\fP .IP -Note that the order of the classes mentioned in classes \fIis\fP relevant -here\&. It\(cq\&s no problem to add new class (subdirectory) names, but -reordering should be prevented\&. If reordering is required, recompile -the library, as the final object files contain class order\-numbers\&. -These class\-order numbers prevent file\-name collisions and thus prevent -replacing file \fIx\&.o\fP from class \fIA\fP by file \fIx\&.o\fP from class -\fIB\fP; +Note that the order of the classes mentioned in \fICLASSES\fP \fIis\fP +relevant\&. New class (subdirectory) names can always be added, but +reordering the lines in the \fICLASSES\fP file should be avoided\&. If +reordering is necessary, then first run the command \fIicmbuild clean\fP +to remove all files thus far created by \fBicmbuild\fP\&. Recompilation is +necessary as the names of the object files contain class order\-numbers +for identification\&. These class\-order numbers prevent file\-name +collisions (e\&.g\&., two classes might use a file \fIdata\&.cc\fP) and thus +replacement of a file \fIx\&.o\fP from class \fIA\fP by file \fIx\&.o\fP from +class \fIB\fP is prevented; .IP o Now simply run .nf - icmbuild + icmbuild \-h .fi from the project\(cq\&s base directory and let the help\-info tell you @@ -73,16 +74,21 @@ .SH "OPTIONS" .PP -\fBIcmbuild\fP may be called with the following operational modes: +\fBIcmbuild\fP recognizes two options, at most one should be specified: +.IP o +\fI\-h\fP: Provide a short usage overview\&. +.IP o +\fI\-c\fP: Clear the screen (using \fItput clear\fP) before starting the +compilation process + +.PP +Following the optional \fI\-c\fP \fBicmbuild\fP() the following arguments may be +passed to \fBicmbuild\fP: .IP o \fIclean\fP .br clean up remnants of previous activities .IP o -\fIhelp\fP -.br -provide help and exit (default when called without arguments) -.IP o \fIlibrary\fP .br build the library (static and optionally the dynamic library) @@ -95,25 +101,39 @@ .br build the stripped binary program .IP o -\fIinstall \fP -install the software in the locations defined in the \fIicmconf\fP -file, optionally below the directory \fI\fP -The \fBicmconf\fP file may be given a line defining \fIDEFCOM\fP containing -the default operational mode to use when none is specified\&. E\&.g\&., +\fIinstall program path\fP +install the constructed program in the specified path (to be used +after issuing \fBicmbuild\fP \fIprogram\fP) +.IP o +\fIinstall static path\fP +install the constructed static library in the specified path (to be +used after issuing \fBicmbuild\fP \fIlibrary\fP) +.IP o +\fIinstall shared path\fP +install the constructed shared library in the specified path (to be +used after issuing \fBicmbuild\fP \fIlibrary\fP) +After adding a line to \fIicmconf\fP containing .nf #define DEFCOM \(dq\&program\(dq\& .fi -constructs the program when the command `\fIicmbuild\fP\(cq\& is -entered\&. \fIDEFCOM\fP may also contain combined options, like +\fBicmbuild\fP by default uses the argument \fIprogram\fP\&. After adding +.nf + + #define DEFCOM \(dq\&strip\(dq\& + +.fi +\fBicmbuild\fP by default uses the argument \fIstrip\fP\&. After adding .nf - #define DEFCOM \(dq\&program strip\(dq\& + #define DEFCOM \(dq\&library\(dq\& .fi -Note that \fIDEFCOM\fP is ignored when an explicit operational mode is -provided to the \fBicmbuild\fP script\&. +\fBicmbuild\fP by default uses the argument \fIlibrary\fP\&. +.PP +\fIDEFCOM\fP is ignored when an explicit operational mode is passed to +\fBicmbuild\fP\&. .PP .SH "FILES" @@ -201,8 +221,10 @@ //#define CC \(dq\&gcc\(dq\& // The compiler options to use\&. Define CFLAGS instead if a C compiler is - // used\&. -#define CXXFLAGS \(dq\& \-\-std=c++14 \-Wall \-g \-O2\(dq\& + // used\&. + // To suppress colored error messages add option \-fdiagnostics\-color=never + // To add debug\-code to object files add option \-g +#define CXXFLAGS \(dq\& \-\-std=c++14 \-Wall \-O2\(dq\& //#define CFLAGS \(dq\& \-Wall \-g \-O2\(dq\& // The extension of internal header files\&. See PRECOMP below @@ -235,15 +257,17 @@ // DEFINES RELATED TO USING A PARSER GENERATOR // =========================================== + // The subdirectory containing the parser\(cq\&s specification file + // If this directive is REMOVED, then all parser\-related #defines + // can also be removed from icmconf\&. +#define PARSER_DIR \(dq\&\(dq\& + // What is the program generating a parser? #define PARSGEN \(dq\&bisonc++\(dq\& // Flags to pass to PARSGEN: #define PARSFLAGS \(dq\&\-V\(dq\& - // The subdirectory containing the parser\(cq\&s specification file -#define PARSER_DIR \(dq\&\(dq\& - // What is the top\-level (or only) grammar specification file? #define PARSSPEC \(dq\&grammar\(dq\& @@ -259,15 +283,17 @@ // DEFINES RELATED TO USING A SCANNER GENERATOR // ============================================ + // The subdirectory containing the scanner\(cq\&s specification file + // If this directive is REMOVED, then all scanner\-related #defines + // can also be removed from icmconf\&. +#define SCANNER_DIR \(dq\&\(dq\& + // What is the program generating the lexical scanner? #define SCANGEN \(dq\&flexc++\(dq\& // Flags to provide SCANGEN with: #define SCANFLAGS \(dq\&\(dq\& - // The subdirectory containing the scanner\(cq\&s specification file -#define SCANNER_DIR \(dq\&\(dq\& - // Name of the lexical scanner specification file #define SCANSPEC \(dq\&lexer\(dq\& diff -Nru icmake-8.00.05/doc/icmconf.7 icmake-8.01.00/doc/icmconf.7 --- icmake-8.00.05/doc/icmconf.7 2015-12-21 13:14:30.000000000 +0000 +++ icmake-8.01.00/doc/icmconf.7 2016-02-13 14:03:43.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "icmconf" "7" "1992\-2015" "icmake\&.8\&.00\&.05\&.tar\&.gz" "configuration file for \fBicmbuild\fP(1)" +.TH "icmconf" "7" "1992\-2016" "icmake\&.8\&.01\&.00\&.tar\&.gz" "configuration file for \fBicmbuild\fP(1)" .PP .SH "NAME" @@ -8,23 +8,47 @@ .SH "DESCRIPTION" .PP -The \fBicmconf\fP configuration file is used to specify and tailor the -characteristics of program maintenance performed by the \fBicmbuild\fP(1) icmake +The \fIicmconf\fP configuration file is used to specify and fine\-tune the +characteristics of program maintenance performed by the \fBicmbuild\fP(1) script\&. It can be used to activate and specify various directives that -determine how the program or library maintenance will proceed\&. +determine how the program or library maintenance is performed\&. .PP The directives are biased towards the construction of a \fBC++\fP program, but -program maintenance for other languages (e\&.g\&., \fBC\fP) can easily be realized -as well\&. +program maintenance for other languages (e\&.g\&., \fBC\fP) can also easily be +configured\&. +.PP +The \fBicmbuild\fP(1) script ignores empty lines and lines whose first non\-blank +character is a hash\-mark (\fI#\fP) as well as lines whose first non\-blank +characters are two consecutive forward slashes (//)\&. Long lines can be split +over multiple lines by using a final backslash character at lines continuing +at the next line (refer to the \fBicmake\fP(1) man\-page for further details)\&. .PP .SH "CLASS DEPENDENCIES" .PP -Traditional make\-utilities recompile sources once header files are -modified\&. In the context of \fBC++\fP program development this is often a bad -idea, as adding a new member to a class does not normally require you to -recompile the class\(cq\&s sources\&. To handle class dependencies in a more sensible -way, \fBicmake\fP(1)\(cq\&s \fICLASSES\fP file may define dependencies among classes\&. +Traditional make\-utilities recompile all dependent sources once header files +are modified\&. When developing \fBC++\fP programs this is hardly ever requird, as +adding a new member function to a class does not require you to recompile +already existing source files\&. Recompilation \fIis\fP required when modifying +the data member organization of classes\&. +.PP +To handle class dependencies in a more sensible way, \fBicmake\fP(1)\(cq\&s +\fICLASSES\fP file may define dependencies among classes\&. +.PP +By default, class\-dependencies are not interpreted\&. To activate +class\-dependencoes recognition then the line +.nf + +//#define USE_ALL \(dq\&a\(dq\& + +.fi +in the \fIicmconf\fP file must be uncommented: +.nf + +#define USE_ALL \(dq\&a\(dq\& + +.fi + .PP If a class Y depends on class X as in: .nf @@ -46,7 +70,7 @@ .fi then the sources of class Y should be recompiled if X\(cq\&s data organization -has changed\&. In cases like these Y depends on X\&. +has changed\&. In such cases Y depends on X\&. .PP Such class dependencies can be specified in the CLASSES file using the form: @@ -55,13 +79,20 @@ y x .fi -where x and y are the directories holding the respective class sources\&. Then, -when altering X\(cq\&s data organization, do \(cq\&touch x/a\(cq\&, followed by \(cq\&icmbuild -program\(cq\&: x\(cq\&s sources as well as the sources in directories (in)directly -depending on x (e\&.g\&., y) are then automatically recompiled by icmbuild\&. +where x and y are the names of the directories in which the respective class +sources are found\&. If \fIicmconf\fP contains a line +.nf + +#define USE_ALL \(dq\&a\(dq\& + +.fi +then, after modifying X\(cq\&s data organization, do \(cq\&touch x/a\(cq\&, followed by +\(cq\&icmbuild program\(cq\&\&. Icmbuild now compiles all of x\(cq\&s sources as well as +the sources in directories (in)directly depending on x (in the example: the +sources in the y directory)\&. .PP -Multiple dependencies can also be specified\&. If the class -organization looks like this: +Multiple dependencies can also be specified\&. If the class organization looks +like this: .nf class Z: public Y @@ -70,14 +101,14 @@ }; .fi -then Z depends on both Y and X\&. In the CLASSES file this may be indicated -by the line +then Z depends on both Y and X\&. In the CLASSES file this is configured +like this: .nf z x y .fi -Indirect dependencies are automatically followed\&. After changing X\(cq\&s data +Indirect dependencies are automatically recognized\&. After changing X\(cq\&s data organization where CLASSES contains the lines .nf @@ -86,35 +117,11 @@ z y .fi -then \(cq\&icmbuild program\(cq\& results in recompiling all of the sources in -classes x, y and z\&. +then \fIicmbuild\fP recompiles all source files in directories x, y and z\&. .PP -By default, class\-dependencies are not interpreted\&. To activate them the line -.nf - -//#define USE_ALL \(dq\&a\(dq\& - -.fi -in the \fIicmconf\fP file must be uncommented: -.nf - -#define USE_ALL \(dq\&a\(dq\& - -.fi - -.PP -Empty lines and lines whose first non\-blank character is a hash\-mark (\fI#\fP) -or whose first non\-blank characters are two consecutive forward slashes (//) -are ignored\&. Long lines can be split over multiple lines by using a final -backslash character at lines which continue at the next line\&. E\&.g\&., -.nf - - name1 depends on multiple other classes - -.fi +.SH "ICMCONF PARAMETERS" .PP -.SH "ICMCONF PARAMETERS" .IP o \fB#define ADD_LIBRARIES \(dq\&\(dq\&\fP .br @@ -153,7 +160,7 @@ variable\&. .IP .IP o -\fB#define CXXFLAGS \(dq\&\-\-std=c++14 \-Wall \-g \-O2\(dq\&\fP +\fB#define CXXFLAGS \(dq\&\-\-std=c++14 \-Wall \-O2\(dq\&\fP .br The compiler options to use\&. The default options are shown\&. When the \fBC\fP compiler is used, use \fI#define CFLAGS\fP rather than @@ -163,31 +170,30 @@ .IP o \fB#define DEFCOM \(dq\&\&.\&.\&.\(dq\&\fP .br -A \fIDEFCOM\fP directive may be added to the \fIicmconf\fP file by -\fIicmstart\fP\&. It may be defined as: +A \fIDEFCOM\fP directive may be added to the \fIicmconf\fP file (the +\fBicmstart\fP(1) script can do this for you)\&. It may be defined as: .nf #define DEFCOM \(dq\&program\(dq\& .fi -in which case \fIicmbuild\fP will do program maintenance\&. Alternatively -it may be defined as: +in which case \fIicmbuild\fP will do program maintenance\&. It may also be +defined as: .nf #define DEFCOM \(dq\&program strip\(dq\& .fi -in which case \fIicmbuild\fP will do program maintenance, creating a -stripped binary program\&. It may also be defined as +in which case \fIicmbuild\fP does program maintenance, creating a +stripped binary program\&. +.IP +Alternatively it may also be defined as: .nf #define DEFCOM \(dq\&library\(dq\& .fi -in which case \fIicmbuild\fP will de library maintenance\&. -.IP -If this directive was not added by \fBicmstart\fP(1) it can always be -added to \fIicmconf\fP by hand\&. +in which case \fIicmbuild\fP does library maintenance\&. .IP .IP o \fB#define IH \(dq\&\&.ih\(dq\&\fP @@ -209,21 +215,22 @@ constructed\&. When a binary program is built it will be linked against this library rather than to the individual object modules\&. .IP -If a library construction is intended (see also the \fIDEFCOM\fP -directive), then the \fILIBRARY\fP directive defines the base name -(without the \fIlib\fP prefix and without the \fI\&.a\fP extension) of the -library to be constructed\&. -.IP -After a library construction \fIinstall static dir\fP installs the static -library at \fIdir\fP, which \fIinstall shared dir\fP installs the shared -library (see below at \fI#define SHARED\fP) at \fIdir\fP\&. +If a library must be constructed (see also the \fIDEFCOM\fP directive), +then the \fILIBRARY\fP directive must specify the library\(cq\&s base name +(without the \fIlib\fP prefix and without the \fI\&.a\fP extension)\&. +.IP +After a library has been constructed \fIicmbuild install static dir\fP +installs the static library at \fIdir\fP, while \fIicmbuild install +shared dir\fP installs the shared library (see below at \fI#define +SHARED\fP) at \fIdir\fP\&. .IP .IP o \fB#define MAIN \(dq\&main\&.cc\(dq\&\fP .br -The source file defining the \fIint main\fP function\&. This specification -may be left as\-is or may completely be removed if \fBicmbuild\fP(1) is -used for library maintenance rather than program maintenance\&. +The source file in which the \fIint main\fP function is defined\&. This +specification may be left as\-is or may completely be removed if +\fBicmbuild\fP(1) is used for library maintenance rather than program +maintenance\&. .IP .IP o \fB#define OBJ_EXT \(dq\&\&.o\(dq\&\fP @@ -231,48 +238,6 @@ The extension of object modules created by the compiler\&. .IP .IP o -\fB#define PARSER_DIR \(dq\&\(dq\&\fP -.br -The subdirectory containing the parser\(cq\&s specification file\&. Leave -empty if no parser class is used and if no parser is generated\&. -The following directives, beginning with \fIPARS\fP, are only -interpreted when \fIPARSER_DIR\fP is defined as a non\-empty string\&. -.IP -.IP o -\fB#define PARSFILES \(dq\&\(dq\&\fP -.br -If the parser specification file named at \fIPARSSPEC\fP itself includes -additional specification files, then patterns matching these -additional grammar specification files should be specified here\&. The -pattern is interpreted in the directory specified at \fIPARSER_DIR\fP -and could contain a subdirectory name (e\&.g\&. \fIspecs/*\fP)\&. When files -matching the pattern are modified then a new parser will be -created\&. By default no additional specification files are used\&. -.IP -.IP o -\fB#define PARSFLAGS \(dq\&\-V\(dq\&\fP -.br -The flags to use when calling the program specified at \fIPARSGEN\fP\&. -.IP -.IP o -\fB#define PARSGEN \(dq\&bisonc++\(dq\&\fP -.br -The name of the program generating the parser\&. -.IP -.IP o -\fB#define PARSOUT \(dq\&parse\&.cc\(dq\&\fP -.br -The name of the file generated by the parser generator (which is used -by \fIicmbuild\fP to compare the timestamps of the parser specification -\fBs\fP against)\&. -.IP -.IP o -\fB#define PARSSPEC \(dq\&grammar\(dq\&\fP -.br -The name of the parser specification file\&. This file is -expected in the directory specified at \fIPARSER_DIR\fP\&. -.IP -.IP o \fB//#define PRECOMP \(dq\&\-x c++\-header\(dq\&\fP .br When activated internal header files (see \fI#define IH\fP) are @@ -288,48 +253,6 @@ program\fP call\&. By default \fIREFRESH\fP is \fInot\fP defined\&. .IP .IP o -\fB#define SCANNER_DIR \(dq\&\(dq\&\fP -.br -The subdirectory containing the scanner\(cq\&s specification file\&. Leave -empty if no scanner class is used and if no lexical scanner is -generated\&. The following directives, beginning with \fISCAN\fP, are only -interpreted when \fISCANNER_DIR\fP is defined as a non\-empty string\&. -.IP -.IP o -\fB#define SCANFILES \(dq\&\(dq\&\fP -.br -If the lexical scanner specification file named at \fISCANSPEC\fP itself -includes additional specification files, then patterns matching these -additional lexer specification files should be specified here\&. The -pattern is interpreted in the directory specified at \fISCANNER_DIR\fP -and could contain a subdirectory name (e\&.g\&. \fIspecs/*\fP)\&. When files -matching the pattern are modified then a new lexical scanner will be -created\&. By default no additional specification files are used\&. -.IP -.IP o -\fB#define SCANFLAGS \(dq\&\(dq\&\fP -.br -The flags to use when calling the program specified at \fISCANGEN\fP\&. -.IP -.IP o -\fB#define SCANGEN \(dq\&flexc++\(dq\&\fP -.br -The name of the program generating the lexical scanner\&. -.IP -.IP o -\fB#define SCANOUT \(dq\&lex\&.cc\(dq\&\fP -.br -The name of the file generated by the lexical scanner (which is used by -\fIicmbuild\fP to compare the timestamps of the scanner specification -\fBs\fP against)\&. -.IP -.IP o -\fB#define SCANSPEC \(dq\&lexer\(dq\&\fP -.br -The name of the lexical scanner specification file\&. This file is -expected in the directory specified at \fISCANNER_DIR\fP\&. -.IP -.IP o \fB#define SHARED\fP .br This directive is only interpreted if \fILIBRARY\fP was also specified\&. @@ -383,11 +306,12 @@ word on a line) optionally followed by additional class names, which are the classes on which the line\(cq\&s first class name depends\&. .IP -Assuming that a program uses five classes \fIOne, Two, Three, Four\fP and -\fIFive\fP and that class \fIThree\fP depends on class \fITwo\fP, which in -turn depends on class \fIOne\fP, while class \fIFive\fP depends on -\fIThree\fP and \fIFour\fP, then the file \fICLASSES\fP may reflect these -dependencies as follows: +Assuming that a program uses five classes \fIOne, Two, Three, Four\fP +and \fIFive\fP, whose sources are in, respectively, directories \fIone, +two, three, four\fP, and \fIfive\fP\&. If class \fIThree\fP depends on class +\fITwo\fP, which in turn depends on class \fIOne\fP, while class \fIFive\fP +depends on \fIThree\fP and \fIFour\fP, then the file \fICLASSES\fP may +reflect these dependencies as follows: .nf one @@ -395,27 +319,21 @@ three two four five three four + .fi -Now touching (creating) the file \fItwo/a\fP (using e\&.g\&., the command -\fItouch two/a\fP) causes all sources of the classes \fITwo, Three\fP and \fIFive\fP -as well as all the sources in the program\(cq\&s root directory to be recompiled: +Afer touching (creating) the file \fItwo/a\fP (using e\&.g\&., the command +\fItouch two/a\fP) all sources of the classes \fITwo, Three\fP and \fIFive\fP +as well as all the sources in the program\(cq\&s root directory are recompiled: \fITwo\fP is recompiled because of the existence of \fItwo/a\fP, \fIThree\fP is recompiled because it depends on \fITwo\fP, \fIFive\fP is recompiled because it depends on \fIThree\fP, the sources in the program\(cq\&s root directory are -recompiled because at least one directory is recompiled\&. -.IP -This facility was added to the \fIicmbuild\fP script because \fBC++\fP header -files are often modified \fIwithout\fP the need to recompile all their depending -sources\&. No recompilation is necessary when a new class member function is -declared\&. Recompilation, however, \fIis\fP necessary when the class\(cq\&s internal -organization changes, e\&.g\&., when the organization of its data members is -modified\&. Simply touching a file \fI\(dq\&a\(dq\&\fP is sufficient to perform -the necessary recompilations\&. +recompiled because at least one directory was recompiled\&. .IP -Following the recompilations the \fIUSE_ALL\fP \fBs\fP are removed\&. +Following the recompilations the \fBs\fP specified at \fI#define USE_ALL\fP are +removed\&. .IP -When the \fIUSE_ALL\fP directive was defined the command \fIicmbuild -clean\fP also removes any leftover \fIUSE_ALL\fP files from the program\(cq\&s direct +When the \fIUSE_ALL\fP directive was defined the command \fIicmbuild clean\fP also +removes any leftover \fIUSE_ALL\fP files from the program\(cq\&s direct subdirectories\&. .IP .IP o @@ -432,43 +350,104 @@ project\(cq\&s release years\&. .PP -.SH "OBSOLETE DIRECTIVES" +.SH "PARSER MAINTENANCE" + +.PP +The following directives are available in cases where a program uses a parser +generator creating a parser class from a grammar specification: +.PP +.IP o +\fB#define PARSER_DIR \(dq\&\(dq\&\fP +.br +The subdirectory containing the parser\(cq\&s specification file\&. +.IP +If parser maintenance is not required, then this directive can be +omitted\&. If omitted, then all other directives, that begin with +\fIPARS\fP, can also be omitted\&. +.IP +.IP o +\fB#define PARSFILES \(dq\&\(dq\&\fP +.br +If the parser specification file named at \fIPARSSPEC\fP itself includes +additional specification files, then patterns matching these +additional grammar specification files should be specified here\&. The +pattern is interpreted in the directory specified at \fIPARSER_DIR\fP +and could contain a subdirectory name (e\&.g\&. \fIspecs/*\fP)\&. When files +matching the pattern are modified then a new parser will be +created\&. By default no additional specification files are used\&. +.IP +.IP o +\fB#define PARSFLAGS \(dq\&\-V\(dq\&\fP +.br +The flags to use when calling the program specified at \fIPARSGEN\fP\&. +.IP +.IP o +\fB#define PARSGEN \(dq\&bisonc++\(dq\&\fP +.br +The name of the program generating the parser\&. +.IP +.IP o +\fB#define PARSOUT \(dq\&parse\&.cc\(dq\&\fP +.br +The name of the file generated by the parser generator (which is used +by \fIicmbuild\fP to compare the timestamps of the parser specification +\fBs\fP against)\&. +.IP +.IP o +\fB#define PARSSPEC \(dq\&grammar\(dq\&\fP +.br +The name of the parser specification file\&. This file is +expected in the directory specified at \fIPARSER_DIR\fP\&. + +.PP +.SH "SCANNER MAINTENANCE" + +.PP +The following directives are available in cases where a program uses a scanner +generator creating a lexical scanner class from a set of regular expressions: +.PP .IP o -\fBBINARY \(dq\&\(dq\&\fP +\fB#define SCANNER_DIR \(dq\&\(dq\&\fP .br -This \fI#define\fP may safely be removed from older \fIicmconf\fP files as -it is no longer used by \fIicmbuild\fP\&. When a binary program is -constructed it is created as \fITMP_DIR \(dq\&/bin/binary\(dq\&\fP, while -\fIinstall program path\fP installs the binary program at \fIpath\fP\&. +The subdirectory containing the scanner\(cq\&s specification file\&. +.IP +If lexical scanner maintenance is not required, then this directive +can be omitted\&. If omitted, then all other directives, that begin with +\fISCAN\fP, can also be omitted\&. .IP .IP o -\fBBIN_INSTALL\fP +\fB#define SCANFILES \(dq\&\(dq\&\fP .br -This \fI#define\fP may safely be removed from older \fIicmconf\fP files as -it is no longer used by \fIicmbuild\fP\&. See \fI#define BINARY\fP for -details about how to install a binary program +If the lexical scanner specification file named at \fISCANSPEC\fP itself +includes additional specification files, then patterns matching these +additional lexer specification files should be specified here\&. The +pattern is interpreted in the directory specified at \fISCANNER_DIR\fP +and could contain a subdirectory name (e\&.g\&. \fIspecs/*\fP)\&. When files +matching the pattern are modified then a new lexical scanner will be +created\&. By default no additional specification files are used\&. .IP .IP o -\fB#define COMPILER \(dq\&\(dq\&\fP +\fB#define SCANFLAGS \(dq\&\(dq\&\fP .br -This \fI#define\fP should be replaced by \fICXX\fP or \fICC\fP\&. +The flags to use when calling the program specified at \fISCANGEN\fP\&. .IP .IP o -\fB#define COMPILER_OPTIONS \(dq\&\(dq\&\fP +\fB#define SCANGEN \(dq\&flexc++\(dq\&\fP .br -This \fI#define\fP should be replaced by \fICXXFLAGS\fP or \fICFLAGS\fP\&. +The name of the program generating the lexical scanner\&. .IP .IP o -\fBLIB_INSTALL\fP +\fB#define SCANOUT \(dq\&lex\&.cc\(dq\&\fP .br -This \fI#define\fP may safely be removed from older \fIicmconf\fP files as -it is no longer used by \fIicmbuild\fP\&. See \fI#define LIBRARY\fP for -details about how to install libraries\&. +The name of the file generated by the lexical scanner (which is used by +\fIicmbuild\fP to compare the timestamps of the scanner specification +\fBs\fP against)\&. .IP .IP o -\fB#define LINKER_OPTIONS \(dq\&\(dq\&\fP +\fB#define SCANSPEC \(dq\&lexer\(dq\&\fP .br -This \fI#define\fP should be replaced by \fILDFLAGS\fP\&. +The name of the lexical scanner specification file\&. This file is +expected in the directory specified at \fISCANNER_DIR\fP\&. .PP .SH "FILES" @@ -504,8 +483,8 @@ \fBicmake\fP(1), \fBicmbuild\fP(1), \fBicmstart\fP(1), \fBicmstart\&.rc\fP(7)\&. .PP .SH "BUGS" -The interpretation of the class dependencies (see section \fBCOMPILING AND -LINKING\fP has altered when \fIicmake\fP was updated to version 7\&.16\&.00\&. +\fBicmbuild\fP(1) ends displaying a fatal error message if the current +working directory does not contain a file \fIicmconf\fP\&. .PP .SH "COPYRIGHT" This is free software, distributed under the terms of the diff -Nru icmake-8.00.05/doc/icmstart.1 icmake-8.01.00/doc/icmstart.1 --- icmake-8.00.05/doc/icmstart.1 2015-12-21 13:14:30.000000000 +0000 +++ icmake-8.01.00/doc/icmstart.1 2016-02-13 14:03:43.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "icmstart" "1" "1992\-2015" "icmake\&.8\&.00\&.05\&.tar\&.gz" "starts icmbuild program maintenance" +.TH "icmstart" "1" "1992\-2016" "icmake\&.8\&.01\&.00\&.tar\&.gz" "starts icmbuild program maintenance" .PP .SH "NAME" @@ -142,14 +142,14 @@ one line, defining the program\(cq\&s initial release year\&. E\&.g\&., .nf - #define YEARS \(dq\&2012\(dq\& + #define YEARS \(dq\&2016\(dq\& .fi Plural is used here since a release year usually becomes a range of years after some time, as with Icmake\(cq\&s years specification: .nf - #define YEARS \(dq\&1992\-2012\(dq\& + #define YEARS \(dq\&1992\-2016\(dq\& .fi diff -Nru icmake-8.00.05/doc/icmstart.rc.7 icmake-8.01.00/doc/icmstart.rc.7 --- icmake-8.00.05/doc/icmstart.rc.7 2015-12-21 13:14:30.000000000 +0000 +++ icmake-8.01.00/doc/icmstart.rc.7 2016-02-13 14:03:43.000000000 +0000 @@ -1,4 +1,4 @@ -.TH "icmstart\&.rc" "7" "1992\-2015" "icmake\&.8\&.00\&.05\&.tar\&.gz" "icmstart resource file" +.TH "icmstart\&.rc" "7" "1992\-2016" "icmake\&.8\&.01\&.00\&.tar\&.gz" "icmstart resource file" .PP .SH "NAME" @@ -7,8 +7,8 @@ .SH "DESCRIPTION" .PP -The \fBicmstart\&.rc\fP file defines the initial files of a program that are -installed by \fBicmstart\fP(1)\&. +The \fBicmstart\&.rc\fP file specifies the files that are installed by +\fBicmstart\fP(1)\&. .PP By default \fBicmstart\&.rc\fP is found in \fI/etc/icmake/icmstart\&.rc\fP, but if a file \fI$HOME/\&.icmake/icmstart\&.rc\fP is found then the latter file is used by @@ -31,88 +31,97 @@ The \fIicmstart\&.rc\fP file may contain: .IP o empty lines, which are ignored; +.IP .IP o lines beginning with a hash\-character (\fI#\fP), also ignored; +.IP .IP o -Optionally: a P (don\(cq\&t install with \fIicmstart xxx library\fP) or an L -(don\(cq\&t install with \fIicmstart xxx program\fP), followed by a blank; see also -\fBicmstart\fP(1)\&. -.IP o -Optionall: a \fI?\fP (followed by a blank) following the optional P or -L in which case the installation of the element must be confirmed by the user\&. -.IP o -Source path names\&. Relative path names are interpreted relative to -the current working directory\&. Environment variables are not expanded, the -initial tilde character is interpreset as the user\(cq\&s home directory\&. -.IP o -Source path names followed by a destination (relative to the -directory initialized by \fBicmstart\fP(1))\&. -A source path may be either a file or a directory\&. If a directory is -specified then all files in and below that directory will be installed\&. +an optional installation mode followed by a source\-destination +specification\&. + .PP -When specifying a destination a path may be specified as well\&. However, the -destination path is always interpreted relative to the installation directory -specified when calling \fBicmstart\fP(1)\&. +.SH "INSTALLATION MODE" + .PP -If a destination is omitted, the source is installed as specified below -\fBicmstart\fP(1)\(cq\&s destination directory\&. +An installation mode consists of a combination of: +.IP o +either a P (don\(cq\&t install with \fIicmstart xxx library\fP) or an L +(don\(cq\&t install with \fIicmstart xxx program\fP); +.IP +.IP o +a D, indicating that the source must also be installed by default, +i\&.e\&., if neither `program\(cq\& or `library\(cq\& was specified as second argument\&. +.IP +.IP o +a b, indicating that the +file must \fInot\fP be installed if the \fI\-b\fP (basic installation) option was +specified when calling \fIicmstart\fP\&. +.IP +.IP o +Following the optional P, L, D, b combination a space delimited +optional \fI?\fP may be specified\&. If specified the installation of the file or +directory must be confirmed by the user\&. + .PP -.SH "EXAMPLES" +.SH "SOURCE\-DESTINATION SPECIFICATIONS" .PP -The following entries can be used in an \fIicmstart\&.rc\fP file: +The following source\-destination specifications can be used in an +\fIicmstart\&.rc\fP file: .IP o \fIsource\fP .br -`Source\(cq\& must be in the skeleton directory visited by \fBicmstart(1)\fP -and is installed as \fIsource\fP in the destination directory specified when -calling \fBicmstart\fP(1)\&. -.IP o -\fIsource dest\fP -.br -`Source\(cq\& must be in the skeleton directory visited by \fBicmstart(1)\fP -and is installed as \fIdest\fP in the destination directory specified when -calling \fBicmstart\fP(1)\&. -.IP o -\fI~/path\fP -.br -`~/path\(cq\& is installed as \fI~/path\fP in the destination directory -specified when calling \fBicmstart\fP(1)\&. The \fI~\fP\-character is expanded to the -user\(cq\&s home directory\&. -.IP o -\fI~/path dest\fP -.br -`~/path\(cq\& is installed as \fIdest\fP in the destination directory -specified when calling \fBicmstart\fP(1)\&. The \fI~\fP\-characteris expanded to the -user\(cq\&s home directory\&. -.IP o -\fI/path\fP -.br -`/path\(cq\& is installed as \fI\&./path\fP in the destination directory -specified when calling \fBicmstart\fP(1)\&. -.IP o -\fI/path dest\fP -.br -`/path\(cq\& is installed as \fIdest\fP in the destination directory -.IP o -\fI? source\fP -.br -The user must confirm the installation of \fIsource\fP\&. -.IP o -\fI? source dest\fP -.br -The user must confirm the installation of \fIsource\fP as \fIdest\fP in -the destination directory specified when calling \fBicmstart\fP(1)\&. +A plain name must exist in the \fIicmstart\(cq\&s\fP skeleton directory\&. It +is installed in the destination directory \fI`dest\(cq\&\fP specified when calling +\fBicmstart\fP(1)\&. Example: +.nf + + CLASSES + +.fi +\fIskeletondir/CLASSES\fP is installed as \fIdest/CLASSES\fP +.IP .IP o -\fI# text\fP +\fIpathspec\fP .br -Interpreted as comment and ignored\&. The \fI#\fP\-character must be the -first character on the line\&. +If `pathspec\(cq\& does not begin with a slash it must exist in +\fIicmstart\(cq\&s\fP skeleton directory\&. It is installed as `pathspec\(cq\& in the +destination directory specified when calling \fBicmstart\fP(1)\&. Example: +.nf + + dir/file + +.fi +\fIskeletondir/dir/file\fP is installed as \fIdest/dir/file\fP +.IP .IP o -an empty line -.br -Empty lines are skipped\&. +\fI/pathspec\fP or \fI~/pathspec\fP +The \fI~\fP\-character is expanded to the user\(cq\&s home directory\&. The +pathspec\(cq\&s final element is installed in the destination directory specified +when calling \fBicmstart\fP(1)\&. Example: +.nf + ~/\&.icmake/file + +.fi +\fI$HOME/\&.icmake/file\fP is installed as \fIdest/file\fP +When the above source specifications are followed by a destination +specification \fIdestspec\fP (a file or non\-absolute directory specification) +then the source specification is installed as dest/destspec) below the +destination directory specified when calling \fBicmstart\fP(1)\&. Examples: +.nf + + CLASSES CLASSES # skeletondir/CLASSES is installed as + # dest/CLASSES + dir/file dir/file # skeletondir/dir/file is installed as + # dest/dir/file + ~/\&.icmake/file \&.icmake/file # $HOME/\&.icmake/file is installed as + # dest/\&.icmake/file + +.fi +Icmstart conveerts the destination specification to a full path +specification\&. If this full path specification does not begin with \fIdest\(cq\&s\fP +full path specification an error message is displayed and \fIicmstart\fP ends\&. .PP .SH "FILES" The mentioned paths are sugestive only and may be installation dependent: diff -Nru icmake-8.00.05/doc/manpage/build icmake-8.01.00/doc/manpage/build --- icmake-8.00.05/doc/manpage/build 2015-12-17 17:45:54.000000000 +0000 +++ icmake-8.01.00/doc/manpage/build 2016-02-01 14:36:51.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/icmake -qt /tmp/icmake-man +#!/usr/bin/icmake -t. void yodl(string dest, string src) { diff -Nru icmake-8.00.05/doc/manpage/icmake.yo icmake-8.01.00/doc/manpage/icmake.yo --- icmake-8.00.05/doc/manpage/icmake.yo 2015-12-17 17:45:54.000000000 +0000 +++ icmake-8.01.00/doc/manpage/icmake.yo 2016-02-01 14:36:51.000000000 +0000 @@ -52,17 +52,17 @@ special operators as well as a set of support functions that have proven to be useful in program maintenance. - The program bf(icmun)(1) can be used to disassemble the compiled -byte-code (.bim) file. tt(Icmun) is primarily used for illustration, education -and debugging. + The program bf(icmun)(1) can be used to disassemble the compiled byte-code +(.bim) file. tt(Icmun) is primarily used for illustration, education, and +debugging. Traditional make-utilities recompile sources once header files are modified. In the context of bf(C++) program development this is often a bad idea, as adding a new member to a class does not normally require you to -recompile the class's sources. To handle class dependencies in a more sensible -way, bf(icmbuld)(1) may inspect tt(CLASSES) files that can be used to define -dependencies among classes. By default, class-dependencies are not -interpreted. See also the bf(icmconf)(7) man-page for further details. +recompile the class's sources. To handle class dependencies bf(icmbuld)(1) may +inspect tt(CLASSES) files that can be used to define dependencies among +classes. By default, class-dependencies are not interpreted. Refer to the +bf(icmconf)(7) man-page for further details. manpageoptions() @@ -70,32 +70,58 @@ itemization( itt(source): icm() script source file (default extension: tt(.im)). - itt(dest): binary icm() script file (default: tt(`source'.bim)). - itt(--): icm() arguments separator for arguments passed to - tt(icm-exec)nl() - tt(args): arguments following tt(--) are passed to tt(icm-exec) as-is - as its arguments, and are available from icm()-sctipt's - tt(main()) function's tt(list argv) parameter (see below at - section bf(USER DEFINED FUNCTIONS)). - ) - - the following options are available. The tt(-h) option overrules all other -options, the tt(-a) option overrules all other options except for tt(-h). Of -the remaining action options (tt(-b, -c, -e, -i, -p) and tt(-t)) only one may -be specified: - itemization( - sop(a)()(show information about icm(), overruled by tt(-h)) - sop(b)()(discontinued. Option -e can be used instead) - sop(c)()(the icm() source file is compiled) - sop(e)()(execute the icm() .bim file, given as first argument) + itt(dest): binary icm() script file (default: tt(`source'.bim), called + the `.bim file' below). + itt(--): icm() arguments separator separating icm() arguments from + arguments passed to the .bim filenl() + tt(args): arguments following tt(--) are passed to the .bim file + as-is, and are available from the tt(list argv) parameter defined + as the icm() script's tt(main) function's second parameter (see + below at section bf(USER DEFINED FUNCTIONS)). For some options + (see below) the tt(--) separator is not required. + ) + + Icm() supports various options, described next. The tt(-h) option +overrules all other options, the tt(-a) option overrules all other options +except for tt(-h). Of the remaining action options (tt(-b, -c, -e, -i, -p) and +tt(-t)) only one may be specified: + itemization( + sop(a)()(show information about icm(), overruled by tt(-h);) + sop(b)()(discontinued: use option -e instead;) + sop(c)()(the icm() source file is compiled, generating a .bim file;) + sop(e)()(execute the icm() .bim file, given as icm()'s first file + argument. Any additional arguments are passed to the .bim file as-is, + and tt(--) should not be specified;) sop(F)()(the filenames and flags as well as an overview of all actions to - be performed by icm() are shown on the standard output stream) - sop(i)()(the first argument is the icm() source file, the default - binary file is constructed if necessary and all additional - arguments are passed to tt(icm-exec) `as is'.) - sop(p)()(the icm() source file is only preprocessed, output is the - preprocessed only the preprocessor is activated) - sop(q)()(ignored) + be performed by icm() are shown on the standard output stream;) + sop(h)()(provide usage info and end icm();) + sop(i)()(the first argument is the icm() source file, the default binary + file is constructed if necessary. Any additional arguments are passed + to the .bim file as-is, and tt(--) should not be specified;) + sop(p)()(the icm() source file is only preprocessed, and the preprocessed + file is written to icm()'s second + file argument (by default tt(`source'.pim));) + sop(q)()(ignored, will be removed in a future icm() version;) + sop(t)()(the argument following tt(-t) is the name of a temporary .bim + file, which is removed after icm()'s call. When tt(.) is specified as + the name of the temporary .bim file then the default temporary + directory, followed by icm()'s process-id, followed by tt(.bim) is + used. + + Following the name of the temporary .bim file the name of the icm() + source script must be specified. Any additional arguments are passed + to the .bim file as-is, and tt(--) should not be specified; After + setting the source script file's executable flag (tt(chmod +x + script)), and providing it with an initial line like this: verb( + #!/usr/bin/icmake -t. + ) + the icm() script can directly be called: + verb( + script arg1 arg2 + ) + in which case the icm() script tt(`script') is executed while it + receives the arguments tt(script arg1 arg2). + ) sop(T)()(this option must be provided with the name of a directory which is used to store temporary files. E.g., when compiling an icm() script, the output of icm()'s preprocessor is a temporary file which @@ -103,23 +129,7 @@ not a writable directory, in which case the current user's tt($HOME) directory is used. Implicit temporary filenames always start with the process id of the current icm() process.) - sop(t)()(the argument following tt(-t) is the name of a temporary tt(.bim) - file, which is removed after icm()'s call. The next argument is the - name of the icm() script, and all additional arguments are passed as - arguments to the icm() script. After making an icm()-script executable - (tt(chmod +x script)), and providing it with an initial line like - this: - verb( - #!/usr/bin/icmake -t /tmp/script - ) - the script can directly be called: - verb( - script arg1 arg2 - ) - in which case the icm() script tt(`script') is executed while it - received the three arguments tt(script arg1 arg2). - ) - sop(v)()(displays icm()'s version number, and ends icm(), + sop(v)()(display icm()'s version number, and end icm(), overruled by tt(-h)) ) @@ -145,62 +155,75 @@ E.g., if the first line of an (executable) icmakefile 'icm' (without extension) contains verb( - #!/usr/bin/icmake -qi + #!/usr/bin/icmake -i ) then tt(icm) may be issued as a command, thus executing verb( - /usr/bin/icmake -qi icm ... + /usr/bin/icmake -i icm ... ) Alternatively, verb( - #! /usr/bin/icmake -qt /tmp/icm + #!/usr/bin/icmake -t /tmp/icm ) may be used, resulting in the execution of verb( - #! /usr/bin/icmake -qt /tmp/icm icm ... + #!/usr/bin/icmake -t /tmp/icm icm ... ) - In this case the binary file is removed on exit. The PID extension being - the process-id of the icm() program executing tt(icm). + In this case the binary file is removed on exit. + itt(#include "filename")nl() The file tt(filename) is included at the location of the directive - itt(#include )nl() The file tt(filename) is included at the - location of the tt(#include) directive; tt(filename) is searched in - the colon-separated directories specified by the tt(IM) environment - variable. The first occurrence of tt(filename) in the directories - specified by the tt(IM) environment variable is used. - itt(#define identifier [definition])nl() The text tt(identifier) will be - replaced by tt(definition). The definition may contain references to - already defined identifiers, using the tt(${identifier}) format. If - the tt(${identifier}) hasn't been defined (yet), the text - tt(${identifier}) is literally kept. To prevent infinite recursion at - most 100 tt(${identifier}) replacements are allowed. - - Definitions - continue at the next line if the last character on a line is a - backslash (tt(\)) (which is not included in the definition). Double - quoted strings in definitions are kept as is. Multiple blanks in - definitions are contracted to a single blank space. - - A definition is optional. If omitted, the macro is defined, so it can - be used in tt(#if(n)def) directives (see below), but in they are not - replaced by any text in icm() code statements. - itt(#ifdef identifier)nl() - If the tt(identifier) macro was defined the next block of code (until - a matching tt(#else) or tt(#endif) directive was detected) is + + itt(#include )nl() + The file tt(filename) is included at the location of the tt(#include) + directive; tt(filename) is searched in the colon-separated directories + specified by the tt(IM) environment variable. The first occurrence of + tt(filename) in the directories specified by the tt(IM) environment + variable is used. + + itt(#define identifier [definition])nl() + The text tt(identifier) will be replaced by tt(definition). The + definition may contain references to already defined identifiers, + using the tt(${identifier}) format. If the tt(${identifier}) hasn't + been defined (yet), the text tt(${identifier}) is literally kept. To + prevent infinite recursion at most 100 tt(${identifier}) replacements + are allowed. + + Definitions continue at the next line if the last character on a line + is a backslash (tt(\)). (which is not included in the + definition). The preprocessor concatenates double-quuted strings, and + double quoted strings may not span multiple lines. Multiple blanks + (outside of double quoted strings) in definitions are contracted to a + single blank space. + + The definition following the tt(#define's) identifier is optional. If + omitted, the macro is defined, so it can be used in tt(#if(n)def) + directives (see below), but they are not replaced by any text in + icm() code statements. + + itt(#ifdef identifier)nl() + If the tt(identifier) macro was defined the next block of code (until a + matching tt(#else) or tt(#endif) directive was read) is byte-compiled. Otherwise, the block of code is ignored. + itt(#ifndef identifier)nl() If the tt(identifier) macro was em(not) defined the next block of code (until a matching tt(#else) or tt(#endif) directive was detected) is byte-compiled. Otherwise, the block of code is ignored. + itt(#else)nl() - Terminates a tt(#ifdef) and tt(#ifndef) directive, reversing the - acceptance decision about the following code. Only one tt(#else) + Terminates a tt(#ifdef) and tt(#ifndef) directive, reversing the + acceptance decision about the following code. Only one tt(#else) directive can be associated with tt(#if(n)def) directives. + itt(#endif)nl() - Terminates the preprocessor block starting at the matching - tt(#ifdef), tt(#ifndef) or tt(#else) directive. + Terminates the preprocessor block starting at the matching + tt(#ifdef), tt(#ifndef) or tt(#else) directive. The tt(#endif) + directory and its matching tt(#if(n)def) directive must be specified + in the same file. + itt(#undef identifier) nl() - Remove tt(identifier) from the set of defined symbols. This does not + Remove tt(identifier) from the set of defined symbols. This does not affect the specification of any previously defined symbols in which tt(identifier's) definition has been used. If tt(identifier) hasn't been defined a warning is issued. @@ -208,7 +231,7 @@ manpagesection(DATA TYPES) - Icm() supports three data types: + Icm() supports these data types: itemization( itt(ASCII character constants)nl() ASCII character constants consist of one character, surrounded by @@ -233,7 +256,7 @@ itt(string)nl() Text variables. String constants are delimited by double quotes. Multiple string constants may be concatenated, but a single - string constant may not extend over multiple lines. String constants + string constant may not span multiple lines. String constants separated by white space only (i.e., blanks, newlines, comment) are concatenated and represent one single string constant. To indicate an end-of-line in a string constant use the tt(\n) escape sequence. @@ -246,7 +269,6 @@ Likewise, ASCII character constants surrounded by single quotes may be used in situations where a string operand is expected. - itt(list)nl() A data structure containing a series of individually accessible tt(string) values. When a list contains elements, its first element is @@ -257,17 +279,17 @@ return a value. ) - Variables may be defined at the global level as well as at any local level -within functions. When defined inside functions, the standard bf(C) scoping + Variables can be defined at the global level as well as at any local level +inside functions. When defined inside functions, the standard bf(C) scoping and visibility rules apply. E.g., local variables can only be used in their own or in more deeply nested blocks, their visibility is masked in more deeply nested blocks by defining an identically named variable inside those more -deeply nested blocks. Variables are strongly typed. A variable cannot have +deeply nested blocks. Variables are strongly typed, and cannot have type tt(void). - Variables may be initialized once they are defined. Initializations can -use expressions, using predefined functions, constant values and values of -variables that are visible at the point of definition. + Variables may be initialized when they are defined. Initializations are +expressions, that can use pre- or user-defined functions, constant values, and +values of variables that are visible at the point of definition. manpagesection(PREDEFINED CONSTANTS) @@ -317,21 +339,24 @@ bf(int-typed operand(s):) - All bf(C) operators (except for pointers, as icm() does not support -pointers) are supported, operating like their bf(C) counterparts on tt(int) -expressions. + All bf(C) operators are available (except for pointer operators, as icm() +does not support pointers). They operate like their bf(C)-programming language +counterparts. bf(string-typed operand(s):) - For tt(string) type variables and/or values the following -operators are available: + For tt(string) type variables and/or constants the following +operators are available (tt(a) and tt(b) represent tt(string) variables or +constants): + itemization( itt(a + b): returns a new tt(string) value containing the concatenation of tt(string) values tt(a) and tt(b). Note that tt(string) constants may be -concatetated without using the tt(+) operator, e.g., +directly concatetated (without using the tt(+) operator), e.g., the following +two lines both define the string tt("hello world"): verb( - "hello " "world" - "hello " + "world" +"hello " "world" +"hello " + "world" ) itt(a += b): tt(a) must be a tt(string) variable, to which the tt(string) @@ -340,48 +365,52 @@ it() string comparisons: operators tt(== != <= >= < > !=) and tt(==) may be applied to tt(string) values or variables, returning 1 if the comparison succeeds, otherwise 0. Comparison is case sensitively, and follows the -tt(ASCII) character set. +ordering or characters as defined in the tt(ASCII) character set. - itt(!a): the boolean tt(!) operator returns 1 if the tt(string a) is + itt(!a): the boolean tt(!) (not) operator returns 1 if the tt(string a) is empty, otherwise 0 is returned. itt(a younger b, a newer b): returns 1 if file tt(a) is more recent than -file tt(b). E.g., tt("source.cc" newer "source.o"). If tt(b) doesn't exist, 1 -is returned; if tt(a) doesn't exist 0 is returned; if neither tt(a) nor tt(b) -exists, 0 is returned; if they are of the same age, 0 is returned. Explicit -tests for the existence of a file can be performed using the tt(exists()) -predefined function (see below, section bf(PREDEFINED FUNCTIONS)). +file tt(b). E.g., tt("source.cc" newer "source.o"). The files tt(a) and tt(b) +do not have to exist: if both don't exist 0 is returned; if tt(b) doesn't +exist, 1 is returned; if tt(a) doesn't exist 0 is returned; if they are +equally old 0 is returned. (the tt(exists()) predefined function (see below, +section bf(PREDEFINED FUNCTIONS)) can be used to test explicity whether a file +exists). itt(a older b): turns 1 if file tt(a) is older than file tt(b). E.g., -tt("libprog.a" older "source.o"). If tt(a) doesn't exist, 1 is returned; if -tt(b) doesn't exist 0 is returned; if neither tt(a) nor tt(b) exists, 0 is -returned; if they are of the same age, 0 is returned. +tt("libprog.a" older "source.o"). The files tt(a) and tt(b) do not have to +exist: if both don't exist 0 is returned; if tt(a) doesn't exist, 1 is +returned; if tt(b) doesn't exist 0 is returned; if they are equally old 0 is +returned. - itt([]): the index operator is defined as an alternative to the built-in -function tt(element). It can only be applied (as holds true for tt(element()) -as well) as so-called em(rvalue). Therefore, constructions like: + itt([]): the index operator retrieves a character from a string variable +or constant: it returns a string as an em(rvalue). Therefore, the following +statement compiles OK: verb( - // assume str1 and str2 are strings - str1 = str2[3] + // assume str1 and str2 are strings +str1 = str2[3]; ) - will be accepted, but the following construction will not be accepted: + but the following statement won't compile: verb( - str2[3] = str; // won't compile +str2[3] = "a"; ) + An empty string is returned if an invalid index value is provided. + it() The `backtick` operator (tt(`string cmd`))nl() - A string placed between two backticks is executed by the tt(popen)(3) + A string placed between two backticks is executed by the tt(popen)(3) function. The standard output gererated by the command that is stored in the string argument is returned as a list. An empty list indicates that the command could not be executed. A command that could be executed but did not produce any output returns a list containing one empty element. The command's standard error stream output is not - automatically collected. Standard shell redirection could be used to - collect the standard error stream's output as well. Example: - verb( - string s = "ls"; - printf(`s`); // prints the elements in the current - // directory + collected by the backtick operator. However, standard shell + redirection could be used to collect the standard error stream's + output. Example: + verb( +printf(`"ls"`); // prints the elements in + // the current directory ) The predefined function tt(eval(string cmd)) behaves exactly like the backtick operator: they are synonyms. @@ -395,36 +424,40 @@ itt(a + b): returns a new tt(list) value containing the concatenation of tt(list) values tt(a) and tt(b). This is em(not) a set operation: if an element appears both in tt(a) and in tt(b), they will appear twice in the -resulting list. +resulting list (set-addition is provided by the built-in function +tt(listunion)). itt(a - b): returns a new tt(list) value containing the elements in tt(a) -that are not present in tt(b). This em(is) a set operation. +that are not present in tt(b). This em(is) a set-difference operation: the +returned list contains all elements in tt(a) that are not elements of tt(b). itt(a += b): elements in tt(b) are added to the elements in tt(a), which must be a tt(list) variable. This is em(not) a set operation. itt(a -= b): elements in tt(b) are removed from the elements in tt(a), -which must be a tt(list) variable. This em(is) a set operation. +which must be a tt(list) variable. This em(is) a set operation: all elements +of tt(a) that are found in tt(b) are removed from tt(a). it() list equality comparisons: operators tt(!=) and tt(==) may be applied to tt(list) values or variables. Operator tt(==) returns 1 if both lists have -element-by-element identical elements, 0 otherwise. Operator tt(!=) reverses -the result of tt(==). +element-by-element identical elements, otherwise 0 is returned. Operator +tt(!=) reverses the result of tt(==). itt(!a): the boolean tt(!) operator returns 1 if the tt(list a) is empty, otherwise 0 is returned. - itt([]): the index operator is defined as an alternative to the built-in -function tt(element). It can only be applied (as holds true for tt(element()) -as well) as so-called em(rvalue). Therefore, constructions like: + itt([]): the index operator retrieves a list element from a list variable: +it returns a string as an em(rvalue). Therefore, the following statement +compiles OK: verb( - // assume lst is a list, str is a string - str = lst[3] + // assume lst is a list, str is a string +str = lst[3]; ) - will be accepted, but the following construction will not be accepted: + but the following statement won't compile: verb( - lst[3] = str; // won't compile +lst[3] = str; ) + An empty string is returned if an invalid index value is provided. ) bf(Casting:) @@ -433,12 +466,12 @@ cast: itemization( it() Strings to ints and vice versa (tt((int)"123", (string)55)) - it() Strings may be cast to lists (tt(list lst = (list)"hello")) + it() Strings to lists (tt(list lst = (list)"hello")) ) manpagesection(FLOW CONTROL) - Icm() offers the following subset of bf(C)'s statement types. They can be + Icm() offers the following subset of bf(C)'s statements. They can be used as in the bf(C) programming language. itemization( itt(expression ;)nl() @@ -450,7 +483,7 @@ point of definition. itt(if (condition) statement)nl() - A variable may be defined and initialized within the condition. E.g, + Inside the condition a variable may be defined and initialized. E.g, verb( if (string str = getText()) process(str); @@ -460,42 +493,55 @@ after the tt(if) statement. itt(if (condition) statement else statement)nl() - As with the previous statement, a variable may be defined and - initialized within the condition. + As with the previous statement, inside the condition a variable may be + defined and initialized. itt(for (init; condition; increment) statement)nl() Variables (of a single type) may be initialized (and optionally be defined) in the tt(init) section. The tt(init), tt(condition) and - tt(increment) sections may be left empty. The empty condition section + tt(increment) sections may remain empty. The empty condition section is interpreted as `always tt(true)'. itt(while (condition) statement)nl() - A variable may be defined and initialized within the condition.nl() - A complementary tt(do ... while()) statement is not available. + Inside the condition a variable may be defined and initialized.nl() + A complementary tt(do ... while()) statement is not available. Note + that defining a variable, using an initialization expression means + that the intialization expressing is executed at each iteration of the + tt(while) statement. So the following statement will never end, and + will display a never ending stream of values 10: + verb( +while (int x = 10) + printf(x--, "\n"); + ) + + itt(return;), and tt(return expression;)nl() + Plain tt(return) statements can be used in tt(void) functions, + and tt(return expression) statements are used in other type of + functions. The function tt(main) has return type tt(void) and so in + tt(main) only plain tt(return) statements can be used. + By default an icm() script's exit value equals 0. Use the built-in + function tt(exit) (see below) to specify any other exit value. - itt(return)nl() - Plain tt(return) statements can be used for tt(void) functions, - and tt(return expression) statements are used for other - functions. The function tt(main) by default returns 0; other functions - do not use default return values. + bf(Be advised: ) the behavior of non-void functions not returning + values is undefined. itt(break)nl() - To leave tt(for) and tt(while) statements, overruling the statement's + Leaves tt(for) and tt(while) statements, overruling the statement's condition. itt(continue)nl() - To continue with the next iteration of a tt(for) or tt(while) + Continues with the next iteration of a tt(for) or tt(while) statement. itt(exit(expression))nl() - To end the execution of an icm()-script. The tt(expression) must + Ends the execution of an icm()-script. The tt(expression) must evaluate to an tt(int) value, which becomes the script's exit value. ) manpagesection(PREDEFINED FUNCTIONS) Icm() offers the following predefined functions, which can be used -anywhere in icm() scripts. The function overview is ordered alphabetically +anywhere in icm() scripts. The following overview is ordered alphabetically by function name. itemization( @@ -517,23 +563,6 @@ Returns tt(i) as a string, e.g., tt(ascii(65)) returns the string tt("A"); - it() The `backtick` operator (tt(`))nl() - A string placed between two backticks is executed by the tt(popen)(3) - function. The standard output gererated by the command that is stored - in the string argument is returned as a list. An empty list indicates - that the command could not be executed. A command that could be - executed but did not produce any output returns a list containing one - empty element. The command's standard error stream output is not - automatically collected. Standard shell redirection could be used to - collect the standard error stream's output as well. Example: - verb( - string s = "ls"; - printf(`s`); // prints the elements in the current - // directory - ) - The predefined function tt(eval(string cmd)) behaves exactly like the - backtick operator: they are synonyms. - itt(string change_base(string file, string newbase))nl() Changes the basename of tt(file), returns the changed name. E.g, tt(change_base("/path/demo.im", "out")) returns tt("/path/out.im"); @@ -550,12 +579,13 @@ itt(string chdir(string newdir))nl() Changes the script's working directory, returns the previous dir as an - absolute path.nl() - Use tt(chdir(".")) to get current working directory, tt(chdir("")) may - be used to obtain the startup working directory (this functionality - was broken in releases before than 7.00, but is now operational). The - function terminates the icm()-script if the specified tt(newdir) does - not exist. + absolute path. + + Use tt(chdir(".")) to obtain the current working directory, + tt(chdir("")) may be used to obtain the startup working directory + (this functionality was broken in releases before than 7.00, but is + now operational). The function terminates the icm()-script if the + specified tt(newdir) does not exist. itt(string chdir(int checking, string newdir))nl() Same functionality as the previous function, but by specifying @@ -574,25 +604,19 @@ itt(echo(int opt))nl() Controls echoing of called programs (and their arguments), specify - tt(OFF) if echoing is not requested. By default tt(ON) is active. + tt(OFF) if echoing is not requested. By default tt(echo(ON)) is used. - itt(string element(int index, list lst))nl() - Returns string tt(index) (0-based) from tt(lst). An empty string is - returned if an unavailable index value is provided. See also the - tt([]) operator in the section bf(OPERATORS). - - itt(string element(int index, string str))nl() - Returns character tt(index) (0-based) from tt(str). An empty string is - returned if an unavailable index value is provided. See also the - tt([]) operator in the section bf(OPERATORS). + itt(string element(int index, list (or string) var))nl() + Acts identical to the index operator: refer to the index (tt([])) + operator in the section bf(OPERATORS). itt(list eval(string str))nl() This function acts identically to the backtick operator. The example - shown at the description of the backtick operator could therefore also + provided with the backtick operator could therefore also have been written like this: verb( - printf(eval("ls")); // prints the elements in the current - // directory +printf(eval("ls")); // prints the elements in the current + // directory ) itt(exec(string cmd, ...))nl() @@ -615,12 +639,13 @@ itt(execute(string cmd, string cmdhd, string arghd, ..., string argtl, string cmdtl))nl() - Same as tt(exec()), but command head/tail and argument - head/tail must be specified. - The actually executed command starts with tt(cmd), followed by - tt(cmdhd). Next is a series of arguments follows, each - enclosed by tt(arghd) and tt(argtl). The command terminates - with tt(cmdtl). 0 is returned + Same as tt(exec()), but command head/tail and argument head/tail must + be specified. + + The actually executed command starts with tt(cmd), followed by + tt(cmdhd). Next is a series of arguments follows, each enclosed by + tt(arghd) and tt(argtl). The command terminates with tt(cmdtl). 0 is + returned itt(execute(int checking, string cmd, string cmdhd, string arghd, ..., string argtl, string cmdtl))nl() @@ -633,18 +658,21 @@ Returns a non-zero value if tt(file) exists, otherwise 0 is returned. itt(list fgets(string file, list offset))nl() - bf(NOTE:) the prototype of this function changed from - tt(fgets(string file, int offset)) to tt(fgets(string file, list - offset)) at version 8.00.00.nl() - - The next line found at offet tt(offset) is read from tt(file). It - returns a list tt(retlist) containing as its first element the - contents of the read line (without the tt(\n) line terminator), as its - second element the line's terminator `tt(\n)' (if encountered), and as - its third element the string tt(OK) if a line was successfully read, - tt(FAIL) if reading from file failed. At EOF an empty list is - returned. The list may contain additional elements, which are - internally used by tt(fgets).nl() + bf(NOTE:) in icm() version 8.00.00 the prototype of this function was + changed from tt(list fgets(string file, int offset)) to + tt(list fgets(string file, list offset)). + + The next line found at the offset contained in tt(offset) is read from + tt(file). Pass an empty list to tt(fgets) to read tt(file) from its + beginning. + + It returns a list containing as its first element the contents of the + read line (without the tt(\n) line terminator), as its second element + the line's terminator `tt(\n)' (if encountered), and as its third + element the string tt(OK) if a line was successfully read, tt(FAIL) if + reading from file failed. When reading at EOF an empty list is + returned. The returned list may contain additional elements, which are + internally used by tt(fgets) when reading the next line. To read multiple lines, start by passing an empty list as tt(gets's) second argument. To read subsequent lines, pass the previously @@ -652,14 +680,14 @@ Here is an example showing how to read a complete file: verb( - list ret; - while (1) - { - ret = fgets("filename", ret); - if (!ret) - break; - process(ret[0], ret[1]); - } +list ret; +while (1) +{ + ret = fgets("filename", ret); + if (!ret) + break; + process(ret[0], ret[1]); +} ) itt(int fprintf(string filename, ...))nl() @@ -668,11 +696,12 @@ itt(int fprintf(string filename, string format, ...))nl() Appends all (comma separated) arguments to the file - tt(filename). Returns the number of printed arguments.nl() - If tt(format) contains placeholders %1 .. %n the output is - formatted (see also tt(strformat)). Note that in this case - argument counting (also) starts beyond the format string: the - first argument following tt(format) is referred to as tt(%1). + tt(filename). Returns the number of printed arguments. + + If tt(format) contains placeholders %1 .. %n the output is formatted + (see also tt(strformat)). Note that in this case argument counting + (also) starts beyond the format string: the first argument following + tt(format) is referred to as tt(%1). itt(string get_base(string file))nl() Returns the base name of tt(file). The base name is the file without @@ -683,13 +712,12 @@ base name of tt(a/b/c) equals tt(c). itt(string getch())nl() - Returns the next pressed key as a string (no `Enter' required for - ms-dos and unix (incl. linux) systems). + Returns the next pressed key as a string (pressing `Enter' is not + required). itt(string get_dext(string file))nl() Returns the extension of tt(file), including the separating dot. The - extension is all information starting at the final dot - in the filename. + extension is all information starting at the filename's final dot. If no final dot is found, an empty string is returned. @@ -698,8 +726,8 @@ containing two elements: the first element indicates whether the environment variable was - defined (value tt("1")) or not (value tt("0"));nl() the second element - indicates the value of the environment variable. + defined (value tt("1")) or not (value tt("0"));nl() + the second element indicates the value of the environment variable. Enivironment variables are of the form tt(variable=value), and if defined the list's second element contains tt(value). If the value is @@ -707,17 +735,17 @@ itt(string get_ext(string file))nl() Returns the extension of tt(file), except for the separating dot. The - extension is all information starting at the final dot - in the filename. + extension is all information starting at the final dot in the + filename. If no final dot is found, an empty string is returned. - itt(int getpid())nl() - Returns the process-id (UNIX) of the icmake byte - code interpreter bf(icm-exec). + itt(int getpid())nl() + Returns the process-id of the icmake byte code interpreter + bf(icm-exec). itt(string gets())nl() - Returns the next line read from the keyboard as a tt(string). The line + Returns the next line read from the keyboard as a tt(string). The line entered on the keyboard must be terminated by an `Enter' key, which is not stored in the returned string. @@ -728,13 +756,26 @@ If no path is found, an empty strring is returned. + itt(int listfind(list lst, string str))nl() + Returns the first index in tt(lst) where the string tt(str) is found, + or -1 if tt(lst) does not contain tt(str). + itt(int listlen(list l))nl() Returns the number of elements in tt(list). + itt(list listunion(list lhs, list rhs))nl() + Returns a list containing the union of the elements in tt(lhs) and + tt(rhs). + + itt(list listunion(list lst, string str))nl() + Returns a list containing the union of the elements in tt(lst) and + tt(str). + itt(list makelist(string mask))nl() Returns a list of all files matching tt(mask). E.g., tt(makelist("*.c")) returns a list containing all files ending in tt(.c). + itt(list makelist(type, string mask))nl() Same as the previous function, but the type of the directory elements may be specified as its first argument: @@ -777,13 +818,14 @@ itt(int printf(string format, ...))nl() Shows all (comma separated) arguments to screen (i.e., the standard output stream). Returns the number of printed arguments (the - tt(format) string counts as one argument).nl() + tt(format) string counts as one argument). + If tt(format) contains placeholders %1 .. %n the output is formatted (see also tt(strformat)). itt(int putenv(string envvar))nl() - Adds tt(envvar) to the current (bf(icmake)) environment - Use the format: "VAR=value". Returns 0. + Adds tt(envvar) to the current (bf(icmake)) environment Use the format: + "VAR=value". Returns 0. itt(string resize(string str, int newlength)) Returns a copy of string tt(str), resized to tt(newlength) characters. @@ -798,15 +840,15 @@ Deprecated: use tt(listlen). itt(list stat(string entry))nl() - Returns bf(stat)(2) information of directory entry tt(entry) as - a list. The returned list has two elements: element 0 is the + Returns bf(stat)(2) information of directory entry tt(entry) as a + list. The returned list has two elements: element 0 is the em(attribute value), element 1 contains the size of the file. Attributes are returned as bit-flags, composed from the following predefined constants: verb( - S_IFCHR S_IFDIR S_IFREG - S_IREAD S_IWRITE S_IEXEC +S_IFCHR S_IFDIR S_IFREG +S_IREAD S_IWRITE S_IEXEC ) See the bf(stat)(2) manual page for the meanings of these constants. @@ -815,13 +857,18 @@ tt(P_NOCHECK) the function won't terminate the script. Rather, it returns bf(stat)(2)'s return value. - itt(int strlen(string s))nl() - Returns the number of characters in tt(s) (not counting the final 0). + itt(int strchr(string str, string chars))nl() + Returns the first index in tt(str) where any of the characters in + tt(chars) is found, or -1 if tt(str) does not contain any of the + characters in tt(chars). + + itt(int strlen(string str))nl() + Returns the number of characters in tt(str) (not counting the final 0). itt(int strfind(string haystack, string needle))nl() - Returns index in tt(haystack) where tt(needle) is found, or -1 if - tt(needle) is not contained in tt(haystack).nl() - bf(This function was called strstr() in versions before 7.00). + Returns index in tt(haystack) where tt(needle) is found, or -1 if + tt(needle) is not contained in tt(haystack).nl() bf(This function was + called strstr() in versions before 7.00). itt(int strformat(string format,...))nl() Returns a formatted string using placeholders %1 .. %2 to address @@ -897,8 +944,8 @@ itemization( itt(argc) represents the number of elements in tt(argv); - itt(argv) contains the arguments, with element 0 the compiled icm() script -(the `tt(.bim)' file); + itt(argv) contains the arguments, with element 0 being equal to the + name of the .bim file; itt(envp) contains the `environment' variables. The function tt(listlen) can be used to determine the number of its elements. Elements in tt(envp) have @@ -923,7 +970,6 @@ if (getenv("dryrun")[0] == "0") linking(element(2, argv)); } - exit (0); } ) @@ -940,14 +986,15 @@ User-defined functions must have the following elements: itemization( - it() The function's return type. One of the available types must be -used explicitly, e.g., tt(void). There is no default type. + it() The function's return type, which must be one of tt(void, int, + string) or tt(list). There is no default type. it() The function's name, e.g., tt(compile). it() A parameter list, defining zero or more comma-separated -parameters. The parameters themselves consist of a type name followed by the -parameter's identifier. E.g., tt((string outfile, string source)). + parameters. The parameters themselves consist of a type name (tt(int, + string), or tt(list)) followed by the parameter's identifier. E.g., + tt((string outfile, string source)). it() A em(body) surrounded by a pair of curly braces (tt({) and tt(})). ) @@ -965,10 +1012,13 @@ (and optionally initialized) anywhere inside functions, and also in tt(if, for) and tt(while) statements. + The behavior of icm()-scripts using non-void functions that do not return +values is not defined. manpagefiles() - The mentioned paths are sugestive only and may be installation dependent: + The mentioned paths are sugestive only and may vary over different +icm()-installations: itemization( it() bf(/usr/bin/icmake): the main icm() program; it() bf(/usr/bin/icmun): the icm() unassembler; diff -Nru icmake-8.00.05/doc/manpage/icmbuild.yo icmake-8.01.00/doc/manpage/icmbuild.yo --- icmake-8.00.05/doc/manpage/icmbuild.yo 2015-12-17 17:45:54.000000000 +0000 +++ icmake-8.01.00/doc/manpage/icmbuild.yo 2016-02-01 14:36:51.000000000 +0000 @@ -16,8 +16,8 @@ it()bf(ARG1)nl()\ ) -DEFINEMACRO(icm)(0)(bf(icmbuild)) -DEFINEMACRO(Icm)(0)(bf(Icmbuild)) +DEFINEMACRO(icb)(0)(bf(icmbuild)) +DEFINEMACRO(Icb)(0)(bf(Icmbuild)) DELETEMACRO(tt) DEFINEMACRO(tt)(1)(em(ARG1)) @@ -31,58 +31,59 @@ COMMENT( all other: add after () ) manpagesynopsis() - icm() tt(mode) + icb() [-h] [-c] tt(args) manpagedescription() -The icm() script is a generic script that can be used to do program +The icb() script is a generic script that can be used to do program maintenance using bf(icmake)(1). -The script expects two files to be available in the directory where program -maintenance is required, and the icm() script should be available in your -path or it should be started as, e.g., tt(./icmbuild) - -Icm() assumes that your sources exist in and below a directory in which the -files tt(icmconf) and tt(CLASSES) live. The file tt(CLASSES) contains the -names of all subdirectories in which class-specific sources are kept. The file -tt(icmconf) in bf(icmake)(1)'s distribution offers an example of the -configuration parameters that are used for program maintenance. In this latter -file it is assumed that bf(C++) sources are maintained, but the icm() script -is not restricted to do maintenance for bf(C++) programs. - -Icm() compiles all sources in each of the subdirectories named in the file -tt(CLASSES), and then compiles all sources in the current working directory -(except for the source containing tt(main())). +Icb() requires that the file tt(icmconf) is available in the directory where +program maintenance is requested. -The compiled sources result in object modules which are then kept in a +Icb() assumes that your sources exist in and below the current working +directory. The file tt(icmconf) in bf(icmake)(1)'s distribution provides an +example of an tt(icmconf) file that can be used by icb(). In that example +tt(icmconf) file it is assumed that bf(C++) sources are maintained, but +program maintenance for, e.g., bf(C) sources can easily be configured. + +Icb()() compiles all sources in each of the subdirectories named in the file +tt(CLASSES), and then compiles all sources in the current working directory. + +The compiled sources result in object modules which may be kept in a library, against which the main-object module is linked. It is also possible to specify additional libraries against which the program must be linked. -Once a library is constructed it is kept up to date by the script. Changing a -source will result in replacing its former module by its new module in the -library. +If a library is constructed it is kept up to date by icb(). When a source is +successfully compiled its new object module will replace the old one that is +found in the library. At that point the object files are no longer required +and are removed by icb(). manpagesection(KICK-STARTING ICMBUILD) -Normally, icm() is installed and used as follows: +To use icb() do as follows: itemization( - it() Install icm() in your path; - it() copy tt(icmconf) and tt(CLASSES) to your project's base directory - (i.e., the directory in which and where below the project's sources are - found); + it() Install icb() in your path; + it() copy tt(icmconf) (and probably the file tt(CLASSES)) to your + project's base directory (i.e., the directory in which and where below + the project's sources are found); it() Modify the tt(#defines) in the file tt(icmconf) to taste; - it() List the subdirectories containing sources in the file tt(CLASSES) + it() Enter the names of subdirectories containing sources on separate + lines in the file tt(CLASSES) - Note that the order of the classes mentioned in classes em(is) relevant - here. It's no problem to add new class (subdirectory) names, but - reordering should be prevented. If reordering is required, recompile - the library, as the final object files contain class order-numbers. - These class-order numbers prevent file-name collisions and thus prevent - replacing file tt(x.o) from class tt(A) by file tt(x.o) from class - tt(B); + Note that the order of the classes mentioned in tt(CLASSES) em(is) + relevant. New class (subdirectory) names can always be added, but + reordering the lines in the tt(CLASSES) file should be avoided. If + reordering is necessary, then first run the command tt(icmbuild clean) + to remove all files thus far created by icb(). Recompilation is + necessary as the names of the object files contain class order-numbers + for identification. These class-order numbers prevent file-name + collisions (e.g., two classes might use a file tt(data.cc)) and thus + replacement of a file tt(x.o) from class tt(A) by file tt(x.o) from + class tt(B) is prevented; it() Now simply run verb( - icmbuild + icmbuild -h ) from the project's base directory and let the help-info tell you what your options are. See the next section for the modes of operation. @@ -90,43 +91,59 @@ manpageoptions() - Icm() may be called with the following operational modes: + Icb() recognizes two options, at most one should be specified: + itemization( + itt(-h): Provide a short usage overview. + itt(-c): Clear the screen (using tt(tput clear)) before starting the + compilation process + ) + + Following the optional tt(-c) icb()() the following arguments may be + passed to icb(): itemization( itt(clean)nl() clean up remnants of previous activities - itt(help)nl() - provide help and exit (default when called without arguments) itt(library)nl() build the library (static and optionally the dynamic library) itt(program)nl() build the binary program itt(program strip)nl() build the stripped binary program - itt(install ) - install the software in the locations defined in the tt(icmconf) - file, optionally below the directory tt() + itt(install program path) + install the constructed program in the specified path (to be used + after issuing icb() tt(program)) + itt(install static path) + install the constructed static library in the specified path (to be + used after issuing icb() tt(library)) + itt(install shared path) + install the constructed shared library in the specified path (to be + used after issuing icb() tt(library)) ) - The bf(icmconf) file may be given a line defining tt(DEFCOM) containing -the default operational mode to use when none is specified. E.g., + After adding a line to tt(icmconf) containing verb( #define DEFCOM "program" ) - constructs the program when the command `tt(icmbuild)' is -entered. tt(DEFCOM) may also contain combined options, like + icb() by default uses the argument tt(program). After adding + verb( + #define DEFCOM "strip" + ) + icb() by default uses the argument tt(strip). After adding verb( - #define DEFCOM "program strip" + #define DEFCOM "library" ) - Note that tt(DEFCOM) is ignored when an explicit operational mode is -provided to the icm() script. + icb() by default uses the argument tt(library). + + tt(DEFCOM) is ignored when an explicit operational mode is passed to + icb(). manpagefiles() The mentioned paths are sugestive only and may be installation dependent: itemization( it() bf(/usr/share/icmake/icmconf) - Example of a icm() configuration file; + Example of a icb() configuration file; it() bf(/usr/share/icmake/CLASSES) - Example of a icm() tt(CLASSES) file. + Example of a icb() tt(CLASSES) file. ) manpagesection(EXAMPLES) diff -Nru icmake-8.00.05/doc/manpage/icmconf.yo icmake-8.01.00/doc/manpage/icmconf.yo --- icmake-8.00.05/doc/manpage/icmconf.yo 2015-12-17 17:46:03.000000000 +0000 +++ icmake-8.01.00/doc/manpage/icmconf.yo 2016-02-08 13:16:28.000000000 +0000 @@ -29,22 +29,42 @@ manpagedescription() -The bf(icmconf) configuration file is used to specify and tailor the -characteristics of program maintenance performed by the bf(icmbuild)(1) icmake +The tt(icmconf) configuration file is used to specify and fine-tune the +characteristics of program maintenance performed by the bf(icmbuild)(1) script. It can be used to activate and specify various directives that -determine how the program or library maintenance will proceed. +determine how the program or library maintenance is performed. The directives are biased towards the construction of a bf(C++) program, but -program maintenance for other languages (e.g., bf(C)) can easily be realized -as well. +program maintenance for other languages (e.g., bf(C)) can also easily be +configured. + +The bf(icmbuild)(1) script ignores empty lines and lines whose first non-blank +character is a hash-mark (tt(#)) as well as lines whose first non-blank +characters are two consecutive forward slashes (//). Long lines can be split +over multiple lines by using a final backslash character at lines continuing +at the next line (refer to the bf(icmake)(1) man-page for further details). manpagesection(CLASS DEPENDENCIES) -Traditional make-utilities recompile sources once header files are -modified. In the context of bf(C++) program development this is often a bad -idea, as adding a new member to a class does not normally require you to -recompile the class's sources. To handle class dependencies in a more sensible -way, bf(icmake)(1)'s tt(CLASSES) file may define dependencies among classes. +Traditional make-utilities recompile all dependent sources once header files +are modified. When developing bf(C++) programs this is hardly ever requird, as +adding a new member function to a class does not require you to recompile +already existing source files. Recompilation em(is) required when modifying +the data member organization of classes. + +To handle class dependencies in a more sensible way, bf(icmake)(1)'s +tt(CLASSES) file may define dependencies among classes. + +By default, class-dependencies are not interpreted. To activate +class-dependencoes recognition then the line + verb( +//#define USE_ALL "a" + ) + in the tt(icmconf) file must be uncommented: + verb( +#define USE_ALL "a" + ) + If a class Y depends on class X as in: verb( @@ -62,61 +82,47 @@ }; ) then the sources of class Y should be recompiled if X's data organization -has changed. In cases like these Y depends on X. +has changed. In such cases Y depends on X. Such class dependencies can be specified in the CLASSES file using the form: verb( y x ) - where x and y are the directories holding the respective class sources. Then, -when altering X's data organization, do 'touch x/a', followed by 'icmbuild -program': x's sources as well as the sources in directories (in)directly -depending on x (e.g., y) are then automatically recompiled by icmbuild. + where x and y are the names of the directories in which the respective class +sources are found. If tt(icmconf) contains a line + verb( +#define USE_ALL "a" + ) + then, after modifying X's data organization, do 'touch x/a', followed by +'icmbuild program'. Icmbuild now compiles all of x's sources as well as +the sources in directories (in)directly depending on x (in the example: the +sources in the y directory). -Multiple dependencies can also be specified. If the class -organization looks like this: +Multiple dependencies can also be specified. If the class organization looks +like this: verb( class Z: public Y { X d_x; }; ) - then Z depends on both Y and X. In the CLASSES file this may be indicated -by the line + then Z depends on both Y and X. In the CLASSES file this is configured +like this: verb( z x y ) - Indirect dependencies are automatically followed. After changing X's data + Indirect dependencies are automatically recognized. After changing X's data organization where CLASSES contains the lines verb( x y x z y ) - then 'icmbuild program' results in recompiling all of the sources in -classes x, y and z. - -By default, class-dependencies are not interpreted. To activate them the line - verb( -//#define USE_ALL "a" - ) - in the tt(icmconf) file must be uncommented: - verb( -#define USE_ALL "a" - ) - -Empty lines and lines whose first non-blank character is a hash-mark (tt(#)) -or whose first non-blank characters are two consecutive forward slashes (//) -are ignored. Long lines can be split over multiple lines by using a final -backslash character at lines which continue at the next line. E.g., - verb( - name1 depends on \ - multiple other \ - classes - ) + then tt(icmbuild) recompiles all source files in directories x, y and z. manpagesection(ICMCONF PARAMETERS) + itemization( itb(#define ADD_LIBRARIES "") When a program must be linked against additional libraries (other than @@ -144,32 +150,31 @@ "gcc"). Its setting is overruled by an identically named environment variable. - itb(#define CXXFLAGS "--std=c++14 -Wall -g -O2") + itb(#define CXXFLAGS "--std=c++14 -Wall -O2") The compiler options to use. The default options are shown. When the bf(C) compiler is used, use tt(#define CFLAGS) rather than tt(CXXFLAGS). Its setting is overruled by an identically named environment variable. itb(#define DEFCOM "...") - A tt(DEFCOM) directive may be added to the tt(icmconf) file by - tt(icmstart). It may be defined as: + A tt(DEFCOM) directive may be added to the tt(icmconf) file (the + bf(icmstart)(1) script can do this for you). It may be defined as: verb( #define DEFCOM "program" ) - in which case tt(icmbuild) will do program maintenance. Alternatively - it may be defined as: + in which case tt(icmbuild) will do program maintenance. It may also be + defined as: verb( #define DEFCOM "program strip" ) - in which case tt(icmbuild) will do program maintenance, creating a - stripped binary program. It may also be defined as + in which case tt(icmbuild) does program maintenance, creating a + stripped binary program. + + Alternatively it may also be defined as: verb( #define DEFCOM "library" ) - in which case tt(icmbuild) will de library maintenance. - - If this directive was not added by bf(icmstart)(1) it can always be - added to tt(icmconf) by hand. + in which case tt(icmbuild) does library maintenance. itb(#define IH ".ih") The extension used for internal header files. See tt(#define PRECOMP) @@ -185,53 +190,24 @@ constructed. When a binary program is built it will be linked against this library rather than to the individual object modules. - If a library construction is intended (see also the tt(DEFCOM) - directive), then the tt(LIBRARY) directive defines the base name - (without the tt(lib) prefix and without the tt(.a) extension) of the - library to be constructed. - - After a library construction tt(install static dir) installs the static - library at tt(dir), which tt(install shared dir) installs the shared - library (see below at tt(#define SHARED)) at tt(dir). + If a library must be constructed (see also the tt(DEFCOM) directive), + then the tt(LIBRARY) directive must specify the library's base name + (without the tt(lib) prefix and without the tt(.a) extension). + + After a library has been constructed tt(icmbuild install static dir) + installs the static library at tt(dir), while tt(icmbuild install + shared dir) installs the shared library (see below at tt(#define + SHARED)) at tt(dir). itb(#define MAIN "main.cc") - The source file defining the tt(int main) function. This specification - may be left as-is or may completely be removed if bf(icmbuild)(1) is - used for library maintenance rather than program maintenance. + The source file in which the tt(int main) function is defined. This + specification may be left as-is or may completely be removed if + bf(icmbuild)(1) is used for library maintenance rather than program + maintenance. itb(#define OBJ_EXT ".o") The extension of object modules created by the compiler. - itb(#define PARSER_DIR "") - The subdirectory containing the parser's specification file. Leave - empty if no parser class is used and if no parser is generated. - The following directives, beginning with tt(PARS), are only - interpreted when tt(PARSER_DIR) is defined as a non-empty string. - - itb(#define PARSFILES "") - If the parser specification file named at tt(PARSSPEC) itself includes - additional specification files, then patterns matching these - additional grammar specification files should be specified here. The - pattern is interpreted in the directory specified at tt(PARSER_DIR) - and could contain a subdirectory name (e.g. tt(specs/*)). When files - matching the pattern are modified then a new parser will be - created. By default no additional specification files are used. - - itb(#define PARSFLAGS "-V") - The flags to use when calling the program specified at tt(PARSGEN). - - itb(#define PARSGEN "bisonc++") - The name of the program generating the parser. - - itb(#define PARSOUT "parse.cc") - The name of the file generated by the parser generator (which is used - by tt(icmbuild) to compare the timestamps of the parser specification - file(s) against). - - itb(#define PARSSPEC "grammar") - The name of the parser specification file. This file is - expected in the directory specified at tt(PARSER_DIR). - itb(//#define PRECOMP "-x c++-header") When activated internal header files (see tt(#define IH)) are precompiled when they are more recent than their precompiled @@ -243,36 +219,6 @@ Define tt(REFRESH) to relink the binary program at every tt(icmbuild program) call. By default tt(REFRESH) is em(not) defined. - itb(#define SCANNER_DIR "") - The subdirectory containing the scanner's specification file. Leave - empty if no scanner class is used and if no lexical scanner is - generated. The following directives, beginning with tt(SCAN), are only - interpreted when tt(SCANNER_DIR) is defined as a non-empty string. - - itb(#define SCANFILES "") - If the lexical scanner specification file named at tt(SCANSPEC) itself - includes additional specification files, then patterns matching these - additional lexer specification files should be specified here. The - pattern is interpreted in the directory specified at tt(SCANNER_DIR) - and could contain a subdirectory name (e.g. tt(specs/*)). When files - matching the pattern are modified then a new lexical scanner will be - created. By default no additional specification files are used. - - itb(#define SCANFLAGS "") - The flags to use when calling the program specified at tt(SCANGEN). - - itb(#define SCANGEN "flexc++") - The name of the program generating the lexical scanner. - - itb(#define SCANOUT "lex.cc") - The name of the file generated by the lexical scanner (which is used by - tt(icmbuild) to compare the timestamps of the scanner specification - file(s) against). - - itb(#define SCANSPEC "lexer") - The name of the lexical scanner specification file. This file is - expected in the directory specified at tt(SCANNER_DIR). - itb(#define SHARED) This directive is only interpreted if tt(LIBRARY) was also specified. If defined a static library (extension tt(.a)) as well as a shared @@ -317,37 +263,32 @@ word on a line) optionally followed by additional class names, which are the classes on which the line's first class name depends. - Assuming that a program uses five classes tt(One, Two, Three, Four) and - tt(Five) and that class tt(Three) depends on class tt(Two), which in - turn depends on class tt(One), while class tt(Five) depends on - tt(Three) and tt(Four), then the file tt(CLASSES) may reflect these - dependencies as follows: - verb( + Assuming that a program uses five classes tt(One, Two, Three, Four) + and tt(Five), whose sources are in, respectively, directories tt(one, + two, three, four), and tt(five). If class tt(Three) depends on class + tt(Two), which in turn depends on class tt(One), while class tt(Five) + depends on tt(Three) and tt(Four), then the file tt(CLASSES) may + reflect these dependencies as follows: + verb( one two one three two four - five three four ) - Now touching (creating) the file tt(two/a) (using e.g., the command -tt(touch two/a)) causes all sources of the classes tt(Two, Three) and tt(Five) -as well as all the sources in the program's root directory to be recompiled: + five three four + ) + Afer touching (creating) the file tt(two/a) (using e.g., the command +tt(touch two/a)) all sources of the classes tt(Two, Three) and tt(Five) +as well as all the sources in the program's root directory are recompiled: tt(Two) is recompiled because of the existence of tt(two/a), tt(Three) is recompiled because it depends on tt(Two), tt(Five) is recompiled because it depends on tt(Three), the sources in the program's root directory are -recompiled because at least one directory is recompiled. - -This facility was added to the tt(icmbuild) script because bf(C++) header -files are often modified em(without) the need to recompile all their depending -sources. No recompilation is necessary when a new class member function is -declared. Recompilation, however, em(is) necessary when the class's internal -organization changes, e.g., when the organization of its data members is -modified. Simply touching a file tt("a") is sufficient to perform -the necessary recompilations. +recompiled because at least one directory was recompiled. -Following the recompilations the tt(USE_ALL) file(s) are removed. +Following the recompilations the file(s) specified at tt(#define USE_ALL) are +removed. -When the tt(USE_ALL) directive was defined the command tt(icmbuild -clean) also removes any leftover tt(USE_ALL) files from the program's direct +When the tt(USE_ALL) directive was defined the command tt(icmbuild clean) also +removes any leftover tt(USE_ALL) files from the program's direct subdirectories. itb(#define USE_ECHO ON) @@ -360,32 +301,80 @@ project's release years. ) -manpagesection(OBSOLETE DIRECTIVES) +manpagesection(PARSER MAINTENANCE) + +The following directives are available in cases where a program uses a parser +generator creating a parser class from a grammar specification: + itemization( - itb(BINARY "") - This tt(#define) may safely be removed from older tt(icmconf) files as - it is no longer used by tt(icmbuild). When a binary program is - constructed it is created as tt(TMP_DIR "/bin/binary"), while - tt(install program path) installs the binary program at tt(path). - - itb(BIN_INSTALL) - This tt(#define) may safely be removed from older tt(icmconf) files as - it is no longer used by tt(icmbuild). See tt(#define BINARY) for - details about how to install a binary program - - itb(#define COMPILER "") - This tt(#define) should be replaced by tt(CXX) or tt(CC). - - itb(#define COMPILER_OPTIONS "") - This tt(#define) should be replaced by tt(CXXFLAGS) or tt(CFLAGS). - - itb(LIB_INSTALL) - This tt(#define) may safely be removed from older tt(icmconf) files as - it is no longer used by tt(icmbuild). See tt(#define LIBRARY) for - details about how to install libraries. + itb(#define PARSER_DIR "") + The subdirectory containing the parser's specification file. + + If parser maintenance is not required, then this directive can be + omitted. If omitted, then all other directives, that begin with + tt(PARS), can also be omitted. + + itb(#define PARSFILES "") + If the parser specification file named at tt(PARSSPEC) itself includes + additional specification files, then patterns matching these + additional grammar specification files should be specified here. The + pattern is interpreted in the directory specified at tt(PARSER_DIR) + and could contain a subdirectory name (e.g. tt(specs/*)). When files + matching the pattern are modified then a new parser will be + created. By default no additional specification files are used. + + itb(#define PARSFLAGS "-V") + The flags to use when calling the program specified at tt(PARSGEN). + + itb(#define PARSGEN "bisonc++") + The name of the program generating the parser. + + itb(#define PARSOUT "parse.cc") + The name of the file generated by the parser generator (which is used + by tt(icmbuild) to compare the timestamps of the parser specification + file(s) against). - itb(#define LINKER_OPTIONS "") - This tt(#define) should be replaced by tt(LDFLAGS). + itb(#define PARSSPEC "grammar") + The name of the parser specification file. This file is + expected in the directory specified at tt(PARSER_DIR). + ) + +manpagesection(SCANNER MAINTENANCE) + +The following directives are available in cases where a program uses a scanner +generator creating a lexical scanner class from a set of regular expressions: + + itemization( + itb(#define SCANNER_DIR "") + The subdirectory containing the scanner's specification file. + + If lexical scanner maintenance is not required, then this directive + can be omitted. If omitted, then all other directives, that begin with + tt(SCAN), can also be omitted. + + itb(#define SCANFILES "") + If the lexical scanner specification file named at tt(SCANSPEC) itself + includes additional specification files, then patterns matching these + additional lexer specification files should be specified here. The + pattern is interpreted in the directory specified at tt(SCANNER_DIR) + and could contain a subdirectory name (e.g. tt(specs/*)). When files + matching the pattern are modified then a new lexical scanner will be + created. By default no additional specification files are used. + + itb(#define SCANFLAGS "") + The flags to use when calling the program specified at tt(SCANGEN). + + itb(#define SCANGEN "flexc++") + The name of the program generating the lexical scanner. + + itb(#define SCANOUT "lex.cc") + The name of the file generated by the lexical scanner (which is used by + tt(icmbuild) to compare the timestamps of the scanner specification + file(s) against). + + itb(#define SCANSPEC "lexer") + The name of the lexical scanner specification file. This file is + expected in the directory specified at tt(SCANNER_DIR). ) manpagefiles() @@ -412,7 +401,7 @@ bf(icmake)(1), bf(icmbuild)(1), bf(icmstart)(1), bf(icmstart.rc)(7). manpagebugs() - The interpretation of the class dependencies (see section bf(COMPILING AND -LINKING) has altered when tt(icmake) was updated to version 7.16.00. + bf(icmbuild)(1) ends displaying a fatal error message if the current +working directory does not contain a file tt(icmconf). includefile(trailer.inc) diff -Nru icmake-8.00.05/doc/manpage/icmstart.rc.yo icmake-8.01.00/doc/manpage/icmstart.rc.yo --- icmake-8.00.05/doc/manpage/icmstart.rc.yo 2015-12-17 17:45:54.000000000 +0000 +++ icmake-8.01.00/doc/manpage/icmstart.rc.yo 2016-02-01 14:36:51.000000000 +0000 @@ -28,8 +28,8 @@ manpagedescription() -The bf(icmstart.rc) file defines the initial files of a program that are -installed by bf(icmstart)(1). +The bf(icmstart.rc) file specifies the files that are installed by +bf(icmstart)(1). By default bf(icmstart.rc) is found in tt(/etc/icmake/icmstart.rc), but if a file tt($HOME/.icmake/icmstart.rc) is found then the latter file is used by @@ -50,65 +50,80 @@ The tt(icmstart.rc) file may contain: itemization( it() empty lines, which are ignored; + it() lines beginning with a hash-character (tt(#)), also ignored; - it() Optionally: a P (don't install with tt(icmstart xxx library)) or an L -(don't install with tt(icmstart xxx program)), followed by a blank; see also -bf(icmstart)(1). - it() Optionall: a tt(?) (followed by a blank) following the optional P or -L in which case the installation of the element must be confirmed by the user. - it() Source path names. Relative path names are interpreted relative to -the current working directory. Environment variables are not expanded, the -initial tilde character is interpreset as the user's home directory. - it() Source path names followed by a destination (relative to the -directory initialized by bf(icmstart)(1)). + + it() an optional installation mode followed by a source-destination +specification. ) - A source path may be either a file or a directory. If a directory is -specified then all files in and below that directory will be installed. -When specifying a destination a path may be specified as well. However, the -destination path is always interpreted relative to the installation directory -specified when calling bf(icmstart)(1). +manpagesection(INSTALLATION MODE) + + An installation mode consists of a combination of: + itemization( + it() either a P (don't install with tt(icmstart xxx library)) or an L +(don't install with tt(icmstart xxx program)); + + it() a D, indicating that the source must also be installed by default, +i.e., if neither `program' or `library' was specified as second argument. -If a destination is omitted, the source is installed as specified below -bf(icmstart)(1)'s destination directory. + it() a b, indicating that the +file must em(not) be installed if the tt(-b) (basic installation) option was +specified when calling tt(icmstart). + + it() Following the optional P, L, D, b combination a space delimited +optional tt(?) may be specified. If specified the installation of the file or +directory must be confirmed by the user. + ) -manpagesection(EXAMPLES) +manpagesection(SOURCE-DESTINATION SPECIFICATIONS) - The following entries can be used in an tt(icmstart.rc) file: + The following source-destination specifications can be used in an +tt(icmstart.rc) file: itemization( it() tt(source)nl() - `Source' must be in the skeleton directory visited by bf(icmstart(1)) -and is installed as tt(source) in the destination directory specified when -calling bf(icmstart)(1). - it() tt(source dest)nl() - `Source' must be in the skeleton directory visited by bf(icmstart(1)) -and is installed as tt(dest) in the destination directory specified when -calling bf(icmstart)(1). - it() tt(~/path)nl() - `~/path' is installed as tt(~/path) in the destination directory -specified when calling bf(icmstart)(1). The tt(~)-character is expanded to the -user's home directory. - it() tt(~/path dest)nl() - `~/path' is installed as tt(dest) in the destination directory -specified when calling bf(icmstart)(1). The tt(~)-characteris expanded to the -user's home directory. - it() tt(/path)nl() - `/path' is installed as tt(./path) in the destination directory -specified when calling bf(icmstart)(1). - it() tt(/path dest)nl() - `/path' is installed as tt(dest) in the destination directory - it() tt(? source)nl() - The user must confirm the installation of tt(source). - it() tt(? source dest)nl() - The user must confirm the installation of tt(source) as tt(dest) in -the destination directory specified when calling bf(icmstart)(1). - it() tt(# text)nl() - Interpreted as comment and ignored. The tt(#)-character must be the - first character on the line. - it() an empty line+nl() - Empty lines are skipped. - ) + A plain name must exist in the tt(icmstart's) skeleton directory. It +is installed in the destination directory tt(`dest') specified when calling +bf(icmstart)(1). Example: + verb( + CLASSES + ) + tt(skeletondir/CLASSES) is installed as tt(dest/CLASSES) + + it() tt(pathspec)nl() + If `pathspec' does not begin with a slash it must exist in +tt(icmstart's) skeleton directory. It is installed as `pathspec' in the +destination directory specified when calling bf(icmstart)(1). Example: + verb( + dir/file + ) + tt(skeletondir/dir/file) is installed as tt(dest/dir/file) + + it() tt(/pathspec) or tt(~/pathspec) + The tt(~)-character is expanded to the user's home directory. The +pathspec's final element is installed in the destination directory specified +when calling bf(icmstart)(1). Example: + verb( + ~/.icmake/file + ) + tt($HOME/.icmake/file) is installed as tt(dest/file) + ) + When the above source specifications are followed by a destination +specification tt(destspec) (a file or non-absolute directory specification) +then the source specification is installed as dest/destspec) below the +destination directory specified when calling bf(icmstart)(1). Examples: + verb( + CLASSES CLASSES # skeletondir/CLASSES is installed as + # dest/CLASSES + dir/file dir/file # skeletondir/dir/file is installed as + # dest/dir/file + ~/.icmake/file .icmake/file # $HOME/.icmake/file is installed as + # dest/.icmake/file + ) + Icmstart conveerts the destination specification to a full path +specification. If this full path specification does not begin with tt(dest's) +full path specification an error message is displayed and tt(icmstart) ends. manpagefiles() The mentioned paths are sugestive only and may be installation dependent: diff -Nru icmake-8.00.05/doc/manpage/icmstart.yo icmake-8.01.00/doc/manpage/icmstart.yo --- icmake-8.00.05/doc/manpage/icmstart.yo 2015-12-17 17:45:54.000000000 +0000 +++ icmake-8.01.00/doc/manpage/icmstart.yo 2016-02-01 14:36:51.000000000 +0000 @@ -141,12 +141,12 @@ When the file tt(YEAR) is defined in a configuration path it should have one line, defining the program's initial release year. E.g., verb( - #define YEARS "2012" + #define YEARS "2016" ) Plural is used here since a release year usually becomes a range of years after some time, as with Icmake's years specification: verb( - #define YEARS "1992-2012" + #define YEARS "1992-2016" ) ) diff -Nru icmake-8.00.05/examples/am icmake-8.01.00/examples/am --- icmake-8.00.05/examples/am 2015-12-17 17:45:54.000000000 +0000 +++ icmake-8.01.00/examples/am 2016-02-13 12:43:22.000000000 +0000 @@ -1,13 +1,9 @@ -#! /usr/bin/icmake -qt /tmp/am +#! /usr/bin/icmake -t. -/* - AM +// This script implements a non-destructive rm (am: attic move) - This script is used to implement a non-destructive rm -*/ - -#define YEAR "1994--1995" -#define VERSION "1.14" +#define YEAR "1994--2016" +#define VERSION "1.14.01" #define ATTIC_DIR "/.attic" // append after $HOME #define ATTIC_ZIP "attic.zip" // the zip-name diff -Nru icmake-8.00.05/examples/defines icmake-8.01.00/examples/defines --- icmake-8.00.05/examples/defines 2015-12-17 17:45:54.000000000 +0000 +++ icmake-8.01.00/examples/defines 2016-02-13 12:45:29.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/icmake -qt /tmp/defines +#!/usr/bin/icmake -t. #define FIRST "This text" #define SECOND "will be printed, starting with: " ${FIRST} diff -Nru icmake-8.00.05/examples/ds icmake-8.01.00/examples/ds --- icmake-8.00.05/examples/ds 2015-12-17 17:45:54.000000000 +0000 +++ icmake-8.01.00/examples/ds 2016-02-01 14:36:51.000000000 +0000 @@ -1,17 +1,11 @@ -#! /usr/bin/icmake -qt /tmp/ds +#!/usr/bin/icmake -t. -/* - D S -*/ - -#define VERSION "1.05" -#define YEAR "1994--1995" - -int - debug; -string - progname, - xdev; +#define VERSION "1.06.01" +#define YEAR "1994--2016" + +int debug; +string progname; +string xdev; void kill(string s) { @@ -21,19 +15,16 @@ string backslash_wild(string spec) { - string - s, - ret; - int - index; + string s; + string ret; - for (index = 0; s = element(index, spec); index++) + for (int index = 0; s = element(index, spec); index++) { if (s == "*" || s == "?") // wildcard specifiers ? ret += "\\"; // protect the wildcard spec. ret += s; } - return (ret); // return the protected string + return ret; // return the protected string } void preamble(list argv) @@ -45,12 +36,9 @@ void option(string arg) { - int - index; - string - optchar; + string optchar; // process all option characters - for (index = 1; optchar = element(index, arg); index++) + for (int index = 1; optchar = arg[index]; ++index) { if (optchar == "x") // X-dev ok ? xdev == ""; // set appropriate flag @@ -63,22 +51,17 @@ list options(int argc, list argv) { - int - index; - list - new; - string - arg; + list new; - for (index = 0; index < argc; index++) // walk all cmd line arguments + for (int index = 0; index != argc; ++index) // all cmd line arguments { - arg = element(index, argv); // get next element + string arg = element(index, argv); // get next element if (element(0, arg) == "-") // found an option ? option(arg); // then process it else new += (list)arg; // else add to the returnlist } - return (new); // return argv-list without options + return new; // return argv-list without options } void usage() @@ -86,8 +69,8 @@ printf ( "\n" - "ICCE DS (Disk Search). Version " VERSION "\n" - "Copyright (c) ICCE " YEAR ". All Rights Reserved\n" + "DS (Disk Search). Version " VERSION "\n" + "Copyright (c) GPL " YEAR ". All Rights Reserved\n" "\n" "DS by Frank B. Brokken\n" "\n" @@ -103,26 +86,21 @@ "For the 'file' argument quoted wildcards (e.g., ds '*.local') are ok.\n" "\n" ); - exit (1); + exit(0); } void process(int argc, list argv) { - string - cmd, - filespec, - startdir; - - if (argc == 2) // a file given as argument - startdir = "/"; // start at the root - else - startdir = element(1, argv); // otherwise start at specified dir + string startdir = argc == 2 ? // a file given as argument + "/" // start at the root + : + argv[1]; // otherwise start at specified dir // protect wildcards in the // filespecification with \-char - filespec = backslash_wild(element(argc - 1, argv)); + string filespec = backslash_wild(element(argc - 1, argv)); - cmd = "find " + startdir + " " + xdev + " -name " + filespec + + string cmd = "find " + startdir + " " + xdev + " -name " + filespec + " 2>/dev/null"; if (!debug) @@ -131,7 +109,7 @@ printf(cmd, "\n"); } -int main(int argc, list argv) +void main(int argc, list argv) { preamble(argv); // preamble: determine progname etc. argv = options(argc, argv); // process options @@ -139,8 +117,6 @@ if (argc == 1) // no arguments ? usage(); // give help - - process(argc, argv); // else process arguments - return (0); + process(argc, argv); // else process arguments } diff -Nru icmake-8.00.05/examples/initialization icmake-8.01.00/examples/initialization --- icmake-8.00.05/examples/initialization 2015-12-17 17:45:54.000000000 +0000 +++ icmake-8.01.00/examples/initialization 2016-02-13 12:44:13.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/icmake -qt /tmp/initialization +#!/usr/bin/icmake -t. int main() diff -Nru icmake-8.00.05/examples/nesteddirectives icmake-8.01.00/examples/nesteddirectives --- icmake-8.00.05/examples/nesteddirectives 2015-12-17 17:45:54.000000000 +0000 +++ icmake-8.01.00/examples/nesteddirectives 2016-02-13 12:45:02.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/icmake -qt /tmp/nesteddirectives +#!/usr/bin/icmake -t. /* This simple icmake script illustrates the use of nested directives diff -Nru icmake-8.00.05/examples/r icmake-8.01.00/examples/r --- icmake-8.00.05/examples/r 2015-12-17 17:45:54.000000000 +0000 +++ icmake-8.01.00/examples/r 2016-02-13 12:44:47.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/icmake -qt /tmp/r +#!/usr/bin/icmake -t. /* This simple icmake script starts a given command in the current diff -Nru icmake-8.00.05/icmake/icmconf icmake-8.01.00/icmake/icmconf --- icmake-8.00.05/icmake/icmconf 2015-12-17 17:45:56.000000000 +0000 +++ icmake-8.01.00/icmake/icmconf 2016-02-01 14:36:51.000000000 +0000 @@ -8,17 +8,7 @@ #define ADD_LIBRARY_PATHS "../../tmp" #define REFRESH #define CLS -#define SCANNER_DIR "" -#define SCANGEN "" -#define SCANFLAGS "" -#define SCANSPEC "" -#define SCANOUT "" -#define PARSER_DIR "" -#define PARSGEN "" -#define PARSSPEC "" -#define PARSFLAGS "" -#define PARSOUT "" #define TMP_DIR "tmp" #define LIBRARY "modules" #define OBJ_EXT ".o" -#define DEFCOM "program" +#define DEFCOM "program" diff -Nru icmake-8.00.05/icmake/options.c icmake-8.01.00/icmake/options.c --- icmake-8.00.05/icmake/options.c 2015-12-17 17:45:56.000000000 +0000 +++ icmake-8.01.00/icmake/options.c 2016-02-01 14:36:51.000000000 +0000 @@ -13,11 +13,13 @@ if (argc == 1) usage(program); - execArgIdx = dashesIndex(argv, argv + argc); + execArgIdx = dashesIndex(argv, argv + argc); /* beyond -- */ setTmpDir(); + + int ready = 0; - while (1) + while (!ready) { int c = getopt(argc, argv, "ac:e:fFhi:t:T:p:qv"); @@ -33,6 +35,7 @@ case 'e': optExecute(); + ready = 1; break; case 'h': @@ -48,6 +51,7 @@ case 'i': optIm(argv); + ready = 1; break; case 'T': @@ -56,8 +60,9 @@ case 't': optTmpBim(argv); + ready = 1; break; - + case 'p': optPreProcess(argv); break; @@ -71,14 +76,16 @@ exit(0); case -1: - inspectFlags(program, argv); - return; + ready = 1; + break; case '?': rss_fatal(0, 0, "option -%c not supported", optopt); } /* switch */ } /* while */ + + inspectFlags(program, argv); } diff -Nru icmake-8.00.05/icmake/opttmpbim.c icmake-8.01.00/icmake/opttmpbim.c --- icmake-8.00.05/icmake/opttmpbim.c 2015-12-17 17:45:56.000000000 +0000 +++ icmake-8.01.00/icmake/opttmpbim.c 2016-02-01 14:36:51.000000000 +0000 @@ -1,6 +1,4 @@ - -/* #define msg -*/ +#define msgx #include "icmake.ih" @@ -11,6 +9,9 @@ bimFile = rss_trimLeft(optarg); + if (strcmp(bimFile, ".") == 0) // replace . by + bimFile = rss_strjoin(tmpDir, ".bim"); // /tmpDir/`pid`.bim + msg("optarg = `%s', bimfile = `%s'", optarg, bimFile); if (argv[optind] == NULL) diff -Nru icmake-8.00.05/icmake/opttmpdir.c icmake-8.01.00/icmake/opttmpdir.c --- icmake-8.00.05/icmake/opttmpdir.c 2015-12-17 17:45:56.000000000 +0000 +++ icmake-8.01.00/icmake/opttmpdir.c 2016-02-01 14:36:51.000000000 +0000 @@ -1,6 +1,4 @@ - -/* #define msg -*/ +#define msgx #include "icmake.ih" @@ -11,5 +9,10 @@ if (tmpDir[strlen(tmpDir) - 1] != '/') /* tmpDir must end in / */ tmpDir = rss_strcat(tmpDir, "/"); + + char pidStr[20]; + snprintf(pidStr, 20, "%u", getpid()); + + tmpDir = rss_strcat(tmpDir, pidStr); } diff -Nru icmake-8.00.05/icmake/settmpdir.c icmake-8.01.00/icmake/settmpdir.c --- icmake-8.00.05/icmake/settmpdir.c 2015-12-17 17:45:56.000000000 +0000 +++ icmake-8.01.00/icmake/settmpdir.c 2016-02-01 14:36:51.000000000 +0000 @@ -5,7 +5,7 @@ struct stat buf; char pidStr[20]; - sprintf(pidStr, "%u", getpid()); + snprintf(pidStr, 20, "%u", getpid()); tmpDir = rss_strcat( rss_strjoin( diff -Nru icmake-8.00.05/icmake/showflags.c icmake-8.01.00/icmake/showflags.c --- icmake-8.00.05/icmake/showflags.c 2015-12-17 17:45:56.000000000 +0000 +++ icmake-8.01.00/icmake/showflags.c 2016-02-01 14:36:51.000000000 +0000 @@ -31,9 +31,9 @@ (flags & f_rmBim) != 0, (flags & f_force) != 0, - imFile, - pimFile, - bimFile, + imFile ? imFile : "--", + pimFile ? pimFile : "--", + bimFile ? bimFile : "--", tmpDir ); } diff -Nru icmake-8.00.05/icmake/usage.c icmake-8.01.00/icmake/usage.c --- icmake-8.00.05/icmake/usage.c 2015-12-17 17:45:56.000000000 +0000 +++ icmake-8.01.00/icmake/usage.c 2016-02-01 14:36:51.000000000 +0000 @@ -6,7 +6,7 @@ printf ( - "%s%s%s%s%s", + "%s%s%s%s%s%s%s%s%s%s%s", "Usage: ", program, @@ -16,16 +16,21 @@ " -a : information about ", program, "\n" - " -b : blunt execution of the destinationfile, which is\n" - " provided as `source'\n" " -c : the destination file is compiled (even if it's " "up-to-date)\n" + " -e : execute the .bim file, which is provided as " + "`source'\n" + " (remaining arguments are passed as-is to the .bim\n" + " file)\n" " -f : the icmake source file is recompiled (even if the\n" " .bim file is up-to-date) either when no other " "options\n" " are specified, or when in combination with options\n" " -i and -t\n" " -F : show filenames, flags, and actions to perform\n" + " -h : provide this help and end ", + program, + "\n" " -i : the first argument is the icmake source file to\n" " process (default extension: .im), the default\n" " .bim-filename is used and the .bim file is kept;\n" @@ -37,13 +42,19 @@ "the\n" " icmake source file to process (using default " "extension\n" - " .im). Remaining arguments are passed to icm-exec\n" + " .im). Remaining arguments are passed as-is to " + "icm-exec\n" " -T : the directory name following -T is used for " "icmake's\n" " temporary files. By default /tmp is used or the " "HOME\n" " directory if /tmp is not writable. When used, -T is\n" " usually specified as icmake's first option\n" + " -v : display ", + program, + "'s version number and end ", + program, + "\n" "\n" " source: icmake source file to process (default extension: .im,\n" " with -b the default extension is .bim)\n" @@ -57,3 +68,6 @@ exit(0); } + + + diff -Nru icmake-8.00.05/icm-comp/parser/data.c icmake-8.01.00/icm-comp/parser/data.c --- icmake-8.00.05/icm-comp/parser/data.c 2015-12-17 17:45:54.000000000 +0000 +++ icmake-8.01.00/icm-comp/parser/data.c 2016-02-01 14:36:51.000000000 +0000 @@ -77,6 +77,11 @@ /* 2c */ "trimright", + "strchr", + "listfind", + "listunion" + + /* 30 */ }; ExprType gp_opType[] = diff -Nru icmake-8.00.05/icm-comp/parser/grammar icmake-8.01.00/icm-comp/parser/grammar --- icmake-8.00.05/icm-comp/parser/grammar 2015-12-17 17:45:55.000000000 +0000 +++ icmake-8.01.00/icm-comp/parser/grammar 2016-02-01 14:36:51.000000000 +0000 @@ -39,7 +39,9 @@ IF INT LIST + LISTFIND LISTLEN + LISTUNION MAKELIST ECHO_TOKEN NUMBER @@ -47,6 +49,7 @@ PUTENV RETURN STAT + STRCHR STRING STRINGTYPE STRLEN @@ -759,21 +762,27 @@ ; _two_arg_funs: - C_EXT /* string, string */ + C_EXT /* string, string */ | C_BASE | C_PATH | - ELEMENT /* int, list | int, string */ + ELEMENT /* int, list | int, string */ | - FGETS /* list fgets(string, int) */ + FGETS /* list fgets(string, int) */ | - FIELDS /* string, string */ + FIELDS /* string, string */ | - STRFIND /* string, string */ + LISTFIND /* list, string */ | - RESIZE /* string, int */ + LISTUNION /* list, list | list, string */ +| + STRCHR /* string, string */ +| + STRFIND /* string, string */ +| + RESIZE /* string, int */ ; _optint_string: diff -Nru icmake-8.00.05/icm-comp/parser/inc/function.5 icmake-8.01.00/icm-comp/parser/inc/function.5 --- icmake-8.00.05/icm-comp/parser/inc/function.5 2015-12-17 17:45:55.000000000 +0000 +++ icmake-8.01.00/icm-comp/parser/inc/function.5 2016-02-01 14:36:51.000000000 +0000 @@ -51,21 +51,27 @@ ; _two_arg_funs: - C_EXT /* string, string */ + C_EXT /* string, string */ | C_BASE | C_PATH | - ELEMENT /* int, list | int, string */ + ELEMENT /* int, list | int, string */ | - FGETS /* list fgets(string, int) */ + FGETS /* list fgets(string, int) */ | - FIELDS /* string, string */ + FIELDS /* string, string */ | - STRFIND /* string, string */ + LISTFIND /* list, string */ | - RESIZE /* string, int */ + LISTUNION /* list, list | list, string */ +| + STRCHR /* string, string */ +| + STRFIND /* string, string */ +| + RESIZE /* string, int */ ; _optint_string: diff -Nru icmake-8.00.05/icm-comp/parser/inc/tokens.2 icmake-8.01.00/icm-comp/parser/inc/tokens.2 --- icmake-8.00.05/icm-comp/parser/inc/tokens.2 2015-12-17 17:45:55.000000000 +0000 +++ icmake-8.01.00/icm-comp/parser/inc/tokens.2 2016-02-01 14:36:51.000000000 +0000 @@ -33,7 +33,9 @@ IF INT LIST + LISTFIND LISTLEN + LISTUNION MAKELIST ECHO_TOKEN NUMBER @@ -41,6 +43,7 @@ PUTENV RETURN STAT + STRCHR STRING STRINGTYPE STRLEN diff -Nru icmake-8.00.05/icm-comp/parser/parse.c icmake-8.01.00/icm-comp/parser/parse.c --- icmake-8.00.05/icm-comp/parser/parse.c 2015-12-17 17:45:55.000000000 +0000 +++ icmake-8.01.00/icm-comp/parser/parse.c 2016-02-01 14:36:51.000000000 +0000 @@ -137,51 +137,54 @@ IF = 289, INT = 290, LIST = 291, - LISTLEN = 292, - MAKELIST = 293, - ECHO_TOKEN = 294, - NUMBER = 295, - PRINTF = 296, - PUTENV = 297, - RETURN = 298, - STAT = 299, - STRING = 300, - STRINGTYPE = 301, - STRLEN = 302, - STRLWR = 303, - RESIZE = 304, - STRUPR = 305, - STRFIND = 306, - STRFORMAT = 307, - SUBSTR = 308, - SYSTEM = 309, - TRIM = 310, - TRIMLEFT = 311, - TRIMRIGHT = 312, - VOID = 313, - WHILE = 314, - AND_IS = 315, - OR_IS = 316, - XOR_IS = 317, - SHL_IS = 318, - SHR_IS = 319, - DIV_IS = 320, - MINUS_IS = 321, - MUL_IS = 322, - MOD_IS = 323, - PLUS_IS = 324, - OR = 325, - AND = 326, - EQUAL = 327, - NOT_EQUAL = 328, - SMALLER_EQUAL = 329, - GREATER_EQUAL = 330, - OLDER = 331, - YOUNGER = 332, - SHL = 333, - SHR = 334, - INC = 335, - DEC = 336 + LISTFIND = 292, + LISTLEN = 293, + LISTUNION = 294, + MAKELIST = 295, + ECHO_TOKEN = 296, + NUMBER = 297, + PRINTF = 298, + PUTENV = 299, + RETURN = 300, + STAT = 301, + STRCHR = 302, + STRING = 303, + STRINGTYPE = 304, + STRLEN = 305, + STRLWR = 306, + RESIZE = 307, + STRUPR = 308, + STRFIND = 309, + STRFORMAT = 310, + SUBSTR = 311, + SYSTEM = 312, + TRIM = 313, + TRIMLEFT = 314, + TRIMRIGHT = 315, + VOID = 316, + WHILE = 317, + AND_IS = 318, + OR_IS = 319, + XOR_IS = 320, + SHL_IS = 321, + SHR_IS = 322, + DIV_IS = 323, + MINUS_IS = 324, + MUL_IS = 325, + MOD_IS = 326, + PLUS_IS = 327, + OR = 328, + AND = 329, + EQUAL = 330, + NOT_EQUAL = 331, + SMALLER_EQUAL = 332, + GREATER_EQUAL = 333, + OLDER = 334, + YOUNGER = 335, + SHL = 336, + SHR = 337, + INC = 338, + DEC = 339 }; #endif @@ -201,7 +204,7 @@ /* Copy the second part of user declarations. */ -#line 205 "parse.c" /* yacc.c:358 */ +#line 208 "parse.c" /* yacc.c:358 */ #ifdef short # undef short @@ -443,21 +446,21 @@ /* YYFINAL -- State number of the termination state. */ #define YYFINAL 11 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 905 +#define YYLAST 891 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 106 +#define YYNTOKENS 109 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 84 /* YYNRULES -- Number of rules. */ -#define YYNRULES 215 +#define YYNRULES 218 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 358 +#define YYNSTATES 361 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 336 +#define YYMAXUTOK 339 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -469,16 +472,16 @@ 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 93, 2, 2, 2, 92, 77, 2, - 103, 99, 90, 88, 100, 89, 2, 91, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 72, 104, - 80, 60, 81, 71, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 96, 2, 2, 2, 95, 80, 2, + 106, 102, 93, 91, 103, 92, 2, 94, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 75, 107, + 83, 63, 84, 74, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 97, 2, 102, 76, 2, 101, 2, 2, 2, + 2, 100, 2, 105, 79, 2, 104, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 105, 75, 98, 96, 2, 2, 2, + 2, 2, 2, 108, 78, 101, 99, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -497,37 +500,37 @@ 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, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 73, 74, 78, 79, 82, - 83, 84, 85, 86, 87, 94, 95 + 55, 56, 57, 58, 59, 60, 61, 62, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 76, 77, + 81, 82, 85, 86, 87, 88, 89, 90, 97, 98 }; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 114, 114, 117, 121, 128, 134, 139, 145, 145, - 152, 152, 158, 158, 164, 172, 174, 177, 183, 190, - 196, 199, 204, 211, 218, 218, 227, 233, 235, 237, - 241, 247, 255, 258, 265, 265, 272, 279, 287, 294, - 301, 308, 315, 322, 329, 336, 343, 350, 357, 364, - 371, 378, 385, 394, 401, 408, 415, 422, 429, 436, - 443, 450, 457, 464, 471, 478, 485, 492, 499, 506, - 512, 518, 524, 530, 536, 542, 548, 554, 562, 567, - 572, 579, 581, 589, 597, 604, 608, 610, 612, 617, - 619, 626, 628, 632, 664, 669, 673, 677, 678, 683, - 693, 701, 710, 712, 714, 718, 720, 722, 724, 726, - 728, 730, 732, 734, 736, 738, 740, 742, 744, 746, - 748, 750, 752, 754, 756, 758, 762, 764, 766, 768, - 770, 772, 774, 776, 780, 782, 784, 788, 794, 798, - 800, 804, 810, 814, 816, 820, 827, 833, 840, 849, - 860, 868, 876, 883, 890, 897, 904, 907, 915, 921, - 925, 947, 956, 963, 965, 969, 969, 979, 994, 1009, - 1031, 1055, 1061, 1067, 1067, 1077, 1077, 1083, 1088, 1093, - 1095, 1099, 1104, 1108, 1118, 1118, 1124, 1126, 1132, 1135, - 1137, 1139, 1141, 1144, 1147, 1150, 1155, 1157, 1161, 1167, - 1175, 1182, 1190, 1192, 1194, 1198, 1205, 1211, 1219, 1222, - 1231, 1239, 1241, 1250, 1255, 1267 + 0, 117, 117, 120, 124, 131, 137, 142, 148, 148, + 155, 155, 161, 161, 167, 175, 177, 180, 186, 193, + 199, 202, 207, 214, 221, 221, 230, 236, 238, 240, + 244, 250, 258, 261, 268, 268, 275, 282, 290, 297, + 304, 311, 318, 325, 332, 339, 346, 353, 360, 367, + 374, 381, 388, 397, 404, 411, 418, 425, 432, 439, + 446, 453, 460, 467, 474, 481, 488, 495, 502, 509, + 515, 521, 527, 533, 539, 545, 551, 557, 565, 570, + 575, 582, 584, 592, 600, 607, 611, 613, 615, 620, + 622, 629, 631, 635, 667, 672, 676, 680, 681, 686, + 696, 704, 713, 715, 717, 721, 723, 725, 727, 729, + 731, 733, 735, 737, 739, 741, 743, 745, 747, 749, + 751, 753, 755, 757, 759, 761, 765, 767, 769, 771, + 773, 775, 777, 779, 781, 783, 785, 789, 791, 793, + 797, 803, 807, 809, 813, 819, 823, 825, 829, 836, + 842, 849, 858, 869, 877, 885, 892, 899, 906, 913, + 916, 924, 930, 934, 956, 965, 972, 974, 978, 978, + 988, 1003, 1018, 1040, 1064, 1070, 1076, 1076, 1086, 1086, + 1092, 1097, 1102, 1104, 1108, 1113, 1117, 1127, 1127, 1133, + 1135, 1141, 1144, 1146, 1148, 1150, 1153, 1156, 1159, 1164, + 1166, 1170, 1176, 1184, 1191, 1199, 1201, 1203, 1207, 1214, + 1220, 1228, 1231, 1240, 1248, 1250, 1259, 1264, 1276 }; #endif @@ -541,28 +544,29 @@ "G_BASE", "G_EXT", "G_DEXT", "G_PATH", "ELEMENT", "ELSE", "EVAL", "EXEC", "EXECUTE", "EXISTS", "EXIT", "FGETS", "FIELDS", "FOR", "FPRINTF", "GETENV", "GETCH", "GETPID", "GETS", "IDENTIFIER", "IF", "INT", "LIST", - "LISTLEN", "MAKELIST", "ECHO_TOKEN", "NUMBER", "PRINTF", "PUTENV", - "RETURN", "STAT", "STRING", "STRINGTYPE", "STRLEN", "STRLWR", "RESIZE", - "STRUPR", "STRFIND", "STRFORMAT", "SUBSTR", "SYSTEM", "TRIM", "TRIMLEFT", - "TRIMRIGHT", "VOID", "WHILE", "'='", "AND_IS", "OR_IS", "XOR_IS", - "SHL_IS", "SHR_IS", "DIV_IS", "MINUS_IS", "MUL_IS", "MOD_IS", "PLUS_IS", - "'?'", "':'", "OR", "AND", "'|'", "'^'", "'&'", "EQUAL", "NOT_EQUAL", - "'<'", "'>'", "SMALLER_EQUAL", "GREATER_EQUAL", "OLDER", "YOUNGER", - "SHL", "SHR", "'+'", "'-'", "'*'", "'/'", "'%'", "'!'", "INC", "DEC", - "'~'", "'['", "'}'", "')'", "','", "'`'", "']'", "'('", "';'", "'{'", - "$accept", "input", "args", "break_ok", "break_stat", "closebrace", - "$@1", "closepar", "$@2", "comma", "$@3", "compound", "condition", - "continue_stat", "_voidtype", "def_var_or_fun", "enterid", "enter_varid", - "err_expression", "$@4", "expr_code", "_p_casttype", "_string", - "_func_or_var", "_backtick", "$@5", "expression", "_for", "_expr_list", - "_opt_init_expression", "_opt_cond_expression", "_opt_inc_expression", - "for_stat", "_partype", "_pars", "_opt_parlist", "_funvars", "_funid", - "funcdef", "_zero_arg_funs", "_one_arg_funs", "_two_arg_funs", - "_optint_string", "_comma_expr", "_optint_special", "_comma_arglist", - "_opt_arglist", "_funname", "function", "_if", "_else", "if_stat", - "_p_makeList_expr", "_p_makeList_normal", "_old_young", "_older_younger", - "$@6", "p_makeList", "nesting", "ok", "openbrace", "$@7", "openpar", - "$@8", "popdead", "pushdead", "_return_tail", "_leave", "return_stat", + "LISTFIND", "LISTLEN", "LISTUNION", "MAKELIST", "ECHO_TOKEN", "NUMBER", + "PRINTF", "PUTENV", "RETURN", "STAT", "STRCHR", "STRING", "STRINGTYPE", + "STRLEN", "STRLWR", "RESIZE", "STRUPR", "STRFIND", "STRFORMAT", "SUBSTR", + "SYSTEM", "TRIM", "TRIMLEFT", "TRIMRIGHT", "VOID", "WHILE", "'='", + "AND_IS", "OR_IS", "XOR_IS", "SHL_IS", "SHR_IS", "DIV_IS", "MINUS_IS", + "MUL_IS", "MOD_IS", "PLUS_IS", "'?'", "':'", "OR", "AND", "'|'", "'^'", + "'&'", "EQUAL", "NOT_EQUAL", "'<'", "'>'", "SMALLER_EQUAL", + "GREATER_EQUAL", "OLDER", "YOUNGER", "SHL", "SHR", "'+'", "'-'", "'*'", + "'/'", "'%'", "'!'", "INC", "DEC", "'~'", "'['", "'}'", "')'", "','", + "'`'", "']'", "'('", "';'", "'{'", "$accept", "input", "args", + "break_ok", "break_stat", "closebrace", "$@1", "closepar", "$@2", + "comma", "$@3", "compound", "condition", "continue_stat", "_voidtype", + "def_var_or_fun", "enterid", "enter_varid", "err_expression", "$@4", + "expr_code", "_p_casttype", "_string", "_func_or_var", "_backtick", + "$@5", "expression", "_for", "_expr_list", "_opt_init_expression", + "_opt_cond_expression", "_opt_inc_expression", "for_stat", "_partype", + "_pars", "_opt_parlist", "_funvars", "_funid", "funcdef", + "_zero_arg_funs", "_one_arg_funs", "_two_arg_funs", "_optint_string", + "_comma_expr", "_optint_special", "_comma_arglist", "_opt_arglist", + "_funname", "function", "_if", "_else", "if_stat", "_p_makeList_expr", + "_p_makeList_normal", "_old_young", "_older_younger", "$@6", + "p_makeList", "nesting", "ok", "openbrace", "$@7", "openpar", "$@8", + "popdead", "pushdead", "_return_tail", "_leave", "return_stat", "semicol", "$@9", "_stm", "statement", "statements", "typed_condition", "typed_varlist", "_varType", "type_of_var", "var_condition", "var_expr", "var_expr_list", "_while", "while_stat", "zeroframe", YY_NULLPTR @@ -580,11 +584,11 @@ 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 61, 315, 316, 317, 318, 319, 320, 321, 322, 323, - 324, 63, 58, 325, 326, 124, 94, 38, 327, 328, - 60, 62, 329, 330, 331, 332, 333, 334, 43, 45, - 42, 47, 37, 33, 335, 336, 126, 91, 125, 41, - 44, 96, 93, 40, 59, 123 + 315, 316, 317, 61, 318, 319, 320, 321, 322, 323, + 324, 325, 326, 327, 63, 58, 328, 329, 124, 94, + 38, 330, 331, 60, 62, 332, 333, 334, 335, 336, + 337, 43, 45, 42, 47, 37, 33, 338, 339, 126, + 91, 125, 41, 44, 96, 93, 40, 59, 123 }; # endif @@ -593,7 +597,7 @@ #define yypact_value_is_default(Yystate) \ (!!((Yystate) == (-317))) -#define YYTABLE_NINF -216 +#define YYTABLE_NINF -219 #define yytable_value_is_error(Yytable_value) \ 0 @@ -602,42 +606,43 @@ STATE-NUM. */ static const yytype_int16 yypact[] = { - 31, -317, -317, -317, -317, 27, -29, -317, -317, -317, - 17, -317, -317, -317, -317, -317, -317, -97, -67, -42, - 4, 11, -317, -317, -28, -317, 34, -25, -317, -317, - -317, -317, 663, 48, -13, 354, -317, -317, -11, -6, - 48, -317, -317, -317, -317, -317, -317, -317, -317, -317, + 48, -317, -317, -317, -317, 31, -26, -317, -317, -317, + 24, -317, -317, -317, -317, -317, -317, -88, -86, -77, + 2, 13, -317, -317, -39, -317, 26, -28, -317, -317, + -317, -317, 646, 46, -22, 328, -317, -317, -17, -9, + 46, -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, - -317, -317, -317, -317, -317, -317, -317, -317, -5, -317, + -317, -317, -317, -317, -317, -317, -317, -317, -10, -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, - -317, -317, -317, -317, -317, -317, -317, -317, 663, 663, - 663, 663, 663, 663, 663, 562, 62, -317, 788, -317, - -317, -317, -317, -317, -317, -317, 13, -317, -317, -317, - -317, -67, -317, -317, -317, -317, -317, -317, -317, -317, - -317, -317, 12, -317, -317, -317, 663, -317, -317, -317, - -317, -317, -317, 8, 49, -317, -317, -317, -317, 20, - -317, -317, 34, -317, -317, -317, -317, -317, -317, -317, - -61, -61, -61, -61, -61, -61, 788, -317, -317, -317, - 16, 788, -317, 663, 663, 663, 663, 663, 663, 663, - 663, 663, 663, 663, 663, 663, 663, 663, 663, 663, - 663, 663, 663, 663, 663, 663, 663, 663, 663, 663, - 663, 663, 663, 663, 663, -317, -317, 663, -317, -317, - -317, -317, -317, 55, -317, 56, -33, -317, -317, -317, - -317, -317, -317, -317, -317, -317, -317, 788, -317, -22, - 34, 354, -317, -317, -317, -317, -317, -317, 34, -317, - -317, 58, -317, -317, 59, 60, -317, -317, 61, 663, - -317, 788, 788, 788, 788, 788, 788, 788, 788, 788, - 788, 788, 750, 340, 444, 544, 644, 808, 254, 254, - 14, 14, 14, 14, 14, 14, 90, 90, 0, 0, - -61, -61, -61, 707, -317, -317, 68, 69, 71, -317, - -317, -317, 72, -317, -10, -317, 74, -317, -317, -317, - -317, -317, -317, 48, -317, -317, -317, -317, -317, -61, - 663, -317, -317, -317, -317, -317, -317, -317, -317, -317, - -317, -317, -317, -317, -317, 57, 459, -317, 100, -317, - -317, -317, -317, 190, -317, -317, 77, -317, -317, -317, - -317, -317, -317, 663, 459, -317, -317, -317, 55, -317, - 788, -317, -317, -317, 74, -317, -317, 158, -317, -317, - 459, -317, -317, 459, -317, -317, -317, -317 + -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, + -317, 646, 646, 646, 646, 646, 646, 646, 542, 51, + -317, 771, -317, -317, -317, -317, -317, -317, -317, -1, + -317, -317, -317, -317, -86, -317, -317, -317, -317, -317, + -317, -317, -317, -317, -317, 4, -317, -317, -317, 646, + -317, -317, -317, -317, -317, -317, -5, -3, -317, -317, + -317, -317, 25, -317, -317, 26, -317, -317, -317, -317, + -317, -317, -317, -80, -80, -80, -80, -80, -80, 771, + -317, -317, -317, 11, 771, -317, 646, 646, 646, 646, + 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, + 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, + 646, 646, 646, 646, 646, 646, 646, 646, -317, -317, + 646, -317, -317, -317, -317, -317, 16, -317, 53, -32, + -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, + 771, -317, 5, 26, 328, -317, -317, -317, -317, -317, + -317, 26, -317, -317, 54, -317, -317, 56, 57, -317, + -317, 58, 646, -317, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 733, 314, 421, 524, 627, + 791, 225, 225, 75, 75, 75, 75, 75, 75, 117, + 117, 133, 133, -80, -80, -80, 690, -317, -317, 12, + 68, 59, -317, -317, -317, 72, -317, -24, -317, 74, + -317, -317, -317, -317, -317, -317, 46, -317, -317, -317, + -317, -317, -80, 646, -317, -317, -317, -317, -317, -317, + -317, -317, -317, -317, -317, -317, -317, -317, 0, 436, + -317, 43, -317, -317, -317, -317, 190, -317, -317, 77, + -317, -317, -317, -317, -317, -317, 646, 436, -317, -317, + -317, 16, -317, 771, -317, -317, -317, 74, -317, -317, + 141, -317, -317, 436, -317, -317, 436, -317, -317, -317, + -317 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -645,70 +650,71 @@ means the default is an error. */ static const yytype_uint8 yydefact[] = { - 0, 202, 204, 203, 18, 0, 0, 3, 184, 205, - 0, 1, 2, 100, 175, 21, 19, 0, 0, 22, - 215, 0, 20, 211, 12, 215, 98, 0, 185, 172, - 215, 208, 0, 0, 0, 0, 199, 96, 12, 0, - 0, 176, 212, 112, 113, 105, 135, 111, 110, 127, - 126, 128, 114, 116, 117, 115, 129, 106, 139, 140, - 107, 130, 131, 175, 119, 102, 103, 104, 33, 108, - 175, 109, 79, 175, 118, 134, 31, 120, 122, 133, - 121, 132, 175, 175, 136, 123, 124, 125, 0, 0, - 0, 0, 0, 0, 0, 0, 78, 81, 209, 175, - 175, 175, 175, 175, 175, 10, 12, 156, 22, 210, - 13, 0, 7, 17, 182, 178, 178, 181, 178, 215, - 184, 101, 0, 186, 184, 26, 0, 184, 175, 191, - 175, 190, 215, 0, 24, 184, 196, 198, 184, 0, - 175, 189, 0, 173, 94, 24, 24, 24, 24, 24, - 74, 69, 76, 70, 72, 75, 34, 27, 28, 29, - 0, 10, 30, 0, 0, 0, 0, 0, 0, 0, + 0, 205, 207, 206, 18, 0, 0, 3, 187, 208, + 0, 1, 2, 100, 178, 21, 19, 0, 0, 22, + 218, 0, 20, 214, 12, 218, 98, 0, 188, 175, + 218, 211, 0, 0, 0, 0, 202, 96, 12, 0, + 0, 179, 215, 112, 113, 105, 138, 111, 110, 127, + 126, 128, 114, 116, 117, 115, 129, 106, 142, 143, + 107, 130, 131, 178, 119, 102, 103, 104, 33, 132, + 108, 133, 178, 109, 79, 178, 118, 137, 134, 31, + 120, 122, 136, 121, 135, 178, 178, 139, 123, 124, + 125, 0, 0, 0, 0, 0, 0, 0, 0, 78, + 81, 212, 178, 178, 178, 178, 178, 178, 10, 12, + 159, 22, 213, 13, 0, 7, 17, 185, 181, 181, + 184, 181, 218, 187, 101, 0, 189, 187, 26, 0, + 187, 178, 194, 178, 193, 218, 0, 24, 187, 199, + 201, 187, 0, 178, 192, 0, 176, 94, 24, 24, + 24, 24, 24, 74, 69, 76, 70, 72, 75, 34, + 27, 28, 29, 0, 10, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 71, 73, 0, 146, 24, - 24, 24, 24, 24, 32, 0, 24, 167, 195, 83, - 171, 157, 213, 187, 193, 9, 194, 25, 188, 24, - 24, 0, 174, 179, 183, 180, 192, 197, 24, 95, - 99, 12, 5, 161, 12, 12, 12, 82, 0, 0, - 80, 36, 43, 44, 45, 46, 47, 39, 42, 38, - 40, 41, 0, 48, 49, 59, 60, 58, 50, 51, - 53, 54, 55, 56, 66, 65, 61, 62, 57, 63, - 64, 67, 68, 0, 147, 12, 215, 215, 12, 155, - 144, 11, 12, 12, 0, 85, 86, 184, 87, 88, - 10, 15, 16, 0, 14, 10, 24, 24, 35, 77, - 0, 37, 24, 24, 150, 138, 24, 151, 142, 165, - 24, 163, 164, 166, 24, 24, 0, 23, 206, 200, - 6, 4, 12, 52, 148, 137, 12, 12, 162, 84, - 89, 184, 177, 0, 0, 24, 24, 169, 24, 178, - 207, 177, 149, 170, 91, 10, 92, 215, 214, 6, - 0, 177, 159, 0, 158, 160, 177, 93 + 0, 0, 0, 0, 0, 0, 0, 0, 71, 73, + 0, 149, 24, 24, 24, 24, 24, 32, 0, 24, + 170, 198, 83, 174, 160, 216, 190, 196, 9, 197, + 25, 191, 24, 24, 0, 177, 182, 186, 183, 195, + 200, 24, 95, 99, 12, 5, 164, 12, 12, 12, + 82, 0, 0, 80, 36, 43, 44, 45, 46, 47, + 39, 42, 38, 40, 41, 0, 48, 49, 59, 60, + 58, 50, 51, 53, 54, 55, 56, 66, 65, 61, + 62, 57, 63, 64, 67, 68, 0, 150, 12, 218, + 218, 12, 158, 147, 11, 12, 12, 0, 85, 86, + 187, 87, 88, 10, 15, 16, 0, 14, 10, 24, + 24, 35, 77, 0, 37, 24, 24, 153, 141, 24, + 154, 145, 168, 24, 166, 167, 169, 24, 24, 0, + 23, 209, 203, 6, 4, 12, 52, 151, 140, 12, + 12, 165, 84, 89, 187, 180, 0, 0, 24, 24, + 172, 24, 181, 210, 180, 152, 173, 91, 10, 92, + 218, 217, 6, 0, 180, 162, 0, 161, 163, 180, + 93 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -317, -317, -131, -163, -317, -32, -317, -139, -317, -23, - -317, -317, -40, -317, -317, 185, -38, -102, 18, -317, - -165, -317, -317, -317, -317, -317, -47, -317, -145, -317, - -317, -317, -317, 52, -317, -317, -317, -317, 186, -317, + -317, -317, -146, -172, -317, -43, -317, -141, -317, -23, + -317, -317, -49, -317, -317, 178, -38, -109, -115, -317, + -163, -317, -317, -317, -317, -317, -47, -317, -153, -317, + -317, -317, -317, 44, -317, -317, -317, -317, 182, -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, -317, - -317, -317, -317, -133, -317, -112, -317, -317, -88, 87, - 64, -317, -44, -317, -316, -138, -317, -317, -317, -115, - -317, -317, -285, 70, -317, 3, -317, 6, -317, 167, + -317, -317, -317, -138, -317, -116, -317, -317, -107, 83, + 55, -317, -33, -317, -316, -143, -317, -317, -317, -114, + -317, -317, -242, 65, -317, 3, -317, 6, -317, 171, -317, -317, -317, -20 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 5, 231, 334, 120, 121, 122, 204, 205, 296, - 34, 123, 290, 124, 6, 7, 20, 21, 125, 126, - 127, 160, 96, 97, 237, 238, 98, 128, 286, 287, - 331, 345, 129, 37, 38, 39, 25, 14, 15, 99, - 100, 101, 102, 304, 103, 307, 279, 104, 105, 130, - 351, 131, 106, 207, 313, 283, 284, 107, 209, 30, - 132, 133, 26, 27, 339, 210, 224, 134, 135, 16, - 17, 136, 137, 35, 292, 138, 9, 139, 319, 23, - 24, 140, 141, 36 + -1, 5, 234, 337, 123, 124, 125, 207, 208, 299, + 34, 126, 293, 127, 6, 7, 20, 21, 128, 129, + 130, 163, 99, 100, 240, 241, 101, 131, 289, 290, + 334, 348, 132, 37, 38, 39, 25, 14, 15, 102, + 103, 104, 105, 307, 106, 310, 282, 107, 108, 133, + 354, 134, 109, 210, 316, 286, 287, 110, 212, 30, + 135, 136, 26, 27, 342, 213, 227, 137, 138, 16, + 17, 139, 140, 35, 295, 141, 9, 142, 322, 23, + 24, 143, 144, 36 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -716,261 +722,260 @@ number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 31, 33, 144, 8, 13, 214, 10, 28, 8, 216, - 42, 10, 218, 1, 2, 142, 234, 235, 18, 145, - 226, 18, 240, 227, 3, 348, 146, 11, 211, 147, - 212, 332, 40, 195, 196, 355, 197, 29, 148, 149, - 357, 150, 151, 152, 153, 154, 155, 156, 161, 341, - 19, -165, -165, 108, 285, 198, 199, 200, 201, 202, - 203, -100, 1, 2, -23, 354, 1, 2, 356, 1, - 2, 32, 278, 3, 311, 312, -201, 3, 41, 217, - 3, 108, -215, 206, 219, 4, 220, 110, -97, 4, - 192, 193, 194, 143, 195, 196, 228, 197, -145, 213, - 188, 189, 190, 191, 192, 193, 194, 162, 195, 196, - 215, 197, -162, 222, 225, 239, 241, 242, 243, 244, + 31, 33, 147, 8, 237, 238, 10, 13, 8, 217, + 42, 10, 214, 219, 215, 145, 221, 198, 199, 28, + 200, 29, 226, 243, 229, 18, 18, 230, 351, -100, + 148, 11, 40, 235, 236, 235, 235, 239, 358, 149, + 1, 2, 150, 360, 153, 154, 155, 156, 157, 158, + 159, 164, 151, 152, 3, -168, -168, 19, 111, 288, + 281, 1, 2, 314, 315, -23, 1, 2, -204, 201, + 202, 203, 204, 205, 206, 3, 32, 335, 41, 111, + 3, 113, 220, 1, 2, -97, 209, 277, 278, 279, + 280, 235, 4, 146, 285, 344, -148, 3, 222, 165, + 223, -165, 216, 225, -218, 218, 336, -90, 294, 4, + 231, 357, -218, 242, 359, 306, 294, 228, -218, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 40, 329, - 273, 316, 223, -215, -215, 281, 320, -153, -152, -154, - 333, -90, 298, 232, 233, 232, 232, 236, 303, 306, - -143, -168, 315, 285, 314, 326, -141, 350, 190, 191, - 192, 193, 194, 280, 195, 196, 353, 197, 295, 294, - 12, 318, 299, 344, 229, 337, 22, 327, 208, 289, - 109, 347, 221, 0, 0, 0, 349, 230, 0, 0, - 0, 0, 0, 297, 0, 0, 338, 274, 275, 276, - 277, 232, 288, 0, 282, 0, 293, 0, 0, 0, - 0, 0, 0, 0, 293, 0, 0, 0, 291, 0, - 0, 0, 0, 0, 0, 0, 291, 0, 0, 0, - 0, 0, 302, 323, 0, 317, 305, 308, 0, 309, - 310, 174, 0, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 0, 195, 196, 340, 197, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 335, - 0, 0, 0, 0, 336, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 321, 322, 0, 0, 346, 0, - 324, 325, 0, 0, 232, 0, 0, 352, 328, 0, - 0, 0, 0, 330, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 0, 195, 196, - 0, 197, 0, 342, 343, 111, 0, -24, -24, -24, - 112, -24, -24, -24, 113, -24, -24, -24, -24, -24, - -24, -24, -24, 0, -24, -24, -24, -24, 114, -24, - -24, 115, -24, -24, -24, -24, -24, -24, 116, 1, - 2, -24, -24, -24, -24, -24, -24, 117, -24, -24, - 3, -24, -24, -24, -24, -24, -24, -24, -24, -24, - -24, -24, 0, 118, 176, 177, 178, 179, 180, 181, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 40, 319, 276, 332, 284, -156, 323, -155, -157, + 353, -146, 301, 329, 191, 192, 193, 194, 195, 196, + 197, 309, 198, 199, -171, 200, 318, 317, 288, -144, + 356, 297, 298, 12, 324, 325, 283, 321, 347, 232, + 327, 328, 22, 340, 235, 302, 330, 211, 331, 350, + 224, 233, 292, 333, 112, 0, 0, 352, 193, 194, + 195, 196, 197, 0, 198, 199, 300, 200, 0, 0, + 341, 0, 0, 345, 346, 291, 195, 196, 197, 296, + 198, 199, 0, 200, 0, 0, 0, 296, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 305, 326, 0, 320, 308, + 311, 0, 312, 313, 177, 0, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 0, 195, 196, 0, 197, 0, 0, - 0, 0, -24, -24, 0, 0, 0, -24, -24, -24, - -24, 0, -8, 0, 0, -24, 0, -24, 119, -173, - 111, 0, -24, -24, -24, 112, -24, -24, -24, 113, - -24, -24, -24, -24, -24, -24, -24, -24, 0, -24, - -24, -24, -24, 114, -24, -24, 115, -24, -24, -24, - -24, -24, -24, 116, 1, 2, -24, -24, -24, -24, - -24, -24, 117, -24, -24, 3, -24, -24, -24, -24, - -24, -24, -24, -24, -24, -24, -24, 0, 118, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 0, 195, 196, - 0, 197, 0, 0, 0, 0, 0, -24, -24, 0, + 192, 193, 194, 195, 196, 197, 0, 198, 199, 343, + 200, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 338, 0, 0, 0, 0, 339, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 349, 198, 199, 0, 200, 0, 0, 0, 114, + 355, -24, -24, -24, 115, -24, -24, -24, 116, -24, + -24, -24, -24, -24, -24, -24, -24, 0, -24, -24, + -24, -24, 117, -24, -24, 118, -24, -24, -24, -24, + -24, -24, 119, 1, 2, -24, -24, -24, -24, -24, + -24, -24, -24, 120, -24, -24, -24, 3, -24, -24, + -24, -24, -24, -24, -24, -24, -24, -24, -24, 0, + 121, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 0, 198, 199, 0, 200, 0, 0, 0, 0, -24, + -24, 0, 0, 0, -24, -24, -24, -24, 0, -8, + 0, 0, -24, 0, -24, 122, -176, 114, 0, -24, + -24, -24, 115, -24, -24, -24, 116, -24, -24, -24, + -24, -24, -24, -24, -24, 0, -24, -24, -24, -24, + 117, -24, -24, 118, -24, -24, -24, -24, -24, -24, + 119, 1, 2, -24, -24, -24, -24, -24, -24, -24, + -24, 120, -24, -24, -24, 3, -24, -24, -24, -24, + -24, -24, -24, -24, -24, -24, -24, 0, 121, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 0, 198, 199, + 0, 200, 0, 0, 0, 0, 0, -24, -24, 0, 0, 0, -24, -24, -24, -24, 0, 0, 0, 0, - -24, 0, -24, 119, -173, 43, 44, 45, 0, 46, + -24, 0, -24, 122, -176, 43, 44, 45, 0, 46, 47, 48, 0, 49, 50, 51, 52, 53, 54, 55, 56, 0, 57, 58, 59, 60, 0, 61, 62, 0, - 63, 64, 65, 66, 67, 68, 0, 157, 158, 69, - 70, 71, 72, 73, 74, 0, 75, 76, 159, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 0, 195, 196, - 0, 197, 0, 0, 0, 0, 0, 0, 0, 0, - 88, 89, 0, 0, 0, 90, 91, 92, 93, 0, - 0, 0, 0, 94, 0, 95, 43, 44, 45, 0, - 46, 47, 48, 0, 49, 50, 51, 52, 53, 54, - 55, 56, 0, 57, 58, 59, 60, 0, 61, 62, - 0, 63, 64, 65, 66, 67, 68, 0, 0, 0, - 69, 70, 71, 72, 73, 74, 0, 75, 76, 0, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 0, 195, 196, - 0, 197, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 88, 89, 0, 0, 0, 90, 91, 92, 93, - 0, 0, 0, 0, 94, 0, 95, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 0, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 63, 64, 65, 66, 67, 68, 0, 160, 161, 69, + 70, 71, 72, 73, 74, 75, 76, 0, 77, 78, + 79, 162, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 0, 198, 199, 0, 200, 0, 0, 0, 0, 0, + 0, 0, 0, 91, 92, 0, 0, 0, 93, 94, + 95, 96, 0, 0, 0, 0, 97, 0, 98, 43, + 44, 45, 0, 46, 47, 48, 0, 49, 50, 51, + 52, 53, 54, 55, 56, 0, 57, 58, 59, 60, + 0, 61, 62, 0, 63, 64, 65, 66, 67, 68, + 0, 0, 0, 69, 70, 71, 72, 73, 74, 75, + 76, 0, 77, 78, 79, 0, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 0, 195, 196, 0, 197, 0, 0, 0, 0, 301, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 300, 175, 176, 177, 178, 179, 180, 181, + 195, 196, 197, 0, 198, 199, 0, 200, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 91, 92, 0, + 0, 0, 93, 94, 95, 96, 0, 0, 0, 0, + 97, 0, 98, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 0, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 0, 195, 196, 0, 197, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 0, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 0, 195, 196, 0, 197, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 0, 195, 196, 0, 197 + 192, 193, 194, 195, 196, 197, 0, 198, 199, 0, + 200, 0, 0, 0, 0, 304, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 303, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 0, + 198, 199, 0, 200, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 0, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 0, 198, 199, + 0, 200, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 0, 198, 199, + 0, 200 }; static const yytype_int16 yycheck[] = { - 20, 24, 40, 0, 33, 120, 0, 104, 5, 124, - 30, 5, 127, 35, 36, 38, 147, 148, 1, 63, - 135, 1, 161, 138, 46, 341, 70, 0, 116, 73, - 118, 316, 26, 94, 95, 351, 97, 104, 82, 83, - 356, 88, 89, 90, 91, 92, 93, 94, 95, 334, - 33, 84, 85, 33, 219, 99, 100, 101, 102, 103, - 104, 103, 35, 36, 60, 350, 35, 36, 353, 35, - 36, 60, 203, 46, 84, 85, 104, 46, 103, 126, - 46, 33, 104, 106, 128, 58, 130, 100, 99, 58, - 90, 91, 92, 99, 94, 95, 140, 97, 103, 119, - 86, 87, 88, 89, 90, 91, 92, 45, 94, 95, - 98, 97, 99, 105, 134, 99, 163, 164, 165, 166, + 20, 24, 40, 0, 150, 151, 0, 33, 5, 123, + 30, 5, 119, 127, 121, 38, 130, 97, 98, 107, + 100, 107, 137, 164, 138, 1, 1, 141, 344, 106, + 63, 0, 26, 148, 149, 150, 151, 152, 354, 72, + 35, 36, 75, 359, 91, 92, 93, 94, 95, 96, + 97, 98, 85, 86, 49, 87, 88, 33, 33, 222, + 206, 35, 36, 87, 88, 63, 35, 36, 107, 102, + 103, 104, 105, 106, 107, 49, 63, 319, 106, 33, + 49, 103, 129, 35, 36, 102, 109, 202, 203, 204, + 205, 206, 61, 102, 209, 337, 106, 49, 131, 48, + 133, 102, 122, 108, 107, 101, 63, 107, 223, 61, + 143, 353, 107, 102, 356, 103, 231, 137, 102, 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, 142, 314, - 197, 290, 134, 104, 99, 99, 295, 99, 99, 99, - 60, 104, 101, 145, 146, 147, 148, 149, 100, 100, - 99, 99, 287, 338, 100, 306, 99, 19, 88, 89, - 90, 91, 92, 203, 94, 95, 349, 97, 228, 221, - 5, 293, 239, 338, 142, 328, 10, 309, 111, 219, - 33, 339, 132, -1, -1, -1, 345, 143, -1, -1, - -1, -1, -1, 236, -1, -1, 331, 199, 200, 201, - 202, 203, 219, -1, 206, -1, 220, -1, -1, -1, - -1, -1, -1, -1, 228, -1, -1, -1, 220, -1, - -1, -1, -1, -1, -1, -1, 228, -1, -1, -1, - -1, -1, 275, 300, -1, 293, 276, 277, -1, 282, - 283, 71, -1, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, -1, 94, 95, 333, 97, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 322, - -1, -1, -1, -1, 327, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 296, 297, -1, -1, 338, -1, - 302, 303, -1, -1, 306, -1, -1, 347, 310, -1, - -1, -1, -1, 315, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, -1, 94, 95, - -1, 97, -1, 335, 336, 1, -1, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, -1, 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, -1, 59, 74, 75, 76, 77, 78, 79, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 145, 293, 200, 317, 102, 102, 298, 102, 102, + 19, 102, 104, 309, 89, 90, 91, 92, 93, 94, + 95, 103, 97, 98, 102, 100, 290, 103, 341, 102, + 352, 224, 231, 5, 299, 300, 206, 296, 341, 145, + 305, 306, 10, 331, 309, 242, 312, 114, 313, 342, + 135, 146, 222, 318, 33, -1, -1, 348, 91, 92, + 93, 94, 95, -1, 97, 98, 239, 100, -1, -1, + 334, -1, -1, 338, 339, 222, 93, 94, 95, 223, + 97, 98, -1, 100, -1, -1, -1, 231, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 278, 303, -1, 296, 279, + 280, -1, 285, 286, 74, -1, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, -1, 94, 95, -1, 97, -1, -1, - -1, -1, 88, 89, -1, -1, -1, 93, 94, 95, - 96, -1, 98, -1, -1, 101, -1, 103, 104, 105, - 1, -1, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, -1, 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, -1, 59, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, -1, 94, 95, - -1, 97, -1, -1, -1, -1, -1, 88, 89, -1, - -1, -1, 93, 94, 95, 96, -1, -1, -1, -1, - 101, -1, 103, 104, 105, 3, 4, 5, -1, 7, + 90, 91, 92, 93, 94, 95, -1, 97, 98, 336, + 100, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 325, -1, -1, -1, -1, 330, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 341, 97, 98, -1, 100, -1, -1, -1, 1, + 350, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, -1, 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, -1, + 62, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + -1, 97, 98, -1, 100, -1, -1, -1, -1, 91, + 92, -1, -1, -1, 96, 97, 98, 99, -1, 101, + -1, -1, 104, -1, 106, 107, 108, 1, -1, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, -1, 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, -1, 62, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, -1, 97, 98, + -1, 100, -1, -1, -1, -1, -1, 91, 92, -1, + -1, -1, 96, 97, 98, 99, -1, -1, -1, -1, + 104, -1, 106, 107, 108, 3, 4, 5, -1, 7, 8, 9, -1, 11, 12, 13, 14, 15, 16, 17, 18, -1, 20, 21, 22, 23, -1, 25, 26, -1, 28, 29, 30, 31, 32, 33, -1, 35, 36, 37, - 38, 39, 40, 41, 42, -1, 44, 45, 46, 47, + 38, 39, 40, 41, 42, 43, 44, -1, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, -1, 94, 95, - -1, 97, -1, -1, -1, -1, -1, -1, -1, -1, - 88, 89, -1, -1, -1, 93, 94, 95, 96, -1, - -1, -1, -1, 101, -1, 103, 3, 4, 5, -1, - 7, 8, 9, -1, 11, 12, 13, 14, 15, 16, - 17, 18, -1, 20, 21, 22, 23, -1, 25, 26, - -1, 28, 29, 30, 31, 32, 33, -1, -1, -1, - 37, 38, 39, 40, 41, 42, -1, 44, 45, -1, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, -1, 94, 95, - -1, 97, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 88, 89, -1, -1, -1, 93, 94, 95, 96, - -1, -1, -1, -1, 101, -1, 103, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 58, 59, 60, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + -1, 97, 98, -1, 100, -1, -1, -1, -1, -1, + -1, -1, -1, 91, 92, -1, -1, -1, 96, 97, + 98, 99, -1, -1, -1, -1, 104, -1, 106, 3, + 4, 5, -1, 7, 8, 9, -1, 11, 12, 13, + 14, 15, 16, 17, 18, -1, 20, 21, 22, 23, + -1, 25, 26, -1, 28, 29, 30, 31, 32, 33, + -1, -1, -1, 37, 38, 39, 40, 41, 42, 43, + 44, -1, 46, 47, 48, -1, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - -1, 94, 95, -1, 97, -1, -1, -1, -1, 102, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 93, 94, 95, -1, 97, 98, -1, 100, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 91, 92, -1, + -1, -1, 96, 97, 98, 99, -1, -1, -1, -1, + 104, -1, 106, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, -1, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, -1, 94, 95, -1, 97, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - -1, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, -1, 94, 95, -1, 97, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, -1, 94, 95, -1, 97 + 90, 91, 92, 93, 94, 95, -1, 97, 98, -1, + 100, -1, -1, -1, -1, 105, 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, -1, + 97, 98, -1, 100, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, -1, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, -1, 97, 98, + -1, 100, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, -1, 97, 98, + -1, 100 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 35, 36, 46, 58, 107, 120, 121, 181, 182, - 183, 0, 121, 33, 143, 144, 175, 176, 1, 33, - 122, 123, 144, 185, 186, 142, 168, 169, 104, 104, - 165, 189, 60, 115, 116, 179, 189, 139, 140, 141, - 183, 103, 189, 3, 4, 5, 7, 8, 9, 11, + 0, 35, 36, 49, 61, 110, 123, 124, 184, 185, + 186, 0, 124, 33, 146, 147, 178, 179, 1, 33, + 125, 126, 147, 188, 189, 145, 171, 172, 107, 107, + 168, 192, 63, 118, 119, 182, 192, 142, 143, 144, + 186, 106, 192, 3, 4, 5, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23, 25, 26, 28, 29, 30, 31, 32, 33, 37, - 38, 39, 40, 41, 42, 44, 45, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 88, 89, - 93, 94, 95, 96, 101, 103, 128, 129, 132, 145, - 146, 147, 148, 150, 153, 154, 158, 163, 33, 185, - 100, 1, 6, 10, 24, 27, 34, 43, 59, 104, - 110, 111, 112, 117, 119, 124, 125, 126, 133, 138, - 155, 157, 166, 167, 173, 174, 177, 178, 181, 183, - 187, 188, 115, 99, 122, 168, 168, 168, 168, 168, - 132, 132, 132, 132, 132, 132, 132, 35, 36, 46, - 127, 132, 45, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 73, 74, 75, 76, 77, + 38, 39, 40, 41, 42, 43, 44, 46, 47, 48, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 91, 92, 96, 97, 98, 99, 104, 106, 131, + 132, 135, 148, 149, 150, 151, 153, 156, 157, 161, + 166, 33, 188, 103, 1, 6, 10, 24, 27, 34, + 45, 62, 107, 113, 114, 115, 120, 122, 127, 128, + 129, 136, 141, 158, 160, 169, 170, 176, 177, 180, + 181, 184, 186, 190, 191, 118, 102, 125, 171, 171, + 171, 171, 171, 135, 135, 135, 135, 135, 135, 135, + 35, 36, 49, 130, 135, 48, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 94, 95, 97, 168, 168, - 168, 168, 168, 168, 113, 114, 115, 159, 165, 164, - 171, 164, 164, 189, 175, 98, 175, 132, 175, 168, - 168, 179, 105, 124, 172, 189, 175, 175, 168, 139, - 166, 108, 124, 124, 108, 108, 124, 130, 131, 99, - 113, 132, 132, 132, 132, 132, 132, 132, 132, 132, - 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, - 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, - 132, 132, 132, 132, 124, 124, 124, 124, 108, 152, - 189, 99, 124, 161, 162, 126, 134, 135, 181, 189, - 118, 124, 180, 183, 111, 118, 115, 115, 101, 132, - 72, 102, 115, 100, 149, 189, 100, 151, 189, 115, - 115, 84, 85, 160, 100, 175, 113, 122, 123, 184, - 113, 124, 124, 132, 124, 124, 108, 161, 124, 126, - 124, 136, 178, 60, 109, 115, 115, 159, 175, 170, - 132, 178, 124, 124, 134, 137, 189, 171, 170, 113, - 19, 156, 189, 109, 178, 170, 178, 170 + 88, 89, 90, 91, 92, 93, 94, 95, 97, 98, + 100, 171, 171, 171, 171, 171, 171, 116, 117, 118, + 162, 168, 167, 174, 167, 167, 192, 178, 101, 178, + 135, 178, 171, 171, 182, 108, 127, 175, 192, 178, + 178, 171, 142, 169, 111, 127, 127, 111, 111, 127, + 133, 134, 102, 116, 135, 135, 135, 135, 135, 135, + 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, + 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, + 135, 135, 135, 135, 135, 135, 135, 127, 127, 127, + 127, 111, 155, 192, 102, 127, 164, 165, 129, 137, + 138, 184, 192, 121, 127, 183, 186, 114, 121, 118, + 118, 104, 135, 75, 105, 118, 103, 152, 192, 103, + 154, 192, 118, 118, 87, 88, 163, 103, 178, 116, + 125, 126, 187, 116, 127, 127, 135, 127, 127, 111, + 164, 127, 129, 127, 139, 181, 63, 112, 118, 118, + 162, 178, 173, 135, 181, 127, 127, 137, 140, 192, + 174, 173, 116, 19, 159, 192, 112, 181, 173, 181, + 173 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { - 0, 106, 107, 107, 108, 108, 109, 110, 112, 111, - 114, 113, 116, 115, 117, 118, 118, 119, 120, 121, - 121, 121, 122, 123, 125, 124, 126, 127, 127, 127, - 128, 128, 129, 129, 131, 130, 132, 132, 132, 132, - 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, - 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, - 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, - 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, - 132, 132, 132, 133, 134, 134, 135, 135, 135, 136, - 136, 137, 137, 138, 139, 140, 140, 141, 141, 142, - 143, 144, 145, 145, 145, 146, 146, 146, 146, 146, - 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, - 146, 146, 146, 146, 146, 146, 147, 147, 147, 147, - 147, 147, 147, 147, 148, 148, 148, 149, 149, 150, - 150, 151, 151, 152, 152, 153, 154, 154, 154, 154, - 154, 154, 154, 154, 154, 154, 154, 155, 156, 156, - 157, 158, 159, 160, 160, 162, 161, 163, 163, 163, - 163, 164, 165, 167, 166, 169, 168, 170, 171, 172, - 172, 173, 173, 174, 176, 175, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 178, 178, 179, 179, - 180, 181, 182, 182, 182, 183, 184, 184, 185, 185, - 186, 186, 186, 187, 188, 189 + 0, 109, 110, 110, 111, 111, 112, 113, 115, 114, + 117, 116, 119, 118, 120, 121, 121, 122, 123, 124, + 124, 124, 125, 126, 128, 127, 129, 130, 130, 130, + 131, 131, 132, 132, 134, 133, 135, 135, 135, 135, + 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, + 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, + 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, + 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, + 135, 135, 135, 136, 137, 137, 138, 138, 138, 139, + 139, 140, 140, 141, 142, 143, 143, 144, 144, 145, + 146, 147, 148, 148, 148, 149, 149, 149, 149, 149, + 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, + 149, 149, 149, 149, 149, 149, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 150, 151, 151, 151, + 152, 152, 153, 153, 154, 154, 155, 155, 156, 157, + 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, + 158, 159, 159, 160, 161, 162, 163, 163, 165, 164, + 166, 166, 166, 166, 167, 168, 170, 169, 172, 171, + 173, 174, 175, 175, 176, 176, 177, 179, 178, 180, + 180, 180, 180, 180, 180, 180, 180, 180, 180, 181, + 181, 182, 182, 183, 184, 185, 185, 185, 186, 187, + 187, 188, 188, 189, 189, 189, 190, 191, 192 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ @@ -989,15 +994,15 @@ 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, - 1, 2, 1, 1, 1, 1, 2, 3, 5, 7, - 4, 4, 3, 3, 3, 3, 1, 2, 2, 1, - 9, 3, 0, 1, 1, 0, 2, 2, 3, 6, - 7, 1, 1, 0, 2, 0, 2, 0, 0, 1, - 1, 1, 1, 2, 0, 2, 1, 2, 2, 1, - 1, 1, 2, 2, 2, 2, 1, 2, 2, 1, - 2, 2, 1, 1, 1, 1, 1, 3, 2, 3, - 3, 1, 3, 2, 7, 0 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 2, 1, 1, 1, 2, 1, 1, 1, 1, 2, + 3, 5, 7, 4, 4, 3, 3, 3, 3, 1, + 2, 2, 1, 9, 3, 0, 1, 1, 0, 2, + 2, 3, 6, 7, 1, 1, 0, 2, 0, 2, + 0, 0, 1, 1, 1, 1, 2, 0, 2, 1, + 2, 2, 1, 1, 1, 2, 2, 2, 2, 1, + 2, 2, 1, 2, 2, 1, 1, 1, 1, 1, + 3, 2, 3, 3, 1, 3, 2, 7, 0 }; @@ -1674,757 +1679,757 @@ switch (yyn) { case 4: -#line 124 "grammar" /* yacc.c:1646 */ +#line 127 "grammar" /* yacc.c:1646 */ { (yyval) = *p_multipleArgs(&(yyvsp[-2]), &(yyvsp[0])); } -#line 1682 "parse.c" /* yacc.c:1646 */ +#line 1687 "parse.c" /* yacc.c:1646 */ break; case 5: -#line 129 "grammar" /* yacc.c:1646 */ +#line 132 "grammar" /* yacc.c:1646 */ { (yyval) = *p_firstArg(&(yyvsp[0])); } -#line 1690 "parse.c" /* yacc.c:1646 */ +#line 1695 "parse.c" /* yacc.c:1646 */ break; case 6: -#line 134 "grammar" /* yacc.c:1646 */ +#line 137 "grammar" /* yacc.c:1646 */ { gp_breakOK++; } -#line 1698 "parse.c" /* yacc.c:1646 */ +#line 1703 "parse.c" /* yacc.c:1646 */ break; case 7: -#line 140 "grammar" /* yacc.c:1646 */ +#line 143 "grammar" /* yacc.c:1646 */ { (yyval) = *p_break(); } -#line 1706 "parse.c" /* yacc.c:1646 */ +#line 1711 "parse.c" /* yacc.c:1646 */ break; case 8: -#line 145 "grammar" /* yacc.c:1646 */ +#line 148 "grammar" /* yacc.c:1646 */ { gp_parse_error = err_closebrace_expected; symtab_pop(); } -#line 1715 "parse.c" /* yacc.c:1646 */ +#line 1720 "parse.c" /* yacc.c:1646 */ break; case 10: -#line 152 "grammar" /* yacc.c:1646 */ +#line 155 "grammar" /* yacc.c:1646 */ { gp_parse_error = err_closepar_expected; } -#line 1723 "parse.c" /* yacc.c:1646 */ +#line 1728 "parse.c" /* yacc.c:1646 */ break; case 12: -#line 158 "grammar" /* yacc.c:1646 */ +#line 161 "grammar" /* yacc.c:1646 */ { gp_parse_error = err_comma_expected; } -#line 1731 "parse.c" /* yacc.c:1646 */ +#line 1736 "parse.c" /* yacc.c:1646 */ break; case 14: -#line 167 "grammar" /* yacc.c:1646 */ +#line 170 "grammar" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 1739 "parse.c" /* yacc.c:1646 */ +#line 1744 "parse.c" /* yacc.c:1646 */ break; case 17: -#line 178 "grammar" /* yacc.c:1646 */ +#line 181 "grammar" /* yacc.c:1646 */ { (yyval) = *p_continue(); } -#line 1747 "parse.c" /* yacc.c:1646 */ +#line 1752 "parse.c" /* yacc.c:1646 */ break; case 18: -#line 184 "grammar" /* yacc.c:1646 */ +#line 187 "grammar" /* yacc.c:1646 */ { gp_varType = 0; } -#line 1755 "parse.c" /* yacc.c:1646 */ +#line 1760 "parse.c" /* yacc.c:1646 */ break; case 19: -#line 192 "grammar" /* yacc.c:1646 */ +#line 195 "grammar" /* yacc.c:1646 */ { gp_init = *p_catCode(&gp_init, &(yyvsp[-1])); } -#line 1763 "parse.c" /* yacc.c:1646 */ +#line 1768 "parse.c" /* yacc.c:1646 */ break; case 22: -#line 205 "grammar" /* yacc.c:1646 */ +#line 208 "grammar" /* yacc.c:1646 */ { p_defineVar(); /* the first n variables of a function, up to the end of the parameter list are the parameters. */ } -#line 1772 "parse.c" /* yacc.c:1646 */ +#line 1777 "parse.c" /* yacc.c:1646 */ break; case 23: -#line 212 "grammar" /* yacc.c:1646 */ +#line 215 "grammar" /* yacc.c:1646 */ { (yyval) = *p_fetchVar(); } -#line 1780 "parse.c" /* yacc.c:1646 */ +#line 1785 "parse.c" /* yacc.c:1646 */ break; case 24: -#line 218 "grammar" /* yacc.c:1646 */ +#line 221 "grammar" /* yacc.c:1646 */ { gp_parse_error = err_in_expression; } -#line 1788 "parse.c" /* yacc.c:1646 */ +#line 1793 "parse.c" /* yacc.c:1646 */ break; case 25: -#line 222 "grammar" /* yacc.c:1646 */ +#line 225 "grammar" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 1796 "parse.c" /* yacc.c:1646 */ +#line 1801 "parse.c" /* yacc.c:1646 */ break; case 26: -#line 228 "grammar" /* yacc.c:1646 */ +#line 231 "grammar" /* yacc.c:1646 */ { (yyval) = *p_expression(&(yyvsp[0])); } -#line 1804 "parse.c" /* yacc.c:1646 */ +#line 1809 "parse.c" /* yacc.c:1646 */ break; case 30: -#line 243 "grammar" /* yacc.c:1646 */ +#line 246 "grammar" /* yacc.c:1646 */ { /* catenate the new string */ gp_stringbuf = rss_strcat(gp_stringbuf, util_string()); } -#line 1812 "parse.c" /* yacc.c:1646 */ +#line 1817 "parse.c" /* yacc.c:1646 */ break; case 31: -#line 248 "grammar" /* yacc.c:1646 */ +#line 251 "grammar" /* yacc.c:1646 */ { free(gp_stringbuf); /* free former string */ gp_stringbuf = rss_strdup(util_string()); /* duplicate initial string */ } -#line 1821 "parse.c" /* yacc.c:1646 */ +#line 1826 "parse.c" /* yacc.c:1646 */ break; case 33: -#line 259 "grammar" /* yacc.c:1646 */ +#line 262 "grammar" /* yacc.c:1646 */ { (yyval) = *p_fetchVar(); } -#line 1829 "parse.c" /* yacc.c:1646 */ +#line 1834 "parse.c" /* yacc.c:1646 */ break; case 34: -#line 265 "grammar" /* yacc.c:1646 */ +#line 268 "grammar" /* yacc.c:1646 */ { gp_parse_error = err_backtick_expected; } -#line 1837 "parse.c" /* yacc.c:1646 */ +#line 1842 "parse.c" /* yacc.c:1646 */ break; case 36: -#line 275 "grammar" /* yacc.c:1646 */ +#line 278 "grammar" /* yacc.c:1646 */ { (yyval) = *p_assign(&(yyvsp[-2]), &(yyvsp[0])); } -#line 1845 "parse.c" /* yacc.c:1646 */ +#line 1850 "parse.c" /* yacc.c:1646 */ break; case 37: -#line 283 "grammar" /* yacc.c:1646 */ +#line 286 "grammar" /* yacc.c:1646 */ { (yyval) = *p_indexOp(&(yyvsp[-3]), &(yyvsp[-1])); } -#line 1853 "parse.c" /* yacc.c:1646 */ +#line 1858 "parse.c" /* yacc.c:1646 */ break; case 38: -#line 290 "grammar" /* yacc.c:1646 */ +#line 293 "grammar" /* yacc.c:1646 */ { (yyval) = *p_compoundAss(&(yyvsp[-2]), &(yyvsp[0]), p_multiply, "*="); } -#line 1861 "parse.c" /* yacc.c:1646 */ +#line 1866 "parse.c" /* yacc.c:1646 */ break; case 39: -#line 297 "grammar" /* yacc.c:1646 */ +#line 300 "grammar" /* yacc.c:1646 */ { (yyval) = *p_compoundAss(&(yyvsp[-2]), &(yyvsp[0]), p_divide, "/="); } -#line 1869 "parse.c" /* yacc.c:1646 */ +#line 1874 "parse.c" /* yacc.c:1646 */ break; case 40: -#line 304 "grammar" /* yacc.c:1646 */ +#line 307 "grammar" /* yacc.c:1646 */ { (yyval) = *p_compoundAss(&(yyvsp[-2]), &(yyvsp[0]), p_modulo, "%="); } -#line 1877 "parse.c" /* yacc.c:1646 */ +#line 1882 "parse.c" /* yacc.c:1646 */ break; case 41: -#line 311 "grammar" /* yacc.c:1646 */ +#line 314 "grammar" /* yacc.c:1646 */ { (yyval) = *p_compoundAss(&(yyvsp[-2]), &(yyvsp[0]), p_addition, "+="); } -#line 1885 "parse.c" /* yacc.c:1646 */ +#line 1890 "parse.c" /* yacc.c:1646 */ break; case 42: -#line 318 "grammar" /* yacc.c:1646 */ +#line 321 "grammar" /* yacc.c:1646 */ { (yyval) = *p_compoundAss(&(yyvsp[-2]), &(yyvsp[0]), p_subtract, "-="); } -#line 1893 "parse.c" /* yacc.c:1646 */ +#line 1898 "parse.c" /* yacc.c:1646 */ break; case 43: -#line 325 "grammar" /* yacc.c:1646 */ +#line 328 "grammar" /* yacc.c:1646 */ { (yyval) = *p_compoundAss(&(yyvsp[-2]), &(yyvsp[0]), p_and, "&="); } -#line 1901 "parse.c" /* yacc.c:1646 */ +#line 1906 "parse.c" /* yacc.c:1646 */ break; case 44: -#line 332 "grammar" /* yacc.c:1646 */ +#line 335 "grammar" /* yacc.c:1646 */ { (yyval) = *p_compoundAss(&(yyvsp[-2]), &(yyvsp[0]), p_or, "|="); } -#line 1909 "parse.c" /* yacc.c:1646 */ +#line 1914 "parse.c" /* yacc.c:1646 */ break; case 45: -#line 339 "grammar" /* yacc.c:1646 */ +#line 342 "grammar" /* yacc.c:1646 */ { (yyval) = *p_compoundAss(&(yyvsp[-2]), &(yyvsp[0]), p_xor, "^="); } -#line 1917 "parse.c" /* yacc.c:1646 */ +#line 1922 "parse.c" /* yacc.c:1646 */ break; case 46: -#line 346 "grammar" /* yacc.c:1646 */ +#line 349 "grammar" /* yacc.c:1646 */ { (yyval) = *p_compoundAss(&(yyvsp[-2]), &(yyvsp[0]), p_shl, "<<="); } -#line 1925 "parse.c" /* yacc.c:1646 */ +#line 1930 "parse.c" /* yacc.c:1646 */ break; case 47: -#line 353 "grammar" /* yacc.c:1646 */ +#line 356 "grammar" /* yacc.c:1646 */ { (yyval) = *p_compoundAss(&(yyvsp[-2]), &(yyvsp[0]), p_shr, ">>="); } -#line 1933 "parse.c" /* yacc.c:1646 */ +#line 1938 "parse.c" /* yacc.c:1646 */ break; case 48: -#line 360 "grammar" /* yacc.c:1646 */ +#line 363 "grammar" /* yacc.c:1646 */ { (yyval) = *p_orBool(&(yyvsp[-2]), &(yyvsp[0])); } -#line 1941 "parse.c" /* yacc.c:1646 */ +#line 1946 "parse.c" /* yacc.c:1646 */ break; case 49: -#line 367 "grammar" /* yacc.c:1646 */ +#line 370 "grammar" /* yacc.c:1646 */ { (yyval) = *p_andBoolean(&(yyvsp[-2]), &(yyvsp[0])); } -#line 1949 "parse.c" /* yacc.c:1646 */ +#line 1954 "parse.c" /* yacc.c:1646 */ break; case 50: -#line 374 "grammar" /* yacc.c:1646 */ +#line 377 "grammar" /* yacc.c:1646 */ { (yyval) = *p_equal(&(yyvsp[-2]), &(yyvsp[0])); } -#line 1957 "parse.c" /* yacc.c:1646 */ +#line 1962 "parse.c" /* yacc.c:1646 */ break; case 51: -#line 381 "grammar" /* yacc.c:1646 */ +#line 384 "grammar" /* yacc.c:1646 */ { (yyval) = *p_unequal(&(yyvsp[-2]), &(yyvsp[0])); } -#line 1965 "parse.c" /* yacc.c:1646 */ +#line 1970 "parse.c" /* yacc.c:1646 */ break; case 52: -#line 390 "grammar" /* yacc.c:1646 */ +#line 393 "grammar" /* yacc.c:1646 */ { (yyval) = *p_ternary(&(yyvsp[-4]), &(yyvsp[-2]), &(yyvsp[0])); } -#line 1973 "parse.c" /* yacc.c:1646 */ +#line 1978 "parse.c" /* yacc.c:1646 */ break; case 53: -#line 397 "grammar" /* yacc.c:1646 */ +#line 400 "grammar" /* yacc.c:1646 */ { (yyval) = *p_smaller(&(yyvsp[-2]), &(yyvsp[0])); } -#line 1981 "parse.c" /* yacc.c:1646 */ +#line 1986 "parse.c" /* yacc.c:1646 */ break; case 54: -#line 404 "grammar" /* yacc.c:1646 */ +#line 407 "grammar" /* yacc.c:1646 */ { (yyval) = *p_greater(&(yyvsp[-2]), &(yyvsp[0])); } -#line 1989 "parse.c" /* yacc.c:1646 */ +#line 1994 "parse.c" /* yacc.c:1646 */ break; case 55: -#line 411 "grammar" /* yacc.c:1646 */ +#line 414 "grammar" /* yacc.c:1646 */ { (yyval) = *p_smEqual(&(yyvsp[-2]), &(yyvsp[0])); } -#line 1997 "parse.c" /* yacc.c:1646 */ +#line 2002 "parse.c" /* yacc.c:1646 */ break; case 56: -#line 418 "grammar" /* yacc.c:1646 */ +#line 421 "grammar" /* yacc.c:1646 */ { (yyval) = *p_grEqual(&(yyvsp[-2]), &(yyvsp[0])); } -#line 2005 "parse.c" /* yacc.c:1646 */ +#line 2010 "parse.c" /* yacc.c:1646 */ break; case 57: -#line 425 "grammar" /* yacc.c:1646 */ +#line 428 "grammar" /* yacc.c:1646 */ { (yyval) = *p_addition(&(yyvsp[-2]), &(yyvsp[0])); } -#line 2013 "parse.c" /* yacc.c:1646 */ +#line 2018 "parse.c" /* yacc.c:1646 */ break; case 58: -#line 432 "grammar" /* yacc.c:1646 */ +#line 435 "grammar" /* yacc.c:1646 */ { (yyval) = *p_and(&(yyvsp[-2]), &(yyvsp[0])); } -#line 2021 "parse.c" /* yacc.c:1646 */ +#line 2026 "parse.c" /* yacc.c:1646 */ break; case 59: -#line 439 "grammar" /* yacc.c:1646 */ +#line 442 "grammar" /* yacc.c:1646 */ { (yyval) = *p_or(&(yyvsp[-2]), &(yyvsp[0])); } -#line 2029 "parse.c" /* yacc.c:1646 */ +#line 2034 "parse.c" /* yacc.c:1646 */ break; case 60: -#line 446 "grammar" /* yacc.c:1646 */ +#line 449 "grammar" /* yacc.c:1646 */ { (yyval) = *p_xor(&(yyvsp[-2]), &(yyvsp[0])); } -#line 2037 "parse.c" /* yacc.c:1646 */ +#line 2042 "parse.c" /* yacc.c:1646 */ break; case 61: -#line 453 "grammar" /* yacc.c:1646 */ +#line 456 "grammar" /* yacc.c:1646 */ { (yyval) = *p_shl(&(yyvsp[-2]), &(yyvsp[0])); } -#line 2045 "parse.c" /* yacc.c:1646 */ +#line 2050 "parse.c" /* yacc.c:1646 */ break; case 62: -#line 460 "grammar" /* yacc.c:1646 */ +#line 463 "grammar" /* yacc.c:1646 */ { (yyval) = *p_shr(&(yyvsp[-2]), &(yyvsp[0])); } -#line 2053 "parse.c" /* yacc.c:1646 */ +#line 2058 "parse.c" /* yacc.c:1646 */ break; case 63: -#line 467 "grammar" /* yacc.c:1646 */ +#line 470 "grammar" /* yacc.c:1646 */ { (yyval) = *p_subtract(&(yyvsp[-2]), &(yyvsp[0])); } -#line 2061 "parse.c" /* yacc.c:1646 */ +#line 2066 "parse.c" /* yacc.c:1646 */ break; case 64: -#line 474 "grammar" /* yacc.c:1646 */ +#line 477 "grammar" /* yacc.c:1646 */ { (yyval) = *p_multiply(&(yyvsp[-2]), &(yyvsp[0])); } -#line 2069 "parse.c" /* yacc.c:1646 */ +#line 2074 "parse.c" /* yacc.c:1646 */ break; case 65: -#line 481 "grammar" /* yacc.c:1646 */ +#line 484 "grammar" /* yacc.c:1646 */ { (yyval) = *p_young(&(yyvsp[-2]), &(yyvsp[0])); } -#line 2077 "parse.c" /* yacc.c:1646 */ +#line 2082 "parse.c" /* yacc.c:1646 */ break; case 66: -#line 488 "grammar" /* yacc.c:1646 */ +#line 491 "grammar" /* yacc.c:1646 */ { (yyval) = *p_old(&(yyvsp[-2]), &(yyvsp[0])); } -#line 2085 "parse.c" /* yacc.c:1646 */ +#line 2090 "parse.c" /* yacc.c:1646 */ break; case 67: -#line 495 "grammar" /* yacc.c:1646 */ +#line 498 "grammar" /* yacc.c:1646 */ { (yyval) = *p_divide(&(yyvsp[-2]), &(yyvsp[0])); } -#line 2093 "parse.c" /* yacc.c:1646 */ +#line 2098 "parse.c" /* yacc.c:1646 */ break; case 68: -#line 502 "grammar" /* yacc.c:1646 */ +#line 505 "grammar" /* yacc.c:1646 */ { (yyval) = *p_modulo(&(yyvsp[-2]), &(yyvsp[0])); } -#line 2101 "parse.c" /* yacc.c:1646 */ +#line 2106 "parse.c" /* yacc.c:1646 */ break; case 69: -#line 508 "grammar" /* yacc.c:1646 */ +#line 511 "grammar" /* yacc.c:1646 */ { (yyval) = *p_negate(&(yyvsp[0])); } -#line 2109 "parse.c" /* yacc.c:1646 */ +#line 2114 "parse.c" /* yacc.c:1646 */ break; case 70: -#line 514 "grammar" /* yacc.c:1646 */ +#line 517 "grammar" /* yacc.c:1646 */ { (yyval) = *p_incDec(pre_op, op_inc, &(yyvsp[0])); } -#line 2117 "parse.c" /* yacc.c:1646 */ +#line 2122 "parse.c" /* yacc.c:1646 */ break; case 71: -#line 520 "grammar" /* yacc.c:1646 */ +#line 523 "grammar" /* yacc.c:1646 */ { (yyval) = *p_incDec(post_op, op_inc, &(yyvsp[-1])); } -#line 2125 "parse.c" /* yacc.c:1646 */ +#line 2130 "parse.c" /* yacc.c:1646 */ break; case 72: -#line 526 "grammar" /* yacc.c:1646 */ +#line 529 "grammar" /* yacc.c:1646 */ { (yyval) = *p_incDec(pre_op, op_dec, &(yyvsp[0])); } -#line 2133 "parse.c" /* yacc.c:1646 */ +#line 2138 "parse.c" /* yacc.c:1646 */ break; case 73: -#line 532 "grammar" /* yacc.c:1646 */ +#line 535 "grammar" /* yacc.c:1646 */ { (yyval) = *p_incDec(post_op, op_dec, &(yyvsp[-1])); } -#line 2141 "parse.c" /* yacc.c:1646 */ +#line 2146 "parse.c" /* yacc.c:1646 */ break; case 74: -#line 538 "grammar" /* yacc.c:1646 */ +#line 541 "grammar" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2149 "parse.c" /* yacc.c:1646 */ +#line 2154 "parse.c" /* yacc.c:1646 */ break; case 75: -#line 544 "grammar" /* yacc.c:1646 */ +#line 547 "grammar" /* yacc.c:1646 */ { (yyval) = *p_not(&(yyvsp[0])); } -#line 2157 "parse.c" /* yacc.c:1646 */ +#line 2162 "parse.c" /* yacc.c:1646 */ break; case 76: -#line 550 "grammar" /* yacc.c:1646 */ +#line 553 "grammar" /* yacc.c:1646 */ { (yyval) = *p_notBoolean(&(yyvsp[0])); } -#line 2165 "parse.c" /* yacc.c:1646 */ +#line 2170 "parse.c" /* yacc.c:1646 */ break; case 77: -#line 558 "grammar" /* yacc.c:1646 */ +#line 561 "grammar" /* yacc.c:1646 */ { (yyval) = *p_cast((yyvsp[-2]).type, &(yyvsp[0])); } -#line 2173 "parse.c" /* yacc.c:1646 */ +#line 2178 "parse.c" /* yacc.c:1646 */ break; case 78: -#line 563 "grammar" /* yacc.c:1646 */ +#line 566 "grammar" /* yacc.c:1646 */ { (yyval) = *p_stackFrame(e_str | e_const); } -#line 2181 "parse.c" /* yacc.c:1646 */ +#line 2186 "parse.c" /* yacc.c:1646 */ break; case 79: -#line 568 "grammar" /* yacc.c:1646 */ +#line 571 "grammar" /* yacc.c:1646 */ { (yyval) = *p_stackFrame(e_int | e_const); } -#line 2189 "parse.c" /* yacc.c:1646 */ +#line 2194 "parse.c" /* yacc.c:1646 */ break; case 80: -#line 575 "grammar" /* yacc.c:1646 */ +#line 578 "grammar" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } -#line 2197 "parse.c" /* yacc.c:1646 */ +#line 2202 "parse.c" /* yacc.c:1646 */ break; case 82: -#line 584 "grammar" /* yacc.c:1646 */ +#line 587 "grammar" /* yacc.c:1646 */ { (yyval) = *p_oneArg(f_backtick, &(yyvsp[-1])); } -#line 2205 "parse.c" /* yacc.c:1646 */ +#line 2210 "parse.c" /* yacc.c:1646 */ break; case 83: -#line 591 "grammar" /* yacc.c:1646 */ +#line 594 "grammar" /* yacc.c:1646 */ { symtab_push(); } -#line 2213 "parse.c" /* yacc.c:1646 */ +#line 2218 "parse.c" /* yacc.c:1646 */ break; case 84: -#line 600 "grammar" /* yacc.c:1646 */ +#line 603 "grammar" /* yacc.c:1646 */ { (yyval) = *p_catCode(&(yyvsp[-2]), &(yyvsp[0])); } -#line 2221 "parse.c" /* yacc.c:1646 */ +#line 2226 "parse.c" /* yacc.c:1646 */ break; case 90: -#line 619 "grammar" /* yacc.c:1646 */ +#line 622 "grammar" /* yacc.c:1646 */ { (yyval) = *p_stackFrame(e_int | e_const); (yyval).evalue = 1; } -#line 2230 "parse.c" /* yacc.c:1646 */ +#line 2235 "parse.c" /* yacc.c:1646 */ break; case 93: -#line 643 "grammar" /* yacc.c:1646 */ +#line 646 "grammar" /* yacc.c:1646 */ { (yyval) = *p_for(&(yyvsp[-8]), &(yyvsp[-6]), &(yyvsp[-4]), &(yyvsp[-1])); } -#line 2238 "parse.c" /* yacc.c:1646 */ +#line 2243 "parse.c" /* yacc.c:1646 */ break; case 99: -#line 687 "grammar" /* yacc.c:1646 */ +#line 690 "grammar" /* yacc.c:1646 */ { symtab_setFunParams(); /* the # variables so far are the parameters */ } -#line 2246 "parse.c" /* yacc.c:1646 */ +#line 2251 "parse.c" /* yacc.c:1646 */ break; case 100: -#line 694 "grammar" /* yacc.c:1646 */ +#line 697 "grammar" /* yacc.c:1646 */ { p_beginFunction(); } -#line 2254 "parse.c" /* yacc.c:1646 */ +#line 2259 "parse.c" /* yacc.c:1646 */ break; case 101: -#line 705 "grammar" /* yacc.c:1646 */ +#line 708 "grammar" /* yacc.c:1646 */ { p_endFunction(&(yyvsp[-1])); } -#line 2262 "parse.c" /* yacc.c:1646 */ +#line 2267 "parse.c" /* yacc.c:1646 */ break; - case 137: -#line 790 "grammar" /* yacc.c:1646 */ + case 140: +#line 799 "grammar" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2270 "parse.c" /* yacc.c:1646 */ +#line 2275 "parse.c" /* yacc.c:1646 */ break; - case 141: -#line 806 "grammar" /* yacc.c:1646 */ + case 144: +#line 815 "grammar" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2278 "parse.c" /* yacc.c:1646 */ +#line 2283 "parse.c" /* yacc.c:1646 */ break; - case 145: -#line 821 "grammar" /* yacc.c:1646 */ + case 148: +#line 830 "grammar" /* yacc.c:1646 */ { (yyval).evalue = p_functionIdx(); } -#line 2286 "parse.c" /* yacc.c:1646 */ +#line 2291 "parse.c" /* yacc.c:1646 */ break; - case 146: -#line 829 "grammar" /* yacc.c:1646 */ + case 149: +#line 838 "grammar" /* yacc.c:1646 */ { (yyval) = *p_zeroArgs((yyvsp[-1]).type); } -#line 2294 "parse.c" /* yacc.c:1646 */ +#line 2299 "parse.c" /* yacc.c:1646 */ break; - case 147: -#line 836 "grammar" /* yacc.c:1646 */ + case 150: +#line 845 "grammar" /* yacc.c:1646 */ { (yyval) = *p_oneArg((yyvsp[-2]).type, &(yyvsp[0])); } -#line 2302 "parse.c" /* yacc.c:1646 */ +#line 2307 "parse.c" /* yacc.c:1646 */ break; - case 148: -#line 845 "grammar" /* yacc.c:1646 */ + case 151: +#line 854 "grammar" /* yacc.c:1646 */ { (yyval) = *p_twoArgs((yyvsp[-4]).type, &(yyvsp[-2]), &(yyvsp[0])); } -#line 2310 "parse.c" /* yacc.c:1646 */ +#line 2315 "parse.c" /* yacc.c:1646 */ break; - case 149: -#line 856 "grammar" /* yacc.c:1646 */ + case 152: +#line 865 "grammar" /* yacc.c:1646 */ { (yyval) = *p_threeArgs((yyvsp[-6]).type, &(yyvsp[-4]), &(yyvsp[-2]), &(yyvsp[0])); } -#line 2318 "parse.c" /* yacc.c:1646 */ +#line 2323 "parse.c" /* yacc.c:1646 */ break; - case 150: -#line 864 "grammar" /* yacc.c:1646 */ + case 153: +#line 873 "grammar" /* yacc.c:1646 */ { (yyval) = *p_optIntString((yyvsp[-3]).type, &(yyvsp[-1]), &(yyvsp[0])); } -#line 2326 "parse.c" /* yacc.c:1646 */ +#line 2331 "parse.c" /* yacc.c:1646 */ break; - case 151: -#line 872 "grammar" /* yacc.c:1646 */ + case 154: +#line 881 "grammar" /* yacc.c:1646 */ { (yyval) = *p_optIntSpecial((yyvsp[-3]).type, &(yyvsp[-1]), &(yyvsp[0])); } -#line 2334 "parse.c" /* yacc.c:1646 */ +#line 2339 "parse.c" /* yacc.c:1646 */ break; - case 152: -#line 879 "grammar" /* yacc.c:1646 */ + case 155: +#line 888 "grammar" /* yacc.c:1646 */ { (yyval) = *p_specials(f_printf, &(yyvsp[0])); } -#line 2342 "parse.c" /* yacc.c:1646 */ +#line 2347 "parse.c" /* yacc.c:1646 */ break; - case 153: -#line 886 "grammar" /* yacc.c:1646 */ + case 156: +#line 895 "grammar" /* yacc.c:1646 */ { (yyval) = *p_fprintf((yyvsp[-2]).type, &(yyvsp[0])); } -#line 2350 "parse.c" /* yacc.c:1646 */ +#line 2355 "parse.c" /* yacc.c:1646 */ break; - case 154: -#line 893 "grammar" /* yacc.c:1646 */ + case 157: +#line 902 "grammar" /* yacc.c:1646 */ { (yyval) = *p_specials(f_strformat, &(yyvsp[0])); } -#line 2358 "parse.c" /* yacc.c:1646 */ +#line 2363 "parse.c" /* yacc.c:1646 */ break; - case 155: -#line 900 "grammar" /* yacc.c:1646 */ + case 158: +#line 909 "grammar" /* yacc.c:1646 */ { (yyval) = *p_callFunction((yyvsp[-2]).evalue, &(yyvsp[0])); } -#line 2366 "parse.c" /* yacc.c:1646 */ +#line 2371 "parse.c" /* yacc.c:1646 */ break; - case 157: -#line 909 "grammar" /* yacc.c:1646 */ + case 160: +#line 918 "grammar" /* yacc.c:1646 */ { symtab_push(); } -#line 2374 "parse.c" /* yacc.c:1646 */ +#line 2379 "parse.c" /* yacc.c:1646 */ break; - case 158: -#line 917 "grammar" /* yacc.c:1646 */ + case 161: +#line 926 "grammar" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2382 "parse.c" /* yacc.c:1646 */ +#line 2387 "parse.c" /* yacc.c:1646 */ break; - case 160: -#line 934 "grammar" /* yacc.c:1646 */ + case 163: +#line 943 "grammar" /* yacc.c:1646 */ { (yyval) = *p_if(&(yyvsp[-6]), &(yyvsp[-4]), &(yyvsp[-1])); symtab_pop(); } -#line 2391 "parse.c" /* yacc.c:1646 */ +#line 2396 "parse.c" /* yacc.c:1646 */ break; - case 161: -#line 950 "grammar" /* yacc.c:1646 */ + case 164: +#line 959 "grammar" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2399 "parse.c" /* yacc.c:1646 */ +#line 2404 "parse.c" /* yacc.c:1646 */ break; - case 162: -#line 956 "grammar" /* yacc.c:1646 */ + case 165: +#line 965 "grammar" /* yacc.c:1646 */ { (yyval) = *p_stackFrame(e_int | e_const); (yyval).evalue = IS_FILE; } -#line 2408 "parse.c" /* yacc.c:1646 */ +#line 2413 "parse.c" /* yacc.c:1646 */ break; - case 165: -#line 969 "grammar" /* yacc.c:1646 */ + case 168: +#line 978 "grammar" /* yacc.c:1646 */ { gp_parse_error = err_older_younger; } -#line 2416 "parse.c" /* yacc.c:1646 */ +#line 2421 "parse.c" /* yacc.c:1646 */ break; - case 166: -#line 973 "grammar" /* yacc.c:1646 */ + case 169: +#line 982 "grammar" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2424 "parse.c" /* yacc.c:1646 */ +#line 2429 "parse.c" /* yacc.c:1646 */ break; - case 167: -#line 981 "grammar" /* yacc.c:1646 */ + case 170: +#line 990 "grammar" /* yacc.c:1646 */ { (yyval) = *p_makeList ( @@ -2436,11 +2441,11 @@ op_hlt /* not op_younger or op_older */ ); } -#line 2440 "parse.c" /* yacc.c:1646 */ +#line 2445 "parse.c" /* yacc.c:1646 */ break; - case 168: -#line 997 "grammar" /* yacc.c:1646 */ + case 171: +#line 1006 "grammar" /* yacc.c:1646 */ { (yyval) = *p_makeList ( @@ -2452,11 +2457,11 @@ op_hlt /* not op_younger or op_older */ ); } -#line 2456 "parse.c" /* yacc.c:1646 */ +#line 2461 "parse.c" /* yacc.c:1646 */ break; - case 169: -#line 1015 "grammar" /* yacc.c:1646 */ + case 172: +#line 1024 "grammar" /* yacc.c:1646 */ { (yyval) = *p_makeList ( @@ -2472,11 +2477,11 @@ (yyvsp[-3]).type /* older/younger */ ); } -#line 2476 "parse.c" /* yacc.c:1646 */ +#line 2481 "parse.c" /* yacc.c:1646 */ break; - case 170: -#line 1038 "grammar" /* yacc.c:1646 */ + case 173: +#line 1047 "grammar" /* yacc.c:1646 */ { (yyval) = *p_makeList ( @@ -2492,191 +2497,191 @@ (yyvsp[-2]).type /* older/younger */ ); } -#line 2496 "parse.c" /* yacc.c:1646 */ +#line 2501 "parse.c" /* yacc.c:1646 */ break; - case 171: -#line 1056 "grammar" /* yacc.c:1646 */ + case 174: +#line 1065 "grammar" /* yacc.c:1646 */ { gp_nestLevel++; } -#line 2504 "parse.c" /* yacc.c:1646 */ +#line 2509 "parse.c" /* yacc.c:1646 */ break; - case 172: -#line 1062 "grammar" /* yacc.c:1646 */ + case 175: +#line 1071 "grammar" /* yacc.c:1646 */ { yyerrok; } -#line 2512 "parse.c" /* yacc.c:1646 */ +#line 2517 "parse.c" /* yacc.c:1646 */ break; - case 173: -#line 1067 "grammar" /* yacc.c:1646 */ + case 176: +#line 1076 "grammar" /* yacc.c:1646 */ { gp_parse_error = err_openbrace_expected; } -#line 2520 "parse.c" /* yacc.c:1646 */ +#line 2525 "parse.c" /* yacc.c:1646 */ break; - case 174: -#line 1071 "grammar" /* yacc.c:1646 */ + case 177: +#line 1080 "grammar" /* yacc.c:1646 */ { symtab_push(); } -#line 2528 "parse.c" /* yacc.c:1646 */ +#line 2533 "parse.c" /* yacc.c:1646 */ break; - case 175: -#line 1077 "grammar" /* yacc.c:1646 */ + case 178: +#line 1086 "grammar" /* yacc.c:1646 */ { gp_parse_error = err_openpar_expected; } -#line 2536 "parse.c" /* yacc.c:1646 */ +#line 2541 "parse.c" /* yacc.c:1646 */ break; - case 177: -#line 1083 "grammar" /* yacc.c:1646 */ + case 180: +#line 1092 "grammar" /* yacc.c:1646 */ { p_popDead(); } -#line 2544 "parse.c" /* yacc.c:1646 */ +#line 2549 "parse.c" /* yacc.c:1646 */ break; - case 178: -#line 1088 "grammar" /* yacc.c:1646 */ + case 181: +#line 1097 "grammar" /* yacc.c:1646 */ { p_pushDead(); /* set new dead-level */ } -#line 2552 "parse.c" /* yacc.c:1646 */ +#line 2557 "parse.c" /* yacc.c:1646 */ break; - case 181: -#line 1100 "grammar" /* yacc.c:1646 */ + case 184: +#line 1109 "grammar" /* yacc.c:1646 */ { msg("saw return"); } -#line 2560 "parse.c" /* yacc.c:1646 */ +#line 2565 "parse.c" /* yacc.c:1646 */ break; - case 183: -#line 1110 "grammar" /* yacc.c:1646 */ + case 186: +#line 1119 "grammar" /* yacc.c:1646 */ { (yyval) = *p_return((yyvsp[-1]).type, &(yyvsp[0])); msg("SAW return stmt"); } -#line 2569 "parse.c" /* yacc.c:1646 */ +#line 2574 "parse.c" /* yacc.c:1646 */ break; - case 184: -#line 1118 "grammar" /* yacc.c:1646 */ + case 187: +#line 1127 "grammar" /* yacc.c:1646 */ { gp_parse_error = err_semicol_expected; } -#line 2577 "parse.c" /* yacc.c:1646 */ +#line 2582 "parse.c" /* yacc.c:1646 */ break; - case 187: -#line 1128 "grammar" /* yacc.c:1646 */ + case 190: +#line 1137 "grammar" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2585 "parse.c" /* yacc.c:1646 */ +#line 2590 "parse.c" /* yacc.c:1646 */ break; - case 198: -#line 1163 "grammar" /* yacc.c:1646 */ + case 201: +#line 1172 "grammar" /* yacc.c:1646 */ { (yyval) = *p_catStmnts(&(yyvsp[-1]), &(yyvsp[0])); } -#line 2593 "parse.c" /* yacc.c:1646 */ +#line 2598 "parse.c" /* yacc.c:1646 */ break; - case 200: -#line 1177 "grammar" /* yacc.c:1646 */ + case 203: +#line 1186 "grammar" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2601 "parse.c" /* yacc.c:1646 */ +#line 2606 "parse.c" /* yacc.c:1646 */ break; - case 201: -#line 1184 "grammar" /* yacc.c:1646 */ + case 204: +#line 1193 "grammar" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2609 "parse.c" /* yacc.c:1646 */ +#line 2614 "parse.c" /* yacc.c:1646 */ break; - case 205: -#line 1199 "grammar" /* yacc.c:1646 */ + case 208: +#line 1208 "grammar" /* yacc.c:1646 */ { gp_parse_error = err_identifier_expected; gp_varType = (yyvsp[0]).type; } -#line 2618 "parse.c" /* yacc.c:1646 */ +#line 2623 "parse.c" /* yacc.c:1646 */ break; - case 206: -#line 1206 "grammar" /* yacc.c:1646 */ + case 209: +#line 1215 "grammar" /* yacc.c:1646 */ { p_generateCode(&(yyvsp[0]), op_push_imm, 0); (yyval) = (yyvsp[0]); } -#line 2627 "parse.c" /* yacc.c:1646 */ +#line 2632 "parse.c" /* yacc.c:1646 */ break; - case 207: -#line 1214 "grammar" /* yacc.c:1646 */ + case 210: +#line 1223 "grammar" /* yacc.c:1646 */ { (yyval) = *p_assign(&(yyvsp[-2]), &(yyvsp[0])); /* explicit initialization */ } -#line 2635 "parse.c" /* yacc.c:1646 */ +#line 2640 "parse.c" /* yacc.c:1646 */ break; - case 209: -#line 1225 "grammar" /* yacc.c:1646 */ + case 212: +#line 1234 "grammar" /* yacc.c:1646 */ { (yyval) = *p_expression(p_assign(&(yyvsp[-2]), &(yyvsp[0]))); /* explicit initialization */ } -#line 2643 "parse.c" /* yacc.c:1646 */ +#line 2648 "parse.c" /* yacc.c:1646 */ break; - case 210: -#line 1234 "grammar" /* yacc.c:1646 */ + case 213: +#line 1243 "grammar" /* yacc.c:1646 */ { (yyval) = *p_catCode(&(yyvsp[-2]), &(yyvsp[0])); /* catenate variable */ /* initialization code */ } -#line 2652 "parse.c" /* yacc.c:1646 */ +#line 2657 "parse.c" /* yacc.c:1646 */ break; - case 212: -#line 1244 "grammar" /* yacc.c:1646 */ + case 215: +#line 1253 "grammar" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } -#line 2660 "parse.c" /* yacc.c:1646 */ +#line 2665 "parse.c" /* yacc.c:1646 */ break; - case 214: -#line 1262 "grammar" /* yacc.c:1646 */ + case 217: +#line 1271 "grammar" /* yacc.c:1646 */ { (yyval) = *p_while(&(yyvsp[-4]), &(yyvsp[-1]), 1); } -#line 2668 "parse.c" /* yacc.c:1646 */ +#line 2673 "parse.c" /* yacc.c:1646 */ break; - case 215: -#line 1267 "grammar" /* yacc.c:1646 */ + case 218: +#line 1276 "grammar" /* yacc.c:1646 */ { (yyval) = *p_stackFrame(0); /* by default initializes a variable to 0 */ } -#line 2676 "parse.c" /* yacc.c:1646 */ +#line 2681 "parse.c" /* yacc.c:1646 */ break; -#line 2680 "parse.c" /* yacc.c:1646 */ +#line 2685 "parse.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -2904,7 +2909,7 @@ #endif return yyresult; } -#line 1272 "grammar" /* yacc.c:1906 */ +#line 1281 "grammar" /* yacc.c:1906 */ int yywrap(void) diff -Nru icmake-8.00.05/icm-comp/parser/pcallfun.c icmake-8.01.00/icm-comp/parser/pcallfun.c --- icmake-8.00.05/icm-comp/parser/pcallfun.c 2015-12-17 17:45:55.000000000 +0000 +++ icmake-8.01.00/icm-comp/parser/pcallfun.c 2016-02-01 14:36:51.000000000 +0000 @@ -1,3 +1,4 @@ +#define msgx #include "parser.ih" SemVal *p_callFunction(int funIdx, SemVal *e) @@ -30,7 +31,7 @@ return e; /* nothing to do here */ nParams = symtab_fun_nParams(funIdx); /* then check correct # of args */ - + if ((unsigned)e->type == nParams) p_checkArgumentTypes(nParams, funIdx, (SemVal *)e->code); else diff -Nru icmake-8.00.05/icm-comp/parser/pcallrss.c icmake-8.01.00/icm-comp/parser/pcallrss.c --- icmake-8.00.05/icm-comp/parser/pcallrss.c 2015-12-17 17:45:55.000000000 +0000 +++ icmake-8.01.00/icm-comp/parser/pcallrss.c 2016-02-01 14:36:51.000000000 +0000 @@ -49,9 +49,11 @@ type = e_list | e_reg; break; /* 2 arguments, returning int */ + case f_listfind: case f_strfind: + case f_strchr: case f_system: - args++; + ++args; break; /* 2 args, returning string */ case f_chdir: @@ -61,10 +63,11 @@ case f_str_el: case f_element: case f_resize: - args++; /* two arguments */ + ++args; /* two arguments */ type = e_str | e_reg; /* returning string */ break; + /* 3 args, returning string */ case f_substr: args = 3; /* three arguments */ @@ -72,11 +75,12 @@ break; /* 2 args, returning list */ + case f_listunion: case f_stat: case f_fgets: /* list fgets(string, int) */ case f_strtok: /* list strtok(string, string) */ case f_makelist: /* list p_makeList(int, string) */ - args++; + ++args; type = e_list | e_reg; break; /* # args passed as argument */ diff -Nru icmake-8.00.05/icm-comp/parser/pcheckargumenttypes.c icmake-8.01.00/icm-comp/parser/pcheckargumenttypes.c --- icmake-8.00.05/icm-comp/parser/pcheckargumenttypes.c 2015-12-17 17:45:55.000000000 +0000 +++ icmake-8.01.00/icm-comp/parser/pcheckargumenttypes.c 2016-02-01 14:36:51.000000000 +0000 @@ -1,15 +1,17 @@ -#define msg +#define msgx #include "parser.ih" -void p_checkArgumentTypes(unsigned nParams, unsigned funIdx, SemVal *a) +void p_checkArgumentTypes(unsigned nParams, unsigned funIdx, SemVal *args) { register unsigned idx; - for (idx = 0; idx != nParams; ++idx, ++a) + msg("checking %d parameters", nParams); + + for (idx = 0; idx != nParams; ++idx, ++args) { - if (symtab_funParameterType(funIdx, idx) != (a->type & e_typeMask)) + if (symtab_funParameterType(funIdx, idx) != (args->type & e_typeMask)) util_semantic("Function `%s', argument %u: type mismatch", - idx + 1, symtab_funName(funIdx)); + symtab_funName(funIdx), idx + 1); } } diff -Nru icmake-8.00.05/icm-comp/parser/pcompoundass.c icmake-8.01.00/icm-comp/parser/pcompoundass.c --- icmake-8.00.05/icm-comp/parser/pcompoundass.c 1970-01-01 00:00:00.000000000 +0000 +++ icmake-8.01.00/icm-comp/parser/pcompoundass.c 2016-02-01 14:36:51.000000000 +0000 @@ -0,0 +1,21 @@ +#include "parser.ih" + +SemVal *p_compoundAss(SemVal *lval, SemVal *rval, + SemVal *(*fun)(SemVal *, SemVal *), + char *opstr) +{ + register ExprType ltype; + register unsigned evalue; + + ltype = lval->type; + evalue = lval->evalue; + + fun(lval, rval); /* perform operation */ + + rval->type = ltype; /* restore ltype/value */ + rval->evalue = evalue; + rval->codelen = 0; + rval->code = NULL; + + return p_assignment(rval, lval, opstr); /* perform p_assignment */ +} diff -Nru icmake-8.00.05/icm-comp/parser/pexpr2stack.c icmake-8.01.00/icm-comp/parser/pexpr2stack.c --- icmake-8.00.05/icm-comp/parser/pexpr2stack.c 2015-12-17 17:45:55.000000000 +0000 +++ icmake-8.01.00/icm-comp/parser/pexpr2stack.c 2016-02-01 14:36:51.000000000 +0000 @@ -1,3 +1,5 @@ +#define msgx + /* Push an expression value on the stack */ diff -Nru icmake-8.00.05/icm-comp/parser/pmathass.c icmake-8.01.00/icm-comp/parser/pmathass.c --- icmake-8.00.05/icm-comp/parser/pmathass.c 2015-12-17 17:45:55.000000000 +0000 +++ icmake-8.01.00/icm-comp/parser/pmathass.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -#include "parser.ih" - -SemVal *p_compoundAss(SemVal *lval, SemVal *rval, - SemVal *(*fun)(SemVal *, SemVal *), - char *opstr) -{ - register ExprType - ltype; - register unsigned - evalue; - - ltype = lval->type; - evalue = lval->evalue; - - fun(lval, rval); /* perform operation */ - - rval->type = ltype; /* restore ltype/value */ - rval->evalue = evalue; - rval->codelen = 0; - rval->code = NULL; - - return p_assignment(rval, lval, opstr); /* perform p_assignment */ -} diff -Nru icmake-8.00.05/icm-comp/parser/preturn.c icmake-8.01.00/icm-comp/parser/preturn.c --- icmake-8.00.05/icm-comp/parser/preturn.c 2015-12-17 17:45:55.000000000 +0000 +++ icmake-8.01.00/icm-comp/parser/preturn.c 2016-02-01 14:36:51.000000000 +0000 @@ -1,17 +1,16 @@ - - -/* #define msg -*/ +#define msgx #include "parser.ih" SemVal *p_return(ExprType op, SemVal *e) { - msg("BEGIN"); + msg("BEGIN 0x%x", e->type); - if (!test_type(e, e_stack)) + if (test_type(e, e_bool) || !test_type(e, e_stack)) p_expr2stack(e); + msg("NEXT 0x%x", e->type); + unsigned funIdx = symtab_lastFunction(); if ((Opcode)op == op_ret) /* return opcode received */ @@ -40,7 +39,7 @@ symtab_funName(funIdx)); } - msg("poping the pushed return value and returning"); + msg("popping the pushed return value and returning"); p_generateCode(e, op_pop_reg); p_generateCode(e, op); diff -Nru icmake-8.00.05/icm-comp/parser/pternary.c icmake-8.01.00/icm-comp/parser/pternary.c --- icmake-8.00.05/icm-comp/parser/pternary.c 2015-12-17 17:45:55.000000000 +0000 +++ icmake-8.01.00/icm-comp/parser/pternary.c 2016-02-01 14:36:51.000000000 +0000 @@ -23,11 +23,11 @@ return ifFalse; } + p_expr2bool(cond); /* convert the condition to bool */ p_expr2stack(ifTrue); /* convert the expressions to code */ p_expr2stack(ifFalse); - p_generateCode(cond, op_jmp_false, j_falselist); /* jmp around ifTrue */ p_patchupTrue(cond, 1); /* destination for the ifTrue code */ p_catCode(cond, ifTrue); /* cond = cond + ifTrue */ @@ -38,6 +38,9 @@ p_patchupTrue(cond, 1); /* jump from ifTrue to the end of expr. */ + set_type(cond, ifTrue->type); /* return type must be the ifTrue/ifFalse + type */ + return cond; /* ?: return */ } diff -Nru icmake-8.00.05/icm-comp/parser/ptwoargs.c icmake-8.01.00/icm-comp/parser/ptwoargs.c --- icmake-8.00.05/icm-comp/parser/ptwoargs.c 2015-12-17 17:45:55.000000000 +0000 +++ icmake-8.01.00/icm-comp/parser/ptwoargs.c 2016-02-01 14:36:51.000000000 +0000 @@ -32,8 +32,17 @@ ok = test_type(larg, e_str) && test_type(rarg, e_int); break; + case f_listfind: + ok = test_type(larg, e_list) && test_type(rarg, e_str); + break; + + case f_listunion: + ok = test_type(larg, e_list) && test_type(rarg, e_str | e_list); + break; + default: /* + case f_strchr: case f_strtok: case f_c_ext: case f_c_base: @@ -43,6 +52,8 @@ ok = larg->type & rarg->type & e_str; } + msg("types test %d, funstring: %x", ok, type); + if (ok) { p_catCode(rarg, larg); /* make one code vector */ diff -Nru icmake-8.00.05/icm-comp/parser/tokens.h icmake-8.01.00/icm-comp/parser/tokens.h --- icmake-8.00.05/icm-comp/parser/tokens.h 2015-12-17 17:45:55.000000000 +0000 +++ icmake-8.01.00/icm-comp/parser/tokens.h 2016-02-01 14:36:51.000000000 +0000 @@ -79,51 +79,54 @@ IF = 289, INT = 290, LIST = 291, - LISTLEN = 292, - MAKELIST = 293, - ECHO_TOKEN = 294, - NUMBER = 295, - PRINTF = 296, - PUTENV = 297, - RETURN = 298, - STAT = 299, - STRING = 300, - STRINGTYPE = 301, - STRLEN = 302, - STRLWR = 303, - RESIZE = 304, - STRUPR = 305, - STRFIND = 306, - STRFORMAT = 307, - SUBSTR = 308, - SYSTEM = 309, - TRIM = 310, - TRIMLEFT = 311, - TRIMRIGHT = 312, - VOID = 313, - WHILE = 314, - AND_IS = 315, - OR_IS = 316, - XOR_IS = 317, - SHL_IS = 318, - SHR_IS = 319, - DIV_IS = 320, - MINUS_IS = 321, - MUL_IS = 322, - MOD_IS = 323, - PLUS_IS = 324, - OR = 325, - AND = 326, - EQUAL = 327, - NOT_EQUAL = 328, - SMALLER_EQUAL = 329, - GREATER_EQUAL = 330, - OLDER = 331, - YOUNGER = 332, - SHL = 333, - SHR = 334, - INC = 335, - DEC = 336 + LISTFIND = 292, + LISTLEN = 293, + LISTUNION = 294, + MAKELIST = 295, + ECHO_TOKEN = 296, + NUMBER = 297, + PRINTF = 298, + PUTENV = 299, + RETURN = 300, + STAT = 301, + STRCHR = 302, + STRING = 303, + STRINGTYPE = 304, + STRLEN = 305, + STRLWR = 306, + RESIZE = 307, + STRUPR = 308, + STRFIND = 309, + STRFORMAT = 310, + SUBSTR = 311, + SYSTEM = 312, + TRIM = 313, + TRIMLEFT = 314, + TRIMRIGHT = 315, + VOID = 316, + WHILE = 317, + AND_IS = 318, + OR_IS = 319, + XOR_IS = 320, + SHL_IS = 321, + SHR_IS = 322, + DIV_IS = 323, + MINUS_IS = 324, + MUL_IS = 325, + MOD_IS = 326, + PLUS_IS = 327, + OR = 328, + AND = 329, + EQUAL = 330, + NOT_EQUAL = 331, + SMALLER_EQUAL = 332, + GREATER_EQUAL = 333, + OLDER = 334, + YOUNGER = 335, + SHL = 336, + SHR = 337, + INC = 338, + DEC = 339 }; #endif diff -Nru icmake-8.00.05/icm-comp/scanner/lexer icmake-8.01.00/icm-comp/scanner/lexer --- icmake-8.00.05/icm-comp/scanner/lexer 2015-12-17 17:45:55.000000000 +0000 +++ icmake-8.01.00/icm-comp/scanner/lexer 2016-02-01 14:36:51.000000000 +0000 @@ -214,6 +214,21 @@ yylval.type = e_list; return LIST; } +listfind { + yylval.type = f_listfind; + return LISTFIND; + } +listunion { + yylval.type = f_listunion; + return LISTUNION; + } +listlen | +sizeof | +sizeoflist { + sc_saveInfo(); + yylval.type = f_listlen; + return LISTLEN; + } makelist { yylval.type = f_makelist; return MAKELIST; @@ -239,17 +254,14 @@ yylval.type = op_ret; return RETURN; } -listlen | -sizeof | -sizeoflist { - sc_saveInfo(); - yylval.type = f_listlen; - return LISTLEN; - } stat { yylval.type = f_stat; return STAT; } +strchr { + yylval.type = f_strchr; + return STRCHR; + } string { yylval.type = e_str; return STRINGTYPE; @@ -366,16 +378,6 @@ "<<" { return SHL; } -0x[0-9A-Fa-f]+ { - unsigned value; - sscanf(yytext + 2, "%x", &value); - util_printf("%d", (int)value); - return NUMBER; - } -[0-9]+ { - util_setString(yytext); - return NUMBER; - } OFF | P_CHECK { util_setString("0"); diff -Nru icmake-8.00.05/icm-comp/scanner/lexer.c icmake-8.01.00/icm-comp/scanner/lexer.c --- icmake-8.00.05/icm-comp/scanner/lexer.c 2015-12-17 17:45:55.000000000 +0000 +++ icmake-8.01.00/icm-comp/scanner/lexer.c 2016-02-01 14:36:51.000000000 +0000 @@ -368,8 +368,8 @@ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 116 -#define YY_END_OF_BUFFER 117 +#define YY_NUM_RULES 117 +#define YY_END_OF_BUFFER 118 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -377,52 +377,53 @@ flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[396] = +static yyconst flex_int16_t yy_accept[407] = { 0, - 0, 0, 0, 0, 117, 115, 6, 7, 115, 18, - 115, 115, 115, 115, 115, 115, 115, 16, 15, 115, - 115, 115, 114, 114, 114, 114, 115, 114, 114, 114, - 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, - 114, 114, 114, 114, 114, 115, 115, 2, 116, 1, - 2, 93, 83, 91, 85, 0, 0, 82, 78, 84, - 79, 81, 80, 16, 99, 0, 15, 97, 94, 92, - 95, 96, 114, 114, 104, 114, 114, 114, 87, 114, - 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, - 114, 114, 114, 49, 114, 114, 114, 114, 114, 114, - - 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, - 86, 90, 10, 0, 9, 5, 5, 5, 11, 0, - 11, 0, 0, 17, 88, 89, 100, 114, 114, 114, - 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, - 114, 114, 114, 114, 114, 114, 114, 114, 47, 114, - 114, 51, 114, 114, 114, 114, 114, 114, 114, 114, - 114, 114, 114, 114, 114, 114, 114, 114, 114, 8, - 9, 0, 0, 14, 0, 0, 114, 114, 114, 114, - 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, - 114, 114, 114, 114, 114, 38, 114, 40, 41, 42, - - 114, 45, 114, 114, 114, 114, 114, 114, 37, 52, - 114, 114, 114, 114, 114, 114, 114, 114, 62, 114, - 114, 114, 114, 114, 114, 114, 72, 50, 114, 114, - 4, 3, 0, 0, 111, 107, 114, 114, 114, 114, - 114, 114, 114, 114, 114, 114, 114, 114, 21, 22, - 114, 23, 114, 114, 114, 114, 114, 114, 46, 114, - 114, 114, 114, 114, 35, 114, 114, 114, 114, 76, - 54, 114, 114, 114, 114, 114, 114, 114, 114, 114, - 114, 114, 114, 114, 114, 114, 114, 75, 114, 12, - 13, 103, 114, 114, 114, 114, 114, 114, 114, 114, - - 114, 114, 114, 114, 114, 114, 114, 114, 114, 44, - 114, 114, 114, 114, 114, 48, 36, 114, 114, 55, - 56, 57, 58, 60, 114, 114, 63, 64, 65, 67, - 66, 70, 71, 114, 114, 114, 114, 101, 114, 113, - 105, 102, 108, 110, 114, 19, 20, 114, 25, 24, - 114, 39, 43, 30, 114, 114, 32, 114, 59, 114, - 114, 68, 114, 114, 114, 77, 109, 114, 112, 114, - 114, 114, 29, 31, 33, 34, 53, 114, 114, 73, - 114, 106, 114, 114, 114, 114, 69, 74, 114, 27, - 114, 61, 26, 28, 0 + 0, 0, 0, 0, 118, 116, 6, 7, 116, 18, + 116, 116, 116, 116, 116, 116, 116, 16, 15, 116, + 116, 116, 115, 115, 115, 115, 116, 115, 115, 115, + 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, + 115, 115, 115, 115, 115, 116, 116, 2, 117, 1, + 2, 96, 86, 94, 88, 0, 0, 85, 81, 87, + 82, 84, 83, 16, 0, 15, 100, 97, 95, 98, + 99, 115, 115, 105, 115, 115, 115, 90, 115, 115, + 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, + 115, 115, 49, 115, 115, 115, 115, 115, 115, 115, + + 115, 115, 115, 115, 115, 115, 115, 115, 115, 89, + 93, 10, 0, 9, 5, 5, 5, 11, 0, 11, + 0, 0, 17, 91, 92, 101, 115, 115, 115, 115, + 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, + 115, 115, 115, 115, 115, 115, 115, 47, 115, 115, + 51, 115, 115, 115, 115, 115, 115, 115, 115, 115, + 115, 115, 115, 115, 115, 115, 115, 115, 8, 9, + 0, 0, 14, 0, 0, 115, 115, 115, 115, 115, + 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, + 115, 115, 115, 115, 38, 115, 40, 41, 42, 115, + + 45, 115, 115, 115, 115, 115, 115, 37, 52, 115, + 115, 115, 115, 115, 115, 115, 115, 64, 115, 115, + 115, 115, 115, 115, 115, 115, 75, 50, 115, 115, + 4, 3, 0, 0, 112, 108, 115, 115, 115, 115, + 115, 115, 115, 115, 115, 115, 115, 115, 21, 22, + 115, 23, 115, 115, 115, 115, 115, 115, 46, 115, + 115, 115, 115, 115, 35, 115, 115, 115, 115, 115, + 115, 79, 59, 115, 115, 115, 115, 115, 115, 115, + 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, + 78, 115, 12, 13, 104, 115, 115, 115, 115, 115, + + 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, + 115, 115, 44, 115, 115, 115, 115, 115, 48, 36, + 115, 115, 115, 115, 60, 61, 62, 63, 56, 65, + 115, 115, 66, 67, 68, 70, 69, 73, 74, 115, + 115, 115, 115, 102, 115, 114, 106, 103, 109, 111, + 115, 19, 20, 115, 25, 24, 115, 39, 43, 30, + 115, 115, 32, 115, 115, 55, 115, 115, 115, 71, + 115, 115, 115, 80, 110, 115, 113, 115, 115, 115, + 29, 31, 33, 34, 53, 115, 58, 115, 115, 76, + 115, 107, 115, 115, 115, 54, 115, 72, 77, 115, + 27, 115, 57, 26, 28, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -468,105 +469,107 @@ 5, 5, 5, 5, 5, 5, 5, 1 } ; -static yyconst flex_int16_t yy_base[407] = +static yyconst flex_int16_t yy_base[418] = { 0, - 0, 458, 66, 67, 463, 465, 465, 465, 444, 465, - 443, 65, 419, 441, 63, 64, 440, 63, 70, 70, - 439, 71, 0, 66, 413, 412, 436, 33, 394, 44, - 48, 46, 404, 56, 399, 406, 401, 394, 38, 399, - 54, 387, 388, 393, 386, 57, 107, 465, 465, 465, - 103, 465, 465, 465, 465, 433, 115, 465, 465, 465, - 465, 465, 465, 117, 120, 0, 123, 423, 465, 465, - 465, 422, 0, 414, 0, 120, 119, 410, 465, 387, - 390, 387, 100, 387, 377, 381, 94, 387, 98, 382, - 370, 369, 366, 0, 365, 365, 371, 359, 375, 369, - - 359, 88, 352, 108, 373, 357, 364, 363, 362, 351, - 465, 465, 465, 150, 0, 465, 143, 0, 465, 403, - 402, 146, 401, 0, 465, 465, 0, 378, 380, 379, - 368, 378, 371, 138, 108, 351, 358, 345, 348, 120, - 338, 341, 342, 348, 341, 348, 114, 332, 0, 340, - 136, 0, 330, 342, 341, 340, 331, 338, 333, 322, - 335, 321, 136, 321, 319, 324, 331, 323, 320, 465, - 0, 172, 0, 465, 177, 0, 344, 339, 342, 351, - 347, 348, 329, 177, 344, 332, 318, 321, 312, 310, - 312, 302, 312, 315, 306, 0, 309, 0, 0, 294, - - 294, 0, 294, 297, 156, 301, 295, 298, 0, 295, - 294, 288, 287, 284, 288, 276, 283, 284, 0, 62, - 284, 141, 282, 280, 276, 288, 124, 0, 287, 284, - 465, 465, 324, 323, 0, 0, 307, 307, 307, 301, - 303, 299, 297, 300, 303, 294, 277, 268, 0, 0, - 271, 0, 274, 265, 260, 259, 253, 253, 0, 251, - 267, 262, 244, 264, 0, 244, 259, 257, 252, 0, - 0, 254, 239, 253, 244, 250, 242, 238, 246, 239, - 235, 240, 233, 232, 235, 241, 236, 0, 239, 465, - 465, 0, 258, 255, 260, 261, 247, 246, 254, 256, - - 241, 230, 222, 232, 227, 219, 210, 210, 222, 0, - 220, 208, 202, 205, 204, 0, 0, 208, 203, 0, - 0, 0, 0, 208, 214, 205, 0, 0, 0, 0, - 0, 0, 0, 210, 208, 198, 221, 0, 233, 0, - 0, 0, 0, 0, 230, 0, 0, 161, 0, 0, - 205, 0, 0, 0, 204, 190, 0, 199, 0, 188, - 191, 0, 194, 172, 175, 0, 0, 188, 0, 173, - 151, 171, 0, 0, 0, 0, 0, 153, 150, 0, - 149, 0, 148, 146, 141, 134, 0, 0, 145, 0, - 125, 0, 0, 0, 465, 219, 224, 226, 231, 236, + 0, 465, 66, 67, 470, 472, 472, 472, 451, 472, + 450, 65, 426, 448, 63, 64, 447, 63, 70, 62, + 446, 69, 0, 66, 420, 419, 443, 30, 401, 42, + 48, 46, 411, 56, 406, 413, 408, 401, 33, 406, + 54, 394, 395, 400, 393, 57, 107, 472, 472, 472, + 86, 472, 472, 472, 472, 440, 115, 472, 472, 472, + 472, 472, 472, 103, 0, 117, 430, 472, 472, 472, + 429, 0, 421, 0, 114, 113, 417, 472, 394, 397, + 394, 94, 394, 384, 388, 88, 394, 92, 389, 377, + 376, 373, 0, 372, 372, 378, 366, 382, 376, 366, + + 82, 359, 102, 380, 364, 371, 370, 369, 358, 472, + 472, 472, 144, 0, 472, 138, 0, 472, 410, 409, + 140, 408, 0, 472, 472, 0, 385, 387, 386, 375, + 385, 378, 132, 111, 358, 365, 352, 355, 112, 345, + 348, 349, 355, 348, 355, 104, 339, 0, 347, 131, + 0, 337, 349, 348, 347, 338, 345, 340, 329, 342, + 328, 132, 328, 326, 331, 338, 330, 327, 472, 0, + 154, 0, 472, 161, 0, 351, 346, 349, 358, 354, + 355, 336, 160, 351, 339, 325, 328, 319, 317, 319, + 309, 319, 322, 313, 0, 316, 0, 0, 301, 301, + + 0, 301, 304, 140, 308, 302, 305, 0, 65, 302, + 296, 295, 292, 296, 284, 291, 292, 0, 297, 140, + 291, 142, 289, 287, 283, 295, 142, 0, 294, 291, + 472, 472, 331, 330, 0, 0, 314, 314, 314, 308, + 310, 306, 304, 307, 310, 301, 284, 275, 0, 0, + 278, 0, 281, 272, 267, 266, 260, 260, 0, 258, + 274, 269, 251, 271, 0, 251, 266, 260, 263, 254, + 257, 0, 0, 259, 244, 258, 249, 255, 244, 246, + 242, 250, 243, 239, 244, 237, 236, 239, 245, 240, + 0, 243, 472, 472, 0, 262, 259, 264, 265, 251, + + 250, 258, 260, 245, 234, 226, 236, 231, 223, 214, + 214, 226, 0, 224, 212, 206, 209, 208, 0, 0, + 212, 211, 214, 205, 0, 0, 0, 0, 210, 0, + 216, 207, 0, 0, 0, 0, 0, 0, 0, 212, + 210, 200, 223, 0, 235, 0, 0, 0, 0, 0, + 232, 0, 0, 154, 0, 0, 207, 0, 0, 0, + 206, 192, 0, 201, 204, 0, 193, 188, 196, 0, + 203, 185, 194, 0, 0, 214, 0, 199, 177, 192, + 0, 0, 0, 0, 0, 175, 0, 166, 158, 0, + 150, 0, 150, 148, 147, 0, 146, 0, 0, 157, - 168, 241, 166, 244, 123, 76 + 0, 153, 0, 0, 0, 472, 212, 217, 219, 224, + 229, 199, 234, 196, 237, 166, 162 } ; -static yyconst flex_int16_t yy_def[407] = +static yyconst flex_int16_t yy_def[418] = { 0, - 395, 1, 396, 396, 395, 395, 395, 395, 395, 395, - 395, 395, 397, 395, 395, 395, 395, 395, 395, 395, - 395, 395, 398, 398, 398, 398, 395, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 395, 395, 395, 395, 395, - 399, 395, 395, 395, 395, 395, 400, 395, 395, 395, - 395, 395, 395, 395, 395, 401, 395, 395, 395, 395, - 395, 395, 398, 398, 398, 398, 398, 398, 395, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 395, 395, 395, 395, 402, 395, 395, 403, 395, 395, - 395, 395, 404, 401, 395, 395, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 395, - 402, 395, 405, 395, 395, 406, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 395, 395, 395, 395, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 395, - 395, 398, 398, 398, 398, 398, 398, 398, 398, 398, - - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 398, 398, 398, 398, 398, 398, - 398, 398, 398, 398, 0, 395, 395, 395, 395, 395, + 406, 1, 407, 407, 406, 406, 406, 406, 406, 406, + 406, 406, 408, 406, 406, 406, 406, 406, 406, 406, + 406, 406, 409, 409, 409, 409, 406, 409, 409, 409, + 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, + 409, 409, 409, 409, 409, 406, 406, 406, 406, 406, + 410, 406, 406, 406, 406, 406, 411, 406, 406, 406, + 406, 406, 406, 406, 412, 406, 406, 406, 406, 406, + 406, 409, 409, 409, 409, 409, 409, 406, 409, 409, + 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, + 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, + + 409, 409, 409, 409, 409, 409, 409, 409, 409, 406, + 406, 406, 406, 413, 406, 406, 414, 406, 406, 406, + 406, 415, 412, 406, 406, 409, 409, 409, 409, 409, + 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, + 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, + 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, + 409, 409, 409, 409, 409, 409, 409, 409, 406, 413, + 406, 416, 406, 406, 417, 409, 409, 409, 409, 409, + 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, + 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, + + 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, + 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, + 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, + 406, 406, 406, 406, 409, 409, 409, 409, 409, 409, + 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, + 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, + 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, + 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, + 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, + 409, 409, 406, 406, 409, 409, 409, 409, 409, 409, + + 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, + 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, + 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, + 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, + 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, + 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, + 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, + 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, + 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, + 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, - 395, 395, 395, 395, 395, 395 + 409, 409, 409, 409, 409, 0, 406, 406, 406, 406, + 406, 406, 406, 406, 406, 406, 406 } ; -static yyconst flex_int16_t yy_nxt[534] = +static yyconst flex_int16_t yy_nxt[541] = { 0, 6, 7, 8, 9, 10, 6, 11, 12, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 23, @@ -575,61 +578,61 @@ 6, 27, 23, 28, 29, 30, 23, 31, 32, 33, 23, 34, 23, 35, 36, 37, 38, 39, 40, 41, 42, 23, 43, 44, 23, 45, 23, 46, 49, 49, - 50, 50, 54, 59, 111, 61, 64, 64, 65, 234, - 60, 62, 55, 67, 67, 67, 68, 69, 71, 72, - 74, 80, 81, 86, 83, 90, 100, 75, 84, 101, - - 85, 87, 91, 92, 94, 103, 51, 51, 76, 113, - 88, 95, 89, 277, 104, 105, 117, 117, 278, 106, - 114, 114, 114, 121, 112, 115, 232, 66, 122, 122, - 64, 64, 65, 65, 65, 65, 67, 67, 67, 128, - 132, 143, 129, 138, 130, 146, 139, 159, 160, 147, - 133, 162, 170, 144, 174, 131, 172, 172, 187, 175, - 175, 183, 184, 114, 114, 114, 163, 118, 188, 173, - 193, 124, 185, 201, 202, 394, 186, 286, 205, 123, - 194, 206, 287, 207, 220, 231, 231, 221, 280, 222, - 233, 233, 393, 208, 392, 209, 223, 224, 242, 243, - - 261, 391, 262, 263, 281, 370, 390, 389, 371, 388, - 387, 244, 386, 264, 385, 384, 383, 382, 372, 48, - 48, 48, 48, 48, 56, 381, 56, 56, 56, 73, - 73, 116, 380, 116, 116, 116, 120, 379, 120, 120, - 120, 171, 378, 171, 171, 171, 176, 176, 377, 376, - 375, 374, 373, 369, 368, 367, 366, 365, 364, 363, + 50, 50, 54, 59, 110, 61, 64, 64, 67, 68, + 60, 62, 55, 66, 66, 66, 70, 71, 79, 80, + 73, 99, 82, 85, 100, 89, 83, 74, 84, 116, + + 116, 86, 90, 91, 93, 102, 51, 51, 75, 112, + 87, 94, 88, 268, 103, 104, 64, 64, 269, 105, + 113, 113, 113, 120, 111, 114, 270, 65, 121, 121, + 66, 66, 66, 127, 131, 142, 128, 137, 129, 145, + 138, 158, 159, 146, 132, 161, 169, 143, 173, 130, + 117, 171, 171, 174, 174, 182, 183, 113, 113, 113, + 162, 186, 192, 200, 201, 234, 184, 231, 231, 232, + 185, 187, 193, 204, 233, 233, 205, 219, 206, 122, + 220, 242, 243, 221, 261, 222, 262, 263, 207, 283, + 208, 280, 223, 224, 244, 289, 281, 264, 378, 172, + + 290, 379, 123, 405, 404, 284, 403, 402, 401, 400, + 399, 380, 48, 48, 48, 48, 48, 56, 398, 56, + 56, 56, 72, 72, 115, 397, 115, 115, 115, 119, + 396, 119, 119, 119, 170, 395, 170, 170, 170, 175, + 175, 394, 393, 392, 391, 390, 389, 388, 387, 386, + 385, 384, 383, 382, 381, 377, 376, 375, 374, 373, + 372, 371, 370, 369, 368, 367, 366, 365, 364, 363, 362, 361, 360, 359, 358, 357, 356, 355, 354, 353, 352, 351, 350, 349, 348, 347, 346, 345, 344, 343, 342, 341, 340, 339, 338, 337, 336, 335, 334, 333, - 332, 331, 330, 329, 328, 327, 326, 325, 324, 323, + 332, 331, 330, 329, 328, 327, 326, 325, 324, 323, 322, 321, 320, 319, 318, 317, 316, 315, 314, 313, 312, 311, 310, 309, 308, 307, 306, 305, 304, 303, 302, 301, 300, 299, 298, 297, 296, 295, 294, 293, - 292, 291, 290, 289, 288, 285, 284, 283, 282, 279, - 276, 275, 274, 273, 272, 271, 270, 269, 268, 267, - 266, 265, 260, 259, 258, 257, 256, 255, 254, 253, - 252, 251, 250, 249, 248, 247, 246, 245, 241, 240, - 239, 238, 237, 236, 235, 230, 229, 228, 227, 226, - 225, 219, 218, 217, 216, 215, 214, 213, 212, 211, - 210, 204, 203, 200, 199, 198, 197, 196, 195, 192, - - 191, 190, 189, 182, 181, 180, 179, 178, 177, 174, - 174, 174, 169, 168, 167, 166, 165, 164, 161, 158, - 157, 156, 155, 154, 153, 152, 151, 150, 149, 148, - 145, 142, 141, 140, 137, 136, 135, 134, 127, 126, - 125, 119, 110, 109, 108, 107, 102, 99, 98, 97, - 96, 93, 82, 79, 78, 77, 70, 63, 58, 57, - 53, 52, 395, 47, 5, 395, 395, 395, 395, 395, - 395, 395, 395, 395, 395, 395, 395, 395, 395, 395, - 395, 395, 395, 395, 395, 395, 395, 395, 395, 395, - 395, 395, 395, 395, 395, 395, 395, 395, 395, 395, - - 395, 395, 395, 395, 395, 395, 395, 395, 395, 395, - 395, 395, 395, 395, 395, 395, 395, 395, 395, 395, - 395, 395, 395, 395, 395, 395, 395, 395, 395, 395, - 395, 395, 395 + 292, 291, 288, 287, 286, 285, 282, 279, 278, 277, + 276, 275, 274, 273, 272, 271, 267, 266, 265, 260, + 259, 258, 257, 256, 255, 254, 253, 252, 251, 250, + 249, 248, 247, 246, 245, 241, 240, 239, 238, 237, + 236, 235, 230, 229, 228, 227, 226, 225, 218, 217, + 216, 215, 214, 213, 212, 211, 210, 209, 203, 202, + + 199, 198, 197, 196, 195, 194, 191, 190, 189, 188, + 181, 180, 179, 178, 177, 176, 173, 173, 173, 168, + 167, 166, 165, 164, 163, 160, 157, 156, 155, 154, + 153, 152, 151, 150, 149, 148, 147, 144, 141, 140, + 139, 136, 135, 134, 133, 126, 125, 124, 118, 109, + 108, 107, 106, 101, 98, 97, 96, 95, 92, 81, + 78, 77, 76, 69, 63, 58, 57, 53, 52, 406, + 47, 5, 406, 406, 406, 406, 406, 406, 406, 406, + 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, + 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, + + 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, + 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, + 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, + 406, 406, 406, 406, 406, 406, 406, 406, 406, 406 } ; -static yyconst flex_int16_t yy_chk[534] = +static yyconst flex_int16_t yy_chk[541] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -638,58 +641,58 @@ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 4, - 3, 4, 12, 15, 46, 16, 18, 18, 18, 406, - 15, 16, 12, 19, 19, 19, 20, 20, 22, 22, - 24, 28, 28, 31, 30, 32, 39, 24, 30, 39, - - 30, 31, 32, 32, 34, 41, 3, 4, 24, 47, - 31, 34, 31, 220, 41, 41, 51, 51, 220, 41, - 47, 47, 47, 57, 46, 47, 405, 18, 57, 57, - 64, 64, 64, 65, 65, 65, 67, 67, 67, 76, - 77, 87, 76, 83, 76, 89, 83, 102, 102, 89, - 77, 104, 114, 87, 122, 76, 117, 117, 135, 122, - 122, 134, 134, 114, 114, 114, 104, 51, 135, 403, - 140, 401, 134, 147, 147, 391, 134, 227, 151, 57, - 140, 151, 227, 151, 163, 172, 172, 163, 222, 163, - 175, 175, 389, 151, 386, 151, 163, 163, 184, 184, - - 205, 385, 205, 205, 222, 348, 384, 383, 348, 381, - 379, 184, 378, 205, 372, 371, 370, 368, 348, 396, - 396, 396, 396, 396, 397, 365, 397, 397, 397, 398, - 398, 399, 364, 399, 399, 399, 400, 363, 400, 400, - 400, 402, 361, 402, 402, 402, 404, 404, 360, 358, - 356, 355, 351, 345, 339, 337, 336, 335, 334, 326, - 325, 324, 319, 318, 315, 314, 313, 312, 311, 309, - 308, 307, 306, 305, 304, 303, 302, 301, 300, 299, - 298, 297, 296, 295, 294, 293, 289, 287, 286, 285, - 284, 283, 282, 281, 280, 279, 278, 277, 276, 275, - - 274, 273, 272, 269, 268, 267, 266, 264, 263, 262, - 261, 260, 258, 257, 256, 255, 254, 253, 251, 248, - 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, - 237, 234, 233, 230, 229, 226, 225, 224, 223, 221, - 218, 217, 216, 215, 214, 213, 212, 211, 210, 208, - 207, 206, 204, 203, 201, 200, 197, 195, 194, 193, - 192, 191, 190, 189, 188, 187, 186, 185, 183, 182, - 181, 180, 179, 178, 177, 169, 168, 167, 166, 165, - 164, 162, 161, 160, 159, 158, 157, 156, 155, 154, - 153, 150, 148, 146, 145, 144, 143, 142, 141, 139, - - 138, 137, 136, 133, 132, 131, 130, 129, 128, 123, - 121, 120, 110, 109, 108, 107, 106, 105, 103, 101, - 100, 99, 98, 97, 96, 95, 93, 92, 91, 90, - 88, 86, 85, 84, 82, 81, 80, 78, 74, 72, - 68, 56, 45, 44, 43, 42, 40, 38, 37, 36, - 35, 33, 29, 27, 26, 25, 21, 17, 14, 13, - 11, 9, 5, 2, 395, 395, 395, 395, 395, 395, - 395, 395, 395, 395, 395, 395, 395, 395, 395, 395, - 395, 395, 395, 395, 395, 395, 395, 395, 395, 395, - 395, 395, 395, 395, 395, 395, 395, 395, 395, 395, - - 395, 395, 395, 395, 395, 395, 395, 395, 395, 395, - 395, 395, 395, 395, 395, 395, 395, 395, 395, 395, - 395, 395, 395, 395, 395, 395, 395, 395, 395, 395, - 395, 395, 395 + 3, 4, 12, 15, 46, 16, 18, 18, 20, 20, + 15, 16, 12, 19, 19, 19, 22, 22, 28, 28, + 24, 39, 30, 31, 39, 32, 30, 24, 30, 51, + + 51, 31, 32, 32, 34, 41, 3, 4, 24, 47, + 31, 34, 31, 209, 41, 41, 64, 64, 209, 41, + 47, 47, 47, 57, 46, 47, 209, 18, 57, 57, + 66, 66, 66, 75, 76, 86, 75, 82, 75, 88, + 82, 101, 101, 88, 76, 103, 113, 86, 121, 75, + 51, 116, 116, 121, 121, 133, 133, 113, 113, 113, + 103, 134, 139, 146, 146, 417, 133, 171, 171, 416, + 133, 134, 139, 150, 174, 174, 150, 162, 150, 57, + 162, 183, 183, 162, 204, 162, 204, 204, 150, 222, + 150, 220, 162, 162, 183, 227, 220, 204, 354, 414, + + 227, 354, 412, 402, 400, 222, 397, 395, 394, 393, + 391, 354, 407, 407, 407, 407, 407, 408, 389, 408, + 408, 408, 409, 409, 410, 388, 410, 410, 410, 411, + 386, 411, 411, 411, 413, 380, 413, 413, 413, 415, + 415, 379, 378, 376, 373, 372, 371, 369, 368, 367, + 365, 364, 362, 361, 357, 351, 345, 343, 342, 341, + 340, 332, 331, 329, 324, 323, 322, 321, 318, 317, + 316, 315, 314, 312, 311, 310, 309, 308, 307, 306, + 305, 304, 303, 302, 301, 300, 299, 298, 297, 296, + 292, 290, 289, 288, 287, 286, 285, 284, 283, 282, + + 281, 280, 279, 278, 277, 276, 275, 274, 271, 270, + 269, 268, 267, 266, 264, 263, 262, 261, 260, 258, + 257, 256, 255, 254, 253, 251, 248, 247, 246, 245, + 244, 243, 242, 241, 240, 239, 238, 237, 234, 233, + 230, 229, 226, 225, 224, 223, 221, 219, 217, 216, + 215, 214, 213, 212, 211, 210, 207, 206, 205, 203, + 202, 200, 199, 196, 194, 193, 192, 191, 190, 189, + 188, 187, 186, 185, 184, 182, 181, 180, 179, 178, + 177, 176, 168, 167, 166, 165, 164, 163, 161, 160, + 159, 158, 157, 156, 155, 154, 153, 152, 149, 147, + + 145, 144, 143, 142, 141, 140, 138, 137, 136, 135, + 132, 131, 130, 129, 128, 127, 122, 120, 119, 109, + 108, 107, 106, 105, 104, 102, 100, 99, 98, 97, + 96, 95, 94, 92, 91, 90, 89, 87, 85, 84, + 83, 81, 80, 79, 77, 73, 71, 67, 56, 45, + 44, 43, 42, 40, 38, 37, 36, 35, 33, 29, + 27, 26, 25, 21, 17, 14, 13, 11, 9, 5, + 2, 406, 406, 406, 406, 406, 406, 406, 406, 406, + 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, + 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, + + 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, + 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, + 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, + 406, 406, 406, 406, 406, 406, 406, 406, 406, 406 } ; static yy_state_type yy_last_accepting_state; @@ -713,7 +716,7 @@ #define YY_NO_INPUT -#line 717 "lexer.c" +#line 720 "lexer.c" #define INITIAL 0 #define str 1 @@ -934,7 +937,7 @@ #line 12 "lexer" -#line 938 "lexer.c" +#line 941 "lexer.c" while ( 1 ) /* loops until end-of-file is reached */ { @@ -962,13 +965,13 @@ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 396 ) + if ( yy_current_state >= 407 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 465 ); + while ( yy_base[yy_current_state] != 472 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -1402,431 +1405,437 @@ YY_RULE_SETUP #line 217 "lexer" { - yylval.type = f_makelist; - return MAKELIST; + yylval.type = f_listfind; + return LISTFIND; } YY_BREAK case 54: YY_RULE_SETUP #line 221 "lexer" { - yylval.type = op_older; - return OLDER; + yylval.type = f_listunion; + return LISTUNION; } YY_BREAK case 55: +#line 226 "lexer" +case 56: +#line 227 "lexer" +case 57: YY_RULE_SETUP -#line 225 "lexer" +#line 227 "lexer" { - yylval.type = f_printf; - return PRINTF; + sc_saveInfo(); + yylval.type = f_listlen; + return LISTLEN; } YY_BREAK -case 56: +case 58: YY_RULE_SETUP -#line 229 "lexer" +#line 232 "lexer" { - yylval.type = f_putenv; - return PUTENV; + yylval.type = f_makelist; + return MAKELIST; } YY_BREAK -case 57: +case 59: YY_RULE_SETUP -#line 233 "lexer" +#line 236 "lexer" { - yylval.type = f_resize; - return RESIZE; + yylval.type = op_older; + return OLDER; } YY_BREAK -case 58: +case 60: YY_RULE_SETUP -#line 238 "lexer" +#line 240 "lexer" { - yylval.type = op_ret; - return RETURN; + yylval.type = f_printf; + return PRINTF; } YY_BREAK -case 59: -#line 243 "lexer" -case 60: -#line 244 "lexer" case 61: YY_RULE_SETUP #line 244 "lexer" { - sc_saveInfo(); - yylval.type = f_listlen; - return LISTLEN; + yylval.type = f_putenv; + return PUTENV; } YY_BREAK case 62: YY_RULE_SETUP -#line 249 "lexer" +#line 248 "lexer" { - yylval.type = f_stat; - return STAT; + yylval.type = f_resize; + return RESIZE; } YY_BREAK case 63: YY_RULE_SETUP #line 253 "lexer" { - yylval.type = e_str; - return STRINGTYPE; + yylval.type = op_ret; + return RETURN; } YY_BREAK case 64: YY_RULE_SETUP #line 257 "lexer" { - yylval.type = f_strlen; - return STRLEN; + yylval.type = f_stat; + return STAT; } YY_BREAK case 65: YY_RULE_SETUP #line 261 "lexer" { - yylval.type = f_strlwr; - return STRLWR; + yylval.type = f_strchr; + return STRCHR; } YY_BREAK case 66: YY_RULE_SETUP #line 265 "lexer" { - yylval.type = f_strupr; - return STRUPR; + yylval.type = e_str; + return STRINGTYPE; } YY_BREAK case 67: YY_RULE_SETUP #line 269 "lexer" { - yylval.type = f_strtok; - return FIELDS; + yylval.type = f_strlen; + return STRLEN; } YY_BREAK case 68: YY_RULE_SETUP #line 273 "lexer" { - yylval.type = f_strfind; - return STRFIND; + yylval.type = f_strlwr; + return STRLWR; } YY_BREAK case 69: YY_RULE_SETUP #line 277 "lexer" { - yylval.type = f_strformat; - return STRFORMAT; + yylval.type = f_strupr; + return STRUPR; } YY_BREAK case 70: YY_RULE_SETUP #line 281 "lexer" { - yylval.type = f_substr; - return SUBSTR; + yylval.type = f_strtok; + return FIELDS; } YY_BREAK case 71: YY_RULE_SETUP #line 285 "lexer" { - yylval.type = f_system; - return SYSTEM; + yylval.type = f_strfind; + return STRFIND; } YY_BREAK case 72: YY_RULE_SETUP #line 289 "lexer" { - yylval.type = f_trim; - return TRIMLEFT; + yylval.type = f_strformat; + return STRFORMAT; } YY_BREAK case 73: YY_RULE_SETUP #line 293 "lexer" { - yylval.type = f_trimleft; - return TRIMLEFT; + yylval.type = f_substr; + return SUBSTR; } YY_BREAK case 74: YY_RULE_SETUP #line 297 "lexer" { - yylval.type = f_trimright; - return TRIMRIGHT; + yylval.type = f_system; + return SYSTEM; } YY_BREAK case 75: YY_RULE_SETUP #line 301 "lexer" { - return WHILE; + yylval.type = f_trim; + return TRIMLEFT; } YY_BREAK case 76: -#line 305 "lexer" -case 77: YY_RULE_SETUP #line 305 "lexer" { - yylval.type = op_younger; - return YOUNGER; + yylval.type = f_trimleft; + return TRIMLEFT; } YY_BREAK -case 78: +case 77: YY_RULE_SETUP #line 309 "lexer" { - return INC; + yylval.type = f_trimright; + return TRIMRIGHT; } YY_BREAK -case 79: +case 78: YY_RULE_SETUP -#line 312 "lexer" +#line 313 "lexer" { - return DEC; + return WHILE; } YY_BREAK +case 79: +#line 317 "lexer" case 80: YY_RULE_SETUP -#line 315 "lexer" +#line 317 "lexer" { - return DIV_IS; + yylval.type = op_younger; + return YOUNGER; } YY_BREAK case 81: YY_RULE_SETUP -#line 318 "lexer" +#line 321 "lexer" { - return MINUS_IS; + return INC; } YY_BREAK case 82: YY_RULE_SETUP -#line 321 "lexer" +#line 324 "lexer" { - return MUL_IS; + return DEC; } YY_BREAK case 83: YY_RULE_SETUP -#line 324 "lexer" +#line 327 "lexer" { - return MOD_IS; + return DIV_IS; } YY_BREAK case 84: YY_RULE_SETUP -#line 327 "lexer" +#line 330 "lexer" { - return PLUS_IS; + return MINUS_IS; } YY_BREAK case 85: YY_RULE_SETUP -#line 330 "lexer" +#line 333 "lexer" { - return AND_IS; + return MUL_IS; } YY_BREAK case 86: YY_RULE_SETUP -#line 333 "lexer" +#line 336 "lexer" { - return OR_IS; + return MOD_IS; } YY_BREAK case 87: YY_RULE_SETUP -#line 336 "lexer" +#line 339 "lexer" { - return XOR_IS; + return PLUS_IS; } YY_BREAK case 88: YY_RULE_SETUP -#line 339 "lexer" +#line 342 "lexer" { - return SHL_IS; + return AND_IS; } YY_BREAK case 89: YY_RULE_SETUP -#line 342 "lexer" +#line 345 "lexer" { - return SHR_IS; + return OR_IS; } YY_BREAK case 90: YY_RULE_SETUP -#line 345 "lexer" +#line 348 "lexer" { - return OR; + return XOR_IS; } YY_BREAK case 91: YY_RULE_SETUP -#line 348 "lexer" +#line 351 "lexer" { - return AND; + return SHL_IS; } YY_BREAK case 92: YY_RULE_SETUP -#line 351 "lexer" +#line 354 "lexer" { - return EQUAL; + return SHR_IS; } YY_BREAK case 93: YY_RULE_SETUP -#line 354 "lexer" +#line 357 "lexer" { - return NOT_EQUAL; + return OR; } YY_BREAK case 94: YY_RULE_SETUP -#line 357 "lexer" +#line 360 "lexer" { - return SMALLER_EQUAL; + return AND; } YY_BREAK case 95: YY_RULE_SETUP -#line 360 "lexer" +#line 363 "lexer" { - return GREATER_EQUAL; + return EQUAL; } YY_BREAK case 96: YY_RULE_SETUP -#line 363 "lexer" +#line 366 "lexer" { - return SHR; + return NOT_EQUAL; } YY_BREAK case 97: YY_RULE_SETUP -#line 366 "lexer" +#line 369 "lexer" { - return SHL; + return SMALLER_EQUAL; } YY_BREAK case 98: YY_RULE_SETUP -#line 369 "lexer" +#line 372 "lexer" { - unsigned value; - sscanf(yytext + 2, "%x", &value); - util_printf("%d", (int)value); - return NUMBER; + return GREATER_EQUAL; } YY_BREAK case 99: YY_RULE_SETUP #line 375 "lexer" { - util_setString(yytext); - return NUMBER; + return SHR; } YY_BREAK case 100: -#line 380 "lexer" +YY_RULE_SETUP +#line 378 "lexer" +{ + return SHL; + } + YY_BREAK case 101: +#line 382 "lexer" +case 102: YY_RULE_SETUP -#line 380 "lexer" +#line 382 "lexer" { util_setString("0"); return NUMBER; } YY_BREAK -case 102: -#line 385 "lexer" case 103: -#line 386 "lexer" +#line 387 "lexer" case 104: +#line 388 "lexer" +case 105: YY_RULE_SETUP -#line 386 "lexer" +#line 388 "lexer" { util_setString("1"); return NUMBER; } YY_BREAK -case 105: -#line 391 "lexer" case 106: -#line 392 "lexer" +#line 393 "lexer" case 107: +#line 394 "lexer" +case 108: YY_RULE_SETUP -#line 392 "lexer" +#line 394 "lexer" { util_setString("2"); return NUMBER; } YY_BREAK -case 108: -#line 397 "lexer" case 109: +#line 399 "lexer" +case 110: YY_RULE_SETUP -#line 397 "lexer" +#line 399 "lexer" { util_setString("4"); return NUMBER; } YY_BREAK -case 110: -#line 402 "lexer" case 111: +#line 404 "lexer" +case 112: YY_RULE_SETUP -#line 402 "lexer" +#line 404 "lexer" { util_setString("8"); return NUMBER; } YY_BREAK -case 112: +case 113: YY_RULE_SETUP -#line 406 "lexer" +#line 408 "lexer" { util_setString("16"); return NUMBER; } YY_BREAK -case 113: +case 114: YY_RULE_SETUP -#line 410 "lexer" +#line 412 "lexer" { util_setString("32"); return NUMBER; } YY_BREAK -case 114: +case 115: YY_RULE_SETUP -#line 414 "lexer" +#line 416 "lexer" { util_setString(yytext); return IDENTIFIER; } YY_BREAK -case 115: +case 116: YY_RULE_SETUP -#line 418 "lexer" +#line 420 "lexer" return yytext[0]; YY_BREAK -case 116: +case 117: YY_RULE_SETUP -#line 419 "lexer" +#line 421 "lexer" ECHO; YY_BREAK -#line 1830 "lexer.c" +#line 1839 "lexer.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(str): yyterminate(); @@ -2121,7 +2130,7 @@ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 396 ) + if ( yy_current_state >= 407 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -2149,11 +2158,11 @@ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 396 ) + if ( yy_current_state >= 407 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 395); + yy_is_jam = (yy_current_state == 406); return yy_is_jam ? 0 : yy_current_state; } @@ -2825,4 +2834,4 @@ #define YYTABLES_NAME "yytables" -#line 418 "lexer" +#line 420 "lexer" diff -Nru icmake-8.00.05/icm-comp/symtab/addfunction.c icmake-8.01.00/icm-comp/symtab/addfunction.c --- icmake-8.00.05/icm-comp/symtab/addfunction.c 2015-12-17 17:45:55.000000000 +0000 +++ icmake-8.01.00/icm-comp/symtab/addfunction.c 2016-02-01 14:36:51.000000000 +0000 @@ -18,6 +18,8 @@ next->returnType = type | e_reg; next->address = offset; + if (strcmp("main", next->name) == 0 && (type & e_typeMask)) + util_semantic("`main(...)' must have 'void' return type"); msg("gs_vars.nParams is %u", gs_vars.nParams); diff -Nru icmake-8.00.05/icm-exec/builtin/bchdir.c icmake-8.01.00/icm-exec/builtin/bchdir.c --- icmake-8.00.05/icm-exec/builtin/bchdir.c 2015-12-17 17:45:55.000000000 +0000 +++ icmake-8.01.00/icm-exec/builtin/bchdir.c 2016-02-01 14:36:51.000000000 +0000 @@ -41,7 +41,8 @@ free(dir); /* at the new destination: obtain */ - getcwd(newdir, MAX_PATHLEN); /* its absolute pathname */ + if (getcwd(newdir, MAX_PATHLEN) == NULL) + rss_fatal(0, 0, "getcwd($s) fails"); /* its absolute pathname */ if (newdir[strlen(newdir) - 1] != DIRSEP) /* and append a DIRSEP */ strcat(newdir, dirsep); diff -Nru icmake-8.00.05/icm-exec/builtin/blistfind.c icmake-8.01.00/icm-exec/builtin/blistfind.c --- icmake-8.00.05/icm-exec/builtin/blistfind.c 1970-01-01 00:00:00.000000000 +0000 +++ icmake-8.01.00/icm-exec/builtin/blistfind.c 2016-02-01 14:36:51.000000000 +0000 @@ -0,0 +1,17 @@ +/* + This function returns the first index of an element in the lhs list which +is equal to either the rhs string + -1 is returned if such an element was not found. +*/ + +#include "builtin.ih" + +void b_listFind(void) +{ + Variable *target = stack_top() - 1; + + intcons_int( + eb_releaseReg(), + (int)list_contains(stack_top(), string_charp(target)) + ); +} diff -Nru icmake-8.00.05/icm-exec/builtin/blistunion.c icmake-8.01.00/icm-exec/builtin/blistunion.c --- icmake-8.00.05/icm-exec/builtin/blistunion.c 1970-01-01 00:00:00.000000000 +0000 +++ icmake-8.01.00/icm-exec/builtin/blistunion.c 2016-02-01 14:36:51.000000000 +0000 @@ -0,0 +1,18 @@ +#include "builtin.ih" + +/* + Returns the set-union of the lhs list and the rhs list or string +*/ + +void b_listUnion() +{ + Variable *source = stack_top() - 1; + + listcons(eb_releaseReg()); + list_unionList(&gb_reg, stack_top()); + + if (var_type(source) == e_str) + list_unionStr(&gb_reg, string_charp(source)); + else + list_unionList(&gb_reg, source); +} diff -Nru icmake-8.00.05/icm-exec/builtin/bstat.c icmake-8.01.00/icm-exec/builtin/bstat.c --- icmake-8.00.05/icm-exec/builtin/bstat.c 2015-12-17 17:45:55.000000000 +0000 +++ icmake-8.01.00/icm-exec/builtin/bstat.c 2016-02-01 14:36:51.000000000 +0000 @@ -27,27 +27,28 @@ { /* failure to stat? */ if (rss_checkMode (mode)) /* if mode indicates abort..*/ rss_fatal(0, 0, "stat - unable to stat file %s", fname); - - return; /* no checking: return */ + statbuf.st_size = -1; } /* empty list */ - - if (statbuf.st_mode & S_IREAD) /* set file attribute int */ - fileatt |= IS_IREAD; - - if (statbuf.st_mode & S_IWRITE) - fileatt |= IS_IWRITE; - - if (statbuf.st_mode & S_IEXEC) - fileatt |= IS_IEXEC; - - if (statbuf.st_mode & S_IFDIR) - fileatt |= IS_IFDIR; - - if (statbuf.st_mode & S_IFCHR) - fileatt |= IS_IFCHR; - - if (statbuf.st_mode & S_IFREG) - fileatt |= IS_IFREG; + else + { + if (statbuf.st_mode & S_IREAD) /* set file attribute int */ + fileatt |= IS_IREAD; + + if (statbuf.st_mode & S_IWRITE) + fileatt |= IS_IWRITE; + + if (statbuf.st_mode & S_IEXEC) + fileatt |= IS_IEXEC; + + if (statbuf.st_mode & S_IFDIR) + fileatt |= IS_IFDIR; + + if (statbuf.st_mode & S_IFCHR) + fileatt |= IS_IFCHR; + + if (statbuf.st_mode & S_IFREG) + fileatt |= IS_IFREG; + } listcons(eb_releaseReg()); /* return result as list */ diff -Nru icmake-8.00.05/icm-exec/builtin/bstrchr.c icmake-8.01.00/icm-exec/builtin/bstrchr.c --- icmake-8.00.05/icm-exec/builtin/bstrchr.c 1970-01-01 00:00:00.000000000 +0000 +++ icmake-8.01.00/icm-exec/builtin/bstrchr.c 2016-02-01 14:36:51.000000000 +0000 @@ -0,0 +1,15 @@ +/* + Function fun_builtin_strChr()} returns the first index in a string + haystack where a character in the b_subString needle was found. + If not found, -1 is returned. +*/ + +#include "builtin.ih" + +void b_strChr() +{ + char const *haystack = string_charp(stack_top()); + char const *ret = strpbrk(haystack, string_charp(stack_top() - 1)); + + intcons_int(eb_releaseReg(), ret ? ret - haystack : -1); +} diff -Nru icmake-8.00.05/icm-exec/builtin/builtin.c icmake-8.01.00/icm-exec/builtin/builtin.c --- icmake-8.00.05/icm-exec/builtin/builtin.c 2015-12-17 17:45:55.000000000 +0000 +++ icmake-8.01.00/icm-exec/builtin/builtin.c 2016-02-01 14:36:51.000000000 +0000 @@ -2,7 +2,9 @@ void builtin() { - getcwd(gb_orgDir, MAX_PATHLEN); + if (!getcwd(gb_orgDir, MAX_PATHLEN)) + rss_fatal(0, 0, "getcwd($s) fails"); /* its absolute pathname */ + gb_argHead = rss_strdup(""); gb_argTail = rss_strdup(""); gb_cmdHead = rss_strdup(""); diff -Nru icmake-8.00.05/icm-exec/builtin/builtin.ih icmake-8.01.00/icm-exec/builtin/builtin.ih --- icmake-8.00.05/icm-exec/builtin/builtin.ih 2015-12-17 17:45:55.000000000 +0000 +++ icmake-8.01.00/icm-exec/builtin/builtin.ih 2016-02-01 14:36:51.000000000 +0000 @@ -134,5 +134,6 @@ void b_trim(void); void b_trimLeft(void); void b_trimRight(void); - - +void b_strChr(void); +void b_listFind(void); +void b_listUnion(void); diff -Nru icmake-8.00.05/icm-exec/builtin/data.c icmake-8.01.00/icm-exec/builtin/data.c --- icmake-8.00.05/icm-exec/builtin/data.c 2015-12-17 17:45:55.000000000 +0000 +++ icmake-8.01.00/icm-exec/builtin/data.c 2016-02-01 14:36:51.000000000 +0000 @@ -90,9 +90,11 @@ /* added later without having to change the */ /* binary code */ - b_empty, - b_empty, - b_empty, + b_strChr, + b_listFind, + b_listUnion, + + /* 30 */ b_empty, b_empty, b_empty, diff -Nru icmake-8.00.05/icm-exec/builtin/ebtermch.c icmake-8.01.00/icm-exec/builtin/ebtermch.c --- icmake-8.00.05/icm-exec/builtin/ebtermch.c 2015-12-17 17:45:56.000000000 +0000 +++ icmake-8.01.00/icm-exec/builtin/ebtermch.c 2016-02-01 14:36:51.000000000 +0000 @@ -31,7 +31,11 @@ } key = getchar(); - printf("%c\n", key); + + if (key == '\n') + putchar('\n'); + else + printf("%c\n", key); tcsetattr(STDIN_FILENO, TCSANOW, &saved); diff -Nru icmake-8.00.05/icm-exec/builtin/frame icmake-8.01.00/icm-exec/builtin/frame --- icmake-8.00.05/icm-exec/builtin/frame 2015-12-17 17:45:56.000000000 +0000 +++ icmake-8.01.00/icm-exec/builtin/frame 2016-02-01 14:36:51.000000000 +0000 @@ -1,5 +1,5 @@ #include "builtin.ih" -void eb_ +void b_() { } diff -Nru icmake-8.00.05/icm-exec/icmconf icmake-8.01.00/icm-exec/icmconf --- icmake-8.00.05/icm-exec/icmconf 2015-12-17 17:45:56.000000000 +0000 +++ icmake-8.01.00/icm-exec/icmconf 2016-02-01 14:36:51.000000000 +0000 @@ -8,16 +8,6 @@ #define LINKER_OPTIONS "-s" #define ADD_LIBRARIES "icrss" #define ADD_LIBRARY_PATHS "../../tmp" -#define SCANNER_DIR "" -#define SCANGEN "" -#define SCANFLAGS "" -#define SCANSPEC "" -#define SCANOUT "" -#define PARSER_DIR "" -#define PARSGEN "" -#define PARSSPEC "" -#define PARSFLAGS "" -#define PARSOUT "" #define TMP_DIR "tmp" #define LIBRARY "modules" #define OBJ_EXT ".o" diff -Nru icmake-8.00.05/icm-exec/list/add.c icmake-8.01.00/icm-exec/list/add.c --- icmake-8.00.05/icm-exec/list/add.c 2015-12-17 17:45:56.000000000 +0000 +++ icmake-8.01.00/icm-exec/list/add.c 2016-02-01 14:36:51.000000000 +0000 @@ -18,7 +18,7 @@ { char const *cp = l_constElement(rhs)[idx]; - if (!list_contains(©, cp)) + if (list_contains(©, cp) == -1) list_add_charPtr(©, cp); } diff -Nru icmake-8.00.05/icm-exec/list/contains.c icmake-8.01.00/icm-exec/list/contains.c --- icmake-8.00.05/icm-exec/list/contains.c 2015-12-17 17:45:56.000000000 +0000 +++ icmake-8.01.00/icm-exec/list/contains.c 2016-02-01 14:36:51.000000000 +0000 @@ -2,13 +2,11 @@ int list_contains(ListVariable *lhs, char const *str) { - unsigned idx; - - for (idx = *l_sizePtr(lhs); idx--; ) + for (int idx = 0, end = *l_sizePtr(lhs); idx != end; ++idx) { if (strcmp(str, l_element(lhs)[idx]) == 0) - return 1; + return idx; } - return 0; + return -1; } diff -Nru icmake-8.00.05/icm-exec/list/frame icmake-8.01.00/icm-exec/list/frame --- icmake-8.00.05/icm-exec/list/frame 1970-01-01 00:00:00.000000000 +0000 +++ icmake-8.01.00/icm-exec/list/frame 2016-02-01 14:36:51.000000000 +0000 @@ -0,0 +1,20 @@ +#include "list.ih" + +void l_ (ListVariable *list, ) +{ +} + + + + + + + + + + + + + + + diff -Nru icmake-8.00.05/icm-exec/list/list.h icmake-8.01.00/icm-exec/list/list.h --- icmake-8.00.05/icm-exec/list/list.h 2015-12-17 17:45:56.000000000 +0000 +++ icmake-8.01.00/icm-exec/list/list.h 2016-02-01 14:36:51.000000000 +0000 @@ -47,10 +47,16 @@ void list_add_grab_charPtr(ListVariable *list, char *txt); void list_add(ListVariable *lhs, ListVariable const *rhs); + /* -1 if not found */ +int list_contains(ListVariable *lhs, char const *str); +/* int list_findListElement(ListVariable *lhs, ListVariable const *rhs); */ + +void list_unionStr(ListVariable *list, char const *txt); +void list_unionList(ListVariable *list, ListVariable const *src); + void list_sub(ListVariable *lhs, ListVariable const *rhs); int list_bool(ListVariable const *lhs); -int list_contains(ListVariable *lhs, char const *str); -unsigned list_size(ListVariable const *list); +unsigned list_size(ListVariable const *list); char const *list_at(ListVariable const *list, unsigned idx); void list_sort(ListVariable *list); diff -Nru icmake-8.00.05/icm-exec/list/unionlist.c icmake-8.01.00/icm-exec/list/unionlist.c --- icmake-8.00.05/icm-exec/list/unionlist.c 1970-01-01 00:00:00.000000000 +0000 +++ icmake-8.01.00/icm-exec/list/unionlist.c 2016-02-01 14:36:51.000000000 +0000 @@ -0,0 +1,22 @@ +#include "list.ih" + +void list_unionList(ListVariable *list, ListVariable const *src) +{ + for (unsigned idx = l_size(src); idx--; ) + list_unionStr(list, list_at(src, idx)); +} + + + + + + + + + + + + + + + diff -Nru icmake-8.00.05/icm-exec/list/unionstr.c icmake-8.01.00/icm-exec/list/unionstr.c --- icmake-8.00.05/icm-exec/list/unionstr.c 1970-01-01 00:00:00.000000000 +0000 +++ icmake-8.01.00/icm-exec/list/unionstr.c 2016-02-01 14:36:51.000000000 +0000 @@ -0,0 +1,22 @@ +#include "list.ih" + +void list_unionStr(ListVariable *list, char const *str) +{ + if (list_contains(list, str) == -1) + list_add_charPtr(list, str); +} + + + + + + + + + + + + + + + diff -Nru icmake-8.00.05/icm-pp/linear/undef.c icmake-8.01.00/icm-pp/linear/undef.c --- icmake-8.00.05/icm-pp/linear/undef.c 2015-12-21 13:18:27.000000000 +0000 +++ icmake-8.01.00/icm-pp/linear/undef.c 2016-02-01 14:36:51.000000000 +0000 @@ -2,13 +2,21 @@ int linear_undef(char const *ident) { - Linear const *item = linear_search(ident); + Linear *item = (Linear *)linear_search(ident); if (item == NULL) return 0; - *item->id = 0; + free(item->id); // free the item to undef free(item->definition); + --l_size; // reduce the size + + if (l_table + l_size != item) // not the last item was removed: + { + item->id = l_table[l_size].id; // store the last item + item->definition = l_table[l_size].definition; // at the free spot + } + return 1; } diff -Nru icmake-8.00.05/icmun/data.c icmake-8.01.00/icmun/data.c --- icmake-8.00.05/icmun/data.c 2015-12-17 17:45:56.000000000 +0000 +++ icmake-8.01.00/icmun/data.c 2016-02-01 14:36:51.000000000 +0000 @@ -73,6 +73,9 @@ /* 2c */ "trimright", + "strchr", + "listfind", + "listunion" }; FILE *infile; diff -Nru icmake-8.00.05/icmun/funcall.c icmake-8.01.00/icmun/funcall.c --- icmake-8.00.05/icmun/funcall.c 2015-12-17 17:45:56.000000000 +0000 +++ icmake-8.01.00/icmun/funcall.c 2016-02-01 14:36:51.000000000 +0000 @@ -1,6 +1,6 @@ #include "icmun.ih" -void fun_call () +void fun_call() { int offs = rss_getInt16 (infile); dumpint(offs); diff -Nru icmake-8.00.05/icmun/icmconf icmake-8.01.00/icmun/icmconf --- icmake-8.00.05/icmun/icmconf 2015-12-17 17:45:56.000000000 +0000 +++ icmake-8.01.00/icmun/icmconf 2016-02-01 14:36:51.000000000 +0000 @@ -8,16 +8,6 @@ #define ADD_LIBRARIES "icrss" #define ADD_LIBRARY_PATHS "../../tmp" #define CLS -#define SCANNER_DIR "" -#define SCANGEN "" -#define SCANFLAGS "" -#define SCANSPEC "" -#define SCANOUT "" -#define PARSER_DIR "" -#define PARSGEN "" -#define PARSSPEC "" -#define PARSFLAGS "" -#define PARSOUT "" #define TMP_DIR "tmp" #define LIBRARY "modules" #define OBJ_EXT ".o" diff -Nru icmake-8.00.05/INSTALL icmake-8.01.00/INSTALL --- icmake-8.00.05/INSTALL 2015-12-17 17:45:54.000000000 +0000 +++ icmake-8.01.00/INSTALL 2016-02-01 14:36:51.000000000 +0000 @@ -1,7 +1,7 @@ INSTALLING ICMAKE ================= - Version 8.00.00 (and beyond) + Version 8.00.00 (and beyond). 1. Unpack the archive: ====================== diff -Nru icmake-8.00.05/rss/types.ih icmake-8.01.00/rss/types.ih --- icmake-8.00.05/rss/types.ih 2015-12-17 17:45:57.000000000 +0000 +++ icmake-8.01.00/rss/types.ih 2016-02-01 14:36:51.000000000 +0000 @@ -50,29 +50,31 @@ e_null = 0, /* rss + compiler: */ - e_int = (1 << 0), /* int-type expression */ - e_str = (1 << 1), /* string-type expression */ - e_list = (1 << 2), /* list-type expression */ + e_int = (1 << 0), /* 1: int-type expression */ + e_str = (1 << 1), /* 2: string-type expression */ + e_list = (1 << 2), /* 4: list-type expression */ /* compiler only: */ - e_bool = (1 << 3), /* bool-type expression */ + e_bool = (1 << 3), /* 8: bool-type expression */ e_typeMask = (e_int | e_list | e_str | e_bool), - e_const = (1 << 4), /* immediate value */ - e_var = (1 << 5), /* variable */ - e_reg = (1 << 6), /* register */ - e_stack = (1 << 7), /* value available on the stack */ + e_const = (1 << 4), /* 0x10 immediate value */ + e_var = (1 << 5), /* 0x20 variable */ + e_reg = (1 << 6), /* 0x40 register */ + e_stack = (1 << 7), /* 0x80 value available on the stack */ - e_pre_inc_dec = (1 << 8), /* pre-inc or pre-dec */ - e_post_inc_dec = (1 << 9) /* post-inc or post-dec */ + e_pre_inc_dec = (1 << 8), /* pre-inc or pre-dec */ + e_post_inc_dec = (1 << 9) /* post-inc or post-dec */ } ExprType; /* when the ordering or entries of the following enum changes, update - icmun/data.c, icm-comp/parser/data.c and icm-exec/builtin/data.c as - well en rebuild all programs. It will also change the contents of the - .bim file, so it also requires at least a minor version upgrade. + icmun/data.c, + icm-comp/parser/data.c and + icm-exec/builtin/data.c + as well en rebuild all programs. It will also change the contents of + the .bim file, so it also requires at least a minor version upgrade. */ typedef enum /* names of rss-functions */ { @@ -144,8 +146,14 @@ /* 2c */ f_trimright, + + f_strchr, + f_listfind, + f_listunion, - /* 20 left for new opcodes until f_hlt */ + /* 30 */ + + /* 17 left for new opcodes until f_hlt */ f_hlt = f_trimright + 21 /* dummy marker for non-existing */ } FunNr; diff -Nru icmake-8.00.05/scripts/icmbuild.in icmake-8.01.00/scripts/icmbuild.in --- icmake-8.00.05/scripts/icmbuild.in 2015-12-17 17:45:57.000000000 +0000 +++ icmake-8.01.00/scripts/icmbuild.in 2016-02-01 14:36:51.000000000 +0000 @@ -1,4 +1,4 @@ -#!@BINDIR@/icmake -t/tmp/icmbuild +#!@BINDIR@/icmake -t. #include "icmconf" @@ -21,11 +21,13 @@ list g_classes; // all class-directories int g_nClasses; // number of class-directories int g_compiled; // any source compiled (but main)? -int g_keepGramspec; // keep the gramspec directory list g_classLines; // list of all lines in CLASSES list g_classLine; // line of the CLASSES file list g_inspected; // list of classes whose dependencies have been // inspected (used with USE_ALL) + +list g_buildprog = strtok("program strip", " "); + int g_base; // compile the sources in the base directory int g_chdir; // display chdirs to directories without sources to // compile @@ -63,7 +65,6 @@ #ifdef CXX g_compiler = setOpt(CXX, "CXX") + " " + setOpt(CXXFLAGS, "CXXFLAGS"); #else - #ifdef CC g_compiler = setOpt(CC, "CC") + " " + setOpt(CFLAGS, "CFLAGS"); #else @@ -90,90 +91,72 @@ return ret; } -void parser() -{ - chdir(PARSER_DIR); - - list gramfiles = makelist(PARSSPEC); - -#ifdef PARSFILES - gramfiles += makelist(PARSFILES); -#else - #ifdef GRAMBUILD - chdir("gramspec"); - showCd(PARSER_DIR "gramspec"); - - system("./grambuild"); - chdir(".."); - #endif -#endif - - for (int idx = listlen(gramfiles); idx--; ) +#ifdef PARSER_DIR + void parser() { - if (gramfiles[idx] younger PARSOUT) // need new parser + chdir(PARSER_DIR); + + list gramfiles = makelist(PARSSPEC); + + #ifdef PARSFILES + gramfiles += makelist(PARSFILES); + #endif + + for (int idx = listlen(gramfiles); idx--; ) { - showCd(PARSER_DIR); - if (USE_ECHO) - printf("New parser: `", gramfiles[idx], "' changed\n"); - system(PARSGEN " " PARSFLAGS " " PARSSPEC); - break; + if (gramfiles[idx] younger PARSOUT) // need new parser + { + showCd(PARSER_DIR); + if (USE_ECHO) + printf("New parser: `", gramfiles[idx], "' changed\n"); + system(PARSGEN " " PARSFLAGS " " PARSSPEC); + break; + } } + chdir(".."); } - chdir(".."); -} - -void scanner() -{ - chdir(SCANNER_DIR); - - int rerun = PARSER_DIR != "" && - "../"PARSER_DIR"/"PARSOUT younger SCANOUT; +#endif - if (!rerun) +#ifdef SCANNER_DIR + void scanner() { - list scanfiles = makelist(PARSSPEC) + makelist(SCANSPEC); + chdir(SCANNER_DIR); - #ifdef SCANFILES - scanfiles += makelist(SCANFILES); - #endif + int rerun = PARSER_DIR != "" && + "../"PARSER_DIR"/"PARSOUT younger SCANOUT; - for (int idx = listlen(scanfiles); idx--; ) + if (!rerun) { - if (scanfiles[idx] younger SCANOUT) + list scanfiles = makelist(PARSSPEC) + makelist(SCANSPEC); + + #ifdef SCANFILES + scanfiles += makelist(SCANFILES); + #endif + + for (int idx = listlen(scanfiles); idx--; ) { - showCd(SCANNER_DIR); - rerun = 1; - break; + if (scanfiles[idx] younger SCANOUT) + { + showCd(SCANNER_DIR); + rerun = 1; + break; + } } } + + if (rerun) + system(SCANGEN " " SCANFLAGS " " SCANSPEC); + + chdir(".."); } - - if (rerun) - system(SCANGEN " " SCANFLAGS " " SCANSPEC); - - chdir(".."); -} +#endif #ifdef USE_ALL -int find(string needle, list haystack) -{ - int idx; - for (idx = listlen(haystack); idx--; ) - { - if (needle == haystack[idx]) - break; - } - return idx; -} - void touch(string dir) { echo(OFF); - - if (!exists(dir + "/" USE_ALL)) - system("touch " + dir + "/" USE_ALL); - + system("touch " + dir + "/" USE_ALL); echo(USE_ECHO); } @@ -183,8 +166,8 @@ // file and inspect their dependencies. void dependenciesOf(string thisClass) { - if (find(thisClass, g_inspected) != -1) // this class already inspected - return; // then done with this class + if (listfind(g_inspected, thisClass) != -1) // this class already + return; // inspected? then ready: return g_base = 1; // recompile the base's files @@ -196,7 +179,7 @@ { list hit = strtok(g_classLines[idx], " \t"); - if (find(thisClass, hit) > 0) + if (listfind(hit, thisClass) > 0) { touch(hit[0]); dependenciesOf(hit[0]); @@ -220,19 +203,15 @@ #endif // USE_ALL -int isEmpty(string line) +int isEmpty(string line) // needs stripped line { - list parts = strtok(line, " \t"); - - return (int)(listlen(parts) == 0 || - parts[0][0] == "#" || strfind(parts[0], "//") == 0); + return strlen(line) == 0 || line[0] == "#" || strfind(line, "//") == 0; } - int lineRead() { g_classLine = fgets("CLASSES", g_classLine); - return (int)(listlen(g_classLine) && g_classLine[2] == "OK"); + return listlen(g_classLine) && g_classLine[2] == "OK"; } list nextCLASSESline() // return entries of CLASSES as a list @@ -273,30 +252,25 @@ void setClasses() { + +#ifdef SCANNER_DIR // make sure that scanner/parser // directories come first, so they // don't get reordered if (SCANNER_DIR != "") g_classes = (list)SCANNER_DIR; // add the scanner-dir +#endif +#ifdef PARSER_DIR if (PARSER_DIR != "") g_classes += (list)PARSER_DIR; +#endif list class; while (listlen(class = nextCLASSESline())) - { - string dir = class[0]; + g_classes = listunion(g_classes, class[0]); - if - ( - dir != SCANNER_DIR // SCANNER_DIR is already there - && - dir != PARSER_DIR // PARSER_DIR is already there - ) - g_classes += (list)dir; // add this dir. - } - - // classLines contains the full lines of the CLASSES file, and thus + // g_classLines contains the full lines of the CLASSES file, and thus // stores its dependencies. g_nClasses = listlen(g_classes); @@ -311,13 +285,13 @@ list inspect(string destDir, int prefix, string srcDir, list srcList, string library) { + string oprefix = destDir + "/" + (string)prefix; + srcDir += "/"; + #ifdef USE_ALL string all = srcDir + USE_ALL; #endif - string oprefix = destDir + "/" + (string)prefix; - srcDir += "/"; - for (int idx = listlen(srcList); idx--; ) { string file = srcList[idx]; @@ -465,11 +439,15 @@ g_sources = SOURCES; g_compiled = 0; +#ifdef PARSER_DIR if (PARSER_DIR != "") parser(); +#endif +#ifdef SCANNER_DIR if (SCANNER_DIR != "") scanner(); +#endif if ( @@ -693,6 +671,42 @@ system("tput clear"); } +void usage(string prog) +{ + printf("Usage: ", prog, " [-h] [-c] args\n" + " -h - Disply this help-information and end ", + prog, "\n" + " -c - Do 'tput clear' (clear screen) just before\n" + " processing 'args'\n" + " args - select from:\n" + " clean - clean up remnants of previous activities\n" + + #ifdef LIBRARY + " library - build the static library " TMP_DIR "/lib" + LIBRARY ".a\n" + " optionally (SHARED in icmconf) build a\n" + " shared library as well\n" + #endif + + #ifdef SHARED + " strip-shared - strip a shared library\n" + #endif + + " When building a program:\n" + " program - build " TMP_DIR "/binary\n" + " program strip - build stripped " TMP_DIR "/binary\n" + " install program path - to install the binary at `path'\n" + " (provide the full path-name)\n" + " When building a library:\n" + " install static base - install the static library under " + "`base'\n" + " install shared base - install the shared library under " + "`base'\n" + ); + + exit(0); +} + void main(int argc, list argv, list envp) { echo(USE_ECHO); @@ -701,6 +715,11 @@ g_command = argv[1]; + string prog = change_ext(change_path(argv[0], ""), ""); + + if (g_command == "-h") + usage(prog); + int cls; if (g_command == "-c") { @@ -722,25 +741,6 @@ } #endif -#ifdef KEEPGRAMSPEC - g_keepGramspec = 1; -#endif - -#ifdef PARSFILES - if (exists(PARSER_DIR "/gramspec") && !g_keepGramspec) - { - printf("Remove superfluous directory `" PARSER_DIR - "/gramspec' [yN] ? "); - if (getch() == "y") - system("rm -rf " PARSER_DIR "/gramspec"); - else - fprintf("icmconf", "\n" - "\n" - " // Do not remove\n" - "#define KEEPGRAMSPEC\n"); - } -#endif - if (g_command == "clean") clean(); @@ -749,14 +749,14 @@ string option; - if (g_command == "program") + if (listfind(g_buildprog, g_command) != -1) { clearScreen(cls); - if (argv[2] == "strip") + if (g_command == "strip") + { + g_command = "program"; option = "-s"; - else - option = ""; - + } program(option); // exits } @@ -768,45 +768,14 @@ #ifdef USE_ALL rmUSE_ALLfiles(); #endif - exit(0); + return; } if (g_command == "strip-shared") { strip_shared(); - exit(0); + return; } - string prog = change_ext(change_path(argv[0], ""), ""); - - printf("Usage: ", prog, " [-c] cmd\n" - " -c - Does 'tput clear' (clear screen) just before\n" - " starting 'program' or 'library'\n" - " cmd: command to execute:\n" - " clean - clean up remnants of previous activities\n" - - #ifdef LIBRARY - " library - build the static library " TMP_DIR "/lib" - LIBRARY ".a\n" - " optionally (SHARED in icmconf) build a\n" - " shared library as well\n" - #endif - - #ifdef SHARED - " strip-shared - strip a shared library\n" - #endif - - " When building a program:\n" - " program - build " TMP_DIR "/binary\n" - " program strip - build stripped " TMP_DIR "/binary\n" - " install program path - to install the binary at `path'\n" - " (provide the full path-name)\n" - " When building a library:\n" - " install static base - install the static library under " - "`base'\n" - " install shared base - install the shared library under " - "`base'\n" - ); - - exit(0); + usage(prog); } diff -Nru icmake-8.00.05/scripts/icmstart.in icmake-8.01.00/scripts/icmstart.in --- icmake-8.00.05/scripts/icmstart.in 2015-12-17 17:45:57.000000000 +0000 +++ icmake-8.01.00/scripts/icmstart.in 2016-02-01 14:36:51.000000000 +0000 @@ -1,23 +1,31 @@ -#!@BINDIR@/icmake -t/tmp/icmstart +#!@BINDIR@/icmake -t. -string g_confpath; -string g_userHome = getenv("HOME")[1]; -string g_home = g_userHome + "/.icmake"; -string g_skelpath = "@SKELDIR@"; -string g_program; -string g_defaultcommand = ""; -string g_defaultcommandArg; -string g_destpath; +string g_confPath; +string g_home = getenv("HOME")[1] + "/.icmake"; +string g_skelPath = "@SKELDIR@"; +string g_program = "icmstart"; +string g_defaultCommand; +string g_defaultCommandArg; +list g_defaultCommands = strtok("program library", " "); +string g_destPath; +string g_destSpec; string g_cwd = chdir(""); -list g_mkdir; +string g_icmconf; -int g_confirminstall = 0; +list g_mkdir; +list g_installed; +list g_actions = strtok("b P L D PD Pb bP DP pL Lp LD DL", " "); + // possible initial + // actions on rc-file + // lines + +int g_confirmInstall = 0; int g_skeletons = 1; int g_replace = 0; int g_debug = 0; -int g_askreplace = 1; -int g_basic = 0; +int g_askReplace = 1; int g_version = 1; +int g_basic = 0; void usage() { @@ -34,8 +42,8 @@ " that would have been executed\n" " -I: do NOT install any files.\n" " -r: replace existing files/directories\n" - " -s skelpath: Read the skeleton information from the directory\n" - " `skelpath' rather than @SKELDIR@\n" + " -s skelPath: Read the skeleton information from the directory\n" + " `skelPath' rather than @SKELDIR@\n" " dir: the directory to install the files into\n" " program, library: command passed by default to the icmbuild " "script\n" @@ -60,6 +68,11 @@ return (int)stat(P_NOCHECK, s)[0] & S_IFREG; } +void ignore(string dest) +{ + g_installed += (list)(g_destPath + dest); +} + void syscall(string command) { if (g_debug) @@ -82,23 +95,58 @@ g_mkdir += (list)dir; } +string readlink(string name) +{ + name = eval("readlink -f " + name)[0]; + return resize(name, strlen(name) - 1); +} + string absPath(string arg) { if (arg[0] != "/") arg = g_cwd + arg; - if (arg[strlen(arg) - 1] != "/") - arg += "/"; + return readlink(arg) + "/"; +} + +string absSource(string source) +{ + int abs = strchr(source, "~/") == 0; - return arg; + if (abs == 0) + source = g_skelPath + source; + + source = readlink(source); + + if (abs == 0 && strfind(source, g_skelPath) != 0) + die("source: `" + source + "' not in `" + g_skelPath + "'"); + + if (!isFileOrDir(source)) + die("Can't find file or dir. `" + source + "'"); + + return source; +} + +string absDest(string dest) +{ + if (strchr(dest, "~/") == 0) // absolute path name + die("absolute destination specifications (`" + dest + + "') not supported"); + + dest = readlink(g_destPath + dest); + if (strfind(dest, g_destPath) != 0) + die("dest: `" + dest + "' not in `" + g_destPath + "'"); + + return dest; } + void arguments(int argc, list argv) { list icm = getenv("ICM"); // ICM environment var defined? if ((int)icm[0] == 1) - g_skelpath = icm[1]; // then re-assign skelpath + g_skelPath = icm[1]; // then re-assign skelPath int cmdidx = 1; while (cmdidx < argc) @@ -113,7 +161,7 @@ g_basic = 1; g_version = 0; } - else if (arg[1] == "c") // -c: re-assign g_confpath + else if (arg[1] == "c") // -c: re-assign g_confPath { arg = substr(arg, 2, 999); // get all beyond -c @@ -124,7 +172,7 @@ arg = argv[++cmdidx]; } - g_confpath = absPath(arg); // reassign confpath + g_confPath = absPath(arg); // reassign confpath } else if (arg[1] == "d") // -d: debug g_debug = 1; @@ -132,10 +180,10 @@ g_skeletons = 0; else if (arg[1] == "r") // -r: replace existing file(s) { - g_askreplace = 0; + g_askReplace = 0; g_replace = 1; } - else if (arg[1] == "s") // -s: re-assign g_skelpath + else if (arg[1] == "s") // -s: re-assign g_skelPath { arg = substr(arg, 2, 999); // get all beyond -s @@ -146,160 +194,113 @@ arg = argv[++cmdidx]; } - g_skelpath = arg; // reassign skelpath + g_skelPath = arg; // reassign skelPath } else - printf("[Warning] ignoring unkown option ", arg, "\n"); + die("Option `" + arg + "' not supported\n"); ++cmdidx; } - g_skelpath = absPath(g_skelpath); - g_destpath = argv[cmdidx]; - if (g_destpath[strlen(g_destpath) - 1] != "/") - g_destpath += "/"; - - md(g_destpath); // install the target dir - + g_skelPath = absPath(g_skelPath); + g_destSpec = argv[cmdidx]; + g_destPath = absPath(g_destSpec); - - if (!g_debug) - g_destpath = chdir(g_destpath); + g_icmconf = g_destPath + "icmconf"; if (++cmdidx < argc) { - g_defaultcommandArg = argv[cmdidx]; - if - ( - g_defaultcommandArg == "program" - || - g_defaultcommandArg == "library" - ) + g_defaultCommandArg = argv[cmdidx]; + + if (listfind(g_defaultCommands, g_defaultCommandArg) == -1) { - g_defaultcommand = - "#define DEFCOM \"" + g_defaultcommandArg + "\"\n"; - if (g_defaultcommandArg == "library") - g_version = 0; + printf("Initial command `", g_defaultCommandArg, + "' not supported\n"); + exit(1); } - else - printf("Ignored initial command `", g_defaultcommandArg, - "' for icmbuild\n"); + + if (g_defaultCommandArg == "library") + g_version = 0; + + g_defaultCommand = + "\n" + "#define DEFCOM \"" + g_defaultCommandArg + "\"\n"; } + + md(g_destPath); // install the target dir } int replace(string target) { - while (g_askreplace) + while (g_askReplace) { printf("`", target, "' exists.\n" - "Replace [?akNy] ? "); + "Replace [?akNqy] ? "); string answer = getch(); if (answer == "a") { g_replace = 1; - g_askreplace = 0; + g_askReplace = 0; break; } if (answer == "k") { - g_askreplace = 0; + g_askReplace = 0; break; } if (answer == "y") return 1; + if (answer == "q") + exit(0); + if (answer == "n" || answer == "\n") return 0; - printf("Press `a' to replace all,\n" - " `k' to keep all current versions\n" - " `n' to keep current version (default)\n" - " `?' shows this help\n"); + printf("Press `a' : replace ", target, " and ALL remaining files,\n" + " `k' : KEEP ", target, " and all remaining files\n" + " `n' : (or press Enter) do NOT replace ", target, + " (default)\n" + " `q' : QUIT (do NOT replace ", target, + ", and END icmstart NOW)\n" + " 'y' : REPLACE ", target, "\n" + " `?' : show this help\n"); } return g_replace; } -int install(string target) -{ - return (int)(!exists(target) || replace(target)); -} - -int install_dest(string source, string dest) +int install(string dest, string target) { - if (!isFileOrDir(source)) - die("Can't find `" + source + "'\n"); - - if (dest == "") - dest = change_path(source, g_destpath); - else - dest = g_destpath + dest; - - int idx = strlen(dest) - 1; - - if (dest[idx] == "/") - dest = resize(dest, idx); - - if (install(dest)) - { - md(get_path(dest)); - syscall("cp -rd " + source + " " + dest); - return 1; - } - - return 0; + return (int)(!exists(target) || replace(dest)); } - // a line in the conffile may be organized as follows (except for empty - // lines and comment lines starting at # in column 0) - // name is either a file or a directory; directories are copied - // completely. - // name - skelpath/name is installed as destpath/name - // ./path/name - $cwd/path/name is installed as destpath/name - // /path/name - /path/name is installed as destpath/name - // a second entry may be dest (path OK): destpath/dest will be the - // destination. E.g.: - // name one/two - skelpath/name is installed as destpath/one/two - // All lines may start with a P (+space) or L (+space). - // A source at a P-line is not installed when using 'icmstart xxx library' - // A source at an L-line is not installed when using 'icmstart xxx - // program' If omitted the source is installed unconditionally. - // Following P or L (+space) an optional ? (+ space) may be specificed - // in which case the installation must be confirmed by the user -int install_file(string source, string dest) +int install_file(string realSource, string dest, string realDest) { - if (source[0] == ".") - source = g_cwd + source; - else - { - int idx = strfind(source, "/"); + if (!install(dest, realDest)) + return 0; - if (idx == -1) - source = g_skelpath + source; - else if (idx > 0) - source = g_cwd + source; - } - return install_dest(source, dest); + md(get_path(realDest)); + syscall("cp -rd " + realSource + " " + realDest); + g_installed += (list)realDest; + return 1; } string find(string path, string file) { string ret = path + "/" + file; - if (exists(ret)) - return ret; - - return ""; + return exists(ret) ? ret : ""; } string findFile(string file) { string ret; - if (g_confpath != "") // locate file in -c path - ret = find(g_confpath, file); + if (g_confPath != "") // locate file in -c path + ret = find(g_confPath, file); if (ret == "") // not found, locate in $HOME ret = find(g_home, file); @@ -317,9 +318,9 @@ string ret = findFile(file); if (ret != "") - system("cat " + ret + " >> " + g_destpath + "VERSION"); + system("cat " + ret + " >> " + g_destPath + "VERSION"); else - fprintf(g_destpath + "VERSION", + fprintf(g_destPath + "VERSION", "#define ", file, " \"", default, "\"\n"); } } @@ -329,11 +330,11 @@ if (!g_version) return; - string str = g_destpath + "VERSION"; + string str = g_destPath + "VERSION"; - if (install(str)) + if (install("VERSION", str)) { - system(P_NOCHECK, "rm -f " + g_destpath + "VERSION"); + system(P_NOCHECK, "rm -f " + str); install_conf("AUTHOR", ""); install_conf("VERSION", "0.00.00"); @@ -343,49 +344,38 @@ } } -void install_std() +void defaultCommand() { - install_version(); // install a default command if - // provided as last arg. - if (install_file("icmconf", "") && g_defaultcommand != "") - fprintf(g_destpath + "icmconf", g_defaultcommand); + if (g_defaultCommand != "") // provided as last arg. + fprintf(g_icmconf, g_defaultCommand); // for libraries: uncomment the // #define LIBRARY spec, and // comment out #define MAIN - if (strfind(g_defaultcommand, "library") != -1) + if (strfind(g_defaultCommand, "library") != -1) syscall("sed -i '\n" "s?^//\\(#define LIBRARY\\)?\\1?\n" "s?^\\(#define MAIN\\)?//\\1?\n" - "' " + g_destpath + "icmconf"); + "' " + g_icmconf); if (!g_version) // uncomment syscall("sed -i '\n" // #define USE_VERSION "s?^\\(#define USE_VERSION\\)?//\\1?\n" - "' " + g_destpath + "icmconf"); + "' " + g_icmconf); } -int confirminstall(string source, string dest) +int confirmInstall(string source, string dest) { - if (g_confirminstall) - { - if (source == dest) - printf("Install `", dest, "' [yN] ? "); - else - printf("Install `", source, "' as `", dest, "' [yN] ? "); - return getch() == "y"; - } - - return 1; -} + if (!g_confirmInstall) + return 1; -string check_home(string source) -{ - if (source[0] != "~") - return source; + if (source == dest) + printf("Install `", dest, "' [yN] ? "); + else + printf("Install `", source, "' as `", dest, "' [yN] ? "); - return g_userHome + substr(source, 1, strlen(source)); + return getch() == "y"; } list shift(list source) // shift away the first element @@ -398,76 +388,91 @@ return ret; } + // ignore 'P' for library construction, + // ignore 'L' for program construction + // do not ignore the 'D' specificied entries +int ignoreEntry(string install) +{ + return + (int) + ( + g_basic && strchr(install, "b") != -1 + || + strchr(install, "D") == -1 // not by default + && + ( + g_defaultCommandArg == "library" && strchr(install, "P") != -1 + || + g_defaultCommandArg == "program" && strchr(install, "L") != -1 + ) + ); +} // a line in the conffile may be organized as follows (name is either // a file or a directory; directories are copied completely): - // name - name is located in skelpath and installed at destpath - // name dest - name is located in skelpath and installed at destpath/name + // name - name is located in skelPath and installed at destPath + // name dest - name is located in skelPath and installed at destPath/name // if name is a directory then the destination will be - // destpath/dest/name. dest may also be /dest + // destPath/dest/name. dest may also be /dest // path/name - relative or absolute path's name will be installed at - // destpath. Relative is relative to the startup directory + // destPath. Relative is relative to the startup directory // path/name dest - relative or absolute path's name will be installed - // at destpath/dest. dest may also be /dest - // All lines may start with a P (+space) or L (+space). - // A source at a P-line is not installed when using 'icmstart xxx library' - // A source at an L-line is not installed when using 'icmstart xxx - // program' If omitted the source is installed unconditionally. - // Following P or L (+space) an optional ? (+ space) may be specificed - // in which case the installation must be confirmed by the user - + // at destPath/dest. dest may also be /dest + // All lines may start with a P, L, D, or b. + // b and D may also be added to P or L + // A source at a P-line is installed when using 'icmstart xxx program' + // A source at an L-line is installed when using 'icmstart xxx library' + // A source at a D line, or a source withoug P,L,D prefixes is + // unconditionally installed. + // A source at a b-line is ignored with the -b (basic) flag + // Following a P,L,D,b combination (+space) an optional ? (+ space) may be + // specificed in which case installation of the source must be confirmed + // by the user void install_line(string confline) { list fields = strtok(confline, " \t\n"); string source = fields[0]; - // empty line or comment + // ignore empty line or comment if (listlen(fields) == 0 || source[0] == "#") return; + // remove any P/L/D flags string install = source; - if (install == "P" || install == "L") + if (listfind(g_actions, install) == -1) + install = ""; + else { - fields = shift(fields); // rm the P/L-flag + fields = shift(fields); source = fields[0]; } - else - install = ""; - g_confirminstall = source == "?"; // need confirmation ? + g_confirmInstall = source == "?"; // need confirmation ? - if (g_confirminstall) + if (g_confirmInstall) { fields = shift(fields); // rm the ?-mark source = fields[0]; } - if - ( - g_defaultcommandArg == "library" && install == "P" - || - g_defaultcommandArg == "program" && install == "L" - ) - return; // no P with libs, no L with progs + if (ignoreEntry(install)) + return; + + string realSource = absSource(source); string dest = listlen(fields) > 1 ? fields[1] : source; + string realDest = absDest(dest); - source = check_home(source); - dest = check_home(dest); + if (listfind(g_installed, realDest) != -1) // already processed 'dest' + return; - if (!g_replace && !g_askreplace && exists(g_destpath + dest)) + if (!g_replace && !g_askReplace && exists(realDest)) return; - if (!confirminstall(source, dest)) + if (!confirmInstall(source, dest)) return; - install_file(source, dest); -} - -int last(string haystack, string needle) -{ - list entry = strtok(haystack, " \t\n"); - return entry[listlen(entry) - 1] == needle; + install_file(realSource, dest, realDest); } void install_rc() @@ -478,36 +483,24 @@ die("Can't find configuration file `icmstart.rc'"); while (list line = fgets(conffile, line)) - { - string file = line[0]; + install_line(line[0]); - if - ( - !( - g_basic && // don't install version/usage for basic - (last(file, "version.cc") || last(file, "usage.cc")) - ) - ) - install_line(file); - } + install_version(); + defaultCommand(); } -int main(int argc, list argv) +void main(int argc, list argv) { echo(OFF); - g_program = get_base(argv[0]); - if (argc == 1) usage(); arguments(argc, argv); - install_std(); // install CLASSES VERSION and icmconf - install_rc(); // install .rc file elements - printf("Done. Don't forget to inspect the #defines in\n" - "'", g_destpath, "icmconf'\n"); + printf("Done. Don't forget to inspect the #defines in " + "'", g_destSpec + "/icmconf'\n\n"); } diff -Nru icmake-8.00.05/usr/share/icmake/icmconf icmake-8.01.00/usr/share/icmake/icmconf --- icmake-8.00.05/usr/share/icmake/icmconf 2015-12-17 17:45:57.000000000 +0000 +++ icmake-8.01.00/usr/share/icmake/icmconf 2016-02-01 14:36:51.000000000 +0000 @@ -65,8 +65,10 @@ //#define CC "gcc" // The compiler options to use. Define CFLAGS instead if a C compiler is - // used. -#define CXXFLAGS " --std=c++14 -Wall -g -O2" + // used. + // To suppress colored error messages add option -fdiagnostics-color=never + // To add debug-code to object files add option -g +#define CXXFLAGS " --std=c++14 -Wall -O2" //#define CFLAGS " -Wall -g -O2" // The extension of internal header files. See PRECOMP below @@ -99,15 +101,17 @@ // DEFINES RELATED TO USING A PARSER GENERATOR // =========================================== + // The subdirectory containing the parser's specification file + // If this directive is REMOVED, then all parser-related #defines + // can also be removed from icmconf. +#define PARSER_DIR "" + // What is the program generating a parser? #define PARSGEN "bisonc++" // Flags to pass to PARSGEN: #define PARSFLAGS "-V" - // The subdirectory containing the parser's specification file -#define PARSER_DIR "" - // What is the top-level (or only) grammar specification file? #define PARSSPEC "grammar" @@ -123,15 +127,17 @@ // DEFINES RELATED TO USING A SCANNER GENERATOR // ============================================ + // The subdirectory containing the scanner's specification file + // If this directive is REMOVED, then all scanner-related #defines + // can also be removed from icmconf. +#define SCANNER_DIR "" + // What is the program generating the lexical scanner? #define SCANGEN "flexc++" // Flags to provide SCANGEN with: #define SCANFLAGS "" - // The subdirectory containing the scanner's specification file -#define SCANNER_DIR "" - // Name of the lexical scanner specification file #define SCANSPEC "lexer" diff -Nru icmake-8.00.05/VERSION icmake-8.01.00/VERSION --- icmake-8.00.05/VERSION 2015-12-21 13:08:36.000000000 +0000 +++ icmake-8.01.00/VERSION 2016-02-01 14:36:51.000000000 +0000 @@ -1,2 +1,2 @@ -VERSION=8.00.05 -YEARS=1992-2015 +VERSION=8.01.00 +YEARS=1992-2016