icmake-10.03.00/bootstrap/0000755000175000017500000000000014204126770014170 5ustar frankfrankicmake-10.03.00/bootstrap/functions0000644000175000017500000000450614204126313016121 0ustar frankfrank# sourced by the various icm_bootstrap shell scripts try() { echo " $*" $* || exit 1 } subdirs() { [ "`find ./ -mindepth 1 -maxdepth 1 -type d -name ORG`" != "" ] && return for subdir in `find ./ -mindepth 1 -maxdepth 1 -type d` ; do try cd $subdir add=0 srclist=`find -mindepth 1 -maxdepth 1 -type f -name '*.cc' \ -exec basename '{}' ';'` if [ "$srclist" != "" ] then ih=${subdir}.ih if [ ! -e ${ih}.gch ] ; then try ${CXX} ${CXXFLAGS} -x c++-header $ih fi for src in `find -mindepth 1 -maxdepth 1 -type f -name '*.cc' \ -exec basename '{}' ';'` ; do obj=../${dir}${src%%.*}.o if [ $src -nt ${obj} ] ; then try ${CXX} ${CXXFLAGS} -o${obj} -c $src fi add=1 done fi let dir=${dir}+${add} try cd .. done } maindir() # $1: destination program path, { # unused: $2: optional -s, use LDFLAGS for src in `find -mindepth 1 -maxdepth 1 -type f -name '*.cc' \ -exec basename '{}' ';'` ; do if [ "$src" != "main.cc" ] ; then obj=${src%%.*}.o if [ $src -nt ${obj} ] ; then try ${CXX} ${CXXFLAGS} -o${obj} -c $src fi fi done ls *.o > /dev/null 2>&1 if [ $? -ne 0 ] ; then try ${CXX} ${CXXFLAGS} -o ../tmp${1} main.cc ${LDFLAGS} else try ${CXX} ${CXXFLAGS} -o ../tmp${1} *.o main.cc \ -L../tmp -lsupport -lbobcat ${LDFLAGS} fi } build() { program=$1 shift rm -f *.o */*.o NR=1 for x in $* ; do try cd $x echo -n . try ${CXX} ${CXXFLAGS} -c *.cc for file in *.o do try mv $file ${NR}$file done try cd .. let NR=${NR}+1 done echo -n . try ${CXX} ${CXXFLAGS} -c *.c echo -n . try ar crs ../tmp/lib${program}.a */*.o echo -n . try ${CXX} -o ../tmp/${LIBDIR}/${program} *.o -l${program} -lsupport \ -L../tmp ${LDFLAGS} echo -n . rm *.o */*.o ../tmp/lib${program}.a echo . } icmake-10.03.00/bootstrap/flags0000644000175000017500000000046514204126770015214 0ustar frankfrank# sourced by the various bootstrap functions if [ ! -e ../tmp/INSTALL.sh ] ; then echo ../tmp/INSTALL.sh does not exist: execute ./icm_prepare exit 1 fi . ../tmp/INSTALL.sh if [ "${CXXFLAGS}" == "" ] ; then CXXFLAGS=" --std=c++20 -Wall -O2 " fi if [ "${CXX}" == "" ] ; then CXX="g++" fi icmake-10.03.00/build0000755000175000017500000000161614204126313013175 0ustar frankfrank#!/bin/bash # action is clean, distclean or a base directory (e.g., /) action=$1 if [ "$action" == "distclean" ] ; then echo rm -rf tmp rm -rf tmp action=clean fi # distclean falls through into 'clean' to remove the subdir's # tmp dirs if [ "$action" == "clean" ] ; then for dir in support comp exec pp dep un icmake icmbuild do cd $dir echo -n "cd $dir; " icmbuild clean cd .. done exit 0 fi if [ ! -e tmp/INSTALL.im ] ; then if [ "$action" == "" ] ; then echo " First run ./icm_prepare, specifying a base directory for icmake (e.g. /), or restart $0, and specify a base directory as its first command-line argument, e.g., '$0 /' " exit 1; fi ./icm_prepare $action fi for dir in support comp exec pp dep un icmake icmbuild do cd $dir echo $dir icmbuild || exit 1 cd .. done icmake-10.03.00/changelog0000644000175000017500000010131014204243504014014 0ustar frankfrankicmake (10.03.00) * On little-engine architectures icmake 10.02.00 should not be used as it only writes the least significant bytes of multi-byte values to its .bim files. This error was repaired in version 10.03.00 -- Frank B. Brokken Sat, 19 Feb 2022 20:38:21 +0100 icmake (10.02.00) * Daniel Bungert noticed that icmake couldn't be used on big-endian architectures (like the s390x emulator). The bug was caused by icmake using little-endian number representations in its .bim files. Starting this version little-endian number representations are still used in the .bim files, but on big-endian acrchitectures numbers are converted to little-endian representations before writing them to the .bim files and converted to big-endian representations when reading numbers from .bim files. * A cosmetic flaw was fixed in the output of the icmake unassembler. -- Frank B. Brokken Fri, 18 Feb 2022 16:47:01 +0100 icmake (10.01.00) * Simplified -t argument handling in icmake * The icmake program (again) recognizes but ignores the -q option. Existing icmake scripts specifying -q should not be processed by icmake 10.00.00. Icmake users are advised to remove -q options from their icmake scripts. * Calling icmake without action option results in an error. -- Frank B. Brokken Tue, 29 Jun 2021 09:51:33 +0200 icmake (10.00.00) * Icmake and its support programs now converted to C++ * Added a new manpage: icmscript(7), describing the syntaxis, construction and predefined support functions and other characteristics of icmake scripts. * Added new options --no-process (-N), --unassemble (-u), and --verbose (-V) to icmake, * Icmake's option --summary) (-F) has been discontinued. * Added new options --no-version-check (-n) to icm-exec and icmun * Added new option -P (no pre-processing) to --compile and --force * The --source short option -i has been replaced by -s; * The predefined functions printf and fprintf also support the << insertion operator (comparable to C++'s std::ostream class). * Changed the organization of the class-dependencies matrices shown by 'icmake -d' (icm_dep), simplifying visual inspection of circular class-dependencies * Fixed a flaw in handling precompiled headers in the std. icmbuild script causing precompilation of modified headers at the second icmbuild run. -- Frank B. Brokken Tue, 14 Jun 2021 08:29:07 +0200 icmake (9.03.01) * The file 'version.cc' wasn't correctly recognized in /usr/lib/icmake/icmbuild: fixed in this release. * Fixed unintended termination of /usr/lib/icmake/icmbuild caused by non-existing .gch files (when PRECOMP was specified; this happened when a directory only contained a header, but no sources). -- Frank B. Brokken Mon, 13 Jan 2020 10:08:17 +0100 icmake (9.03.00) * Added list constants ( '[' string+ ']' ) to the grammar * Changed icm-exec's int comparison function: returns 1 if equal, 0 if not * Redesigned icm-comp's implementation * Precompiled headers are now stored under TMP_DIR * Added icmbuild commands cleantmp and cleangch * icmbuild options -c can only be specified when building libraries or programs * Stripping (-s) can only be specified when installing * The icmbuild strip command is discontinued: use -s instead * The icmbuild script was reorganized: its functions are now in the distribution in the ./scripts/ib directory * The icmbuild command in the distribution is created from the scripts/icmbuild.in and scripts/ib files by scripts/catim * The icmconf file's directives related to using a lexical scanner can be specified independently from the directives related to using a parser generator (and vice versa) * The standard icmake skeleton files specify namespace Icmake instead of the previously used namespace Icmbuild. * All manpages received a full overhaul -- Frank B. Brokken Sun, 12 Jan 2020 14:11:58 +0100 icmake (9.02.09) * Updated the man-pages -- Frank B. Brokken Mon, 09 Sep 2019 16:10:38 +0200 icmake (9.02.08) * Migrated from Github to Gitlab -- Frank B. Brokken Mon, 25 Jun 2018 10:18:20 +0200 icmake (9.02.07) * Using ctrl-C while executing icmstart no longer requires a terminal reset when using bash as command shell (in fact: icm-exec restores the initial terminal (stdin) configuration when terminated by ctrl-C). * The man-pages contain warnings that path names containing blanks are not supported. -- Frank B. Brokken Thu, 15 Mar 2018 20:55:48 +0100 icmake (9.02.06) * Fixed icmbuild's install command wrt installing libraries -- Frank B. Brokken Wed, 31 Jan 2018 16:17:49 +0100 icmake (9.02.05) * Removed an error (#-lines are comment) in the icmconf(7) man-page -- Frank B. Brokken Thu, 25 Jan 2018 09:05:47 +0100 icmake (9.02.04) * DEFCOM lines are not anymore appended to existing 'icmconf' files if its Replace request is answered by k or N. -- Frank B. Brokken Sun, 10 Dec 2017 09:17:54 +0100 icmake (9.02.03) * stdarg.h is needed in rss.h: inclusion moved from rss.ih to rss.h * updated the usr/share/icmake/icmconf file -- Frank B. Brokken Thu, 02 Nov 2017 09:18:16 +0100 icmake (9.02.02) * Fixed an annoying typo in [/usr/lib/icmake/]icmbuild. Do not use 9.02.01 -- Frank B. Brokken Tue, 01 Nov 2016 13:40:42 +0100 icmake (9.02.01) * Fixed a flaw in [/usr/lib/icmake/]icmbuild: when DEFCOM "library" was defined in icmconf, and precompiled headers were requested, then MAIN had to be defined as well. This is not required anymore. -- Frank B. Brokken Tue, 01 Nov 2016 09:54:11 +0100 icmake (9.02.00) * icmbuild now is a small program, providing help or starting the icmbuild script in LIBDIR (cf. INSTALL) * Man-pages were updated * Cosmetic changes to icmake --help's output * The name of the optional configuration file YEAR was changed to YEARS (as it defines YEARS, not YEAR) * `icmconf' was added to /etc/icmake/icmstart.rc * As mentioned in icmake's man-page the program `icmun' is mainly used in some specific situations. In icmake's daily practice it isn't used. Therefore it was moved from the standard binary programs directory to icmake's LIB directory (commonly /usr/lib/icmake). * The file /etc/icmake/icmake.rc was nowhere used and was removed. -- Frank B. Brokken Sun, 25 Sep 2016 12:36:07 +0200 icmake (9.01.00) * Man-pages weren't properly updated at 9.00.00. This was fixed in this release. -- Frank B. Brokken Sat, 03 Sep 2016 15:10:43 +0200 icmake (9.00.00) * Added support program icm-dep computing dependencies for USE_ALL classes and precompiled headers, called from /usr/bin/icmbuild, or directly using icmake's option --icm-dep (-d) * Icmake supports several long options in addition to the standard short options. See icmake(1) for details. * Changed references to IS_* into O_* in icmake(1)'s man-page. The IS_ entries were already unavailable, but the man-page still referred to them. Now fixed. * Contents of lines in CLASSES beyond the first word are no longer interpreted. * Added new option NO_PRECOMP_WARNING to icmconf * Option -b was removed from icmake. * The built-in function makelist(mask, [younger,older], referencefile) is now operational (was mentioned in icmake's man-page, but wasn't implemented before). * Repaired a bug in substr that could segfault. * Man-pages updated. Icmbuild(1) contains a description of the icm-dep program. -- Frank B. Brokken Sat, 23 Jul 2016 20:55:33 +0200 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: #define PRECOMP "-x c++-headers" must be #define PRECOMP "-x c++-header" * Fixed a bug in the implementation of the '#undef IDENTIFIER' preprocessor directive causing intermittend errors on amd64 architectures: instead of removing the entry from the table of defined identifiers the id of the item to undefine is simply changed into an empty string. A bit of a kludge, but it solves the problem. -- Frank B. Brokken Mon, 21 Dec 2015 14:12:03 +0100 icmake (8.00.04) * Fixed handling of line continuation backslashes (\$) in icm-pp -- Frank B. Brokken Fri, 11 Dec 2015 22:01:51 +0100 icmake (8.00.03) * Fixed an erroneously placed variable definition in icmbuild.in * Fixed too late assignment of a function's address into its symtab record due to which functions could not recursively be called. icmake (8.00.02) * Fixed a leftover size_t / unsigned mismatch on amd64 architectures. -- Frank B. Brokken Tue, 08 Dec 2015 19:23:40 +0100 icmake (8.00.01) * Fixed size_t / unsigned mismatches on amd64 architectures. * Applied patches provided by Tony Mancill. Thanks, Tony :-) -- Frank B. Brokken Tue, 08 Dec 2015 10:55:36 +0100 icmake (8.00.00) * This release adds several new builtin functions, which required a redefinition of the builtin function codes. Because of this existing .bim files must be recompiled from their .im source files. * Martin Dorwig suggested several additions to icmake's run-time support functions. In particular facilities for formatted string construction and formatted printf functions. Many of his suggestions were implemented in version 8.00.00, which now offers several new built-in functions (get_dext, length, resize, strformat, trim, trimleft, trimright (see icmake(1) for details)). * The functions fprintf and printf now support a format string as their first argument, in which %-notations refer to subsequent argument numbers (see icmake(1) for details). * The 16 bit offset limit was removed from fgets. Also, fgets's signature changed. See icmake(1) for details. * Added the 'continue' statement/keyword to the flow constrol statements. It can be used inside while and for statements. * Added the ternary operator (?:) to the set of supported operators. * Global variable initialization can now use expression statements, not just constant expressions. * Local variables can be defined and immediately initialized anywhere inside functions. Multiple local variables (of the same type) can be defined in the initialization section of a for-statement, A single variable can be defined in the condition clause of if- and while-statements. If not explicitly initialized such variables represent a `false' condition. * Character constants are supported and are converted to single-character string constants. Conversely, single-character string constants can be used in int-expressions. In that case their values are equal to the int-values of their (first) characters. * The main() functions in icmake scripts now by default return 0. * Fixed a bug in the printf family of functions: these functions now return the number of printed arguments (as documented in icmake(1)'s man-page). * Fixed a bug in handling decrement and increment operators: previously their resulting wasn't pushed on the stack when used in return statements, causing a stack underflow. * Fixed a bug in the icm-pp precompiler: multiple #defines of the same identifier are not accepted anymore. Multple #undefines are OK, but an #undefine generates a warning if it doesn't refer to a currently #defined identifier. * Drive specifiers are not supported anymore * The function glob() is now assumed available. * The internal code organization in the rss, icm-pp, icm-comp, and icm-exec directories was significantly changed. Code belonging together is now collected in its own subdirectory, where the subdir-name is used as first part of the name of `public' functions (but their source names do not start with the subdir name. E.g. symtab_push is found in symtab/push.c). Support functions inside a directories start with an abbreviated subdir-name, both in their names and in their source filenames (e.g., st_addVar is found in symtab/staddvar.c). Also, within subdirectories 'dirname.ih' files contain all declarations that are required only by the sources in that directory, while 'dirname.h' files contain all declarations required by other parts of icmake programs that use the subdirectory's `public' functions. Because of this reorganization several old files (like rss/ic*h files) became obsolete and were removed. * The -q and -b options are not supported anymore. * The -e option replaces the previously defined -b option. * The -v option shows icmake's version to the standard output stream (terminating icmake). * The -F flag shows which files, and flags are used by icmake, and which actions are going to be performed. * The -T flag can be used to specify a non-default destination directory for temporary files (by default /tmp or (if not available) $HOME is used). -- Frank B. Brokken Sun, 29 Nov 2015 18:35:22 +0100 icmake (7.23.02) * Wow! After > 20 years being used, Martin Dorwig found a bug in icm_pp's getident() function: it didn't accept digits in identifiers. It's fixed in this release, now implementing the standard definition of an identifier. -- Frank B. Brokken Fri, 16 Oct 2015 14:46:41 +0200 icmake (7.23.01) * Overlooked checking for PRECOMP in icmbuild's precompile() function. Now fixed. -- Frank B. Brokken Thu, 15 Oct 2015 16:45:39 +0200 icmake (7.23.00) * Updated CXXFLAGS in generated icmconf files to contain --std=c++14 * Added the define //#define PRECOMP "-x c++-header" to icmconf files. When activated, internal header files are precompiled when they are more recent than their precompiled versions. * Added the define #define IH ".ih" to icmconf files, specifying the extension of internal header files. It is used by PRECOMP. * Reorganized the #defines in the icmconf mold file so that related #defines are easily recognized. -- Frank B. Brokken Thu, 15 Oct 2015 14:52:21 +0200 icmake (7.22.01) * The `ar' program in binutils >= 2.25.7 generates a warning when the u modifier is used in combination with the r option. Icmake's icmbuild script previously used 'ar cru'. To prevent the warning, 'ar cr' is now used. -- Frank B. Brokken Sat, 16 May 2015 20:35:40 +0200 icmake (7.22.00) * `icmstart dir library' uncomments the library construction spec. and comments out the main.cc spec. in icmconf * `icmstart -b ...' (basic installation), won't install the default VERSION, usage.cc and version.cc files * `icmstart -b ...' and `icmstart ... library comments out the line #define USE_LIBRARY in icmconf. * The default g++ compiler flags now specify c++14 * Added the file 'required' summarizing the software which was used for building icmake. * The entry //#define EXTENSION ".exe" was removed from INSTALL.im as it's apparently no longer required for systems like cygwin. In cases the .exe extension is needed, rename the binaries accordingly after building them. * Removed -D__STDC_VERSION__=199901L from the flex call in ./comp/build -- Frank B. Brokken Tue, 20 Jan 2015 15:53:40 +0100 icmake (7.21.01) * By default, ./icm_bootstrap no longer specifies -g when compiling icmake's sources. If you *want* to use the -g flag, define an environment variable CFLAGS. E.g., CFLAGS="-Wall -O2 -g". * Applied Colin Herbert's patches (to see Colin's patches use the prefix https://gist.gitlab.com/ColinHebert/): Removed the redundant definition of __STDC_VERSION__ from lexer.c: 1377507/raw/545a60cb39105c80d97e543dc77e00ab7ecbb5ff/lexer.c.diff Removed the hard coded path to CONFDIR: 1377533/raw/c7cb3f768deafa8c2e393bed1f5d4acd42edc7bd/icm_install.diff * The above changes were suggested by Florian Franzen. Thanks! -- Frank B. Brokken Mon, 20 Jan 2014 11:00:27 +0100 icmake (7.21.00) * Repaired segfaults found in icmake, icm-exec, and icmun by Alexandre Reber. -- Frank B. Brokken Tue, 30 Jul 2013 16:49:58 +0200 icmake (7.20.00) * added missing '\n' to the strtok call in icmbuild's 'dependenciesOf' function * line continuation in CLASSES results in one line being counted in the icmbuild script. * Added suggestions by Johann 'Myrkraverk' Oskarsson about compiling icmake on solaris (in ./contributions/solaris) -- Frank B. Brokken Sat, 09 Mar 2013 14:48:45 +0100 icmake (7.19.00) * build scripts for constructing icmake now support the CC environment flags as well. CC defines the C-compiler to use. * icmbuild script's COMPILER and COMPILER_OPTIONS variables should be considered obsolete, and are overruled by CXX and CXXFLAGS, defining the C++ compiler and flags or CC and CFLAGS, defining the C compiler and flags in that order. -- Frank B. Brokken Mon, 16 Jul 2012 15:39:52 +0200 icmake (7.18.00) * Fine-tuned icmbuild so that only used USE_ALL files are removed instead of all files named so * The initial program files installed by default by icmstart assume that the flexc++ scanner generator (0.93.00) and the bisonc++ parser generator (>= 3.00.00) is available. * The documentation about class dependency handling was improved -- Frank B. Brokken Wed, 22 Feb 2012 14:06:48 +0100 icmake (7.17.00) * Changed (mproved/repaired) the directory dependencies handling (as defined in CLASSES) by icmbuild.in; improved the readability of icmbuild's output. * Updated YEAR(S) information in VERSION and ./usr/share/icmake/version.cc to 2012. -- Frank B. Brokken Tue, 03 Jan 2012 17:39:28 +0100 icmake (7.16.01) * Removed erroneous -o from '-fPIC -o' in icmbuild at line 450 in icmbuild.in -- Frank B. Brokken Wed, 28 Sep 2011 20:41:33 +0200 icmake (7.16.00) * `icm_bootstrap' script now recognizes CFLAGS and LDFLAGS environment variables for, resp. gcc and ld flags. * icmbuild script now correctly interprets class dependencies defined in CLASSES and correctly interprets USE_ALL (see `man icmconf') * `icmbuild' script now recognizes (configurable) CXXFLAGS and LDFLAGS for, resp. g++ and ld flags. Default values are defined in the program's 'icmconf' file. * By default the COMPILER setting now includes --std=c++0x and -Wall, preventing accidental omission by CXXFLAGS. * The default file name suggested for USE_ALL is 'a' (e.g., class/a) * Documentation was updated (in particular the `icmconf' man-page) -- Frank B. Brokken Fri, 24 Jun 2011 20:29:38 +0200 icmake (7.15.00) * AUTHOR, VERSION and YEAR removed from /etc/icmake, see icmstart(1) * Double installation of changelog.gz prevented * /usr/share/doc/icmake/mail.frank removed from the installation * icmstart.rc supports optional P and L flags for program and library only icmake project installations. See icmstart.rc(7) * Using standard x.yy.zz version number format -- Frank B. Brokken Mon, 14 Feb 2011 20:56:28 +0100 icmake (7.14.1) * Added test for defined SHAREDREQ to icmbuild -- Frank B. Brokken Mon, 17 Jan 2011 20:29:51 +0100 icmake (7.14.0) * Repaired segfault error caused by calling an underfined function (comp/callfun.c) * Removed compiler warning about dangerous casts from comp/outcode.c and comp/patchup.c by defining a union for char[2] and int16_t, rather than casting the char[2] to int16_t. * Defined icm_prepare, called from icm_bootstrap and rss/build to prepare the tmp/ directory * The separate 'build' icmake scripts were still expecting librss.a. Changed to the proper library name: libicrss.a * Modified the shared library construction function to use the linker flag --as-needed, repaired the 'defs' flag spelling (was: def), added the icmconf entry SHAREDREQ to contain the names and paths of libraries required by the shared library, and the shared library construction is now using COMPILER (rather than gcc) to construct the shared library with. * added the `ALL' facility to icmbuild, allowing the specification of a class dependency graph in the CLASSES file. * Added the icmconf(7) man page -- Frank B. Brokken Fri, 14 Jan 2011 13:19:59 +0100 icmake (7.13.1) * Manpages in release 7.13.0 were not refreshed. Now repaired. -- Frank B. Brokken Sun, 03 Oct 2010 14:42:48 +0200 icmake (7.13.0) * the icmconf file has a (default not active) #define REFRESH that may be activated when a binary program is created. When active a new binary is always created even if no source was compiled. This may be useful when the program uses a library that is actively under development and is frequently changed. * the icmbuild script offers the option -c doing a 'tput clear' (clear screen) just before starting the build process. The icmconf #define CLS, by default not active, accomplishes the same. * /etc/icmake/VERSION contains 2010 -- Frank B. Brokken Sat, 02 Oct 2010 15:52:09 +0200 icmake (7.12.5) * added missing test for modified SCANSPEC (lexer) file in scripts/icmbuild. -- Frank B. Brokken Wed, 23 Dec 2009 10:44:30 +0100 icmake (7.12.4) * repaired lacking directory recognition in scripts/icmstart.im * removed `return 0;' from usr/share/icmake/main.cc as 0 is returned by default * replaced endl by `\n' in usr/share/icmake/usage.cc * changed the location of the main repository in make/about.c -- Frank B. Brokken Tue, 22 Dec 2009 14:53:53 +0100 icmake (7.12.3) * applied the patch given in Debian bug report #537574 -- Frank B. Brokken Wed, 29 Jul 2009 13:22:13 +0200 icmake (7.12.2) * icmbuild touches 'version.cc' only if it exists. * The built-in function 'gets()' will now remove a trailing \n as per the icmake man-page -- Frank B. Brokken Fri, 17 Jul 2009 13:20:33 +0200 icmake (7.12.1) * icm-pp supports the #undef directive * updated icmake's release year to 1992-2009. * library construction contains code to create a shared library as a new option that can be specified in icmconf * the top-level directory has been reorganized. See INSTALL and QUICKINSTALL for details. Icmake's initial construction uses `icm_bootstrap' and prepares an icmake installation under ./tmp/ * installation of (parts of) icmake constructed by `icm_bootstrap' is done using `icm_install'. * added `where-is-what' giving an overview of what the various top-level files and directories are for. * configuration files for icmstart are found in the following locations (in order, accepting the first file(s) found: (1) determined by -c (2) in $HOME/.icmake (3) found in /etc/default/icmake. * the previously used `def/destinations' file is not used anymore. * the file `icmconf' has been modified (see icmbuild(1)), allowing, e.g., multiple lexical scanner specification files. * documentation adapted. * new man-page: icmstart.rc(7). -- Frank B. Brokken Tue, 14 Apr 2009 13:00:51 +0200 icmake (7.11.1) * Introduced a three-digit version number: major, minor and subreleases. * Updated icmbuild sources to 2008. * The Gnu g++ flags for the upcoming c++0x standard are now mentioned in icmconf. icmake (7.11) * Fixed missing dead[0] initialization in comp/icm-comp.c Fixed handling of C and C++ comment in strings in icm-pp: The preprocessor now keeps C/C++ comment in string/character constants in #defines allowing for constructions like #define PAT "dir/*" which in earlier versions resulted in an unterminated C comment error. The icmstart and icmbuild scripts are now bisonc++ >= 2.0.0 aware, and grambuild is now effectively superfluous (but still available) Added #define EXTENSION to def/destinations to allow easy compilation in cygwin environments The script icmscripts.sh can be used to recreate the icm-scripts in the bin/ subdirectory. Primarily useful for maintenance. The 'unix' script no longer by default constructs stripped versions of the binary programs, the install.sh by default installs unstripped binaries. The argument 'strip' may be provided to strip the binaries. icmake (7.10) * Removed Superfluous #defines from icm.h #define values may extend over multiple lines, using the \ character as the last character on the line to indicate line-continuation. Applied size_t where applicable, using unsigned otherwise to prevent problematic behavior on some 64 bit architectures. Changed many old-style classic C parameter lists into ANSI C style parameter lists Minor textual repairs to the manual pages. Added the option to compile with extensive compiler flags in the top-level build script. MSDOS is no longer suported by specific code. icmake (7.02) * Repaired a misconfiguration in the bootstrap.sh and install.sh scripts due to which the icmstart and icmbuild scripts weren't properly installed. -- Frank B. Brokken Wed, 21 Feb 2007 14:49:23 +0100 icmake (7.01) * The INSTALL file was updated. So were the scripts bootstrap (now named bootstrap.sh) and unix. Compilation warnings appearing on Mac OS-X were as good as possible removed, some old files and directories were removed or placed in a directory of their own. -- Frank B. Brokken Wed, 07 Feb 2007 15:50:33 +0100 icmake (7.00) * The subdirectory examples is renamed to templates [Above change: Mon, 05 Feb 2007 16:09:46 +0100] Defines (#define) may use other #defined variables to determine their value. icmake's sources may use hexadecimal constants (0xdead) global and local variables may be immediately initialized by constants and/or available functions. Variables cannot be used for the initialization. execute() function repaired: it never succeeded due to invalid return value initial source may or may not have .im extension, as suggested in the general usage info provided by icmake itself. If the specified initial source does not exist, an .im extension is attempted. The IM environment variable may contain several, `:'-delimited paths getenv() implemented: returns list: [0]: ok (or not), [1]: value of the environment variable strlen/strupr/strlwr now defined as rss-functions, no longer as macros strstr renamed to strfind. substr() added, returning a substring from an existing string. (f)printf() now have int-return values (instead of undefined) icmake manual page rewritten added icmbuild script for general program maintenance added icmbuild manual page added icmstart script to start an icmake maintenance project using icmbuild added icmstart manual page the `unix' script will regenerate the parser and the lexical scanner if their specification files have changed. [Above changes: Tue, 21 Sep 2006 14:31:43 +0200] icmcomp uses a resizing rather than a fixed sized buffer to store strings found in an icmake script (used to be a fixed-sized buffer of 100 chars, causing icmcomp to segfault with, e.g., long option lists) -- Frank B. Brokken Sat, 18 Nov 2006 10:34:13 +0100 The type `unsigned' was changed to `size_t' where appropriate Fixed some flaws in the `unix' script, and (??) added icm-exec.c to my local icmake svn repository Added icmstart script to start an icmake project in some subdir Global strings weren't initialized to empty strings. Now they are. -- Frank B. Brokken Sat, 04 Nov 2006 17:41:32 +0100 icmake (6.30) Debian patches up to 6.22-7 processed; more in general: the sources now compile free of warnings chdir("") now returns initial working directory Execution error on the powerpc repaired. Caused by strcmp() sometimes returning a non-zero value having its lowest 16 bits equal to zero. Since icmake internally uses 16-bits int values, this results in a zero value following an int to int16 assignment. See, e.g., exec/string/compare.c During the process of repairing the above error, Icm-exec was completely rewritten. Lintian warning about an error in the icmake.1 manual page repaired Lindian warning about the inappropriate executable mode of examples/defines.im repaired. Newer versions of icmake programs operate fine on existing (older) binary scripts as long as icmake's major version isn't upgraded. Newer versions of binary icmake files remain to be inexecutable with older icmake versions. PRE-ANNOUNCING VERSION 7.00: A major upgrade (to version 7.00) will be released soon. As a prelude: it will define new built-in functions: getenv() and substr() will be completely new, and strstr() will be replaced by the new function strfind(). Existing scripts defining getenv(), substr() and/or strfind() should rename these functions to, e.g., my_getenv() (and comparable) or (possibly) remove these definitions and use the new built-in functions. The distiction between distribution version and program version (see below) is removed. All programs will have the same version as the distribution. NOTE: The version referred to here is the version of the distribution, not of the icmake programs. 6.22 Compiler warnings and the use of gets() removed from the sources All programs now use the same version, which is defined in version.c, which is defined in the rss. Standard manpage (icmake.1) included in the distribution. 6.21 Elf binaries for unix 6.20 Unix-icmake accepts the -t flag, to specify a temporary binary- icmake file. Allowing in unix-environments the riddance of the permanent bim-file. The temporary binary makefile will --in this case-- get the process-id for its extension. 6.18 - 6.19: Not distributed. 6.17b DOS-distribution only: Dependencies on icce.h and sicce.lib removed from the distribution. Programs are *not* affected by this distribution. 6.17 Comment accepted in #define directives, Trailing info on #include lines ignored, Minor changes to documentation files. 6.17 This is as far as our memory reaches: the log of changes before this distribution are lost to future generations... This release never made sunsite or tsx-11. Only ftp.icce.rug.nl got it, and two sub-releases beyond. icmake-10.03.00/comp/0000755000175000017500000000000014204243136013105 5ustar frankfrankicmake-10.03.00/comp/functions/0000755000175000017500000000000014204243136015115 5ustar frankfrankicmake-10.03.00/comp/functions/functions1.cc0000644000175000017500000000013214204126313017506 0ustar frankfrank//#define XERR #include "functions.ih" Functions::Functions() : d_main(0, e_bool) {} icmake-10.03.00/comp/functions/name.f0000644000175000017500000000021314204126313016175 0ustar frankfrank//#define XERR #include "functions.ih" inline string const &Functions::name() const { return isMain() ? s_main : d_overload->first; } icmake-10.03.00/comp/functions/find.cc0000644000175000017500000000033114204126313016336 0ustar frankfrank//#define XERR #include "functions.ih" Functions::Overload const *Functions::find(std::string const &name) const { auto iter = d_functions.find(name); return iter == d_functions.end() ? 0 : &iter->second; } icmake-10.03.00/comp/functions/definemain.cc0000644000175000017500000000061214204126313017517 0ustar frankfrank#define XERR #include "functions.ih" void Functions::defineMain(ExprType type) { d_info = &d_main; if (d_main.returnType != e_bool) Error::msg(Error::MAIN_NO_OVERLOADS); else if (type != e_void and type != e_int) Error::msg(Error::MAIN_RETURN_ERROR); else { d_main.returnType = type; d_main.offset = d_code.size() + sizeof(Header); } } icmake-10.03.00/comp/functions/data.cc0000644000175000017500000000012214204126313016325 0ustar frankfrank//#define XERR #include "functions.ih" string const Functions::s_main{ "main" }; icmake-10.03.00/comp/functions/code.f0000644000175000017500000000011114204126313016164 0ustar frankfrankinline std::string const &Functions::code() const { return d_code; } icmake-10.03.00/comp/functions/maininfo.f0000644000175000017500000000012114204126313017053 0ustar frankfrankinline Functions::Info const &Functions::mainInfo() const { return d_main; } icmake-10.03.00/comp/functions/ismain.f0000644000175000017500000000011014204126313016531 0ustar frankfrankinline bool Functions::isMain() const { return d_info == &d_main; } icmake-10.03.00/comp/functions/functions.h0000644000175000017500000000477414204126313017307 0ustar frankfrank#ifndef INCLUDED_FUNCTIONS_H_ #define INCLUDED_FUNCTIONS_H_ #include #include #include #include "../exprtype/exprtype.h" struct Functions { struct Info { unsigned offset; // location in the code-section ExprType returnType; // return type of this overload std::vector params; // param types of this overload std::vector locals; // types of this overload's local // variables std::string code; // code of this overloaded function }; typedef std::vector Overload; private: typedef std::unordered_map FunMap; FunMap d_functions; std::string d_code; // code of all defined functions // d_code.size() is the offset in the // code-section of the next function Info d_main; // Info of main(). Returntype e_bool: // not defined FunMap::iterator d_overload; // the function that's currently // being defined (not main) Info *d_info; // ->Info of the function that's // currently being defined static std::string const s_main; // main's function name public: Functions(); void define(ExprType type, std::string const &name); void paramType(ExprType type); void checkOverload() const; ExprType type() const; // return type of the current // function bool isMain() const; // true if the current function is // main std::string const &name() const; // name of the current function Overload const *find(std::string const &name) const; void add(std::string const &code); // code of the next function .f std::string const &code() const; // all function code bytes .f Info const &mainInfo() const; // .f private: void defineMain(ExprType type); void checkMainParams() const; }; #include "paramtype.f" #include "ismain.f" #include "name.f" #include "type.f" #include "add.f" #include "code.f" #include "maininfo.f" #endif icmake-10.03.00/comp/functions/define.cc0000644000175000017500000000122614204126313016654 0ustar frankfrank//#define XERR #include "functions.ih" void Functions::define(ExprType type, string const &name) { if (name == "main") defineMain(type); else { // this function's overloads d_overload = d_functions.emplace(name, Overload{}).first; d_overload->second.push_back( Info{ as(d_code.size() + sizeof(Header)), type } ); d_info = &d_overload->second.back(); // ->the Info under // construction xerr(name << " returns " << d_info->returnType); } } icmake-10.03.00/comp/functions/paramtype.f0000644000175000017500000000013014204126313017255 0ustar frankfrankinline void Functions::paramType(ExprType type) { d_info->params.push_back(type); } icmake-10.03.00/comp/functions/icmconf0000777000175000017500000000000014204126313021214 2../../icmconf.dirustar frankfrankicmake-10.03.00/comp/functions/functions.ih0000644000175000017500000000032014204132347017443 0ustar frankfrank#include "functions.h" #include "../../xerr/xerr.ih" #include #include "../../support/header/header.h" #include "../../support/as/as.h" #include "../error/error.h" using namespace std; icmake-10.03.00/comp/functions/checkmainparams.cc0000644000175000017500000000067314204126313020555 0ustar frankfrank#define XERR #include "functions.ih" namespace { initializer_list mainParams{ e_int, e_list, e_list }; } void Functions::checkMainParams() const try { if (d_info->params.size() > 3) throw 1; auto beginReq = mainParams.begin(); for (auto const ¶m: d_info->params) { if (*beginReq++ != (param & e_mask)) throw 1; } } catch (...) { Error::msg(Error::MAIN_PARAMS_ERROR); } icmake-10.03.00/comp/functions/checkoverload.cc0000644000175000017500000000120414204126313020227 0ustar frankfrank//#define XERR #include "functions.ih" void Functions::checkOverload() const { xerr("start"); if (d_info == &d_main) { checkMainParams(); xerr("end 1"); return; } for ( auto begin = d_overload->second.begin(), end = d_overload->second.end() - 1; begin != end; ++begin) { if (begin->params == d_info->params) { Error::msg(Error::AMBIGUOUS_OVERLOAD) << d_overload->first << "'\n"; xerr("end 2"); return; } } xerr("end 3"); } icmake-10.03.00/comp/functions/type.f0000644000175000017500000000011314204126313016235 0ustar frankfrankinline ExprType Functions::type() const { return d_info->returnType; } icmake-10.03.00/comp/functions/add.f0000644000175000017500000000020114204126313016002 0ustar frankfrankinline void Functions::add(std::string const &code) { d_code += code; // add the code of the next function } icmake-10.03.00/comp/functions/frame0000644000175000017500000000007014204126313016124 0ustar frankfrank//#define XERR #include "functions.ih" Functions:: { } icmake-10.03.00/comp/README.generator0000644000175000017500000000555214204126313015756 0ustar frankfrankSee generator/backend.cc for the implementation of writing the binary file ========================================================================== string str = "hello"; int val = 12; void main() { val += strlen(str); } ------------------------------------------------------------------------ Binary file statistics: strings at offset 0x0036 variables at offset 0x003c filenames at offset 0x003e code at offset 0x0014 first opcode at offset 0x0024 'code' starts with the code of all defined functions. The end of the 'code' section defines the 'first opcode' location, where the initialization code of the global variables is appended, which in turn is followed by the code calling main, and a subsequent exit. Variable section dump: variable 0000: string variable 0001: int String constants dump: [0036 (0000)] "hello" Disassembled code: [0014] 07 01 00 push global int [0001] [0017] 07 00 00 push global string [0000] [001a] 1b 23 callrss 23 (strlen) [001c] 1c 01 add sp, 01 [001e] 08 push reg [001f] 11 add [0020] 09 01 00 pop global int [0001] [0023] 23 ret [0024] 06 00 00 push string "hello" [0027] 09 00 00 pop global string [0000] [002a] 05 0c 00 push int 000c [002d] 09 01 00 pop global int [0001] [0030] 21 14 00 call [0014] [0033] 04 push int 0 [0034] 24 pop reg [0035] 1d exit --------------------------------------------------------------------------- 0:version strings globvars filenames --0--1--2--3--4--5--6--7--8--9--A--B--C--D--E--F- 00000000: 39 2E 30 33 36 00 00 00 3C 00 00 00 3E 00 00 00 9.036...<...>... 1st opcode: initializes the global variables, then prepares for calling main, then pops main's reg and exits 1st function code byte starts at 14 --0--1--2--3--4--5--6--7--8--9--A--B--C--D--E--F- 00000010: 24 00 00 00 07 01 00 07 00 00 1B 23 1C 01 08 11 $..........#.... 24: 1st opcode byte: initialization of global vars --0--1--2--3--4--5--6--7--8--9--A--B--C--D--E--F- 00000020: 09 01 00 23 06 00 00 09 00 00 05 0C 00 09 01 00 ...#............ 3c: global variable types 36: strings 3e: used filename(s) --0--1--2--3--4--5--6--7--8--9--A--B--C--D--E--F- 00000030: 21 14 00 04 24 1D 68 65 6C 6C 6F 00 02 01 69 6E !...$.hello...in 00000040: 70 75 74 0A put. icmake-10.03.00/comp/hierarchy.odp0000644000175000017500000003630714204126313015575 0ustar frankfrankPK¢e§R3&¬¨//mimetypeapplication/vnd.oasis.opendocument.presentationPK¢e§RConfigurations2/toolbar/PK¢e§RConfigurations2/floater/PK¢e§RConfigurations2/menubar/PK¢e§RConfigurations2/popupmenu/PK¢e§RConfigurations2/toolpanel/PK¢e§RConfigurations2/progressbar/PK¢e§RConfigurations2/statusbar/PK¢e§RConfigurations2/images/Bitmaps/PK¢e§RConfigurations2/accelerator/PK¢e§R styles.xmlí]K“ã¶¾çW¨”Šo¤ø¥±g]v\vRµc»v7®ÊÉE‘D/E°Hj4ãSþA9äÿå—O%ê12×UÞк?4@£~õõË&=ƒ$ `ô8ÖUm<‘ý Z=Žÿñé{e6þúÝŸ¾‚ËeàzÛ ˆ2%Í^CŽPá(} ™ÂÇñ:Ëâ‡ÉÆ ¢©*LVCÓæú{ÌʸQ°yo“èºi>D÷€‹òf Z7C >þhbº BÙ 0­âÁMŒjY„@¬&N@ŠIõ²Õ‰eĺ¼45³ƒÝn§îL"ÿ§œ§dà%›pê$ÎZð²' ˆa’qjßˉãm2ß›€`ÆÒ‰®êyÍÞÚM2Yaq Øç•4®Ï«XýÄÝÉÖ‚i‘º‰Å1P²Å1­Xé¡×¬5ñÜÐË…Åz,-.&Þkj×ÚÔ. 2pò È\Ù¶0­ØÔKDŸëtKŸÏç’ËI—P¶‘—4T–°¡ Ûdzµ7žé/Ù†™9))ŒéË+Œé—´Å]Èw"!KGÛÍ$Òm»™[Õƒ¥¼à¨œ‘T¤‰…¦'«Ü¾.á6ò©}¡µ—$ÎrCRì¡TCCƘ‰ƒµµ€®M0 §_%¾Öé"ªÚœ »„0Rž°û3/Â#ÄdJ"ÔPR¸i`AŸ ‹·‘—mÉR†Ôæ»`ã 9ÍǪ¬,ÐZâ3ÊÉЄ˜ñìP ¢•‚ôHå%[”&É òÞb-©3B|¹K7LAÚÿ#PaœâY´Y¬œËU‘v›e‡Z„;…4ÎÌ<ËÐ ;ÄÍc]š$ðÙ´rGà“ü4øåVœ‘´ w…’°EG ÜFY‚êýÇÇJ½ Ú$»QeaTáÊ9m‚ÁÎZáy¿¯ykŽgüõÇj£Ø‰‚—¦5ã^ë9umûyî:Øç Ïúûã¢ïJã„wš8h(ÞhìG¾›øãîC‰Ù<–P=0 ü±8¼v="š·uÔL(Ôñ‚ª‹Vó=€=1\}KØZ5'°¦0ó¹ÍV€ä`µwQW*k˜¿Cì B9X!øm›fÁò•(cìúø¼DAã ³¢6fFÈXÀ,Ã¼,3"À~F¬ÖB퀵ë—sàûÅÚ†$*hÍ›‚Ly)£QÎ|­Íä²Ï4üÒâRƒ´lx÷tH$ Á3)±²Ø¢):ÑLœŽ&’1ýI³|äð8þßÿ+œP‰ s¤Ì&ˆ”Ð] œ¼¯§H€I“iâ„ëöGÔƒ_7 ŽeÌVÙY6™Ý&m’vÀÁ82£( °„ à ÜBfoéTÏï!«G„fw‰ÝB†jÝ%BÓÞ2ï§?|îÔNÏzCȺS;=ï¡û´ÓºÖDöÛ2ÔB6Û±Mš6^­NÔ6Úí¬°ÀtÁ¶,‘ï Ê©t—RNË7(,™¸Ö€–§n ”J ˆs’Ä”8ë1u“µd ÚÓSñF@ éF©n3Ìu¾Ù²ˆ4Ù:ÛÕZaŽ6±Õ*QöïÑ4x-Èæ~_ƒÎwº§múŒùGh—¬ 5ß3V$Þ¢žL¨“HÄ„W·cÝÏëcCdhK­ vDÜJ´k<0‡\! F}ü1¯¡éÔˆç86xƒ( b&·,·Œ„R AÙ7Ôvö%EÄΉEÎ)š…ÎIÄÎó›o !ú6ñÚ¥ŠZI °¬QJø\§“uÌ6vBð‡ðƒÁÅoÀËvA¶FV»šbÜ_ë&yЫRqƒ´ų̂¿‰ˆ!ÍßO„?|‚yÄGÿ×…ÿFM‰ Îhù°„V3ÂuŒ"8Â¥G¨(þ·Xè BsG!í½£qø„:¼_eíyÉ· š'¼Ê$!Ä}ÔO½‡}ÈAúÕ½ÛI7tÓóöe0{ÉëB…ë{!AYÛ ÁèùP™N -)Ÿeu‘ïoÀÅnß6 É-Éht’+Rk¢üKI÷‡.ZëpÑnF•æÓc‡Kƒ„ùp¹ã¨áÒÔ…d¸\F:9Ž(7ÝuÎ>0 ³8ùIøÆvjÒ0òÈ®ýúCǵQeyÆÃTDôyšRâMÖhYâ•o)0ôåÑàAz]Ñ`œÊ)„䌎|qyuC¸˜×U@ÆŒ€õ²ä¼µõæ~Ñž†x‡ŽÀ„Eçµ€R¢¸0*´íSa¹)‹tD}(†]sÐáUúçƒxÙãrJËã[0)“\ÖøÅù‰:]ÏgœG©ÚLoˆ:ÒÈŸü\¼vÎ©Ž´â9†i¶LWó€í^ºú€íÎÁ8Òz‰ Ò–AƒÇs÷†F£•̱8ÊN‰‹á–A‚‡{÷†D›yÌÁ8Ö@Êà!éùcaß2ññ“0zø¾Àr¾Yà“-! äÆ]ü¾ÑÛLHFïr,S€É)†æ±å]BJAä×–kˆ$M×p§l£ cÇ\ÝÑúÎM×MÖâU¦è1®>jEžýïX4ñÂõ>¯|G{Ÿ?ñŒÓê!M­=o2ªq¦œÅ”£ý¾9ëÛ”ÓŽ™Úê Ÿdšš­;¶S¹¶$:?k3 'a§€Ì=èÌ~zÀ8_8š~ž°§ªmþÜ0mªÙm=`µ÷@§«{ÐUÂòëó|=`M§çéËiüâû®ºÆÅÜîsë|˜æA>ír{€\r§ȧäÒÏúÜ —†|Þä³òçÛE†/Ûý\6KzÆ%½"*iø~({Öš³;<ð7<ð7<ðw#'ªÃç8Qøøøøø»ñÕ7úróT"8[òӧχsÓ[<75‡“ÒᤴAàᤴ“Ò·äoœ-ƒ³ep¶ ΖEhp¶ ΖÁÙ28[gËm#48[zp¶ÔxPgÉ•_ÎÔLÕü%ö—X•ØÍ?„¿¤Aì;ñ—ˆ%Æ ÝWdSJn‰oÞkŸ ½&R?Ä!š Ö0DCiTÊ ïé<Ž×.²h[ Þóê‡Ê¨š=ãïòá³TÇ2ùo6•èšjÛSžÈßPpìIç˜ÓxÐÑD¦[Wfb´†Õkq &ö@</7^ ˆã˜˜´§ŽãMÿ¤unÜÁ)?Ø S}Î¥Bs«æƒ¬ÔÖÔ½3s&ŃnÒ`?`'p¹ È·µ$K³$¤©h»Y_Ó®%ôÝ í0,O·‡æžVI¥W.öA¢æo xðë7RîÜ’©æÜwǵûLšµK‚ ÷âúˆ¯0Q²E'´*ºr3h5‹Q›q³˜ÆU ì_}fòVôR›M/„á©·SoÃËéá©÷K/á[ñ?Wí¦RÙ+WŠ„$zI‚ER3¿„y¿ÈHÕe‰¤ £tý ÿûË/Š+ÿðø—tµŠ²i°MHZ*MKøW‚Ñi±¨{)¥ò¦,³…¦ÑŒ¤u«Jóµ†uÝÓêÏr3ÆO£äAÞæé‚úET,R?!Å¢ lhûžÅ^Ö/AÃE¥`ÝX$Q,ú& :'ÕÎÈ :œÉöÇ‚¯G€5µÀƒn²åKL„§Ë„^õ|ôUÏyÄiÅRú¢ïb²Çâ(ý:ÍoÖ»ç·èKvE¬¬è„ ¯YæÁšU}qãsaŒPœ0FȱÅ_бîN·É’äÂgȃ•øÄagz¾î‚ÈŠnÓ°^CGÖ%6lÁ=a€Æ©€S õõè¤kL¦•éJ7&ï=3?M&—P¶“'¶Êu HŠ­àTIŠÃ囿×ïðôúÝ9±_n&üÐÕ>Agõ×§ýh#ÊŽÃÀRy” /„µ471öÀbbnX«»e©Á¯—êòc›×ÔO-´®aù²ò¢„$ˆ‹Çµ;tÍRý™iú ÿL~óÝJŸý´>Ñ”"Y‚ Ñ Cêñò ÿÕÏhñ÷CɺU–¸§³Êš¤`aXã’<åD²¨ À<«hGBY›§ÛmT{òó¨r¾Ú}Œ`Uª¼©zñ4p‚ßB¹+ê–ÓÄ¿šjðÈ•nLðÊýƒ–ô8bÄ-Ôé[„ü*ÏQQ\‘YøŠÔºX·Ÿ¢²(sâ'Ò¯ðêã°ÈЍøR”$¹’I…ÖÚ›(õKNÈZ½®K5ЦTÓîoKÊjå@©žÓE®êoNß0CÝË=›"EÉü5‘Û‘ýF%ƒ ƒäeD ‰+‚—~ðu³Ü*Ö"ªRÕ2ßBö5%F—¿‘ ,ŽŠ‡Q‘Åþ ¤ï´dÙë‘J»6Ë]ùq1%ÉQÊ(ißÈ0íAt /|=¼Zm6ÄOÌì.&¿ÎdYç~¶‰‚¶9ós¶1T}PêAl+ ô󰃦ÒG…¡ïËéWÒ”ÔîS·@ÑS˜ÒwzõG®¥WQ·²]C'ºªþ4=¬l½|eCóèwÊÒeÅ£5ä1Y•óhù æˆÖ›²Åú ó9 YVÜ໢‹$J»ºêØftí0R=Ýæní˜ü †>u«£qXæúåJ¹œc ;O¨öÁç¨ÜÐmÉP ºU¬Õ¤™D%Ìéú÷ò­=yP‘Þ;ŽÇð™1ïA¥wïó¾"ÄQ”[óPº"(b n£|½¨‰\ð®þ8Ö¬øEä§Sì¶ZLvM·øT1öÒ©ˆ¿zþ޾úõV¶¢=ˆy¯>åÊ ‚ÝÙT˜ñÒAd¸ *V7fã¨hªþþ’û1y"qS¤,·qLJ©îdí ƒ\¬»v—øAþßÿè¦Õ{HorÕVŠÄþzºc1nSeîæÀg(a?¿$K·(l ÏJC(|*ÉÀ®øéy‚i}_árl¦3pÀàPdìªÂ’¬hNZÞBÆÕB*~“™WDÈ}“YWC«æ›DȾBÆ›Äǹ>otv¯†ùF×iÍušŠ\ "ëϵP÷º›\[›¼|Út,iøÒ}è<~¨ê~v±ÞhŽà3’Û¢—î𠺳Ú\8+J’77û 7ûjéØ¡Û¶øñ#ú¢Ë«Ú†/­î>vGJÜaÛóß%ñ" ä(Äÿ ÞÇ®eÖ¯­O¸º#<³:¯Úº U¯ŽªFV’šªaØmCU©†iAC£u¥Ô’îîfÍ¿@±´![Oá/Pù<§ycE&ÕZFjOÔö¸4o hš’ ¤ùNx§ 0jé—ŒmÚDíùßUÇ6z}¨VÍšµØª‹º–†Kµ ¯“ÁÕ‘›ayݵÃ|ôØøìùQˆ¸æu¼%JF£”à5=ìúb'Ž{}áæ¶>Øø ¤„lP,6,)–iyu7ûÞîOì§Kº}X²L[oËÎLk±íð<ÅACŒƒÇAC€ƒ:¶G8èp„lõ8hè*2œ 8˜øQz.'!2Å r9ˆ\ˆw঺ê¹n"X§Í>DØR=„/€(óó‚üùü´£ÆÞOyhÁ®êºÖ”ŸóüÔõSCÅž„-<â£H‚ãµ&A5úì³8öY'ÙgªvuÑð8ûLÕÓq?H˜ª^ÝG?‹}X~,ÊRm\9)’<ùñŸÎOGâ©£b“óSˆ°º…¯O­yñÔÂHWcÛ#¾ }எí\எX°@&ÏBó$ ¡h6uÄa].¢:*Â%u»,g†ÿVÎjs0Ù×qVSuħ¾°F_à«4 hx6Fwä«¶Šl+àS_l¢+¹ª=ÏUËu ŲgÌW]Ç” Ï=í«w„/0 éîÀMv€™#ÏС¸pGÏ@P\¸—ä.‚™³Ç9¹'°bvrË0ø€ì9gdX ‹À‡iß:sž 3XØU }/ïAS‡hÏž$¡;„ž( ±z—{º¥8ž9‘=Ý– ï’ˆ,HB¤óYˆ5®e‰$†¨l0R‘{I[¼$¥¿|4)à°ŠœÉn&‘>‹ˆOŠác‘IÐñzaæ5Žy–sˆ,žL¹ç"‹æ¹¸ç!Ðõôt=ë°‡.ðpw\¾ð;¨üDJ¿‘]¬CÇÐÀ•~ÌÃKŠd?_wîß C½Ysþmâƒ8ãêÓÉÎÌlMm¥{bjJP×f¬-Å0°;ÊCdKÐç½J¤±8ò›©Hd7ÕµNnÖØªárUÍE{5ö•ô+Iïˆ|.ƒzyÞ¹E7…E *BÊ jÅV¬ñ0"Ö=Å`™7sQæøÆÎL`;¿CÙŽ  K#¡Ï‚‚_’FzbAÆá|Û9éÚÓ;åÚ®jans‘Õ]²¹¸ÜFqyþQÉ­R¾ZF½‰ïƒŒ­Ú&W̸*¬öStfrPä@%%¤ƒb±m–‚±aúl úì»qq‘‹™>>7„ ø8·cabMmßBܾ=à^çÏåÑåûE]ix~ ¥Ãÿ 7Gð²Ø„„ÈEc¥7D$ß Wù Žz›¶ç.öõ—t„•ôŠ‘n:®‚‘9Vô°N `^Rõˆîkð'ƒèôÑ ¡z'#=üÑ=d›Èºd{mµMv›æÞN·Å¬p—|?a_à¹w f",p ŠØ6]¤`Ç»}X®~É-¨Î‡èž>shlóÔ‚i@´ê§ð–ê˜g_ã1åÇuNŸ¿`É ‰¦ñ‹¤n¤U“âoRJ¥‚nó€Hßàðò5ö›æ®ºssUU·¿ÝdŠe¬=¯³ÓÄÅ~þ’ÈÏ<}ÇB¿Í]Iƒ”Ô»äD£ú­Z¿¼ùíÑ+„þvêÇ5lurÝ4çQÐ=ÍÀ&î; Ö“âyãô/ ßôÕ ‡K<ù»èJ—7Àï̓½³:`;‹}•ëßʽsê Älq÷ b³½«Ål$°ÓÙÚ.2!d^\v‘=qo™»o_ý¬Ïböãɽ»þJ¹Ù&ËÔâÑ úÀ¹ª±œQ̱ûK  9GTÞgŸÜÏ&£ƒ/±_õ7Øw"zžÆ‰õ5ÏŽ|Qàô5cvýÎÜ–è~¿¨s+ “×w+£6¦~ý+K_‰ˆý€lh¼ÿáéÔüGZ¸•`ð0  %û-†ƒ¼N(ûJ÷cßõOö~ÏœÿRˆÆ}oD›øßÇÿPKàÖ“…° ¾lPK¢e§R settings.xmlÝZ[sâ¸~ß_1EͩڭS ¹©I¶ÌÅÀ„pµøeJØ4‘%¯$cȯ?’!™ 1ÖÆ[§6léûº[­îVÛ_þ\ûøÃ 2Ž(¹)”>i…¸ÔCdqS°-óìsáÏÛß¾Ðù¹°âQ7ô!g !‡ðr:á•ímJéMa)DP)iÉöê'ÊŲ¦éÅíïÂn È¿)„ŒT(àˆWð!¯·¢¦>U~ŒBŠX‰%Ü^ä>ÂǨ±g.õ‰2Ãð5LÀ —cøcá^ÏyåR2G‹cQ¶£_Ï_cD_lEѧè<¶_I×õb|÷yèûƾØ3öö×±‚íV;l÷ý•‹œnŸýáÙ n¿ìtÙ~œ!}å#v—ÙMAŠ\Y!½xO!iÞÏsƈ«3 Ï7Å&7…Ûk]»úR|‹ó·°;p.’ÀË××åÌàä‰e"ú…¦g—½Ñb™,½v¥iÇâŸù 8CăkèísÁ(y­â9ÒoØæ‰aÔööÄä‚IG(Ü*·(¥³D“!¯Íwö؃ŸQŠ! …Û9ÀfÁ7%û6>z›,ªXr„l?Ä"X˜‘Dýï s¤è;CW˜L^ÌÑZ[–>•›è .™hú8ä-@< ¹#°ÉÑ}•ëÊ/u#¹Õp«ÓÀÈGاx›­#/CÑ%Å¥Òåñai_›·\y,Ñn=:`#óÞ>>àðê¢*…`›Âm+º¹IÇÑ—¡O€¼Y:Ô}„Þ¯)Š¿†êRCÈx=ËÃà]Z£˜¾1»sC Ù/Dz|ZïdÞÜÏlKʤ«§ôóÄ2AOŸ¸ÍcW¸§^>Á¦NCiåFî£עᡃY3K6ˆ jK@pH·uøéiFy÷!Ò(y.RÆKi•„ˆccÊuý××É×9×ɪόÃҗÊ×)õøaÙ³¡›²\;(øÕùe6äÃRg‚VEZ,ô´+O­ ÊNo™$uy¸ŽKŽdš”~ÿÇÃ?¡ÈC>Š´y\ç)šQåLç…žC9éPê÷HB’=…Ìqe–€žÊƒ½dsL£\w“‚,áâëÃ÷¡Û»ó|òÅñ›í…ŹöïtpŒ À›CVœ>IW‘ŠZÊñìaç@{áãï3&[ªà þ£È—€Áb°Tþç¼úñ÷P øÇN€"r0`Þ'Ng餒¥ ²€c5ê«f¡êYR¤“ÖrqÅœ›æn:¡ê€/s“ÉK)œƒ )ÖH$GéClßAÏà‘ËP LúΉ4Ã[Ñ(gÂp?Ñ»ØBb Þ‘!ä0VÄa焺îš”ÍçAò²ï³÷K;òp&ÿv›’´A#TüPíQÊ20¹öK½ê­…*\ ¢z‡©Ä{w~Öú+þ&’`¹Å¾Eº•QmF Þ¢ =É­ðé÷[ 7¿ ¿L[—ÞAFâÈ܉+Âw»ÙÚ¹ª“W¥ôQ*“;A¸y´T^s¼û´#3‰,ói>mш”Çå%½‰DN†ÁnÇæH§*¥D.OjbŽ.‡Ñ³«Ð ~íOH ¬ÓÍë)SÌ`! óu$ å"¿J³2ÛæïÓŠE7„À£²îËAëØ!BYX2Yìù ±«•²Ü—5ã‚`9 }?¯,{Ä ‰}ódé;ǰµe™¤Þ#‘PlÞF¯g¯À4:“ÇaŠC¥f&Ê„ÝùÌÒêëÅ/¨|…â[ŸÑoŸ¯KÙôëƒ@.<£þŠpÿy²å,þ§'£õߢ¶L5Ýw|üݱì™úÀõõy¯î®ïÿ¯¿Ai<°Ÿ‚¶mê}Çw‚‡òøÎ™çvëëjú´8¿·^†N ãÞ¸ü1µm˜Ž-?gÃù:6Míad¬k¤º“KÍ™¶õ‘Y[eÇ“.ùcmZªnf¥ÏݧFTóu9nzr˜èa\]¹d¸y˜`­æwWnc÷I[«ï³æzé5mÝñMî–í»ÙÄÜ8e:Mó/oÚÕf §®EºÁïkQ´£oœæ8òš ýþûàÎmu¹3uðLŽ“2>:þ{j¬gŽx|YÉÚ·Œ;Û¬6e]Ê7¾ˆuƒ‡‰‡í2¾r¬à^ÚIéhŒ&—‘7Zr¾ÖÃãÈmŽ7FcXr›k ëAÛV%ï²7+ K³ÉWîH{5Õº¥•ƒñp>4Ç«1~˜j¥þ°aÛ/s¥•Ó´¯zëÕÌ÷L§éá”ýY°‚ÖR†GP ?Þ¾Ö#5Lyyíåq_r¶ëÕ¥|†fž¬zU± àw*àÃV:ØÃ-¾y¯xè…ÍÛÿPKñÜI¯øò)PK¢e§RK½¯„Ú Ú Thumbnails/thumbnail.png‰PNG  IHDR¾:<PLTEmmmvvv|||6f¤9h¥Dq«Ju­R{±{½{Z‚µ`†·b‡¸fŠºhŒ»o‘¾s•Àz™Ã„„„‹‹‹”””›››€¿€£££«««³³³»»»ŸÆƒ Æ‡¤É¨Ë’¬Îœ³Ñ ¶Ô¥ºÖ©½Ø‡Ã‡ŠÄŠ“È“œÍœ Ï £Ñ£ªÔª°×°µÙµ¼Ý¼­ÀÙ´ÆÝ¶ÈÞ¹Éß¼ÌáÃÃÃËËËÔÔÔÛÛÛÀÏâÄÒäÉÖæË×èËØçÌØèÒÜêÃàÃËåËÐçÐÔéÔÜíÜÖàìÚãîÞåðãããàïàëëëàçðãêòéîôäñäëõëíñöïóøóóóòõùôùôöøúþþþÿÿÿu¯¼b “IDATxÚíœwšJÇ»¶¯éÛ׳¯Èì§Û¦µ‰'=M÷)c =81êïÿÿ¿¼Á˜¨‘_¢`Ø’”Ï\¿3÷ÞùÁ hôöBâK|‰/ñ%¾Ä—ø_âK|‰/ñ%¾Ä—ø_âK|‰/ñ%¾Ä—ø_âK|‰LüÉÝÝdwñD¼ 8ƒsñT €+†Î±sq‚å#OZì]<Sœs$üŸ—çgߺݳ³¯ß¾ZÀ0RuCÇXi#ΪiVAXÅ ñ_³qÛЙÒË HņÞVƒ#á__žw¯/~ž]~»½°c|Ì4]økœëX´"ÂÄit„°©«H€+˜_¼ÖÚ:?–x.¾ÝÁíÝÝíLøB.-vgADóÅâÖ©Aø-¢ ®0lcÝR‘ª’á ä¶¥ @Ãb-ÖÆèάñpMü çg™„ꪺ?œac[ž©×;yuÚñš‡?¸W½NÏï €¾ì5 ?¸.õCñ·ÜÑq‚ù.¥~‘Gë»g/È…½§ñSzÑæÁ±ûŒñç+ò˜Ý¶O ½g‰? roöðÒ§ý(ùDøÜðý raaJÇég{áóÁmîN7Ôѧ9|›ç èQú”dšËoÎü¸øaló-}D«>/€8*þøm'iw篢àŽ€zÂæÉÚUw7ßàÔöÃÉ&7ð91œ{ìªûH•yסÜW.~À¸ œ€ óµ4Ï^ ˜wÑÚ»;‹a=øéFL¤|z[UWœ-Ýä¦A-B †Í¤7 Û0 -ÀV®ûº¸ÛÉä~}ÜÂííaðUUÇ:¶L £6^KSÆL³-Àâ01qÒ›[‚0G¶…òÝW÷úòÍ—Ë7——Ý™|™Jû&à‹XK²5ƒé¶n€XÄÆŒXIoµL°„²l'vžÔš‹Ûoç×ço®/ºÝK~ñ¼rÝbîë.þ]<¸åùó]J8_£ÐKigzÕWÝ¥§=ùý÷ä#§œ·zï‡'¯¼ÂîkN+À÷ÞûãdWyú[v”6=9˜a²_Np_:àƒ›æêGy¡Nç>Û(-’}MÿìU„Qâ'{QÑðØsÂ|÷E¡*ü”ºv•là…Î 'ûš{âC/ÁÔ™áãÓƒ3Çg¹//ª~l¼Ÿ‘ý%£®3Nw_}¨ËWfÊuš,…¡ã§¹/Z1>8Óâø©ºš:n¢û êñ·ùS¯éeu*ÐÕ笚ä_¶RÆ”‹F99•ÿØç?½ª+V§;Jg‹º üæŸ%¶3JßgÒwNþøX9¾ûq¬¯9Õû˜fHG°çÅ’aïÏÞëªñýÑFœ²ž?„[9Jv˜Ç¡ÿÕ‡iµøB´Ê— 0MÊQа‹"»eòô]ñùVÜùÐo¤¿%bì"i™f7o‡ÁŸ;I¡"]\›ŽïÃNÿ±NÌŠŽó®ºªÅO,®/`ºÊQfWEǨN¾s9¾“OãîW/tç÷Ò)Î.¢Ž1ԃﳣõ¡ç»£L Ï ˆ¿ÏA!×~üÜ‘Ì~þôWvQñ F&ûãÿ·H*áì’o̶»Ë«Ãß! +6á"i¸¥:üœÍ !&c,0µnæP¾ÉK<رÀb•<}š+ä FÆ*«GN¸ST^Ÿ© q‚E6¤†¢šf ¾¡#K× djØÄy™žëí˜T”Æçš©™‚IÓ°eañ쯳Qºÿ8šö—N¨×óJêæ9àþþú_Ã"¡eíø"í|Žü1¥©%Ì^ÀyuÝTþ«üï½ÃøŠŽu3*Ùpñôùç¬FxCwkF§— W¡õ Í~u7c õä覆ªëì|ùÇÌi‘©k•Z¿Àìˤnè¸^A³VÛp†~©Ë»§½bCÕZ?µû,g#ZdnvÕøyòOÀ÷éüAEýÜTŸ#7;•Í+AåÖÏ‘¿››’ŒúWã#âgËß-’9¥• ü¹SÿSj6ù.峕ãCD á÷s,9LXQƒõ3åÿˆ?,"øO×¾Ôaý,ù»R’ŒDµà§/q³SÙ´Ìjµ~ºüÝìT6m,KP“õaè§á×ÍV ¢Úðá*ÙÂÔÛcIGwéÝ/UO–¹e8«–êÂÏhý÷+BM%Ãô‰›œÃ` #¦…ÊÜÃRxÛÆŠ¡×Ôϳ1ÝBc¤Øt¥ø„„õ µ H%;ÞB£|7Õzð`†Mñ¯m©F‰O#âû³˜5Yÿ©üõ(™óº´ëc {4«VëÝ»^}UwKþñö¹üBîóö3Ô‹¿ÕúŸ|*÷9ã>•ûêöÂÚú*µÔ¥å—_î×AþDþ»O©ž»OÙ³Sþ»F<‘K÷¼íÁ¾Ã?ÊãèþkŽ÷Å®ÊáW¡ÕŽ¿!ÿÂøî¡î•´ÿØÖZoN1ü!uv£‰ ÍýØ–y“c௖}æâ{%ªªñWòÏÆS[Žÿ(ÿ üùÞM|uøòOÅ÷i75;þrm¢›R7Z[+À‡A˜†ï9>T·jNƒ“ˆ¦Þ£ê™á/z¶ð?„À_´þëø¾ãAõÛá&ĈÖÿºœÜ |!ºút<|èÅÖwÐDüéiTo­<jÞä}˜ÅÆ-NØÁb‰aMÃ'Ò†¸b«Hoó¦áÛm¬¶L¤nœx˜Ýhí7¼ê.·ïÓFã¿ýÞhüÿôßo¶ö]‰/Îý\XÃð±jÅ‹nt«¶,%À:C¬9øH54+z<¬ß 4®!b6Çúš„Ù¶Ém°40ÓXsðYð?RuÃfã¿÷ÿÛÇFãwÂFãËMâÿ¿âO›ß`¯kØÜ-å^äÏ?hµ-d˜[f#ñãÝH×ê5¿Ô¾Ä—ø_âK|‰/ñ%¾Ä—ø_âK|‰/ñ%¾Ä—ø_âK|‰/ñ%¾Ä—ø_âK|‰/ñ%¾Ä—ø_âK|‰/ñ%¾Ä—ø ÛþSµå½Yñ~IEND®B`‚PK¢e§Rmeta.xml“ÁŽ›0†ï} D÷jlcH‚EX©‡ª‡­Z©©Ô[Dl/u 6²Í’¾}Á@Ên¢*7<üߌç÷LþxnêàE+µÚ‡8Ba Ó\ªj~?|»ð±x—ëçgÉåšuP4•Á€*K[#ì*ÏÐEui¥¥ªl„¥ŽQÝ µ€ôš¡¾èŸÊh­÷áOçZ áOÑH› Æep:/Le8¯/ú¾ï£ž,Z+ÈKW‚)ú÷ Q*ÙÜ{ÓQ{uͱû{ŒÚ5kYßËŽZÀtÓ78Õb†³KËmgjß0gPÔbä-Ć‹ö\Kõû–C8Ë2èÿ^à¿Ö'o¬ŸN÷v3Ïobþ^  ‹eÊFËŠÜÇŒðîƒáE£Œ˜Ð”PœEÛí†Ä8É’Þ rÎè MÚpB“”¢$B;’Æ»”d9\dSUÁ¥ðÎø\Å×ù”ÄŸ ù6W¹R¼ÙV [òF>Ç'q%”hmŠ'y2â‹on#%Qüð$Uw>þØmŽ›$X Ž­Ñ¿s¡‡¬9ˆç"ÿòMù/ËjÇE³N²ÀÇõi䇹ê”Û‡Â"‡¯¬‡·Ö½ø PKä€å Ã,PK¢e§RMETA-INF/manifest.xml­“MjÃ0…÷9…ÑÞR6EÄɢФPí‘#FB?Á¾}%Ç.%Cv3Ìè½OiŒ®.àƒ²ØWúB*ÀÖv û†|Ÿ¾êr<ìöF ’"Ÿ‹*ŸÃpk’øtNæ…ÒŹ¤û;&ʈX™or1Ńè{öï;~PKµºâ&ÉPK¢e§R3&¬¨//mimetypePK¢e§RUConfigurations2/toolbar/PK¢e§R‹Configurations2/floater/PK¢e§RÁConfigurations2/menubar/PK¢e§R÷Configurations2/popupmenu/PK¢e§R/Configurations2/toolpanel/PK¢e§RgConfigurations2/progressbar/PK¢e§R¡Configurations2/statusbar/PK¢e§RÙConfigurations2/images/Bitmaps/PK¢e§RConfigurations2/accelerator/PK¢e§RršáqtÑ Pstyles.xmlPK¢e§RàÖ“…° ¾l ùcontent.xmlPK¢e§RñÜI¯øò) â!settings.xmlPK¢e§RK½¯„Ú Ú )Thumbnails/thumbnail.pngPK¢e§Rä€å Ã,$5meta.xmlPK¢e§Rµºâ&É7META-INF/manifest.xmlPK+†8icmake-10.03.00/comp/symtab/0000755000175000017500000000000014204243136014404 5ustar frankfrankicmake-10.03.00/comp/symtab/find.cc0000644000175000017500000000103314204126313015625 0ustar frankfrank//#define XERR #include "symtab.ih" // find 'name' in VarVect vect: vect is the vector at an externally // determined level // int Symtab::find(VarVect const &vect, string const &name) const { auto iter = find_if(vect.begin(), vect.end(), [&](auto const &element) { // true: already defined return element.name == name; } ); return iter == vect.end() ? -1 : iter - vect.begin(); } icmake-10.03.00/comp/symtab/symtab.ih0000644000175000017500000000033714204126313016225 0ustar frankfrank#include "symtab.h" #include "../../xerr/xerr.ih" #include #include "../error/error.h" #include "../../support/as/as.h" #include "../semval/semval.h" #include "../functions/functions.h" using namespace std; icmake-10.03.00/comp/symtab/findvar.cc0000644000175000017500000000101014204126313016331 0ustar frankfrank#define XERR #include "symtab.ih" namespace { Symtab::Var notFound{ "", e_null, 0xc000 }; } Symtab::Var const &Symtab::findVar(std::string const &name) const { // visit all VarVects from the last to the first for (unsigned level = d_var.size(); level--; ) { if // if found, return the Var ( int idx = find(d_var[level], name); idx != -1 ) return d_var[level][idx]; } return notFound; } icmake-10.03.00/comp/symtab/typeof.f0000644000175000017500000000015514204126313016057 0ustar frankfrankinline ExprType Symtab::typeOf(Location const &loc) const { return d_var[loc.level][loc.idx].exprType; } icmake-10.03.00/comp/symtab/push.f0000644000175000017500000000010314204126313015521 0ustar frankfrankinline void Symtab::push() { d_var.resize(d_var.size() + 1); } icmake-10.03.00/comp/symtab/symtab1.cc0000644000175000017500000000017014204126313016266 0ustar frankfrank//#define XERR #include "symtab.ih" Symtab::Symtab(Functions &functions) : d_functions(functions), d_var(1) {} icmake-10.03.00/comp/symtab/functionparams.cc0000644000175000017500000000041514204126313017741 0ustar frankfrank//#define XERR #include "symtab.ih" void Symtab::functionParams() { xerr("#levels: " << d_var.size() << ", #params: " << d_var.back().size()); for (auto const &var: d_var.back()) d_functions.paramType(var.varType); d_functions.checkOverload(); } icmake-10.03.00/comp/symtab/pop.f0000644000175000017500000000010214204126313015337 0ustar frankfrankinline void Symtab::pop() { d_var.resize(d_var.size() - 1); } icmake-10.03.00/comp/symtab/makeframe.cc0000644000175000017500000000053014204126313016636 0ustar frankfrank#define XERR #include "symtab.ih" SemVal Symtab::makeFrame() const { SemVal frame; if (not d_locals.empty()) { frame << Opcode::frame << as(d_locals.size()); for (ExprType type: d_locals) // process the local variables frame << as(type); } return frame; } icmake-10.03.00/comp/symtab/globalcode2.f0000644000175000017500000000012214204126313016720 0ustar frankfrankinline std::string const &Symtab::globalCode() const { return d_globalCode; } icmake-10.03.00/comp/symtab/icmconf0000777000175000017500000000000014204126313020503 2../../icmconf.dirustar frankfrankicmake-10.03.00/comp/symtab/globalvars.f0000644000175000017500000000013014204126313016676 0ustar frankfrankinline Symtab::VarVect const & Symtab::globalVars() const { return d_var.front(); } icmake-10.03.00/comp/symtab/globaltype.f0000644000175000017500000000014614204126313016713 0ustar frankfrankinline ExprType Symtab::globalType(unsigned idx) const { return d_var[0][idx].varType & e_mask; } icmake-10.03.00/comp/symtab/definefunction.cc0000644000175000017500000000047614204126313017717 0ustar frankfrank#define XERR #include "symtab.ih" void Symtab::defineFunction(ExprType type, string const &name) { d_functions.define(type, name); d_var.resize(1); // only keep the global vars d_locals.clear(); // start with no local variables push(); SemVal::resetDead(); } icmake-10.03.00/comp/symtab/symtab.h0000644000175000017500000000514714204126313016060 0ustar frankfrank#ifndef INCLUDED_SYMTAB_ #define INCLUDED_SYMTAB_ #include #include #include "../exprtype/exprtype.h" class SemVal; class Functions; // see README.stackframe for the construction of stackframes struct Symtab { struct Var { std::string name; // var's name ExprType varType; // int, string, list: | e_var uint16_t location; // the variable's location // (xx, 0xc0xx, 0xbfxx) }; typedef std::vector VarVect; private: Functions &d_functions; std::vector d_var; // globals are at index 0 // function params are at index 1 // local vars are at index >= 2 std::vector d_locals; // types of all local variables // of a function. std::string d_globalCode; // initialization code of // global variables public: Symtab(Functions &functions); void defineFunction(ExprType type, std::string const &name); void functionParams(); // forward the parameter-types to // d_functions, and check the // uniqueness of the parameters SemVal defineVar(ExprType type, std::string const &name); // 0xc000: not found Var const &findVar(std::string const &name) const; ExprType globalType(unsigned idx) const; VarVect const &globalVars() const; // all global vars .f void push(); // next level of variables void pop(); // previous level of variables SemVal functionDefined(SemVal &statements); SemVal makeFrame() const; void globalCode(std::string const &code); // add initialization 1.f // code std::string const &globalCode() const; // initialization code of 2.f // global variables private: // -1 if not found or the var's // in d_var.back() int find(VarVect const &vect, std::string const &name) const; }; #include "globaltype.f" #include "pop.f" #include "push.f" #include "globalcode1.f" #include "globalcode2.f" #include "globalvars.f" #endif icmake-10.03.00/comp/symtab/globalcode1.f0000644000175000017500000000012614204126313016723 0ustar frankfrankinline void Symtab::globalCode(std::string const &code) { d_globalCode += code; } icmake-10.03.00/comp/symtab/definevar.cc0000644000175000017500000000422514204126313016656 0ustar frankfrank#define XERR #include "symtab.ih" // d_var: each nesting level has its own entry. // Level 0: global vars, level 1: parameters, level > 1: local vars // at each level there is a vector containing the definitions of // the variables: name, varType and location. // location of: // * global variables: their index in the global vector; // * parameters: their index in the parameters vector + 0xc002 // * local variabless: 0xc000 - their index in d_locals, which is an array // collecting all local variable types. // // see also README.stackframe SemVal Symtab::defineVar(ExprType type, string const &name) { auto &variables = d_var.back(); // the variables at the current // nestingLevel: the most recent VarVect if ( // if name is defined at this int idx = find(variables, name); // nestingLevel: error, existing idx != -1 // name ) { Error::msg(Error::MULTIPLY_DEFINED) << name << "'\n"; return { type | e_var, 0 }; // return pseudo variable } int varIndex = variables.size(); // the newly defined variable's index switch (d_var.size()) // select the variable's nesting level { case 1: // for global variables the varIndex break; // is already OK case 2: // for parameters: >= 0xc002 varIndex += 0xc000 + 2; // see README.stackframe break; default: // for local variables: < 0xc000 d_locals.push_back(type); varIndex = 0xc000 - d_locals.size(); break; } // xerr("defining " << name << " at location " << hex << // as(varIndex) << dec << ' ' << as(varIndex)); variables.push_back({ name, type | e_var, as(varIndex) }); return { type | e_var, varIndex }; // return the variable's index: // non-negative values: global variables // negative values: parameters or locals } icmake-10.03.00/comp/symtab/frame0000644000175000017500000000006214204126313015414 0ustar frankfrank//#define XERR #include "symtab.ih" Symtab:: { } icmake-10.03.00/comp/symtab/functiondefined.cc0000644000175000017500000000140514204126313020054 0ustar frankfrank#define XERR #include "symtab.ih" SemVal Symtab::functionDefined(SemVal &statements) { SemVal function = makeFrame(); // statements.bytes(); statements.patchFalse(SemVal::END); // xerr("patched false:"); // statements.bytes(); function << statements; if (not SemVal::returns()) { if (d_functions.isMain()) function << Opcode::push_0 << Opcode::pop_reg; else if (d_functions.type() != e_void) Error::msg(Error::RETURN_TYPE) << d_functions.name() << "'\n"; function << Opcode::ret; } d_var.resize(1); // only keep the global variables // (i.e., nestLevel == 0) // reactivate semantic errors, see pendfunction.c return function; } icmake-10.03.00/comp/semval/0000755000175000017500000000000014204243136014374 5ustar frankfrankicmake-10.03.00/comp/semval/invalidcast.cc0000644000175000017500000000023514204126313017201 0ustar frankfrank//#define XERR #include "semval.ih" void SemVal::invalidCast(char const *msg) { Error::msg(Error::INVALID_CAST) << msg << "'\n"; d_type = e_null; } icmake-10.03.00/comp/semval/ternary.cc0000644000175000017500000000343414204126313016370 0ustar frankfrank//#define XERR #include "semval.ih" // *this is the condition SemVal SemVal::ternary(SemVal &&trueExpr, SemVal &&falseExpr) && { if ((trueExpr.type() & falseExpr.type() & e_mask) == e_null) { Error::msg(Error::TERNARY_TYPES) << "?:'\n"; // different types: return move(trueExpr); // error and return } // trueExpr if (d_type & e_const) return move( // known (d_value == 0) and (d_type & e_int) ? // false condition -> falseExpr // return falseExpr : // otherwise trueExpr // return trueExpr ); falseExpr.push(); asBool(); // convert the condition // to bool-code patchTrue(END); // patch the true dest. trueExpr.push(); // append the trueExpr *this << trueExpr; addPatchTrue(Opcode::jmp); // jmp around the false // expr. patchFalse(END); // patch the false dest falseExpr.push(); *this << falseExpr; // :? returns an expression, but is the // patch already now necessary? patchTrue(END); // patch the destination // of the true-condition d_type = (trueExpr.type() & e_mask) | e_stack; return move(*this); } icmake-10.03.00/comp/semval/catstring.cc0000644000175000017500000000046414204126313016702 0ustar frankfrank//#define XERR #include "semval.ih" // both types must be e_str | e_const void SemVal::catString(SemVal const &rhs) { StringStore &stringStore = StringStore::instance(); d_value = stringStore.offset( stringStore.str(d_value) + stringStore.str(rhs.d_value) ); } icmake-10.03.00/comp/semval/data.cc0000644000175000017500000000057014204126313015613 0ustar frankfrank//#define XERR #include "semval.ih" //SemVal &(SemVal::*SemVal::s_insert1)(uint8_t opcode) = &SemVal::insert1; //SemVal &(SemVal::*SemVal::s_insert2)(short value) = &SemVal::insert2; //SemVal &(SemVal::*SemVal::s_insert3)(SemVal &rhs) = &SemVal::insert3; Opcode::Byte SemVal::s_lastOpcode = Opcode::invalid; vector SemVal::s_deadCode(1); bool SemVal::s_returns; icmake-10.03.00/comp/semval/setvalue.f0000644000175000017500000000010214204126313016361 0ustar frankfrankinline void SemVal::setValue(int value) { d_value = value; } icmake-10.03.00/comp/semval/asbool.cc0000644000175000017500000000040014204126313016151 0ustar frankfrank#define XERR #include "semval.ih" void SemVal::asBool() { if (d_type & e_bool) // already a bool expression return; push(); addPatchTrue(Opcode::jmp_true); addPatchFalse(Opcode::jmp); d_type = e_stack | e_bool; } icmake-10.03.00/comp/semval/opinsert3.f0000644000175000017500000000012514204126313016464 0ustar frankfrankinline SemVal &operator<<(SemVal &lhs, SemVal &rhs) { return lhs.insert3(rhs); } icmake-10.03.00/comp/semval/printfargs.f0000644000175000017500000000015614204126313016721 0ustar frankfrankinline std::vector &SemVal::printfArgs() { return d_printfArgs; // grabbed by Args } icmake-10.03.00/comp/semval/semval1.cc0000644000175000017500000000026114204126313016247 0ustar frankfrank//#define XERR #include "semval.ih" SemVal::SemVal(ExprType type, int value) : d_type(type), d_value(value) { xerr("type: " << d_type << ", value: " << d_value); } icmake-10.03.00/comp/semval/settype.f0000644000175000017500000000010214204126313016226 0ustar frankfrankinline void SemVal::setType(ExprType type) { d_type = type; } icmake-10.03.00/comp/semval/accept2.cc0000644000175000017500000000050714204126313016223 0ustar frankfrank//#define XERR #include "semval.ih" // sameType: lhs/rhs data types are identical or int/bool combis // accept(opcode): the opcode is accepted by the calling SemVal bool SemVal::accept(SemVal const &rhs, Opcode::Byte opcode) const { return sameType(rhs, opcode) and accept(opcode) and rhs.accept(opcode); } icmake-10.03.00/comp/semval/code.f0000644000175000017500000000010614204126313015447 0ustar frankfrankinline std::string const &SemVal::code() const { return d_code; } icmake-10.03.00/comp/semval/nprintfargs.f0000644000175000017500000000011614204126313017073 0ustar frankfrankinline size_t SemVal::nPrintfArgs() const { return d_printfArgs.size(); } icmake-10.03.00/comp/semval/swaptruefalse.f0000644000175000017500000000011414204126313017421 0ustar frankfrankinline void SemVal::swapTrueFalse() { d_patchTrue.swap(d_patchFalse); } icmake-10.03.00/comp/semval/negate.cc0000644000175000017500000000051514204126313016144 0ustar frankfrank//#define XERR #include "semval.ih" SemVal SemVal::negate() { if (accept(Opcode::umin)) { if (d_type & e_const) // a mere value is available d_value = -d_value; else { push(); *this << Opcode::umin; } } return move(*this); } icmake-10.03.00/comp/semval/printfarg.cc0000644000175000017500000000021614204126313016673 0ustar frankfrank//#define XERR #include "semval.ih" SemVal SemVal::printfArg(SemVal &arg) { d_printfArgs.push_back(move(arg)); return move(*this); } icmake-10.03.00/comp/semval/constbinary.cc0000644000175000017500000000370314204126313017236 0ustar frankfrank//#define XERR #include "semval.ih" void SemVal::constBinary(Opcode::Byte opcode, SemVal const &rhs) { switch (opcode) { default: // to avoid compiler warnings break; case Opcode::mul: d_value *= rhs.value(); break; case Opcode::div: if (rhs.value() == 0) Error::msg(Error::DIVISION_BY_ZERO) << "/'\n"; else d_value /= rhs.value(); break; case Opcode::mod: if (rhs.value() == 0) Error::msg(Error::DIVISION_BY_ZERO) << "%'\n"; else d_value %= rhs.value(); break; case Opcode::add: if (d_type & e_str) { catString(rhs); return; } d_value += rhs.value(); break; case Opcode::sub: d_value -= rhs.value(); break; case Opcode::eq: d_value = constCompare(rhs) == 0; break; case Opcode::neq: d_value = constCompare(rhs) != 0; break; case Opcode::sm: d_value = constCompare(rhs) < 0; break; case Opcode::gr: d_value = constCompare(rhs) > 0; break; case Opcode::smeq: d_value = constCompare(rhs) <= 0; break; case Opcode::greq: d_value = constCompare(rhs) >= 0; break; // case younger - only run-time // case older case Opcode::band: d_value &= rhs.value(); break; case Opcode::bor: d_value |= rhs.value(); break; case Opcode::bxor: d_value ^= rhs.value(); break; case Opcode::shl: d_value <<= rhs.value(); break; case Opcode::shr: d_value >>= rhs.value(); break; } d_type = e_int | e_const; } icmake-10.03.00/comp/semval/incdec.cc0000644000175000017500000000044714204126313016132 0ustar frankfrank//#define XERR #include "semval.ih" SemVal SemVal::incDec(Opcode::Byte opcode, ExprType prepost) { if (isLvalue(opcode) and accept(opcode)) { *this << opcode << as(d_value); // write ++ or -- opcode d_type = e_int | prepost; } return move(*this); } icmake-10.03.00/comp/semval/shiftpatchfalse.cc0000644000175000017500000000023014204126313020043 0ustar frankfrank//#define XERR #include "semval.ih" void SemVal::shiftPatchFalse(unsigned shift) { for (unsigned &offset: d_patchFalse) offset += shift; } icmake-10.03.00/comp/semval/exprstmnt.cc0000644000175000017500000000123014204126313016740 0ustar frankfrank#define XERR #include "semval.ih" // called by Parser::exprStmnt SemVal SemVal::exprStmnt() { bool2int(); if (d_code.size()) { // current semval: last value on the stack: pop it instead of // adding 1 to the SP if (d_lastOpcode == Opcode::copy_var) d_code[d_code.size() - sizeof(int16_t) - 1] = d_lastOpcode = Opcode::pop_var; else if ( (d_type & e_stack) and not (d_type & (e_prefix | e_postfix)) ) *this << Opcode::asp << as(1); } return move(*this); } icmake-10.03.00/comp/semval/insert1.cc0000644000175000017500000000022714204126313016266 0ustar frankfrank//#define XERR #include "semval.ih" SemVal &SemVal::insert1(uint8_t opcode) { // if (not d_ignoreNext) d_code += opcode; return *this; } icmake-10.03.00/comp/semval/pushdead.f0000644000175000017500000000013214204126313016331 0ustar frankfrank// static inline void SemVal::pushDead() { s_deadCode.push_back(s_deadCode.back()); } icmake-10.03.00/comp/semval/rmjmpzero.cc0000644000175000017500000000042214204126313016723 0ustar frankfrank//#define XERR #include "semval.ih" void SemVal::rmJmpZero() { if ( d_patchFalse.size() and d_patchFalse.back() == d_code.size() ) { d_patchFalse.pop_back(); d_code.resize(d_code.size() - sizeof(char) - sizeof(short)); } patchFalse(END); } icmake-10.03.00/comp/semval/opinsert4.cc0000644000175000017500000000034614204126313016632 0ustar frankfrank#define XERR #include "semval.ih" SemVal &operator<<(SemVal &semVal, Opcode::Byte opcode) { return semVal.insert1(as(SemVal::s_lastOpcode = semVal.d_lastOpcode = opcode) ); } icmake-10.03.00/comp/semval/addpatchtrue2.f0000644000175000017500000000013714204126313017273 0ustar frankfrankinline void SemVal::addPatchTrue(Opcode::Byte jmpcode) { addPatch(d_patchTrue, jmpcode); } icmake-10.03.00/comp/semval/logicor.cc0000644000175000017500000000070214204126313016335 0ustar frankfrank//#define XERR #include "semval.ih" SemVal SemVal::logicOr(SemVal &&rhs) && { if (d_type & rhs.type() & e_const) // const operands set(e_int | e_const, d_value != 0 or rhs.value() != 0 or (d_type & e_str) or (rhs.type() & e_str) ); else { asBool(); rmJmpZero(); rhs.asBool(); *this << rhs; } return move(*this); } icmake-10.03.00/comp/semval/set.cc0000644000175000017500000000017414204126313015475 0ustar frankfrank//#define XERR #include "semval.ih" void SemVal::set(ExprType type, int value) { d_type = type; d_value = value; } icmake-10.03.00/comp/semval/tolist.cc0000644000175000017500000000120414204126313016213 0ustar frankfrank//#define XERR #include "semval.ih" void SemVal::toList() { char const *type; switch (d_type & e_mask) { case e_list: // already a list, cast not needed return; case e_str: push(); *this << Opcode::atol; d_type = e_list | e_stack ; return; case e_bool: type = "bool' to `list"; break; case e_int: type = "int' to `list"; break; default: // if e_null: invalid cast type = "void' to `int"; break; } invalidCast(type); } icmake-10.03.00/comp/semval/opinsert2.f0000644000175000017500000000013514204126313016464 0ustar frankfrankinline SemVal &operator<<(SemVal &semVal, short value) { return semVal.insert2(value); } icmake-10.03.00/comp/semval/islvalue1.f0000644000175000017500000000015314204126313016444 0ustar frankfrankinline bool SemVal::isLvalue(Opcode::Byte opcode) const { return isLvalue(Opcode::mnemonic(opcode)); } icmake-10.03.00/comp/semval/continuestmnt.cc0000644000175000017500000000020614204126313017610 0ustar frankfrank//#define XERR #include "semval.ih" void SemVal::continueStmnt() { addPatch(d_patchContinue, Opcode::jmp); d_state = DEAD; } icmake-10.03.00/comp/semval/addpatch1.cc0000644000175000017500000000023514204126313016531 0ustar frankfrank#define XERR #include "semval.ih" void SemVal::addPatch(vector &patchVect) { *this << as(0); patchVect.push_back(d_code.size()); } icmake-10.03.00/comp/semval/insert2.cc0000644000175000017500000000025014204160651016266 0ustar frankfrank#define XERR #include "semval.ih" SemVal &SemVal::insert2(short value) { // if (not d_ignoreNext) // { endian(&d_code, value); // } return *this; } icmake-10.03.00/comp/semval/boolnot.cc0000644000175000017500000000055214204126313016356 0ustar frankfrank//#define XERR #include "semval.ih" SemVal SemVal::boolNot() { if (d_type & e_const) // immediate value set(e_int | e_const, not( (d_type & e_str) or d_value != 0 ) ); // strings: always 'true', ints: != 0: true else { asBool(); swapTrueFalse(); } return move(*this); } icmake-10.03.00/comp/semval/setresult.f0000644000175000017500000000016314204126313016572 0ustar frankfrankinline void SemVal::setResult(ExprType result) // e_var, e_stack, ... { d_type = (d_type & e_mask) | result; } icmake-10.03.00/comp/semval/assignable.cc0000644000175000017500000000037614204126313017016 0ustar frankfrank//#define XERR #include "semval.ih" bool SemVal::assignable(Opcode::Byte opcode, SemVal &rhs) const { if ( (d_type & e_var) and sameType(rhs.type(), opcode) ) return true; Error::msg(Error::OPERAND_TYPES) << "='\n"; return false; } icmake-10.03.00/comp/semval/patchtrue.f0000644000175000017500000000012014204126313016530 0ustar frankfrankinline void SemVal::patchTrue(PatchDest dest) { patch(d_patchTrue, dest); } icmake-10.03.00/comp/semval/cast.cc0000644000175000017500000000075614204126313015642 0ustar frankfrank#define XERR #include "semval.ih" SemVal SemVal::cast(Tokens::Tokens_ destType) { switch (destType) { case Tokens::INT: toInt(); break; case Tokens::STRINGTYPE: toStr(); break; case Tokens::LIST: toList(); break; case Tokens::BOOL: asBool(); break; default: // avoids compiler warnings break; } return move(*this); } icmake-10.03.00/comp/semval/islvalue2.cc0000644000175000017500000000032614204126313016607 0ustar frankfrank//#define XERR #include "semval.ih" bool SemVal::isLvalue(char const *mnemonic) const { if (d_type & e_var) return true; Error::msg(Error::LVALUE_NEEDED) << mnemonic << "'\n"; return false; } icmake-10.03.00/comp/semval/patchbreak.f0000644000175000017500000000010314204126313016636 0ustar frankfrankinline void SemVal::patchBreak() { patch(d_patchBreak, END); } icmake-10.03.00/comp/semval/icmconf0000777000175000017500000000000014204126313020473 2../../icmconf.dirustar frankfrankicmake-10.03.00/comp/semval/binary.cc0000644000175000017500000000202114204126313016157 0ustar frankfrank//#define XERR #include "semval.ih" // the lhs value is pushed first, the rhs value pushed 2nd SemVal SemVal::binary(Opcode::Byte opcode, SemVal &&rhs) { xerr("lhs type: " << d_type << ", rhs type: " << rhs.d_type); if (accept(rhs, opcode)) { if ( (d_type & rhs.type() & e_const) // lhs, rhs both constants and // but older,younger are opcode != Opcode::older // always run-time checked and opcode != Opcode::younger ) constBinary(opcode, rhs); else { rhs.push(); push(); *this << rhs << opcode; // comparison operations // return int values if (Opcode::eq <= opcode and opcode <= Opcode::greq) d_type = e_int; stackType(); } } return move(*this); } icmake-10.03.00/comp/semval/compound.cc0000644000175000017500000000116114204126313016523 0ustar frankfrank#define XERR #include "semval.ih" // lhs @= rhs becomes: // push lhs, push rhs, @, copy lhs (-> pop lhs if it's the last // step of the expression) SemVal SemVal::compound(Opcode::Byte opcode, SemVal &&rhs) { if (not assignable(opcode, rhs)) return move(*this); // a (compound) assignment is always handled by code: // lhs code | rhs code | operation | copy_var to lhs push(); rhs.push(); *this << rhs << opcode << Opcode::copy_var << as(d_value); d_type = (d_type & e_mask) | e_var; return move(*this); } icmake-10.03.00/comp/semval/insert3.cc0000644000175000017500000000130214204126313016263 0ustar frankfrank#define XERR #include "semval.ih" // see README.patch SemVal &SemVal::insert3(SemVal &rhs) { unsigned length = d_code.length(); // current code length d_code += rhs.d_code; // append rhs's code d_lastOpcode = rhs.d_lastOpcode; // and update the last opocde // append rhs patch offsets + // length to d_patchTrue extend(d_patchTrue, rhs.d_patchTrue, length); extend(d_patchFalse, rhs.d_patchFalse, length); extend(d_patchBreak, rhs.d_patchBreak, length); extend(d_patchContinue, rhs.d_patchContinue, length); return *this; } icmake-10.03.00/comp/semval/constcompare.f0000644000175000017500000000047114204126313017237 0ustar frankfrank // both types either int or string. // list constants are always compared run-time inline int SemVal::constCompare(SemVal const &rhs) const { return (d_type & e_int) ? d_value - rhs.value() : StringStore::instance().constCompare(d_value, rhs.value()); } icmake-10.03.00/comp/semval/assign.cc0000644000175000017500000000162414204126313016167 0ustar frankfrank#define XERR #include "semval.ih" // pop_var or copy_var SemVal SemVal::assign(SemVal &&rhs, Opcode::Byte opcode) { if (not isLvalue("=")) return move(*this); if (not tryString2Int(rhs)) // if d_type & e_int: 'a' etc -> int value rhs.bool2int(); // maybe rhs is bool? convert to int // for '=': same types required if ((d_type & rhs.type() & e_mask) == e_null) { Error::msg(Error::OPERAND_TYPES) << "='\n"; return move(*this); } rhs.push(); // push the rhs expression on the stack // and perform the assignment *this << Opcode::pop_var << as(d_value); rhs << *this; // append lhs's code rhs.set(d_type, d_value); return move(rhs); } icmake-10.03.00/comp/semval/catstatement.cc0000644000175000017500000000056514204126313017402 0ustar frankfrank//#define XERR #include "semval.ih" void SemVal::catStatement(SemVal &next) { xerr("stack size: " << s_deadCode.size()); if (not s_deadCode.back()) { patchFalse(END); patchTrue(END); *this << next; s_deadCode.back() = (d_state = next.d_state) != ACCEPT; s_returns = (d_state & RETURN) != 0; } xerr("OUT"); } icmake-10.03.00/comp/semval/value.f0000644000175000017500000000007114204126313015652 0ustar frankfrankinline int SemVal::value() const { return d_value; } icmake-10.03.00/comp/semval/ifstmnt.cc0000644000175000017500000000741514204126313016373 0ustar frankfrank//#define XERR #include "semval.ih" // see below for a description SemVal SemVal::ifStmnt(SemVal &cond, SemVal &trueStmnt, SemVal &falseStmnt) { if (cond.type() & e_const) // constant condition: use { // trueStmnt or falseStmnt *this << (cond.boolConst() ? trueStmnt : falseStmnt); return move(*this); } bool useFalse = falseStmnt.d_code.size() != 0; cond.asBool(); // prepare true- and false-lists if (trueStmnt.d_code.size() == 0) // no trueStmnt { xerr("no true code"); if (not useFalse) // and no falseStmnt: { xerr("no false code"); return move(cond); // then return cond as bool } xerr("false code"); cond.patchFalse(END); // only a falseStmnt: reach it *this << cond << falseStmnt; // append the falseStmnt return *this; // and done } xerr("true code"); cond.patchTrue(END); // trueStmnt exists: reach it if (not useFalse) // no falseStmnt { xerr("no false code"); *this << cond << trueStmnt; // append the trueStmnt return *this; // and done } xerr("false code"); trueStmnt.addPatchFalse(Opcode::jmp); // add jmp around falseStmnt // trueStmnt's patchFalse list becomes cond's patchFalse list, // so its jmp-locations must be incremented with cond's code size: trueStmnt.shiftPatchFalse(cond.d_code.length()); // now save the trueStmnt's falselist (eventually becoming cond's // patchFalse list) auto patchFalse{ move(trueStmnt.d_patchFalse) }; // append trueStmnt to cond: trueStmnt doesn't have a patchFalse list // anymore, so cond's patchFalse remains as-is cond << trueStmnt; // now that cond = cond | trueStmnt: cond's false jmps must reach // the end of cond's code: cond.patchFalse(END); // restore patchFalse as cond|falseStmnt's d_patchFalse: cond.d_patchFalse = move(patchFalse); // append (cond|trueStmnt)|falseStmnt to the initialization code: *this << cond << falseStmnt; return move(*this); } // Aho, Sethi, Ullman, 1986, p. 505 // // S = if E then M1 S1 // E.true -> M1 // S.next -> merge(E.false, S1.next) // // S = if E then M1 S1 N else M2 S2 // E.true -> M1 // E.false -> M2 // S.next -> merge(S1.next, N.next, S2.next) // // ------------------------------------------------------------------------- // // The current object contains the if-stmnt's initialization list, so // the cond, trueStmnt and falseStmnt's code is appended to the current // object: // // No trueStmnt, no falseStmnt: // ============================ // F // +-----> // | // cond ----> // T // // No trueStmnt: // ============= // T // +--------------+------> T // | T| // cond ----> falseStmt ---> F // F // // No falseStmnt: // ============== // F // +----------------+---> F // | F| // cond ----> trueStmnt --> T // T // // If-stmnt having a trueStmnt and a falseStmnt: // F // +---------------------------+ // | | // cond ----> trueStmnt | jmp +-----> falseStmt -+--> F // T T| F| | T| | // | +---+--------------------------+ // | | // +------------------------------+--------> T icmake-10.03.00/comp/semval/patchfalse.f0000644000175000017500000000012214204126313016645 0ustar frankfrankinline void SemVal::patchFalse(PatchDest dest) { patch(d_patchFalse, dest); } icmake-10.03.00/comp/semval/semval.h0000644000175000017500000002037414204171312016036 0ustar frankfrank#ifndef INCLUDED_SEMVAL_ #define INCLUDED_SEMVAL_ #include #include #include "../exprtype/exprtype.h" #include "../builtin/builtin.h" #include "../opcode/opcode.h" #include "../stringstore/stringstore.h" #include "../tokens/tokens.h" #include "../../support/as/as.h" #include "../../support/endian/endian.h" // e_int const values are directly stored in d_value // e_str const values are the offsets of strings in the string section // e_list const values are constructed by listconst // types of global variables are defined in the variables section by their // ExprType type values (e.g., e_int == 1, e_str == 2, e_list == 4) class SemVal: private Endian { friend SemVal &operator<<(SemVal &semVal, uint8_t opcode); // 1.f friend SemVal &operator<<(SemVal &semVal, short value); // 2.f friend SemVal &operator<<(SemVal &lhs, SemVal &rhs); // 3.f friend SemVal &operator<<(SemVal &semVal, Opcode::Byte opcode); // 4.cc ExprType d_type = e_null; // type of the expression int d_value; // index or value of the expression // for '(f)printf <<' calls: index // in s_printfMap std::vector d_patchTrue; std::vector d_patchFalse; std::vector d_patchBreak; std::vector d_patchContinue; std::vector d_printfArgs; std::string d_code; enum State // at catStatements: rhs is accepted at { // ACCEPT, otherwise it's ignored, and lhs ACCEPT = 0, // gets the rhs's NextState DEAD = 1, // (using bit-flags) RETURN = 2 }; unsigned d_state = ACCEPT; // static SemVal &(SemVal::*s_insert1)(uint8_t opcode); // static SemVal &(SemVal::*s_insert2)(short value); // static SemVal &(SemVal::*s_insert3)(SemVal &rhs); Opcode::Byte d_lastOpcode = Opcode::invalid; static Opcode::Byte s_lastOpcode; static std::vector s_deadCode; // vector, to initialize to // an initial size static bool s_returns; // last statement is return public: enum PatchDest { BEGIN, END }; std::string const &code() const; SemVal() = default; SemVal(ExprType type, int value = 0); ExprType type() const; // the SemVal's type int value() const; int constCompare(SemVal const &rhs) const; // copy SemVal assign(SemVal &&rhs, Opcode::Byte opcode); // '=' SemVal compound(Opcode::Byte opType, SemVal &&rhs); SemVal negate(); // '-' SemVal bitNot(); // '~' SemVal boolNot(); // '!' SemVal incDec(Opcode::Byte opcode, ExprType prepost); SemVal logicOr(SemVal &&rhs) &&; SemVal logicAnd(SemVal &&rhs) &&; SemVal binary(Opcode::Byte opcode, SemVal &&rhs); SemVal cast(Tokens::Tokens_ destType); SemVal ternary(SemVal &&trueExpr, SemVal &&falseExpr) &&; bool assignable(Opcode::Byte opcode, SemVal &rhs) const; bool isLvalue(Opcode::Byte opcode) const; // 1.f bool isLvalue(char const *mnemonic) const; // 2.cc void setValue(int value); void setType(ExprType type); // .f void setResult(ExprType result); // e_var, e_stack, ... void set(ExprType type, int value); SemVal printfArg(SemVal &rhs); void push(); // convert to code pushed on the stack // (performs bool2int) void callrss(Builtin builtin, unsigned nArgs = 0); // # args, // including a push_imm (if used) void catString(SemVal const &rhs); // this, rhs: e_str | e_const bool accept(Opcode::Byte opCode) const; // 1.cc bool accept(SemVal const &rhs, Opcode::Byte opCode) const; // 2.cc bool sameType(SemVal const &rhs, Opcode::Byte opcode) const; SemVal exprStmnt(); SemVal ifStmnt(SemVal &cond, SemVal &trueStmnt, SemVal &falseStmnt); SemVal forStmnt(SemVal &cond, SemVal &inc, SemVal &stmnt); void breakStmnt(); // add jmp + short 0 void continueStmnt(); // add jmp + short 0 void catStatement(SemVal &next); void patchFalse(PatchDest dest); // .f std::vector &printfArgs(); // grabbed by Args size_t nPrintfArgs() const; // .f void ends(); // state: DEAD & RETURN .f static bool returns(); // .f static void pushDead(); // push the dead-code state .f static void popDead(); // pop the former .f // dead-code state static void resetDead(); // tmp void bytes() const; private: bool copiedVar(); // change last pop_var into copy_var // (instead of pop/push void stackType(); // e_mask | e_stack void bool2int(); // patchup a e_bool to e_int void toInt(); void toStr(); void toList(); void asBool(); // also pushes const values, // initializes true and false patch // vectors bool boolConst() const; // use only when const: // true: int != 0, string length != 0, // otherwise false void swapTrueFalse(); // .f void rmJmpZero(); void invalidCast(char const *msg); // Error msg, e_null void constBinary(Opcode::Byte opcode, SemVal const &rhs); bool tryString2Int(SemVal &rhs); SemVal &insert1(uint8_t byte); // also: Opcode::Byte SemVal &insert2(short value); SemVal &insert3(SemVal &rhs); // -> scvatenate.c // void insert(); // activates adding code // void dead(); // SemVal &dead1(uint8_t opcode); // SemVal &dead2(short value); // SemVal &dead3(SemVal &rhs); // maybe erase list? void patch(std::vector &list, PatchDest dest); void patchBreak(); // always to the end .f void patchContinue(PatchDest dest); // .f void patchTrue(PatchDest dest); // patchFalse: public .f void addPatchTrue(Opcode::Byte jmpCode);// add jmpCode + short 0 2.f void addPatchTrue(); // add short 0 to d_code 1.f void addPatchFalse(Opcode::Byte jmpCode);// add jmpCode + short 0 2.f void addPatchFalse(); // add short 0 to d_code 1.f void shiftPatchFalse(unsigned shift); void addPatch(std::vector &pvect); void addPatch(std::vector &pvect, Opcode::Byte); static void extend(std::vector &dest, std::vector &src, unsigned shift); static void merge(std::vector &dest, std::vector &src); }; #include "type.f" #include "value.f" #include "setvalue.f" #include "settype.f" #include "islvalue1.f" #include "setresult.f" #include "constcompare.f" #include "code.f" #include "patchfalse.f" #include "popdead.f" #include "pushdead.f" #include "ends.f" #include "returns.f" #include "printfargs.f" #include "nprintfargs.f" #include "opinsert1.f" #include "opinsert2.f" #include "opinsert3.f" // #include "opinsert4.f" tmp: .cc #endif icmake-10.03.00/comp/semval/semval.ih0000644000175000017500000000054114204126313016202 0ustar frankfrank#include "../../xerr/xerr.ih" #include "semval.h" #include #include #include "../error/error.h" #include "swaptruefalse.f" #include "stacktype.f" #include "patchtrue.f" #include "patchbreak.f" #include "patchcontinue.f" #include "addpatchtrue1.f" #include "addpatchtrue2.f" #include "addpatchfalse.f" using namespace std; icmake-10.03.00/comp/semval/accept1.cc0000644000175000017500000000036714204126313016226 0ustar frankfrank//#define XERR #include "semval.ih" bool SemVal::accept(Opcode::Byte opcode) const { if (Opcode::types(opcode) & d_type) return true; Error::msg(Error::ARGUMENT_MISMATCH) << Opcode::mnemonic(opcode) << "'\n"; return false; } icmake-10.03.00/comp/semval/bitnot.cc0000644000175000017500000000050714204126313016201 0ustar frankfrank//#define XERR #include "semval.ih" SemVal SemVal::bitNot() { if (accept(Opcode::bnot)) { if (d_type & e_const) // a mere value is available d_value = ~d_value; else { push(); *this << Opcode::bnot; } } return move(*this); } icmake-10.03.00/comp/semval/sametype.cc0000644000175000017500000000063214204126313016530 0ustar frankfrank//#define XERR #include "semval.ih" bool SemVal::sameType(SemVal const &rhs, Opcode::Byte opcode) const { if ( (d_type & rhs.d_type & e_mask) or ( (d_type & e_intMask) and (rhs.d_type & e_intMask) ) ) return true; // types are identical, or an int/bool combi Error::msg(Error::OPERAND_TYPES) << Opcode::mnemonic(opcode) << "'\n"; return false; } icmake-10.03.00/comp/semval/breakstmnt.cc0000644000175000017500000000020014204126313017042 0ustar frankfrank//#define XERR #include "semval.ih" void SemVal::breakStmnt() { addPatch(d_patchBreak, Opcode::jmp); d_state = DEAD; } icmake-10.03.00/comp/semval/merge.cc0000644000175000017500000000027314204126313016001 0ustar frankfrank//#define XERR #include "semval.ih" // static void SemVal::merge(vector &dest, vector &src) { dest.insert(dest.end(), src.begin(), src.end()); src.clear(); } icmake-10.03.00/comp/semval/opinsert1.f0000644000175000017500000000013714204126313016465 0ustar frankfrankinline SemVal &operator<<(SemVal &semVal, uint8_t value) { return semVal.insert1(value); } icmake-10.03.00/comp/semval/addpatch2.cc0000644000175000017500000000027614204126313016537 0ustar frankfrank#define XERR #include "semval.ih" void SemVal::addPatch(vector &patchVect, Opcode::Byte jmpcode) { *this << jmpcode << as(0); patchVect.push_back(d_code.size()); } icmake-10.03.00/comp/semval/forstmnt.cc0000644000175000017500000001077314204126313016564 0ustar frankfrank#define XERR #include "semval.ih" // '*this' contains the code of the init-section // when used as 'while' the init-section is empty // the stmnt beyond 'init' is constructed in 'cond'. // '|' in comment indicates catenation of SemVal code blocks SemVal SemVal::forStmnt(SemVal &cond, SemVal &inc, SemVal &stmnt) { if (not (cond.d_type & e_const)) // 'cond' is not constant cond.asBool(); // -> prepare T/F lists else if (not cond.boolConst()) // cond is constant but false: return move(*this); // merely return init // save the patches to the // stmnt's end vector condFalse = move(cond.d_patchFalse); if (not (stmnt.d_type & e_const)) // stmnt has code { cond.patchTrue(END); // continue at stmnt cond << stmnt; // cond is 'cond | stmnt' // no inc, then continue at // cond's begin PatchDest patchDest = inc.d_type & e_const ? BEGIN : END; cond.patchTrue(patchDest); // stmnt continues at Inc cond.patchFalse(patchDest); // or (if Inc constant) cond.patchContinue(patchDest); // at cond's 1st opcode byte merge(condFalse, cond.d_patchBreak);// add stmnt's break jumps } if (not (inc.d_type & e_const)) // inc has code cond << inc; cond.addPatchTrue(Opcode::jmp); // jump to the code-begin cond.patchTrue(BEGIN); // continue at cond's begin cond.d_patchFalse = move(condFalse); // restore cond's False- (and // stmnt's Break) exits *this << cond; // append to init return move(*this); } // Init: initialization is available as (*this) stmnt // // -: constant element // c: element has code // |: cat stmnt // //Cond Stmnt Inc code: //------------------------------------------------------------------- // // F ? ? Init // // T - - Init | ---+ // ^ | // | | // +--+ // // // T - c Init | Inc -+ // ^ | // | | // +-------+ // // // T c - br // Init | Stmnt -+----------> // ^ | // | | T,F,cont // +---------+ // // // T c c +--------------------> // br| // Init | -- Stmnt ---------- Inc -+ // ^ T,F,cont | // | | // +------------------------+ // // // c - c F---------> // | // Init | Cond -+ // ^ | // | T-> Inc -+ // | | // | | // +---------------+ // // // c c - F-------+------------> // | | // Init | Cond -+ | // ^ | br| // | T-> Stmnt -+ // | |T,F,cont // | | // +-----------------+ // // // c c c F-------+--------------------> // | | // Init | Cond -+ | // ^ | br| // | T-> Stmnt ----------> Inc -+ // | T,F,cont | // | | // +---------------------------------+ icmake-10.03.00/comp/semval/patchcontinue.f0000644000175000017500000000013014204126313017376 0ustar frankfrankinline void SemVal::patchContinue(PatchDest dest) { patch(d_patchContinue, dest); } icmake-10.03.00/comp/semval/stacktype.f0000644000175000017500000000011614204126313016545 0ustar frankfrankinline void SemVal::stackType() { d_type = (d_type & e_mask) | e_stack; } icmake-10.03.00/comp/semval/patch.cc0000644000175000017500000000231014204171312015772 0ustar frankfrank#define XERR #include "semval.ih" void SemVal::patch(vector &list, PatchDest dest) { if (list.empty()) return; unsigned patchDest = dest == END ? d_code.size() : 0; // offset is the offset immediately beyond the jump instruction // including the two bytes jmp offset following the jmp, jf, jt // instruction. This is the position where the jump // starts after having read the jump instruction. Hence, the // jumpsize is determined by the distance 'patchDest - offset', // whereas this jumpsize must be inserted 2 bytes before offset // because that's where jmp reads the #bytes the jmp must skip //xerr("size: " << list.size()); for (unsigned offset: list) { //cerr << "insert jump size at " << (offset - 2) << '\n'; short jumpSize = patchDest - offset; //cerr << "jump size: " << hex << jumpSize << dec << '\n'; endian(&d_code[offset - 2], jumpSize); } //cerr << '\n'; list.clear(); // this patch is completed, code may be // appended to which this patch-vector no // longer applies. } icmake-10.03.00/comp/semval/addpatchtrue1.f0000644000175000017500000000010214204126313017262 0ustar frankfrankinline void SemVal::addPatchTrue() { addPatch(d_patchTrue); } icmake-10.03.00/comp/semval/returns.f0000644000175000017500000000010214204126313016233 0ustar frankfrank// static inline bool SemVal::returns() { return s_returns; } icmake-10.03.00/comp/semval/addpatchfalse.f0000644000175000017500000000014114204126313017317 0ustar frankfrankinline void SemVal::addPatchFalse(Opcode::Byte jmpcode) { addPatch(d_patchFalse, jmpcode); } icmake-10.03.00/comp/semval/ends.f0000644000175000017500000000007414204126313015472 0ustar frankfrankinline void SemVal::ends() { d_state = DEAD | RETURN; } icmake-10.03.00/comp/semval/type.f0000644000175000017500000000007414204126313015522 0ustar frankfrankinline ExprType SemVal::type() const { return d_type; } icmake-10.03.00/comp/semval/bytes.cc0000644000175000017500000000054614204126313016033 0ustar frankfrank#define XERR #include "semval.ih" void SemVal::bytes() const { xerr("size code: " << d_code.size() << ", true: " << d_patchTrue.size() <<\ ", false: " << d_patchFalse.size()); cerr << " " << hex << setfill('0'); for (unsigned char ch: d_code) cerr << setw(2) << (unsigned)ch << ' '; cerr << dec << setfill(' ') << '\n'; } icmake-10.03.00/comp/semval/logicand.cc0000644000175000017500000000102314204126313016454 0ustar frankfrank//#define XERR #include "semval.ih" SemVal SemVal::logicAnd(SemVal &&rhs) && { xerr("lhs type: " << d_type << ", rhs type: " << rhs.d_type); if (d_type & rhs.type() & e_const) // const operands set(e_int | e_const, ( d_value != 0 or (d_type & e_str) ) and ( rhs.value() != 0 or (rhs.type() & e_str) ) ); else { asBool(); patchTrue(END); rhs.asBool(); *this << rhs; } xerr("retun type: " << d_type); return move(*this); } icmake-10.03.00/comp/semval/toint.cc0000644000175000017500000000161514204126313016040 0ustar frankfrank//#define XERR #include "semval.ih" void SemVal::toInt() { char const *type; switch (d_type & e_mask) { case e_int: return; case e_bool: bool2int(); // d_type: e_int | e_stack return; case e_str: if (d_type & e_const) // int-representation of a set(e_int | e_const, // constant string StringStore::instance().asInt(d_value)); else { push(); *this << Opcode::atoi; d_type = e_int | e_stack; // atoi replaces the stacktop } return; case e_list: type = "list' to `int"; break; default: // if e_null: invalid cast type = "void' to `int"; break; } invalidCast(type); } icmake-10.03.00/comp/semval/tostr.cc0000644000175000017500000000175114204126313016057 0ustar frankfrank//#define XERR #include "semval.ih" void SemVal::toStr() { char const *type; switch (d_type & e_mask) { case e_str: // already a str, cast not needed return; case e_bool: // bools become ints bool2int(); [[fallthrough]]; case e_int: // (string)int: OK if (d_type & e_const) set(e_str | e_const, StringStore::instance().offset(to_string(d_value)) ); else { push(); *this << Opcode::itoa; d_type = e_str | e_stack; } return; case e_list: // (stringlist not implemented type = "list' to `string"; break; default: // if e_null: invalid cast type = "void' to `int"; break; } invalidCast(type); } icmake-10.03.00/comp/semval/resetdead.cc0000644000175000017500000000020414204126313016634 0ustar frankfrank//#define XERR #include "semval.ih" //static void SemVal::resetDead() { s_deadCode = vector(1); s_returns = false; } icmake-10.03.00/comp/semval/popdead.f0000644000175000017500000000010614204126313016151 0ustar frankfrank//static inline void SemVal::popDead() { s_deadCode.pop_back(); } icmake-10.03.00/comp/semval/frame0000644000175000017500000000006214204126313015404 0ustar frankfrank//#define XERR #include "semval.ih" SemVal:: { } icmake-10.03.00/comp/semval/extend.cc0000644000175000017500000000044514204126313016172 0ustar frankfrank//#define XERR #include "semval.ih" // static void SemVal::extend(vector &dest, vector &src, unsigned shift) { for_each(src.begin(), src.end(), [&](unsigned offset) { dest.push_back(offset + shift); } ); } icmake-10.03.00/comp/semval/trystring2int.cc0000644000175000017500000000114114204126313017537 0ustar frankfrank#define XERR #include "semval.ih" bool SemVal::tryString2Int(SemVal &rhs) { if ( d_type & e_int // lhs must be int and rhs.type() == (e_str | e_const) // rhs must be a const. str ) { // get the string string const &str = StringStore::instance().str(rhs.value()); if (str.length() == 1) // it's a 1-char string { rhs.set(e_int | e_const, str[0]); // return the char's value return true; // as int } } return false; } icmake-10.03.00/comp/semval/copiedvar.cc0000644000175000017500000000037314204126313016657 0ustar frankfrank//#define XERR #include "semval.ih" bool SemVal::copiedVar() { if (d_lastOpcode != Opcode::pop_var) return false; d_lastOpcode = Opcode::copy_var; d_code[d_code.size() - sizeof(short) - 1] = d_lastOpcode; return true; } icmake-10.03.00/comp/semval/boolconst.cc0000644000175000017500000000047014204126313016703 0ustar frankfrank#define XERR #include "semval.ih" bool SemVal::boolConst() const { switch (static_cast(d_type)) { case e_int | e_const: return d_value != 0; case e_str | e_const: return StringStore::instance().str(d_value).length(); default: return false; } } icmake-10.03.00/comp/semval/bool2int.cc0000644000175000017500000000042714204126313016433 0ustar frankfrank//#define XERR #include "semval.ih" void SemVal::bool2int() { if ((d_type & e_bool) == e_null) // not a bool return; patchTrue(END); *this << Opcode::push_1_jmp_end; patchFalse(END); *this << Opcode::push_0; d_type = e_int | e_stack; } icmake-10.03.00/comp/semval/push.cc0000644000175000017500000000311614204126313015660 0ustar frankfrank#define XERR #include "semval.ih" void SemVal::push() { if (d_type & e_stack) // expression already pushed { if (d_type & e_bool) bool2int(); return; } switch (d_type & (e_const | e_var | e_bool | e_reg | e_prefix | e_postfix)) { default: // handles e_void types: no actions return; case e_const: *this << (d_type & e_int ? Opcode::push_imm : Opcode::push_strconst) << as(d_value); break; case e_var: if (not copiedVar()) *this << Opcode::push_var << as(d_value); break; case e_bool: bool2int(); return; // bool2int -> alredy e_stack type case e_reg: *this << Opcode::push_reg; break; case e_prefix: // prefix: first do ++, then push the variable // holding the result of the expression *this << Opcode::push_var << as(d_value); break; case e_postfix: { // postfix: first push the variable, then compute the // result of the expression SemVal pre{ e_int }; // pseudo type for the insertion below: pre << Opcode::push_var << as(d_value); pre << *this; *this = move(pre); } break; } stackType(); } icmake-10.03.00/comp/args/0000755000175000017500000000000014204243136014041 5ustar frankfrankicmake-10.03.00/comp/args/args4.f0000644000175000017500000000012014204126313015216 0ustar frankfrankinline Args::Args(SemVal &semVal) : vector(1, std::move(semVal)) {} icmake-10.03.00/comp/args/args5.f0000644000175000017500000000014214204126313015223 0ustar frankfrankinline Args::Args(std::vector &semValVect) : vector(std::move(semValVect)) {} icmake-10.03.00/comp/args/callfunction.cc0000644000175000017500000000046414204126313017032 0ustar frankfrank//#define XERR #include "args.ih" bool Args::callFunction(SemVal &ret, Functions::Info const &info) { uint8_t size = pushArgs(ret); ret << Opcode::call << as(info.offset); if (size > 0) ret << Opcode::asp << size; ret.setType(e_reg | info.returnType); return true; } icmake-10.03.00/comp/args/function.cc0000644000175000017500000000047714204126313016202 0ustar frankfrank//#define XERR #include "args.ih" bool Args::function(SemVal &ret, Functions::Overload const *overloads) { if (overloads == 0) return false; for (Functions::Info const &info: *overloads) { if (equalTypes(info.params)) return callFunction(ret, info); } return false; } icmake-10.03.00/comp/args/makelist.cc0000644000175000017500000000112714204126313016157 0ustar frankfrank#define XERR #include "args.ih" bool Args::makelist(Builtin::ArgsIter funBegin, Builtin::ArgsIter funEnd, unsigned argBegin, unsigned argEnd) { if (argEnd - argBegin == 0) // zero trailing args: OK return true; if (funEnd - funBegin != argEnd - argBegin) // # specs/args differ return false; // check trailing args for (; funBegin != funEnd; ++funBegin, ++argBegin) { if (not equalTypes(funBegin, argBegin)) return false; } return true; } icmake-10.03.00/comp/args/args.ih0000644000175000017500000000020314204126313015307 0ustar frankfrank#include "args.h" #include "../../xerr/xerr.ih" #include "../../support/as/as.h" #include "equaltypes1.f" using namespace std; icmake-10.03.00/comp/args/trailingtypes.cc0000644000175000017500000000117214204126313017244 0ustar frankfrank#define XERR #include "args.ih" // inspect arguments from the last back to the first bool Args::trailingTypes(Builtin::ArgsIter funBegin, Builtin::ArgsIter funEnd, unsigned argBegin, unsigned argEnd) const { if (funEnd - funBegin > argEnd - argBegin) // too few trailing args return false; // check trailing args fm the // last to the first for (--argEnd ; funEnd-- != funBegin; --argEnd) { if (not equalTypes(funEnd, argEnd)) return false; } return true; } icmake-10.03.00/comp/args/typesmatch.cc0000644000175000017500000000322014204126313016523 0ustar frankfrank#define XERR #include "args.ih" bool Args::typesMatch(Builtin::Function function) { if (function == Builtin::BuiltinSize) // no such builtin function return false; // get the fun's args info auto const &funArgs = Builtin::arguments(function); if (funArgs.size() == 0) return size() == 0; // no arguments: OK auto funBegin = funArgs.begin(); // initialize the types/args auto funEnd = funArgs.end(); // iterators/indices // initial int not present? // then provide it: if ((*funBegin & e_bool) and not((*this)[0].type() & e_int)) insert( begin(), SemVal{ e_int | e_const, Builtin::defaultArg(function) } ); unsigned argBegin = 0; unsigned argEnd = size(); // xerr("funtypes:"); // for (auto iter = funBegin; iter != funEnd; ++iter) // cerr << *iter << ' '; // cerr << '\n'; // funBegin, argBegin move up if (not initialTypes(function, funBegin, funEnd, argBegin, argEnd)) return false; //xerr("funargs: " << (funEnd - funBegin) << ", args: " << (argEnd - argBegin)); // funBegin == funEnd or points beyond e_null // argBegin is the index of the next argument to check return function == Builtin::MAKELIST ? // handle MAKELIST makelist(funBegin, funEnd, argBegin, argEnd) : trailingTypes(funBegin, funEnd, argBegin, argEnd); } icmake-10.03.00/comp/args/catexpressions.cc0000644000175000017500000000127214204126313017421 0ustar frankfrank#define XERR #include "args.ih" // catExpressions is called for for- and if- statements's initialization // and increment sections. If an expression has no code, then the SemVal Args::catExpressions(unsigned end) { SemVal ret; for (unsigned idx = 0; idx != end; ++idx) { SemVal &arg = (*this)[idx]; // if (arg.type() & (e_const | e_var)) // continue; //xerr(" type: " << arg.type() << ", code size: " << arg.code().size()); //arg.bytes(); SemVal next = arg.exprStmnt(); ret << next; //ret.bytes(); // arg.push(); // push the initialization code // ret << arg; } return ret; } icmake-10.03.00/comp/args/callmakelist.cc0000644000175000017500000000461514204126313017020 0ustar frankfrank#define XERR #include "args.ih" // see below for the argument handling procedure SemVal Args::callMakelist() { SemVal ret; vector indices{ 3, 1, 0, 2 }; if (size() == 4) // comparison provided: turn into int const (*this)[2].setType(e_int | e_const); else // no comparison, provide Opcode::hlt { push_back(SemVal{ e_int | e_const, Opcode::hlt }); indices.erase(indices.begin()); } vector &args = *this; // 'indices' specifies the pusing order for (unsigned idx: indices) // of the arguments { args[idx].push(); ret << args[idx]; } ret << Opcode::call_rss << as(Builtin::MAKELIST) << Opcode::asp << as(size()); ret.setResult(Builtin::returnType(Builtin::MAKELIST)); return ret; } // There are always 2 or 4 arguments: 4 argument: comparison string is used // With 2 args: a 3rd Opcode::hlt arg is added // // Arguments vector with 2 (-> 3) arguments: // [0]: selection type (e.g., O_FILE) // [1]: regex // [2]: hlt // // Arguments vector with 4 arguments: // [0]: selection type (e.g., O_FILE) // [1]: regex // [2]: older/younger // [3]: comparison string // // // argument: 0 1 2 3 // makelist(O_ALL, "*.cc", younger, "xx"); // // [0014] 06 05 00 push string "xx" // [0017] 06 00 00 push string "*.cc" // [001a] 05 08 00 push int 0008 // [001d] 05 17 00 push int 0017 // [0020] 1b 1c callrss 1c (makelist) // // makelist("*.cc", younger, "xx"); // // [0014] 06 05 00 push string "xx" // [0017] 06 00 00 push string "*.cc" // [001a] 05 01 00 push int 0001 // [001d] 05 17 00 push int 0017 // [0020] 1b 1c callrss 1c (makelist) // // makelist("*.cc"); // // [0014] 06 00 00 push string "*.cc" // [0017] 05 01 00 push int 0001 // [001a] 05 34 00 push int 0034 // [001d] 1b 1c callrss 1c (makelist) // // makelist(O_ALL, "*.cc"); // // [0014] 06 00 00 push string "*.cc" // [0017] 05 01 00 push int 0001 // [001a] 05 34 00 push int 0034 // [001d] 1b 1c callrss 1c (makelist) // // 1st pushed: comparison string or omitted // 2nd pushed: regex // 3rd pushed: selection type (O_FILE, O_ALL, ...) // 4th pushed: greater, smaller (when comp. file is used), hlt (otherwise) icmake-10.03.00/comp/args/equaltypes1.f0000644000175000017500000000021614204126313016461 0ustar frankfrankinline bool Args::equalTypes(Builtin::ArgsIter funIter, unsigned argIdx) const { return (*funIter & (*this)[argIdx].type()) != e_null; } icmake-10.03.00/comp/args/initialtypes.cc0000644000175000017500000000156614204126313017073 0ustar frankfrank#define XERR #include "args.ih" bool Args::initialTypes(Builtin::Function function, Builtin::ArgsIter &funBegin, Builtin::ArgsIter funEnd, unsigned &argBegin, unsigned argEnd) { // inspect all types or until // e_null for (; funBegin != funEnd; ++funBegin, ++argBegin) { if (*funBegin == e_null) // e_null: variable #args ok { ++funBegin; // continue beyond break; } if ( argBegin == argEnd // not enough arguments or // or types differ: no builtin not equalTypes(funBegin, argBegin) ) return false; } return true; } icmake-10.03.00/comp/args/equaltypes2.cc0000644000175000017500000000055414204126313016627 0ustar frankfrank//#define XERR #include "args.ih" bool Args::equalTypes(std::vector const ¶mTypes) const { unsigned nArgs = size(); if (paramTypes.size() != nArgs) return false; for (size_t idx = 0; idx != nArgs; ++idx) { if (not equalMask((*this)[idx].type(), paramTypes[idx])) return false; } return true; } icmake-10.03.00/comp/args/ifstmnt.cc0000644000175000017500000000120714204126313016031 0ustar frankfrank//#define XERR #include "args.ih" // the current Args object contains the if stmnt's initialization list as its // size() - 1 initial elements. Its final element is the actual condition. // The initial size() - 1 elements are concatenated, resulting in a SemVal, // which then calls SemVal::ifStmnt, receiving its final element and trueStmnt // and falseStmnt as its arguments. SemVal Args::ifStmnt(SemVal &trueStmnt, SemVal &falseStmnt) { // push the initialization code and // complete the ifstmnt return catExpressions(size() - 1).ifStmnt(back(), trueStmnt, falseStmnt); } icmake-10.03.00/comp/args/args.h0000644000175000017500000000652214204126313015150 0ustar frankfrank#ifndef INCLUDED_ARGS_ #define INCLUDED_ARGS_ #include #include "../semval/semval.h" #include "../builtin/builtin.h" #include "../functions/functions.h" // see comment below class Args: public std::vector { public: Args() = default; Args(SemVal &semVal); // 4.f Args(std::vector &semValVect); // steals semValVect // 5.f Args &add(SemVal &semVal); // does push_back // if true then 'ret' calls // builtin function 'name' bool builtin(SemVal &ret, std::string const &name); SemVal callBuiltin(Builtin::Function function); // if true then 'ret' calls // user-defined function 'name' bool function(SemVal &ret, Functions::Overload const *overloads); // back() has the conditition code, // before that: var. initializations SemVal ifStmnt(SemVal &trueStmnt, SemVal &falseStmnt); SemVal forStmnt(SemVal &cond, Args &inc, SemVal &stmnt); private: uint8_t pushArgs(SemVal &ret); SemVal callMakelist(); // cannot be const members as an optional initial // int value may be inserted bool typesMatch(Builtin::Function function); bool initialTypes(Builtin::Function function, Builtin::ArgsIter &funBegin, Builtin::ArgsIter funEnd, unsigned &argBegin, unsigned argEnd); bool makelist(Builtin::ArgsIter funBegin, Builtin::ArgsIter funEnd, unsigned argBegin, unsigned argEnd); bool trailingTypes(Builtin::ArgsIter funBegin, Builtin::ArgsIter funEnd, unsigned argBegin, unsigned argEnd) const; // used for builtin functions (1.f) bool equalTypes(Builtin::ArgsIter funIter, unsigned argIdx) const; // used when calling functions (2.cc) bool equalTypes(std::vector const ¶mTypes) const; bool callFunction(SemVal &ret, Functions::Info const &info); SemVal catExpressions(unsigned end); // push the code of // initialization, init and inc }; #include "args4.f" #include "args5.f" // the structure of arguments passed to functions is: // // The SemVal argument structure: // // SemVal // [ // type: // value: #arguments // code: [ ... 'value' SemVal structs ... ] // | | | // | | +-> the last SemVal refers to // | | the last argument // | | // | +-> each SemVal has code pushing an argument // | on the run-time (icm-exec) stack // | (i.e., executable code) // | // +-> the 1st SemVal refers to // the first argument // ] #endif icmake-10.03.00/comp/args/forstmnt.cc0000644000175000017500000000036714204126313016227 0ustar frankfrank#define XERR #include "args.ih" // '*this' is the init section SemVal Args::forStmnt(SemVal &cond, Args &inc, SemVal &stmnt) { SemVal incSv = inc.catExpressions(inc.size()); return catExpressions(size()).forStmnt(cond, incSv, stmnt); } icmake-10.03.00/comp/args/builtin.cc0000644000175000017500000000036114204126313016013 0ustar frankfrank//#define XERR #include "args.ih" bool Args::builtin(SemVal &ret, string const &name) { auto function = Builtin::find(name); if (not typesMatch(function)) return false; ret = callBuiltin(function); return true; } icmake-10.03.00/comp/args/pushargs.cc0000644000175000017500000000044414204126313016203 0ustar frankfrank//#define XERR #include "args.ih" uint8_t Args::pushArgs(SemVal &ret) { // push all arguments in reversed order for (auto begin = rbegin(), end = rend(); begin != end; ++begin) { begin->push(); ret << *begin; } return size(); } icmake-10.03.00/comp/args/frame0000644000175000017500000000005614204126313015054 0ustar frankfrank//#define XERR #include "args.ih" Args:: { } icmake-10.03.00/comp/args/add.cc0000644000175000017500000000016414204126313015076 0ustar frankfrank#define XERR #include "args.ih" Args &Args::add(SemVal &semVal) { push_back(move(semVal)); return *this; } icmake-10.03.00/comp/args/callbuiltin.cc0000644000175000017500000000156414204126313016655 0ustar frankfrank//#define XERR #include "args.ih" SemVal Args::callBuiltin(Builtin::Function function) { SemVal ret; // list makelist([int type = O_FILE], string mask) // list makelist([int type = O_FILE,] string mask, {newer,older}, // string comparefile) // the run-time makelist function needs a (hidden, not configurable) // first argument S_IEXEC (= 32, see scaneer/lexer) if (function == Builtin::MAKELIST) return callMakelist(); uint8_t nArgs = pushArgs(ret); if (Builtin::argCount(function)) { SemVal count{ e_int | e_const, nArgs++ }; count.push(); ret << count; } ret << Opcode::call_rss << as(function); if (nArgs != 0) ret << Opcode::asp << nArgs; ret.setResult(Builtin::returnType(function)); xerr("returning type " << ret.type()); return ret; } icmake-10.03.00/comp/icm_bootstrap0000755000175000017500000000022714204126313015676 0ustar frankfrank#!/bin/bash . ../bootstrap/flags . ../bootstrap/functions echo Creating tmp${LIBDIR}/icm-comp subdirs maindir ${LIBDIR}/icm-comp rm -f */*.gch *.o icmake-10.03.00/comp/stringstore/0000755000175000017500000000000014204243136015470 5ustar frankfrankicmake-10.03.00/comp/stringstore/instance.cc0000644000175000017500000000022614204126313017600 0ustar frankfrank//#define XERR #include "stringstore.ih" StringStore StringStore::s_stringStore; StringStore &StringStore::instance() { return s_stringStore; } icmake-10.03.00/comp/stringstore/offset.cc0000644000175000017500000000126414204126313017265 0ustar frankfrank#define XERR #include "stringstore.ih" unsigned StringStore::offset(string const &str) { if ( auto iter = find_if(d_string.begin(), d_string.end(), [&](Info const &info) { return info.str == str; // find str in existing strings } ); iter != d_string.end() ) return iter->offset; // return offset of existing str. d_indexOf.insert({ d_offset, d_string.size() }); // index given offset d_string.push_back({ d_offset, str }); // string info itself unsigned ret = d_offset; d_offset += str.size() + 1; // add 1 for \0 return ret; } icmake-10.03.00/comp/stringstore/constcompare.cc0000644000175000017500000000042114204126313020466 0ustar frankfrank//#define XERR #include "stringstore.ih" int StringStore::constCompare(unsigned lhsOffset, unsigned rhsOffset) const { return d_string[ d_indexOf.find(lhsOffset)->second ].str.compare( d_string[ d_indexOf.find(rhsOffset)->second ].str ); } icmake-10.03.00/comp/stringstore/icmconf0000777000175000017500000000000014204126313021567 2../../icmconf.dirustar frankfrankicmake-10.03.00/comp/stringstore/stringvect.f0000644000175000017500000000014614204126313020025 0ustar frankfrankinline std::vector const &StringStore::stringVect() const { return d_string; } icmake-10.03.00/comp/stringstore/str.cc0000644000175000017500000000023314204126313016602 0ustar frankfrank#define XERR #include "stringstore.ih" string const &StringStore::str(unsigned offset) const { return d_string[d_indexOf.find(offset)->second].str; } icmake-10.03.00/comp/stringstore/stringstore.ih0000644000175000017500000000022314204127352020373 0ustar frankfrank#include "stringstore.h" #include "../../xerr/xerr.ih" #include #include using namespace std; using namespace FBB; icmake-10.03.00/comp/stringstore/stringstore1.cc0000644000175000017500000000022114204126313020433 0ustar frankfrank//#define XERR #include "stringstore.ih" StringStore::StringStore() : d_string(1, { 0, "" }), d_offset(1), d_indexOf{ { 0, 0 } } {} icmake-10.03.00/comp/stringstore/asint.cc0000644000175000017500000000100614204126313017107 0ustar frankfrank//#define XERR #include "stringstore.ih" int StringStore::asInt(unsigned strOffset) { auto iter = d_indexOf.find(strOffset); // iter->second is the index in // d_string if (iter == d_indexOf.end()) fmsg << "internal error: no string at offset " << strOffset << noid; try { return stoi(d_string[iter->second].str); // convert to int } catch (...) { return 0; // or return 0 } } icmake-10.03.00/comp/stringstore/frame0000644000175000017500000000007414204126313016503 0ustar frankfrank//#define XERR #include "stringstore.ih" StringStore:: { } icmake-10.03.00/comp/stringstore/stringstore.h0000644000175000017500000000362014204126313020222 0ustar frankfrank#ifndef INCLUDED_STRINGSTORE_ #define INCLUDED_STRINGSTORE_ #include #include #include // Singleton struct StringStore { struct Info { unsigned offset; std::string str; }; private: std::vector d_string; // the strings and their offsets in // the string area unsigned d_offset; // offset of the next string in the // string area // offset index // (in d_string) std::unordered_map d_indexOf; // locate a string // idx given its // offset static StringStore s_stringStore; // defined in instance.cc public: StringStore(StringStore const &other) = delete; static StringStore &instance(); // was: add(...) unsigned offset(std::string const &str);// returns offset of str // (adds it if a new str) std::string const &str(unsigned offset) const; // returns str given // its offset // "123" -> 123 int asInt(unsigned strOffset); // returns 0 if no int-chars int constCompare(unsigned lhsOffset, unsigned rhsOffset) const; std::vector const &stringVect() const; // the strings and .f // their offsets in // the string area private: StringStore(); }; #include "stringvect.f" #endif icmake-10.03.00/comp/exprtype/0000755000175000017500000000000014204243136014765 5ustar frankfrankicmake-10.03.00/comp/exprtype/opand.f0000644000175000017500000000027514204126313016236 0ustar frankfrankinline constexpr ExprType operator&(ExprType lhs, ExprType rhs) { return static_cast( static_cast(lhs) & static_cast(rhs) ); } icmake-10.03.00/comp/exprtype/exprtype.ih0000644000175000017500000000010114204126313017154 0ustar frankfrank#include "exprtype.h" #include using namespace std; icmake-10.03.00/comp/exprtype/equalmask.f0000644000175000017500000000014114204126313017110 0ustar frankfrankinline bool equalMask(ExprType lhs, ExprType rhs) { return (lhs & rhs & e_mask) != e_null; } icmake-10.03.00/comp/exprtype/opinsert.cc0000644000175000017500000000152714204126313017141 0ustar frankfrank#include "exprtype.ih" ostream &operator<<(ostream &out, ExprType type) { if (type & e_null) return out << "void"; out << "[ "; if (type & e_int) out << "int "; else if (type & e_str) out << "string "; else if (type & e_list) out << "list "; if (type & e_bool) out << "bool "; if (type & e_const) out << "const "; else if (type & e_var) out << "var "; else if (type & e_reg) out << "reg "; else if (type & e_stack) out << "stack "; if (type & e_prefix) out << "prefix "; else if (type & e_postfix) out << "postfix "; else if (type & e_order) out << "order "; else if (type & e_printf) out << "printf "; else if (type & e_fprintf) out << "fprintf "; return out << ']'; } icmake-10.03.00/comp/exprtype/exprtype.h0000644000175000017500000000052114204126313017011 0ustar frankfrank#ifndef INCLUDED_EXPRTYPE_H_ #define INCLUDED_EXPRTYPE_H_ #include #include "../../support/exprtype/exprtype.h" unsigned const N_EXPR_TYPES = 4; // #types used at e_mask #include "opor.f" #include "opand.f" #include "equalmask.f" #include "voidmask.f" std::ostream &operator<<(std::ostream &out, ExprType type); #endif icmake-10.03.00/comp/exprtype/opor.f0000644000175000017500000000027514204126313016114 0ustar frankfrankinline constexpr ExprType operator|(ExprType lhs, ExprType rhs) { return static_cast( static_cast(lhs) | static_cast(rhs) ); } icmake-10.03.00/comp/exprtype/voidmask.f0000644000175000017500000000017214204126313016746 0ustar frankfrankinline bool voidMask(ExprType lhs, ExprType rhs) { return equalMask(lhs, rhs) or (lhs == e_void and rhs == e_void); } icmake-10.03.00/comp/usage.cc0000644000175000017500000000100514204126313014511 0ustar frankfrank#include "main.ih" namespace { char const info[] = R"_( [options] source dest Where: [options] - optional arguments (short options between parentheses): --help (-h) - provide this help --version (-v) - show version information and terminate source - source file to compile (normally output from ICM-PP) dest - name of the generated binary (.bim) file )_"; } void usage(std::string const &progname) { Tools::usageTop(progname) << info; } icmake-10.03.00/comp/parser/0000755000175000017500000000000014204243136014401 5ustar frankfrankicmake-10.03.00/comp/parser/listconst.cc0000644000175000017500000000137314204126313016733 0ustar frankfrank////#define XERR //#include "parser.ih" // //SemVal Parser::listConst(Args &args) //{ // return args.builtin(Builtin::LISTCONST); // // // SemVal list{ e_const | e_list }; // the result // // for (auto &semVal: args) // ensure that all args are string // { // if (semVal.type() & e_str) // { // semVal.push(); // all arguments must be strigns // list << semVal; // add code to list // continue; // } // // Error::msg(Error::LIST_CONST); // return list; // } // // list << Opcode::push_imm << as(args.size()); // list.callBuiltin(Builtin::LISTCONST, args.size() + 1); // // return // return list; //} icmake-10.03.00/comp/parser/parser.h0000644000175000017500000000600014204126313016037 0ustar frankfrank// Generated by Bisonc++ V6.03.00 on Thu, 05 Mar 2020 17:53:53 +0100 #ifndef Parser_h_included #define Parser_h_included #include "parserbase.h" #include "../exprtype/exprtype.h" #include "../scanner/scanner.h" #include "../functions/functions.h" #include "../symtab/symtab.h" #include "../stringstore/stringstore.h" class Parser: public ParserBase { // $insert scannerobject Scanner d_scanner; Functions d_functions; Symtab d_symtab; ExprType d_type; // last received type specification SemVal d_initCode; // global initialization code uint16_t d_breakOK = 0; // (nested) break/continue is OK int d_token; // token produced by lex() public: Parser(char const *input); int parse(); Scanner const &scanner() const; // all: .f Functions const &functions() const; Symtab const &symtab() const; private: SemVal variable(std::string const &name); SemVal defineVar(SemVal &lhs, SemVal &expr); void functionHead(); void functionDefined(SemVal &body); SemVal functionReturn(SemVal &expr) const; SemVal function(std::string const &name, Args &&args) const; SemVal index(SemVal &lhs, SemVal &rhs) const; SemVal shiftOrPrint(SemVal &lhs, Opcode::Byte opcode, SemVal &rhs) const; // .f (ih) SemVal binary(SemVal &lhs, Opcode::Byte opcode, SemVal &rhs) const; SemVal ifStmnt(Args &cond, SemVal &trueStmnt, SemVal &falseStmnt); SemVal forStmnt(Args &&init, SemVal &cond, Args &&inc, SemVal &stmnt); SemVal exprStmnt(SemVal &expr) const; // also handles exit() SemVal returnStmnt(Tokens::Tokens_ token, SemVal &expr) const; SemVal checkBreakOK() const; SemVal breakStmnt() const; SemVal continueStmnt() const; SemVal pushPrint(SemVal &expr) const; // handle (f)printf insertions void push(); // pushes symtab and SemVal's pushDead void pop(); // pops the previous level static SemVal catStatements(SemVal &stmnts, SemVal &stmnt); static void semValPopPush(); // reset SemVal's deadCode stack // Parser's own members: void error(); // called on (syntax) errors int lex(); // returns the next token from the // lexical scanner. void print(); // use, e.g., d_token, d_loc void exceptionHandler(std::exception const &exc); // support functions for parse(): void executeAction_(int ruleNr); void errorRecovery_(); void nextCycle_(); void nextToken_(); void print_(); }; #include "scanner.f" #include "functions.f" #include "symtab.f" #endif icmake-10.03.00/comp/parser/parser1.cc0000644000175000017500000000023714204126313016264 0ustar frankfrank//#define XERR #include "parser.ih" Parser::Parser(char const *input) : d_scanner(input, "-"), d_symtab(d_functions) // d_unAssembler(d_symtab) {} icmake-10.03.00/comp/parser/binary.f0000644000175000017500000000025614204126313016034 0ustar frankfrankinline SemVal Parser::binary(SemVal &lhs, Opcode::Byte opcode, SemVal &rhs) const { return pushPrint(lhs).binary(opcode, pushPrint(rhs)); } icmake-10.03.00/comp/parser/functions.f0000644000175000017500000000011614204126313016553 0ustar frankfrankinline Functions const &Parser::functions() const { return d_functions; } icmake-10.03.00/comp/parser/print.f0000644000175000017500000000005014204126313015674 0ustar frankfrankinline void Parser::print() {} icmake-10.03.00/comp/parser/parse.cc0000644000175000017500000037242414204171312016032 0ustar frankfrank// Generated by Bisonc++ V6.04.03 on Tue, 15 Feb 2022 18:39:11 +0100 // base/comment // $insert class.ih #include "parser.ih" // The FIRST element of SR arrays shown below uses `d_type', defining the // state's type, and `d_lastIdx' containing the last element's index. If // d_lastIdx contains the REQ_TOKEN bitflag (see below) then the state needs // a token: if in this state d_token is Reserved_::UNDETERMINED_, nextToken() will be // called // The LAST element of SR arrays uses `d_token' containing the last retrieved // token to speed up the (linear) seach. Except for the first element of SR // arrays, the field `d_action' is used to determine what to do next. If // positive, it represents the next state (used with SHIFT); if zero, it // indicates `ACCEPT', if negative, -d_action represents the number of the // rule to reduce to. // `lookup()' tries to find d_token in the current SR array. If it fails, and // there is no default reduction UNEXPECTED_TOKEN_ is thrown, which is then // caught by the error-recovery function. // The error-recovery function will pop elements off the stack until a state // having bit flag ERR_ITEM is found. This state has a transition on errTok_ // which is applied. In this errTok_ state, while the current token is not a // proper continuation, new tokens are obtained by nextToken(). If such a // token is found, error recovery is successful and the token is // handled according to the error state's SR table and parsing continues. // During error recovery semantic actions are ignored. // A state flagged with the DEF_RED flag will perform a default // reduction if no other continuations are available for the current token. // The ACCEPT STATE never shows a default reduction: when it is reached the // parser returns ACCEPT(). During the grammar // analysis phase a default reduction may have been defined, but it is // removed during the state-definition phase. // So: // s_x[] = // { // [_field_1_] [_field_2_] // // First element: {state-type, idx of last element}, // Other elements: {required token, action to perform}, // ( < 0: reduce, // 0: ACCEPT, // > 0: next state) // } // base/declarations namespace // anonymous { char const author[] = "Frank B. Brokken (f.b.brokken@rug.nl)"; enum Reserved_ { UNDETERMINED_ = -2, EOF_ = -1, errTok_ = 256 }; enum StateType // modify statetype/data.cc when this enum changes { NORMAL, ERR_ITEM, REQ_TOKEN, ERR_REQ, // ERR_ITEM | REQ_TOKEN DEF_RED, // state having default reduction ERR_DEF, // ERR_ITEM | DEF_RED REQ_DEF, // REQ_TOKEN | DEF_RED ERR_REQ_DEF // ERR_ITEM | REQ_TOKEN | DEF_RED }; inline bool operator&(StateType lhs, StateType rhs) { return (static_cast(lhs) & rhs) != 0; } enum StateTransition { ACCEPT_ = 0, // `ACCEPT' TRANSITION }; struct PI_ // Production Info { size_t d_nonTerm; // identification number of this production's // non-terminal size_t d_size; // number of elements in this production }; struct SR_ // Shift Reduce info, see its description above { union { int _field_1_; // initializer, allowing initializations // of the SR s_[] arrays StateType d_type; int d_token; }; union { int _field_2_; int d_lastIdx; // if negative, the state uses SHIFT int d_action; // may be negative (reduce), // postive (shift), or 0 (accept) }; }; // $insert staticdata enum // size to expand the state-stack with when { // full STACK_EXPANSION_ = 10 }; // Productions Info Records: PI_ const s_productionInfo[] = { {0, 0}, // not used: reduction values are negative {316, 2}, // 1: input -> input defVarOrFun {316, 1}, // 2: input -> defVarOrFun {318, 0}, // 3: syntaxCloseParen -> {319, 0}, // 4: syntaxCommaOrSemicol -> {320, 0}, // 5: syntaxCommaOrCloseparen -> {321, 0}, // 6: syntaxExpression -> {322, 0}, // 7: syntaxIdentifier -> {323, 0}, // 8: syntaxInit -> {324, 0}, // 9: syntaxOpenCurly -> {325, 0}, // 10: syntaxSemicol -> {326, 0}, // 11: syntaxTypename -> {327, 0}, // 12: opValue -> {328, 1}, // 13: openCurly ('{') -> '{' {329, 1}, // 14: closeCurly ('}') -> '}' {330, 1}, // 15: closeParenBreakOK (')') -> ')' {331, 1}, // 16: varType_ (INT) -> INT {331, 1}, // 17: varType_ (STRINGTYPE) -> STRINGTYPE {331, 1}, // 18: varType_ (LIST) -> LIST {332, 2}, // 19: varType -> varType_ syntaxIdentifier {333, 2}, // 20: string_ (STRING) -> string_ STRING {333, 1}, // 21: string_ (STRING) -> STRING {334, 1}, // 22: string -> string_ {335, 1}, // 23: cast (INT) -> INT {335, 1}, // 24: cast (LIST) -> LIST {335, 1}, // 25: cast (STRINGTYPE) -> STRINGTYPE {335, 1}, // 26: cast (BOOL) -> BOOL {336, 1}, // 27: identifier (IDENTIFIER) -> IDENTIFIER {337, 1}, // 28: argsExpr -> expression {337, 2}, // 29: argsExpr (ORDER) -> ORDER opValue {338, 3}, // 30: args (',') -> args ',' argsExpr {338, 1}, // 31: args -> argsExpr {339, 0}, // 32: argsNull -> {340, 1}, // 33: argsOpt -> args {340, 1}, // 34: argsOpt -> argsNull {341, 1}, // 35: defineVar_ -> identifier {342, 1}, // 36: defineVar -> defineVar_ {342, 4}, // 37: defineVar ('=') -> defineVar_ '=' syntaxExpression expression {343, 4}, // 38: globalVars (',') -> globalVars ',' defineVar syntaxCommaOrSemicol {343, 2}, // 39: globalVars -> defineVar syntaxCommaOrSemicol {344, 4}, // 40: localVars (',') -> localVars ',' defineVar syntaxCommaOrSemicol {344, 2}, // 41: localVars -> defineVar syntaxCommaOrSemicol {345, 1}, // 42: exprUnit_ -> string {345, 1}, // 43: exprUnit_ (NUMBER) -> NUMBER {345, 1}, // 44: exprUnit_ -> identifier {346, 2}, // 45: exprStart_ -> exprUnit_ syntaxExpression {347, 1}, // 46: expression -> exprStart_ {347, 3}, // 47: expression ('[') -> '[' argsOpt ']' {347, 4}, // 48: expression ('[') -> expression '[' expression ']' {347, 4}, // 49: expression ('(') -> identifier '(' argsOpt ')' {347, 3}, // 50: expression ('`') -> '`' expression '`' {347, 3}, // 51: expression ('(') -> '(' expression ')' {347, 2}, // 52: expression ('!') -> '+' expression {347, 2}, // 53: expression ('!') -> '-' expression {347, 2}, // 54: expression ('!') -> '~' expression {347, 2}, // 55: expression ('!') -> '!' expression {347, 3}, // 56: expression (INCDEC) -> INCDEC opValue expression {347, 3}, // 57: expression (INCDEC) -> expression INCDEC opValue {347, 4}, // 58: expression ('!') -> '(' cast ')' expression {347, 3}, // 59: expression ('+') -> expression '+' expression {347, 3}, // 60: expression ('-') -> expression '-' expression {347, 4}, // 61: expression (MULTIPLY) -> expression MULTIPLY opValue expression {347, 4}, // 62: expression (SHIFT) -> expression SHIFT opValue expression {347, 4}, // 63: expression (ORDER) -> expression ORDER opValue expression {347, 4}, // 64: expression (EQUALITY) -> expression EQUALITY opValue expression {347, 3}, // 65: expression ('&') -> expression '&' expression {347, 3}, // 66: expression ('^') -> expression '^' expression {347, 3}, // 67: expression ('|') -> expression '|' expression {347, 3}, // 68: expression (AND) -> expression AND expression {347, 3}, // 69: expression (OR) -> expression OR expression {347, 5}, // 70: expression ('?') -> expression '?' expression ':' expression {347, 3}, // 71: expression ('=') -> expression '=' expression {347, 4}, // 72: expression (MATH_IS) -> expression MATH_IS opValue expression {348, 2}, // 73: conditionVar_ -> varType defineVar {349, 1}, // 74: condition -> expression {349, 1}, // 75: condition -> conditionVar_ {350, 1}, // 76: optCondition -> condition {350, 0}, // 77: optCondition -> {351, 1}, // 78: retExpr_ -> expression {351, 0}, // 79: retExpr_ -> {352, 1}, // 80: retLeave_ (RETURN) -> RETURN {352, 1}, // 81: retLeave_ (EXIT) -> EXIT {353, 3}, // 82: returnStatement -> retLeave_ syntaxExpression retExpr_ {354, 1}, // 83: while_ (WHILE) -> WHILE {355, 7}, // 84: whileStatement ('(') -> while_ '(' syntaxExpression condition syntaxCloseParen closeParenBreakOK statement {356, 3}, // 85: flowArgs (',') -> flowArgs ',' expression {356, 1}, // 86: flowArgs -> expression {357, 3}, // 87: flowInitDefs_ (',') -> flowInitDefs_ ',' defineVar {357, 1}, // 88: flowInitDefs_ -> defineVar {358, 1}, // 89: flowInit -> flowArgs {358, 2}, // 90: flowInit -> varType flowInitDefs_ {359, 1}, // 91: optInit -> flowInit {359, 1}, // 92: optInit -> argsNull {360, 1}, // 93: for_ (FOR) -> FOR {361, 1}, // 94: forOptInc_ -> flowArgs {361, 1}, // 95: forOptInc_ -> argsNull {362, 15}, // 96: forStatement ('(') -> for_ '(' syntaxInit optInit syntaxSemicol ';' syntaxExpression optCondition syntaxSemicol ';' syntaxExpression forOptInc_ syntaxCloseParen closeParenBreakOK statement {363, 1}, // 97: if_ (IF) -> IF {364, 1}, // 98: ifElse_ (ELSE) -> ELSE {365, 2}, // 99: ifStatementElse_ -> ifElse_ statement {365, 0}, // 100: ifStatementElse_ -> {366, 1}, // 101: ifCond_ -> condition {366, 2}, // 102: ifCond_ (';') -> ';' condition {366, 3}, // 103: ifCond_ (';') -> flowInit ';' condition {367, 9}, // 104: ifStatement ('(') -> if_ '(' syntaxExpression ifCond_ syntaxCloseParen ')' syntaxExpression statement ifStatementElse_ {368, 1}, // 105: stBreak_ (BREAK) -> BREAK {369, 1}, // 106: stContinue_ (CONTINUE) -> CONTINUE {370, 3}, // 107: stCompound_ -> openCurly statements closeCurly {371, 2}, // 108: stAlt_ (';') -> stBreak_ ';' {371, 2}, // 109: stAlt_ (';') -> stContinue_ ';' {371, 1}, // 110: stAlt_ -> stCompound_ {371, 1}, // 111: stAlt_ (';') -> ';' {371, 2}, // 112: stAlt_ (';') -> expression ';' {371, 2}, // 113: stAlt_ (';') -> returnStatement ';' {371, 1}, // 114: stAlt_ -> whileStatement {371, 1}, // 115: stAlt_ -> ifStatement {371, 1}, // 116: stAlt_ -> forStatement {371, 2}, // 117: stAlt_ (errTok_) -> errTok_ ';' {372, 1}, // 118: statement -> stAlt_ {372, 3}, // 119: statement (';') -> varType localVars ';' {373, 2}, // 120: statements -> statements statement {373, 0}, // 121: statements -> {374, 1}, // 122: fdName_ -> identifier {375, 1}, // 123: fdParamName_ -> identifier {376, 3}, // 124: fdParam_ -> varType fdParamName_ syntaxCommaOrCloseparen {377, 4}, // 125: fdParams_ (',') -> fdParams_ ',' syntaxTypename fdParam_ {377, 1}, // 126: fdParams_ -> fdParam_ {378, 1}, // 127: fdOptParams_ -> fdParams_ {378, 0}, // 128: fdOptParams_ -> {379, 5}, // 129: fdHead_ ('(') -> fdName_ '(' fdOptParams_ ')' syntaxOpenCurly {380, 4}, // 130: functionDef -> fdHead_ openCurly statements closeCurly {381, 1}, // 131: _voidtype (VOID) -> VOID {382, 3}, // 132: _definition (';') -> varType globalVars ';' {382, 2}, // 133: _definition -> varType functionDef {382, 2}, // 134: _definition -> _voidtype functionDef {317, 2}, // 135: defVarOrFun -> _definition syntaxTypename {383, 1}, // 136: input_$ -> input }; // State info and SR_ transitions for each state. SR_ s_0[] = { { { REQ_TOKEN}, { 11} }, { { 316}, { 1} }, // input { { 317}, { 2} }, // defVarOrFun { { 382}, { 3} }, // _definition { { 332}, { 4} }, // varType { { 381}, { 5} }, // _voidtype { { 331}, { 6} }, // varType_ { { 306}, { 7} }, // VOID { { 300}, { 8} }, // INT { { 305}, { 9} }, // STRINGTYPE { { 301}, { 10} }, // LIST { { 0}, { 0} }, }; SR_ s_1[] = { { { REQ_TOKEN}, { 11} }, { { 317}, { 11} }, // defVarOrFun { { 382}, { 3} }, // _definition { { 332}, { 4} }, // varType { { 381}, { 5} }, // _voidtype { { 331}, { 6} }, // varType_ { { 306}, { 7} }, // VOID { { 300}, { 8} }, // INT { { 305}, { 9} }, // STRINGTYPE { { 301}, { 10} }, // LIST { { EOF_}, { ACCEPT_} }, { { 0}, { 0} }, }; SR_ s_2[] = { { { DEF_RED}, { 1} }, { { 0}, { -2} }, }; SR_ s_3[] = { { { DEF_RED}, { 2} }, { { 326}, { 12} }, // syntaxTypename { { 0}, { -11} }, }; SR_ s_4[] = { { { REQ_TOKEN}, { 9} }, { { 343}, { 13} }, // globalVars { { 380}, { 14} }, // functionDef { { 342}, { 15} }, // defineVar { { 379}, { 16} }, // fdHead_ { { 341}, { 17} }, // defineVar_ { { 374}, { 18} }, // fdName_ { { 336}, { 19} }, // identifier { { 298}, { 20} }, // IDENTIFIER { { 0}, { 0} }, }; SR_ s_5[] = { { { REQ_TOKEN}, { 6} }, { { 380}, { 21} }, // functionDef { { 379}, { 16} }, // fdHead_ { { 374}, { 18} }, // fdName_ { { 336}, { 22} }, // identifier { { 298}, { 20} }, // IDENTIFIER { { 0}, { 0} }, }; SR_ s_6[] = { { { DEF_RED}, { 2} }, { { 322}, { 23} }, // syntaxIdentifier { { 0}, { -7} }, }; SR_ s_7[] = { { { DEF_RED}, { 1} }, { { 0}, { -131} }, }; SR_ s_8[] = { { { DEF_RED}, { 1} }, { { 0}, { -16} }, }; SR_ s_9[] = { { { DEF_RED}, { 1} }, { { 0}, { -17} }, }; SR_ s_10[] = { { { DEF_RED}, { 1} }, { { 0}, { -18} }, }; SR_ s_11[] = { { { DEF_RED}, { 1} }, { { 0}, { -1} }, }; SR_ s_12[] = { { { DEF_RED}, { 1} }, { { 0}, { -135} }, }; SR_ s_13[] = { { { REQ_TOKEN}, { 3} }, { { 59}, { 24} }, // ';' { { 44}, { 25} }, // ',' { { 0}, { 0} }, }; SR_ s_14[] = { { { DEF_RED}, { 1} }, { { 0}, { -133} }, }; SR_ s_15[] = { { { DEF_RED}, { 2} }, { { 319}, { 26} }, // syntaxCommaOrSemicol { { 0}, { -4} }, }; SR_ s_16[] = { { { REQ_TOKEN}, { 3} }, { { 328}, { 27} }, // openCurly { { 123}, { 28} }, // '{' { { 0}, { 0} }, }; SR_ s_17[] = { { { REQ_DEF}, { 2} }, { { 61}, { 29} }, // '=' { { 0}, { -36} }, }; SR_ s_18[] = { { { REQ_TOKEN}, { 2} }, { { 40}, { 30} }, // '(' { { 0}, { 0} }, }; SR_ s_19[] = { { { REQ_DEF}, { 2} }, { { 40}, { -122} }, // '(' { { 0}, { -35} }, }; SR_ s_20[] = { { { DEF_RED}, { 1} }, { { 0}, { -27} }, }; SR_ s_21[] = { { { DEF_RED}, { 1} }, { { 0}, { -134} }, }; SR_ s_22[] = { { { DEF_RED}, { 1} }, { { 0}, { -122} }, }; SR_ s_23[] = { { { DEF_RED}, { 1} }, { { 0}, { -19} }, }; SR_ s_24[] = { { { DEF_RED}, { 1} }, { { 0}, { -132} }, }; SR_ s_25[] = { { { REQ_TOKEN}, { 5} }, { { 342}, { 31} }, // defineVar { { 341}, { 17} }, // defineVar_ { { 336}, { 32} }, // identifier { { 298}, { 20} }, // IDENTIFIER { { 0}, { 0} }, }; SR_ s_26[] = { { { DEF_RED}, { 1} }, { { 0}, { -39} }, }; SR_ s_27[] = { { { DEF_RED}, { 2} }, { { 373}, { 33} }, // statements { { 0}, { -121} }, }; SR_ s_28[] = { { { DEF_RED}, { 1} }, { { 0}, { -13} }, }; SR_ s_29[] = { { { DEF_RED}, { 2} }, { { 321}, { 34} }, // syntaxExpression { { 0}, { -6} }, }; SR_ s_30[] = { { { REQ_DEF}, { 9} }, { { 378}, { 35} }, // fdOptParams_ { { 377}, { 36} }, // fdParams_ { { 376}, { 37} }, // fdParam_ { { 332}, { 38} }, // varType { { 331}, { 6} }, // varType_ { { 300}, { 8} }, // INT { { 305}, { 9} }, // STRINGTYPE { { 301}, { 10} }, // LIST { { 0}, { -128} }, }; SR_ s_31[] = { { { DEF_RED}, { 2} }, { { 319}, { 39} }, // syntaxCommaOrSemicol { { 0}, { -4} }, }; SR_ s_32[] = { { { DEF_RED}, { 1} }, { { 0}, { -35} }, }; SR_ s_33[] = { { { ERR_REQ}, { 49} }, { { 329}, { 40} }, // closeCurly { { 372}, { 41} }, // statement { { 125}, { 42} }, // '}' { { 371}, { 43} }, // stAlt_ { { 332}, { 44} }, // varType { { 368}, { 45} }, // stBreak_ { { 369}, { 46} }, // stContinue_ { { 370}, { 47} }, // stCompound_ { { 59}, { 48} }, // ';' { { 347}, { 49} }, // expression { { 353}, { 50} }, // returnStatement { { 355}, { 51} }, // whileStatement { { 367}, { 52} }, // ifStatement { { 362}, { 53} }, // forStatement { { errTok_}, { 54} }, // errTok_ { { 331}, { 6} }, // varType_ { { 293}, { 55} }, // BREAK { { 294}, { 56} }, // CONTINUE { { 328}, { 57} }, // openCurly { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 352}, { 68} }, // retLeave_ { { 354}, { 69} }, // while_ { { 363}, { 70} }, // if_ { { 360}, { 71} }, // for_ { { 300}, { 8} }, // INT { { 305}, { 9} }, // STRINGTYPE { { 301}, { 10} }, // LIST { { 123}, { 28} }, // '{' { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 303}, { 73} }, // RETURN { { 296}, { 74} }, // EXIT { { 307}, { 75} }, // WHILE { { 299}, { 76} }, // IF { { 297}, { 77} }, // FOR { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { 0} }, }; SR_ s_34[] = { { { REQ_TOKEN}, { 18} }, { { 347}, { 82} }, // expression { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { 0} }, }; SR_ s_35[] = { { { REQ_TOKEN}, { 2} }, { { 41}, { 83} }, // ')' { { 0}, { 0} }, }; SR_ s_36[] = { { { REQ_DEF}, { 2} }, { { 44}, { 84} }, // ',' { { 0}, { -127} }, }; SR_ s_37[] = { { { DEF_RED}, { 1} }, { { 0}, { -126} }, }; SR_ s_38[] = { { { REQ_TOKEN}, { 4} }, { { 375}, { 85} }, // fdParamName_ { { 336}, { 86} }, // identifier { { 298}, { 20} }, // IDENTIFIER { { 0}, { 0} }, }; SR_ s_39[] = { { { DEF_RED}, { 1} }, { { 0}, { -38} }, }; SR_ s_40[] = { { { DEF_RED}, { 1} }, { { 0}, { -130} }, }; SR_ s_41[] = { { { DEF_RED}, { 1} }, { { 0}, { -120} }, }; SR_ s_42[] = { { { DEF_RED}, { 1} }, { { 0}, { -14} }, }; SR_ s_43[] = { { { DEF_RED}, { 1} }, { { 0}, { -118} }, }; SR_ s_44[] = { { { REQ_TOKEN}, { 6} }, { { 344}, { 87} }, // localVars { { 342}, { 88} }, // defineVar { { 341}, { 17} }, // defineVar_ { { 336}, { 32} }, // identifier { { 298}, { 20} }, // IDENTIFIER { { 0}, { 0} }, }; SR_ s_45[] = { { { REQ_TOKEN}, { 2} }, { { 59}, { 89} }, // ';' { { 0}, { 0} }, }; SR_ s_46[] = { { { REQ_TOKEN}, { 2} }, { { 59}, { 90} }, // ';' { { 0}, { 0} }, }; SR_ s_47[] = { { { DEF_RED}, { 1} }, { { 0}, { -110} }, }; SR_ s_48[] = { { { DEF_RED}, { 1} }, { { 0}, { -111} }, }; SR_ s_49[] = { { { REQ_TOKEN}, { 18} }, { { 59}, { 91} }, // ';' { { 91}, { 92} }, // '[' { { 315}, { 93} }, // INCDEC { { 43}, { 94} }, // '+' { { 45}, { 95} }, // '-' { { 314}, { 96} }, // MULTIPLY { { 313}, { 97} }, // SHIFT { { 312}, { 98} }, // ORDER { { 311}, { 99} }, // EQUALITY { { 38}, { 100} }, // '&' { { 94}, { 101} }, // '^' { { 124}, { 102} }, // '|' { { 310}, { 103} }, // AND { { 309}, { 104} }, // OR { { 63}, { 105} }, // '?' { { 61}, { 106} }, // '=' { { 308}, { 107} }, // MATH_IS { { 0}, { 0} }, }; SR_ s_50[] = { { { REQ_TOKEN}, { 2} }, { { 59}, { 108} }, // ';' { { 0}, { 0} }, }; SR_ s_51[] = { { { DEF_RED}, { 1} }, { { 0}, { -114} }, }; SR_ s_52[] = { { { DEF_RED}, { 1} }, { { 0}, { -115} }, }; SR_ s_53[] = { { { DEF_RED}, { 1} }, { { 0}, { -116} }, }; SR_ s_54[] = { { { REQ_TOKEN}, { 2} }, { { 59}, { 109} }, // ';' { { 0}, { 0} }, }; SR_ s_55[] = { { { DEF_RED}, { 1} }, { { 0}, { -105} }, }; SR_ s_56[] = { { { DEF_RED}, { 1} }, { { 0}, { -106} }, }; SR_ s_57[] = { { { DEF_RED}, { 2} }, { { 373}, { 110} }, // statements { { 0}, { -121} }, }; SR_ s_58[] = { { { DEF_RED}, { 1} }, { { 0}, { -46} }, }; SR_ s_59[] = { { { REQ_DEF}, { 23} }, { { 340}, { 111} }, // argsOpt { { 338}, { 112} }, // args { { 339}, { 113} }, // argsNull { { 337}, { 114} }, // argsExpr { { 347}, { 115} }, // expression { { 312}, { 116} }, // ORDER { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { -32} }, }; SR_ s_60[] = { { { REQ_DEF}, { 2} }, { { 40}, { 117} }, // '(' { { 0}, { -44} }, }; SR_ s_61[] = { { { REQ_TOKEN}, { 18} }, { { 347}, { 118} }, // expression { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { 0} }, }; SR_ s_62[] = { { { REQ_TOKEN}, { 23} }, { { 347}, { 119} }, // expression { { 335}, { 120} }, // cast { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 300}, { 121} }, // INT { { 301}, { 122} }, // LIST { { 305}, { 123} }, // STRINGTYPE { { 292}, { 124} }, // BOOL { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { 0} }, }; SR_ s_63[] = { { { REQ_TOKEN}, { 18} }, { { 347}, { 125} }, // expression { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { 0} }, }; SR_ s_64[] = { { { REQ_TOKEN}, { 18} }, { { 347}, { 126} }, // expression { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { 0} }, }; SR_ s_65[] = { { { REQ_TOKEN}, { 18} }, { { 347}, { 127} }, // expression { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { 0} }, }; SR_ s_66[] = { { { REQ_TOKEN}, { 18} }, { { 347}, { 128} }, // expression { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { 0} }, }; SR_ s_67[] = { { { DEF_RED}, { 2} }, { { 327}, { 129} }, // opValue { { 0}, { -12} }, }; SR_ s_68[] = { { { DEF_RED}, { 2} }, { { 321}, { 130} }, // syntaxExpression { { 0}, { -6} }, }; SR_ s_69[] = { { { REQ_TOKEN}, { 2} }, { { 40}, { 131} }, // '(' { { 0}, { 0} }, }; SR_ s_70[] = { { { REQ_TOKEN}, { 2} }, { { 40}, { 132} }, // '(' { { 0}, { 0} }, }; SR_ s_71[] = { { { REQ_TOKEN}, { 2} }, { { 40}, { 133} }, // '(' { { 0}, { 0} }, }; SR_ s_72[] = { { { DEF_RED}, { 2} }, { { 321}, { 134} }, // syntaxExpression { { 0}, { -6} }, }; SR_ s_73[] = { { { DEF_RED}, { 1} }, { { 0}, { -80} }, }; SR_ s_74[] = { { { DEF_RED}, { 1} }, { { 0}, { -81} }, }; SR_ s_75[] = { { { DEF_RED}, { 1} }, { { 0}, { -83} }, }; SR_ s_76[] = { { { DEF_RED}, { 1} }, { { 0}, { -97} }, }; SR_ s_77[] = { { { DEF_RED}, { 1} }, { { 0}, { -93} }, }; SR_ s_78[] = { { { DEF_RED}, { 1} }, { { 0}, { -42} }, }; SR_ s_79[] = { { { DEF_RED}, { 1} }, { { 0}, { -43} }, }; SR_ s_80[] = { { { REQ_DEF}, { 2} }, { { 304}, { 135} }, // STRING { { 0}, { -22} }, }; SR_ s_81[] = { { { DEF_RED}, { 1} }, { { 0}, { -21} }, }; SR_ s_82[] = { { { REQ_DEF}, { 17} }, { { 91}, { 92} }, // '[' { { 315}, { 93} }, // INCDEC { { 43}, { 94} }, // '+' { { 45}, { 95} }, // '-' { { 314}, { 96} }, // MULTIPLY { { 313}, { 97} }, // SHIFT { { 312}, { 98} }, // ORDER { { 311}, { 99} }, // EQUALITY { { 38}, { 100} }, // '&' { { 94}, { 101} }, // '^' { { 124}, { 102} }, // '|' { { 310}, { 103} }, // AND { { 309}, { 104} }, // OR { { 63}, { 105} }, // '?' { { 61}, { 106} }, // '=' { { 308}, { 107} }, // MATH_IS { { 0}, { -37} }, }; SR_ s_83[] = { { { DEF_RED}, { 2} }, { { 324}, { 136} }, // syntaxOpenCurly { { 0}, { -9} }, }; SR_ s_84[] = { { { DEF_RED}, { 2} }, { { 326}, { 137} }, // syntaxTypename { { 0}, { -11} }, }; SR_ s_85[] = { { { DEF_RED}, { 2} }, { { 320}, { 138} }, // syntaxCommaOrCloseparen { { 0}, { -5} }, }; SR_ s_86[] = { { { DEF_RED}, { 1} }, { { 0}, { -123} }, }; SR_ s_87[] = { { { REQ_TOKEN}, { 3} }, { { 59}, { 139} }, // ';' { { 44}, { 140} }, // ',' { { 0}, { 0} }, }; SR_ s_88[] = { { { DEF_RED}, { 2} }, { { 319}, { 141} }, // syntaxCommaOrSemicol { { 0}, { -4} }, }; SR_ s_89[] = { { { DEF_RED}, { 1} }, { { 0}, { -108} }, }; SR_ s_90[] = { { { DEF_RED}, { 1} }, { { 0}, { -109} }, }; SR_ s_91[] = { { { DEF_RED}, { 1} }, { { 0}, { -112} }, }; SR_ s_92[] = { { { REQ_TOKEN}, { 18} }, { { 347}, { 142} }, // expression { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { 0} }, }; SR_ s_93[] = { { { DEF_RED}, { 2} }, { { 327}, { 143} }, // opValue { { 0}, { -12} }, }; SR_ s_94[] = { { { REQ_TOKEN}, { 18} }, { { 347}, { 144} }, // expression { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { 0} }, }; SR_ s_95[] = { { { REQ_TOKEN}, { 18} }, { { 347}, { 145} }, // expression { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { 0} }, }; SR_ s_96[] = { { { DEF_RED}, { 2} }, { { 327}, { 146} }, // opValue { { 0}, { -12} }, }; SR_ s_97[] = { { { DEF_RED}, { 2} }, { { 327}, { 147} }, // opValue { { 0}, { -12} }, }; SR_ s_98[] = { { { DEF_RED}, { 2} }, { { 327}, { 148} }, // opValue { { 0}, { -12} }, }; SR_ s_99[] = { { { DEF_RED}, { 2} }, { { 327}, { 149} }, // opValue { { 0}, { -12} }, }; SR_ s_100[] = { { { REQ_TOKEN}, { 18} }, { { 347}, { 150} }, // expression { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { 0} }, }; SR_ s_101[] = { { { REQ_TOKEN}, { 18} }, { { 347}, { 151} }, // expression { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { 0} }, }; SR_ s_102[] = { { { REQ_TOKEN}, { 18} }, { { 347}, { 152} }, // expression { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { 0} }, }; SR_ s_103[] = { { { REQ_TOKEN}, { 18} }, { { 347}, { 153} }, // expression { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { 0} }, }; SR_ s_104[] = { { { REQ_TOKEN}, { 18} }, { { 347}, { 154} }, // expression { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { 0} }, }; SR_ s_105[] = { { { REQ_TOKEN}, { 18} }, { { 347}, { 155} }, // expression { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { 0} }, }; SR_ s_106[] = { { { REQ_TOKEN}, { 18} }, { { 347}, { 156} }, // expression { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { 0} }, }; SR_ s_107[] = { { { DEF_RED}, { 2} }, { { 327}, { 157} }, // opValue { { 0}, { -12} }, }; SR_ s_108[] = { { { DEF_RED}, { 1} }, { { 0}, { -113} }, }; SR_ s_109[] = { { { DEF_RED}, { 1} }, { { 0}, { -117} }, }; SR_ s_110[] = { { { ERR_REQ}, { 49} }, { { 329}, { 158} }, // closeCurly { { 372}, { 41} }, // statement { { 125}, { 42} }, // '}' { { 371}, { 43} }, // stAlt_ { { 332}, { 44} }, // varType { { 368}, { 45} }, // stBreak_ { { 369}, { 46} }, // stContinue_ { { 370}, { 47} }, // stCompound_ { { 59}, { 48} }, // ';' { { 347}, { 49} }, // expression { { 353}, { 50} }, // returnStatement { { 355}, { 51} }, // whileStatement { { 367}, { 52} }, // ifStatement { { 362}, { 53} }, // forStatement { { errTok_}, { 54} }, // errTok_ { { 331}, { 6} }, // varType_ { { 293}, { 55} }, // BREAK { { 294}, { 56} }, // CONTINUE { { 328}, { 57} }, // openCurly { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 352}, { 68} }, // retLeave_ { { 354}, { 69} }, // while_ { { 363}, { 70} }, // if_ { { 360}, { 71} }, // for_ { { 300}, { 8} }, // INT { { 305}, { 9} }, // STRINGTYPE { { 301}, { 10} }, // LIST { { 123}, { 28} }, // '{' { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 303}, { 73} }, // RETURN { { 296}, { 74} }, // EXIT { { 307}, { 75} }, // WHILE { { 299}, { 76} }, // IF { { 297}, { 77} }, // FOR { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { 0} }, }; SR_ s_111[] = { { { REQ_TOKEN}, { 2} }, { { 93}, { 159} }, // ']' { { 0}, { 0} }, }; SR_ s_112[] = { { { REQ_DEF}, { 2} }, { { 44}, { 160} }, // ',' { { 0}, { -33} }, }; SR_ s_113[] = { { { DEF_RED}, { 1} }, { { 0}, { -34} }, }; SR_ s_114[] = { { { DEF_RED}, { 1} }, { { 0}, { -31} }, }; SR_ s_115[] = { { { REQ_DEF}, { 17} }, { { 91}, { 92} }, // '[' { { 315}, { 93} }, // INCDEC { { 43}, { 94} }, // '+' { { 45}, { 95} }, // '-' { { 314}, { 96} }, // MULTIPLY { { 313}, { 97} }, // SHIFT { { 312}, { 98} }, // ORDER { { 311}, { 99} }, // EQUALITY { { 38}, { 100} }, // '&' { { 94}, { 101} }, // '^' { { 124}, { 102} }, // '|' { { 310}, { 103} }, // AND { { 309}, { 104} }, // OR { { 63}, { 105} }, // '?' { { 61}, { 106} }, // '=' { { 308}, { 107} }, // MATH_IS { { 0}, { -28} }, }; SR_ s_116[] = { { { DEF_RED}, { 2} }, { { 327}, { 161} }, // opValue { { 0}, { -12} }, }; SR_ s_117[] = { { { REQ_DEF}, { 23} }, { { 340}, { 162} }, // argsOpt { { 338}, { 112} }, // args { { 339}, { 113} }, // argsNull { { 337}, { 114} }, // argsExpr { { 347}, { 115} }, // expression { { 312}, { 116} }, // ORDER { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { -32} }, }; SR_ s_118[] = { { { REQ_TOKEN}, { 18} }, { { 96}, { 163} }, // '`' { { 91}, { 92} }, // '[' { { 315}, { 93} }, // INCDEC { { 43}, { 94} }, // '+' { { 45}, { 95} }, // '-' { { 314}, { 96} }, // MULTIPLY { { 313}, { 97} }, // SHIFT { { 312}, { 98} }, // ORDER { { 311}, { 99} }, // EQUALITY { { 38}, { 100} }, // '&' { { 94}, { 101} }, // '^' { { 124}, { 102} }, // '|' { { 310}, { 103} }, // AND { { 309}, { 104} }, // OR { { 63}, { 105} }, // '?' { { 61}, { 106} }, // '=' { { 308}, { 107} }, // MATH_IS { { 0}, { 0} }, }; SR_ s_119[] = { { { REQ_TOKEN}, { 18} }, { { 41}, { 164} }, // ')' { { 91}, { 92} }, // '[' { { 315}, { 93} }, // INCDEC { { 43}, { 94} }, // '+' { { 45}, { 95} }, // '-' { { 314}, { 96} }, // MULTIPLY { { 313}, { 97} }, // SHIFT { { 312}, { 98} }, // ORDER { { 311}, { 99} }, // EQUALITY { { 38}, { 100} }, // '&' { { 94}, { 101} }, // '^' { { 124}, { 102} }, // '|' { { 310}, { 103} }, // AND { { 309}, { 104} }, // OR { { 63}, { 105} }, // '?' { { 61}, { 106} }, // '=' { { 308}, { 107} }, // MATH_IS { { 0}, { 0} }, }; SR_ s_120[] = { { { REQ_TOKEN}, { 2} }, { { 41}, { 165} }, // ')' { { 0}, { 0} }, }; SR_ s_121[] = { { { DEF_RED}, { 1} }, { { 0}, { -23} }, }; SR_ s_122[] = { { { DEF_RED}, { 1} }, { { 0}, { -24} }, }; SR_ s_123[] = { { { DEF_RED}, { 1} }, { { 0}, { -25} }, }; SR_ s_124[] = { { { DEF_RED}, { 1} }, { { 0}, { -26} }, }; SR_ s_125[] = { { { REQ_DEF}, { 3} }, { { 91}, { 92} }, // '[' { { 315}, { 93} }, // INCDEC { { 0}, { -52} }, }; SR_ s_126[] = { { { REQ_DEF}, { 3} }, { { 91}, { 92} }, // '[' { { 315}, { 93} }, // INCDEC { { 0}, { -53} }, }; SR_ s_127[] = { { { REQ_DEF}, { 3} }, { { 91}, { 92} }, // '[' { { 315}, { 93} }, // INCDEC { { 0}, { -54} }, }; SR_ s_128[] = { { { REQ_DEF}, { 3} }, { { 91}, { 92} }, // '[' { { 315}, { 93} }, // INCDEC { { 0}, { -55} }, }; SR_ s_129[] = { { { REQ_TOKEN}, { 18} }, { { 347}, { 166} }, // expression { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { 0} }, }; SR_ s_130[] = { { { REQ_DEF}, { 19} }, { { 351}, { 167} }, // retExpr_ { { 347}, { 168} }, // expression { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { -79} }, }; SR_ s_131[] = { { { DEF_RED}, { 2} }, { { 321}, { 169} }, // syntaxExpression { { 0}, { -6} }, }; SR_ s_132[] = { { { DEF_RED}, { 2} }, { { 321}, { 170} }, // syntaxExpression { { 0}, { -6} }, }; SR_ s_133[] = { { { DEF_RED}, { 2} }, { { 323}, { 171} }, // syntaxInit { { 0}, { -8} }, }; SR_ s_134[] = { { { DEF_RED}, { 1} }, { { 0}, { -45} }, }; SR_ s_135[] = { { { DEF_RED}, { 1} }, { { 0}, { -20} }, }; SR_ s_136[] = { { { DEF_RED}, { 1} }, { { 0}, { -129} }, }; SR_ s_137[] = { { { REQ_TOKEN}, { 7} }, { { 376}, { 172} }, // fdParam_ { { 332}, { 38} }, // varType { { 331}, { 6} }, // varType_ { { 300}, { 8} }, // INT { { 305}, { 9} }, // STRINGTYPE { { 301}, { 10} }, // LIST { { 0}, { 0} }, }; SR_ s_138[] = { { { DEF_RED}, { 1} }, { { 0}, { -124} }, }; SR_ s_139[] = { { { DEF_RED}, { 1} }, { { 0}, { -119} }, }; SR_ s_140[] = { { { REQ_TOKEN}, { 5} }, { { 342}, { 173} }, // defineVar { { 341}, { 17} }, // defineVar_ { { 336}, { 32} }, // identifier { { 298}, { 20} }, // IDENTIFIER { { 0}, { 0} }, }; SR_ s_141[] = { { { DEF_RED}, { 1} }, { { 0}, { -41} }, }; SR_ s_142[] = { { { REQ_TOKEN}, { 18} }, { { 93}, { 174} }, // ']' { { 91}, { 92} }, // '[' { { 315}, { 93} }, // INCDEC { { 43}, { 94} }, // '+' { { 45}, { 95} }, // '-' { { 314}, { 96} }, // MULTIPLY { { 313}, { 97} }, // SHIFT { { 312}, { 98} }, // ORDER { { 311}, { 99} }, // EQUALITY { { 38}, { 100} }, // '&' { { 94}, { 101} }, // '^' { { 124}, { 102} }, // '|' { { 310}, { 103} }, // AND { { 309}, { 104} }, // OR { { 63}, { 105} }, // '?' { { 61}, { 106} }, // '=' { { 308}, { 107} }, // MATH_IS { { 0}, { 0} }, }; SR_ s_143[] = { { { DEF_RED}, { 1} }, { { 0}, { -57} }, }; SR_ s_144[] = { { { REQ_DEF}, { 4} }, { { 91}, { 92} }, // '[' { { 315}, { 93} }, // INCDEC { { 314}, { 96} }, // MULTIPLY { { 0}, { -59} }, }; SR_ s_145[] = { { { REQ_DEF}, { 4} }, { { 91}, { 92} }, // '[' { { 315}, { 93} }, // INCDEC { { 314}, { 96} }, // MULTIPLY { { 0}, { -60} }, }; SR_ s_146[] = { { { REQ_TOKEN}, { 18} }, { { 347}, { 175} }, // expression { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { 0} }, }; SR_ s_147[] = { { { REQ_TOKEN}, { 18} }, { { 347}, { 176} }, // expression { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { 0} }, }; SR_ s_148[] = { { { REQ_TOKEN}, { 18} }, { { 347}, { 177} }, // expression { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { 0} }, }; SR_ s_149[] = { { { REQ_TOKEN}, { 18} }, { { 347}, { 178} }, // expression { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { 0} }, }; SR_ s_150[] = { { { REQ_DEF}, { 9} }, { { 91}, { 92} }, // '[' { { 315}, { 93} }, // INCDEC { { 43}, { 94} }, // '+' { { 45}, { 95} }, // '-' { { 314}, { 96} }, // MULTIPLY { { 313}, { 97} }, // SHIFT { { 312}, { 98} }, // ORDER { { 311}, { 99} }, // EQUALITY { { 0}, { -65} }, }; SR_ s_151[] = { { { REQ_DEF}, { 10} }, { { 91}, { 92} }, // '[' { { 315}, { 93} }, // INCDEC { { 43}, { 94} }, // '+' { { 45}, { 95} }, // '-' { { 314}, { 96} }, // MULTIPLY { { 313}, { 97} }, // SHIFT { { 312}, { 98} }, // ORDER { { 311}, { 99} }, // EQUALITY { { 38}, { 100} }, // '&' { { 0}, { -66} }, }; SR_ s_152[] = { { { REQ_DEF}, { 11} }, { { 91}, { 92} }, // '[' { { 315}, { 93} }, // INCDEC { { 43}, { 94} }, // '+' { { 45}, { 95} }, // '-' { { 314}, { 96} }, // MULTIPLY { { 313}, { 97} }, // SHIFT { { 312}, { 98} }, // ORDER { { 311}, { 99} }, // EQUALITY { { 38}, { 100} }, // '&' { { 94}, { 101} }, // '^' { { 0}, { -67} }, }; SR_ s_153[] = { { { REQ_DEF}, { 12} }, { { 91}, { 92} }, // '[' { { 315}, { 93} }, // INCDEC { { 43}, { 94} }, // '+' { { 45}, { 95} }, // '-' { { 314}, { 96} }, // MULTIPLY { { 313}, { 97} }, // SHIFT { { 312}, { 98} }, // ORDER { { 311}, { 99} }, // EQUALITY { { 38}, { 100} }, // '&' { { 94}, { 101} }, // '^' { { 124}, { 102} }, // '|' { { 0}, { -68} }, }; SR_ s_154[] = { { { REQ_DEF}, { 13} }, { { 91}, { 92} }, // '[' { { 315}, { 93} }, // INCDEC { { 43}, { 94} }, // '+' { { 45}, { 95} }, // '-' { { 314}, { 96} }, // MULTIPLY { { 313}, { 97} }, // SHIFT { { 312}, { 98} }, // ORDER { { 311}, { 99} }, // EQUALITY { { 38}, { 100} }, // '&' { { 94}, { 101} }, // '^' { { 124}, { 102} }, // '|' { { 310}, { 103} }, // AND { { 0}, { -69} }, }; SR_ s_155[] = { { { REQ_TOKEN}, { 18} }, { { 58}, { 179} }, // ':' { { 91}, { 92} }, // '[' { { 315}, { 93} }, // INCDEC { { 43}, { 94} }, // '+' { { 45}, { 95} }, // '-' { { 314}, { 96} }, // MULTIPLY { { 313}, { 97} }, // SHIFT { { 312}, { 98} }, // ORDER { { 311}, { 99} }, // EQUALITY { { 38}, { 100} }, // '&' { { 94}, { 101} }, // '^' { { 124}, { 102} }, // '|' { { 310}, { 103} }, // AND { { 309}, { 104} }, // OR { { 63}, { 105} }, // '?' { { 61}, { 106} }, // '=' { { 308}, { 107} }, // MATH_IS { { 0}, { 0} }, }; SR_ s_156[] = { { { REQ_DEF}, { 17} }, { { 91}, { 92} }, // '[' { { 315}, { 93} }, // INCDEC { { 43}, { 94} }, // '+' { { 45}, { 95} }, // '-' { { 314}, { 96} }, // MULTIPLY { { 313}, { 97} }, // SHIFT { { 312}, { 98} }, // ORDER { { 311}, { 99} }, // EQUALITY { { 38}, { 100} }, // '&' { { 94}, { 101} }, // '^' { { 124}, { 102} }, // '|' { { 310}, { 103} }, // AND { { 309}, { 104} }, // OR { { 63}, { 105} }, // '?' { { 61}, { 106} }, // '=' { { 308}, { 107} }, // MATH_IS { { 0}, { -71} }, }; SR_ s_157[] = { { { REQ_TOKEN}, { 18} }, { { 347}, { 180} }, // expression { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { 0} }, }; SR_ s_158[] = { { { DEF_RED}, { 1} }, { { 0}, { -107} }, }; SR_ s_159[] = { { { DEF_RED}, { 1} }, { { 0}, { -47} }, }; SR_ s_160[] = { { { REQ_TOKEN}, { 20} }, { { 337}, { 181} }, // argsExpr { { 347}, { 115} }, // expression { { 312}, { 116} }, // ORDER { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { 0} }, }; SR_ s_161[] = { { { DEF_RED}, { 1} }, { { 0}, { -29} }, }; SR_ s_162[] = { { { REQ_TOKEN}, { 2} }, { { 41}, { 182} }, // ')' { { 0}, { 0} }, }; SR_ s_163[] = { { { DEF_RED}, { 1} }, { { 0}, { -50} }, }; SR_ s_164[] = { { { DEF_RED}, { 1} }, { { 0}, { -51} }, }; SR_ s_165[] = { { { REQ_TOKEN}, { 18} }, { { 347}, { 183} }, // expression { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { 0} }, }; SR_ s_166[] = { { { REQ_DEF}, { 3} }, { { 91}, { 92} }, // '[' { { 315}, { 93} }, // INCDEC { { 0}, { -56} }, }; SR_ s_167[] = { { { DEF_RED}, { 1} }, { { 0}, { -82} }, }; SR_ s_168[] = { { { REQ_DEF}, { 17} }, { { 91}, { 92} }, // '[' { { 315}, { 93} }, // INCDEC { { 43}, { 94} }, // '+' { { 45}, { 95} }, // '-' { { 314}, { 96} }, // MULTIPLY { { 313}, { 97} }, // SHIFT { { 312}, { 98} }, // ORDER { { 311}, { 99} }, // EQUALITY { { 38}, { 100} }, // '&' { { 94}, { 101} }, // '^' { { 124}, { 102} }, // '|' { { 310}, { 103} }, // AND { { 309}, { 104} }, // OR { { 63}, { 105} }, // '?' { { 61}, { 106} }, // '=' { { 308}, { 107} }, // MATH_IS { { 0}, { -78} }, }; SR_ s_169[] = { { { REQ_TOKEN}, { 25} }, { { 349}, { 184} }, // condition { { 347}, { 185} }, // expression { { 348}, { 186} }, // conditionVar_ { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 332}, { 187} }, // varType { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 331}, { 6} }, // varType_ { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 300}, { 8} }, // INT { { 305}, { 9} }, // STRINGTYPE { { 301}, { 10} }, // LIST { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { 0} }, }; SR_ s_170[] = { { { REQ_TOKEN}, { 29} }, { { 366}, { 188} }, // ifCond_ { { 349}, { 189} }, // condition { { 59}, { 190} }, // ';' { { 358}, { 191} }, // flowInit { { 347}, { 192} }, // expression { { 348}, { 186} }, // conditionVar_ { { 356}, { 193} }, // flowArgs { { 332}, { 194} }, // varType { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 331}, { 6} }, // varType_ { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 300}, { 8} }, // INT { { 305}, { 9} }, // STRINGTYPE { { 301}, { 10} }, // LIST { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { 0} }, }; SR_ s_171[] = { { { REQ_DEF}, { 27} }, { { 359}, { 195} }, // optInit { { 358}, { 196} }, // flowInit { { 339}, { 197} }, // argsNull { { 356}, { 193} }, // flowArgs { { 332}, { 198} }, // varType { { 347}, { 199} }, // expression { { 331}, { 6} }, // varType_ { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 300}, { 8} }, // INT { { 305}, { 9} }, // STRINGTYPE { { 301}, { 10} }, // LIST { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { -32} }, }; SR_ s_172[] = { { { DEF_RED}, { 1} }, { { 0}, { -125} }, }; SR_ s_173[] = { { { DEF_RED}, { 2} }, { { 319}, { 200} }, // syntaxCommaOrSemicol { { 0}, { -4} }, }; SR_ s_174[] = { { { DEF_RED}, { 1} }, { { 0}, { -48} }, }; SR_ s_175[] = { { { REQ_DEF}, { 3} }, { { 91}, { 92} }, // '[' { { 315}, { 93} }, // INCDEC { { 0}, { -61} }, }; SR_ s_176[] = { { { REQ_DEF}, { 6} }, { { 91}, { 92} }, // '[' { { 315}, { 93} }, // INCDEC { { 43}, { 94} }, // '+' { { 45}, { 95} }, // '-' { { 314}, { 96} }, // MULTIPLY { { 0}, { -62} }, }; SR_ s_177[] = { { { REQ_DEF}, { 7} }, { { 91}, { 92} }, // '[' { { 315}, { 93} }, // INCDEC { { 43}, { 94} }, // '+' { { 45}, { 95} }, // '-' { { 314}, { 96} }, // MULTIPLY { { 313}, { 97} }, // SHIFT { { 0}, { -63} }, }; SR_ s_178[] = { { { REQ_DEF}, { 8} }, { { 91}, { 92} }, // '[' { { 315}, { 93} }, // INCDEC { { 43}, { 94} }, // '+' { { 45}, { 95} }, // '-' { { 314}, { 96} }, // MULTIPLY { { 313}, { 97} }, // SHIFT { { 312}, { 98} }, // ORDER { { 0}, { -64} }, }; SR_ s_179[] = { { { REQ_TOKEN}, { 18} }, { { 347}, { 201} }, // expression { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { 0} }, }; SR_ s_180[] = { { { REQ_DEF}, { 17} }, { { 91}, { 92} }, // '[' { { 315}, { 93} }, // INCDEC { { 43}, { 94} }, // '+' { { 45}, { 95} }, // '-' { { 314}, { 96} }, // MULTIPLY { { 313}, { 97} }, // SHIFT { { 312}, { 98} }, // ORDER { { 311}, { 99} }, // EQUALITY { { 38}, { 100} }, // '&' { { 94}, { 101} }, // '^' { { 124}, { 102} }, // '|' { { 310}, { 103} }, // AND { { 309}, { 104} }, // OR { { 63}, { 105} }, // '?' { { 61}, { 106} }, // '=' { { 308}, { 107} }, // MATH_IS { { 0}, { -72} }, }; SR_ s_181[] = { { { DEF_RED}, { 1} }, { { 0}, { -30} }, }; SR_ s_182[] = { { { DEF_RED}, { 1} }, { { 0}, { -49} }, }; SR_ s_183[] = { { { REQ_DEF}, { 3} }, { { 91}, { 92} }, // '[' { { 315}, { 93} }, // INCDEC { { 0}, { -58} }, }; SR_ s_184[] = { { { DEF_RED}, { 2} }, { { 318}, { 202} }, // syntaxCloseParen { { 0}, { -3} }, }; SR_ s_185[] = { { { REQ_DEF}, { 17} }, { { 91}, { 92} }, // '[' { { 315}, { 93} }, // INCDEC { { 43}, { 94} }, // '+' { { 45}, { 95} }, // '-' { { 314}, { 96} }, // MULTIPLY { { 313}, { 97} }, // SHIFT { { 312}, { 98} }, // ORDER { { 311}, { 99} }, // EQUALITY { { 38}, { 100} }, // '&' { { 94}, { 101} }, // '^' { { 124}, { 102} }, // '|' { { 310}, { 103} }, // AND { { 309}, { 104} }, // OR { { 63}, { 105} }, // '?' { { 61}, { 106} }, // '=' { { 308}, { 107} }, // MATH_IS { { 0}, { -74} }, }; SR_ s_186[] = { { { DEF_RED}, { 1} }, { { 0}, { -75} }, }; SR_ s_187[] = { { { REQ_TOKEN}, { 5} }, { { 342}, { 203} }, // defineVar { { 341}, { 17} }, // defineVar_ { { 336}, { 32} }, // identifier { { 298}, { 20} }, // IDENTIFIER { { 0}, { 0} }, }; SR_ s_188[] = { { { DEF_RED}, { 2} }, { { 318}, { 204} }, // syntaxCloseParen { { 0}, { -3} }, }; SR_ s_189[] = { { { DEF_RED}, { 1} }, { { 0}, { -101} }, }; SR_ s_190[] = { { { REQ_TOKEN}, { 25} }, { { 349}, { 205} }, // condition { { 347}, { 185} }, // expression { { 348}, { 186} }, // conditionVar_ { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 332}, { 187} }, // varType { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 331}, { 6} }, // varType_ { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 300}, { 8} }, // INT { { 305}, { 9} }, // STRINGTYPE { { 301}, { 10} }, // LIST { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { 0} }, }; SR_ s_191[] = { { { REQ_TOKEN}, { 2} }, { { 59}, { 206} }, // ';' { { 0}, { 0} }, }; SR_ s_192[] = { { { REQ_DEF}, { 18} }, { { 91}, { 92} }, // '[' { { 315}, { 93} }, // INCDEC { { 43}, { 94} }, // '+' { { 45}, { 95} }, // '-' { { 314}, { 96} }, // MULTIPLY { { 313}, { 97} }, // SHIFT { { 312}, { 98} }, // ORDER { { 311}, { 99} }, // EQUALITY { { 38}, { 100} }, // '&' { { 94}, { 101} }, // '^' { { 124}, { 102} }, // '|' { { 310}, { 103} }, // AND { { 309}, { 104} }, // OR { { 63}, { 105} }, // '?' { { 61}, { 106} }, // '=' { { 308}, { 107} }, // MATH_IS { { 41}, { -74} }, // ')' { { 0}, { -86} }, }; SR_ s_193[] = { { { REQ_DEF}, { 2} }, { { 44}, { 207} }, // ',' { { 0}, { -89} }, }; SR_ s_194[] = { { { REQ_TOKEN}, { 6} }, { { 357}, { 208} }, // flowInitDefs_ { { 342}, { 209} }, // defineVar { { 341}, { 17} }, // defineVar_ { { 336}, { 32} }, // identifier { { 298}, { 20} }, // IDENTIFIER { { 0}, { 0} }, }; SR_ s_195[] = { { { DEF_RED}, { 2} }, { { 325}, { 210} }, // syntaxSemicol { { 0}, { -10} }, }; SR_ s_196[] = { { { DEF_RED}, { 1} }, { { 0}, { -91} }, }; SR_ s_197[] = { { { DEF_RED}, { 1} }, { { 0}, { -92} }, }; SR_ s_198[] = { { { REQ_TOKEN}, { 6} }, { { 357}, { 208} }, // flowInitDefs_ { { 342}, { 211} }, // defineVar { { 341}, { 17} }, // defineVar_ { { 336}, { 32} }, // identifier { { 298}, { 20} }, // IDENTIFIER { { 0}, { 0} }, }; SR_ s_199[] = { { { REQ_DEF}, { 17} }, { { 91}, { 92} }, // '[' { { 315}, { 93} }, // INCDEC { { 43}, { 94} }, // '+' { { 45}, { 95} }, // '-' { { 314}, { 96} }, // MULTIPLY { { 313}, { 97} }, // SHIFT { { 312}, { 98} }, // ORDER { { 311}, { 99} }, // EQUALITY { { 38}, { 100} }, // '&' { { 94}, { 101} }, // '^' { { 124}, { 102} }, // '|' { { 310}, { 103} }, // AND { { 309}, { 104} }, // OR { { 63}, { 105} }, // '?' { { 61}, { 106} }, // '=' { { 308}, { 107} }, // MATH_IS { { 0}, { -86} }, }; SR_ s_200[] = { { { DEF_RED}, { 1} }, { { 0}, { -40} }, }; SR_ s_201[] = { { { REQ_DEF}, { 15} }, { { 91}, { 92} }, // '[' { { 315}, { 93} }, // INCDEC { { 43}, { 94} }, // '+' { { 45}, { 95} }, // '-' { { 314}, { 96} }, // MULTIPLY { { 313}, { 97} }, // SHIFT { { 312}, { 98} }, // ORDER { { 311}, { 99} }, // EQUALITY { { 38}, { 100} }, // '&' { { 94}, { 101} }, // '^' { { 124}, { 102} }, // '|' { { 310}, { 103} }, // AND { { 309}, { 104} }, // OR { { 63}, { 105} }, // '?' { { 0}, { -70} }, }; SR_ s_202[] = { { { REQ_TOKEN}, { 3} }, { { 330}, { 212} }, // closeParenBreakOK { { 41}, { 213} }, // ')' { { 0}, { 0} }, }; SR_ s_203[] = { { { DEF_RED}, { 1} }, { { 0}, { -73} }, }; SR_ s_204[] = { { { REQ_TOKEN}, { 2} }, { { 41}, { 214} }, // ')' { { 0}, { 0} }, }; SR_ s_205[] = { { { DEF_RED}, { 1} }, { { 0}, { -102} }, }; SR_ s_206[] = { { { REQ_TOKEN}, { 25} }, { { 349}, { 215} }, // condition { { 347}, { 185} }, // expression { { 348}, { 186} }, // conditionVar_ { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 332}, { 187} }, // varType { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 331}, { 6} }, // varType_ { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 300}, { 8} }, // INT { { 305}, { 9} }, // STRINGTYPE { { 301}, { 10} }, // LIST { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { 0} }, }; SR_ s_207[] = { { { REQ_TOKEN}, { 18} }, { { 347}, { 216} }, // expression { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { 0} }, }; SR_ s_208[] = { { { REQ_DEF}, { 2} }, { { 44}, { 217} }, // ',' { { 0}, { -90} }, }; SR_ s_209[] = { { { REQ_DEF}, { 2} }, { { 41}, { -73} }, // ')' { { 0}, { -88} }, }; SR_ s_210[] = { { { REQ_TOKEN}, { 2} }, { { 59}, { 218} }, // ';' { { 0}, { 0} }, }; SR_ s_211[] = { { { DEF_RED}, { 1} }, { { 0}, { -88} }, }; SR_ s_212[] = { { { ERR_REQ}, { 47} }, { { 372}, { 219} }, // statement { { 371}, { 43} }, // stAlt_ { { 332}, { 44} }, // varType { { 368}, { 45} }, // stBreak_ { { 369}, { 46} }, // stContinue_ { { 370}, { 47} }, // stCompound_ { { 59}, { 48} }, // ';' { { 347}, { 49} }, // expression { { 353}, { 50} }, // returnStatement { { 355}, { 51} }, // whileStatement { { 367}, { 52} }, // ifStatement { { 362}, { 53} }, // forStatement { { errTok_}, { 54} }, // errTok_ { { 331}, { 6} }, // varType_ { { 293}, { 55} }, // BREAK { { 294}, { 56} }, // CONTINUE { { 328}, { 57} }, // openCurly { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 352}, { 68} }, // retLeave_ { { 354}, { 69} }, // while_ { { 363}, { 70} }, // if_ { { 360}, { 71} }, // for_ { { 300}, { 8} }, // INT { { 305}, { 9} }, // STRINGTYPE { { 301}, { 10} }, // LIST { { 123}, { 28} }, // '{' { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 303}, { 73} }, // RETURN { { 296}, { 74} }, // EXIT { { 307}, { 75} }, // WHILE { { 299}, { 76} }, // IF { { 297}, { 77} }, // FOR { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { 0} }, }; SR_ s_213[] = { { { DEF_RED}, { 1} }, { { 0}, { -15} }, }; SR_ s_214[] = { { { DEF_RED}, { 2} }, { { 321}, { 220} }, // syntaxExpression { { 0}, { -6} }, }; SR_ s_215[] = { { { DEF_RED}, { 1} }, { { 0}, { -103} }, }; SR_ s_216[] = { { { REQ_DEF}, { 17} }, { { 91}, { 92} }, // '[' { { 315}, { 93} }, // INCDEC { { 43}, { 94} }, // '+' { { 45}, { 95} }, // '-' { { 314}, { 96} }, // MULTIPLY { { 313}, { 97} }, // SHIFT { { 312}, { 98} }, // ORDER { { 311}, { 99} }, // EQUALITY { { 38}, { 100} }, // '&' { { 94}, { 101} }, // '^' { { 124}, { 102} }, // '|' { { 310}, { 103} }, // AND { { 309}, { 104} }, // OR { { 63}, { 105} }, // '?' { { 61}, { 106} }, // '=' { { 308}, { 107} }, // MATH_IS { { 0}, { -85} }, }; SR_ s_217[] = { { { REQ_TOKEN}, { 5} }, { { 342}, { 221} }, // defineVar { { 341}, { 17} }, // defineVar_ { { 336}, { 32} }, // identifier { { 298}, { 20} }, // IDENTIFIER { { 0}, { 0} }, }; SR_ s_218[] = { { { DEF_RED}, { 2} }, { { 321}, { 222} }, // syntaxExpression { { 0}, { -6} }, }; SR_ s_219[] = { { { DEF_RED}, { 1} }, { { 0}, { -84} }, }; SR_ s_220[] = { { { ERR_REQ}, { 47} }, { { 372}, { 223} }, // statement { { 371}, { 43} }, // stAlt_ { { 332}, { 44} }, // varType { { 368}, { 45} }, // stBreak_ { { 369}, { 46} }, // stContinue_ { { 370}, { 47} }, // stCompound_ { { 59}, { 48} }, // ';' { { 347}, { 49} }, // expression { { 353}, { 50} }, // returnStatement { { 355}, { 51} }, // whileStatement { { 367}, { 52} }, // ifStatement { { 362}, { 53} }, // forStatement { { errTok_}, { 54} }, // errTok_ { { 331}, { 6} }, // varType_ { { 293}, { 55} }, // BREAK { { 294}, { 56} }, // CONTINUE { { 328}, { 57} }, // openCurly { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 352}, { 68} }, // retLeave_ { { 354}, { 69} }, // while_ { { 363}, { 70} }, // if_ { { 360}, { 71} }, // for_ { { 300}, { 8} }, // INT { { 305}, { 9} }, // STRINGTYPE { { 301}, { 10} }, // LIST { { 123}, { 28} }, // '{' { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 303}, { 73} }, // RETURN { { 296}, { 74} }, // EXIT { { 307}, { 75} }, // WHILE { { 299}, { 76} }, // IF { { 297}, { 77} }, // FOR { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { 0} }, }; SR_ s_221[] = { { { DEF_RED}, { 1} }, { { 0}, { -87} }, }; SR_ s_222[] = { { { REQ_DEF}, { 26} }, { { 350}, { 224} }, // optCondition { { 349}, { 225} }, // condition { { 347}, { 185} }, // expression { { 348}, { 186} }, // conditionVar_ { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 332}, { 187} }, // varType { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 331}, { 6} }, // varType_ { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 300}, { 8} }, // INT { { 305}, { 9} }, // STRINGTYPE { { 301}, { 10} }, // LIST { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { -77} }, }; SR_ s_223[] = { { { REQ_DEF}, { 4} }, { { 365}, { 226} }, // ifStatementElse_ { { 364}, { 227} }, // ifElse_ { { 295}, { 228} }, // ELSE { { 0}, { -100} }, }; SR_ s_224[] = { { { DEF_RED}, { 2} }, { { 325}, { 229} }, // syntaxSemicol { { 0}, { -10} }, }; SR_ s_225[] = { { { DEF_RED}, { 1} }, { { 0}, { -76} }, }; SR_ s_226[] = { { { DEF_RED}, { 1} }, { { 0}, { -104} }, }; SR_ s_227[] = { { { ERR_REQ}, { 47} }, { { 372}, { 230} }, // statement { { 371}, { 43} }, // stAlt_ { { 332}, { 44} }, // varType { { 368}, { 45} }, // stBreak_ { { 369}, { 46} }, // stContinue_ { { 370}, { 47} }, // stCompound_ { { 59}, { 48} }, // ';' { { 347}, { 49} }, // expression { { 353}, { 50} }, // returnStatement { { 355}, { 51} }, // whileStatement { { 367}, { 52} }, // ifStatement { { 362}, { 53} }, // forStatement { { errTok_}, { 54} }, // errTok_ { { 331}, { 6} }, // varType_ { { 293}, { 55} }, // BREAK { { 294}, { 56} }, // CONTINUE { { 328}, { 57} }, // openCurly { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 352}, { 68} }, // retLeave_ { { 354}, { 69} }, // while_ { { 363}, { 70} }, // if_ { { 360}, { 71} }, // for_ { { 300}, { 8} }, // INT { { 305}, { 9} }, // STRINGTYPE { { 301}, { 10} }, // LIST { { 123}, { 28} }, // '{' { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 303}, { 73} }, // RETURN { { 296}, { 74} }, // EXIT { { 307}, { 75} }, // WHILE { { 299}, { 76} }, // IF { { 297}, { 77} }, // FOR { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { 0} }, }; SR_ s_228[] = { { { DEF_RED}, { 1} }, { { 0}, { -98} }, }; SR_ s_229[] = { { { REQ_TOKEN}, { 2} }, { { 59}, { 231} }, // ';' { { 0}, { 0} }, }; SR_ s_230[] = { { { DEF_RED}, { 1} }, { { 0}, { -99} }, }; SR_ s_231[] = { { { DEF_RED}, { 2} }, { { 321}, { 232} }, // syntaxExpression { { 0}, { -6} }, }; SR_ s_232[] = { { { REQ_DEF}, { 21} }, { { 361}, { 233} }, // forOptInc_ { { 356}, { 234} }, // flowArgs { { 339}, { 235} }, // argsNull { { 347}, { 199} }, // expression { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { -32} }, }; SR_ s_233[] = { { { DEF_RED}, { 2} }, { { 318}, { 236} }, // syntaxCloseParen { { 0}, { -3} }, }; SR_ s_234[] = { { { REQ_DEF}, { 2} }, { { 44}, { 207} }, // ',' { { 0}, { -94} }, }; SR_ s_235[] = { { { DEF_RED}, { 1} }, { { 0}, { -95} }, }; SR_ s_236[] = { { { REQ_TOKEN}, { 3} }, { { 330}, { 237} }, // closeParenBreakOK { { 41}, { 213} }, // ')' { { 0}, { 0} }, }; SR_ s_237[] = { { { ERR_REQ}, { 47} }, { { 372}, { 238} }, // statement { { 371}, { 43} }, // stAlt_ { { 332}, { 44} }, // varType { { 368}, { 45} }, // stBreak_ { { 369}, { 46} }, // stContinue_ { { 370}, { 47} }, // stCompound_ { { 59}, { 48} }, // ';' { { 347}, { 49} }, // expression { { 353}, { 50} }, // returnStatement { { 355}, { 51} }, // whileStatement { { 367}, { 52} }, // ifStatement { { 362}, { 53} }, // forStatement { { errTok_}, { 54} }, // errTok_ { { 331}, { 6} }, // varType_ { { 293}, { 55} }, // BREAK { { 294}, { 56} }, // CONTINUE { { 328}, { 57} }, // openCurly { { 346}, { 58} }, // exprStart_ { { 91}, { 59} }, // '[' { { 336}, { 60} }, // identifier { { 96}, { 61} }, // '`' { { 40}, { 62} }, // '(' { { 43}, { 63} }, // '+' { { 45}, { 64} }, // '-' { { 126}, { 65} }, // '~' { { 33}, { 66} }, // '!' { { 315}, { 67} }, // INCDEC { { 352}, { 68} }, // retLeave_ { { 354}, { 69} }, // while_ { { 363}, { 70} }, // if_ { { 360}, { 71} }, // for_ { { 300}, { 8} }, // INT { { 305}, { 9} }, // STRINGTYPE { { 301}, { 10} }, // LIST { { 123}, { 28} }, // '{' { { 345}, { 72} }, // exprUnit_ { { 298}, { 20} }, // IDENTIFIER { { 303}, { 73} }, // RETURN { { 296}, { 74} }, // EXIT { { 307}, { 75} }, // WHILE { { 299}, { 76} }, // IF { { 297}, { 77} }, // FOR { { 334}, { 78} }, // string { { 302}, { 79} }, // NUMBER { { 333}, { 80} }, // string_ { { 304}, { 81} }, // STRING { { 0}, { 0} }, }; SR_ s_238[] = { { { DEF_RED}, { 1} }, { { 0}, { -96} }, }; // State array: SR_ *s_state[] = { s_0, s_1, s_2, s_3, s_4, s_5, s_6, s_7, s_8, s_9, s_10, s_11, s_12, s_13, s_14, s_15, s_16, s_17, s_18, s_19, s_20, s_21, s_22, s_23, s_24, s_25, s_26, s_27, s_28, s_29, s_30, s_31, s_32, s_33, s_34, s_35, s_36, s_37, s_38, s_39, s_40, s_41, s_42, s_43, s_44, s_45, s_46, s_47, s_48, s_49, s_50, s_51, s_52, s_53, s_54, s_55, s_56, s_57, s_58, s_59, s_60, s_61, s_62, s_63, s_64, s_65, s_66, s_67, s_68, s_69, s_70, s_71, s_72, s_73, s_74, s_75, s_76, s_77, s_78, s_79, s_80, s_81, s_82, s_83, s_84, s_85, s_86, s_87, s_88, s_89, s_90, s_91, s_92, s_93, s_94, s_95, s_96, s_97, s_98, s_99, s_100, s_101, s_102, s_103, s_104, s_105, s_106, s_107, s_108, s_109, s_110, s_111, s_112, s_113, s_114, s_115, s_116, s_117, s_118, s_119, s_120, s_121, s_122, s_123, s_124, s_125, s_126, s_127, s_128, s_129, s_130, s_131, s_132, s_133, s_134, s_135, s_136, s_137, s_138, s_139, s_140, s_141, s_142, s_143, s_144, s_145, s_146, s_147, s_148, s_149, s_150, s_151, s_152, s_153, s_154, s_155, s_156, s_157, s_158, s_159, s_160, s_161, s_162, s_163, s_164, s_165, s_166, s_167, s_168, s_169, s_170, s_171, s_172, s_173, s_174, s_175, s_176, s_177, s_178, s_179, s_180, s_181, s_182, s_183, s_184, s_185, s_186, s_187, s_188, s_189, s_190, s_191, s_192, s_193, s_194, s_195, s_196, s_197, s_198, s_199, s_200, s_201, s_202, s_203, s_204, s_205, s_206, s_207, s_208, s_209, s_210, s_211, s_212, s_213, s_214, s_215, s_216, s_217, s_218, s_219, s_220, s_221, s_222, s_223, s_224, s_225, s_226, s_227, s_228, s_229, s_230, s_231, s_232, s_233, s_234, s_235, s_236, s_237, s_238, }; } // anonymous namespace ends // $insert polymorphicCode namespace Meta_ { size_t const *t_nErrors; // $insert idoftag char const *idOfTag_[] = { "OPCODE", "TOKEN", "ARGS", "SEMVAL", "STRING", "" }; size_t const *s_nErrors_; Base::~Base() {} } // namespace Meta_ // If the parsing function call (i.e., parse()' needs arguments, then provide // an overloaded function. The code below doesn't rely on parameters, so no // arguments are required. Furthermore, parse uses a function try block to // allow us to do ACCEPT and ABORT from anywhere, even from within members // called by actions, simply throwing the appropriate exceptions. // base/base1 ParserBase::ParserBase() : d_token(Reserved_::UNDETERMINED_), // $insert baseclasscode d_requiredTokens_(0) { Meta_::t_nErrors = &d_nErrors_; } // base/clearin void ParserBase::clearin_() { d_nErrors_ = 0; d_stackIdx = -1; d_stateStack.clear(); d_token = Reserved_::UNDETERMINED_; d_next = TokenPair{ Reserved_::UNDETERMINED_, STYPE_{} }; d_recovery = false; d_acceptedTokens_ = d_requiredTokens_; d_val_ = STYPE_{}; push_(0); } // base/debugfunctions void ParserBase::setDebug(bool mode) { d_actionCases_ = false; d_debug_ = mode; } void ParserBase::setDebug(DebugMode_ mode) { d_actionCases_ = mode & ACTIONCASES; d_debug_ = mode & ON; } // base/lex void ParserBase::lex_(int token) { d_token = token; if (d_token <= 0) d_token = Reserved_::EOF_; d_terminalToken = true; } // base/lookup int ParserBase::lookup_() const { // if the final transition is negative, then we should reduce by the rule // given by its positive value. SR_ const *sr = s_state[d_state]; SR_ const *last = sr + sr->d_lastIdx; for ( ; ++sr != last; ) // visit all but the last SR entries { if (sr->d_token == d_token) return sr->d_action; } if (sr == last) // reached the last element { if (sr->d_action < 0) // default reduction { return sr->d_action; } // No default reduction, so token not found, so error. throw UNEXPECTED_TOKEN_; } // not at the last element: inspect the nature of the action // (< 0: reduce, 0: ACCEPT, > 0: shift) int action = sr->d_action; return action; } // base/pop void ParserBase::pop_(size_t count) { if (d_stackIdx < static_cast(count)) { ABORT(); } d_stackIdx -= count; d_state = d_stateStack[d_stackIdx].first; d_vsp = &d_stateStack[d_stackIdx]; } // base/poptoken void ParserBase::popToken_() { d_token = d_next.first; d_val_ = std::move(d_next.second); d_next.first = Reserved_::UNDETERMINED_; } // base/push void ParserBase::push_(size_t state) { size_t currentSize = d_stateStack.size(); if (stackSize_() == currentSize) { size_t newSize = currentSize + STACK_EXPANSION_; d_stateStack.resize(newSize); } ++d_stackIdx; d_stateStack[d_stackIdx] = StatePair{ d_state = state, std::move(d_val_) }; d_vsp = &d_stateStack[d_stackIdx]; if (d_stackIdx == 0) { } else { } } // base/pushtoken void ParserBase::pushToken_(int token) { d_next = TokenPair{ d_token, std::move(d_val_) }; d_token = token; } // base/redotoken void ParserBase::redoToken_() { if (d_token != Reserved_::UNDETERMINED_) pushToken_(d_token); } // base/reduce void ParserBase::reduce_(int rule) { PI_ const &pi = s_productionInfo[rule]; d_token = pi.d_nonTerm; pop_(pi.d_size); d_terminalToken = false; } // base/shift void ParserBase::shift_(int action) { push_(action); popToken_(); // token processed if (d_recovery and d_terminalToken) { d_recovery = false; d_acceptedTokens_ = 0; } } // base/startrecovery void ParserBase::startRecovery_() { int lastToken = d_token; // give the unexpected token a // chance to be processed // again. pushToken_(Reserved_::errTok_); // specify errTok_ as next token push_(lookup_()); // push the error state d_token = lastToken; // reactivate the unexpected // token (we're now in an // ERROR state). d_recovery = true; } // base/top inline size_t ParserBase::top_() const { return d_stateStack[d_stackIdx].first; } // derived/errorrecovery void Parser::errorRecovery_() { // When an error has occurred, pop elements off the stack until the top // state has an error-item. If none is found, the default recovery // mode (which is to abort) is activated. // // If EOF is encountered without being appropriate for the current state, // then the error recovery will fall back to the default recovery mode. // (i.e., parsing terminates) if (d_acceptedTokens_ >= d_requiredTokens_)// only generate an error- { // message if enough tokens ++d_nErrors_; // were accepted. Otherwise error(); // simply skip input } // get the error state while (not (s_state[top_()][0].d_type & ERR_ITEM)) { pop_(); } // In the error state, looking up a token allows us to proceed. // Continuation may be require multiple reductions, but eventually a // terminal-token shift is used. See nextCycle_ for details. startRecovery_(); } // derived/executeaction void Parser::executeAction_(int production) try { if (token_() != Reserved_::UNDETERMINED_) pushToken_(token_()); // save an already available token switch (production) { // $insert actioncases case 1: #line 56 "grammar" { d_val_ = std::move(vs_(-1)); } break; case 2: #line 58 "grammar" { d_val_ = std::move(vs_(0)); } break; case 3: #line 2 "inc/syntax" { Error::set(Error::CLOSEPAREN); } break; case 4: #line 8 "inc/syntax" { Error::set(Error::COMMA_OR_SEMICOL); } break; case 5: #line 14 "inc/syntax" { Error::set(Error::COMMA_OR_CLOSEPAREN); } break; case 6: #line 20 "inc/syntax" { Error::set(Error::EXPRESSION); } break; case 7: #line 26 "inc/syntax" { Error::set(Error::IDENTIFIER); } break; case 8: #line 32 "inc/syntax" { Error::set(Error::INIT); } break; case 9: #line 38 "inc/syntax" { Error::set(Error::OPENCURLY); } break; case 10: #line 44 "inc/syntax" { Error::set(Error::SEMICOL); } break; case 11: #line 50 "inc/syntax" { Error::set(Error::TYPENAME); } break; case 12: #line 2 "inc/opvalue" { d_val_ = as(d_scanner.expr()); } break; case 13: #line 3 "inc/opencurly" { Error::set(Error::STATEMENT); d_symtab.push(); } break; case 14: #line 3 "inc/closecurly" { d_symtab.pop(); } break; case 15: #line 3 "inc/closeparenbreakok" { ++d_breakOK; } break; case 16: #line 3 "inc/vartype" { d_type = e_int; } break; case 17: #line 8 "inc/vartype" { d_type = e_str; } break; case 18: #line 13 "inc/vartype" { d_type = e_list; } break; case 19: #line 20 "inc/vartype" { d_val_ = std::move(vs_(-1)); } break; case 20: #line 3 "inc/string" { d_val_ = vs_(-1).get() + d_scanner.matched(); } break; case 21: #line 8 "inc/string" { d_val_ = d_scanner.matched(); } break; case 22: #line 15 "inc/string" { d_val_ = SemVal{ e_str | e_const, as(StringStore::instance().offset(vs_(0).get())) }; } break; case 23: #line 3 "inc/cast" { d_val_ = Tokens::INT; } break; case 24: #line 8 "inc/cast" { d_val_ = Tokens::LIST; } break; case 25: #line 13 "inc/cast" { d_val_ = Tokens::STRINGTYPE; } break; case 26: #line 18 "inc/cast" { d_val_ = Tokens::BOOL; } break; case 27: #line 3 "inc/identifier" { d_val_ = d_scanner.matched(); } break; case 28: #line 3 "inc/args" { d_val_ = move(vs_(0).get()); } break; case 29: #line 8 "inc/args" { d_val_ = SemVal{ e_order, vs_(0).get() }; } break; case 30: #line 17 "inc/args" { d_val_ = vs_(-2).get().add(vs_(0).get()); } break; case 31: #line 22 "inc/args" { d_val_ = Args{ vs_(0).get() }; } break; case 32: #line 28 "inc/args" { d_val_ = Args{}; } break; case 33: #line 35 "inc/args" { d_val_ = std::move(vs_(0)); } break; case 34: #line 37 "inc/args" { d_val_ = std::move(vs_(0)); } break; case 35: #line 3 "inc/definevar" { d_val_ = d_symtab.defineVar(d_type, vs_(0).get()); } break; case 36: #line 13 "inc/definevar" { d_val_ = std::move(vs_(0)); } break; case 37: #line 15 "inc/definevar" { d_val_ = defineVar(vs_(-3).get(), vs_(0).get()); } break; case 38: #line 3 "inc/globalvars" { d_initCode << vs_(-1).get(); } break; case 39: #line 8 "inc/globalvars" { d_initCode << vs_(-1).get(); } break; case 40: #line 3 "inc/localvars" { d_val_ = move(vs_(-3).get() << vs_(-1).get()); } break; case 41: #line 8 "inc/localvars" { d_val_ = move(vs_(-1).get()); } break; case 42: #line 3 "inc/expression" { d_val_ = std::move(vs_(0)); } break; case 43: #line 5 "inc/expression" { d_val_ = SemVal{ e_int | e_const, d_scanner.expr() }; } break; case 44: #line 10 "inc/expression" { d_val_ = variable(vs_(0).get()); } break; case 45: #line 18 "inc/expression" { d_val_ = std::move(vs_(-1)); } break; case 46: #line 22 "inc/expression" { d_val_ = std::move(vs_(0)); } break; case 47: #line 24 "inc/expression" { d_val_ = vs_(-1).get().callBuiltin(Builtin::LISTCONST); } break; case 48: #line 29 "inc/expression" { d_val_ = index(vs_(-3).get(), vs_(-1).get()); } break; case 49: #line 34 "inc/expression" { d_val_ = function(vs_(-3).get(), move(vs_(-1).get())); } break; case 50: #line 40 "inc/expression" { d_val_ = function("`", Args{ vs_(-1).get() }); } break; case 51: #line 45 "inc/expression" { d_val_ = pushPrint(vs_(-1).get()); } break; case 52: #line 50 "inc/expression" { d_val_ = vs_(0).get(); } break; case 53: #line 55 "inc/expression" { d_val_ = vs_(0).get().negate(); } break; case 54: #line 61 "inc/expression" { d_val_ = vs_(0).get().bitNot(); } break; case 55: #line 66 "inc/expression" { d_val_ = vs_(0).get().boolNot(); } break; case 56: #line 71 "inc/expression" { d_val_ = vs_(0).get().incDec(vs_(-1).get(), e_prefix); } break; case 57: #line 76 "inc/expression" { d_val_ = vs_(-2).get().incDec(vs_(0).get(), e_postfix); } break; case 58: #line 81 "inc/expression" { d_val_ = vs_(0).get().cast(vs_(-2).get()); } break; case 59: #line 86 "inc/expression" { d_val_ = vs_(-2).get().binary(Opcode::add, move(vs_(0).get())); } break; case 60: #line 91 "inc/expression" { d_val_ = vs_(-2).get().binary(Opcode::sub, move(vs_(0).get())); } break; case 61: #line 96 "inc/expression" { d_val_ = vs_(-3).get().binary(vs_(-1).get(), move(vs_(0).get())); } break; case 62: #line 101 "inc/expression" { d_val_ = shiftOrPrint(vs_(-3).get(), vs_(-1).get(), vs_(0).get()); } break; case 63: #line 106 "inc/expression" { d_val_ = binary(vs_(-3).get(), vs_(-1).get(), vs_(0).get()); } break; case 64: #line 111 "inc/expression" { d_val_ = binary(vs_(-3).get(), vs_(-1).get(), vs_(0).get()); } break; case 65: #line 116 "inc/expression" { d_val_ = binary(vs_(-2).get(), Opcode::band, vs_(0).get()); } break; case 66: #line 121 "inc/expression" { d_val_ = binary(vs_(-2).get(), Opcode::bxor, vs_(0).get()); } break; case 67: #line 126 "inc/expression" { d_val_ = binary(vs_(-2).get(), Opcode::bor, vs_(0).get()); } break; case 68: #line 131 "inc/expression" { d_val_ = pushPrint(vs_(-2).get()).logicAnd(pushPrint(vs_(0).get())); } break; case 69: #line 136 "inc/expression" { d_val_ = pushPrint(vs_(-2).get()).logicOr(pushPrint(vs_(0).get())); } break; case 70: #line 141 "inc/expression" { d_val_ = pushPrint(vs_(-4).get()).ternary(pushPrint(vs_(-2).get()), pushPrint(vs_(0).get())); } break; case 71: #line 146 "inc/expression" { d_val_ = vs_(-2).get().assign(pushPrint(vs_(0).get()), Opcode::copy_var); } break; case 72: #line 151 "inc/expression" { d_val_ = vs_(-3).get().compound(vs_(-1).get(), pushPrint(vs_(0).get())); } break; case 73: #line 3 "inc/condition" { d_val_ = move(vs_(0).get()); } break; case 74: #line 10 "inc/condition" { d_val_ = std::move(vs_(0)); } break; case 75: #line 12 "inc/condition" { d_val_ = std::move(vs_(0)); } break; case 76: #line 3 "inc/optcondition" { d_val_ = std::move(vs_(0)); } break; case 77: #line 4 "inc/optcondition" { d_val_ = SemVal{ e_int | e_const, 1 }; } break; case 78: #line 3 "inc/returnstatement" { d_val_ = std::move(vs_(0)); } break; case 79: #line 4 "inc/returnstatement" { d_val_ = SemVal{ e_void }; } break; case 80: #line 11 "inc/returnstatement" { d_val_ = Tokens::RETURN; } break; case 81: #line 16 "inc/returnstatement" { d_val_ = Tokens::EXIT; } break; case 82: #line 23 "inc/returnstatement" { d_val_ = returnStmnt(vs_(-2).get(), vs_(0).get()); } break; case 83: #line 3 "inc/whilestatement" { push(); } break; case 84: #line 11 "inc/whilestatement" { d_val_ = forStmnt(Args{}, vs_(-3).get(), Args{}, vs_(0).get()); } break; case 85: #line 3 "inc/flowargs" { d_val_ = move(vs_(-2).get().add(vs_(0).get())); } break; case 86: #line 8 "inc/flowargs" { d_val_ = Args{ vs_(0).get() }; } break; case 87: #line 3 "inc/flowinit" { d_val_ = move(vs_(-2).get().add(vs_(0).get())); } break; case 88: #line 8 "inc/flowinit" { d_val_ = Args{ vs_(0).get() }; } break; case 89: #line 15 "inc/flowinit" { d_val_ = std::move(vs_(0)); } break; case 90: #line 17 "inc/flowinit" { d_val_ = move(vs_(0).get()); } break; case 91: #line 3 "inc/optinit" { d_val_ = std::move(vs_(0)); } break; case 92: #line 5 "inc/optinit" { d_val_ = std::move(vs_(0)); } break; case 93: #line 3 "inc/forstatement" { push(); } break; case 94: #line 10 "inc/forstatement" { d_val_ = std::move(vs_(0)); } break; case 95: #line 12 "inc/forstatement" { d_val_ = std::move(vs_(0)); } break; case 96: #line 22 "inc/forstatement" { d_val_ = forStmnt(move(vs_(-11).get()), vs_(-7).get(), move(vs_(-3).get()), vs_(0).get()); } break; case 97: #line 3 "inc/ifstatement" { push(); } break; case 98: #line 10 "inc/ifstatement" { semValPopPush(); } break; case 99: #line 17 "inc/ifstatement" { d_val_ = move(vs_(0).get()); } break; case 100: #line 21 "inc/ifstatement" { d_val_ = SemVal{}; } break; case 101: #line 28 "inc/ifstatement" { d_val_ = Args{ vs_(0).get() }; } break; case 102: #line 33 "inc/ifstatement" { d_val_ = Args{ vs_(0).get() }; } break; case 103: #line 38 "inc/ifstatement" { d_val_ = move(vs_(-2).get().add(vs_(0).get())); } break; case 104: #line 48 "inc/ifstatement" { d_val_ = ifStmnt(vs_(-5).get(), vs_(-1).get(), vs_(0).get()); } break; case 105: #line 3 "inc/statement" { d_val_ = move(breakStmnt()); } break; case 106: #line 10 "inc/statement" { d_val_ = move(continueStmnt()); } break; case 107: #line 20 "inc/statement" { d_val_ = move(vs_(-1).get()); } break; case 108: #line 27 "inc/statement" { d_val_ = std::move(vs_(-1)); } break; case 109: #line 29 "inc/statement" { d_val_ = std::move(vs_(-1)); } break; case 110: #line 31 "inc/statement" { d_val_ = std::move(vs_(0)); } break; case 111: #line 33 "inc/statement" { d_val_ = SemVal{}; } break; case 112: #line 38 "inc/statement" { d_val_ = exprStmnt(vs_(-1).get()); } break; case 113: #line 43 "inc/statement" { d_val_ = std::move(vs_(-1)); } break; case 114: #line 45 "inc/statement" { d_val_ = std::move(vs_(0)); } break; case 115: #line 47 "inc/statement" { d_val_ = std::move(vs_(0)); } break; case 116: #line 49 "inc/statement" { d_val_ = std::move(vs_(0)); } break; case 117: #line 51 "inc/statement" { d_val_ = SemVal{}; } break; case 118: #line 58 "inc/statement" { d_val_ = std::move(vs_(0)); } break; case 119: #line 60 "inc/statement" { d_val_ = move(vs_(-1).get()); } break; case 120: #line 3 "inc/statements" { d_val_ = catStatements(vs_(-1).get(), vs_(0).get()); } break; case 121: #line 7 "inc/statements" { d_val_ = SemVal{}; } break; case 122: #line 3 "inc/functiondef" { d_symtab.defineFunction(d_type, vs_(0).get()); } break; case 123: #line 10 "inc/functiondef" { d_symtab.defineVar(d_type, vs_(0).get()); } break; case 124: #line 17 "inc/functiondef" { d_val_ = std::move(vs_(-2)); } break; case 125: #line 21 "inc/functiondef" { d_val_ = std::move(vs_(-3)); } break; case 126: #line 23 "inc/functiondef" { d_val_ = std::move(vs_(0)); } break; case 127: #line 27 "inc/functiondef" { d_val_ = std::move(vs_(0)); } break; case 129: #line 33 "inc/functiondef" { functionHead(); } break; case 130: #line 40 "inc/functiondef" { functionDefined(vs_(-1).get()); } break; case 131: #line 3 "inc/defvarorfun" { d_type = e_void; } break; case 132: #line 11 "inc/defvarorfun" { d_val_ = std::move(vs_(-2)); } break; case 133: #line 13 "inc/defvarorfun" { d_val_ = std::move(vs_(-1)); } break; case 134: #line 15 "inc/defvarorfun" { d_val_ = std::move(vs_(-1)); } break; case 135: #line 20 "inc/defvarorfun" { d_val_ = std::move(vs_(-1)); } break; } } catch (std::exception const &exc) { exceptionHandler(exc); } // derived/nextcycle void Parser::nextCycle_() try { if (s_state[state_()]->d_type & REQ_TOKEN) nextToken_(); // obtain next token int action = lookup_(); // lookup d_token in d_state if (action > 0) // SHIFT: push a new state { shift_(action); return; } if (action < 0) // REDUCE: execute and pop. { if (recovery_()) redoToken_(); else executeAction_(-action); // next token is the rule's LHS reduce_(-action); return; } if (recovery_()) ABORT(); else ACCEPT(); } catch (ErrorRecovery_) { if (not recovery_()) errorRecovery_(); else { if (token_() == Reserved_::EOF_) ABORT(); popToken_(); // skip the failing token } } // derived/nexttoken void Parser::nextToken_() { // If d_token is Reserved_::UNDETERMINED_ then if savedToken_() is // Reserved_::UNDETERMINED_ another token is obtained from lex(). Then // savedToken_() is assigned to d_token. // no need for a token: got one already if (token_() != Reserved_::UNDETERMINED_) { return; } if (savedToken_() != Reserved_::UNDETERMINED_) { popToken_(); // consume pending token } else { ++d_acceptedTokens_; // accept another token (see // errorRecover()) lex_(lex()); print_(); } print(); } // derived/print void Parser::print_() { // $insert print } // derived/parse int Parser::parse() try { // The parsing algorithm: // Initially, state 0 is pushed on the stack, and all relevant variables // are initialized by Base::clearin_. // // Then, in an eternal loop: // // 1. If a state is a REQ_TOKEN type, then the next token is obtained // from nextToken(). This may very well be the currently available // token. When retrieving a terminal token d_terminal is set to true. // // 2. lookup() is called, d_token is looked up in the current state's // SR_ array. // // 4. Depending on the result of the lookup() function the next state is // shifted on the parser's stack, a reduction by some rule is applied, // or the parsing function returns ACCEPT(). When a reduction is // called for, any action that may have been defined for that // reduction is executed. // // 5. An error occurs if d_token is not found, and the state has no // default reduction. clearin_(); // initialize, push(0) while (true) { // $insert prompt nextCycle_(); } } catch (Return_ retValue) { return retValue or d_nErrors_; } // derived/tail icmake-10.03.00/comp/parser/function.cc0000644000175000017500000000161214204126313016532 0ustar frankfrank#define XERR #include "parser.ih" SemVal Parser::function(string const &name, Args &&args) const { SemVal ret; //xerr("calling " << name << ", args:"); //for (SemVal const &arg: args) //arg.bytes(); for (auto &arg: args) arg = pushPrint(arg); // special case: 'element(idx, list or string)' calls index if ( name == "element" and args.size() == 2 and (args[0].type() & e_int) and args[1].type() & (e_str | e_list) ) return index(args[1], args[0]); if ( not args.builtin(ret, name) // ret is called using args and not args.function(ret, d_functions.find(name)) // (same) ) Error::msg(Error::UNDEFINED_FUNCTION) << name << "' (maybe types of args mismatch)\n"; // SemVal::pushDead(); ??? return ret; } icmake-10.03.00/comp/parser/lex.f0000644000175000017500000000010314204126313015327 0ustar frankfrankinline int Parser::lex() { return d_token = d_scanner.lex(); } icmake-10.03.00/comp/parser/symtab.f0000644000175000017500000000010514204126313016040 0ustar frankfrankinline Symtab const &Parser::symtab() const { return d_symtab; } icmake-10.03.00/comp/parser/error.f0000644000175000017500000000006214204126313015674 0ustar frankfrankinline void Parser::error() { Error::msg(); } icmake-10.03.00/comp/parser/README0000644000175000017500000000547614204126313015272 0ustar frankfrankPolymorphic semantic types are EXPRPTR: Expr *; SIZE_T: size_t; STMNTPTR: Statement *; STRING: std::string; UPtrExpr is std::unique_ptr The grammar expects >= variable or function definitions (defVarOrFun) syntaxX rules are all defined in the inc/syntax file. They preset the Error message to the next error if it is encountered following successfully parsing a rule. E.g., syntaxExpression: { Error::set(Error::EXPRESSION); } d_lastType holds the last received type specification. defVarOrFun: either a variable definition (varsDef) or a function definition (functionDef). this rule merely defines, and returns nothing varsDef: varType varsDefList ';' returns an Expr * (EXPRPTR) functionDef: this rule merely defines, and returns nothing varType: assigns d_lastType. returns the corresponding INT, STRINGTYPE or LIST token. varsDefList: initializes an Args object with the number and if provided intialization values of a list of variables. If an initialization (var = expr) was provided for a global variable then the initialization is stored in the Symtab's global intialization vector s_initialization. functionDef: functionDef: fdHead_ openCurly statements closeCurly { completeFunction($3); } defines a function. * the symbol table starts the next level of var. defs. * comma separated 'type params' are stored * the function is defined by Function::functionHead * all statements (including local var. defs.) are collected * the function is completed by adding the statements' code. (completeFunction: Function.complete(), Symtab resets to only global variables) statements: statements: statements statement { $$ = pushStatement($1, $2); } | { $$ = new CompoundStatement{}; } ; statements are statement sequences embedded in a compound statement CompoundStatement: a compound statement contains a vector of statements, and a bool d_aceept which is set to false once a statement is a return/break/continue, whereafter additional stmnts are no longer added to the compound stmnt The CompundStatement is derived from Statement, and is not the same as the syntax rule 'statementCompound' returnStatement: retLeave_ syntaxExpression retExpr_ { $$ = semicolAfter(new ReturnStatement{ $1, $3 }); } retLeave_ returns an expression or a NullExpr for e_void: a plain return; returns e_void, other expressions return the type of the expression (int, string, list) 'semicolAfter' returns the statement received as argument and sets Error to SEMICOL: a ; must follow next. icmake-10.03.00/comp/parser/parser.ih0000644000175000017500000000063414204126313016217 0ustar frankfrank// Generated by Bisonc++ V6.03.00 on Thu, 05 Mar 2020 17:53:53 +0100 // $insert class.h #include "parser.h" #include #include "../../xerr/xerr.ih" #include "../../support/as/as.h" #include "../error/error.h" #include "../opcode/opcode.h" #include "error.f" #include "lex.f" #include "print.f" #include "exceptionhandler.f" #include "binary.f" using namespace std; using namespace FBB; icmake-10.03.00/comp/parser/exprstmnt.cc0000644000175000017500000000023714204126313016753 0ustar frankfrank#define XERR #include "parser.ih" SemVal Parser::exprStmnt(SemVal &expr) const { return expr.type() & e_printMask ? pushPrint(expr) : expr.exprStmnt(); } icmake-10.03.00/comp/parser/grammar.output0000644000175000017500000033336614204126313017324 0ustar frankfrank[grammar (info)] Line 87: Production Rules: (precedences (shown between parentheses) were set by %prec; are equal to the precedence of the rules' 1st terminal tokens; or (if not shown) are equal to the default (max) precedence) 1: input -> input defVarOrFun 2: input -> defVarOrFun 3: syntaxCloseParen -> 4: syntaxCommaOrSemicol -> 5: syntaxCommaOrCloseparen -> 6: syntaxExpression -> 7: syntaxIdentifier -> 8: syntaxInit -> 9: syntaxOpenCurly -> 10: syntaxSemicol -> 11: syntaxTypename -> 12: opValue -> 13: openCurly ('{') -> '{' 14: closeCurly ('}') -> '}' 15: closeParenBreakOK (')') -> ')' 16: varType_ (INT) -> INT 17: varType_ (STRINGTYPE) -> STRINGTYPE 18: varType_ (LIST) -> LIST 19: varType -> varType_ syntaxIdentifier 20: string_ (STRING) -> string_ STRING 21: string_ (STRING) -> STRING 22: string -> string_ 23: cast (INT) -> INT 24: cast (LIST) -> LIST 25: cast (STRINGTYPE) -> STRINGTYPE 26: cast (BOOL) -> BOOL 27: identifier (IDENTIFIER) -> IDENTIFIER 28: argsExpr -> expression 29: argsExpr (ORDER) -> ORDER opValue 30: args (',') -> args ',' argsExpr 31: args -> argsExpr 32: argsNull -> 33: argsOpt -> args 34: argsOpt -> argsNull 35: defineVar_ -> identifier 36: defineVar -> defineVar_ 37: defineVar ('=') -> defineVar_ '=' syntaxExpression expression 38: globalVars (',') -> globalVars ',' defineVar syntaxCommaOrSemicol 39: globalVars -> defineVar syntaxCommaOrSemicol 40: localVars (',') -> localVars ',' defineVar syntaxCommaOrSemicol 41: localVars -> defineVar syntaxCommaOrSemicol 42: exprUnit_ -> string 43: exprUnit_ (NUMBER) -> NUMBER 44: exprUnit_ -> identifier 45: exprStart_ -> exprUnit_ syntaxExpression 46: expression -> exprStart_ 47: expression ('[') -> '[' argsOpt ']' 48: expression ('[') -> expression '[' expression ']' 49: expression ('(') -> identifier '(' argsOpt ')' 50: expression ('`') -> '`' expression '`' 51: expression ('(') -> '(' expression ')' 52: expression ('!') -> '+' expression 53: expression ('!') -> '-' expression 54: expression ('!') -> '~' expression 55: expression ('!') -> '!' expression 56: expression (INCDEC) -> INCDEC opValue expression 57: expression (INCDEC) -> expression INCDEC opValue 58: expression ('!') -> '(' cast ')' expression 59: expression ('+') -> expression '+' expression 60: expression ('-') -> expression '-' expression 61: expression (MULTIPLY) -> expression MULTIPLY opValue expression 62: expression (SHIFT) -> expression SHIFT opValue expression 63: expression (ORDER) -> expression ORDER opValue expression 64: expression (EQUALITY) -> expression EQUALITY opValue expression 65: expression ('&') -> expression '&' expression 66: expression ('^') -> expression '^' expression 67: expression ('|') -> expression '|' expression 68: expression (AND) -> expression AND expression 69: expression (OR) -> expression OR expression 70: expression ('?') -> expression '?' expression ':' expression 71: expression ('=') -> expression '=' expression 72: expression (MATH_IS) -> expression MATH_IS opValue expression 73: conditionVar_ -> varType defineVar 74: condition -> expression 75: condition -> conditionVar_ 76: optCondition -> condition 77: optCondition -> 78: retExpr_ -> expression 79: retExpr_ -> 80: retLeave_ (RETURN) -> RETURN 81: retLeave_ (EXIT) -> EXIT 82: returnStatement -> retLeave_ syntaxExpression retExpr_ 83: while_ (WHILE) -> WHILE 84: whileStatement ('(') -> while_ '(' syntaxExpression condition syntaxCloseParen closeParenBreakOK statement 85: flowArgs (',') -> flowArgs ',' expression 86: flowArgs -> expression 87: flowInitDefs_ (',') -> flowInitDefs_ ',' defineVar 88: flowInitDefs_ -> defineVar 89: flowInit -> flowArgs 90: flowInit -> varType flowInitDefs_ 91: optInit -> flowInit 92: optInit -> argsNull 93: for_ (FOR) -> FOR 94: forOptInc_ -> flowArgs 95: forOptInc_ -> argsNull 96: forStatement ('(') -> for_ '(' syntaxInit optInit syntaxSemicol ';' syntaxExpression optCondition syntaxSemicol ';' syntaxExpression forOptInc_ syntaxCloseParen closeParenBreakOK statement 97: if_ (IF) -> IF 98: ifElse_ (ELSE) -> ELSE 99: ifStatementElse_ -> ifElse_ statement 100: ifStatementElse_ -> 101: ifCond_ -> condition 102: ifCond_ (';') -> ';' condition 103: ifCond_ (';') -> flowInit ';' condition 104: ifStatement ('(') -> if_ '(' syntaxExpression ifCond_ syntaxCloseParen ')' syntaxExpression statement ifStatementElse_ 105: stBreak_ (BREAK) -> BREAK 106: stContinue_ (CONTINUE) -> CONTINUE 107: stCompound_ -> openCurly statements closeCurly 108: stAlt_ (';') -> stBreak_ ';' 109: stAlt_ (';') -> stContinue_ ';' 110: stAlt_ -> stCompound_ 111: stAlt_ (';') -> ';' 112: stAlt_ (';') -> expression ';' 113: stAlt_ (';') -> returnStatement ';' 114: stAlt_ -> whileStatement 115: stAlt_ -> ifStatement 116: stAlt_ -> forStatement 117: stAlt_ (errTok_) -> errTok_ ';' 118: statement -> stAlt_ 119: statement (';') -> varType localVars ';' 120: statements -> statements statement 121: statements -> 122: fdName_ -> identifier 123: fdParamName_ -> identifier 124: fdParam_ -> varType fdParamName_ syntaxCommaOrCloseparen 125: fdParams_ (',') -> fdParams_ ',' syntaxTypename fdParam_ 126: fdParams_ -> fdParam_ 127: fdOptParams_ -> fdParams_ 128: fdOptParams_ -> 129: fdHead_ ('(') -> fdName_ '(' fdOptParams_ ')' syntaxOpenCurly 130: functionDef -> fdHead_ openCurly statements closeCurly 131: _voidtype (VOID) -> VOID 132: _definition (';') -> varType globalVars ';' 133: _definition -> varType functionDef 134: _definition -> _voidtype functionDef 135: defVarOrFun -> _definition syntaxTypename 136: input_$ -> input Symbolic Terminal tokens: error EOF 292: BOOL 293: BREAK 294: CONTINUE 295: ELSE 296: EXIT 297: FOR 298: IDENTIFIER 299: IF 300: INT 301: LIST 302: NUMBER 303: RETURN 304: STRING 305: STRINGTYPE 306: VOID 307: WHILE 61: '=' 308: MATH_IS 63: '?' 58: ':' 309: OR 310: AND 124: '|' 94: '^' 38: '&' 311: EQUALITY 312: ORDER 313: SHIFT 43: '+' 45: '-' 314: MULTIPLY 33: '!' 126: '~' 315: INCDEC 91: '[' 123: '{' 125: '}' 41: ')' 44: ',' 93: ']' 40: '(' 96: '`' 59: ';' Grammar States: State 0: 136: input_$ -> . input 0: On input to state 1 1: On defVarOrFun to state 2 2: On _definition to state 3 3: On varType to state 4 4: On _voidtype to state 5 5: On varType_ to state 6 6: On VOID to state 7 7: On INT to state 8 8: On STRINGTYPE to state 9 9: On LIST to state 10 State 1: 136: input_$ -> input . 1: input -> input . defVarOrFun 0: On defVarOrFun to state 11 1: On _definition to state 3 2: On varType to state 4 3: On _voidtype to state 5 4: On varType_ to state 6 5: On VOID to state 7 6: On INT to state 8 7: On STRINGTYPE to state 9 8: On LIST to state 10 State 2: 2: input -> defVarOrFun . Reduce by 2: input -> defVarOrFun . State 3: 135: defVarOrFun -> _definition . syntaxTypename 0: On syntaxTypename to state 12 Reduce by 11: syntaxTypename -> . State 4: 132: _definition -> varType . globalVars ';' 133: _definition -> varType . functionDef 0: On globalVars to state 13 1: On functionDef to state 14 2: On defineVar to state 15 3: On fdHead_ to state 16 4: On defineVar_ to state 17 5: On fdName_ to state 18 6: On identifier to state 19 7: On IDENTIFIER to state 20 State 5: 134: _definition -> _voidtype . functionDef 0: On functionDef to state 21 1: On fdHead_ to state 16 2: On fdName_ to state 18 3: On identifier to state 22 4: On IDENTIFIER to state 20 State 6: 19: varType -> varType_ . syntaxIdentifier 0: On syntaxIdentifier to state 23 Reduce by 7: syntaxIdentifier -> . State 7: 131: _voidtype -> VOID . Reduce by 131: _voidtype -> VOID . State 8: 16: varType_ -> INT . Reduce by 16: varType_ -> INT . State 9: 17: varType_ -> STRINGTYPE . Reduce by 17: varType_ -> STRINGTYPE . State 10: 18: varType_ -> LIST . Reduce by 18: varType_ -> LIST . State 11: 1: input -> input defVarOrFun . Reduce by 1: input -> input defVarOrFun . State 12: 135: defVarOrFun -> _definition syntaxTypename . Reduce by 135: defVarOrFun -> _definition syntaxTypename . State 13: 132: _definition -> varType globalVars . ';' 38: globalVars -> globalVars . ',' defineVar syntaxCommaOrSemicol 0: On ';' to state 24 1: On ',' to state 25 State 14: 133: _definition -> varType functionDef . Reduce by 133: _definition -> varType functionDef . State 15: 39: globalVars -> defineVar . syntaxCommaOrSemicol 0: On syntaxCommaOrSemicol to state 26 Reduce by 4: syntaxCommaOrSemicol -> . State 16: 130: functionDef -> fdHead_ . openCurly statements closeCurly 0: On openCurly to state 27 1: On '{' to state 28 State 17: 36: defineVar -> defineVar_ . 37: defineVar -> defineVar_ . '=' syntaxExpression expression 0: On '=' to state 29 Reduce by 36: defineVar -> defineVar_ . State 18: 129: fdHead_ -> fdName_ . '(' fdOptParams_ ')' syntaxOpenCurly 0: On '(' to state 30 State 19: 35: defineVar_ -> identifier . 122: fdName_ -> identifier . Reduce by 35: defineVar_ -> identifier . Reduce by 122: fdName_ -> identifier . State 20: 27: identifier -> IDENTIFIER . Reduce by 27: identifier -> IDENTIFIER . State 21: 134: _definition -> _voidtype functionDef . Reduce by 134: _definition -> _voidtype functionDef . State 22: 122: fdName_ -> identifier . Reduce by 122: fdName_ -> identifier . State 23: 19: varType -> varType_ syntaxIdentifier . Reduce by 19: varType -> varType_ syntaxIdentifier . State 24: 132: _definition -> varType globalVars ';' . Reduce by 132: _definition -> varType globalVars ';' . State 25: 38: globalVars -> globalVars ',' . defineVar syntaxCommaOrSemicol 0: On defineVar to state 31 1: On defineVar_ to state 17 2: On identifier to state 32 3: On IDENTIFIER to state 20 State 26: 39: globalVars -> defineVar syntaxCommaOrSemicol . Reduce by 39: globalVars -> defineVar syntaxCommaOrSemicol . State 27: 130: functionDef -> fdHead_ openCurly . statements closeCurly 0: On statements to state 33 Reduce by 121: statements -> . State 28: 13: openCurly -> '{' . Reduce by 13: openCurly -> '{' . State 29: 37: defineVar -> defineVar_ '=' . syntaxExpression expression 0: On syntaxExpression to state 34 Reduce by 6: syntaxExpression -> . State 30: 129: fdHead_ -> fdName_ '(' . fdOptParams_ ')' syntaxOpenCurly 0: On fdOptParams_ to state 35 1: On fdParams_ to state 36 2: On fdParam_ to state 37 3: On varType to state 38 4: On varType_ to state 6 5: On INT to state 8 6: On STRINGTYPE to state 9 7: On LIST to state 10 Reduce by 128: fdOptParams_ -> . State 31: 38: globalVars -> globalVars ',' defineVar . syntaxCommaOrSemicol 0: On syntaxCommaOrSemicol to state 39 Reduce by 4: syntaxCommaOrSemicol -> . State 32: 35: defineVar_ -> identifier . Reduce by 35: defineVar_ -> identifier . State 33: 130: functionDef -> fdHead_ openCurly statements . closeCurly 120: statements -> statements . statement 0: On closeCurly to state 40 1: On statement to state 41 2: On '}' to state 42 3: On stAlt_ to state 43 4: On varType to state 44 5: On stBreak_ to state 45 6: On stContinue_ to state 46 7: On stCompound_ to state 47 8: On ';' to state 48 9: On expression to state 49 10: On returnStatement to state 50 11: On whileStatement to state 51 12: On ifStatement to state 52 13: On forStatement to state 53 14: On errTok_ to state 54 15: On varType_ to state 6 16: On BREAK to state 55 17: On CONTINUE to state 56 18: On openCurly to state 57 19: On exprStart_ to state 58 20: On '[' to state 59 21: On identifier to state 60 22: On '`' to state 61 23: On '(' to state 62 24: On '+' to state 63 25: On '-' to state 64 26: On '~' to state 65 27: On '!' to state 66 28: On INCDEC to state 67 29: On retLeave_ to state 68 30: On while_ to state 69 31: On if_ to state 70 32: On for_ to state 71 33: On INT to state 8 34: On STRINGTYPE to state 9 35: On LIST to state 10 36: On '{' to state 28 37: On exprUnit_ to state 72 38: On IDENTIFIER to state 20 39: On RETURN to state 73 40: On EXIT to state 74 41: On WHILE to state 75 42: On IF to state 76 43: On FOR to state 77 44: On string to state 78 45: On NUMBER to state 79 46: On string_ to state 80 47: On STRING to state 81 State 34: 37: defineVar -> defineVar_ '=' syntaxExpression . expression 0: On expression to state 82 1: On exprStart_ to state 58 2: On '[' to state 59 3: On identifier to state 60 4: On '`' to state 61 5: On '(' to state 62 6: On '+' to state 63 7: On '-' to state 64 8: On '~' to state 65 9: On '!' to state 66 10: On INCDEC to state 67 11: On exprUnit_ to state 72 12: On IDENTIFIER to state 20 13: On string to state 78 14: On NUMBER to state 79 15: On string_ to state 80 16: On STRING to state 81 State 35: 129: fdHead_ -> fdName_ '(' fdOptParams_ . ')' syntaxOpenCurly 0: On ')' to state 83 State 36: 127: fdOptParams_ -> fdParams_ . 125: fdParams_ -> fdParams_ . ',' syntaxTypename fdParam_ 0: On ',' to state 84 Reduce by 127: fdOptParams_ -> fdParams_ . State 37: 126: fdParams_ -> fdParam_ . Reduce by 126: fdParams_ -> fdParam_ . State 38: 124: fdParam_ -> varType . fdParamName_ syntaxCommaOrCloseparen 0: On fdParamName_ to state 85 1: On identifier to state 86 2: On IDENTIFIER to state 20 State 39: 38: globalVars -> globalVars ',' defineVar syntaxCommaOrSemicol . Reduce by 38: globalVars -> globalVars ',' defineVar syntaxCommaOrSemicol . State 40: 130: functionDef -> fdHead_ openCurly statements closeCurly . Reduce by 130: functionDef -> fdHead_ openCurly statements closeCurly . State 41: 120: statements -> statements statement . Reduce by 120: statements -> statements statement . State 42: 14: closeCurly -> '}' . Reduce by 14: closeCurly -> '}' . State 43: 118: statement -> stAlt_ . Reduce by 118: statement -> stAlt_ . State 44: 119: statement -> varType . localVars ';' 0: On localVars to state 87 1: On defineVar to state 88 2: On defineVar_ to state 17 3: On identifier to state 32 4: On IDENTIFIER to state 20 State 45: 108: stAlt_ -> stBreak_ . ';' 0: On ';' to state 89 State 46: 109: stAlt_ -> stContinue_ . ';' 0: On ';' to state 90 State 47: 110: stAlt_ -> stCompound_ . Reduce by 110: stAlt_ -> stCompound_ . State 48: 111: stAlt_ -> ';' . Reduce by 111: stAlt_ -> ';' . State 49: 112: stAlt_ -> expression . ';' 48: expression -> expression . '[' expression ']' 57: expression -> expression . INCDEC opValue 59: expression -> expression . '+' expression 60: expression -> expression . '-' expression 61: expression -> expression . MULTIPLY opValue expression 62: expression -> expression . SHIFT opValue expression 63: expression -> expression . ORDER opValue expression 64: expression -> expression . EQUALITY opValue expression 65: expression -> expression . '&' expression 66: expression -> expression . '^' expression 67: expression -> expression . '|' expression 68: expression -> expression . AND expression 69: expression -> expression . OR expression 70: expression -> expression . '?' expression ':' expression 71: expression -> expression . '=' expression 72: expression -> expression . MATH_IS opValue expression 0: On ';' to state 91 1: On '[' to state 92 2: On INCDEC to state 93 3: On '+' to state 94 4: On '-' to state 95 5: On MULTIPLY to state 96 6: On SHIFT to state 97 7: On ORDER to state 98 8: On EQUALITY to state 99 9: On '&' to state 100 10: On '^' to state 101 11: On '|' to state 102 12: On AND to state 103 13: On OR to state 104 14: On '?' to state 105 15: On '=' to state 106 16: On MATH_IS to state 107 State 50: 113: stAlt_ -> returnStatement . ';' 0: On ';' to state 108 State 51: 114: stAlt_ -> whileStatement . Reduce by 114: stAlt_ -> whileStatement . State 52: 115: stAlt_ -> ifStatement . Reduce by 115: stAlt_ -> ifStatement . State 53: 116: stAlt_ -> forStatement . Reduce by 116: stAlt_ -> forStatement . State 54: 117: stAlt_ -> errTok_ . ';' 0: On ';' to state 109 State 55: 105: stBreak_ -> BREAK . Reduce by 105: stBreak_ -> BREAK . State 56: 106: stContinue_ -> CONTINUE . Reduce by 106: stContinue_ -> CONTINUE . State 57: 107: stCompound_ -> openCurly . statements closeCurly 0: On statements to state 110 Reduce by 121: statements -> . State 58: 46: expression -> exprStart_ . Reduce by 46: expression -> exprStart_ . State 59: 47: expression -> '[' . argsOpt ']' 0: On argsOpt to state 111 1: On args to state 112 2: On argsNull to state 113 3: On argsExpr to state 114 4: On expression to state 115 5: On ORDER to state 116 6: On exprStart_ to state 58 7: On '[' to state 59 8: On identifier to state 60 9: On '`' to state 61 10: On '(' to state 62 11: On '+' to state 63 12: On '-' to state 64 13: On '~' to state 65 14: On '!' to state 66 15: On INCDEC to state 67 16: On exprUnit_ to state 72 17: On IDENTIFIER to state 20 18: On string to state 78 19: On NUMBER to state 79 20: On string_ to state 80 21: On STRING to state 81 Reduce by 32: argsNull -> . State 60: 49: expression -> identifier . '(' argsOpt ')' 44: exprUnit_ -> identifier . 0: On '(' to state 117 Reduce by 44: exprUnit_ -> identifier . State 61: 50: expression -> '`' . expression '`' 0: On expression to state 118 1: On exprStart_ to state 58 2: On '[' to state 59 3: On identifier to state 60 4: On '`' to state 61 5: On '(' to state 62 6: On '+' to state 63 7: On '-' to state 64 8: On '~' to state 65 9: On '!' to state 66 10: On INCDEC to state 67 11: On exprUnit_ to state 72 12: On IDENTIFIER to state 20 13: On string to state 78 14: On NUMBER to state 79 15: On string_ to state 80 16: On STRING to state 81 State 62: 51: expression -> '(' . expression ')' 58: expression -> '(' . cast ')' expression 0: On expression to state 119 1: On cast to state 120 2: On exprStart_ to state 58 3: On '[' to state 59 4: On identifier to state 60 5: On '`' to state 61 6: On '(' to state 62 7: On '+' to state 63 8: On '-' to state 64 9: On '~' to state 65 10: On '!' to state 66 11: On INCDEC to state 67 12: On INT to state 121 13: On LIST to state 122 14: On STRINGTYPE to state 123 15: On BOOL to state 124 16: On exprUnit_ to state 72 17: On IDENTIFIER to state 20 18: On string to state 78 19: On NUMBER to state 79 20: On string_ to state 80 21: On STRING to state 81 State 63: 52: expression -> '+' . expression 0: On expression to state 125 1: On exprStart_ to state 58 2: On '[' to state 59 3: On identifier to state 60 4: On '`' to state 61 5: On '(' to state 62 6: On '+' to state 63 7: On '-' to state 64 8: On '~' to state 65 9: On '!' to state 66 10: On INCDEC to state 67 11: On exprUnit_ to state 72 12: On IDENTIFIER to state 20 13: On string to state 78 14: On NUMBER to state 79 15: On string_ to state 80 16: On STRING to state 81 State 64: 53: expression -> '-' . expression 0: On expression to state 126 1: On exprStart_ to state 58 2: On '[' to state 59 3: On identifier to state 60 4: On '`' to state 61 5: On '(' to state 62 6: On '+' to state 63 7: On '-' to state 64 8: On '~' to state 65 9: On '!' to state 66 10: On INCDEC to state 67 11: On exprUnit_ to state 72 12: On IDENTIFIER to state 20 13: On string to state 78 14: On NUMBER to state 79 15: On string_ to state 80 16: On STRING to state 81 State 65: 54: expression -> '~' . expression 0: On expression to state 127 1: On exprStart_ to state 58 2: On '[' to state 59 3: On identifier to state 60 4: On '`' to state 61 5: On '(' to state 62 6: On '+' to state 63 7: On '-' to state 64 8: On '~' to state 65 9: On '!' to state 66 10: On INCDEC to state 67 11: On exprUnit_ to state 72 12: On IDENTIFIER to state 20 13: On string to state 78 14: On NUMBER to state 79 15: On string_ to state 80 16: On STRING to state 81 State 66: 55: expression -> '!' . expression 0: On expression to state 128 1: On exprStart_ to state 58 2: On '[' to state 59 3: On identifier to state 60 4: On '`' to state 61 5: On '(' to state 62 6: On '+' to state 63 7: On '-' to state 64 8: On '~' to state 65 9: On '!' to state 66 10: On INCDEC to state 67 11: On exprUnit_ to state 72 12: On IDENTIFIER to state 20 13: On string to state 78 14: On NUMBER to state 79 15: On string_ to state 80 16: On STRING to state 81 State 67: 56: expression -> INCDEC . opValue expression 0: On opValue to state 129 Reduce by 12: opValue -> . State 68: 82: returnStatement -> retLeave_ . syntaxExpression retExpr_ 0: On syntaxExpression to state 130 Reduce by 6: syntaxExpression -> . State 69: 84: whileStatement -> while_ . '(' syntaxExpression condition syntaxCloseParen closeParenBreakOK statement 0: On '(' to state 131 State 70: 104: ifStatement -> if_ . '(' syntaxExpression ifCond_ syntaxCloseParen ')' syntaxExpression statement ifStatementElse_ 0: On '(' to state 132 State 71: 96: forStatement -> for_ . '(' syntaxInit optInit syntaxSemicol ';' syntaxExpression optCondition syntaxSemicol ';' syntaxExpression forOptInc_ syntaxCloseParen closeParenBreakOK statement 0: On '(' to state 133 State 72: 45: exprStart_ -> exprUnit_ . syntaxExpression 0: On syntaxExpression to state 134 Reduce by 6: syntaxExpression -> . State 73: 80: retLeave_ -> RETURN . Reduce by 80: retLeave_ -> RETURN . State 74: 81: retLeave_ -> EXIT . Reduce by 81: retLeave_ -> EXIT . State 75: 83: while_ -> WHILE . Reduce by 83: while_ -> WHILE . State 76: 97: if_ -> IF . Reduce by 97: if_ -> IF . State 77: 93: for_ -> FOR . Reduce by 93: for_ -> FOR . State 78: 42: exprUnit_ -> string . Reduce by 42: exprUnit_ -> string . State 79: 43: exprUnit_ -> NUMBER . Reduce by 43: exprUnit_ -> NUMBER . State 80: 22: string -> string_ . 20: string_ -> string_ . STRING 0: On STRING to state 135 Reduce by 22: string -> string_ . State 81: 21: string_ -> STRING . Reduce by 21: string_ -> STRING . State 82: 37: defineVar -> defineVar_ '=' syntaxExpression expression . 48: expression -> expression . '[' expression ']' 57: expression -> expression . INCDEC opValue 59: expression -> expression . '+' expression 60: expression -> expression . '-' expression 61: expression -> expression . MULTIPLY opValue expression 62: expression -> expression . SHIFT opValue expression 63: expression -> expression . ORDER opValue expression 64: expression -> expression . EQUALITY opValue expression 65: expression -> expression . '&' expression 66: expression -> expression . '^' expression 67: expression -> expression . '|' expression 68: expression -> expression . AND expression 69: expression -> expression . OR expression 70: expression -> expression . '?' expression ':' expression 71: expression -> expression . '=' expression 72: expression -> expression . MATH_IS opValue expression 0: On '[' to state 92 1: On INCDEC to state 93 2: On '+' to state 94 3: On '-' to state 95 4: On MULTIPLY to state 96 5: On SHIFT to state 97 6: On ORDER to state 98 7: On EQUALITY to state 99 8: On '&' to state 100 9: On '^' to state 101 10: On '|' to state 102 11: On AND to state 103 12: On OR to state 104 13: On '?' to state 105 14: On '=' to state 106 15: On MATH_IS to state 107 Reduce by 37: defineVar -> defineVar_ '=' syntaxExpression expression . State 83: 129: fdHead_ -> fdName_ '(' fdOptParams_ ')' . syntaxOpenCurly 0: On syntaxOpenCurly to state 136 Reduce by 9: syntaxOpenCurly -> . State 84: 125: fdParams_ -> fdParams_ ',' . syntaxTypename fdParam_ 0: On syntaxTypename to state 137 Reduce by 11: syntaxTypename -> . State 85: 124: fdParam_ -> varType fdParamName_ . syntaxCommaOrCloseparen 0: On syntaxCommaOrCloseparen to state 138 Reduce by 5: syntaxCommaOrCloseparen -> . State 86: 123: fdParamName_ -> identifier . Reduce by 123: fdParamName_ -> identifier . State 87: 119: statement -> varType localVars . ';' 40: localVars -> localVars . ',' defineVar syntaxCommaOrSemicol 0: On ';' to state 139 1: On ',' to state 140 State 88: 41: localVars -> defineVar . syntaxCommaOrSemicol 0: On syntaxCommaOrSemicol to state 141 Reduce by 4: syntaxCommaOrSemicol -> . State 89: 108: stAlt_ -> stBreak_ ';' . Reduce by 108: stAlt_ -> stBreak_ ';' . State 90: 109: stAlt_ -> stContinue_ ';' . Reduce by 109: stAlt_ -> stContinue_ ';' . State 91: 112: stAlt_ -> expression ';' . Reduce by 112: stAlt_ -> expression ';' . State 92: 48: expression -> expression '[' . expression ']' 0: On expression to state 142 1: On exprStart_ to state 58 2: On '[' to state 59 3: On identifier to state 60 4: On '`' to state 61 5: On '(' to state 62 6: On '+' to state 63 7: On '-' to state 64 8: On '~' to state 65 9: On '!' to state 66 10: On INCDEC to state 67 11: On exprUnit_ to state 72 12: On IDENTIFIER to state 20 13: On string to state 78 14: On NUMBER to state 79 15: On string_ to state 80 16: On STRING to state 81 State 93: 57: expression -> expression INCDEC . opValue 0: On opValue to state 143 Reduce by 12: opValue -> . State 94: 59: expression -> expression '+' . expression 0: On expression to state 144 1: On exprStart_ to state 58 2: On '[' to state 59 3: On identifier to state 60 4: On '`' to state 61 5: On '(' to state 62 6: On '+' to state 63 7: On '-' to state 64 8: On '~' to state 65 9: On '!' to state 66 10: On INCDEC to state 67 11: On exprUnit_ to state 72 12: On IDENTIFIER to state 20 13: On string to state 78 14: On NUMBER to state 79 15: On string_ to state 80 16: On STRING to state 81 State 95: 60: expression -> expression '-' . expression 0: On expression to state 145 1: On exprStart_ to state 58 2: On '[' to state 59 3: On identifier to state 60 4: On '`' to state 61 5: On '(' to state 62 6: On '+' to state 63 7: On '-' to state 64 8: On '~' to state 65 9: On '!' to state 66 10: On INCDEC to state 67 11: On exprUnit_ to state 72 12: On IDENTIFIER to state 20 13: On string to state 78 14: On NUMBER to state 79 15: On string_ to state 80 16: On STRING to state 81 State 96: 61: expression -> expression MULTIPLY . opValue expression 0: On opValue to state 146 Reduce by 12: opValue -> . State 97: 62: expression -> expression SHIFT . opValue expression 0: On opValue to state 147 Reduce by 12: opValue -> . State 98: 63: expression -> expression ORDER . opValue expression 0: On opValue to state 148 Reduce by 12: opValue -> . State 99: 64: expression -> expression EQUALITY . opValue expression 0: On opValue to state 149 Reduce by 12: opValue -> . State 100: 65: expression -> expression '&' . expression 0: On expression to state 150 1: On exprStart_ to state 58 2: On '[' to state 59 3: On identifier to state 60 4: On '`' to state 61 5: On '(' to state 62 6: On '+' to state 63 7: On '-' to state 64 8: On '~' to state 65 9: On '!' to state 66 10: On INCDEC to state 67 11: On exprUnit_ to state 72 12: On IDENTIFIER to state 20 13: On string to state 78 14: On NUMBER to state 79 15: On string_ to state 80 16: On STRING to state 81 State 101: 66: expression -> expression '^' . expression 0: On expression to state 151 1: On exprStart_ to state 58 2: On '[' to state 59 3: On identifier to state 60 4: On '`' to state 61 5: On '(' to state 62 6: On '+' to state 63 7: On '-' to state 64 8: On '~' to state 65 9: On '!' to state 66 10: On INCDEC to state 67 11: On exprUnit_ to state 72 12: On IDENTIFIER to state 20 13: On string to state 78 14: On NUMBER to state 79 15: On string_ to state 80 16: On STRING to state 81 State 102: 67: expression -> expression '|' . expression 0: On expression to state 152 1: On exprStart_ to state 58 2: On '[' to state 59 3: On identifier to state 60 4: On '`' to state 61 5: On '(' to state 62 6: On '+' to state 63 7: On '-' to state 64 8: On '~' to state 65 9: On '!' to state 66 10: On INCDEC to state 67 11: On exprUnit_ to state 72 12: On IDENTIFIER to state 20 13: On string to state 78 14: On NUMBER to state 79 15: On string_ to state 80 16: On STRING to state 81 State 103: 68: expression -> expression AND . expression 0: On expression to state 153 1: On exprStart_ to state 58 2: On '[' to state 59 3: On identifier to state 60 4: On '`' to state 61 5: On '(' to state 62 6: On '+' to state 63 7: On '-' to state 64 8: On '~' to state 65 9: On '!' to state 66 10: On INCDEC to state 67 11: On exprUnit_ to state 72 12: On IDENTIFIER to state 20 13: On string to state 78 14: On NUMBER to state 79 15: On string_ to state 80 16: On STRING to state 81 State 104: 69: expression -> expression OR . expression 0: On expression to state 154 1: On exprStart_ to state 58 2: On '[' to state 59 3: On identifier to state 60 4: On '`' to state 61 5: On '(' to state 62 6: On '+' to state 63 7: On '-' to state 64 8: On '~' to state 65 9: On '!' to state 66 10: On INCDEC to state 67 11: On exprUnit_ to state 72 12: On IDENTIFIER to state 20 13: On string to state 78 14: On NUMBER to state 79 15: On string_ to state 80 16: On STRING to state 81 State 105: 70: expression -> expression '?' . expression ':' expression 0: On expression to state 155 1: On exprStart_ to state 58 2: On '[' to state 59 3: On identifier to state 60 4: On '`' to state 61 5: On '(' to state 62 6: On '+' to state 63 7: On '-' to state 64 8: On '~' to state 65 9: On '!' to state 66 10: On INCDEC to state 67 11: On exprUnit_ to state 72 12: On IDENTIFIER to state 20 13: On string to state 78 14: On NUMBER to state 79 15: On string_ to state 80 16: On STRING to state 81 State 106: 71: expression -> expression '=' . expression 0: On expression to state 156 1: On exprStart_ to state 58 2: On '[' to state 59 3: On identifier to state 60 4: On '`' to state 61 5: On '(' to state 62 6: On '+' to state 63 7: On '-' to state 64 8: On '~' to state 65 9: On '!' to state 66 10: On INCDEC to state 67 11: On exprUnit_ to state 72 12: On IDENTIFIER to state 20 13: On string to state 78 14: On NUMBER to state 79 15: On string_ to state 80 16: On STRING to state 81 State 107: 72: expression -> expression MATH_IS . opValue expression 0: On opValue to state 157 Reduce by 12: opValue -> . State 108: 113: stAlt_ -> returnStatement ';' . Reduce by 113: stAlt_ -> returnStatement ';' . State 109: 117: stAlt_ -> errTok_ ';' . Reduce by 117: stAlt_ -> errTok_ ';' . State 110: 107: stCompound_ -> openCurly statements . closeCurly 120: statements -> statements . statement 0: On closeCurly to state 158 1: On statement to state 41 2: On '}' to state 42 3: On stAlt_ to state 43 4: On varType to state 44 5: On stBreak_ to state 45 6: On stContinue_ to state 46 7: On stCompound_ to state 47 8: On ';' to state 48 9: On expression to state 49 10: On returnStatement to state 50 11: On whileStatement to state 51 12: On ifStatement to state 52 13: On forStatement to state 53 14: On errTok_ to state 54 15: On varType_ to state 6 16: On BREAK to state 55 17: On CONTINUE to state 56 18: On openCurly to state 57 19: On exprStart_ to state 58 20: On '[' to state 59 21: On identifier to state 60 22: On '`' to state 61 23: On '(' to state 62 24: On '+' to state 63 25: On '-' to state 64 26: On '~' to state 65 27: On '!' to state 66 28: On INCDEC to state 67 29: On retLeave_ to state 68 30: On while_ to state 69 31: On if_ to state 70 32: On for_ to state 71 33: On INT to state 8 34: On STRINGTYPE to state 9 35: On LIST to state 10 36: On '{' to state 28 37: On exprUnit_ to state 72 38: On IDENTIFIER to state 20 39: On RETURN to state 73 40: On EXIT to state 74 41: On WHILE to state 75 42: On IF to state 76 43: On FOR to state 77 44: On string to state 78 45: On NUMBER to state 79 46: On string_ to state 80 47: On STRING to state 81 State 111: 47: expression -> '[' argsOpt . ']' 0: On ']' to state 159 State 112: 33: argsOpt -> args . 30: args -> args . ',' argsExpr 0: On ',' to state 160 Reduce by 33: argsOpt -> args . State 113: 34: argsOpt -> argsNull . Reduce by 34: argsOpt -> argsNull . State 114: 31: args -> argsExpr . Reduce by 31: args -> argsExpr . State 115: 28: argsExpr -> expression . 48: expression -> expression . '[' expression ']' 57: expression -> expression . INCDEC opValue 59: expression -> expression . '+' expression 60: expression -> expression . '-' expression 61: expression -> expression . MULTIPLY opValue expression 62: expression -> expression . SHIFT opValue expression 63: expression -> expression . ORDER opValue expression 64: expression -> expression . EQUALITY opValue expression 65: expression -> expression . '&' expression 66: expression -> expression . '^' expression 67: expression -> expression . '|' expression 68: expression -> expression . AND expression 69: expression -> expression . OR expression 70: expression -> expression . '?' expression ':' expression 71: expression -> expression . '=' expression 72: expression -> expression . MATH_IS opValue expression 0: On '[' to state 92 1: On INCDEC to state 93 2: On '+' to state 94 3: On '-' to state 95 4: On MULTIPLY to state 96 5: On SHIFT to state 97 6: On ORDER to state 98 7: On EQUALITY to state 99 8: On '&' to state 100 9: On '^' to state 101 10: On '|' to state 102 11: On AND to state 103 12: On OR to state 104 13: On '?' to state 105 14: On '=' to state 106 15: On MATH_IS to state 107 Reduce by 28: argsExpr -> expression . State 116: 29: argsExpr -> ORDER . opValue 0: On opValue to state 161 Reduce by 12: opValue -> . State 117: 49: expression -> identifier '(' . argsOpt ')' 0: On argsOpt to state 162 1: On args to state 112 2: On argsNull to state 113 3: On argsExpr to state 114 4: On expression to state 115 5: On ORDER to state 116 6: On exprStart_ to state 58 7: On '[' to state 59 8: On identifier to state 60 9: On '`' to state 61 10: On '(' to state 62 11: On '+' to state 63 12: On '-' to state 64 13: On '~' to state 65 14: On '!' to state 66 15: On INCDEC to state 67 16: On exprUnit_ to state 72 17: On IDENTIFIER to state 20 18: On string to state 78 19: On NUMBER to state 79 20: On string_ to state 80 21: On STRING to state 81 Reduce by 32: argsNull -> . State 118: 50: expression -> '`' expression . '`' 48: expression -> expression . '[' expression ']' 57: expression -> expression . INCDEC opValue 59: expression -> expression . '+' expression 60: expression -> expression . '-' expression 61: expression -> expression . MULTIPLY opValue expression 62: expression -> expression . SHIFT opValue expression 63: expression -> expression . ORDER opValue expression 64: expression -> expression . EQUALITY opValue expression 65: expression -> expression . '&' expression 66: expression -> expression . '^' expression 67: expression -> expression . '|' expression 68: expression -> expression . AND expression 69: expression -> expression . OR expression 70: expression -> expression . '?' expression ':' expression 71: expression -> expression . '=' expression 72: expression -> expression . MATH_IS opValue expression 0: On '`' to state 163 1: On '[' to state 92 2: On INCDEC to state 93 3: On '+' to state 94 4: On '-' to state 95 5: On MULTIPLY to state 96 6: On SHIFT to state 97 7: On ORDER to state 98 8: On EQUALITY to state 99 9: On '&' to state 100 10: On '^' to state 101 11: On '|' to state 102 12: On AND to state 103 13: On OR to state 104 14: On '?' to state 105 15: On '=' to state 106 16: On MATH_IS to state 107 State 119: 51: expression -> '(' expression . ')' 48: expression -> expression . '[' expression ']' 57: expression -> expression . INCDEC opValue 59: expression -> expression . '+' expression 60: expression -> expression . '-' expression 61: expression -> expression . MULTIPLY opValue expression 62: expression -> expression . SHIFT opValue expression 63: expression -> expression . ORDER opValue expression 64: expression -> expression . EQUALITY opValue expression 65: expression -> expression . '&' expression 66: expression -> expression . '^' expression 67: expression -> expression . '|' expression 68: expression -> expression . AND expression 69: expression -> expression . OR expression 70: expression -> expression . '?' expression ':' expression 71: expression -> expression . '=' expression 72: expression -> expression . MATH_IS opValue expression 0: On ')' to state 164 1: On '[' to state 92 2: On INCDEC to state 93 3: On '+' to state 94 4: On '-' to state 95 5: On MULTIPLY to state 96 6: On SHIFT to state 97 7: On ORDER to state 98 8: On EQUALITY to state 99 9: On '&' to state 100 10: On '^' to state 101 11: On '|' to state 102 12: On AND to state 103 13: On OR to state 104 14: On '?' to state 105 15: On '=' to state 106 16: On MATH_IS to state 107 State 120: 58: expression -> '(' cast . ')' expression 0: On ')' to state 165 State 121: 23: cast -> INT . Reduce by 23: cast -> INT . State 122: 24: cast -> LIST . Reduce by 24: cast -> LIST . State 123: 25: cast -> STRINGTYPE . Reduce by 25: cast -> STRINGTYPE . State 124: 26: cast -> BOOL . Reduce by 26: cast -> BOOL . State 125: 52: expression -> '+' expression . 48: expression -> expression . '[' expression ']' 57: expression -> expression . INCDEC opValue 59: expression -> expression . '+' expression 60: expression -> expression . '-' expression 61: expression -> expression . MULTIPLY opValue expression 62: expression -> expression . SHIFT opValue expression 63: expression -> expression . ORDER opValue expression 64: expression -> expression . EQUALITY opValue expression 65: expression -> expression . '&' expression 66: expression -> expression . '^' expression 67: expression -> expression . '|' expression 68: expression -> expression . AND expression 69: expression -> expression . OR expression 70: expression -> expression . '?' expression ':' expression 71: expression -> expression . '=' expression 72: expression -> expression . MATH_IS opValue expression 0: On '[' to state 92 1: On INCDEC to state 93 2 (removed by precedence): On '+' to state 94 3 (removed by precedence): On '-' to state 95 4 (removed by precedence): On MULTIPLY to state 96 5 (removed by precedence): On SHIFT to state 97 6 (removed by precedence): On ORDER to state 98 7 (removed by precedence): On EQUALITY to state 99 8 (removed by precedence): On '&' to state 100 9 (removed by precedence): On '^' to state 101 10 (removed by precedence): On '|' to state 102 11 (removed by precedence): On AND to state 103 12 (removed by precedence): On OR to state 104 13 (removed by precedence): On '?' to state 105 14 (removed by precedence): On '=' to state 106 15 (removed by precedence): On MATH_IS to state 107 Reduce by 52: expression -> '+' expression . State 126: 53: expression -> '-' expression . 48: expression -> expression . '[' expression ']' 57: expression -> expression . INCDEC opValue 59: expression -> expression . '+' expression 60: expression -> expression . '-' expression 61: expression -> expression . MULTIPLY opValue expression 62: expression -> expression . SHIFT opValue expression 63: expression -> expression . ORDER opValue expression 64: expression -> expression . EQUALITY opValue expression 65: expression -> expression . '&' expression 66: expression -> expression . '^' expression 67: expression -> expression . '|' expression 68: expression -> expression . AND expression 69: expression -> expression . OR expression 70: expression -> expression . '?' expression ':' expression 71: expression -> expression . '=' expression 72: expression -> expression . MATH_IS opValue expression 0: On '[' to state 92 1: On INCDEC to state 93 2 (removed by precedence): On '+' to state 94 3 (removed by precedence): On '-' to state 95 4 (removed by precedence): On MULTIPLY to state 96 5 (removed by precedence): On SHIFT to state 97 6 (removed by precedence): On ORDER to state 98 7 (removed by precedence): On EQUALITY to state 99 8 (removed by precedence): On '&' to state 100 9 (removed by precedence): On '^' to state 101 10 (removed by precedence): On '|' to state 102 11 (removed by precedence): On AND to state 103 12 (removed by precedence): On OR to state 104 13 (removed by precedence): On '?' to state 105 14 (removed by precedence): On '=' to state 106 15 (removed by precedence): On MATH_IS to state 107 Reduce by 53: expression -> '-' expression . State 127: 54: expression -> '~' expression . 48: expression -> expression . '[' expression ']' 57: expression -> expression . INCDEC opValue 59: expression -> expression . '+' expression 60: expression -> expression . '-' expression 61: expression -> expression . MULTIPLY opValue expression 62: expression -> expression . SHIFT opValue expression 63: expression -> expression . ORDER opValue expression 64: expression -> expression . EQUALITY opValue expression 65: expression -> expression . '&' expression 66: expression -> expression . '^' expression 67: expression -> expression . '|' expression 68: expression -> expression . AND expression 69: expression -> expression . OR expression 70: expression -> expression . '?' expression ':' expression 71: expression -> expression . '=' expression 72: expression -> expression . MATH_IS opValue expression 0: On '[' to state 92 1: On INCDEC to state 93 2 (removed by precedence): On '+' to state 94 3 (removed by precedence): On '-' to state 95 4 (removed by precedence): On MULTIPLY to state 96 5 (removed by precedence): On SHIFT to state 97 6 (removed by precedence): On ORDER to state 98 7 (removed by precedence): On EQUALITY to state 99 8 (removed by precedence): On '&' to state 100 9 (removed by precedence): On '^' to state 101 10 (removed by precedence): On '|' to state 102 11 (removed by precedence): On AND to state 103 12 (removed by precedence): On OR to state 104 13 (removed by precedence): On '?' to state 105 14 (removed by precedence): On '=' to state 106 15 (removed by precedence): On MATH_IS to state 107 Reduce by 54: expression -> '~' expression . State 128: 55: expression -> '!' expression . 48: expression -> expression . '[' expression ']' 57: expression -> expression . INCDEC opValue 59: expression -> expression . '+' expression 60: expression -> expression . '-' expression 61: expression -> expression . MULTIPLY opValue expression 62: expression -> expression . SHIFT opValue expression 63: expression -> expression . ORDER opValue expression 64: expression -> expression . EQUALITY opValue expression 65: expression -> expression . '&' expression 66: expression -> expression . '^' expression 67: expression -> expression . '|' expression 68: expression -> expression . AND expression 69: expression -> expression . OR expression 70: expression -> expression . '?' expression ':' expression 71: expression -> expression . '=' expression 72: expression -> expression . MATH_IS opValue expression 0: On '[' to state 92 1: On INCDEC to state 93 2 (removed by precedence): On '+' to state 94 3 (removed by precedence): On '-' to state 95 4 (removed by precedence): On MULTIPLY to state 96 5 (removed by precedence): On SHIFT to state 97 6 (removed by precedence): On ORDER to state 98 7 (removed by precedence): On EQUALITY to state 99 8 (removed by precedence): On '&' to state 100 9 (removed by precedence): On '^' to state 101 10 (removed by precedence): On '|' to state 102 11 (removed by precedence): On AND to state 103 12 (removed by precedence): On OR to state 104 13 (removed by precedence): On '?' to state 105 14 (removed by precedence): On '=' to state 106 15 (removed by precedence): On MATH_IS to state 107 Reduce by 55: expression -> '!' expression . State 129: 56: expression -> INCDEC opValue . expression 0: On expression to state 166 1: On exprStart_ to state 58 2: On '[' to state 59 3: On identifier to state 60 4: On '`' to state 61 5: On '(' to state 62 6: On '+' to state 63 7: On '-' to state 64 8: On '~' to state 65 9: On '!' to state 66 10: On INCDEC to state 67 11: On exprUnit_ to state 72 12: On IDENTIFIER to state 20 13: On string to state 78 14: On NUMBER to state 79 15: On string_ to state 80 16: On STRING to state 81 State 130: 82: returnStatement -> retLeave_ syntaxExpression . retExpr_ 0: On retExpr_ to state 167 1: On expression to state 168 2: On exprStart_ to state 58 3: On '[' to state 59 4: On identifier to state 60 5: On '`' to state 61 6: On '(' to state 62 7: On '+' to state 63 8: On '-' to state 64 9: On '~' to state 65 10: On '!' to state 66 11: On INCDEC to state 67 12: On exprUnit_ to state 72 13: On IDENTIFIER to state 20 14: On string to state 78 15: On NUMBER to state 79 16: On string_ to state 80 17: On STRING to state 81 Reduce by 79: retExpr_ -> . State 131: 84: whileStatement -> while_ '(' . syntaxExpression condition syntaxCloseParen closeParenBreakOK statement 0: On syntaxExpression to state 169 Reduce by 6: syntaxExpression -> . State 132: 104: ifStatement -> if_ '(' . syntaxExpression ifCond_ syntaxCloseParen ')' syntaxExpression statement ifStatementElse_ 0: On syntaxExpression to state 170 Reduce by 6: syntaxExpression -> . State 133: 96: forStatement -> for_ '(' . syntaxInit optInit syntaxSemicol ';' syntaxExpression optCondition syntaxSemicol ';' syntaxExpression forOptInc_ syntaxCloseParen closeParenBreakOK statement 0: On syntaxInit to state 171 Reduce by 8: syntaxInit -> . State 134: 45: exprStart_ -> exprUnit_ syntaxExpression . Reduce by 45: exprStart_ -> exprUnit_ syntaxExpression . State 135: 20: string_ -> string_ STRING . Reduce by 20: string_ -> string_ STRING . State 136: 129: fdHead_ -> fdName_ '(' fdOptParams_ ')' syntaxOpenCurly . Reduce by 129: fdHead_ -> fdName_ '(' fdOptParams_ ')' syntaxOpenCurly . State 137: 125: fdParams_ -> fdParams_ ',' syntaxTypename . fdParam_ 0: On fdParam_ to state 172 1: On varType to state 38 2: On varType_ to state 6 3: On INT to state 8 4: On STRINGTYPE to state 9 5: On LIST to state 10 State 138: 124: fdParam_ -> varType fdParamName_ syntaxCommaOrCloseparen . Reduce by 124: fdParam_ -> varType fdParamName_ syntaxCommaOrCloseparen . State 139: 119: statement -> varType localVars ';' . Reduce by 119: statement -> varType localVars ';' . State 140: 40: localVars -> localVars ',' . defineVar syntaxCommaOrSemicol 0: On defineVar to state 173 1: On defineVar_ to state 17 2: On identifier to state 32 3: On IDENTIFIER to state 20 State 141: 41: localVars -> defineVar syntaxCommaOrSemicol . Reduce by 41: localVars -> defineVar syntaxCommaOrSemicol . State 142: 48: expression -> expression '[' expression . ']' 48: expression -> expression . '[' expression ']' 57: expression -> expression . INCDEC opValue 59: expression -> expression . '+' expression 60: expression -> expression . '-' expression 61: expression -> expression . MULTIPLY opValue expression 62: expression -> expression . SHIFT opValue expression 63: expression -> expression . ORDER opValue expression 64: expression -> expression . EQUALITY opValue expression 65: expression -> expression . '&' expression 66: expression -> expression . '^' expression 67: expression -> expression . '|' expression 68: expression -> expression . AND expression 69: expression -> expression . OR expression 70: expression -> expression . '?' expression ':' expression 71: expression -> expression . '=' expression 72: expression -> expression . MATH_IS opValue expression 0: On ']' to state 174 1: On '[' to state 92 2: On INCDEC to state 93 3: On '+' to state 94 4: On '-' to state 95 5: On MULTIPLY to state 96 6: On SHIFT to state 97 7: On ORDER to state 98 8: On EQUALITY to state 99 9: On '&' to state 100 10: On '^' to state 101 11: On '|' to state 102 12: On AND to state 103 13: On OR to state 104 14: On '?' to state 105 15: On '=' to state 106 16: On MATH_IS to state 107 State 143: 57: expression -> expression INCDEC opValue . Reduce by 57: expression -> expression INCDEC opValue . State 144: 59: expression -> expression '+' expression . 48: expression -> expression . '[' expression ']' 57: expression -> expression . INCDEC opValue 59: expression -> expression . '+' expression 60: expression -> expression . '-' expression 61: expression -> expression . MULTIPLY opValue expression 62: expression -> expression . SHIFT opValue expression 63: expression -> expression . ORDER opValue expression 64: expression -> expression . EQUALITY opValue expression 65: expression -> expression . '&' expression 66: expression -> expression . '^' expression 67: expression -> expression . '|' expression 68: expression -> expression . AND expression 69: expression -> expression . OR expression 70: expression -> expression . '?' expression ':' expression 71: expression -> expression . '=' expression 72: expression -> expression . MATH_IS opValue expression 0: On '[' to state 92 1: On INCDEC to state 93 2 (removed by precedence): On '+' to state 94 3 (removed by precedence): On '-' to state 95 4: On MULTIPLY to state 96 5 (removed by precedence): On SHIFT to state 97 6 (removed by precedence): On ORDER to state 98 7 (removed by precedence): On EQUALITY to state 99 8 (removed by precedence): On '&' to state 100 9 (removed by precedence): On '^' to state 101 10 (removed by precedence): On '|' to state 102 11 (removed by precedence): On AND to state 103 12 (removed by precedence): On OR to state 104 13 (removed by precedence): On '?' to state 105 14 (removed by precedence): On '=' to state 106 15 (removed by precedence): On MATH_IS to state 107 Reduce by 59: expression -> expression '+' expression . State 145: 60: expression -> expression '-' expression . 48: expression -> expression . '[' expression ']' 57: expression -> expression . INCDEC opValue 59: expression -> expression . '+' expression 60: expression -> expression . '-' expression 61: expression -> expression . MULTIPLY opValue expression 62: expression -> expression . SHIFT opValue expression 63: expression -> expression . ORDER opValue expression 64: expression -> expression . EQUALITY opValue expression 65: expression -> expression . '&' expression 66: expression -> expression . '^' expression 67: expression -> expression . '|' expression 68: expression -> expression . AND expression 69: expression -> expression . OR expression 70: expression -> expression . '?' expression ':' expression 71: expression -> expression . '=' expression 72: expression -> expression . MATH_IS opValue expression 0: On '[' to state 92 1: On INCDEC to state 93 2 (removed by precedence): On '+' to state 94 3 (removed by precedence): On '-' to state 95 4: On MULTIPLY to state 96 5 (removed by precedence): On SHIFT to state 97 6 (removed by precedence): On ORDER to state 98 7 (removed by precedence): On EQUALITY to state 99 8 (removed by precedence): On '&' to state 100 9 (removed by precedence): On '^' to state 101 10 (removed by precedence): On '|' to state 102 11 (removed by precedence): On AND to state 103 12 (removed by precedence): On OR to state 104 13 (removed by precedence): On '?' to state 105 14 (removed by precedence): On '=' to state 106 15 (removed by precedence): On MATH_IS to state 107 Reduce by 60: expression -> expression '-' expression . State 146: 61: expression -> expression MULTIPLY opValue . expression 0: On expression to state 175 1: On exprStart_ to state 58 2: On '[' to state 59 3: On identifier to state 60 4: On '`' to state 61 5: On '(' to state 62 6: On '+' to state 63 7: On '-' to state 64 8: On '~' to state 65 9: On '!' to state 66 10: On INCDEC to state 67 11: On exprUnit_ to state 72 12: On IDENTIFIER to state 20 13: On string to state 78 14: On NUMBER to state 79 15: On string_ to state 80 16: On STRING to state 81 State 147: 62: expression -> expression SHIFT opValue . expression 0: On expression to state 176 1: On exprStart_ to state 58 2: On '[' to state 59 3: On identifier to state 60 4: On '`' to state 61 5: On '(' to state 62 6: On '+' to state 63 7: On '-' to state 64 8: On '~' to state 65 9: On '!' to state 66 10: On INCDEC to state 67 11: On exprUnit_ to state 72 12: On IDENTIFIER to state 20 13: On string to state 78 14: On NUMBER to state 79 15: On string_ to state 80 16: On STRING to state 81 State 148: 63: expression -> expression ORDER opValue . expression 0: On expression to state 177 1: On exprStart_ to state 58 2: On '[' to state 59 3: On identifier to state 60 4: On '`' to state 61 5: On '(' to state 62 6: On '+' to state 63 7: On '-' to state 64 8: On '~' to state 65 9: On '!' to state 66 10: On INCDEC to state 67 11: On exprUnit_ to state 72 12: On IDENTIFIER to state 20 13: On string to state 78 14: On NUMBER to state 79 15: On string_ to state 80 16: On STRING to state 81 State 149: 64: expression -> expression EQUALITY opValue . expression 0: On expression to state 178 1: On exprStart_ to state 58 2: On '[' to state 59 3: On identifier to state 60 4: On '`' to state 61 5: On '(' to state 62 6: On '+' to state 63 7: On '-' to state 64 8: On '~' to state 65 9: On '!' to state 66 10: On INCDEC to state 67 11: On exprUnit_ to state 72 12: On IDENTIFIER to state 20 13: On string to state 78 14: On NUMBER to state 79 15: On string_ to state 80 16: On STRING to state 81 State 150: 65: expression -> expression '&' expression . 48: expression -> expression . '[' expression ']' 57: expression -> expression . INCDEC opValue 59: expression -> expression . '+' expression 60: expression -> expression . '-' expression 61: expression -> expression . MULTIPLY opValue expression 62: expression -> expression . SHIFT opValue expression 63: expression -> expression . ORDER opValue expression 64: expression -> expression . EQUALITY opValue expression 65: expression -> expression . '&' expression 66: expression -> expression . '^' expression 67: expression -> expression . '|' expression 68: expression -> expression . AND expression 69: expression -> expression . OR expression 70: expression -> expression . '?' expression ':' expression 71: expression -> expression . '=' expression 72: expression -> expression . MATH_IS opValue expression 0: On '[' to state 92 1: On INCDEC to state 93 2: On '+' to state 94 3: On '-' to state 95 4: On MULTIPLY to state 96 5: On SHIFT to state 97 6: On ORDER to state 98 7: On EQUALITY to state 99 8 (removed by precedence): On '&' to state 100 9 (removed by precedence): On '^' to state 101 10 (removed by precedence): On '|' to state 102 11 (removed by precedence): On AND to state 103 12 (removed by precedence): On OR to state 104 13 (removed by precedence): On '?' to state 105 14 (removed by precedence): On '=' to state 106 15 (removed by precedence): On MATH_IS to state 107 Reduce by 65: expression -> expression '&' expression . State 151: 66: expression -> expression '^' expression . 48: expression -> expression . '[' expression ']' 57: expression -> expression . INCDEC opValue 59: expression -> expression . '+' expression 60: expression -> expression . '-' expression 61: expression -> expression . MULTIPLY opValue expression 62: expression -> expression . SHIFT opValue expression 63: expression -> expression . ORDER opValue expression 64: expression -> expression . EQUALITY opValue expression 65: expression -> expression . '&' expression 66: expression -> expression . '^' expression 67: expression -> expression . '|' expression 68: expression -> expression . AND expression 69: expression -> expression . OR expression 70: expression -> expression . '?' expression ':' expression 71: expression -> expression . '=' expression 72: expression -> expression . MATH_IS opValue expression 0: On '[' to state 92 1: On INCDEC to state 93 2: On '+' to state 94 3: On '-' to state 95 4: On MULTIPLY to state 96 5: On SHIFT to state 97 6: On ORDER to state 98 7: On EQUALITY to state 99 8: On '&' to state 100 9 (removed by precedence): On '^' to state 101 10 (removed by precedence): On '|' to state 102 11 (removed by precedence): On AND to state 103 12 (removed by precedence): On OR to state 104 13 (removed by precedence): On '?' to state 105 14 (removed by precedence): On '=' to state 106 15 (removed by precedence): On MATH_IS to state 107 Reduce by 66: expression -> expression '^' expression . State 152: 67: expression -> expression '|' expression . 48: expression -> expression . '[' expression ']' 57: expression -> expression . INCDEC opValue 59: expression -> expression . '+' expression 60: expression -> expression . '-' expression 61: expression -> expression . MULTIPLY opValue expression 62: expression -> expression . SHIFT opValue expression 63: expression -> expression . ORDER opValue expression 64: expression -> expression . EQUALITY opValue expression 65: expression -> expression . '&' expression 66: expression -> expression . '^' expression 67: expression -> expression . '|' expression 68: expression -> expression . AND expression 69: expression -> expression . OR expression 70: expression -> expression . '?' expression ':' expression 71: expression -> expression . '=' expression 72: expression -> expression . MATH_IS opValue expression 0: On '[' to state 92 1: On INCDEC to state 93 2: On '+' to state 94 3: On '-' to state 95 4: On MULTIPLY to state 96 5: On SHIFT to state 97 6: On ORDER to state 98 7: On EQUALITY to state 99 8: On '&' to state 100 9: On '^' to state 101 10 (removed by precedence): On '|' to state 102 11 (removed by precedence): On AND to state 103 12 (removed by precedence): On OR to state 104 13 (removed by precedence): On '?' to state 105 14 (removed by precedence): On '=' to state 106 15 (removed by precedence): On MATH_IS to state 107 Reduce by 67: expression -> expression '|' expression . State 153: 68: expression -> expression AND expression . 48: expression -> expression . '[' expression ']' 57: expression -> expression . INCDEC opValue 59: expression -> expression . '+' expression 60: expression -> expression . '-' expression 61: expression -> expression . MULTIPLY opValue expression 62: expression -> expression . SHIFT opValue expression 63: expression -> expression . ORDER opValue expression 64: expression -> expression . EQUALITY opValue expression 65: expression -> expression . '&' expression 66: expression -> expression . '^' expression 67: expression -> expression . '|' expression 68: expression -> expression . AND expression 69: expression -> expression . OR expression 70: expression -> expression . '?' expression ':' expression 71: expression -> expression . '=' expression 72: expression -> expression . MATH_IS opValue expression 0: On '[' to state 92 1: On INCDEC to state 93 2: On '+' to state 94 3: On '-' to state 95 4: On MULTIPLY to state 96 5: On SHIFT to state 97 6: On ORDER to state 98 7: On EQUALITY to state 99 8: On '&' to state 100 9: On '^' to state 101 10: On '|' to state 102 11 (removed by precedence): On AND to state 103 12 (removed by precedence): On OR to state 104 13 (removed by precedence): On '?' to state 105 14 (removed by precedence): On '=' to state 106 15 (removed by precedence): On MATH_IS to state 107 Reduce by 68: expression -> expression AND expression . State 154: 69: expression -> expression OR expression . 48: expression -> expression . '[' expression ']' 57: expression -> expression . INCDEC opValue 59: expression -> expression . '+' expression 60: expression -> expression . '-' expression 61: expression -> expression . MULTIPLY opValue expression 62: expression -> expression . SHIFT opValue expression 63: expression -> expression . ORDER opValue expression 64: expression -> expression . EQUALITY opValue expression 65: expression -> expression . '&' expression 66: expression -> expression . '^' expression 67: expression -> expression . '|' expression 68: expression -> expression . AND expression 69: expression -> expression . OR expression 70: expression -> expression . '?' expression ':' expression 71: expression -> expression . '=' expression 72: expression -> expression . MATH_IS opValue expression 0: On '[' to state 92 1: On INCDEC to state 93 2: On '+' to state 94 3: On '-' to state 95 4: On MULTIPLY to state 96 5: On SHIFT to state 97 6: On ORDER to state 98 7: On EQUALITY to state 99 8: On '&' to state 100 9: On '^' to state 101 10: On '|' to state 102 11: On AND to state 103 12 (removed by precedence): On OR to state 104 13 (removed by precedence): On '?' to state 105 14 (removed by precedence): On '=' to state 106 15 (removed by precedence): On MATH_IS to state 107 Reduce by 69: expression -> expression OR expression . State 155: 70: expression -> expression '?' expression . ':' expression 48: expression -> expression . '[' expression ']' 57: expression -> expression . INCDEC opValue 59: expression -> expression . '+' expression 60: expression -> expression . '-' expression 61: expression -> expression . MULTIPLY opValue expression 62: expression -> expression . SHIFT opValue expression 63: expression -> expression . ORDER opValue expression 64: expression -> expression . EQUALITY opValue expression 65: expression -> expression . '&' expression 66: expression -> expression . '^' expression 67: expression -> expression . '|' expression 68: expression -> expression . AND expression 69: expression -> expression . OR expression 70: expression -> expression . '?' expression ':' expression 71: expression -> expression . '=' expression 72: expression -> expression . MATH_IS opValue expression 0: On ':' to state 179 1: On '[' to state 92 2: On INCDEC to state 93 3: On '+' to state 94 4: On '-' to state 95 5: On MULTIPLY to state 96 6: On SHIFT to state 97 7: On ORDER to state 98 8: On EQUALITY to state 99 9: On '&' to state 100 10: On '^' to state 101 11: On '|' to state 102 12: On AND to state 103 13: On OR to state 104 14: On '?' to state 105 15: On '=' to state 106 16: On MATH_IS to state 107 State 156: 71: expression -> expression '=' expression . 48: expression -> expression . '[' expression ']' 57: expression -> expression . INCDEC opValue 59: expression -> expression . '+' expression 60: expression -> expression . '-' expression 61: expression -> expression . MULTIPLY opValue expression 62: expression -> expression . SHIFT opValue expression 63: expression -> expression . ORDER opValue expression 64: expression -> expression . EQUALITY opValue expression 65: expression -> expression . '&' expression 66: expression -> expression . '^' expression 67: expression -> expression . '|' expression 68: expression -> expression . AND expression 69: expression -> expression . OR expression 70: expression -> expression . '?' expression ':' expression 71: expression -> expression . '=' expression 72: expression -> expression . MATH_IS opValue expression 0: On '[' to state 92 1: On INCDEC to state 93 2: On '+' to state 94 3: On '-' to state 95 4: On MULTIPLY to state 96 5: On SHIFT to state 97 6: On ORDER to state 98 7: On EQUALITY to state 99 8: On '&' to state 100 9: On '^' to state 101 10: On '|' to state 102 11: On AND to state 103 12: On OR to state 104 13: On '?' to state 105 14: On '=' to state 106 15: On MATH_IS to state 107 Reduce by 71: expression -> expression '=' expression . State 157: 72: expression -> expression MATH_IS opValue . expression 0: On expression to state 180 1: On exprStart_ to state 58 2: On '[' to state 59 3: On identifier to state 60 4: On '`' to state 61 5: On '(' to state 62 6: On '+' to state 63 7: On '-' to state 64 8: On '~' to state 65 9: On '!' to state 66 10: On INCDEC to state 67 11: On exprUnit_ to state 72 12: On IDENTIFIER to state 20 13: On string to state 78 14: On NUMBER to state 79 15: On string_ to state 80 16: On STRING to state 81 State 158: 107: stCompound_ -> openCurly statements closeCurly . Reduce by 107: stCompound_ -> openCurly statements closeCurly . State 159: 47: expression -> '[' argsOpt ']' . Reduce by 47: expression -> '[' argsOpt ']' . State 160: 30: args -> args ',' . argsExpr 0: On argsExpr to state 181 1: On expression to state 115 2: On ORDER to state 116 3: On exprStart_ to state 58 4: On '[' to state 59 5: On identifier to state 60 6: On '`' to state 61 7: On '(' to state 62 8: On '+' to state 63 9: On '-' to state 64 10: On '~' to state 65 11: On '!' to state 66 12: On INCDEC to state 67 13: On exprUnit_ to state 72 14: On IDENTIFIER to state 20 15: On string to state 78 16: On NUMBER to state 79 17: On string_ to state 80 18: On STRING to state 81 State 161: 29: argsExpr -> ORDER opValue . Reduce by 29: argsExpr -> ORDER opValue . State 162: 49: expression -> identifier '(' argsOpt . ')' 0: On ')' to state 182 State 163: 50: expression -> '`' expression '`' . Reduce by 50: expression -> '`' expression '`' . State 164: 51: expression -> '(' expression ')' . Reduce by 51: expression -> '(' expression ')' . State 165: 58: expression -> '(' cast ')' . expression 0: On expression to state 183 1: On exprStart_ to state 58 2: On '[' to state 59 3: On identifier to state 60 4: On '`' to state 61 5: On '(' to state 62 6: On '+' to state 63 7: On '-' to state 64 8: On '~' to state 65 9: On '!' to state 66 10: On INCDEC to state 67 11: On exprUnit_ to state 72 12: On IDENTIFIER to state 20 13: On string to state 78 14: On NUMBER to state 79 15: On string_ to state 80 16: On STRING to state 81 State 166: 56: expression -> INCDEC opValue expression . 48: expression -> expression . '[' expression ']' 57: expression -> expression . INCDEC opValue 59: expression -> expression . '+' expression 60: expression -> expression . '-' expression 61: expression -> expression . MULTIPLY opValue expression 62: expression -> expression . SHIFT opValue expression 63: expression -> expression . ORDER opValue expression 64: expression -> expression . EQUALITY opValue expression 65: expression -> expression . '&' expression 66: expression -> expression . '^' expression 67: expression -> expression . '|' expression 68: expression -> expression . AND expression 69: expression -> expression . OR expression 70: expression -> expression . '?' expression ':' expression 71: expression -> expression . '=' expression 72: expression -> expression . MATH_IS opValue expression 0: On '[' to state 92 1: On INCDEC to state 93 2 (removed by precedence): On '+' to state 94 3 (removed by precedence): On '-' to state 95 4 (removed by precedence): On MULTIPLY to state 96 5 (removed by precedence): On SHIFT to state 97 6 (removed by precedence): On ORDER to state 98 7 (removed by precedence): On EQUALITY to state 99 8 (removed by precedence): On '&' to state 100 9 (removed by precedence): On '^' to state 101 10 (removed by precedence): On '|' to state 102 11 (removed by precedence): On AND to state 103 12 (removed by precedence): On OR to state 104 13 (removed by precedence): On '?' to state 105 14 (removed by precedence): On '=' to state 106 15 (removed by precedence): On MATH_IS to state 107 Reduce by 56: expression -> INCDEC opValue expression . State 167: 82: returnStatement -> retLeave_ syntaxExpression retExpr_ . Reduce by 82: returnStatement -> retLeave_ syntaxExpression retExpr_ . State 168: 78: retExpr_ -> expression . 48: expression -> expression . '[' expression ']' 57: expression -> expression . INCDEC opValue 59: expression -> expression . '+' expression 60: expression -> expression . '-' expression 61: expression -> expression . MULTIPLY opValue expression 62: expression -> expression . SHIFT opValue expression 63: expression -> expression . ORDER opValue expression 64: expression -> expression . EQUALITY opValue expression 65: expression -> expression . '&' expression 66: expression -> expression . '^' expression 67: expression -> expression . '|' expression 68: expression -> expression . AND expression 69: expression -> expression . OR expression 70: expression -> expression . '?' expression ':' expression 71: expression -> expression . '=' expression 72: expression -> expression . MATH_IS opValue expression 0: On '[' to state 92 1: On INCDEC to state 93 2: On '+' to state 94 3: On '-' to state 95 4: On MULTIPLY to state 96 5: On SHIFT to state 97 6: On ORDER to state 98 7: On EQUALITY to state 99 8: On '&' to state 100 9: On '^' to state 101 10: On '|' to state 102 11: On AND to state 103 12: On OR to state 104 13: On '?' to state 105 14: On '=' to state 106 15: On MATH_IS to state 107 Reduce by 78: retExpr_ -> expression . State 169: 84: whileStatement -> while_ '(' syntaxExpression . condition syntaxCloseParen closeParenBreakOK statement 0: On condition to state 184 1: On expression to state 185 2: On conditionVar_ to state 186 3: On exprStart_ to state 58 4: On '[' to state 59 5: On identifier to state 60 6: On '`' to state 61 7: On '(' to state 62 8: On '+' to state 63 9: On '-' to state 64 10: On '~' to state 65 11: On '!' to state 66 12: On INCDEC to state 67 13: On varType to state 187 14: On exprUnit_ to state 72 15: On IDENTIFIER to state 20 16: On varType_ to state 6 17: On string to state 78 18: On NUMBER to state 79 19: On INT to state 8 20: On STRINGTYPE to state 9 21: On LIST to state 10 22: On string_ to state 80 23: On STRING to state 81 State 170: 104: ifStatement -> if_ '(' syntaxExpression . ifCond_ syntaxCloseParen ')' syntaxExpression statement ifStatementElse_ 0: On ifCond_ to state 188 1: On condition to state 189 2: On ';' to state 190 3: On flowInit to state 191 4: On expression to state 192 5: On conditionVar_ to state 186 6: On flowArgs to state 193 7: On varType to state 194 8: On exprStart_ to state 58 9: On '[' to state 59 10: On identifier to state 60 11: On '`' to state 61 12: On '(' to state 62 13: On '+' to state 63 14: On '-' to state 64 15: On '~' to state 65 16: On '!' to state 66 17: On INCDEC to state 67 18: On varType_ to state 6 19: On exprUnit_ to state 72 20: On IDENTIFIER to state 20 21: On INT to state 8 22: On STRINGTYPE to state 9 23: On LIST to state 10 24: On string to state 78 25: On NUMBER to state 79 26: On string_ to state 80 27: On STRING to state 81 State 171: 96: forStatement -> for_ '(' syntaxInit . optInit syntaxSemicol ';' syntaxExpression optCondition syntaxSemicol ';' syntaxExpression forOptInc_ syntaxCloseParen closeParenBreakOK statement 0: On optInit to state 195 1: On flowInit to state 196 2: On argsNull to state 197 3: On flowArgs to state 193 4: On varType to state 198 5: On expression to state 199 6: On varType_ to state 6 7: On exprStart_ to state 58 8: On '[' to state 59 9: On identifier to state 60 10: On '`' to state 61 11: On '(' to state 62 12: On '+' to state 63 13: On '-' to state 64 14: On '~' to state 65 15: On '!' to state 66 16: On INCDEC to state 67 17: On INT to state 8 18: On STRINGTYPE to state 9 19: On LIST to state 10 20: On exprUnit_ to state 72 21: On IDENTIFIER to state 20 22: On string to state 78 23: On NUMBER to state 79 24: On string_ to state 80 25: On STRING to state 81 Reduce by 32: argsNull -> . State 172: 125: fdParams_ -> fdParams_ ',' syntaxTypename fdParam_ . Reduce by 125: fdParams_ -> fdParams_ ',' syntaxTypename fdParam_ . State 173: 40: localVars -> localVars ',' defineVar . syntaxCommaOrSemicol 0: On syntaxCommaOrSemicol to state 200 Reduce by 4: syntaxCommaOrSemicol -> . State 174: 48: expression -> expression '[' expression ']' . Reduce by 48: expression -> expression '[' expression ']' . State 175: 61: expression -> expression MULTIPLY opValue expression . 48: expression -> expression . '[' expression ']' 57: expression -> expression . INCDEC opValue 59: expression -> expression . '+' expression 60: expression -> expression . '-' expression 61: expression -> expression . MULTIPLY opValue expression 62: expression -> expression . SHIFT opValue expression 63: expression -> expression . ORDER opValue expression 64: expression -> expression . EQUALITY opValue expression 65: expression -> expression . '&' expression 66: expression -> expression . '^' expression 67: expression -> expression . '|' expression 68: expression -> expression . AND expression 69: expression -> expression . OR expression 70: expression -> expression . '?' expression ':' expression 71: expression -> expression . '=' expression 72: expression -> expression . MATH_IS opValue expression 0: On '[' to state 92 1: On INCDEC to state 93 2 (removed by precedence): On '+' to state 94 3 (removed by precedence): On '-' to state 95 4 (removed by precedence): On MULTIPLY to state 96 5 (removed by precedence): On SHIFT to state 97 6 (removed by precedence): On ORDER to state 98 7 (removed by precedence): On EQUALITY to state 99 8 (removed by precedence): On '&' to state 100 9 (removed by precedence): On '^' to state 101 10 (removed by precedence): On '|' to state 102 11 (removed by precedence): On AND to state 103 12 (removed by precedence): On OR to state 104 13 (removed by precedence): On '?' to state 105 14 (removed by precedence): On '=' to state 106 15 (removed by precedence): On MATH_IS to state 107 Reduce by 61: expression -> expression MULTIPLY opValue expression . State 176: 62: expression -> expression SHIFT opValue expression . 48: expression -> expression . '[' expression ']' 57: expression -> expression . INCDEC opValue 59: expression -> expression . '+' expression 60: expression -> expression . '-' expression 61: expression -> expression . MULTIPLY opValue expression 62: expression -> expression . SHIFT opValue expression 63: expression -> expression . ORDER opValue expression 64: expression -> expression . EQUALITY opValue expression 65: expression -> expression . '&' expression 66: expression -> expression . '^' expression 67: expression -> expression . '|' expression 68: expression -> expression . AND expression 69: expression -> expression . OR expression 70: expression -> expression . '?' expression ':' expression 71: expression -> expression . '=' expression 72: expression -> expression . MATH_IS opValue expression 0: On '[' to state 92 1: On INCDEC to state 93 2: On '+' to state 94 3: On '-' to state 95 4: On MULTIPLY to state 96 5 (removed by precedence): On SHIFT to state 97 6 (removed by precedence): On ORDER to state 98 7 (removed by precedence): On EQUALITY to state 99 8 (removed by precedence): On '&' to state 100 9 (removed by precedence): On '^' to state 101 10 (removed by precedence): On '|' to state 102 11 (removed by precedence): On AND to state 103 12 (removed by precedence): On OR to state 104 13 (removed by precedence): On '?' to state 105 14 (removed by precedence): On '=' to state 106 15 (removed by precedence): On MATH_IS to state 107 Reduce by 62: expression -> expression SHIFT opValue expression . State 177: 63: expression -> expression ORDER opValue expression . 48: expression -> expression . '[' expression ']' 57: expression -> expression . INCDEC opValue 59: expression -> expression . '+' expression 60: expression -> expression . '-' expression 61: expression -> expression . MULTIPLY opValue expression 62: expression -> expression . SHIFT opValue expression 63: expression -> expression . ORDER opValue expression 64: expression -> expression . EQUALITY opValue expression 65: expression -> expression . '&' expression 66: expression -> expression . '^' expression 67: expression -> expression . '|' expression 68: expression -> expression . AND expression 69: expression -> expression . OR expression 70: expression -> expression . '?' expression ':' expression 71: expression -> expression . '=' expression 72: expression -> expression . MATH_IS opValue expression 0: On '[' to state 92 1: On INCDEC to state 93 2: On '+' to state 94 3: On '-' to state 95 4: On MULTIPLY to state 96 5: On SHIFT to state 97 6 (removed by precedence): On ORDER to state 98 7 (removed by precedence): On EQUALITY to state 99 8 (removed by precedence): On '&' to state 100 9 (removed by precedence): On '^' to state 101 10 (removed by precedence): On '|' to state 102 11 (removed by precedence): On AND to state 103 12 (removed by precedence): On OR to state 104 13 (removed by precedence): On '?' to state 105 14 (removed by precedence): On '=' to state 106 15 (removed by precedence): On MATH_IS to state 107 Reduce by 63: expression -> expression ORDER opValue expression . State 178: 64: expression -> expression EQUALITY opValue expression . 48: expression -> expression . '[' expression ']' 57: expression -> expression . INCDEC opValue 59: expression -> expression . '+' expression 60: expression -> expression . '-' expression 61: expression -> expression . MULTIPLY opValue expression 62: expression -> expression . SHIFT opValue expression 63: expression -> expression . ORDER opValue expression 64: expression -> expression . EQUALITY opValue expression 65: expression -> expression . '&' expression 66: expression -> expression . '^' expression 67: expression -> expression . '|' expression 68: expression -> expression . AND expression 69: expression -> expression . OR expression 70: expression -> expression . '?' expression ':' expression 71: expression -> expression . '=' expression 72: expression -> expression . MATH_IS opValue expression 0: On '[' to state 92 1: On INCDEC to state 93 2: On '+' to state 94 3: On '-' to state 95 4: On MULTIPLY to state 96 5: On SHIFT to state 97 6: On ORDER to state 98 7 (removed by precedence): On EQUALITY to state 99 8 (removed by precedence): On '&' to state 100 9 (removed by precedence): On '^' to state 101 10 (removed by precedence): On '|' to state 102 11 (removed by precedence): On AND to state 103 12 (removed by precedence): On OR to state 104 13 (removed by precedence): On '?' to state 105 14 (removed by precedence): On '=' to state 106 15 (removed by precedence): On MATH_IS to state 107 Reduce by 64: expression -> expression EQUALITY opValue expression . State 179: 70: expression -> expression '?' expression ':' . expression 0: On expression to state 201 1: On exprStart_ to state 58 2: On '[' to state 59 3: On identifier to state 60 4: On '`' to state 61 5: On '(' to state 62 6: On '+' to state 63 7: On '-' to state 64 8: On '~' to state 65 9: On '!' to state 66 10: On INCDEC to state 67 11: On exprUnit_ to state 72 12: On IDENTIFIER to state 20 13: On string to state 78 14: On NUMBER to state 79 15: On string_ to state 80 16: On STRING to state 81 State 180: 72: expression -> expression MATH_IS opValue expression . 48: expression -> expression . '[' expression ']' 57: expression -> expression . INCDEC opValue 59: expression -> expression . '+' expression 60: expression -> expression . '-' expression 61: expression -> expression . MULTIPLY opValue expression 62: expression -> expression . SHIFT opValue expression 63: expression -> expression . ORDER opValue expression 64: expression -> expression . EQUALITY opValue expression 65: expression -> expression . '&' expression 66: expression -> expression . '^' expression 67: expression -> expression . '|' expression 68: expression -> expression . AND expression 69: expression -> expression . OR expression 70: expression -> expression . '?' expression ':' expression 71: expression -> expression . '=' expression 72: expression -> expression . MATH_IS opValue expression 0: On '[' to state 92 1: On INCDEC to state 93 2: On '+' to state 94 3: On '-' to state 95 4: On MULTIPLY to state 96 5: On SHIFT to state 97 6: On ORDER to state 98 7: On EQUALITY to state 99 8: On '&' to state 100 9: On '^' to state 101 10: On '|' to state 102 11: On AND to state 103 12: On OR to state 104 13: On '?' to state 105 14: On '=' to state 106 15: On MATH_IS to state 107 Reduce by 72: expression -> expression MATH_IS opValue expression . State 181: 30: args -> args ',' argsExpr . Reduce by 30: args -> args ',' argsExpr . State 182: 49: expression -> identifier '(' argsOpt ')' . Reduce by 49: expression -> identifier '(' argsOpt ')' . State 183: 58: expression -> '(' cast ')' expression . 48: expression -> expression . '[' expression ']' 57: expression -> expression . INCDEC opValue 59: expression -> expression . '+' expression 60: expression -> expression . '-' expression 61: expression -> expression . MULTIPLY opValue expression 62: expression -> expression . SHIFT opValue expression 63: expression -> expression . ORDER opValue expression 64: expression -> expression . EQUALITY opValue expression 65: expression -> expression . '&' expression 66: expression -> expression . '^' expression 67: expression -> expression . '|' expression 68: expression -> expression . AND expression 69: expression -> expression . OR expression 70: expression -> expression . '?' expression ':' expression 71: expression -> expression . '=' expression 72: expression -> expression . MATH_IS opValue expression 0: On '[' to state 92 1: On INCDEC to state 93 2 (removed by precedence): On '+' to state 94 3 (removed by precedence): On '-' to state 95 4 (removed by precedence): On MULTIPLY to state 96 5 (removed by precedence): On SHIFT to state 97 6 (removed by precedence): On ORDER to state 98 7 (removed by precedence): On EQUALITY to state 99 8 (removed by precedence): On '&' to state 100 9 (removed by precedence): On '^' to state 101 10 (removed by precedence): On '|' to state 102 11 (removed by precedence): On AND to state 103 12 (removed by precedence): On OR to state 104 13 (removed by precedence): On '?' to state 105 14 (removed by precedence): On '=' to state 106 15 (removed by precedence): On MATH_IS to state 107 Reduce by 58: expression -> '(' cast ')' expression . State 184: 84: whileStatement -> while_ '(' syntaxExpression condition . syntaxCloseParen closeParenBreakOK statement 0: On syntaxCloseParen to state 202 Reduce by 3: syntaxCloseParen -> . State 185: 74: condition -> expression . 48: expression -> expression . '[' expression ']' 57: expression -> expression . INCDEC opValue 59: expression -> expression . '+' expression 60: expression -> expression . '-' expression 61: expression -> expression . MULTIPLY opValue expression 62: expression -> expression . SHIFT opValue expression 63: expression -> expression . ORDER opValue expression 64: expression -> expression . EQUALITY opValue expression 65: expression -> expression . '&' expression 66: expression -> expression . '^' expression 67: expression -> expression . '|' expression 68: expression -> expression . AND expression 69: expression -> expression . OR expression 70: expression -> expression . '?' expression ':' expression 71: expression -> expression . '=' expression 72: expression -> expression . MATH_IS opValue expression 0: On '[' to state 92 1: On INCDEC to state 93 2: On '+' to state 94 3: On '-' to state 95 4: On MULTIPLY to state 96 5: On SHIFT to state 97 6: On ORDER to state 98 7: On EQUALITY to state 99 8: On '&' to state 100 9: On '^' to state 101 10: On '|' to state 102 11: On AND to state 103 12: On OR to state 104 13: On '?' to state 105 14: On '=' to state 106 15: On MATH_IS to state 107 Reduce by 74: condition -> expression . State 186: 75: condition -> conditionVar_ . Reduce by 75: condition -> conditionVar_ . State 187: 73: conditionVar_ -> varType . defineVar 0: On defineVar to state 203 1: On defineVar_ to state 17 2: On identifier to state 32 3: On IDENTIFIER to state 20 State 188: 104: ifStatement -> if_ '(' syntaxExpression ifCond_ . syntaxCloseParen ')' syntaxExpression statement ifStatementElse_ 0: On syntaxCloseParen to state 204 Reduce by 3: syntaxCloseParen -> . State 189: 101: ifCond_ -> condition . Reduce by 101: ifCond_ -> condition . State 190: 102: ifCond_ -> ';' . condition 0: On condition to state 205 1: On expression to state 185 2: On conditionVar_ to state 186 3: On exprStart_ to state 58 4: On '[' to state 59 5: On identifier to state 60 6: On '`' to state 61 7: On '(' to state 62 8: On '+' to state 63 9: On '-' to state 64 10: On '~' to state 65 11: On '!' to state 66 12: On INCDEC to state 67 13: On varType to state 187 14: On exprUnit_ to state 72 15: On IDENTIFIER to state 20 16: On varType_ to state 6 17: On string to state 78 18: On NUMBER to state 79 19: On INT to state 8 20: On STRINGTYPE to state 9 21: On LIST to state 10 22: On string_ to state 80 23: On STRING to state 81 State 191: 103: ifCond_ -> flowInit . ';' condition 0: On ';' to state 206 State 192: 74: condition -> expression . 48: expression -> expression . '[' expression ']' 57: expression -> expression . INCDEC opValue 59: expression -> expression . '+' expression 60: expression -> expression . '-' expression 61: expression -> expression . MULTIPLY opValue expression 62: expression -> expression . SHIFT opValue expression 63: expression -> expression . ORDER opValue expression 64: expression -> expression . EQUALITY opValue expression 65: expression -> expression . '&' expression 66: expression -> expression . '^' expression 67: expression -> expression . '|' expression 68: expression -> expression . AND expression 69: expression -> expression . OR expression 70: expression -> expression . '?' expression ':' expression 71: expression -> expression . '=' expression 72: expression -> expression . MATH_IS opValue expression 86: flowArgs -> expression . 0: On '[' to state 92 1: On INCDEC to state 93 2: On '+' to state 94 3: On '-' to state 95 4: On MULTIPLY to state 96 5: On SHIFT to state 97 6: On ORDER to state 98 7: On EQUALITY to state 99 8: On '&' to state 100 9: On '^' to state 101 10: On '|' to state 102 11: On AND to state 103 12: On OR to state 104 13: On '?' to state 105 14: On '=' to state 106 15: On MATH_IS to state 107 Reduce by 74: condition -> expression . Reduce by 86: flowArgs -> expression . State 193: 89: flowInit -> flowArgs . 85: flowArgs -> flowArgs . ',' expression 0: On ',' to state 207 Reduce by 89: flowInit -> flowArgs . State 194: 90: flowInit -> varType . flowInitDefs_ 73: conditionVar_ -> varType . defineVar 0: On flowInitDefs_ to state 208 1: On defineVar to state 209 2: On defineVar_ to state 17 3: On identifier to state 32 4: On IDENTIFIER to state 20 State 195: 96: forStatement -> for_ '(' syntaxInit optInit . syntaxSemicol ';' syntaxExpression optCondition syntaxSemicol ';' syntaxExpression forOptInc_ syntaxCloseParen closeParenBreakOK statement 0: On syntaxSemicol to state 210 Reduce by 10: syntaxSemicol -> . State 196: 91: optInit -> flowInit . Reduce by 91: optInit -> flowInit . State 197: 92: optInit -> argsNull . Reduce by 92: optInit -> argsNull . State 198: 90: flowInit -> varType . flowInitDefs_ 0: On flowInitDefs_ to state 208 1: On defineVar to state 211 2: On defineVar_ to state 17 3: On identifier to state 32 4: On IDENTIFIER to state 20 State 199: 86: flowArgs -> expression . 48: expression -> expression . '[' expression ']' 57: expression -> expression . INCDEC opValue 59: expression -> expression . '+' expression 60: expression -> expression . '-' expression 61: expression -> expression . MULTIPLY opValue expression 62: expression -> expression . SHIFT opValue expression 63: expression -> expression . ORDER opValue expression 64: expression -> expression . EQUALITY opValue expression 65: expression -> expression . '&' expression 66: expression -> expression . '^' expression 67: expression -> expression . '|' expression 68: expression -> expression . AND expression 69: expression -> expression . OR expression 70: expression -> expression . '?' expression ':' expression 71: expression -> expression . '=' expression 72: expression -> expression . MATH_IS opValue expression 0: On '[' to state 92 1: On INCDEC to state 93 2: On '+' to state 94 3: On '-' to state 95 4: On MULTIPLY to state 96 5: On SHIFT to state 97 6: On ORDER to state 98 7: On EQUALITY to state 99 8: On '&' to state 100 9: On '^' to state 101 10: On '|' to state 102 11: On AND to state 103 12: On OR to state 104 13: On '?' to state 105 14: On '=' to state 106 15: On MATH_IS to state 107 Reduce by 86: flowArgs -> expression . State 200: 40: localVars -> localVars ',' defineVar syntaxCommaOrSemicol . Reduce by 40: localVars -> localVars ',' defineVar syntaxCommaOrSemicol . State 201: 70: expression -> expression '?' expression ':' expression . 48: expression -> expression . '[' expression ']' 57: expression -> expression . INCDEC opValue 59: expression -> expression . '+' expression 60: expression -> expression . '-' expression 61: expression -> expression . MULTIPLY opValue expression 62: expression -> expression . SHIFT opValue expression 63: expression -> expression . ORDER opValue expression 64: expression -> expression . EQUALITY opValue expression 65: expression -> expression . '&' expression 66: expression -> expression . '^' expression 67: expression -> expression . '|' expression 68: expression -> expression . AND expression 69: expression -> expression . OR expression 70: expression -> expression . '?' expression ':' expression 71: expression -> expression . '=' expression 72: expression -> expression . MATH_IS opValue expression 0: On '[' to state 92 1: On INCDEC to state 93 2: On '+' to state 94 3: On '-' to state 95 4: On MULTIPLY to state 96 5: On SHIFT to state 97 6: On ORDER to state 98 7: On EQUALITY to state 99 8: On '&' to state 100 9: On '^' to state 101 10: On '|' to state 102 11: On AND to state 103 12: On OR to state 104 13: On '?' to state 105 14 (removed by precedence): On '=' to state 106 15 (removed by precedence): On MATH_IS to state 107 Reduce by 70: expression -> expression '?' expression ':' expression . State 202: 84: whileStatement -> while_ '(' syntaxExpression condition syntaxCloseParen . closeParenBreakOK statement 0: On closeParenBreakOK to state 212 1: On ')' to state 213 State 203: 73: conditionVar_ -> varType defineVar . Reduce by 73: conditionVar_ -> varType defineVar . State 204: 104: ifStatement -> if_ '(' syntaxExpression ifCond_ syntaxCloseParen . ')' syntaxExpression statement ifStatementElse_ 0: On ')' to state 214 State 205: 102: ifCond_ -> ';' condition . Reduce by 102: ifCond_ -> ';' condition . State 206: 103: ifCond_ -> flowInit ';' . condition 0: On condition to state 215 1: On expression to state 185 2: On conditionVar_ to state 186 3: On exprStart_ to state 58 4: On '[' to state 59 5: On identifier to state 60 6: On '`' to state 61 7: On '(' to state 62 8: On '+' to state 63 9: On '-' to state 64 10: On '~' to state 65 11: On '!' to state 66 12: On INCDEC to state 67 13: On varType to state 187 14: On exprUnit_ to state 72 15: On IDENTIFIER to state 20 16: On varType_ to state 6 17: On string to state 78 18: On NUMBER to state 79 19: On INT to state 8 20: On STRINGTYPE to state 9 21: On LIST to state 10 22: On string_ to state 80 23: On STRING to state 81 State 207: 85: flowArgs -> flowArgs ',' . expression 0: On expression to state 216 1: On exprStart_ to state 58 2: On '[' to state 59 3: On identifier to state 60 4: On '`' to state 61 5: On '(' to state 62 6: On '+' to state 63 7: On '-' to state 64 8: On '~' to state 65 9: On '!' to state 66 10: On INCDEC to state 67 11: On exprUnit_ to state 72 12: On IDENTIFIER to state 20 13: On string to state 78 14: On NUMBER to state 79 15: On string_ to state 80 16: On STRING to state 81 State 208: 90: flowInit -> varType flowInitDefs_ . 87: flowInitDefs_ -> flowInitDefs_ . ',' defineVar 0: On ',' to state 217 Reduce by 90: flowInit -> varType flowInitDefs_ . State 209: 73: conditionVar_ -> varType defineVar . 88: flowInitDefs_ -> defineVar . Reduce by 73: conditionVar_ -> varType defineVar . Reduce by 88: flowInitDefs_ -> defineVar . State 210: 96: forStatement -> for_ '(' syntaxInit optInit syntaxSemicol . ';' syntaxExpression optCondition syntaxSemicol ';' syntaxExpression forOptInc_ syntaxCloseParen closeParenBreakOK statement 0: On ';' to state 218 State 211: 88: flowInitDefs_ -> defineVar . Reduce by 88: flowInitDefs_ -> defineVar . State 212: 84: whileStatement -> while_ '(' syntaxExpression condition syntaxCloseParen closeParenBreakOK . statement 0: On statement to state 219 1: On stAlt_ to state 43 2: On varType to state 44 3: On stBreak_ to state 45 4: On stContinue_ to state 46 5: On stCompound_ to state 47 6: On ';' to state 48 7: On expression to state 49 8: On returnStatement to state 50 9: On whileStatement to state 51 10: On ifStatement to state 52 11: On forStatement to state 53 12: On errTok_ to state 54 13: On varType_ to state 6 14: On BREAK to state 55 15: On CONTINUE to state 56 16: On openCurly to state 57 17: On exprStart_ to state 58 18: On '[' to state 59 19: On identifier to state 60 20: On '`' to state 61 21: On '(' to state 62 22: On '+' to state 63 23: On '-' to state 64 24: On '~' to state 65 25: On '!' to state 66 26: On INCDEC to state 67 27: On retLeave_ to state 68 28: On while_ to state 69 29: On if_ to state 70 30: On for_ to state 71 31: On INT to state 8 32: On STRINGTYPE to state 9 33: On LIST to state 10 34: On '{' to state 28 35: On exprUnit_ to state 72 36: On IDENTIFIER to state 20 37: On RETURN to state 73 38: On EXIT to state 74 39: On WHILE to state 75 40: On IF to state 76 41: On FOR to state 77 42: On string to state 78 43: On NUMBER to state 79 44: On string_ to state 80 45: On STRING to state 81 State 213: 15: closeParenBreakOK -> ')' . Reduce by 15: closeParenBreakOK -> ')' . State 214: 104: ifStatement -> if_ '(' syntaxExpression ifCond_ syntaxCloseParen ')' . syntaxExpression statement ifStatementElse_ 0: On syntaxExpression to state 220 Reduce by 6: syntaxExpression -> . State 215: 103: ifCond_ -> flowInit ';' condition . Reduce by 103: ifCond_ -> flowInit ';' condition . State 216: 85: flowArgs -> flowArgs ',' expression . 48: expression -> expression . '[' expression ']' 57: expression -> expression . INCDEC opValue 59: expression -> expression . '+' expression 60: expression -> expression . '-' expression 61: expression -> expression . MULTIPLY opValue expression 62: expression -> expression . SHIFT opValue expression 63: expression -> expression . ORDER opValue expression 64: expression -> expression . EQUALITY opValue expression 65: expression -> expression . '&' expression 66: expression -> expression . '^' expression 67: expression -> expression . '|' expression 68: expression -> expression . AND expression 69: expression -> expression . OR expression 70: expression -> expression . '?' expression ':' expression 71: expression -> expression . '=' expression 72: expression -> expression . MATH_IS opValue expression 0: On '[' to state 92 1: On INCDEC to state 93 2: On '+' to state 94 3: On '-' to state 95 4: On MULTIPLY to state 96 5: On SHIFT to state 97 6: On ORDER to state 98 7: On EQUALITY to state 99 8: On '&' to state 100 9: On '^' to state 101 10: On '|' to state 102 11: On AND to state 103 12: On OR to state 104 13: On '?' to state 105 14: On '=' to state 106 15: On MATH_IS to state 107 Reduce by 85: flowArgs -> flowArgs ',' expression . State 217: 87: flowInitDefs_ -> flowInitDefs_ ',' . defineVar 0: On defineVar to state 221 1: On defineVar_ to state 17 2: On identifier to state 32 3: On IDENTIFIER to state 20 State 218: 96: forStatement -> for_ '(' syntaxInit optInit syntaxSemicol ';' . syntaxExpression optCondition syntaxSemicol ';' syntaxExpression forOptInc_ syntaxCloseParen closeParenBreakOK statement 0: On syntaxExpression to state 222 Reduce by 6: syntaxExpression -> . State 219: 84: whileStatement -> while_ '(' syntaxExpression condition syntaxCloseParen closeParenBreakOK statement . Reduce by 84: whileStatement -> while_ '(' syntaxExpression condition syntaxCloseParen closeParenBreakOK statement . State 220: 104: ifStatement -> if_ '(' syntaxExpression ifCond_ syntaxCloseParen ')' syntaxExpression . statement ifStatementElse_ 0: On statement to state 223 1: On stAlt_ to state 43 2: On varType to state 44 3: On stBreak_ to state 45 4: On stContinue_ to state 46 5: On stCompound_ to state 47 6: On ';' to state 48 7: On expression to state 49 8: On returnStatement to state 50 9: On whileStatement to state 51 10: On ifStatement to state 52 11: On forStatement to state 53 12: On errTok_ to state 54 13: On varType_ to state 6 14: On BREAK to state 55 15: On CONTINUE to state 56 16: On openCurly to state 57 17: On exprStart_ to state 58 18: On '[' to state 59 19: On identifier to state 60 20: On '`' to state 61 21: On '(' to state 62 22: On '+' to state 63 23: On '-' to state 64 24: On '~' to state 65 25: On '!' to state 66 26: On INCDEC to state 67 27: On retLeave_ to state 68 28: On while_ to state 69 29: On if_ to state 70 30: On for_ to state 71 31: On INT to state 8 32: On STRINGTYPE to state 9 33: On LIST to state 10 34: On '{' to state 28 35: On exprUnit_ to state 72 36: On IDENTIFIER to state 20 37: On RETURN to state 73 38: On EXIT to state 74 39: On WHILE to state 75 40: On IF to state 76 41: On FOR to state 77 42: On string to state 78 43: On NUMBER to state 79 44: On string_ to state 80 45: On STRING to state 81 State 221: 87: flowInitDefs_ -> flowInitDefs_ ',' defineVar . Reduce by 87: flowInitDefs_ -> flowInitDefs_ ',' defineVar . State 222: 96: forStatement -> for_ '(' syntaxInit optInit syntaxSemicol ';' syntaxExpression . optCondition syntaxSemicol ';' syntaxExpression forOptInc_ syntaxCloseParen closeParenBreakOK statement 0: On optCondition to state 224 1: On condition to state 225 2: On expression to state 185 3: On conditionVar_ to state 186 4: On exprStart_ to state 58 5: On '[' to state 59 6: On identifier to state 60 7: On '`' to state 61 8: On '(' to state 62 9: On '+' to state 63 10: On '-' to state 64 11: On '~' to state 65 12: On '!' to state 66 13: On INCDEC to state 67 14: On varType to state 187 15: On exprUnit_ to state 72 16: On IDENTIFIER to state 20 17: On varType_ to state 6 18: On string to state 78 19: On NUMBER to state 79 20: On INT to state 8 21: On STRINGTYPE to state 9 22: On LIST to state 10 23: On string_ to state 80 24: On STRING to state 81 Reduce by 77: optCondition -> . State 223: 104: ifStatement -> if_ '(' syntaxExpression ifCond_ syntaxCloseParen ')' syntaxExpression statement . ifStatementElse_ 0: On ifStatementElse_ to state 226 1: On ifElse_ to state 227 2: On ELSE to state 228 Reduce by 100: ifStatementElse_ -> . Solved SR CONFLICT on ELSE: shift to state 228, removed ELSE from LA-set of rule 100) State 224: 96: forStatement -> for_ '(' syntaxInit optInit syntaxSemicol ';' syntaxExpression optCondition . syntaxSemicol ';' syntaxExpression forOptInc_ syntaxCloseParen closeParenBreakOK statement 0: On syntaxSemicol to state 229 Reduce by 10: syntaxSemicol -> . State 225: 76: optCondition -> condition . Reduce by 76: optCondition -> condition . State 226: 104: ifStatement -> if_ '(' syntaxExpression ifCond_ syntaxCloseParen ')' syntaxExpression statement ifStatementElse_ . Reduce by 104: ifStatement -> if_ '(' syntaxExpression ifCond_ syntaxCloseParen ')' syntaxExpression statement ifStatementElse_ . State 227: 99: ifStatementElse_ -> ifElse_ . statement 0: On statement to state 230 1: On stAlt_ to state 43 2: On varType to state 44 3: On stBreak_ to state 45 4: On stContinue_ to state 46 5: On stCompound_ to state 47 6: On ';' to state 48 7: On expression to state 49 8: On returnStatement to state 50 9: On whileStatement to state 51 10: On ifStatement to state 52 11: On forStatement to state 53 12: On errTok_ to state 54 13: On varType_ to state 6 14: On BREAK to state 55 15: On CONTINUE to state 56 16: On openCurly to state 57 17: On exprStart_ to state 58 18: On '[' to state 59 19: On identifier to state 60 20: On '`' to state 61 21: On '(' to state 62 22: On '+' to state 63 23: On '-' to state 64 24: On '~' to state 65 25: On '!' to state 66 26: On INCDEC to state 67 27: On retLeave_ to state 68 28: On while_ to state 69 29: On if_ to state 70 30: On for_ to state 71 31: On INT to state 8 32: On STRINGTYPE to state 9 33: On LIST to state 10 34: On '{' to state 28 35: On exprUnit_ to state 72 36: On IDENTIFIER to state 20 37: On RETURN to state 73 38: On EXIT to state 74 39: On WHILE to state 75 40: On IF to state 76 41: On FOR to state 77 42: On string to state 78 43: On NUMBER to state 79 44: On string_ to state 80 45: On STRING to state 81 State 228: 98: ifElse_ -> ELSE . Reduce by 98: ifElse_ -> ELSE . State 229: 96: forStatement -> for_ '(' syntaxInit optInit syntaxSemicol ';' syntaxExpression optCondition syntaxSemicol . ';' syntaxExpression forOptInc_ syntaxCloseParen closeParenBreakOK statement 0: On ';' to state 231 State 230: 99: ifStatementElse_ -> ifElse_ statement . Reduce by 99: ifStatementElse_ -> ifElse_ statement . State 231: 96: forStatement -> for_ '(' syntaxInit optInit syntaxSemicol ';' syntaxExpression optCondition syntaxSemicol ';' . syntaxExpression forOptInc_ syntaxCloseParen closeParenBreakOK statement 0: On syntaxExpression to state 232 Reduce by 6: syntaxExpression -> . State 232: 96: forStatement -> for_ '(' syntaxInit optInit syntaxSemicol ';' syntaxExpression optCondition syntaxSemicol ';' syntaxExpression . forOptInc_ syntaxCloseParen closeParenBreakOK statement 0: On forOptInc_ to state 233 1: On flowArgs to state 234 2: On argsNull to state 235 3: On expression to state 199 4: On exprStart_ to state 58 5: On '[' to state 59 6: On identifier to state 60 7: On '`' to state 61 8: On '(' to state 62 9: On '+' to state 63 10: On '-' to state 64 11: On '~' to state 65 12: On '!' to state 66 13: On INCDEC to state 67 14: On exprUnit_ to state 72 15: On IDENTIFIER to state 20 16: On string to state 78 17: On NUMBER to state 79 18: On string_ to state 80 19: On STRING to state 81 Reduce by 32: argsNull -> . State 233: 96: forStatement -> for_ '(' syntaxInit optInit syntaxSemicol ';' syntaxExpression optCondition syntaxSemicol ';' syntaxExpression forOptInc_ . syntaxCloseParen closeParenBreakOK statement 0: On syntaxCloseParen to state 236 Reduce by 3: syntaxCloseParen -> . State 234: 94: forOptInc_ -> flowArgs . 85: flowArgs -> flowArgs . ',' expression 0: On ',' to state 207 Reduce by 94: forOptInc_ -> flowArgs . State 235: 95: forOptInc_ -> argsNull . Reduce by 95: forOptInc_ -> argsNull . State 236: 96: forStatement -> for_ '(' syntaxInit optInit syntaxSemicol ';' syntaxExpression optCondition syntaxSemicol ';' syntaxExpression forOptInc_ syntaxCloseParen . closeParenBreakOK statement 0: On closeParenBreakOK to state 237 1: On ')' to state 213 State 237: 96: forStatement -> for_ '(' syntaxInit optInit syntaxSemicol ';' syntaxExpression optCondition syntaxSemicol ';' syntaxExpression forOptInc_ syntaxCloseParen closeParenBreakOK . statement 0: On statement to state 238 1: On stAlt_ to state 43 2: On varType to state 44 3: On stBreak_ to state 45 4: On stContinue_ to state 46 5: On stCompound_ to state 47 6: On ';' to state 48 7: On expression to state 49 8: On returnStatement to state 50 9: On whileStatement to state 51 10: On ifStatement to state 52 11: On forStatement to state 53 12: On errTok_ to state 54 13: On varType_ to state 6 14: On BREAK to state 55 15: On CONTINUE to state 56 16: On openCurly to state 57 17: On exprStart_ to state 58 18: On '[' to state 59 19: On identifier to state 60 20: On '`' to state 61 21: On '(' to state 62 22: On '+' to state 63 23: On '-' to state 64 24: On '~' to state 65 25: On '!' to state 66 26: On INCDEC to state 67 27: On retLeave_ to state 68 28: On while_ to state 69 29: On if_ to state 70 30: On for_ to state 71 31: On INT to state 8 32: On STRINGTYPE to state 9 33: On LIST to state 10 34: On '{' to state 28 35: On exprUnit_ to state 72 36: On IDENTIFIER to state 20 37: On RETURN to state 73 38: On EXIT to state 74 39: On WHILE to state 75 40: On IF to state 76 41: On FOR to state 77 42: On string to state 78 43: On NUMBER to state 79 44: On string_ to state 80 45: On STRING to state 81 State 238: 96: forStatement -> for_ '(' syntaxInit optInit syntaxSemicol ';' syntaxExpression optCondition syntaxSemicol ';' syntaxExpression forOptInc_ syntaxCloseParen closeParenBreakOK statement . Reduce by 96: forStatement -> for_ '(' syntaxInit optInit syntaxSemicol ';' syntaxExpression optCondition syntaxSemicol ';' syntaxExpression forOptInc_ syntaxCloseParen closeParenBreakOK statement . icmake-10.03.00/comp/parser/functionhead.cc0000644000175000017500000000017014204126313017352 0ustar frankfrank//#define XERR #include "parser.ih" void Parser::functionHead() { d_symtab.functionParams(); d_breakOK = 0; }; icmake-10.03.00/comp/parser/checkbreakok.cc0000644000175000017500000000025314204126313017321 0ustar frankfrank//#define XERR #include "parser.ih" SemVal Parser::checkBreakOK() const { SemVal ret; if (not d_breakOK) Error::msg(Error::NO_BREAK); return ret; } icmake-10.03.00/comp/parser/pushprint.cc0000644000175000017500000000052114204126313016737 0ustar frankfrank//#define XERR #include "parser.ih" SemVal Parser::pushPrint(SemVal &expr) const { return expr.type() & e_printMask ? function( expr.type() == e_printf ? "printf" : "fprintf", Args{ expr.printfArgs() } ).exprStmnt() : move(expr); } icmake-10.03.00/comp/parser/continuestmnt.cc0000644000175000017500000000023314204126313017615 0ustar frankfrank//#define XERR #include "parser.ih" SemVal Parser::continueStmnt() const { SemVal ret{ checkBreakOK() }; ret.continueStmnt(); return ret; } icmake-10.03.00/comp/parser/cgrammar0000644000175000017500000003527714204126313016130 0ustar frankfrank_args: _args comma errExpression { $$ = smvAddArg(&$1, &$3); } | errExpression { $$ = SVarg(&$1); } ; args: _args { $$ = smvArgs2code(&$1); // convert the arguments to code } ; breakOK: { ++gp_breakOK; } ; breakStmnt: BREAK { $$ = pmv_break(); } ; closeBrace: { gp_parse_error = err_closeBrace_expected; symtab_pop(); } /* '{' for matching */ '}' ; closeParen: { gp_parse_error = err_closeParen_expected; } ')' ; comma: { gp_parse_error = err_comma_expected; } ',' ; compound: openBrace statements closeBrace { $$ = SVmove(&$2); } ; condition: errExpression | typedCondition ; continueStmnt: CONTINUE { $$ = pmv_continue(); } ; defVarOrFun: typedVarlist semicol { svCatenate(&gp_init, &$1); } | typeOfVar functionDef | _voidtype functionDef ; errExpression: { gp_parse_error = err_in_expression; } expression { $$ = SVmove(&$2); } ; exprCode: errExpression { $$ = pmv_expression(&$1); } ; _p_casttype: INT | LIST | STRINGTYPE ; _string: _string STRING { ssAppendBuf(util_string()); // append the next string } | STRING { ssSetBuf(util_string()); // assign the 1st string } ; _func_or_var: function closeParen | IDENTIFIER { msg("identifier: %s", util_string()); $$ = pmv_fetchVar(); } ; _backtick: { gp_parse_error = err_backtick_expected; } '`' ; expression: expression '=' expression { msg("inc/expression.5: assignment (=)"); $$ = pmv_assign(&$1, &$3); } | expression '[' expression ']' { $$ = pmv_indexOp(&$1, &$3); } | expression MUL_IS expression { $$ = pmv_compoundAss(&$1, &$3, pmv_multiply, "*="); } | expression DIV_IS expression { $$ = pmv_compoundAss(&$1, &$3, pmv_divide, "/="); } | expression MOD_IS expression { $$ = pmv_compoundAss(&$1, &$3, pmv_modulo, "%="); } | expression PLUS_IS expression { $$ = pmv_compoundAss(&$1, &$3, pmv_addition, "+="); } | expression MINUS_IS expression { $$ = pmv_compoundAss(&$1, &$3, pmv_subtract, "-="); } | expression AND_IS expression { $$ = pmv_compoundAss(&$1, &$3, pmv_bitand, "&="); } | expression OR_IS expression { $$ = pmv_compoundAss(&$1, &$3, pmv_bitor, "|="); } | expression XOR_IS expression { $$ = pmv_compoundAss(&$1, &$3, pmv_xor, "^="); } | expression SHL_IS expression { $$ = pmv_compoundAss(&$1, &$3, pmv_shl, "<<="); } | expression SHR_IS expression { $$ = pmv_compoundAss(&$1, &$3, pmv_shr, ">>="); } | expression OR expression { $$ = pmv_or(&$1, &$3); } | expression AND expression { $$ = pmv_and(&$1, &$3); } | expression EQUAL expression { $$ = pmv_equal(&$1, &$3); } | expression NOT_EQUAL expression { $$ = pmv_notEqual(&$1, &$3); } | expression '?' expression ':' expression { $$ = pmv_ternary(&$1, &$3, &$5); } | expression '<' expression { $$ = pmv_smaller(&$1, &$3); } | expression '>' expression { $$ = pmv_greater(&$1, &$3); } | expression SMALLER_EQUAL expression { $$ = pmv_smEqual(&$1, &$3); } | expression GREATER_EQUAL expression { $$ = pmv_grEqual(&$1, &$3); } | expression '+' expression { $$ = pmv_addition(&$1, &$3); } | expression '&' expression { $$ = pmv_bitand(&$1, &$3); } | expression '|' expression { $$ = pmv_bitor(&$1, &$3); } | expression '^' expression { $$ = pmv_xor(&$1, &$3); } | expression SHL expression { $$ = pmv_shl(&$1, &$3); } | expression SHR expression { $$ = pmv_shr(&$1, &$3); } | expression '-' expression { $$ = pmv_subtract(&$1, &$3); } | expression '*' expression { $$ = pmv_multiply(&$1, &$3); } | expression YOUNGER expression { $$ = pmv_young(&$1, &$3); } | expression OLDER expression { $$ = pmv_old(&$1, &$3); } | expression '/' expression { $$ = pmv_divide(&$1, &$3); } | expression '%' expression { $$ = pmv_modulo(&$1, &$3); } | '-' expression %prec '!' { $$ = pmv_negate(&$2); } | INC expression { $$ = pmv_incDec(pre_op, op_inc, &$2); } | expression INC { $$ = pmv_incDec(post_op, op_inc, &$1); } | DEC expression { $$ = pmv_incDec(pre_op, op_dec, &$2); } | expression DEC { $$ = pmv_incDec(post_op, op_dec, &$1); } | '+' expression %prec '!' { $$ = SVmove(&$2); } | '~' expression %prec '!' { $$ = pmv_compl(&$2); } | '!' expression { $$ = pmv_not(&$2); } | '(' _p_casttype ')' expression %prec '!' { $$ = pmv_cast(svType(&$2), &$4); } | _string { $$ = SVtype(e_str | e_const, ssBuf()); } | NUMBER { $$ = SVtype(e_int | e_const, util_string()); } | '[' args ']' { msg("[ list ]"); $$ = pmv_listConst(&$2); } | '(' expression closeParen { $$ = SVmove(&$2); } | _func_or_var | '`' expression _backtick { $$ = pmv_oneArg(f_backtick, &$2); } ; _for: FOR nesting { symtab_push(); } ; _expr_list: _expr_list ',' exprCode { svCatenate(&$1, &$3); $$ = SVmove(&$1); } | exprCode ; _opt_init_expression: _expr_list | typedVarlist | zeroSemVal ; _opt_cond_expression: errExpression | { $$ = SVint(1); } ; _opt_inc_expression: _expr_list | zeroSemVal ; forStmnt: // $3: init, $5: cond, $7 inc, $10 stmnt _for openParen _opt_init_expression semicol _opt_cond_expression semicol _opt_inc_expression closeParen breakOK statement popDead { $$ = pmv_for(&$3, &$5, &$7, &$10); } ; _zero_arg_funs: GETCH | GETPID | GETS ; _one_arg_funs: ASCII | EVAL | EXISTS | LISTLEN | ECHO_TOKEN | CMD_TAIL | CMD_HEAD | ARG_HEAD | ARG_TAIL | G_BASE | G_PATH | G_EXT | G_DEXT | PUTENV | GETENV | STRLEN | STRUPR | STRLWR | TRIM | TRIMLEFT | TRIMRIGHT ; _two_arg_funs: C_EXT /* string, string */ | C_BASE | C_PATH | ELEMENT /* int, list | int, string */ | FGETS /* list fgets(string, int) */ | FIELDS /* string, string */ | LISTFIND /* list, string */ | LISTUNION /* list, list | list, string */ | STRCHR /* string, string */ | STRFIND /* string, string */ | RESIZE /* string, int */ ; _optint_string: STAT | CHDIR | SYSTEM ; _comma_expr: ',' errExpression { $$ = SVmove(&$2); } | zeroSemVal ; _optint_special: /* optional extra int arg is OK */ EXEC /* indicating P_CHECK (0) or */ | /* P_NOCHECK (2) */ EXECUTE ; _comma_arglist: ',' args /* argument list, see */ { /* README.args */ $$ = SVmove(&$2); } | zeroSemVal /* 0 arguments */ ; _opt_arglist: args | zeroSemVal ; _funname: IDENTIFIER { $$ = SVint(p_functionIdx()); } ; function: _zero_arg_funs /* getch() or gets() */ openParen { $$ = pmv_zeroArgs(svType(&$1)); } | _one_arg_funs openParen errExpression { $$ = pmv_oneArg(svType(&$1), &$3); } | _two_arg_funs openParen errExpression comma errExpression { $$ = pmv_twoArgs(svType(&$1), &$3, &$5); } | SUBSTR /* three arg function */ openParen errExpression comma errExpression comma errExpression { $$ = pmv_threeArgs($1.type, &$3, &$5, &$7); } | _optint_string /* CHDIR, SYSTEM, STAT */ openParen errExpression /* int inserted if string */ _comma_expr /* may be string if first == int */ { $$ = pmv_optIntString(svType(&$1), &$3, &$4); } | _optint_special /* $1 EXEC, EXECUTE */ openParen /* alternatives: */ errExpression /* $3 fun(int, string, ...) */ _comma_arglist /* $4 or fun(string, ...) */ { $$ = pmv_checkSpecial(svType(&$1), &$3, &$4); } | PRINTF openParen args /* first may be anything */ { $$ = pmv_specials(f_printf, &$3); } | FPRINTF openParen args /* argcount >= 2 required */ { $$ = pmv_fprintf(svType(&$1), &$3); } | STRFORMAT openParen args /* first may be anything */ { $$ = pmv_specials(f_strformat, &$3); } | _funname openParen _opt_arglist { $$ = pmv_callFunction(svValue(&$1), &$3); } | makeList ; /* parameters are defined as local variables of the current function, while counting the number of parameters. At the end of a function definition head its symtab nParams fields holds the number of its parameters, which are represented by the initial nParams elements of symtab's local variables array. */ _partype: typeOfVar enterID ; _pars: _pars comma _partype | _partype ; _opt_parlist: _pars | /* empty */ ; _funvars: openParen _opt_parlist ')' openBrace { symtab_setFunParams(); /* the # variables so far are the parameters */ } ; _funid: IDENTIFIER { p_beginFunction(); } ; functionDef: _funid /* name of the function */ _funvars /* returns init code */ statements closeBrace { p_endFunction(&$3); } ; _if: IF nesting { symtab_push(); } ; _else: ELSE statement { $$ = SVmove(&$2); } | zeroSemVal ; ifStmnt: // $3 $5 $8 _if openParen condition closeParen statement popDead pushDead _else popDead { $$ = pmv_if(&$3, &$5, &$8); symtab_pop(); } ; _makelistCall: MAKELIST openParen errExpression { $$ = SVmove(&$3); } ; _makeList_normal: { $$ = SVint(IS_FILE); } ; _old_young: OLDER | YOUNGER ; _older_younger: { gp_parse_error = err_older_younger; } _old_young { $$ = SVmove(&$2); } ; makeList: _makelistCall /* regex ($1) */ _makeList_normal /* O_FILE IS_FILE expression */ { $$ = pmv_makeList1(&$1, &$2); // makelist of a file regex } | _makelistCall /* match mode (O_FILE, $1) */ comma errExpression /* regex ($3) */ { $$ = pmv_makeList1(&$3, &$1); } | _makelistCall /* regex ($1) */ comma _older_younger /* decision mode ($3) */ comma errExpression /* compare file ($5) */ _makeList_normal /* O_FILE mode ($6) */ { $$ = pmv_makeList2(svType(&$3), &$6, &$1, &$5); } | _makelistCall /* match mode ($1) */ comma errExpression /* regex ($3) */ comma _older_younger /* decision mode ($5) */ comma errExpression /* compare file ($7) */ { $$ = pmv_makeList2(svType(&$5), &$1, &$3, &$7); } ; nesting: pushDead { ++gp_nestLevel; } ; ok: ';' { yyerrok; } ; openBrace: { gp_parse_error = err_openBrace_expected; } '{' /* } (for matching) */ { symtab_push(); } ; openParen: { gp_parse_error = err_openParen_expected; } '(' ; popDead: { deadPop(); } ; pushDead: { deadPush(); // set new dead-level } ; _return_tail: errExpression | zeroSemVal ; _leave: RETURN { msg("saw return"); } | EXIT ; returnStmnt: _leave _return_tail { $$ = pmv_return(svType(&$1), &$2); msg("SAW return stmt"); } ; semicol: { gp_parse_error = err_semicol_expected; } ';' ; _stm: compound | ';' zeroSemVal { $$ = SVmove(&$2); } | exprCode semicol | whileStmnt | ifStmnt | forStmnt | returnStmnt semicol | breakStmnt semicol | continueStmnt semicol | error ok { $$ = SVint(0); svPushStack(&$$); } ; statement: _stm | typedVarlist semicol ; statements: statements statement { $$ = pmv_catStmnts(&$1, &$2); } | zeroSemVal ; typedCondition: typeOfVar varCondition { $$ = SVmove(&$2); } ; typedVarlist: typeOfVar varExprList { $$ = SVmove(&$2); } ; varCondition: enterVarID { svAddCode(&$1, op_push_imm, 0); $$ = SVmove(&$1); } | enterVarID '=' expression { $$ = pmv_assign(&$1, &$3); /* explicit initialization */ } ; _while: WHILE nesting ; whileStmnt: // $3 $6 _while openParen condition closeParen breakOK statement popDead { $$ = pmv_while(&$3, &$6, 1); } ; enterID: IDENTIFIER { p_defineVar(); /* the first n variables of a function, up to the end of the parameter list are the parameters. */ } ; enterVarID: enterID { $$ = pmv_fetchVar(); } ; >>> typeOfVar: -> varType >>> varExpr: >>> varExprList: varsDefList >>> zeroSemVal: icmake-10.03.00/comp/parser/icmconf0000777000175000017500000000000014204126313020500 2../../icmconf.dirustar frankfrankicmake-10.03.00/comp/parser/semvalpoppush.cc0000644000175000017500000000017714204126313017620 0ustar frankfrank//#define XERR #include "parser.ih" // static void Parser::semValPopPush() { SemVal::popDead(); SemVal::pushDead(); } icmake-10.03.00/comp/parser/ifstmnt.cc0000644000175000017500000000047314204126313016375 0ustar frankfrank//#define XERR #include "parser.ih" // 'cond' contains the initialization list and the actual condition as // its final element: see also Args::ifStmnt SemVal Parser::ifStmnt(Args &cond, SemVal &trueStmnt, SemVal &falseStmnt) { SemVal ret = cond.ifStmnt(trueStmnt, falseStmnt); pop(); return ret; } icmake-10.03.00/comp/parser/scanner.f0000644000175000017500000000011014204126313016166 0ustar frankfrankinline Scanner const &Parser::scanner() const { return d_scanner; } icmake-10.03.00/comp/parser/inc/0000755000175000017500000000000014204171312015146 5ustar frankfrankicmake-10.03.00/comp/parser/inc/definevar0000644000175000017500000000075414204126313017043 0ustar frankfrankdefineVar_: identifier { // define an identifier in the symbol table // initializing it to 0, return a SemVal holding its type and index $$ = d_symtab.defineVar(d_type, $1); // define the var. } ; defineVar: defineVar_ | defineVar_ '=' syntaxExpression expression { $$ = defineVar($1, $4); // define and keep the // global var. init. code } ; icmake-10.03.00/comp/parser/inc/newparser0000755000175000017500000000004414204126313017101 0ustar frankfrank#!/bin/bash cd .. bisonc++ grammar icmake-10.03.00/comp/parser/inc/ifstatement0000644000175000017500000000150614204126313017417 0ustar frankfrankif_: IF { push(); } ; ifElse_: ELSE { semValPopPush(); } ; ifStatementElse_: ifElse_ statement { $$ = move($2); } | { $$ = SemVal{}; } ; ifCond_: condition { $$ = Args{ $1 }; } | ';' condition { $$ = Args{ $2 }; } | flowInit ';' condition { $$ = move($1.add($3)); // $$ contains "if ('init'; cond)" // initialization list + the condition as // final Args element. } ; ifStatement: // condition: $4, statement: $8, ifStatementElse: $9 if_ '(' syntaxExpression ifCond_ syntaxCloseParen ')' syntaxExpression statement ifStatementElse_ { $$ = ifStmnt($4, $8, $9); // also does d_dymtab.pop() } ; icmake-10.03.00/comp/parser/inc/statement0000644000175000017500000000120214204126313017071 0ustar frankfrankstBreak_: BREAK { $$ = move(breakStmnt()); } ; stContinue_: CONTINUE { $$ = move(continueStmnt()); } ; stCompound_: openCurly statements closeCurly { $$ = move($2); } ; stAlt_: stBreak_ ';' | stContinue_ ';' | stCompound_ | ';' { $$ = SemVal{}; } | expression ';' { $$ = exprStmnt($1); } | returnStatement ';' | whileStatement | ifStatement | forStatement | error ';' { $$ = SemVal{}; } ; statement: stAlt_ | varType localVars ';' { $$ = move($2); } ; icmake-10.03.00/comp/parser/inc/args0000644000175000017500000000077014204126313016032 0ustar frankfrankargsExpr: expression { $$ = move($1); } | ORDER opValue // int const with older/younger { // as with makelist(..., older, ...) $$ = SemVal{ e_order, $2 }; } ; args: args ',' argsExpr // Expr { $$ = $1.add($3); } | argsExpr { $$ = Args{ $1 }; } ; argsNull: { $$ = Args{}; } ; argsOpt: args | argsNull ; icmake-10.03.00/comp/parser/inc/string0000644000175000017500000000060714204171312016402 0ustar frankfrankstring_: string_ STRING { $$ = $1 + d_scanner.matched(); } | STRING { $$ = d_scanner.matched(); } ; string: string_ { // store the string, return its SemVal $$ = SemVal{ e_str | e_const, use(StringStore::instance().offset($1)) }; } ; icmake-10.03.00/comp/parser/inc/returnstatement0000644000175000017500000000050114204126313020332 0ustar frankfrankretExpr_: expression | { $$ = SemVal{ e_void }; } ; retLeave_: RETURN { $$ = Tokens::RETURN; } | EXIT { $$ = Tokens::EXIT; } ; returnStatement: retLeave_ syntaxExpression retExpr_ { $$ = returnStmnt($1, $3); // also handles exit() } ; icmake-10.03.00/comp/parser/inc/defvarorfun0000644000175000017500000000031514204126313017412 0ustar frankfrank_voidtype: VOID { d_type = e_void; } ; _definition: varType globalVars ';' | varType functionDef | _voidtype functionDef ; defVarOrFun: _definition syntaxTypename ; icmake-10.03.00/comp/parser/inc/whilestatement0000644000175000017500000000041514204126313020127 0ustar frankfrankwhile_: WHILE { push(); } ; whileStatement: // condition: $4 statement: $7 while_ '(' syntaxExpression condition syntaxCloseParen closeParenBreakOK statement { $$ = forStmnt(Args{}, $4, Args{}, $7); } ; icmake-10.03.00/comp/parser/inc/vartype0000644000175000017500000000030714204126313016564 0ustar frankfrankvarType_: INT { d_type = e_int; } | STRINGTYPE { d_type = e_str; } | LIST { d_type = e_list; } ; varType: varType_ syntaxIdentifier ; icmake-10.03.00/comp/parser/inc/flowargs0000644000175000017500000000021214204126313016711 0ustar frankfrankflowArgs: flowArgs ',' expression { $$ = move($1.add($3)); } | expression { $$ = Args{ $1 }; } ; icmake-10.03.00/comp/parser/inc/functiondef0000644000175000017500000000105514204126313017377 0ustar frankfrankfdName_: identifier { d_symtab.defineFunction(d_type, $1); } ; fdParamName_: identifier { d_symtab.defineVar(d_type, $1); } ; fdParam_: varType fdParamName_ syntaxCommaOrCloseparen ; fdParams_: fdParams_ ',' syntaxTypename fdParam_ | fdParam_ ; fdOptParams_: fdParams_ | // empty ; fdHead_: fdName_ '(' fdOptParams_ ')' syntaxOpenCurly { functionHead(); } ; functionDef: fdHead_ openCurly statements closeCurly { functionDefined($3); } ; icmake-10.03.00/comp/parser/inc/statements0000644000175000017500000000017514204126313017264 0ustar frankfrankstatements: statements statement { $$ = catStatements($1, $2); } | { $$ = SemVal{}; } ; icmake-10.03.00/comp/parser/inc/polymorphic0000644000175000017500000000143714204126313017444 0ustar frankfrank%polymorphic STRING: std::string; SEMVAL: SemVal; ARGS: Args; TOKEN: Tokens::Tokens_; OPCODE: Opcode::Byte; %type identifier string_ %type argsExpr condition, conditionVar_ defineVar_ defineVar exprUnit_ exprStart_ expression ifStatement ifStatementElse_ localVars optCondition retExpr_ stAlt_ stBreak_ stCompound_ stContinue_ statement statements string whileStatement %type argsOpt argsNull args flowArgs // size >= 1 flowInit // size >= 1 flowInitDefs_ ifCond_ // last element is the condition optInit forOptInc_ %type cast retLeave_ %type opValue icmake-10.03.00/comp/parser/inc/globalvars0000644000175000017500000000026114204126313017225 0ustar frankfrankglobalVars: globalVars ',' defineVar syntaxCommaOrSemicol { d_initCode << $3; } | defineVar syntaxCommaOrSemicol { d_initCode << $1; } ; icmake-10.03.00/comp/parser/inc/opencurly0000644000175000017500000000015114204126313017107 0ustar frankfrankopenCurly: '{' { Error::set(Error::STATEMENT); d_symtab.push(); } ; icmake-10.03.00/comp/parser/inc/identifier0000644000175000017500000000011314204126313017207 0ustar frankfrankidentifier: IDENTIFIER { $$ = d_scanner.matched(); } ; icmake-10.03.00/comp/parser/inc/syntax0000644000175000017500000000121114204126313016413 0ustar frankfranksyntaxCloseParen: { Error::set(Error::CLOSEPAREN); } ; syntaxCommaOrSemicol: { Error::set(Error::COMMA_OR_SEMICOL); } ; syntaxCommaOrCloseparen: { Error::set(Error::COMMA_OR_CLOSEPAREN); } ; syntaxExpression: { Error::set(Error::EXPRESSION); } ; syntaxIdentifier: { Error::set(Error::IDENTIFIER); } ; syntaxInit: { Error::set(Error::INIT); } ; syntaxOpenCurly: { Error::set(Error::OPENCURLY); } ; syntaxSemicol: { Error::set(Error::SEMICOL); } ; syntaxTypename: { Error::set(Error::TYPENAME); } ; icmake-10.03.00/comp/parser/inc/condition0000644000175000017500000000017314204126313017061 0ustar frankfrankconditionVar_: varType defineVar { $$ = move($2); } ; condition: expression | conditionVar_ ; icmake-10.03.00/comp/parser/inc/opvalue0000644000175000017500000000011214204171312016536 0ustar frankfrankopValue: { $$ = use(d_scanner.expr()); } ; icmake-10.03.00/comp/parser/inc/flowinit0000644000175000017500000000035214204126313016725 0ustar frankfrankflowInitDefs_: flowInitDefs_ ',' defineVar { $$ = move($1.add($3)); } | defineVar { $$ = Args{ $1 }; } ; flowInit: flowArgs | varType flowInitDefs_ { $$ = move($2); } ; icmake-10.03.00/comp/parser/inc/closecurly0000644000175000017500000000007214204126313017255 0ustar frankfrankcloseCurly: '}' { d_symtab.pop(); } ; icmake-10.03.00/comp/parser/inc/cast0000644000175000017500000000033414204126313016024 0ustar frankfrankcast: INT { $$ = Tokens::INT; } | LIST { $$ = Tokens::LIST; } | STRINGTYPE { $$ = Tokens::STRINGTYPE; } | BOOL { $$ = Tokens::BOOL; } ; icmake-10.03.00/comp/parser/inc/closeparenbreakok0000644000175000017500000000007614204126313020567 0ustar frankfrankcloseParenBreakOK: ')' { ++d_breakOK; } ; icmake-10.03.00/comp/parser/inc/expression0000644000175000017500000000615714204126313017302 0ustar frankfrankexprUnit_: string // semval is a string | NUMBER // value in d_scanner.expr() { $$ = SemVal{ e_int | e_const, d_scanner.expr() }; } | identifier { $$ = variable($1); } ; exprStart_: exprUnit_ syntaxExpression ; expression: exprStart_ | '[' argsOpt ']' // list constant { $$ = $2.callBuiltin(Builtin::LISTCONST); } | expression '[' expression ']' { $$ = index($1, $3); // index calls pushPrint($3) } | identifier '(' argsOpt ')' // all function calls { $$ = function($1, move($3)); // function calls pushPrint for // $3's elements } | '`' expression '`' { $$ = function("`", Args{ $2 }); } | '(' expression ')' // was: open/closeParen { $$ = pushPrint($2); } | '+' expression %prec '!' { $$ = $2; } | '-' expression %prec '!' { $$ = $2.negate(); } | '~' expression %prec '!' { $$ = $2.bitNot(); } | '!' expression { $$ = $2.boolNot(); } | INCDEC opValue expression { $$ = $3.incDec($2, e_prefix); } | expression INCDEC opValue { $$ = $1.incDec($3, e_postfix); } | '(' cast ')' expression %prec '!' { $$ = $4.cast($2); } | expression '+' expression // operators with higher prioritoes: { // no pushPrint $$ = $1.binary(Opcode::add, move($3)); } | expression '-' expression { $$ = $1.binary(Opcode::sub, move($3)); } | expression MULTIPLY opValue expression { $$ = $1.binary($3, move($4)); } | expression SHIFT opValue expression { $$ = shiftOrPrint($1, $3, $4); // e_(f)printf is set by variable() } | expression ORDER opValue expression { $$ = binary($1, $3, $4); } | expression EQUALITY opValue expression { $$ = binary($1, $3, $4); // Parser::binary handles print insertions } | expression '&' expression { $$ = binary($1, Opcode::band, $3); } | expression '^' expression { $$ = binary($1, Opcode::bxor, $3); } | expression '|' expression { $$ = binary($1, Opcode::bor, $3); } | expression AND expression { $$ = pushPrint($1).logicAnd(pushPrint($3)); } | expression OR expression { $$ = pushPrint($1).logicOr(pushPrint($3)); } | expression '?' expression ':' expression { $$ = pushPrint($1).ternary(pushPrint($3), pushPrint($5)); } | expression '=' expression // operators with lower prioritoes than '<<' { // use pushPrint to handle print insertions $$ = $1.assign(pushPrint($3), Opcode::copy_var); } | expression MATH_IS opValue expression { $$ = $1.compound($3, pushPrint($4)); } ; icmake-10.03.00/comp/parser/inc/optinit0000644000175000017500000000005014204126313016553 0ustar frankfrankoptInit: flowInit | argsNull ; icmake-10.03.00/comp/parser/inc/localvars0000644000175000017500000000025714204126313017064 0ustar frankfranklocalVars: localVars ',' defineVar syntaxCommaOrSemicol { $$ = move($1 << $3); } | defineVar syntaxCommaOrSemicol { $$ = move($1); } ; icmake-10.03.00/comp/parser/inc/forstatement0000644000175000017500000000120714204126313017605 0ustar frankfrankfor_: FOR { push(); } ; forOptInc_: flowArgs | argsNull ; forStatement: // $4: init, $8: cond, $12: inc, $15: stmnt // init: Args, cond: SemVal, inc: Args, // statement: SemVal for_ '(' syntaxInit optInit syntaxSemicol ';' syntaxExpression // 4 . . . optCondition syntaxSemicol ';' syntaxExpression // 8 . . . forOptInc_ syntaxCloseParen closeParenBreakOK // 12 . . statement // 15 { $$ = forStmnt(move($4), $8, move($12), $15); // also: pops } ; icmake-10.03.00/comp/parser/inc/optcondition0000644000175000017500000000012714204126313017603 0ustar frankfrankoptCondition: condition | { $$ = SemVal{ e_int | e_const, 1 }; } ; icmake-10.03.00/comp/parser/breakstmnt.cc0000644000175000017500000000022514204126313017056 0ustar frankfrank//#define XERR #include "parser.ih" SemVal Parser::breakStmnt() const { SemVal ret{ checkBreakOK() }; ret.breakStmnt(); return ret; } icmake-10.03.00/comp/parser/grammar0000644000175000017500000000300214204126313015742 0ustar frankfrank//%default-actions quiet %filenames parser %scanner ../scanner/scanner.h //%debug // %print-tokens %token-path ../tokens/tokens.h %baseclass-preinclude "preinclude.h" %include inc/polymorphic %token BOOL BREAK CONTINUE ELSE EXIT FOR IDENTIFIER IF INT LIST NUMBER RETURN STRING STRINGTYPE VOID WHILE %right '=' MATH_IS %right '?' ':' %left OR %left AND %left '|' %left '^' %left '&' %left EQUALITY %left ORDER %left SHIFT %left '+' '-' %left MULTIPLY %right '!' '~' INCDEC %left '[' // highest precedence %expect 1 %% input: input defVarOrFun | defVarOrFun ; %include inc/syntax // %include inc/opvalue // %include inc/opencurly // %include inc/closecurly // %include inc/closeparenbreakok %include inc/vartype // %include inc/string // %include inc/cast // %include inc/identifier // %include inc/args // %include inc/definevar // %include inc/globalvars // %include inc/localvars // %include inc/expression // %include inc/condition // %include inc/optcondition // %include inc/returnstatement // %include inc/whilestatement %include inc/flowargs // %include inc/flowinit // %include inc/optinit // %include inc/forstatement %include inc/ifstatement // %include inc/statement // %include inc/statements // %include inc/functiondef // %include inc/defvarorfun // icmake-10.03.00/comp/parser/exceptionhandler.f0000644000175000017500000000013014204126313020073 0ustar frankfrankinline void Parser::exceptionHandler(std::exception const &exc) { throw; } icmake-10.03.00/comp/parser/forstmnt.cc0000644000175000017500000000032314204126313016557 0ustar frankfrank#define XERR #include "parser.ih" SemVal Parser::forStmnt(Args &&init, SemVal &cond, Args &&inc, SemVal &stmnt) { SemVal ret = init.forStmnt(cond, inc, stmnt); pop(); --d_breakOK; return ret; } icmake-10.03.00/comp/parser/returnstmnt.cc0000644000175000017500000000123014204126313017306 0ustar frankfrank//#define XERR #include "parser.ih" SemVal Parser::returnStmnt(Tokens::Tokens_ type, SemVal &expr) const { xerr("before push: " << expr.type()); expr.push(); // nothing's pushed when e_void xerr("after push: " << expr.type()); SemVal ret; if (type == Tokens::RETURN) ret = functionReturn(expr); else if (equalMask(expr.type(), e_int)) // EXIT: must have ints ret << expr << Opcode::pop_reg << Opcode::exit; else Error::msg(Error::EXIT_TYPE) << d_functions.name() << "'\n"; ret.ends(); return ret; } icmake-10.03.00/comp/parser/variable.cc0000644000175000017500000000151414204126313016473 0ustar frankfrank//#define XERR #include "parser.ih" // see README.stackframe for the organization of the stack frames SemVal Parser::variable(string const &name) { // `name' may be '(f)printf' in which case a SemVal whose type is // e_(f)printf is returned, which is only recognized by the << operator Symtab::Var var = d_symtab.findVar(name); if (var.location != 0xc000) return SemVal{ var.varType, var.location }; if (name == "printf") return SemVal{ e_printf }; // (f)printf insertions don't // have return values: cannot if (name == "fprintf") // be nested in expressions return SemVal{ e_fprintf }; Error::msg(Error::UNDEFINED_VAR) << name << "'\n"; return SemVal{ e_int | e_var }; // pseudo int-var return } icmake-10.03.00/comp/parser/index.cc0000644000175000017500000000125714204126313016021 0ustar frankfrank//#define XERR #include "parser.ih" // rhs is the index SemVal Parser::index(SemVal &lhs, SemVal &rhs) const { rhs = pushPrint(rhs); if ( not (lhs.type() & (e_str | e_list)) // lhs must be string or list or not (rhs.type() & e_int) // rhs must be an int ) { Error::msg(Error::INDEX_TYPE); return SemVal{ e_str | e_const }; } Args args{ rhs }; args.add(lhs); xerr("calling " << (lhs.type() & e_str ? "STR_EL" : "LIST_ELEMENT")); return args.callBuiltin( lhs.type() & e_str ? Builtin::STR_EL : Builtin::LIST_ELEMENT ); } icmake-10.03.00/comp/parser/functionreturn.cc0000644000175000017500000000110414204126313017766 0ustar frankfrank#define XERR #include "parser.ih" // expr's value already pushed // SemVal Parser::functionReturn(SemVal &expr) const { // EXIT already handled if (not voidMask(d_functions.type(), expr.type())) Error::msg(Error::RETURN_TYPE) << d_functions.name() << "'\n"; else if (d_functions.type() != e_void) expr << Opcode::pop_reg; else if ( d_functions.isMain() and d_functions.mainInfo().returnType == e_void ) expr << Opcode::push_0 << Opcode::pop_reg; expr << Opcode::ret; return move(expr); } icmake-10.03.00/comp/parser/pop.cc0000644000175000017500000000014714204126313015505 0ustar frankfrank//#define XERR #include "parser.ih" void Parser::pop() { d_symtab.pop(); SemVal::popDead(); } icmake-10.03.00/comp/parser/preinclude.h0000644000175000017500000000017714204126313016706 0ustar frankfrank#ifndef INCLUDED_PREINCLUDE_H_ #define INCLUDED_PREINCLUDE_H_ #include "../semval/semval.h" #include "../args/args.h" #endif icmake-10.03.00/comp/parser/definevar.cc0000644000175000017500000000124614204171312016652 0ustar frankfrank#define XERR #include "parser.ih" // // pmv_expressionAssign(&$1, &$3); // $$ = d_symtab.defineVar(d_type, $1).assign($4, Opcode::pop_var); // // define the var. assign its // // value, use SemVal Parser::defineVar(SemVal &lhs, SemVal &expr) { SemVal ret{lhs.assign(move(expr), Opcode::pop_var) }; if (static_cast(ret.value()) >= 0) // global variables have pos. // if (as(ret.value()) >= 0) // global variables have pos. d_symtab.globalCode(ret.code()); // index values return ret; } icmake-10.03.00/comp/parser/shiftorprint.cc0000644000175000017500000000152014204126313017436 0ustar frankfrank//#define XERR #include "parser.ih" SemVal Parser::shiftOrPrint(SemVal &lhs, Opcode::Byte opcode, SemVal &rhs) const { if (lhs.type() & e_printMask) // lhs is a printf expression { if (opcode == Opcode::shl) // new printf argument: return lhs.printfArg(rhs); // add it to lhs, and done. // handle the >> operator: if (lhs.nPrintfArgs() > 0) // printf has arguments: first lhs = pushPrint(lhs); // handle the printf insertion else // printf w/o arguments: Error::msg(Error::PRINTF_OPCODE); // 'printf >>' is invalid } return lhs.binary(opcode, move(rhs)); // perform the >> operation } icmake-10.03.00/comp/parser/catstatements.cc0000644000175000017500000000025114204126313017562 0ustar frankfrank//#define XERR #include "parser.ih" // static SemVal Parser::catStatements(SemVal &stmnts, SemVal &stmnt) { stmnts.catStatement(stmnt); return move(stmnts); } icmake-10.03.00/comp/parser/frame0000644000175000017500000000006214204126313015411 0ustar frankfrank//#define XERR #include "parser.ih" Parser:: { } icmake-10.03.00/comp/parser/parserbase.h0000644000175000017500000002764514204171312016713 0ustar frankfrank// Generated by Bisonc++ V6.04.03 on Tue, 15 Feb 2022 18:39:11 +0100 // hdr/includes #ifndef ParserBase_h_included #define ParserBase_h_included #include #include #include // $insert polyincludes #include // $insert preincludes #include "preinclude.h" #include "../tokens/tokens.h" // hdr/baseclass namespace // anonymous { struct PI_; } // $insert polymorphic enum class Tag_ { OPCODE, TOKEN, ARGS, SEMVAL, STRING, }; namespace Meta_ { extern size_t const *t_nErrors; extern size_t const *s_nErrors_; template struct TypeOf; template struct TagOf; // $insert polymorphicSpecializations enum { sizeofTag_ = 5 }; extern char const *idOfTag_[]; template <> struct TagOf { static Tag_ const tag = Tag_::OPCODE; }; template <> struct TagOf { static Tag_ const tag = Tag_::TOKEN; }; template <> struct TagOf { static Tag_ const tag = Tag_::ARGS; }; template <> struct TagOf { static Tag_ const tag = Tag_::SEMVAL; }; template <> struct TagOf { static Tag_ const tag = Tag_::STRING; }; template <> struct TypeOf { typedef Opcode::Byte type; }; template <> struct TypeOf { typedef Tokens::Tokens_ type; }; template <> struct TypeOf { typedef Args type; }; template <> struct TypeOf { typedef SemVal type; }; template <> struct TypeOf { typedef std::string type; }; // Individual semantic value classes are derived from Base, offering a // member returning the value's Tag_, a member cloning the object of its // derived Semantic and a member returning a pointerr to its // derived Semantic data. See also Bisonc++'s distribution file // README.polymorphic-techical class Base { protected: Tag_ d_baseTag; // d_baseTag is assigned by Semantic. public: Base() = default; Base(Base const &other) = delete; virtual ~Base(); Tag_ tag() const; Base *clone() const; void *data() const; private: virtual Base *vClone() const = 0; virtual void *vData() const = 0; }; inline Base *Base::clone() const { return vClone(); } inline void *Base::data() const { return vData(); } inline Tag_ Base::tag() const { return d_baseTag; } // The class Semantic stores a semantic value of the type matching tg_ template class Semantic: public Base { typename TypeOf::type d_data; public: Semantic(); Semantic(Semantic const &other); // req'd for cloning // This constructor member template forwards its arguments to // d_data, allowing it to be initialized using whatever // constructor is available for DataType template Semantic(Params &&...params); private: Base *vClone() const override; void *vData() const override; }; template Semantic::Semantic() { d_baseTag = tg_; // Base's data member: } template Semantic::Semantic(Semantic const &other) : d_data(other.d_data) { d_baseTag = other.d_baseTag; } template template Semantic::Semantic(Params &&...params) : d_data(std::forward(params) ...) { d_baseTag = tg_; } template Base *Semantic::vClone() const { return new Semantic{*this}; } template void *Semantic::vData() const { return const_cast::type *>(&d_data); } // The class SType wraps a pointer to Base. It becomes the polymorphic // STYPE_ type. It also defines get members, allowing constructions like // $$.get to be used. class SType: private std::unique_ptr { typedef std::unique_ptr BasePtr; public: SType() = default; SType(SType const &other); SType(SType &&tmp); ~SType() = default; // Specific overloads are needed for SType = SType assignments SType &operator=(SType const &rhs); SType &operator=(SType &rhs); // required so it is used // instead of the template op= SType &operator=(SType &&tmp); // $insert polymorphicOpAssignDecl SType &operator=(Opcode::Byte const &value); SType &operator=(Opcode::Byte &&tmp); SType &operator=(Tokens::Tokens_ const &value); SType &operator=(Tokens::Tokens_ &&tmp); SType &operator=(Args const &value); SType &operator=(Args &&tmp); SType &operator=(SemVal const &value); SType &operator=(SemVal &&tmp); SType &operator=(std::string const &value); SType &operator=(std::string &&tmp); template void assign(Args &&...args); // By default the get()-members check whether the specified // matches the tag returned by SType::tag (d_data's tag). If they // don't match a run-time fatal error results. template typename TypeOf::type &get(); template typename TypeOf::type const &get() const; Tag_ tag() const; bool valid() const; }; inline SType::SType(SType const &other) : BasePtr{other ? other->clone() : 0} {} inline SType::SType(SType &&tmp) : BasePtr{std::move(tmp)} {} inline SType &SType::operator=(SType const &rhs) { reset(rhs->clone()); return *this; } inline SType &SType::operator=(SType &rhs) { reset(rhs->clone()); return *this; } inline SType &SType::operator=(SType &&tmp) { BasePtr::operator=(std::move(tmp)); return *this; } // $insert polymorphicOpAssignImpl inline SType &SType::operator=(Opcode::Byte const &value) { assign< Tag_::OPCODE >(value); return *this; } inline SType &SType::operator=(Opcode::Byte &&tmp) { assign< Tag_::OPCODE >(std::move(tmp)); return *this; } inline SType &SType::operator=(Tokens::Tokens_ const &value) { assign< Tag_::TOKEN >(value); return *this; } inline SType &SType::operator=(Tokens::Tokens_ &&tmp) { assign< Tag_::TOKEN >(std::move(tmp)); return *this; } inline SType &SType::operator=(Args const &value) { assign< Tag_::ARGS >(value); return *this; } inline SType &SType::operator=(Args &&tmp) { assign< Tag_::ARGS >(std::move(tmp)); return *this; } inline SType &SType::operator=(SemVal const &value) { assign< Tag_::SEMVAL >(value); return *this; } inline SType &SType::operator=(SemVal &&tmp) { assign< Tag_::SEMVAL >(std::move(tmp)); return *this; } inline SType &SType::operator=(std::string const &value) { assign< Tag_::STRING >(value); return *this; } inline SType &SType::operator=(std::string &&tmp) { assign< Tag_::STRING >(std::move(tmp)); return *this; } template void SType::assign(Args &&...args) { reset(new Semantic(std::forward(args) ...)); } template typename TypeOf::type &SType::get() { // $insert warnTagMismatches if (tag() != tg) { if (*t_nErrors != 0) const_cast(this)->assign(); else { std::cerr << "[Fatal] calling `.get(tg)] << ">()', but Tag " << idOfTag_[static_cast(tag())] << " is encountered. Try " "option --debug and call setDebug(Parser::ACTIONCASES)\n"; throw 1; // ABORTs } } return *static_cast::type *>( (*this)->data() ); } template typename TypeOf::type const &SType::get() const { // $insert warnTagMismatches if (tag() != tg) { if (*t_nErrors != 0) const_cast(this)->assign(); else { std::cerr << "[Fatal] calling `.get(tg)] << ">()', but Tag " << idOfTag_[static_cast(tag())] << " is encountered. Try " "option --debug and call setDebug(Parser::ACTIONCASES)\n"; throw 1; // ABORTs } } return *static_cast::type *>( (*this)->data() ); } inline Tag_ SType::tag() const { return valid() ? (*this)->tag() : static_cast(sizeofTag_); } inline bool SType::valid() const { return BasePtr::get() != 0; } } // namespace Meta_ // $insert parserbase class ParserBase: public Tokens { public: enum DebugMode_ { OFF = 0, ON = 1 << 0, ACTIONCASES = 1 << 1 }; // $insert tokens // $insert STYPE typedef Meta_::SType STYPE_; private: // state semval typedef std::pair StatePair; // token semval typedef std::pair TokenPair; int d_stackIdx = -1; std::vector d_stateStack; StatePair *d_vsp = 0; // points to the topmost value stack size_t d_state = 0; TokenPair d_next; int d_token; bool d_terminalToken = false; bool d_recovery = false; protected: enum Return_ { PARSE_ACCEPT_ = 0, // values used as parse()'s return values PARSE_ABORT_ = 1 }; enum ErrorRecovery_ { UNEXPECTED_TOKEN_, }; bool d_actionCases_ = false; // set by options/directives bool d_debug_ = true; size_t d_requiredTokens_; size_t d_nErrors_; // initialized by clearin() size_t d_acceptedTokens_; STYPE_ d_val_; ParserBase(); void ABORT() const; void ACCEPT() const; void ERROR() const; STYPE_ &vs_(int idx); // value stack element idx int lookup_() const; int savedToken_() const; int token_() const; size_t stackSize_() const; size_t state_() const; size_t top_() const; void clearin_(); void errorVerbose_(); void lex_(int token); void popToken_(); void pop_(size_t count = 1); void pushToken_(int token); void push_(size_t nextState); void redoToken_(); bool recovery_() const; void reduce_(int rule); void shift_(int state); void startRecovery_(); public: void setDebug(bool mode); void setDebug(DebugMode_ mode); }; // hdr/abort inline void ParserBase::ABORT() const { throw PARSE_ABORT_; } // hdr/accept inline void ParserBase::ACCEPT() const { throw PARSE_ACCEPT_; } // hdr/error inline void ParserBase::ERROR() const { throw UNEXPECTED_TOKEN_; } // hdr/savedtoken inline int ParserBase::savedToken_() const { return d_next.first; } // hdr/opbitand inline ParserBase::DebugMode_ operator&(ParserBase::DebugMode_ lhs, ParserBase::DebugMode_ rhs) { return static_cast( static_cast(lhs) & rhs); } // hdr/opbitor inline ParserBase::DebugMode_ operator|(ParserBase::DebugMode_ lhs, ParserBase::DebugMode_ rhs) { return static_cast(static_cast(lhs) | rhs); }; // hdr/recovery inline bool ParserBase::recovery_() const { return d_recovery; } // hdr/stacksize inline size_t ParserBase::stackSize_() const { return d_stackIdx + 1; } // hdr/state inline size_t ParserBase::state_() const { return d_state; } // hdr/token inline int ParserBase::token_() const { return d_token; } // hdr/vs inline ParserBase::STYPE_ &ParserBase::vs_(int idx) { return (d_vsp + idx)->second; } #endif icmake-10.03.00/comp/parser/functiondefined.cc0000644000175000017500000000037014204126313020051 0ustar frankfrank#define XERR #include "parser.ih" void Parser::functionDefined(SemVal &body) { SemVal function = d_symtab.functionDefined(body); d_functions.add(function.code()); //xerr("DISASSEMBLING"); //d_unAssembler.disassemble(function.code()); } icmake-10.03.00/comp/parser/push.cc0000644000175000017500000000015214204126313015662 0ustar frankfrank//#define XERR #include "parser.ih" void Parser::push() { d_symtab.push(); SemVal::pushDead(); } icmake-10.03.00/comp/scanner/0000755000175000017500000000000014204243136014536 5ustar frankfrankicmake-10.03.00/comp/scanner/cleanstring.cc0000644000175000017500000000112314204126313017350 0ustar frankfrank#define XERR #include "scanner.ih" int Scanner::cleanString() { string txt = matched(); if ( txt.front() == txt.back() // surrounding chars are equal and // and either ' or " "'\""s.find(txt.front()) != string::npos ) txt = txt.substr(1, txt.length() - 2); // then remove those chars setMatched( String::unescape(txt) ); // and unescape the returned // matched() string begin(StartCondition_::INITIAL); return Tokens::STRING; } icmake-10.03.00/comp/scanner/lex.cc0000644000175000017500000024766414204171312015654 0ustar frankfrank// Generated by Flexc++ V2.10.00 on Tue, 15 Feb 2022 18:39:11 +0100 #include #include #include #include #include // $insert class_ih #include "scanner.ih" // s_ranges_: use (unsigned) characters as index to obtain // that character's range-number. // The range for EOF is defined in a constant in the // class header file size_t const ScannerBase::s_ranges_[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 5, 6, 7, 8, 9,10,11,12,12,13,14,15,16,17,18,19,20, 20,20,20,20,20,20,21,21,22,22,23,24,25,26,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,51,52,53,54,55,56,57,58,59,60, 61,62,63,64,65,66,67,68,69,70,71,72,73,73,74,75,76,77,78,79,80,81,82,83,84, 85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85, 85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85, 85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85, 85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85, 85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85,85, 85,85,85,85,85,85, }; // $insert startcondinfo // s_dfa_ contains the rows of *all* DFAs ordered by start state. The // enum class StartCondition_is defined in the baseclass header. // StartCondition_::INITIAL is always 0. Each entry defines the row to // transit to if the column's character range was sensed. Row numbers are // relative to the used DFA, and d_dfaBase_ is set to the first row of // the subset to use. The row's final two values are respectively the // rule that may be matched at this state, and the rule's FINAL flag. If // the final value equals FINAL (= 1) then, if there's no continuation, // the rule is matched. If the BOL flag (8) is also set (so FINAL + BOL (= // 9) is set) then the rule only matches when d_atBOL is also true. int const ScannerBase::s_dfa_[][89] = { // INITIAL { 1, 2, 3, 1, 2, 4, 5, 6, 1, 7, 8, 9, 1,10,11, 1,12, 1,13,14, 15,15, 1,16,17,18, 1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,20,21,19,19,22,19,19,19,19,19,19, 1, 1, 1,23,19, 1,19,24, 25,19,26,27,19,19,28,19,19,29,19,30,31,19,32,33,19,19,34,35, 19,36,19, 1,37, 1,-1, -1, -1}, // 0 {-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,-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,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1, 72, -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,-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,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1, 3, -1}, // 2 {-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,-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,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1, 4, -1}, // 3 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,38,-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, -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, 72, -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,-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,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1, 15, -1}, // 5 {-1,-1,39,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,40, 40,40,-1,-1,-1,41,-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,-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, 72, -1}, // 6 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,42,-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, -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, 56, -1}, // 7 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,43,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,44,-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, -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, 72, -1}, // 8 {45,45,-1,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, 45,45,45,45,45,45,45,45,45,45,45,45,45,46,45,45,45,45,45,45, 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, 45,45,45,45,45,45,-1, 72, -1}, // 9 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,47,-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, -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, 54, -1}, // 10 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,48,-1,-1,-1,-1,-1, -1,-1,-1,-1,49,-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, -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, 72, -1}, // 11 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,50,-1,-1,-1, -1,-1,-1,-1,51,-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, -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, 72, -1}, // 12 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,52,-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, -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, 55, -1}, // 13 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,53, 53,-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,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 54,-1,-1,-1,-1,-1,-1, 13, -1}, // 14 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,15, 15,15,-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,-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, 12, -1}, // 15 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,55,56,-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, -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, 45, -1}, // 16 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,57,-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, -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, 72, -1}, // 17 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,58,59,-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,-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, 47, -1}, // 18 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 19 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,60,19,19,19,19,19,19,19, 61,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,62,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 20 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,63,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 21 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,64,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 22 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,65,-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, -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, 72, -1}, // 23 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,66,19,67,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 24 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,68,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 25 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,69,19,19,19,19,19,19,19,19,19,19, 70,19,19,-1,-1,-1,-1, 71, -1}, // 26 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,71,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 27 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,72,19,19,19,19,19,19,19,73,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 28 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,74,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 29 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,75,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 30 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,76,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 31 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,77,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 32 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,78,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 33 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,79,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 34 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,80,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 35 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,81,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 36 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,82,-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, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,83,-1,-1, 72, -1}, // 37 {-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,-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,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1, 44, -1}, // 38 {-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,-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,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1, -1, 7}, // 39 {-1,-1,84,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,40, 40,40,-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,-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}, // 40 {41,41,-1,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41, 41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41, 41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41, 41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41, 41,41,41,41,41,41,-1, -1, 6}, // 41 {-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,-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,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1, 34, -1}, // 42 {-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,-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,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1, 30, -1}, // 43 {-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,-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,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1, 36, -1}, // 44 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,85,-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,-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,-1,-1,-1,-1,-1, -1, -1}, // 45 {86,86,-1,86,86,86,86,86,86,86,86,87,86,86,86,86,86,86,86,88, 88,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, 86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86,86, 89,86,86,86,86,86,-1, -1, -1}, // 46 {-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,-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,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1, 33, -1}, // 47 {-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,-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,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1, 41, -1}, // 48 {-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,-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,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1, 35, -1}, // 49 {-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,-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,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1, 42, -1}, // 50 {-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,-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,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1, 32, -1}, // 51 {-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,-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,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1, 31, -1}, // 52 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,53, 53,-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,-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, 13, -1}, // 53 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,90, 90,90,-1,-1,-1,-1,-1,90,90,90,90,90,90,-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,90,90, 90,90,90,90,-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}, // 54 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,91,-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, -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, 53, -1}, // 55 {-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,-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,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1, 46, -1}, // 56 {-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,-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,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1, 43, -1}, // 57 {-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,-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,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1, 48, -1}, // 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,92,-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, -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, 52, -1}, // 59 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,93,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 60 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 61, -1}, // 61 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,94,19,19,95,19,96,19,19,19,19,19,19,19, 19,19,19,19,19,97,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 62 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,98,19,19,19,19,19,19,19,19,19,19, 99,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 63 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,100,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 64 {-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,-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,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1, 38, -1}, // 65 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,101,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 66 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,102,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 67 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,103,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 68 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,104,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 69 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,105,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 70 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,106,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 71 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 21, -1}, // 72 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,107,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 73 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,108,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 74 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,109, 19,19,19,-1,-1,-1,-1, 71, -1}, // 75 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,110,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 76 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,111,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 77 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,112,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 78 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,113,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 79 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,114,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 80 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,115,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 81 {-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,-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,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1, 37, -1}, // 82 {-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,-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,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1, 29, -1}, // 83 {-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,-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,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1, -1, 5}, // 84 {-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,-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,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1, 8, -1}, // 85 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,116,-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,-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,-1,-1,-1,-1,-1, -1, -1}, // 86 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,116,-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,-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,-1,-1,-1,-1,-1, 8, -1}, // 87 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,116,-1,-1,-1,-1,-1,-1,-1,117, 117,-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,-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}, // 88 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,116,-1,-1,-1,-1,-1,-1,-1,118, 118,118,-1,-1,-1,-1,-1,118,118,118,118,118,118,-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,118,118, 118,118,118,118,-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}, // 89 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,90, 90,90,-1,-1,-1,-1,-1,90,90,90,90,90,90,-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,90,90, 90,90,90,90,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1, 14, -1}, // 90 {-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,-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,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1, 39, -1}, // 91 {-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,-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,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1, 40, -1}, // 92 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 57, -1}, // 93 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,119,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 94 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,120,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 95 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,121,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 96 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,122,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 97 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,123,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 98 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,124,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 99 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,125,126,19,19,19,19,19,19,19, 19,19,19,19,127,19,19,19,19,128,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 100 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,129,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 101 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,130,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 102 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,131,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 103 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,132,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 104 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,133,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 105 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 20, -1}, // 106 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 25, -1}, // 107 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,134,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 108 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,135,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 109 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,136,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 110 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,137,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 111 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,138,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 112 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,139,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 113 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,140,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 114 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,141,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 115 {-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,-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,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1, 11, -1}, // 116 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,142, 142,-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,-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}, // 117 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,143, 143,143,-1,-1,-1,-1,-1,143,143,143,143,143,143,-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,143,143, 143,143,143,143,-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}, // 118 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,144,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 119 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,145,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 120 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,146,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 121 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,147,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 122 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,148,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 123 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,149,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 124 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,150,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 125 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,151,152,19,19,19,19,19,19,19,19,19, 19,19,19,19,153,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 126 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,154,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 127 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,155,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 128 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 28, -1}, // 129 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,156,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 130 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,157,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 131 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 18, -1}, // 132 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 19, -1}, // 133 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 26, -1}, // 134 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,158,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 135 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,159,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 136 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,160,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 137 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,161,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 138 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 24, -1}, // 139 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,162,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 140 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,163,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 141 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,164,-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,-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,-1,-1,-1,-1,-1, -1, -1}, // 142 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,165,-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,-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,-1,-1,-1,-1,-1, -1, -1}, // 143 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 68, -1}, // 144 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 64, -1}, // 145 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,166,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 146 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,167,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 147 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,168,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 148 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,169,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 149 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,170,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 150 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,171,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 151 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,172,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 152 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,173,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 153 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,174,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 154 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,175,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 155 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 16, -1}, // 156 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,176,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 157 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 50, -1}, // 158 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 49, -1}, // 159 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,177,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 160 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,178,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 161 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 23, -1}, // 162 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,179,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 163 {-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,-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,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1, 9, -1}, // 164 {-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,-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,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1, 10, -1}, // 165 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 60, -1}, // 166 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,180,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 167 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,181,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 168 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,182,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 169 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,183,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 170 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,184,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 171 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,185,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 172 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,186,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 173 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,187,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 174 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,188,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 175 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,189,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 176 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 22, -1}, // 177 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 27, -1}, // 178 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,190,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 179 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,191,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 180 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 58, -1}, // 181 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,192,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 182 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 70, -1}, // 183 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 62, -1}, // 184 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 59, -1}, // 185 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 65, -1}, // 186 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 67, -1}, // 187 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,193,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 188 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,194,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 189 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 51, -1}, // 190 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 66, -1}, // 191 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,195,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 71, -1}, // 192 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 69, -1}, // 193 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 17, -1}, // 194 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19, 19,19,-1,-1,-1,-1,-1,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,-1,-1,-1,-1,19,-1,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,-1,-1,-1,-1, 63, -1}, // 195 // str { 1, 1,-1, 1, 1, 1, 2, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 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}, // 0 {-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,-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,-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,-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,-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,-1,-1, 0, -1}, // 2 { 4, 4,-1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,-1, 1, -1}, // 3 {-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,-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,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1, 2, -1}, // 4 }; int const (*ScannerBase::s_dfaBase_[])[89] = { s_dfa_ + 0, s_dfa_ + 196, }; size_t ScannerBase::s_istreamNr = 0; // $insert inputImplementation #include "input.src" ScannerBase::ScannerBase(std::istream &in, std::ostream &out) : d_cwd(std::filesystem::current_path().string()), d_out(new std::ostream(out.rdbuf())), // $insert interactiveInit d_in(0), d_dfaBase_(s_dfa_) { p_pushStream(s_istream, new std::istream(in.rdbuf())); } void ScannerBase::switchStream_(std::istream &in, size_t lineNr) { d_input->close(); d_streamStack.back().input = { new std::istream(in.rdbuf()), lineNr }; } ScannerBase::ScannerBase(std::string const &infilename, std::string const &outfilename) : d_cwd(std::filesystem::current_path().string()), d_out(outfilename == "-" ? new std::ostream(std::cout.rdbuf()) : outfilename == "" ? new std::ostream(std::cerr.rdbuf()) : new std::ofstream(outfilename)), d_dfaBase_(s_dfa_) { p_pushStream(infilename, { new std::ifstream(infilename) }); toCwd(); } void ScannerBase::switchStreams(std::istream &in, std::ostream &out) { switchStream_(in, 1); switchOstream(out); } void ScannerBase::switchIstream(std::string const &infilename) { d_input->close(); d_filename = infilename; d_streamStack.back() = StreamStruct{ chgWorkingDir(d_filename), { new std::ifstream(infilename) } }; d_atBOL = true; } void ScannerBase::switchStreams(std::string const &infilename, std::string const &outfilename) { switchOstream(outfilename); switchIstream(infilename); } void ScannerBase::pushStream(std::istream &istr) { p_pushStream("(istream)", new std::istream(istr.rdbuf())); //streamPtr); } void ScannerBase::pushStream(std::string const &name) { std::istream *streamPtr = new std::ifstream(name); if (!*streamPtr) { delete streamPtr; throw std::runtime_error("Cannot read " + name); } p_pushStream(name, streamPtr); } void ScannerBase::toCwd() const { using namespace std; using namespace filesystem; error_code ec; current_path(d_cwd, ec); }; // static std::string ScannerBase::chgWorkingDir(std::string const &name) // any name { using namespace std; using namespace filesystem; if (name == s_istream) // used with istreams return name; // a filename: get its auto path = absolute(name); // full pathname error_code ec; current_path(path.parent_path(), ec); return path.string(); // return the pathname } void ScannerBase::p_pushStream(std::string const &name, std::istream *streamPtr) { if (d_streamStack.size() == s_maxSizeofStreamStack_) { delete streamPtr; throw std::length_error("Max stream stack size exceeded"); } d_filename = name; d_streamStack.push_back( StreamStruct{chgWorkingDir(d_filename), { streamPtr } } ); d_input = &d_streamStack.back().input; d_atBOL = true; } void ScannerBase::switchOstream(std::ostream &out) { *d_out << std::flush; d_out.reset(new std::ostream(out.rdbuf())); } // $insert debugFunctions void ScannerBase::setDebug(bool onOff) {} bool ScannerBase::debug() const { return false; } void ScannerBase::redo(size_t nChars) { size_t from = nChars >= length() ? 0 : length() - nChars; d_input->reRead(d_matched, from); d_matched.resize(from); } void ScannerBase::switchOstream(std::string const &outfilename) { *d_out << std::flush; d_out.reset( outfilename == "-" ? new std::ostream(std::cout.rdbuf()) : outfilename == "" ? new std::ostream(std::cerr.rdbuf()) : new std::ofstream(outfilename)); } bool ScannerBase::popStream() { using namespace std::filesystem; d_input->close(); if (d_streamStack.size() <= 1) return false; d_streamStack.pop_back(); d_filename = path{ chgWorkingDir(d_streamStack.back().pushedName) }.filename().string(); d_input = &d_streamStack.back().input; return true; } // $insert lopImplementation void ScannerBase::lopf_(size_t tail) { tail = length() - tail; push(d_matched.substr(tail, std::string::npos)); d_matched.resize(tail); d_atBOL = length() && d_matched.back() == '\n'; } // See the manual's section `Run-time operations' section for an explanation // of this member. ScannerBase::ActionType_ ScannerBase::actionType_(size_t range) { d_nextState = d_dfaBase_[d_state][range]; if (d_nextState != -1) // transition is possible return ActionType_::CONTINUE; if (knownFinalState()) // FINAL state reached return ActionType_::MATCH; if (d_matched.size()) return ActionType_::ECHO_FIRST; // no match, echo the 1st char return range != s_rangeOfEOF_ ? ActionType_::ECHO_CH : ActionType_::RETURN; } void ScannerBase::accept(size_t nChars) // old name: less { if (nChars < d_matched.size()) { d_input->reRead(d_matched, nChars); d_matched.resize(nChars); } } void ScannerBase::setMatchedSize(size_t length) { d_input->reRead(d_matched, length); // reread the tail section d_matched.resize(length); // return what's left } // At this point a rule has been matched. The next character is not part of // the matched rule and is sent back to the input. The final match length // is determined, the index of the matched rule is determined, and then // d_atBOL is updated. Finally the rule's index is returned. // The numbers behind the finalPtr assignments are explained in the // manual's `Run-time operations' section. size_t ScannerBase::matched_(size_t ch) { d_input->reRead(ch); FinalData *finalPtr; if (not d_atBOL) // not at BOL finalPtr = &d_final.std; // then use the std rule (3, 4) // at BOL else if (not available(d_final.std.rule)) // only a BOL rule avail. finalPtr = &d_final.bol; // use the BOL rule (6) else if (not available(d_final.bol.rule)) // only a std rule is avail. finalPtr = &d_final.std; // use the std rule (7) else if ( // Both are available (8) d_final.bol.length != // check lengths of matched texts d_final.std.length // unequal lengths, use the rule ) // having the longer match length finalPtr = d_final.bol.length > d_final.std.length ? &d_final.bol : &d_final.std; else // lengths are equal: use 1st rule finalPtr = d_final.bol.rule < d_final.std.rule ? &d_final.bol : &d_final.std; setMatchedSize(finalPtr->length); d_atBOL = d_matched.back() == '\n'; return finalPtr->rule; } size_t ScannerBase::getRange_(int ch) // using int to prevent casts { return ch == AT_EOF ? as(s_rangeOfEOF_) : s_ranges_[ch]; } // At this point d_nextState contains the next state and continuation is // possible. The just read char. is appended to d_match void ScannerBase::continue_(int ch) { d_state = d_nextState; if (ch != AT_EOF) d_matched += ch; } void ScannerBase::echoCh_(size_t ch) { *d_out << as(ch); d_atBOL = ch == '\n'; } // At this point there is no continuation. The last character is // pushed back into the input stream as well as all but the first char. in // the buffer. The first char. in the buffer is echoed to stderr. // If there isn't any 1st char yet then the current char doesn't fit any // rules and that char is then echoed void ScannerBase::echoFirst_(size_t ch) { d_input->reRead(ch); d_input->reRead(d_matched, 1); echoCh_(d_matched[0]); } // Update the rules associated with the current state, do this separately // for BOL and std rules. // If a rule was set, update the rule index and the current d_matched // length. void ScannerBase::updateFinals_() { size_t len = d_matched.size(); int const *rf = d_dfaBase_[d_state] + s_finIdx_; if (rf[0] != -1) // update to the latest std rule { d_final.std = FinalData { as(rf[0]), len }; } if (rf[1] != -1) // update to the latest bol rule { d_final.bol = FinalData { as(rf[1]), len }; } } void ScannerBase::reset_() { d_final = Final{ FinalData{s_unavailable, 0}, FinalData {s_unavailable, 0} }; d_state = 0; d_return = true; if (!d_more) d_matched.clear(); d_more = false; } int Scanner::executeAction_(size_t ruleIdx) try { switch (ruleIdx) { // $insert actions case 0: { #line 13 "lexer" return cleanString(); } break; case 1: case 2: { #line 16 "lexer" more(); } break; case 4: { #line 20 "lexer" setWhere(); } break; case 5: { #line 22 "lexer" setLineNr(); } break; case 6: { #line 24 "lexer" pushFile(); } break; case 8: case 9: case 10: case 11: { #line 31 "lexer" return cleanString(); } break; case 12: { #line 34 "lexer" return token(Tokens::NUMBER, stoul(matched())); } break; case 13: { #line 37 "lexer" return token(Tokens::NUMBER, stoul(matched(), 0, 8)); } break; case 14: { #line 39 "lexer" { return token(Tokens::NUMBER, stoul(&matched()[2], 0, 16)); } } break; case 15: { #line 44 "lexer" { more(); begin(StartCondition_::str); } } break; case 16: { #line 49 "lexer" return Tokens::BREAK; } break; case 17: { #line 51 "lexer" return Tokens::CONTINUE; } break; case 18: { #line 53 "lexer" return Tokens::ELSE; } break; case 19: { #line 55 "lexer" return Tokens::EXIT; } break; case 20: { #line 57 "lexer" return Tokens::FOR; } break; case 21: { #line 59 "lexer" return Tokens::IF; } break; case 22: { #line 61 "lexer" return Tokens::RETURN; } break; case 23: { #line 63 "lexer" return Tokens::WHILE; } break; case 24: { #line 65 "lexer" return token(Tokens::VOID,e_void); } break; case 25: { #line 67 "lexer" return token(Tokens::INT,e_int); } break; case 26: { #line 69 "lexer" return token(Tokens::LIST,e_list); } break; case 27: { #line 71 "lexer" return token(Tokens::STRINGTYPE, e_str); } break; case 28: { #line 73 "lexer" return token (Tokens::BOOL,e_bool); } break; case 29: { #line 75 "lexer" return Tokens::OR; } break; case 30: { #line 77 "lexer" return Tokens::AND; } break; case 31: { #line 81 "lexer" return token(Tokens::MATH_IS,Opcode::div); } break; case 32: { #line 83 "lexer" return token(Tokens::MATH_IS,Opcode::sub); } break; case 33: { #line 85 "lexer" return token(Tokens::MATH_IS,Opcode::mul); } break; case 34: { #line 87 "lexer" return token(Tokens::MATH_IS,Opcode::mod); } break; case 35: { #line 89 "lexer" return token(Tokens::MATH_IS,Opcode::add); } break; case 36: { #line 91 "lexer" return token(Tokens::MATH_IS,Opcode::band); } break; case 37: { #line 93 "lexer" return token(Tokens::MATH_IS,Opcode::bor); } break; case 38: { #line 95 "lexer" return token(Tokens::MATH_IS,Opcode::bxor); } break; case 39: { #line 97 "lexer" return token(Tokens::MATH_IS,Opcode::shl); } break; case 40: { #line 99 "lexer" return token(Tokens::MATH_IS,Opcode::shr); } break; case 41: { #line 101 "lexer" return token(Tokens::INCDEC,Opcode::inc); } break; case 42: { #line 103 "lexer" return token(Tokens::INCDEC,Opcode::dec); } break; case 43: { #line 105 "lexer" return token(Tokens::EQUALITY,Opcode::eq); } break; case 44: { #line 107 "lexer" return token(Tokens::EQUALITY,Opcode::neq); } break; case 45: { #line 109 "lexer" return token(Tokens::ORDER,Opcode::sm); } break; case 46: { #line 111 "lexer" return token(Tokens::ORDER,Opcode::smeq); } break; case 47: { #line 113 "lexer" return token(Tokens::ORDER,Opcode::gr); } break; case 48: { #line 115 "lexer" return token(Tokens::ORDER,Opcode::greq); } break; case 49: { #line 117 "lexer" return token(Tokens::ORDER,Opcode::older); } break; case 50: case 51: { #line 120 "lexer" return token(Tokens::ORDER,Opcode::younger); } break; case 52: { #line 122 "lexer" return token(Tokens::SHIFT,Opcode::shr); } break; case 53: { #line 124 "lexer" return token(Tokens::SHIFT,Opcode::shl); } break; case 54: { #line 126 "lexer" return token(Tokens::MULTIPLY,Opcode::mul); } break; case 55: { #line 128 "lexer" return token(Tokens::MULTIPLY,Opcode::div); } break; case 56: { #line 130 "lexer" return token(Tokens::MULTIPLY,Opcode::mod); } break; case 57: case 58: { #line 133 "lexer" return token(Tokens::NUMBER, 0); } break; case 59: case 60: case 61: { #line 137 "lexer" return token(Tokens::NUMBER, 1); } break; case 62: case 63: case 64: { #line 141 "lexer" return token(Tokens::NUMBER, 2); } break; case 65: case 66: { #line 144 "lexer" return token(Tokens::NUMBER, 4); } break; case 67: case 68: { #line 147 "lexer" return token(Tokens::NUMBER, 8); } break; case 69: { #line 149 "lexer" return token(Tokens::NUMBER, 16); } break; case 70: { #line 151 "lexer" return token(Tokens::NUMBER, 32); } break; case 71: { #line 153 "lexer" return Tokens::IDENTIFIER; } break; case 72: { #line 156 "lexer" return matched().front(); } break; case 7: { #line 26 "lexer" lopf_(1); popFile(); } break; } noReturn_(); return 0; } catch (Leave_ value) { return static_cast(value); } int Scanner::lex_() { reset_(); preCode(); while (true) { size_t ch = get_(); // fetch next char size_t range = getRange_(ch); // determine the range updateFinals_(); // update the state's Final info switch (actionType_(range)) // determine the action { case ActionType_::CONTINUE: continue_(ch); continue; case ActionType_::MATCH: { d_token_ = executeAction_(matched_(ch)); if (return_()) { print(); toCwd(); return d_token_; } break; } case ActionType_::ECHO_FIRST: echoFirst_(ch); break; case ActionType_::ECHO_CH: echoCh_(ch); break; case ActionType_::RETURN: if (!popStream()) { postCode(PostEnum_::END); toCwd(); return 0; } postCode(PostEnum_::POP); continue; } // switch postCode(PostEnum_::WIP); reset_(); preCode(); } // while } void ScannerBase::print_() const { } icmake-10.03.00/comp/scanner/input_cc0000644000175000017500000000202214204126313016256 0ustar frankfrankScannerBase::Input::Input() : d_in(0), d_lineNr(1) {} ScannerBase::Input::Input(std::istream *iStream, size_t lineNr) : d_in(iStream), d_lineNr(lineNr) {} size_t ScannerBase::Input::get() { switch (size_t ch = next()) // get the next input char { case '\n': ++d_lineNr; [[fallthrough]]; default: return ch; } } size_t ScannerBase::Input::next() { size_t ch; if (d_deque.empty()) // deque empty: next char fm d_in { if (d_in == 0) return AT_EOF; ch = d_in->get(); return *d_in ? ch : static_cast(AT_EOF); } ch = d_deque.front(); d_deque.pop_front(); return ch; } void ScannerBase::Input::reRead(size_t ch) { if (ch < 0x100) { if (ch == '\n') --d_lineNr; d_deque.push_front(ch); } } void ScannerBase::Input::reRead(std::string const &str, size_t fm) { for (size_t idx = str.size(); idx-- > fm; ) reRead(str[idx]); } icmake-10.03.00/comp/scanner/precode.f0000644000175000017500000000004314204126313016320 0ustar frankfrankinline void Scanner::preCode() {} icmake-10.03.00/comp/scanner/print.f0000644000175000017500000000006014204126313016032 0ustar frankfrankinline void Scanner::print() { print_(); } icmake-10.03.00/comp/scanner/lex.f0000644000175000017500000000006114204126313015467 0ustar frankfrankinline int Scanner::lex() { return lex_(); } icmake-10.03.00/comp/scanner/scanner.ih0000644000175000017500000000035114204126313016505 0ustar frankfrank#include "scanner.h" #include #include #include "../../xerr/xerr.ih" #include "../tokens/tokens.h" #include "../opcode/opcode.h" using namespace std; using namespace FBB; // end of scanner.ih icmake-10.03.00/comp/scanner/pushfile.cc0000644000175000017500000000123014204126313016655 0ustar frankfrank//#define XERR #include "scanner.ih" void Scanner::pushFile() { d_fileStack.top().second = lineNr(); string name = matched().substr(2); // the next filename setFilename(name); // update the scanner's // current filename d_filenames += name + '\n'; d_input->setLineNr(1); // and line nr d_fileStack.push( { filename(), 1 } ); // push the current // file name and line nr xerr("stack[" << d_fileStack.size() << "]: " << filename() << ", " << lineNr()); } icmake-10.03.00/comp/scanner/input.src0000644000175000017500000000216414204126313016406 0ustar frankfrankScannerBase::Input::Input() : d_in(0), d_trueLineNr(1), d_lineNr(1) {} ScannerBase::Input::Input(std::istream *iStream, size_t lineNr) : d_in(iStream), d_lineNr(lineNr) {} size_t ScannerBase::Input::get() { switch (size_t ch = next()) // get the next input char { case '\n': ++d_trueLineNr; ++d_lineNr; [[fallthrough]]; default: return ch; } } size_t ScannerBase::Input::next() { size_t ch; if (d_deque.empty()) // deque empty: next char fm d_in { if (d_in == 0) return AT_EOF; ch = d_in->get(); return *d_in ? ch : static_cast(AT_EOF); } ch = d_deque.front(); d_deque.pop_front(); return ch; } void ScannerBase::Input::reRead(size_t ch) { if (ch < 0x100) { if (ch == '\n') { --d_lineNr; --d_trueLineNr; } d_deque.push_front(ch); } } void ScannerBase::Input::reRead(std::string const &str, size_t fm) { for (size_t idx = str.size(); idx-- > fm; ) reRead(str[idx]); } icmake-10.03.00/comp/scanner/postcode.f0000644000175000017500000000010314204126313016514 0ustar frankfrankinline void Scanner::postCode([[maybe_unused]] PostEnum_ type) {} icmake-10.03.00/comp/scanner/setwhere.cc0000644000175000017500000000055514204126313016675 0ustar frankfrank#define XERR #include "scanner.ih" namespace { string s_where; size_t s_lineNr; } string const &g_where = s_where; // g_where and g_lineNr are used size_t const &g_lineNr = s_lineNr; // by Error void Scanner::setWhere() const { s_lineNr = lineNr(); s_where = filename() + " [line " + to_string(s_lineNr) + "]: "; //xerr(s_where); } icmake-10.03.00/comp/scanner/scanner.h0000644000175000017500000000362714204126313016345 0ustar frankfrank// Generated by Flexc++ V2.07.07 on Thu, 05 Mar 2020 17:53:53 +0100 #ifndef Scanner_H_INCLUDED_ #define Scanner_H_INCLUDED_ #include #include // $insert baseclass_h #include "scannerbase.h" // $insert classHead class Scanner: public ScannerBase { size_t d_expr; // operator exprs or numeric exprs made // available by token() // (see also ../operators/operators.h) std::stack< std::pair > d_fileStack; std::string d_filenames; // all filenames, including terminating '\n' public: Scanner(std::string const &infile, std::string const &outfile); // $insert lexFunctionDecl int lex(); int expr() const; std::string const &filenames() const; // .f private: void setWhere() const; // filename linenr info: modifies g_where int token(int token, size_t expr); int cleanString(); // remove surrounding quotes and unescape // matched(), then return Tokens::STRING void setLineNr(); // update Input's lineNr at ^# lines void pushFile(); // update the current file at ^#\> lines void popFile(); // restore the previous filename/line nr int lex_(); int executeAction_(size_t ruleNr); void print(); void preCode(); // re-implement this function for code that must // be exec'ed before the patternmatching starts void postCode(PostEnum_ type); // re-implement this function for code that must // be exec'ed after the rules's actions. }; #include "lex.f" #include "print.f" #include "precode.f" #include "postcode.f" #include "expr.f" #include "filenames.f" #endif // Scanner_H_INCLUDED_ icmake-10.03.00/comp/scanner/icmconf0000777000175000017500000000000014204126313020635 2../../icmconf.dirustar frankfrankicmake-10.03.00/comp/scanner/expr.f0000644000175000017500000000007014204126313015655 0ustar frankfrankinline int Scanner::expr() const { return d_expr; } icmake-10.03.00/comp/scanner/scanner1.cc0000644000175000017500000000065314204126313016560 0ustar frankfrank//#define XERR #include "scanner.ih" Scanner::Scanner(std::string const &infile, std::string const &outfile) : ScannerBase(infile, outfile) { d_fileStack.push( { infile, lineNr() } ); // push the current // file name and line nr d_filenames = infile + '\n'; setWhere(); xerr("stack[" << d_fileStack.size() << "]: " << infile << ", " << lineNr()); } icmake-10.03.00/comp/scanner/filenames.f0000644000175000017500000000012114204126313016637 0ustar frankfrankinline std::string const &Scanner::filenames() const { return d_filenames; } icmake-10.03.00/comp/scanner/popfile.cc0000644000175000017500000000101414204126313016474 0ustar frankfrank//#define XERR #include "scanner.ih" void Scanner::popFile() { if (d_fileStack.size() == 1) wmsg << filename() << " line " << d_input->trueLineNr() << ": `#>...'/`#' lines mismatch" << endl; else { d_fileStack.pop(); setFilename(d_fileStack.top().first); d_input->setLineNr(d_fileStack.top().second); setWhere(); } xerr("stack[" << d_fileStack.size() << "]: " << \ filename() << ", " << lineNr()); } icmake-10.03.00/comp/scanner/lexer0000644000175000017500000001124414204126313015577 0ustar frankfrank%filenames scanner %input-interface "input.hdr" %input-implementation "input.src" //%print-tokens //%debug %x str %% { \" return cleanString(); . | \\. more(); } [ \t] \n setWhere(); ^#[0-9]+\n setLineNr(); ^#\>.* pushFile(); ^#$ popFile(); \'.' | // character constants '\\[0-7]{3}' | '\\x[[:xdigit:]]{2}' | '\\.' return cleanString(); [1-9][0-9]* return token(Tokens::NUMBER, stoul(matched())); 0[0-7]* return token(Tokens::NUMBER, stoul(matched(), 0, 8)); 0x[[:xdigit:]]+ { return token(Tokens::NUMBER, stoul(&matched()[2], 0, 16)); } \" { more(); begin(StartCondition_::str); } break return Tokens::BREAK; continue return Tokens::CONTINUE; else return Tokens::ELSE; exit return Tokens::EXIT; for return Tokens::FOR; if return Tokens::IF; return return Tokens::RETURN; while return Tokens::WHILE; void return token(Tokens::VOID, e_void); int return token(Tokens::INT, e_int); list return token(Tokens::LIST, e_list); string return token(Tokens::STRINGTYPE, e_str); bool return token (Tokens::BOOL, e_bool); "||" return Tokens::OR; "&&" return Tokens::AND; // plain '=' is returned as matched().front() "/=" return token(Tokens::MATH_IS, Opcode::div); "-=" return token(Tokens::MATH_IS, Opcode::sub); "*=" return token(Tokens::MATH_IS, Opcode::mul); "%=" return token(Tokens::MATH_IS, Opcode::mod); "+=" return token(Tokens::MATH_IS, Opcode::add); "&=" return token(Tokens::MATH_IS, Opcode::band); "|=" return token(Tokens::MATH_IS, Opcode::bor); "^=" return token(Tokens::MATH_IS, Opcode::bxor); "<<=" return token(Tokens::MATH_IS, Opcode::shl); ">>=" return token(Tokens::MATH_IS, Opcode::shr); "++" return token(Tokens::INCDEC, Opcode::inc); "--" return token(Tokens::INCDEC, Opcode::dec); "==" return token(Tokens::EQUALITY, Opcode::eq); "!=" return token(Tokens::EQUALITY, Opcode::neq); "<" return token(Tokens::ORDER, Opcode::sm); "<=" return token(Tokens::ORDER, Opcode::smeq); ">" return token(Tokens::ORDER, Opcode::gr); ">=" return token(Tokens::ORDER, Opcode::greq); older return token(Tokens::ORDER, Opcode::older); newer | younger return token(Tokens::ORDER, Opcode::younger); ">>" return token(Tokens::SHIFT, Opcode::shr); "<<" return token(Tokens::SHIFT, Opcode::shl); "*" return token(Tokens::MULTIPLY, Opcode::mul); "/" return token(Tokens::MULTIPLY, Opcode::div); "%" return token(Tokens::MULTIPLY, Opcode::mod); OFF | P_CHECK return token(Tokens::NUMBER, 0); S_IFDIR | O_FILE | ON return token(Tokens::NUMBER, 1); S_IFCHR | P_NOCHECK | O_DIR return token(Tokens::NUMBER, 2); S_IFREG | O_SUBDIR return token(Tokens::NUMBER, 4); S_IREAD | O_ALL return token(Tokens::NUMBER, 8); S_IWRITE return token(Tokens::NUMBER, 16); S_IEXEC return token(Tokens::NUMBER, 32); [_A-Za-z][A-Za-z0-9_]* return Tokens::IDENTIFIER; . return matched().front(); icmake-10.03.00/comp/scanner/input.hdr0000644000175000017500000000262214204126313016373 0ustar frankfrankclass Input { std::deque d_deque; // pending input chars std::istream *d_in; // ptr for easy streamswitching size_t d_trueLineNr; // true input file's line count size_t d_lineNr; // line count public: Input(); // iStream: dynamically allocated Input(std::istream *iStream, size_t lineNr = 1); size_t get(); // the next range void reRead(size_t ch); // push back 'ch' (if < 0x100) // push back str from idx 'fmIdx' void reRead(std::string const &str, size_t fmIdx); size_t lineNr() const { return d_lineNr; } size_t trueLineNr() const { return d_trueLineNr; } void setLineNr(size_t lineNr) { d_lineNr = lineNr; } size_t nPending() const { return d_deque.size(); } void setPending(size_t size) { d_deque.erase(d_deque.begin(), d_deque.end() - size); } void close() // force closing the stream { delete d_in; d_in = 0; // switchStreams also closes } private: size_t next(); // obtain the next character }; icmake-10.03.00/comp/scanner/input_h0000644000175000017500000000260714204126313016131 0ustar frankfrank class Input { std::deque d_deque; // pending input chars std::istream *d_in; // ptr for easy streamswitching size_t d_lineNr; // line count public: Input(); // iStream: dynamically allocated Input(std::istream *iStream, size_t lineNr = 1); size_t get(); // the next range void reRead(size_t ch); // push back 'ch' (if < 0x100) // push back str from idx 'fmIdx' void reRead(std::string const &str, size_t fmIdx); size_t lineNr() const { return d_lineNr; } void setLineNr(size_t lineNr) { d_lineNr = lineNr; } size_t nPending() const { return d_deque.size(); } void setPending(size_t size) { d_deque.erase(d_deque.begin(), d_deque.end() - size); } void close() // force closing the stream { delete d_in; d_in = 0; // switchStreams also closes } private: size_t next(); // obtain the next character }; icmake-10.03.00/comp/scanner/setlinenr.cc0000644000175000017500000000026114204126313017044 0ustar frankfrank//#define XERR #include "scanner.ih" void Scanner::setLineNr() { d_input->setLineNr(stoul(matched().substr(1))); setWhere(); xerr(" continue at line " << lineNr()); } icmake-10.03.00/comp/scanner/scannerbase.h0000644000175000017500000002563214204171312017177 0ustar frankfrank// Generated by Flexc++ V2.10.00 on Tue, 15 Feb 2022 18:39:11 +0100 #ifndef ScannerBASE_H_INCLUDED #define ScannerBASE_H_INCLUDED #include #include #include #include #include #include class ScannerBase { // idx: rule, value: tail length (NO_INCREMENTS if no tail) typedef std::vector VectorInt; static size_t const s_unavailable = std::numeric_limits::max(); static constexpr char const s_istream[] = "(istream)"; enum { AT_EOF = -1 }; protected: enum Leave_ {}; enum class ActionType_ { CONTINUE, // transition succeeded, go on ECHO_CH, // echo ch itself (d_matched empty) ECHO_FIRST, // echo d_matched[0], push back the rest MATCH, // matched a rule RETURN, // no further continuation, lex returns 0. }; enum class PostEnum_ { END, // postCode called when lex_() ends POP, // postCode called after switching files RETURN, // postCode called when lex_() returns WIP // postCode called when a non-returning rule // was matched }; public: // $insert startcondenum enum class StartCondition_{ INITIAL, str, }; private: struct FinalData { size_t rule; size_t length; }; struct Final { FinalData std; FinalData bol; }; // class Input encapsulates all input operations. // Its member get() returns the next input character // $insert inputInterface protected: #include "input.hdr" struct StreamStruct { std::string pushedName; Input input; }; private: std::string d_cwd; std::vector d_streamStack; std::string d_filename; // name of the currently processed static size_t s_istreamNr; // file. With istreams it receives // the name "", where // # is the sequence number of the // istream (starting at 1) int d_startCondition = 0; int d_lopSC = 0; size_t d_state = 0; int d_nextState; std::shared_ptr d_out; bool d_atBOL = true; // the matched text starts at BOL Final d_final; // only used interactively: std::istream *d_in; // points to the input stream std::shared_ptr d_line; // holds line fm d_in std::string d_matched; // matched characters std::string d_lopMatched; // matched lop-rule characters std::string::iterator d_lopIter; std::string::iterator d_lopTail; std::string::iterator d_lopEnd; size_t d_lopPending; // # pending input chars at lop1_ bool d_return; // return after a rule's action bool d_more = false; // set to true by more() size_t (ScannerBase::*d_get)() = &ScannerBase::getInput; // $insert inputDeclaration protected: Input *d_input; // input now in d_streamStack std::istream *d_in_; int d_token_; // returned by lex_ int const (*d_dfaBase_)[89]; static int const s_dfa_[][89]; static int const (*s_dfaBase_[])[89]; enum: bool { s_interactive_ = false }; enum: size_t { s_rangeOfEOF_ = 86, s_finIdx_ = 87, s_nRules_ = 73, s_maxSizeofStreamStack_ = 10 }; static size_t const s_ranges_[]; static size_t const s_rf_[][2]; public: ScannerBase(ScannerBase const &other) = delete; ScannerBase &operator=(ScannerBase const &rhs) = delete; bool debug() const; std::string const &filename() const; std::string const &cwd() const; std::string const &matched() const; size_t length() const; size_t lineNr() const; void setDebug(bool onOff); void switchOstream(std::ostream &out); void switchOstream(std::string const &outfilename); void switchStreams(std::istream &in, std::ostream &out = std::cout); void switchIstream(std::string const &infilename); void switchStreams(std::string const &infilename, std::string const &outfilename); // $insert interactiveDecl protected: ScannerBase(std::istream &in, std::ostream &out); ScannerBase(std::string const &infilename, std::string const &outfilename); ~ScannerBase(); bool popStream(); std::ostream &out(); void echo() const; void leave(int retValue) const; void toCwd() const; // `accept(n)' returns all but the first `n' characters of the current // token back to the input stream, where they will be rescanned when the // scanner looks for the next match. // So, it matches n of the characters in the input buffer, and so it accepts // n characters, rescanning the rest. void accept(size_t nChars = 0); // former: less void redo(size_t nChars = 0); // rescan the last nChar // characters, reducing // length() by nChars void more(); void push(size_t ch); // push char to Input void push(std::string const &txt); // same: chars std::vector const &streamStack() const; void pushStream(std::istream &curStream); void pushStream(std::string const &curName); void setFilename(std::string const &name); void setMatched(std::string const &text); static std::string istreamName_(); // members used by lex_(): they end in _ and should not be used // otherwise. ActionType_ actionType_(size_t range); // next action bool return_(); // 'return' from codeblock size_t matched_(size_t ch); // handles a matched rule size_t getRange_(int ch); // convert char to range size_t get_(); // next character size_t state_() const; // current state void continue_(int ch); // handles a transition void echoCh_(size_t ch); // echoes ch, sets d_atBOL void echoFirst_(size_t ch); // handles unknown input void updateFinals_(); // update a state's Final info void noReturn_(); // d_return to false void print_() const; // optionally print token void pushFront_(size_t ch); // return char to Input void reset_(); // prepare for new cycle // next input stream: void switchStream_(std::istream &in, size_t lineNr); void lopf_(size_t tail); // matched fixed size tail void lop1_(int lopSC); // matched ab for a/b void lop2_(); // matches the LOP's b tail void lop3_(); // catch-all while matching b void lop4_(); // matches the LOP's a head // $insert startconddecl StartCondition_ startCondition() const; // current start condition void begin(StartCondition_ startCondition); private: static StartCondition_ constexpr SC(int sc); static int constexpr SC(StartCondition_ sc); size_t getInput(); size_t getLOP(); void p_pushStream(std::string const &name, std::istream *streamPtr); void setMatchedSize(size_t length); bool knownFinalState(); static std::string chgWorkingDir(std::string const &filename); template static ReturnType constexpr as(ArgType value); static bool constexpr available(size_t value); }; inline ScannerBase::~ScannerBase() { d_input->close(); } template inline ReturnType constexpr ScannerBase::as(ArgType value) { return static_cast(value); } // $insert startcondimpl inline ScannerBase::StartCondition_ constexpr ScannerBase::SC(int sc) { return as(sc); } inline int constexpr ScannerBase::SC(StartCondition_ sc) { return as(sc); } inline ScannerBase::StartCondition_ ScannerBase::startCondition() const { return SC(d_startCondition); } inline void ScannerBase::begin(StartCondition_ startCondition) { // d_state is reset to 0 by reset_() d_dfaBase_ = s_dfaBase_[d_startCondition = SC(startCondition)]; } inline bool ScannerBase::knownFinalState() { return (d_atBOL && available(d_final.bol.rule)) || available(d_final.std.rule); } inline bool constexpr ScannerBase::available(size_t value) { return value != std::numeric_limits::max(); } inline std::ostream &ScannerBase::out() { return *d_out; } inline void ScannerBase::push(size_t ch) { d_input->reRead(ch); } inline void ScannerBase::push(std::string const &str) { d_input->reRead(str, 0); } inline std::vector const &ScannerBase::streamStack() const { return d_streamStack; } inline void ScannerBase::setFilename(std::string const &name) { d_filename = name; } inline void ScannerBase::setMatched(std::string const &text) { d_matched = text; } inline std::string const &ScannerBase::matched() const { return d_matched; } inline std::string const &ScannerBase::cwd() const { return d_cwd; } inline std::string const &ScannerBase::filename() const { return d_filename; } inline void ScannerBase::echo() const { *d_out << d_matched; } inline size_t ScannerBase::length() const { return d_matched.size(); } inline void ScannerBase::leave(int retValue) const { throw as(retValue); } inline size_t ScannerBase::lineNr() const { return d_input->lineNr(); } inline void ScannerBase::more() { d_more = true; } inline size_t ScannerBase::state_() const { return d_state; } inline size_t ScannerBase::get_() { return (this->*d_get)(); } inline size_t ScannerBase::getInput() { return d_input->get(); } inline bool ScannerBase::return_() { return d_return; } inline void ScannerBase::noReturn_() { d_return = false; } #endif // ScannerBASE_H_INCLUDED icmake-10.03.00/comp/scanner/token.cc0000644000175000017500000000017214204126313016162 0ustar frankfrank//#define XERR #include "scanner.ih" int Scanner::token(int token, size_t expr) { d_expr = expr; return token; } icmake-10.03.00/comp/scanner/frame0000644000175000017500000000006414204126313015550 0ustar frankfrank//#define XERR #include "scanner.ih" Scanner:: { } icmake-10.03.00/comp/ifstmnt.odp0000644000175000017500000003443114204126313015277 0ustar frankfrankPK(l|R3&¬¨//mimetypeapplication/vnd.oasis.opendocument.presentationPK(l|RConfigurations2/toolbar/PK(l|RConfigurations2/floater/PK(l|RConfigurations2/menubar/PK(l|RConfigurations2/popupmenu/PK(l|RConfigurations2/toolpanel/PK(l|RConfigurations2/progressbar/PK(l|RConfigurations2/statusbar/PK(l|RConfigurations2/images/Bitmaps/PK(l|RConfigurations2/accelerator/PK(l|R styles.xmlí]Kã6¾ï¯0ln’õô£3=A²A² t'ÁL'ÀžY¢medQäv÷œöìaûÿö—,Ÿe=LÙò£=š™1Y$«>‹d±H½ûöe žAœø0¼êª6€Ð…ž.=ý¨L‡ß¾ÿË;¸Xø.¸ó »Yƒ0U’ô5É“;š !¼®Ò4º`BšªÂx924m6¢¿‡¬Œúëûá&ï “øÉ]è¬Ar—ºw¸(oæ.§uRÄàá&&k?­Ó*.\G¨–yÄj¢$ˆT/[XF¬ËM3Í0Øn·êÖ$ò?}á<%/éˆSÇQÚ€—=ŠAã”S{nFmâ€yî3–ŒtUÏjvWNœÊ Cˆ À>/¥q}^ÖÀêÅÎV¶L‹ÔM,Ž’-ŽiŲHÝ`­‘ën&,Öciq1ñNSÛÆ¦¶±Ÿ‚˜“¯Aêȶ…iŦ^?üT¥[úl6‘\Nº€²¼$²€5]Ø<ž­ñLÉ6ÌÌIAaLO^aL¯ -Î\¾ ±X:Ü¬ç –nÛI²,äGåŒl "MÌ5=^föu7¡Gí ­ ¼D öq–bw…Jhì3Æ„H¬tm„i8ý2ö¼ JQÕæÙ%„‘òìƒíW¼D“)‰PCAaຆ}„(ðŒíb6&|pýʤ«lBe(~ˆÆ-Œî„Òbãh:ZÕ Æéèe’ÿ=>äC2–ží0mÁ»±I[CJ]°«t]Ù[ÔràÜá€",Ìá{>ë/ šñŽ ¸AòþYò€þÆlÝ:¿o0<ÂêÚ&81šˆ_ï‡_;L¾Ù¥¤©ÃA¡v\@Y‚õ²êkè8,D~ꢾXø/ÀŽÚñvÖžØ'Ãmw>²Cd4†ëÛ!¼sòõÓk¨Ê…o˜ðÌý SØŒXFqvÅ–Q~ –’­Ÿ$ǰô½Ÿ&i œõàwÔ;ͬUÐʰøš¤`ÝlRöì,LýPƒ–u,£ºI€¥Óàûwx€VŽç£Éh@~16ý @¦™&±õ6Z®'ÎÒÐ-BˆVa_-È–…¦·,Ã% eð,&~Š$Ö5í¯B¡ê'\âÖMÍK–4‡±‡Wˆf´Wˆ? íïƒ `e=?‰çUIBþ~a'ÆláV kÚ¶1ž]\ØŸ…MÒŠâNæîØ®W7&cø¸¸2=­öC+5{c¯Jg†®ƒ‹‹úOpÛ$mBF`س çÖdªYøãʉ@R"nŠjÜ™$îËýÐÎZs_Å_E) FH”²`¶Ž’²Yȵ±(âwqŒ» ÏxÏõ=DÂhm`hS£éhç󨣴@ÑqâÊÐ>ç“‹Î&`.=>°yA­|wÈiÙo%B{#§>HHýhN†Ÿ@n¼¬±íð_ m*Ù»¼Û¢ªQ¿[ü;g*rb‡4VhŠdaâlR˜Dö8ø€”Ô ¢•Ãç³hºé†¬öHÝh¾ó×ÞôÒ|¬ÊÊ­%>¡œMˆ)ÏÁN?\*xÑŒT>VÒya’ôCàöƒ’Z0#Ä_ºp‚d`¡=6F žEëÅÊȱ\%i7 P¶¨E¸UHã É4Ƴ ÝCÜ<Ö%¬IŸu«c>ÉOüÏ(ß°¢”¤xL8K”„-:JpÑîÕðH ˆÛ:ð“¢áÝÑ!‘,Ï  ÄÊ|ƒ¦èt@3q:šH†ô'ÍR°[ÿ~ø¿ÿþ;S8¡AçH™µ*3G9Y_‘£:ÓÄ-×í¨?¾®ç0ʘ­¢²l2»š$mƒqdFQæ`cÀA¸=„ÌÎÒ©žßBV‡Mo!»3„ ÕºI„Æ!dÞ$>“îð¹Q;=í !ëFíô¬C„nÓNëZgÙoËP ÙlÇ6ªÛx5:PÛh·³ÄÓ]ÛB°D¾ƒ(¦Ò]J1-Û °dâ:XZžºP*AÎ'ÎJºSâ¬ÇÔ!Œ×N×’Æh[LOžC)¤k= ¤F¸I1×ÙfOÈ"Ò¤«n–+…9ÚÄVËDék´CSãµ ›û] :Ýi㎶éSæ¡i\²"Ô|ÏX’xƒz2¦N"^Ý–u?¯ I¢-µ‚vØ!q+Ñ®©ñÀìs…0õáÇh¼†ºS#žŸãXã ¢€Š™dܲÜ"H EßPÓÙ—8#®9£¨:#©;˯¼†„èXG+‡*ji$Å ðÁ¢B)ás•NV0ÛÛ Á¶Çç7Ýúé Y ìþ©sˆq­g¥JÉ Òì3£þ&"†4¿þðQæÿBü\þ5'b08£ÅÃZÍ×1á— ¢øßb¡Í…´÷Æá ux÷¾ÊÊó’=nA@þÔOx¥IBˆ­¨ž:­ƒô;«}·“nh§çÍËaö’×? Ö÷\‚¢¶‚Á!ò¡2­ZR>Ëj#ß߃ݾM2’k’Ñh%#V¤Æ.Dùç’î‹.ZãpÑ®F•fãC‡K„Ùp¹'ÆAÃ¥® Ép9trÿTlºíœ½gfq ò“ð•íÔ¤aä‘!mûõ§–k£ÒòŒ‡©ˆèó4¥À›¬Ñ²Ä*ßRÎaàÉ£ÁƒôÚ¢Á8•S: É-ùÎãòª†p!0¯­€Œ!«eÉxkêÍÝ(¢7 ñ€ ‹Îk¥@qfThÛÇÂrUé€>ú»ú Ã‹ôÏñBÅù”–Ç6`R$93,¬ñ³!ó uºžÎ8ï8Rµ©^u¤‘?Gø¸xÍ6œShÅ3 [2Ò(l™®æÛtõÛq õ> ¤-ƒçî Z+™aq< Ã-ƒ÷î ‰&ó˜q¨”ÁCÒóǾe0ââGaô€ø>Ãr¾^à£-! äÆ]üPëm&$ƒ‡ƒË }rŠ¡Yly›Rz•åj"I“Ü*›ÐOÙ1W{´~p’Uu x)ºFŒk†‡Z‘gÿMVá¤0C»’XT&7y¯!±©™½h ¹˜I&[f¨ûf£¸fVE?¡™f—7)TÐøÙf!bÅ 6ÈdB6ê .YÅ~ø g.²5Uóe“’hgºt²{Ù¢1ÌyveÑ…G^Gù×¹J`_B“k½Žb4ñNߪU_G9D‡®&¼cêî:Ê‹r¾Àu”ñ^·èîBÊäF/tw!ev“øtwE×®ÅP_ï}][¦úòRtUŸÍ—Rúë'WæÒ™Ø*~§q6žYSÃ2ŒÞÁsfi|‘ž±¿Ñèà©?2ªp¦œÄ”£ý¾9íÚ”ÓŽÛêŸdšš­OìIéÚ’èü¬ÌÌ„­2w 3»éãt=0ÑôÓô€=V lóg†9ÑÆšÝÔVs´º:°]),ÿ°0O×Öx|š°&M˜—|ße×ø¡˜ÛÝ`nsü1ÈÇÝ@n÷KC>éòq¹4äÓn ŸôKC>ëòiù~È“Í<Å—íN~.›Å%=ã’n•´ö=/=kÍØíøëøëø»’Õþ¿Sœ¨öüõüõüõüõü]ùê }¹Ìy*œ-ùéÓçý¹é5ž›šýIiRZ#pRÚÅIé[ò·ôΖÞÙÒ;[zgË•"Ô;[zgKïlé-½³åºê-8[*<(½³äÂ/gj¦j÷þ’3ûK¬Rìæá/©ûFü%¢D‰ð‡FçÙ”‚[â»íÉÀÑk"õ]  b4”… úžÎýpå ‹¶Áà=/ïp¨ŒªÙSþ.~0KX&ÿͦ]Sm{Ìù[ Žý1és:šÈtëÂLìÖ°ºqi .ÁÄ.ˆ§üåÆKq£æñÔr¼éOZëáÆœòƒÍ0ÕYÞç\*4·j“C‚ÚêºwjN¥xÐMì'ì.¾ËìZαŸøE’5"wžÁ×yÕ ÿú¨ +hªÞd>˜Õ┎´ÇÑU{&¦sLŒ‰:£zÊñ‘q‡±ÏQ¹F0F+_ŒG¬RÁZô–ÔÝ'Q5}\‚^ ‚^‚V…€n7Š ‘¸Nšå/»Ý½¨ôBöæãO.ã 2XÄÄÒñ€° ¤ûÆ>o=ø…EÄWébW+¾ Ô?5¸Ž²ÝE%ÉÂt i*ܬçÂÇ´+ ='E ËÓî¹Çe\ꕳ}¨þS{Þ;Âêt;SYÕœMÄÍqå6“fmc?ޏ†â+ˆ•tÞ ­’®\ Zµ§bÔd\-¦QY[Å—_™¼½Ô¦ã3axìåÔëÅð|zxìõÒscøVGü¯åÏ›j¾×ÒØ¸°E¯½„¢W^å¡l¾7«·º7ûøkyD BR£ÄGª$>Çóö¡*<9}ØñƒüÁä7"xù:õ9uäÍÃW¾}Þð˜Í7%{ùŠòUç-"øTš…0kÃKñÙ²öøp¶XßÀ¹c¨ÖªõjWƒP¨Öªõj} ÚeêÕú@5ù@µæÅ¶Ñ/¶ûÅv¿ØîÛׇP¿ØîÛýb»_l÷‹íëF¨_l ·BjƒYÆÚIRòYšJŽ$ç'áóßô´‚.Ói¼f¨:_øˆª ?°¯%u1 (ÖÀI68¬ ã´+œ…Æ*Tèb8W]ü¥RÏvóqt%+xÍ¢H€cz£¤ –Å‚ÈAv.Jhb¨éL5dzR¤©jβÀÞ’ÉâUÉ¿ (¸“$÷CBÇ9'|Íá ƒ)F³C4€Â ‚'}7Þ—¶‘)5.ÇÿñÌ[僧Õ9žº¡† ¦Yœ`XÍÖ°fÍœYãRšjŒU›†wWAKÃ9O«®´3ƒzzumV‚í\kiñ¼÷_é7ôŸ_/Óo8¶Á¡Ð“:Òª$tü ¢ÆÌÚEt¬’P­ PLÕ2mº&8oú¦ZSó"-OUÛÔÏÖ²Žˆì‹!¾Ûú™a/5/`?ªZáðu[äaî îV<Ù´ªÑ«W5zqUS°"éÎãDò€–:3JÖl¬êSÑšª9ÝQ‡É´Î˜1êîüdç-Ø“Q½-ß+tþqâcå6tÕ*è®à3uLm•àŒsˆN#Ê;Y#ŒUË6K@¨¶m5à`Zêd¬wºk¿Tèl v Ìã60OÕɤ¬o;0cC7Ñ¥qn¿³/´;áVë29EÖÔ©=“FøÍ/Ì B…¨+“Æ­uõüÚý´ƒ¦Ô±Qšˆ‰úVÑhÞ/¬¢UÝh\Dg+É©ƒ ÒŠñ‰jä#4c©ÙÄ(ØK½ eøê¤VËg™6.¶µ¼'ȸöÎN6{§ÈEÀí#GÎÁ£ò$œm$…-c~аsXÀ“=ènÖÙżäýÿPKËp@ÓnÅÐPK(l|R content.xmlí\[“£¸~ϯ ØJÞ¸HÜqoíÖÖ>Mo¥2­TÞ0È63€(Àm÷þ‰<æÿå—äHÜŒ§Ý½½™·‘ޤs¾s•„çÃ÷§$–I^D4]ËHÕe‰¤ £t·–ÿñð³âÊßßýéÝn£€¬B’–J@ÓþJ0:-VU/¥t-ïË2[iÍHZµª4ßiX×=­z–ë1~%kù§+êQ±Jý„«2X±¡Í:«ŽÖ/Ãg°j,’(^:£ž“ fÙÄDœ&ËI„|ú¥Ó‰cĹ‚¢0ʃãñ¨ .ÿÃß5Ö§”äTj õ.ÃxŒÐ2´ú¥¯ùi!ÝÓ”"Y‚¤ÑCéñ´–ÿâg´øë²j•¥Þìl€²#)hb|BC’§=’,*PÏ6:‘PÖ®ãíuX{ôóˆ;ßî>F•¸7ñ…§þÌÝ·œ&þÍXƒ)·‹xc„¯ÁÜ/´¤óˆµ¯ÁŽ`ØKŒKÅ1*Šç°ôcTeNüDú´3ÏÚ퟊’$7‚mQ<{¦~Î ™@Kèz.ÚT¨ÛýCIÙ~4PømÁ/o‹gUÈ«)o9g™ø¥P¾ÆV®àÿ,^Çÿ«ÅÃY€bÀȯáQgÁä«—>_”_ªÆQQç™þ +’E‚˜<’¸NG›C“Rª:Y;$ ¹z¬ºvݼ–ÿûŸ·Œ “ìò1,éÄþzÚ ‡-¦¡Œà=½ƒ¯OP£|zJ64n :æJCHqœ²¶—6ÍñF–¶aÛmý™ã2'é8àgàPdì¤mC¶4' ï!ãf!¿K„Ì"ä¾K„¬›!„Uó]"dß !ã]âãÜŸw§Ý›!d¾Ó8íÝ¡÷§‘~3ˆ¬?V ºëZ[›¼;­;64|jÄ#¡»|çÃîߪ=P}ÏHnN»c"~åZå°¯¬/îÄ#¤ÁÅøPQÇþ=4[ˆ>¢]®¹ð¯{?#çkó¼öè°wzÅNExÌÍn«%ªãÊZ–jð+0ÞÖCªîYMã 2›Š=¯y~b5Že³øR›eV¸r»““JÏûawwÐ4¬•ƈfµÔ$ݳ—zCeGhBÊü‰¯Î^Mþ‘Oº¤KÙzýÙ@ð”Áì9 J?ݵÇÎíTÅì^bƒ?ÖÃ{ÓHÝ_]ú—ô 7»3%ÔnseL!xR!l…k9 š¬ÿ4­+]uùuXOWºêq]tº²lSÐVÇãºêXÚÐS£º»Ÿ;ص…ÖIy#‰QObô2ª£[3?\#ñ³|¯÷¿™[Ø·T×±ží–,*“´ü¿öM¯§0ï6–Š iº¶ 1[Õ ãV¦ú\‘ížÈö ‰ì¨žáÞ*½ÌhXÎSZºç¸ ¿ýæƒnÏ Ý›¤k ±˜Aªk:o&CRär$—z`¨¾Y’¤i &Eó1ÁIÁÍqÙC ùc}½~B,v˜V—ðÛÄ¡.¸œ0ì UÏíjÜåĆ3?/+ ªyˆ’Ñ(-ùÙzíaGŽ…F‘X¯–…Ý;À d2¦Ž™ {’eÕd»ž|î§È2àÃöô6ntnÕ@ûJPWTQJ”â 9®e,I7ZˆÑ°ÜB,&âžXLD¢<Õ3½)“:0Æt`NèÀèt`’m=P°¡[’®`lx’ Ø+È0ø—1%8Cß%L:¹¹ÌÉ­ž[]ö[_rqWÅ®yE¢ýœdoÂÇ™±uÖå©®n‹Öåª&òDóTX ³/ë:·/Û—J.,¹w]}Ä\IèF´0S8=#rn”' h0ÄìhÀ°·“õ~vÔo$µ ¾ã^#õ›LPÉXŽ3ï<¦jê®è<­¨£Þc_ç=Îå ‰ðÈÝ'@®ë²‚ê1 ¹Ø®¾Y¦ãŽxôaÖçýþ9RÀÛéâ2ÃaØ’»ÏÜ}ÀYbC˜1†1,!€J6ª/ȲÇò!ô9Ðç¼¢dÚÀ¡Afov`Ær¼½ëðn#ÎE ·c†i0 ·b ›6ª¾ÁÑúÖg¾)Àlô,\Wq‡ï× Ž®¬º—AlJPr#†ar4u5ƨúfض9†¹Žë³`~á¬Ášƒ½Kaf/ƒMh¤—À g$™ØX¿ä®Ž!áBûãŸØ“ð^®ŸaßhÕÏ]Î?ñ -K<¨ŒÑÜÙÜì!–ï B¤‚$~¬EÛ‚æ¨A0~ž3[Bô®ø{Èc÷O¸á“ß%•ûC²Iý(Còr©ˆ\Õîì«}9ql±lRMWë™á[-–‰Ò—®¯/¯OÅ¿ðApˆ×ÐÛç‚QòRÅs¤Û°Í)èíí‰É“~P¸S^‘ÒÐM†¼6ßÙc~F)†€îæs˜ßd”ìÛøèm>" °¨bɾð°"ü‹`aFõ¿ƒÌ‘¢7û]a2y1GkmYúTn¢ƒºd¢éã·ñ0äŽÀ&G÷U®+¿ÔXŒäVÃy¬N# `ŸâMl¶Ž¼ E——4-­6ï¹òX¢ÝztÀF¦½}|ÀáÍUU Á6…»Vt{›Ž£/CŸy³t¨û½ŸSÕ¥†ñz–‡Á»´F1}/bv熲Ÿ&ˆôø*´Þ˼¹ŸÙ–”IWOéç#ˆe‚ž?+p›Ç®ð@½|‚M†ÒÊ5ŒÜ' ®EÃC³f–lÔ–€,ànËðóÓŒ0ò ïC6¤Qò"\¥Œ—Ò* +ÇÆ”ëú^&ëÙÍr¼LNiU¶Õ(`”¾Tþ”RøàGdÏ„nÊjí à7§Ÿ’‘K ZÕh±ÐÓ®<³2 (;¿e~ÔåÑ:®8’iÊgàxü'yÌG‘6Ë ß½ÝÞæ“p(NïÚl/„,δ§}cÞØ²:àüV®"!µ”ßÙÃÎæÂ/¿Í˜ëÈL" Á|ZO[t"åqyIo"qì¼]ÝŽÍ‘ NUJ‰\žÓÄ]*£gW¡ ü>ÚŸ‘@Y§›×3¦˜ÁBæëHÊE~•fe¶Í-Þ§‹oGeÝ—ƒÖ±C„²°d²ØóAbS+e3¸/kÆÁrú~^Y*öˆA0ûæÉÒuŽa!kË2I½D"  ؼ^/^it!ÇJÍL” »ó…¥ÕÿÖ‹ßNù Å·>£ß>*eÓ¯¹ðŒú#(ÂýäÙ–²Dø¿<Ü­ÿµå`ªé¾ããïŽ`ÏÔ®¯Ï{uwý`ü»þ¥ñÀ~Ú¶©÷ß Ëã{g:œÛ­¯«éóâòÁz:1ŒãúÇÔ¶a:¶ü|š cäëhØ4µÇ‘±®‘êL®5gÚÖGfun•Lºxäµi©º™•>_uŸQÍ×å¸qèÉy`¢‡ýquå’áæq‚µšß]¹MŒÝgm­¾Ïšë¥×´uÇ7¹[¶ïgsã”qè4Í?½iW›)œºuê¨EÑv޾qšãÈk.ô‡ïƒ{·ÕåÎÔÁ39NÊøäøCì©5²^8âñe%kß2îm³Ú”u)ßø*Öm '¶ËøÆ±‚i'¥£1š\GÞthÉùZ#·9ÞaÉm®1¬ oZ•¼ËÞ¬4,Í&_¹#íÕXTë–V ÆÃùÐ¬Æøqª•úÆm¿Îm”VNÓ¾é=­W3ß3¦‡S¶gÁ ZK @90üxûúYÔ0åyäµ×‡}ÉØ®W—ò1‘x²êUÄ‚~€TÀ‡­t°‡[|÷.^ñÐÛšwÿPK=W\¤ûï)PK(l|RŽR†sÝ Ý Thumbnails/thumbnail.png‰PNG  IHDRÀÜ3MTÞPLTE###***444<<­I”°/Š xņÝ:ÛALA4 # =¹ãø* {Ã.xzÐ ~,A”ýO¢©K¢Ø“dQ…ÛNow$›°£ë€ŠÉÈ®h³M±Ã§¤3pÚ!¤C± ±M]Õ UЂ  =?”™ýK Ô;@Ä €ævØÃ×­IÛRÐÑ c¾ ‹–äÞ†If @d0m‰x¢®XL2Ì@hJ„ÐÅ‹"èv@Ï­¢9’k¨ŽŽõ.Û°ø³žlØ:‹Òp[°B5ÐÝBÕ Œw¨Ùóˆ²n{žh[µ±Ïô\Ó}Ù,vPÛ Áai>P–²Ùûfùq ˆ †é6]?—À€.µlâ,N L‡Ïrn B-€@ `ÝåùôyzàgVgÃôpÕº’0Z-€@  Ðh´Z-€@  Ð¸Jö iB € ûP @±ió ´Lk¹O‹Šš$Ú ¨‚MEpxàt=/Xò0¬ygA ¡2Ð@〹ê¡;sD °â`ð `˜¢¤ t»Ë£G•žZt4b F‡Ã4 Cñc¾°Ò•‘Ø ºEï#PÂA€y0‰²7 Í+ ôÝÍã°ifÑs£K‚³¨áEáaÃëѬÙдٵÁi²vó¶avcD*C~'šài²éæ…æH ‚ŒB£$å@’C•LPŒf܈¶‘Šs>¤“Í7ï­¹oóã„Cy²ÃÍg ’e£R÷}ˆ¶pOu’b^;ÀŽæ:I9äPo¸9¯ì,™«ŸÙU˜%Ps8@:m8€=ì9Ëx°ÇãÌ“f[Àð·/¿eM¶€ü?ý_ù±€ÉÏò[ÿ?öÈ é?ð Ùg~×—Œ›ÒÀY…Ë¿çU‡Ô@RážØ¿*÷XgÍêkl@k-€}]¨È¢ê6Ú\½áiÀ`àÿyž7Ó^<¦¬¬€b4’lÖp dIŒâR¸2Ææ0…xÒôrÀ˜BŒNXÈâ$ç[•aäIœ7U¯ˆòÆJà‚¸>ð×—Öt».fL¼wÝIF³ø©& ê³-`ö™ÿ'оG¨'cJŠý” X^UŽLަƒÛ+$ ßI=AQ\±XÐ$Ó—Bfò­(’ ¸Ž¨ˆÐûIÖwMHQzò £èËÍvp±È$–ée `IBXP°ìŽ2f_wÏI²è ¤ÏF1PŒ,,€ÜÜÜ|bßUB•ýÁŠgØVû}@4¹<€ ½ã˹€ÑuŠÈt{=TÍÔ±nJ6Ž…ç³ˆ}OìS–ˆ¦—°áVWö8 @9â„.P×!Ôµ «ìУ °È¨³@Ù¥Äç/™ÀÑ-`tVd—°Þ7vîFQ4½(€õágo?°Htôar£s8päáчɿ_ ®ÊJ%`—Ï(Ö»Ýn°;Äìé‚Ö†H”JÀ#ß&¶OÝÁÛê ã×øJx1å~W+J¦—°¦Ò›×|ÑÑ_Äw®þºÄÄcÿ×?¡HdOEW ) QUByþŠ H‹Ùõ™û½xˆ¢¢(…HîGh„ÒŠú9º€Õ á¨@Ñö/cüî›|ù;]²€9Ô|Œâäùä"8ï”™W èèòë{Y²×šýšfIœžXGŸ4U*ž? % Ýôêºâ4Úªh5yº€ ”I ”_¢H´òÖç­*þñŬ\ú¡§-Ý7<:€“Ôòh¶ûIg°œ fqŒuÌyXYå™Å—pžyPÕ•>t1ç™P©‚ºˆÏ2¸ux’Œà8‹¨œE•ÕÞéÓŤgž¥'xGZG(>˨®*©'P-гH-¾€óg× `6œ]Þö˜›~Äõ£ }-nàÁíÃø’ û_¿ÿ-?m»ptìÒàQ×ýÖï÷þ;>%€IùJ4Óô¢þ[´îõO  Âv/ŸàmsH€†ª–‡Q1U±æz^Uå&°óÜôk Íä÷/™Á¥«#Åãã^ýê- Ï’‚ŠÑx¶M:ó+iÇ1Ê*4Pw À´"Œ Ý—öìZ¼6[„1I§eËޏ°y'GIêàÅ3G{LÿÞú¢ÆÑøÐ’@¼ŸšE«ñÍŸ¸°,óluÀl|MÌÞâ¯Þ[ê ÝõE—鞘$Ðà´<åe@ ¾Ÿ'@,ké4qûH¬úæKF0ºöÝ­Ž$‹±¦(°E…hŪãæí„I“AÓE‹Ÿ{[ëï§Oì¶´Íi-``Ó†< ÐÁ ;Z Hìé[,ÂÒ × TK;YÀ™g£=EN@•$qaž&cçN–L–H^€*ž¡ûjXÄþ00‰÷KN ƒm7Å£0ÀªJaà‡!–=p4B_ÿ ƒéÖ6y¿õœÅ×À°„@±u– *&X²AÁUº¡§*L¤«#tœÐ 8²sˆCi®ÏNFºiˆLQc|λwZ૞>òGóZÂN}¤|X´í”r`ñºÔ\ Œ `.‚úZTE¥(ZKj @Ü2Œ’ OToãmÂ(é$Nò:¸Õ´b%éýž1„’lÃÓ.YÓœyñ%Y6F1J&[_$†§œ¿4 þ:Ûö"¨ÆÊØ ”os‘x—–ñš•^GO•˜Œ¹³—~€²‹¤YrQG%Wƒ´²¸Ÿ£Ë8µ›?ßòÞSÄ5€y»G£U¾ŠõÖ8ÀÊû¥Æÿð ËJ›¾óï¼€¨\åܨPù#÷¸ÿýácÉÃc¾ ûýþ_•˜o¹>—Fñkÿ3ïiÀ°ÿK©ïŸ¼€Ï”eƒ¿DÜ–Fñžûlðx®Ð¨¥ëªªŠ?ò4UYír@ @K¼%Ì»åÞáÀ¢¨¤É*,@&­Úl°Ðh´ZÕî_-P÷kÆ IEND®B`‚PK(l|Rmeta.xml“M›0†ïýˆîÕøÁ"¬ÔCÕÃV­ÔTê-"¶—ºÙf“þû‚”ÝDUnxxŸÏë™âñÜ6Á‹0Vjµ q„Â@(¦¹Tõ.ü¾ÿ¶ácù®ÐÏÏ’ Ê5ë[¡h…«‚U–vFØ!T9Ÿ¡7ŠêÊJKUÕ K£ºjé5C}Ñ)>•ÑZïŸÎuž¢‘65$åp:/Lm8o.úÓéâEÃòÊUàEŠÓû…¨”lï½é¨½ºæØý½ Fíšµ­lîeG-`ºí†±NÃÙ¥å®7o˜3(1òâÃE{n¤ú}Ë!œç9ô/ð_ë“7ÖO§{»™gÈ71¯/ËeÊFËÊÂÇŒðîƒáEIÁ€ÑÇ4)Σ,ÛÄ'yRÀDÁ]¡1 Û=Ni< i´%)J3”á.²©ªàÒ xo|®òë>þ”fŸqòm®r¥x ²?¬¶$éùŸÄµPb µ)Ÿäш/¾y˜E(J"òð$U>üØn›$X Ñ¿s¡‡½l8 s‘ù¦ü—eµã¢Y'Yàãú8òÃ\õÊíÂ$ aYÀWÖÃ[ë^þPKt”·IÃ,PK(l|RMETA-INF/manifest.xml­“MjÃ0…÷9…ÑÞR6EÄɢФPí‘#FB?Á¾}%Ç.%Cv3Ìè½OiŒ®.àƒ²ØWúB*ÀÖv û†|Ÿ¾êr<ìöF ’"Ÿ‹*ŸÃpk’øtNæ…ÒŹ¤û;&ʈX™or1Ńè{öï;~PKµºâ&ÉPK(l|R3&¬¨//mimetypePK(l|RUConfigurations2/toolbar/PK(l|R‹Configurations2/floater/PK(l|RÁConfigurations2/menubar/PK(l|R÷Configurations2/popupmenu/PK(l|R/Configurations2/toolpanel/PK(l|RgConfigurations2/progressbar/PK(l|R¡Configurations2/statusbar/PK(l|RÙConfigurations2/images/Bitmaps/PK(l|RConfigurations2/accelerator/PK(l|RËp@ÓnÅÐ Pstyles.xmlPK(l|Râ/Î8ÿ §I öcontent.xmlPK(l|R=W\¤ûï) .settings.xmlPK(l|RŽR†sÝ Ý c&Thumbnails/thumbnail.pngPK(l|Rt”·IÃ,v1meta.xmlPK(l|Rµºâ&Éo3META-INF/manifest.xmlPK+Ø4icmake-10.03.00/comp/icmconf0000644000175000017500000000220014204126757014451 0ustar frankfrank#define PRECOMP "-x c++-header" #define USE_ALL "a" //#define CLS #define LIBRARY "modules" #define MAIN "main.cc" #define SOURCES "*.cc" #define OBJ_EXT ".o" #define TMP_DIR "tmp" #define USE_ECHO ON #define IH ".ih" #define CXX "g++" #define CXXFLAGS " --std=c++20 -Wall -O2 " \ " -fdiagnostics-color=never " #define REFRESH #define LDFLAGS "-s" #define ADD_LIBRARIES "support bobcat" #define ADD_LIBRARY_PATHS "../../support/tmp" #define PARSER_DIR "parser" #define PARSGEN "bisonc++" #define PARSFLAGS "-V" #define PARSSPEC "grammar" #define PARSFILES "inc/*" #define PARSOUT "parse.cc" #define SCANNER_DIR "scanner" #define SCANGEN "flexc++" #define SCANFLAGS "" #define SCANSPEC "lexer" //#define SCANFILES "" #define SCANOUT "lex.cc" #define DEFCOM "program" //#define DEFCOM "library" icmake-10.03.00/comp/tokens/0000755000175000017500000000000014203741153014411 5ustar frankfrankicmake-10.03.00/comp/tokens/tokens.h0000644000175000017500000000077314204126313016070 0ustar frankfrank#ifndef INCLUDED_TOKENS_ #define INCLUDED_TOKENS_ struct Tokens { // Symbolic tokens: enum Tokens_ { BOOL = 292, BREAK, CONTINUE, ELSE, EXIT, FOR, IDENTIFIER, IF, INT, LIST, NUMBER, RETURN, STRING, STRINGTYPE, VOID, WHILE, MATH_IS, OR, AND, EQUALITY, ORDER, SHIFT, MULTIPLY, INCDEC, }; }; #endif icmake-10.03.00/comp/changelog0000644000175000017500000000022414204126313014752 0ustar frankfrankicm-comp version 10.00.00 * C++ version of icmake's icm-comp parser. -- Frank B. Brokken Mon, 07 May 2021 15:00:16 +0200 icmake-10.03.00/comp/main.im0000644000175000017500000000003014204126313014346 0ustar frankfrankint x; void fun() { } icmake-10.03.00/comp/builtin/0000755000175000017500000000000014204243136014553 5ustar frankfrankicmake-10.03.00/comp/builtin/data.cc0000644000175000017500000001240114204126313015766 0ustar frankfrank//#define XERR #include "builtin.ih" // builtin functions are called via Parser::function -> Args::builtin Builtin::Info Builtin::s_builtin[] = { // e_bool: optional int, {}: no arguments, // e_null: any # of arguments (may be prefixed and followed // by required args // 0 default opt arg { e_int | e_reg, { e_str}, }, // ARG_HEAD, { e_int | e_reg, { e_str}, }, // ARG_TAIL, { e_int | e_reg, { e_str}, }, // ASCII_INT, { e_str | e_reg, { e_int}, }, // ASCII_STR, // 4 { e_list | e_reg, { e_str}, }, // BACKTICK, { e_str | e_reg, { e_str, e_str}, }, // C_BASE, { e_str | e_reg, { e_str, e_str}, }, // C_EXT, { e_str | e_reg, { e_str, e_str}, }, // C_PATH, // 8 { e_str | e_reg, { e_int | e_bool, e_str}, }, // CHDIR, 0 (P_CHECK) { e_int | e_reg, { e_str}, }, // CMD_HEAD, { e_int | e_reg, { e_str}, }, // CMD_TAIL, { e_int | e_reg, { e_int}, }, // ECHO, // C { e_str | e_reg, { e_int, e_list}, }, // LIST_ELEMENT, { e_list | e_reg, { e_str}, }, // EVAL, { e_int | e_reg, { e_int | e_bool, e_str, e_null}, }, // EXEC, 0 (P_CHECK) { e_int | e_reg, { e_int | e_bool, e_str, e_str, e_null, e_str, e_str}, }, // EXECUTE, 0 (P_CHECK) // 10 { e_int | e_reg, { e_str}, }, // EXISTS, { e_list | e_reg, { e_str, e_list}, }, // FGETS, { e_int | e_reg, { e_str, e_null}, }, // FPRINTF, { e_str | e_reg, { e_str}, }, // G_BASE, // 14 { e_str | e_reg, { e_str}, }, // G_DEXT, { e_str | e_reg, { e_str}, }, // G_EXT, { e_str | e_reg, { e_str}, }, // G_PATH, { e_str | e_reg, {}, }, // GETCH, // 18 { e_list | e_reg, { e_str}, }, // GETENV, { e_int | e_reg, {}, }, // GETPID, { e_str | e_reg, {}, }, // GETS, { e_int | e_reg, {e_list}, }, // LISTLEN, // 1C // e_null must be an empty set of // arguments. The last 2 args are // optional and must then be // e_order and e_str { e_list | e_reg, { e_int | e_bool, e_str, e_null, e_order, e_str}, }, // MAKELIST, 1 (O_FILE) { e_int | e_reg, {e_null}, }, // PRINTF, { e_int | e_reg, { e_str}, }, // PUTENV, { e_list | e_reg, { e_int | e_bool, e_str}, }, // STAT, 0 (P_CHECK) // 20 { e_str | e_reg, { e_int, e_str}, }, // STR_EL, { e_int | e_reg, { e_str, e_str}, }, // STRFIND, { e_str | e_reg, { e_str, e_null}, }, // STRFORMAT, { e_int | e_reg, { e_str}, }, // STRLEN, // 24 { e_str | e_reg, { e_str}, }, // STRLWR, { e_str | e_reg, { e_str, e_int}, }, // RESIZE, { e_list | e_reg, { e_str, e_str}, }, // STRTOK, { e_str | e_reg, { e_str}, }, // STRUPR, // 28 { e_str | e_reg, { e_str, e_int, e_int}, }, // SUBSTR, { e_int | e_reg, { e_int | e_bool, e_str}, }, // SYSTEM, 0 (P_CHECK) { e_str | e_reg, { e_str}, }, // TRIM, { e_str | e_reg, { e_str}, }, // TRIMLEFT, // 2C { e_str | e_reg, { e_str}, }, // TRIMRIGHT, { e_int | e_reg, { e_str, e_str}, }, // STRCHR, { e_int | e_reg, {e_list, e_str}, }, // LISTFIND, { e_list | e_reg, {e_list,e_list| e_str}, }, // LISTUNION, // 30 { e_list | e_reg, {e_null}, }, // LISTCONST, }; // builtin functions needing 1st argcount arg. unordered_set Builtin::s_argCount = { EXEC, EXECUTE, FPRINTF, PRINTF, STRFORMAT, LISTCONST }; icmake-10.03.00/comp/builtin/defaultarg.f0000644000175000017500000000032014204126313017030 0ustar frankfrank// static inline int Builtin::defaultArg(Function function) { return function == MAKELIST; // only MAKELIST uses default 1 // other default 1st args are 0 } icmake-10.03.00/comp/builtin/builtin.ih0000644000175000017500000000015414204126313016540 0ustar frankfrank#include "builtin.h" #include "../../xerr/xerr.ih" #include "../../support/as/as.h" using namespace std; icmake-10.03.00/comp/builtin/icmconf0000777000175000017500000000000014204126313020652 2../../icmconf.dirustar frankfrankicmake-10.03.00/comp/builtin/arguments.f0000644000175000017500000000016514204126313016726 0ustar frankfrank// static inline Builtin::Args const &Builtin::arguments(Function function) { return s_builtin[function].args; } icmake-10.03.00/comp/builtin/argcount.f0000644000175000017500000000031714204126313016542 0ustar frankfrank // true: needs 1st #arguments argument, not counting iself // static inline bool Builtin::argCount(Function function) { return s_argCount.find(function) != s_argCount.end(); } icmake-10.03.00/comp/builtin/builtin.h0000644000175000017500000000201314204126313016363 0ustar frankfrank#ifndef INCLUDED_BUILTIN_ #define INCLUDED_BUILTIN_ #include #include #include "../../support/builtinfunctions/builtinfunctions.h" #include "../exprtype/exprtype.h" struct Builtin: public BuiltinFunctions { typedef std::initializer_list Args; // argument types typedef Args::const_iterator ArgsIter; private: struct Info // Builtin function info: { ExprType type; // return type Args args; // argument types }; static Info s_builtin[]; static std::unordered_set s_argCount; public: static ExprType returnType(Function function); // includes d_reg static Args const &arguments(Function function); static int defaultArg(Function function); static bool argCount(Function function); }; #include "arguments.f" #include "returntype.f" #include "defaultarg.f" #include "argcount.f" #endif icmake-10.03.00/comp/builtin/returntype.f0000644000175000017500000000016214204126313017137 0ustar frankfrank// static inline ExprType Builtin::returnType(Function function) { return s_builtin[function].type; } icmake-10.03.00/comp/builtin/frame0000644000175000017500000000006414204126313015565 0ustar frankfrank//#define XERR #include "builtin.ih" Builtin:: { } icmake-10.03.00/comp/main.cc0000644000175000017500000000147414204126313014343 0ustar frankfrank#define XERR #include "main.ih" namespace { Arg::LongOption longOpts[] = { Arg::LongOption{"help", 'h'}, Arg::LongOption{"version", 'v'}, }; auto longEnd = longOpts + size(longOpts); } int main(int argc, char **argv) try { Arg const &arg = Arg::initialize("hv", longOpts, longEnd, argc, argv); arg.versionHelp(usage, VERSION, 2); Parser parser{ arg[0] }; // parser.setDebug(true); if (parser.parse()) { cerr << "error(s) encountered\n"; return 1; } Generator generator{ arg[1], parser }; if (not generator.backend()) return generator.noBim(); } catch(int value) { return value; } catch (exception const &exc) { cerr << exc.what() << '\n'; return 1; } catch (...) { cerr << "unexpected exception\n"; return 1; } icmake-10.03.00/comp/error/0000755000175000017500000000000014204243136014236 5ustar frankfrankicmake-10.03.00/comp/error/data.cc0000644000175000017500000000731514204126313015461 0ustar frankfrank//#define XERR #include "error.ih" size_t Error::s_nErrors = 0; size_t Error::s_error = 0; size_t Error::s_lastLine = 0; size_t Error::s_displayCount = 0; char const *Error::s_static[] = { "" , // OFF, (( <- matching below "')' expected" , // CLOSEPAREN, "',' or ')' expected" , // COMMA_OR_CLOSEPAREN, "',' or ';' expected" , // COMMA_OR_SEMICOL, "error in expression" , // EXPRESSION, "identifier expected" , // IDENTIFIER, "error in initialization" , // INIT, "function `main' not defined" , // NO_MAIN, "'(' expected" , // OPENPAREN, ) <- for matching "'{' expected" , // OPENCURLY, } <- for matching "';' expected" , // SEMICOL, "error in statement" , // STATEMENT, "typename/void expected" , // TYPENAME, }; char const *Error::s_semantic[] = { "", // NO_ERROR "ambiguous overload for `" , // AMBIGUOUS_OVERLOAD, "incorrect number and/or types of arguments for `" , // ARGUMENT_MISMATCH, // "cannot overload `" , // CANNOT_OVERLOAD, "division by zero for operator `" , // DIVISION_BY_ZERO, "invalid argument type for `exit': expected: int, got: " , // EXIT_TYPE, "`fprintf <<' must first insert a string\n" , // FPRINTF_NO_STR, "index operators require `string[int]' or `list[int]'\n" , // INDEX_TYPE, "invalid cast from `" , // INVALID_CAST, "invalid operand for `" , // INVALID_OPERAND, "list constant arguments must be (convertible to) string\n" , // LIST_CONST, + "lexpr needed for `" , // LVALUE_NEEDED, + "main(): cannot be called recursively\n" , // MAIN_NOT_RECURSIVE, "main(): cannot be overloaded\n" , // MAIN_NO_OVERLOADS, "main(): parameters must be ([int [,list [,list]]])\n" , // MAIN_PARAMS_ERROR, "main(): return type must be `void' or 'int'\n" , // MAIN_RETURN_ERROR, "multiply defined: `" , // MULTIPLY_DEFINED, + "(f)printf cannot be nested in (f)printf insertions\n" , // NESTED_PRINTF_INSERTION "`break': only in `while' and `for' statements\n" , // NO_BREAK, "`continue: only in `while' and `for' statements\n" , // NO_CONTINUE, "different operand types of `" , // OPERAND_TYPES, "(f)printf needs shl-operator (<<)\n" , // PRINTF_OPCODE "return type error for function `" , // RETURN_TYPE, "the ternary operator's expr2 and expr3 types must be equal\n" , // TERNARY_TYPES, "variable not defined: `" , // UNDEFINED_VAR, + "function not defined: `" , // UNDEFINED_FUNCTION, }; icmake-10.03.00/comp/error/set.f0000644000175000017500000000011014204126313015165 0ustar frankfrank// static inline void Error::set(Static error) { s_error = error; } icmake-10.03.00/comp/error/msg2.cc0000644000175000017500000000035214204126313015412 0ustar frankfrank//#define XERR #include "error.ih" namespace { ofstream noOut; } // static ostream &Error::msg(Semantic error) { return display() ? cout << g_where << s_semantic[error] : noOut; } icmake-10.03.00/comp/error/count.f0000644000175000017500000000010114204126313015522 0ustar frankfrank// static inline size_t Error::count() { return s_nErrors; } icmake-10.03.00/comp/error/msg1.cc0000644000175000017500000000021514204126313015407 0ustar frankfrank//#define XERR #include "error.ih" // static void Error::msg() { if (display()) cout << g_where << s_static[s_error] << '\n'; } icmake-10.03.00/comp/error/icmconf0000777000175000017500000000000014204126313020335 2../../icmconf.dirustar frankfrankicmake-10.03.00/comp/error/error.h0000644000175000017500000000372014204126313015537 0ustar frankfrank#ifndef INCLUDED_ERROR_ #define INCLUDED_ERROR_ #include class Error { static char const *s_static[]; static char const *s_semantic[]; static size_t s_nErrors; static size_t s_error; static size_t s_lastLine; static size_t s_displayCount; enum { MAX_PER_LINE = 2 }; public: enum Static { OFF, CLOSEPAREN, COMMA_OR_CLOSEPAREN, COMMA_OR_SEMICOL, EXPRESSION, IDENTIFIER, INIT, NO_MAIN, OPENPAREN, OPENCURLY, SEMICOL, STATEMENT, TYPENAME, }; enum Semantic { NO_ERROR, AMBIGUOUS_OVERLOAD, ARGUMENT_MISMATCH, // CANNOT_OVERLOAD, DIVISION_BY_ZERO, EXIT_TYPE, FPRINTF_NO_STR, INDEX_TYPE, INVALID_CAST, INVALID_OPERAND, LIST_CONST, LVALUE_NEEDED, MAIN_NOT_RECURSIVE, MAIN_NO_OVERLOADS, MAIN_PARAMS_ERROR, MAIN_RETURN_ERROR, MULTIPLY_DEFINED, NESTED_PRINTF_INSERTION, NO_BREAK, NO_CONTINUE, OPERAND_TYPES, PRINTF_OPCODE, RETURN_TYPE, TERNARY_TYPES, UNDEFINED_VAR, UNDEFINED_FUNCTION, }; static void set(Static error); static void msg(); static std::ostream &msg(Semantic error); static size_t count(); private: static bool display(); }; #include "count.f" #include "set.f" #endif icmake-10.03.00/comp/error/display.cc0000644000175000017500000000034514204126313016211 0ustar frankfrank//#define XERR #include "error.ih" bool Error::display() { ++s_nErrors; if (s_lastLine != g_lineNr) { s_lastLine = g_lineNr; s_displayCount = 0; } return ++s_displayCount <= MAX_PER_LINE; } icmake-10.03.00/comp/error/error.ih0000644000175000017500000000024114204126313015703 0ustar frankfrank#include "error.h" #include #include #include using namespace std; extern string const &g_where; extern size_t const &g_lineNr; icmake-10.03.00/comp/error/frame0000644000175000017500000000006014204126313015244 0ustar frankfrank//#define XERR #include "error.ih" Error:: { } icmake-10.03.00/comp/opcode/0000755000175000017500000000000014204243136014356 5ustar frankfrankicmake-10.03.00/comp/opcode/data.cc0000644000175000017500000000477214204126313015605 0ustar frankfrank//#define XERR #include "opcode.ih" ExprType Opcode::s_types[] = { // allowed types opcode hex value e_null, // jmp, 00 e_null, // jmp_false, 01 e_null, // jmp_true, 02 e_null, // push_1_jmp_end, 03 e_null, // push_0, 04 e_null, // push_imm, 05 e_null, // push_strconst, 06 e_null, // push_var, 07 e_null, // push_reg, 08 e_null, // pop_var, 09 e_int | e_list | e_bool, // umin, 0a e_str, // atoi, 0b e_int | e_bool, // itoa, 0c e_str, // atol, 0d e_int | e_bool, // mul, 0e e_int | e_bool, // div, 0f e_int | e_bool, // mod, 10 e_mask, // add, 11 e_int | e_list, // sub, 12 e_mask, // eq, 13 e_mask, // neq, 14 e_int | e_bool | e_str, // sm, 15 e_int | e_bool | e_str, // gr, 16 e_str, // younger, 17 e_str, // older, 18 e_int | e_bool | e_str, // smeq, 19 e_int | e_bool | e_str, // greq, 1a e_null, // call 1b e_null, // asp 1c e_null, // ret 1d e_null, // copy_var 1e e_int, // inc 1f e_int, // dec 20 e_null, // call 21 e_null, // frame 22 e_null, // ret 23 e_null, // pop_ 24 e_int, // band 25 e_int, // bor 26 e_int, // bnot 27 e_int, // xor 28 e_int, // shl 29 e_int, // shr 2a e_null, // invalid 2b }; icmake-10.03.00/comp/opcode/OLD/0000755000175000017500000000000014203741152014774 5ustar frankfrankicmake-10.03.00/comp/opcode/OLD/accept1.cc0000644000175000017500000000037314204126313016623 0ustar frankfrank//#define XERR #include "opcode.ih" // static bool Opcode::accept(Byte opcode, ExprType type) { if (s_info[opCode].types & type) return true; Error::semantic(Error:ARGUMENT_MISMATCH) << mnemonic(opcode) << "'\n"; return false; } icmake-10.03.00/comp/opcode/opcode.ih0000644000175000017500000000011214204126313016140 0ustar frankfrank#include "opcode.h" #include "../../xerr/xerr.ih" using namespace std; icmake-10.03.00/comp/opcode/opcode.h0000644000175000017500000000064214204126313015777 0ustar frankfrank#ifndef INCLUDED_OPCODE_ #define INCLUDED_OPCODE_ #include #include "../../support/opcodes/opcodes.h" #include "../exprtype/exprtype.h" class Opcode: public Opcodes { static ExprType s_types[]; // allowed operand types of the opcodes public: static ExprType types(Byte opCode); // use SemVal::accept to check whether an opcode is acceptable }; #include "types.f" #endif icmake-10.03.00/comp/opcode/types.f0000644000175000017500000000012514204126313015664 0ustar frankfrank// static inline ExprType Opcode::types(Byte opCode) { return s_types[opCode]; } icmake-10.03.00/comp/opcode/frame0000644000175000017500000000006214204126313015366 0ustar frankfrank//#define XERR #include "opcode.ih" Opcode:: { } icmake-10.03.00/comp/main.ih0000644000175000017500000000047714204126313014360 0ustar frankfrank#include #include #include #include #include "../support/tools/tools.h" #include "parser/parser.h" #include "generator/generator.h" #include "../xerr/xerr.ih" #include "../tmp/INSTALL.im" using namespace std; using namespace FBB; void usage(string const &progname); icmake-10.03.00/comp/forstmnt.odp0000644000175000017500000003506014204126313015466 0ustar frankfrankPKâ“}R3&¬¨//mimetypeapplication/vnd.oasis.opendocument.presentationPKâ“}RConfigurations2/toolbar/PKâ“}RConfigurations2/floater/PKâ“}RConfigurations2/menubar/PKâ“}RConfigurations2/popupmenu/PKâ“}RConfigurations2/toolpanel/PKâ“}RConfigurations2/progressbar/PKâ“}RConfigurations2/statusbar/PKâ“}RConfigurations2/images/Bitmaps/PKâ“}RConfigurations2/accelerator/PKâ“}R styles.xmlí]K“ã¶¾çW¨äJn¤ø¥‰g]v\vRµc»v×®ÊÉE‘D/E°Hj4ãSþA9äÿå—O%ê12×UÞк?4@£~ùÕË&=ƒ$ `ô8ÖUm<‘ý Z=Žþô2õîO_Âå2ðÀƒ½íD™’f¯!HG¨p”>ÐLáãxeñÃdcÑT&«‰¡ió ý=feÜ(Ø<Ž·IôÝ4H"wÒ‡Ì{ÀEy3­›!41Ý¡l˜Vñà&Fµ,B V' E„¤zÙêÄ2b]^ššYŽÁn·Sw&‘ÿÓ‡ ÎS2ð’M8ug-xÙ“Ä0É8µïåÄñ6 ™ïM@0céDWõ¼foí&™¬0„¸ìóJ×çU¬~âîdkÁ´HÝÄâ(Ùâ˜V,‹ôÐkÖšxnèåÂb=–ï5µkmj—H8ùd®l[˜Vlê% ¢Ïuº¥Ïçó Éå¤K(ÛÈK*KØÐ…íãÙÚÏô—lÃÌœ”ÆôåÆôKÚâ.ä;‘‹¥£ífé¶ÝÌ­êÁR^pTÎÈ*ÒÄBÓ“Un_—pùÔ¾ÐÚÀK ’g¹!)öPª¡‚Æ!cLˆÄÁÚZ@×&˜†Ó¯ßëtUmN]B)ÏØ}ÁK„ð1™’5”nXÐ'ˆBÏØ.æc"!ׯ\ºÚF!T6©DhÜÂøA(-6ަ£uÃ`œMžP&ùßÓûbH&Ò³¦-Ùc/ bikH©K–cmj{‹Zœ;1@„…€9~Çgý%D3þÒõ€â/Lß}I@ž<¢¿1[ãoÁoî/ÛÑG7JGO0‚úx„¦ NŒ&â×Çñ_ܦݧ¤©ãQ©v\@Yõ²êèƒ$*‘ÄA桾X/ÀOºñvÖžÝ$ Ãíwïd‡Èh 7·Gx æzä-·7ÖP•K)Þ0á%˜ûf°±œâìŠ-£ü,¥» M{Ô,£GÕ:™·o‚,ÍànF¿ ¦Ûa«¡•añ5ÍÀ¦§.•²µa껀´„¬S9˜4MP,îRß}‰/hÕâúš(Gäc3C4mÐ$¶@Kià&yÚ¡rÑ ñ‹%ùòÐÔ›gxäO© ^ADi!‰uMû³P¨>ÇV¸uSóÁŠ%-`âã•)¢™âWCûõ›p XY?HãÐ}UD’‘XXǘ/½:aMÛ6¦ó« û=Ò£¨MZ‘@B\gáMíquÙÆÕÅýëi­°:©ñÔŸúuj<7t\]Ô‚0„»6iK2ûÀž×¼°œ™f]Iàk7iYˆxªqæ’x/c;oÍ{•¥,!QÊ’Ù:IÊv!7nò$¢ˆ_' î&<àýà7 £´‘¡L¦£]Ù“ŽÒBEljkCû½˜\|°t·!s7òÉ€Í#ÒxxcNË~+1Ú·$ @JêGs2ü ãeMm—÷øiSÅÞ-áÃU¥À˜ú#¨àßS±›¸¤±RS$ û¢w›Á4v±7$ð¤¤n¯]>ŸÅÛÈ˶d)CêFó]°‰ñ†œæcUVh-ñådhBÌJ3aùïü°#–âÖˆÃvé†)ÈA›|„ŒS›–ça’Ÿ¿£|Ê3’bÅwW( ›m”àÁm”%¨ÞŸ?VêUÐNØ*«Ÿ‚WΉh [Ö Ïû}ÍsXs<ão?TÅž²¼4- ÷ZÏ©kÛÏs×Á>yÖ?~}W ¼ÓÄ‘AñF<òÝÄw/Ì@àƒêaàÅ1´ |ìöÐ¼ÍøàТ¶@¡Ö†T \´šïìnáê["À&©¹8±r5…ñÀÎ%hê$«½‹ºRYÃ$øb/­Á ©ÀoÛ4 –¯Dc×LJ" O˜ݰ13BÆföIÕå…`™ö3’`µrh¬]Ÿø•ß/0$QA ÛdÊKrækm&—}¦áÿ¿y¤e뺧C"YžAH‰•ÅÍÃÙˆfât4[ŒéOš¥às…Çñÿþûï\á„J#e6A¤„îåä}=ELšL· \·?¢üøºYÀp,c¶ÊȲÉ6i“´Æ 8iCY€%Láþ2{CH§z~wY="4»K„ìÞ2Të.šö†y—ø8ýás§vzÖBÖÚéyÝ§ÖµÞ ²ß–¡²ÙŽmÒ´ñjõ, ¶Ñng…¦»¶…`‰|QN¥»”rZ¾AaÉÄu°´<õõ T‚\@œ ”ô ¦Ä#©#˜lܰ¨%Kж˜}G0RH7zHp›a®óÍžE¤ÉÖ Ü®Ö ó¦‰­V‰²×x¦ÁkA6÷ût¾ãÎ=mÓgÌ?BÓ¸de¨ùž±"ñõdBD"&¼ºë~^’ C[jí°#âV¢]Óà9ä a0êãÏÊx MGC<¿À±ÁD3ɸe¹e$Zʾ¡¶.)".pNÜ(rNÑ,tNÒ vžß,x Ñ/°‰×.UÔÊHJ@€eRÂç:¬#`¶¡°‚?ì€ .~^¶ ²5²ØýÓäãNY7É#[•ФÝgFýMD iþ~$üáóÌ#þ;‚øÿ¸.ü7jºHÄ`pFË'"´š®cÁ.=BEñ¿ÅBgš; iïÃ'Ôáýû*kE¸ùÓ<áU& !¸£~zè=¶CÒ¯­îÝNº¡›ž·/ „ÙK^‚,Xß ÊÚNFÇȇÊtRhIù,«‹|.vû¶IÈHnIF£“ŒX‘Z»å_Jº?ÌpÑZ‡‹v3ª4Ÿ;\$̇ËíÈèG —¦.$Ãå2ÒÉqü}¹é®söI˜+ÈOÂ7¶S“†‘‡tí×ï;®*Ë3‹"¢ÏÓ”o²FËw¨|K¹€¡/ÄëŠãTNé$$g|t仾«¥軮2†d¬—%ç­­7÷C…öÜ0Ä;t&,¯”Å…Q¡mŸ ËMY¤#úèC1ìš# ¯Ò?Ä—SZ\Ø‚I™ä°°Æ/†ÌÔéz>ã|8âHÕfzCÔ‘FþœààâµÛpNu¤Ï1ì­HC­eºšGe÷ÒÕlwÆ‘ÖûH4X$¶ ãÌe¾¦j¿lRíB—Nö/[´†9Ïo,ºðÄë(ÿúÏ1W ìÛ@ȹÕë(F{ïì­êPýu”ctèfÁ{Ö¡þ®£¼±(ç+\G™Þéu‹þ.¤8wz™ ¿ )ó»Ä§¿ë(ºv+†úvï£èúÛ2Õ׿¢«ºc´_J®ŸÜ˜KDZUüPä|:·f†eƒƒçÂÓøC:xÄþ£8xŒVOó‘Q3å,¦í÷ÍYߦœvÌÔVgø$ÓÔlݱʵ%ÑùY›Y8 ;dîAgöÓÆùzÀÑôóô€=U lóç†éhSÍn뫽:]؃®–\˜çëk:=OXNæßwÕ5~,æv?˜[çÃÜ0ï òi?ÛäÒ;ý@> —†|Öäι4äó~ Ÿ †<Ý.2|Ùîìç²y\Ò3.éQI›À÷CÙ³ÖœÝá¿á¿á¿9Qø;ljêðÀßðÀßðÀßðÀßðÀߨ¾±Ð—뜧ÁÙ’Ÿ>}>œ›Þ⹩9œ”'¥ '¥}œ”¾%Ëàlœ-ƒ³ep¶Ü(Bƒ³ep¶ ΖÁÙ28[n¡ÁÙÒƒ³¥Æƒ28K®ür¦fªöà/¹°¿ÄªÄnþ!ü% b߉¿Dt€(1þÐhè¾"›RrK|ý^ûdàè5‘ú!ѱ†!J£R}Oçq¼v‘EÛbðžW8TFÕì—?˜¥:–ɳ©D×TÛžòDþ–€‚cL:ǜƃŽ&2ݺ2û@ 5¬n\ˆk0±â©x¹ñZ@ÇĤ}TÕ'§{ŽcP¼—üF¯Þ¦¾¤Ž¼yøª£Ò²ù¦d¯ÞP¾¢ê¼E?Uf!ÌÚøZ|¶E¬=½¿Ø¬oàØqˆSâÔ†8µ›AhˆSâÔ†8µ!Níº qjCœš|œZûbÛÛÃb{Xl‹íÛChXl‹ía±=,¶‡Åöm#4,¶…K!±‚,cã¦ùˆ,M%G¡ûŠ“pÅozZA—é4Þ 3TŸ/|CU‚†Ø7’z‡†-à¦[UŽ¿‹qÚ—ƒÎ"c*t9œ«)üR)Eˆçûù8¸’ǼæÑ $À1½LPR ‰Ëc JÁ ä »¥41Òt®šÓy%ÐT5çy\ï ‹Èdáªäß%¼ÐMÓÇ1 ¡ãœ¾ð…Á˜”£ù! @Q Á'}?Ü—¶‘+5.Çÿó,Zžž‚§Õ;žº¡† ¦yœ`XÍΰæÍœYãZšjLU›Fw×AKÃ9Ï«®´ ƒz~umV‚í]kiñ¢w:‡SH;mRG¶F•DnvÑV§¦³¢£j–#€h¨3C û7Šð­+´®kªeÙ×k~¦ZsóbÍ릪æÕÀ¯4aô«í ðOê–9|ñÃVz˜½’Ï•EP¶-môú¥^^Ú” ˆHº÷@‘<"†¥ÎŠI›ªúlZRHsf—ÂrfMñÐtï'ÿ@oÉÂLš úA¡‹Ÿ*·¡£žvZŸ«S:Ô Îø¸„è4¬¼—…ÂTµl³„jÛV ¦¥:S½×uX÷õBoë°#ažvy¦:NUßö`Æ–ÎÑ¥qî¾(³¯´(;áN‹39EÖÔ™=—Fø-®ÎJrD¨÷ÒÖ-uýœÚÿLƒfÑ©aí÷ÑøÒêYµf¥Õ3ŸŒ›º'_HΑNŒ;ªQ Êœq¤YŽQ2‘zI±ðõS§Q±™)®¶¥¼çÇ‘¸N^6gÈUÀœ"ÝQŸTçÝ|»(l ‹ƒ½sžìCo»Éïà¥ïþPKÙæ¢MS0ÑPKâ“}R content.xmlí\ɒ㸽û+œ°Oæp—»jb&&úÔ=1ánO8|qP$$±›$$UËü„þ?‰à"pU¥R-Ýu¨* 3_"Ò»ï’Xº!yÑôJFª.K$ h¥Û+ùŸß+®üãõŸÞÑÍ& È*¤Á>!i©4-ᯣÓbUõRJ¯ä]Yf+M£I«V•æ[ 뺧UÏr=ÆO£äJÞçéŠúET¬R?!Ū Vlh³Îê@ë—ÀáŠ3X5I/€ÑÏI³¬c"N“å¤B>ýÒéÄ1â\AQe«ƒÛÛ[õÖàòþ»Æú”’Ü•ZC½ÍÃ0£mÚV ýÒWn"rûC3ânW&£#çyïmH74OîjyZ,j¡È]FòˆÉãÇ+Ja€Bä9ÍV‡ DÙîŠh‚W¤ýóã‡OÁŽ$>ÌQ”~z@9ÏÊ›°´œd4/ê0h‰³}s²0ÐHL³…†TÔj/Øùy¹0NÜ1ž›íbÛ¹ÙN˜N˜û·Kga´°§ÄáÌ–g´âXØkÁŒbM-ðã ¶¼Ébqqo©ÛÙ¥nó §!OHé/]‹Ñvl,ŽÒ¯ÓöÍzö½t‘»"V6tÂyŸeö|Võ´tázÏu Æ—Œv¬Å_/‘‹£Ó}²&ùâµÁó í`³\p‡Û –x°ô|Û‘ ݧaåCGü¶êÌ0ÐÆ±€Ã‰ÄÍ:;é£iècú¦kÈ…:ðÓdÒ…2'Ln˜—k-<"q¸ÌƒS%)úî›îúïð¸ÿn7±_î&ö¡«}„Nþëã1Ú,µŽ~`)‚<Ê;Šº#›°˜ kU·,ÕúRC¾nòšjÖBk6ß(? JH‚¸¸~Wm‡¶Yªž§Wò/ä‹ÿû^úä§…ô‘¦É†Rû+ù/~F‹¿õ)«VYêÌÎ([’Âàã’<ídQ<›èŽ„²vo—aíÆÏ#¾ùŽp÷!¯Äw_xZq=Âç`å4ñÏÆL¹YÄ#¼s¿Ò’Îk¬¥¸;‚a/1þ,·QQœÑ²ðMëѼý•E™?‘~‡¥çÕ6B»„Åû¢$É™ ]äk/ÂÔûœ m ]å@› Pu»¿/)«•…ÏÓF.þ»Ão˜¡v±šÏºHQ2Käf¤Ø¨da¼ŒH!uŠàµ|Ýæ,7‚еˆxªZæ{Ⱦ¦Èèú Êb–<ŒŠ,öï!}§%Ë^gH8wM–»ñãbŠ’7¢”QÒ¬Èt*¨hN_ø|új¸Ù?<"Ù‹~›Œe›ûÙ. šæÌÏÙ‹!þ TƒØ«€ÐÏÃV5õQ+L[¬Æñ•œÒøæ ¬Ü…ù|eGóèÊÒ\Å£-äm_öEmîû„7l¾à@–Da7Ó±M¡€ÝÝ‚¾£í®l•´¡«$JÛV¬š¶$mûm²<ØT]äBsë@VŸË"JRu±b˜¡ÏÒ+9Εr}Š–&vF-ƒ«¦_I£g椪(c †óƒÎä LXCKºá?Çъɦœ¡²è^g­óª¯‡®:ñÑUÃC—ÁÇø6vFϺ Ìo@ËHõù¬Z¶¾ûšÓ} RuŒ/ƒ}:>URu•;º/™•øùW’+$ ¯äŸrPŠÜo¼,SÇ‘M4±7NÛ¹˜Y¾( «ÈñzekK•ç~ßÓó{Úp‡:¶UϾОö¾È†Uû™ó¤ß•Ò§|£"T5_¡§,'_´—7õ1/¯"Ë<ÍÓ£ï¥â¬«Ÿ ¥OnÚ“5âŒÖk¦rZBþ@Eœ3e×3âÛŸƒø…lü}\*)¬[, 0ã°NÖ¯y°j9‰´¿ 5Ò¬$Ï® 3mŒ2 )¿Û0ËRÕɇ ¤àïi§Ž —‹3Øì¢8ÕAó‚´`^í/TôÁvzèÓüô¶8x1´ÅháÅ ˜³€½efeçð€5+~ùéT'»“»º{¹<ƒ/‘W¨ÍA™±­½œÇAMþš?AîA9}|ç>› J˧ÂèÅH<,ó.¹u^š2f3ž§ÄÿE{×a™tšZ.ž-|àÈôý˜DaùÒ]=végÃýó k|°(ÃEùeì8*êZª³ð$‹1¹!q]r­÷qLJ©êdí ”\=V] »¦~%ÿï¿ÿi&ØåcXaûkèi_"Øbi5å™…|‚BüÓ}²¦q£ª}A`®4„2ŽS֦ߖr’¦õg®—9IOÐ~„ŠŒÝ‚Y“ ÍI£„·§!ãlB*~“2Ϩ!÷MjÈ:›†°j¾I ÙgÓñ&õãœO?oÔO»gÓùFý´wF ½M?ÍêÚ3©Èz]ŽZè®smmò^sݱ¦á}û {\¿ãE»[•sõa <#¹9æºoBøuèúêK%~}©V<&é]ª*êØ¿§û¦„øéú¬Ë5Á¾þ•bçgd¸6¿]ÛžuNh~«>G·ŠÂ+9 Ýš¬û˲‹¿ÕêÕq]°¥üÌ·Îçd5wìúƒÉùó={Æ–ϵÅfµ]‰LµEX[:ì‡ö: iXãɈl³Z!$Ý±Ï ‡Ê–Є”ù=_}Úùg <é’.adëõïF;÷Ìž“ ôÓm{öÚN•ñO­}”ØàõðÎ4Òá¯.ýKú•[䟚ÃM²Œa…'±2D¬P+t+]uù-ÖVz}5倕ƒ<+GÕ=“cu`iMïè®ßÔ®õ(´ƒ”ç’XŸGfWµ,KÙUu<#òçSD>¶/eûÒëî=t_Úê`m`Qnþ™Þ˜E™¤å«Þ™Ç@3—fu@³ ²Í.hº-‚fÕ÷úZ”¯²I×bMbe‰X¬Œ£X!ÕsÍãÎÔDŽˆ†ÈgO»–èÌ#Ðaùzÿë8xOï’qGoø<*‹zsÁ1Íèí´(‰C FIó1±íI±íqÙSöùM}›éõC)b±Ôryæ÷áðÁ>° hÚŸ—•™‹!¾jÞÆ{¢d4JKþò®Þ\á "±^­€}„xàIãJAv%]Až‡%ÃvëÿÒÍúÝïÄ­ß9ìÎF¿ ½©sªÊ;æd8#ædâ¾Ë´ú.Ó\¦öúÝœ;©Dç¨Õ3ì‘=麂!7°Ä¸JFÆÌ–œõZd „HInüXƒJ’ç j0ƒŸfyË"¶ÓñfÇ57±Ý^šeºbù!^G¯;Çš´ä6«bµ$ïÅúXx±º€Ø‡ÄÁ:)*»`¿þ ð¿yðý+üþ°ìœ‹¦+v[4Y»c²K<¦m$.B#; E`£bî—ì¯Çc>0ÚOÕ–sá^LöÏöÃyD¼7ÎïE aÆ–;,àÛ ç–Wýg¹Ž7ïaÇ@Ÿ«÷Ó{:¥dÆ~0i³cÒæQ“fך´kˆ›ÞU]]|±èx¦Ìßõ ^J•Qº'Žc—²V¨õ±iuÌÕP‘eˆæêBZnu̵©5GÍÕœ4Wâ‘æ{.DŒTÏ=²¡:º˜#OµL÷Ü9'äù17¹ßSÌürÃHw»¸â[°:ˆ`×zDñÎD\`Qbo7¬XAàp\w,ÁÁ°—\oAzs1O$ª•é÷´*( ïîÇßé§©Õ[à‡tHÀA·´jC~hà±@ì°žyÿÞ9òäŸ;;ÅWàç ånŸ¬S?ŠG]ׂ··wãA:4[ðP*w± ‚ʾ£ ó¥H¨wvÄ~QT‡Á²Öq¶2‘ólæ³ é¾ k?×È2X<Øh†ñ_}n¯w,ûÙÑøð½R=‡­õ\’6„¸¡`úé™@AJv¹¹÷}V ewÚïòª>ü*|]Y÷`^ëœÝk_.~ýPKFŠtºa \PKâ“}R settings.xmlÝZmsÚ8þ~¿¢ÃÜÍÜÍMŠ!/­™&7æÅÀ…ðjñ—ް¨‘%Ÿ,cȯ?É4%†¦6îÜ\>°¥çÙ]­vWkúkí‘w+ÄÌèu¡ô^+¼CÔeÓÅuÁ¶Ì³…¿n~ùÄæsì¢ dnè!*Î$„¼“ÓiPÙÞfŒ]–Bø•b‘ùˆn¯¾g|Q,kš^Üþ.ìæŠ½ëBÈi… <T„[QSŸˆ*_Ç!E¬Än/&oPcÏ\æùeFÐKŸ£@Œáß ÷rÎK,—Ñ9^¼e;úåü5ÁôáÙ†Q½Îcû•t]/ÆwŸ†7öÅž±·¿Þ*ØnµcÁvß_¸ÈyáæÉžÜàæÓN—íÇÈS>ònwY‘]¤È•Fѳ÷’æ};gŒµ`GÀb~á馨øò&¦¢psvqõáSñ5ÎawÐ\$‚Ÿëårfô †b™_þx^¾Ê ßBx±L_ºÍÛÅ?ó€†)Dk÷¹P”¼Xñé8|ó‰QÔ†{b‚KO(Ü(¿(¥³D“cØvö؃Ÿ1F …›9 Ê‚orF÷m| ôv0¢À·˜bɾèð¦Á!ÁÃŒ$êS”#Eoö¹ÂäòbŽÖÚ²ô™ÜDuÉDÓ'aÐ$›ÝW¹®üRç`1’[ä±: ‚=L@}F6±Ù:ò‚0]b\ºÔ´´Ú¼æÊc‰vëÑ™øöñA€®.ªR¾)Ü´¢ëët}úÈ›¥ÃÜ¿OQü>T—BÆëYï²#쵈ÙsÄ¿› Òã«Ðz+óæ~f[2.]=¥Ÿ‘A~Ràv»Âƒù›: ¥•k»Z‹Ä³f–lÔ–€.Ðm ñÓÓŒ†(è#>dQò"\¤Œ—Ò* +ÇÆ”ëúÿ/”³ ¼P>O_Öà:(}©ü!åª~?"{&tSÖk¿:¿Ì†|XêLЪJ‹…žv幕Áøé-ó•¤.×qÍ‘L“Òï¿á¸ÿŠÜç£H;ˆ =EÓ ªžÉã £Ðs¨'ƼMȲ§Ù ®LªDØ[!>',ê p7)È.¾<}º½;Ð'x{ëf{!äq²ý‘Žáûdcˆ×§ÏÒU,¤¢–r<{Ø9Ð_øõ÷—ç-Uñ†œüQ –€£¢ˆTýv^ýõ÷P øÇN€b ä`Àáû€ÍÒI%kdÇkÌSíBÕ=³¤H'-æâ’97ÍÝtBÕA°ÌM&˜R&4!R¬‘H®ŽÒ‡Ø†7CÐ0 #—c_˜ìÈ‘4Ã[Ñ(g"h?ÑQì !1ïÈòŒÕ£qØ9¡.‡[¤&ã3 !¢Ïû>{ô#O7aÂùo·‰M4BÅÕ¥,³—;`¿ÔÛ¡¾¡·PE LUó05BƒÂ£ó³&Ðïñ79€X‚åûéVFõY(‚ãøQn@N¿ßZ@¸ùýeÚºôqGæ~H]mdëçªV^•±©LîUà>äÑSyÉqôqGfYæÓ}Ú¢s)ËKz‹œ ;‚ÝŽÍ‘ NUJ‰\ÕÄ]&£gW¡ ò:ÚŸ@Y§›×c¦˜ÁÂåëHÎE~•fe¶Í-Þ§‹8D2Y÷å uì¡,,¹,ö<ØÕJÙîËšqÁ¿…ž—W–Š=b‚žy²4žcXÄÛ²LRo’Ȩ6¯£×“WÉã0#¡R3eÂî|biõ?÷âWTþFâsŸ³Ï?”²é×¾\xμáþ òd˃x"ü77FëÏ¢¶L5Ýs<òű}M}àzú¼Ww×wÆëoPìG¿m›zßñÿ¾<¾u¦Ã¹Ýú{5}\œßYÏC'†qg\~Ú6LÇ–Ÿ³aŒ<›¦v?2Ö5Z݀ɥæLÛúȬέ²ãI—Œ¼±6-U7³ÒÇ‹îc#ªyº7¡œ&zØWW.nî'D«yÝ•Û$Ä}ÔÖêû¬¹^¦­;ž¸eûv617N™„NÓüN»ÚLáÔµ¨S7‚»Zmçè§9Ž`s¡ß}ܺ­nàL2“㤌Ž7$P­‘õÄ/+Yû–qk›ÕÆ ¬KùƱn¿§U‰±¸¶ÆÑL^·<݆“ž5mc4¹ŒàthI­GÆ‘Ûo ³ºtÊc L}Ò{XØwaEµni¥Á`<œÍñÀjŒï§Z©?lضÑ–Üæš Fiå4í+9o5ó é4!IÙŸ+d-ex¤çpÀPðãí;h=Z#,È#¯=?ïK.Àv½º”/lÙ>”U¯Š ò|r¤>l¥ƒ=Üâ«òЇ^Ù¼ùPKi˜[Äýô)PKâ“}RU¶÷§¬ ¬ Thumbnails/thumbnail.png‰PNG  IHDRÍ'c…ÒPLTE666;;;CCCKKKTTT[[[dddjjjsss{{{4e¤:j¦Er«Jv­R|±\ƒµa‡¸d‰¹j޼v—Áw˜Ây™Ãƒƒƒ‹‹‹’’’›››£££¬¬¬´´´»»»ƒ¡ÇŒ¨Ë“­Î—°Ð›³Ñ ·Ô¥ºÖª¾Ø®ÁÚ´ÅÜ·ÈÞ¹Êß½ÌáÄÄÄÌÌÌÓÓÓÛÛÛÀÏâÄÒäÉÖæÌ×èËØçÌØèÒÜêÖàìÙâíÞæðãããëëëàçðâéñéîôìðöïóøóóóòõùõøúþþþÿÿÿƒ1sf •IDATxÚíÝ w›8àLkóÈ<ºÓ³#‰×îlOºíDL±¥ƒ]áûÿÿÓˆ¤ÝÆIìH˜÷ˆ8'Ʀ5÷r‘0–/`NÓ…ÑÑú”¦‰g¢ Bpbüè ŽÍ ­‰m$ˆkq,l…¶¸hI/öÀJ‘‡#hA׆79˜^`âX!ºp½ ò?±'^“ؾøÉ]?¡eà tá:Èe±'a'„:6CÆ>w¥Kœlðbæ‚M±¼k‹5†Ø0îÆc¢þ•»µÜ„sÄb_8€ '> Cäü’/¹-—_Kx C`Q"-–`EL,†øÀ‰'˜ü`&|ÂbÁ(DÀê§¢8M0ÈyŠëÇAD.bˆx"£ày‚“ÀTh£1£1£1š¿‘&o4ecÕôø¯ŒÆh8!ÛÞò/ÜÿFq=_?RÙÃë¥DýWÊÆ­A>#.ØÅ Ü@rby7B~ä¹'{àú’{ò×%Ѹ5 ö=ÙñN,ŸIH*W<ÆXØAˆ™Öu$‰˜É%ýtÜšÀO<Â1ø2'Wœz¾ìÀùÔó‚4ˆ8ø²Ì‹dŸ.‰h8¥*À‚€ÌߟF ajšÑ͉õú~ÚÆ¯1S׈DCeeã„“ˆ‰k’·B¼Á.K  D§žiŽN}.WÞ›z¦q+åµ&µàhê™zO ¾÷'Ÿiæxc4Fc4Fc4Fc4“Ô\— ¦Í—‘jªm¹;òóåØ3ÛíבjúN'£1£1£9{*ÿøýjF±ùåòÓŒ4ÿþy7#Mþ~NU`÷Çô4«ªÉd®L³fýñÏÙh>¼»¼ü­(g›ÏïßA™ewsÙoö÷]×,ÛϪ äùœ4P­¶³ªÐÅzVÇ›²˜Õѳ N[šxб<µwq[à´¦ñ£˜Aà Ή“¨Et]¯©®²²Žûè³wÜâi„c;1q©­¨ÕàšU‘= Å~$ìØgÈ¢ªëa5Õõ·õb‡kl£ˆ-í¨Öö[eM¹Tó¥åÁjHÍuÛý›ªNSìZï­eÃi²öûžççÍêt[#××oAdi¾oÆ£±y±2¿¦Ù”Ãh²×Úi^ÍYÁ1šo­êFS–Ch²–{ÿŸnЈ»®4ÙškóùèÇW§>Tx<…÷ýkòaÛl¨îzר³jÎHµ¦•t('£¹UX¦ÜBË¢+MÖ¡¦yh¨Ù©œÌÛ4Ôì6=k”6ߺ‚žSí¢»Ý¦¹&ëY£ôzÅTb£ôz»‘=kÔöïÆµ©gÒËå®ËIh”v›——Ù|4Åå/ûùdüÖôz€»ªOâÁú?M›öë]ŸšÇ’õñþاãO­ö]4ðjÎÎñÓÍ„Æ':.Î-hzÍͬb“ÍX3í`Óu¡ÙôY¡n]hÖ}=sèXÓ¸ñ=JM¯í´¿Ÿ&9rzš0‚øÏ“0âIDÁ[Ö„8¶L…岈—‚Zéˆ5Õúô+sdózÈk׋±Žàî˜3íðÇóW¦žÅÀñ¸#5¶ÔÀ¨3í°gøÒxcõH})p!8¯GíãLSsÛ£¦ha;žÔì‹57]kvë9i7¡›hògs'Œø Eq¾t0å ¨ª¦×w£žkG)ÄYRw¿y´Ö.Èf¶ÍN=¾ms/J‘ÃNknÒTùíÕFjNˆïc;\IÌ<8 q”iý-8¤8ˆ.=­É†Ñ¬Š‡9ÁîG°ã˜xMõ{lp/¦ÔahIe`\;ua¦U÷'Å:¨}j¾_)P­:ªiÍ tÍ÷Ó¶×z²TÖœq-¤¾æÛÑ û¶>Ù‰Ó³g®OêV]”´š‡ÍZ®µŠŸNFöz ÔÃ)õt¦É{Õ܇¦Ô]-å-¾ïu¿É•×­YlÖ»¾5j×`çÖñœÏ6ÓÜh¯×ª"ÐP“éj õFþmßšíZSS¨_Õ´[÷­Éµö€}±Òر{þTD®œÚ÷š<Ó»x(ë]s£¼dq«ûæEïÕj›C¦}ì¨zÏ4Õ#BÞàœ}Ò+WN†¬AÖd½kw›«üþeìš}¡zeüÇËKía ¶›~5_תï±î~þµê74úšíF¹Yøþ Æ®)·‡¯øµ¸;öó!;úÔ]û}›V4ÙþØTíOGÚçŽ6¢­Y‹Ϫg½k¶ÅŒ4wOðmj_ÜÞ\Sì:Óœ= ™¶¦È`NšUgš³mTšó‡»ÓÖäj™æ mM5Àx6ùІÅiÊ¡¬¹…±Æ&]XøK°ý@Y³B“+eš#À‡Ùê™V–hV…І."Q_cc¡ª¦!/µ5_Ö*š$ŠD )ˆ„Zó©ì¦B·2©¶æ¿»n4«A4WU'šóÛÍb³ïDÓJhô5¡ MYÎIÓNhF¢i)4 ªÀ“ùf×*<Ùé[ Mƒ*ðd~{üZŽ«ãO„æ|Í©&rk †ÒhŒÉ¯Ú_YoÓ|n¼st}Íÿ4 —PKÈj8Æ[2j;wUÀp´øºé7ϺÕ(mõu9œfÿç?5Þ”É{vlÞ]þK}á¬gŒ¶æJgtмß<Ó×”¿j,üjîkËßÑeËæõbÚÍ³Ž¿1æµ·1WÕ”4¯•kV#Â#§û”ÍÖ¤6M4?u!`YÀà—óvZÛ.¾ÎGW³ žVÿ×'F[ƒÚiÖ•Ý|KžnMãšË¿Ü+X0 öôÒ¨BY Õ<ϵmëÍ5Õõat²¢»×ê^#£ó#±öy{_u–Fp¨?þ(ÀKë;õMµ$”«b·‡jWdžÓí¦®±Hl[©Š%æ¶Í\[SnnŠ¢(÷]gºCàbð8#Å. ƒqMêš&ù²u#–³@˜¬f “¦æ ÍI'¬‰ê®@B õ05Å€ÒÉfwâZƒâäí"AoÙ’L66"´ï5²n‰c1ש⨾E²}CêÜ‹B iýÈ$kZŠ(w1µCiM±]N¼äÍ‚NLóPÓJj ˜Cäqâ3Ç¡NÀ'—i÷Û_7å¦BøÂ÷¹L³(I8Á*ðBM3­N£1£1£1£1£1£1£1£1£1£1£1£1£1£1£9:ýžŸ×±~b˜ªIEND®B`‚PKâ“}Rmeta.xml“ÁŽ›0†ï} D÷ ¶±›€EX©‡ª‡­Z©Y©·ˆØ^Ö[°‘m–ôí RvU¹ááÿf<¿gòûSS¯ÂX©Õ.D1 ¡˜æRU»ðqÿ%JÃûâC®Ÿž$”kÖ5B¹¨® TYÚa‡Pé|†Î(ªK+-Ue#,uŒêV¨¤— õE§øTFk½ Ÿk)#ëû¾{¼h1¨/]½JÑ\ˆRÉæÖ›ŽÚ‹kŽÝßš`Ô®YÛÈúVvÔFL7ípƒc-Öi8;·Üv¦ö sD-FÞ#°hOµT¿¯9„²,þïùþk=ygýtºµ›y†|ó÷jðpX,S6ZVäÞ8f„w?^Q LP“Á=Âô¦(‹·Û NÉH®9gt…â(Éö ¤Qˆã”LRœâ,²©ªàÒ ñÎø\Å=ùоáìç\äBð–cX-l‘lÞÉçø$®„­Mñ F|÷½ƒm c'wRu§Ã¯tsØ`%8´F¿æ„wŸ;Yó(™‹üË7å?ïª÷Ì:É×Ç‘ƪSn‚"oœ×¶½ø PK´]ÁáÂ+PKâ“}RMETA-INF/manifest.xml­“MjÃ0…÷9…ÑÞR6EÄɢФPí‘#FB?Á¾}%Ç.%Cv3Ìè½OiŒ®.àƒ²ØWúB*ÀÖv û†|Ÿ¾êr<ìöF ’"Ÿ‹*ŸÃpk’øtNæ…ÒŹ¤û;&ʈX™or1Ńè{öï;~PKµºâ&ÉPKâ“}R3&¬¨//mimetypePKâ“}RUConfigurations2/toolbar/PKâ“}R‹Configurations2/floater/PKâ“}RÁConfigurations2/menubar/PKâ“}R÷Configurations2/popupmenu/PKâ“}R/Configurations2/toolpanel/PKâ“}RgConfigurations2/progressbar/PKâ“}R¡Configurations2/statusbar/PKâ“}RÙConfigurations2/images/Bitmaps/PKâ“}RConfigurations2/accelerator/PKâ“}RÙæ¢MS0Ñ Pstyles.xmlPKâ“}RFŠtºa \ Ûcontent.xmlPKâ“}Ri˜[Äýô) u settings.xmlPKâ“}RU¶÷§¬ ¬ ¬'Thumbnails/thumbnail.pngPKâ“}R´]ÁáÂ+Ž2meta.xmlPKâ“}Rµºâ&Ɇ4META-INF/manifest.xmlPK+ï5icmake-10.03.00/comp/generator/0000755000175000017500000000000014204243136015073 5ustar frankfrankicmake-10.03.00/comp/generator/generator.ih0000644000175000017500000000072514204171312017403 0ustar frankfrank#include "generator.h" #include "../../xerr/xerr.ih" #include #include #include #include #include "../../tmp/INSTALL.im" #include "../opcode/opcode.h" #include "../stringstore/stringstore.h" #include "../parser/parser.h" #include "../scanner/scanner.h" #include "../functions/functions.h" #include "../symtab/symtab.h" using namespace std; using namespace FBB; namespace Icmake { extern char version[]; }; icmake-10.03.00/comp/generator/generator.h0000644000175000017500000000276414204135051017237 0ustar frankfrank#ifndef INCLUDED_GENERATOR_ #define INCLUDED_GENERATOR_ // version // offset of the string constant-area (int32_t) 0 // offset of the variable area (int32_t) 1 // offset of the strings area (int32_t) 2 // offset of the first instruction (int32_t) 3 // // code (first byte is first instruction) // ascii-z string constant area // variables // filenames #include #include "../../support/endian/endian.h" #include "../../support/header/header.h" class Parser; class Scanner; class Functions; class Symtab; class Generator: private Endian { Header d_header; char const *d_bimName; std::ofstream d_bim; Scanner const &d_scanner; Functions const &d_functions; Symtab const &d_symtab; public: Generator(char const *bimName, Parser const &parser); ~Generator(); bool backend(); int noBim(); // bim construction not completed private: void setVersion(); // fill the version in d_hdr.version void functionCode(); // writes the functions' code to file void callMain(short offset); // call main() void strings(); // write the string constants void variables(); // write the global var. types void filenames(); // write the encountered filenames }; #endif icmake-10.03.00/comp/generator/filenames.cc0000644000175000017500000000022414204126313017340 0ustar frankfrank//#define XERR #include "generator.ih" void Generator::filenames() { d_header.filenames = d_bim.tellp(); d_bim << d_scanner.filenames(); } icmake-10.03.00/comp/generator/setversion.cc0000644000175000017500000000041214204126313017575 0ustar frankfrank//#define XERR #include "generator.ih" void Generator::setVersion() { string version = VERSION; unsigned main = stoul(version); d_header.version[0] = main + (main >= 10 ? 'a' - 10 : '0'); version.copy(d_header.version + 1, 3, version.find('.')); } icmake-10.03.00/comp/generator/strings.cc0000644000175000017500000000032114204126313017064 0ustar frankfrank//#define XERR #include "generator.ih" void Generator::strings() { d_header.strings = d_bim.tellp(); for (auto const &info: StringStore::instance().stringVect()) d_bim << info.str << '\0'; } icmake-10.03.00/comp/generator/callmain.cc0000644000175000017500000000044314204171312017157 0ustar frankfrank//#define XERR #include "generator.ih" void Generator::callMain(short mainOffset) { // icm_exec pushes main's arguments on the stack, no code required here SemVal mainCall; mainCall << Opcode::call << as(mainOffset) << Opcode::exit; d_bim << mainCall.code(); } icmake-10.03.00/comp/generator/functioncode.cc0000644000175000017500000000105314204126313020056 0ustar frankfrank//#define XERR #include "generator.ih" void Generator::functionCode() { d_bim.seekp(sizeof(Header)); // skip beyond the header d_bim << d_functions.code(); d_header.firstOpcode = d_bim.tellp(); // first executed code byte // (1st byte beyond the code // of the functions: global // var. initialization and // calling main(). } icmake-10.03.00/comp/generator/backend.cc0000644000175000017500000000316414204171312016771 0ustar frankfrank#define XERR #include "generator.ih" // version // strings offset of the string constant-area (int32_t) // variables offset of the global variable types area (int32_t) // filenames offset of the filenames area (int32_t) // code offset of the first instruction to execute (int32_t) // // code // ascii-z string constant area // variables // filenames bool Generator::backend() { Functions::Info const &mainInfo = d_functions.mainInfo(); if (mainInfo.returnType == e_bool) { Error::set(Error::NO_MAIN); Error::msg(); return false; } setVersion(); // fill the version in // d_hdr.version functionCode(); // write the functions' code d_bim << d_symtab.globalCode(); // write the global vars. // initialization code callMain(mainInfo.offset); // append calling main strings(); // write the string constants variables(); // append the types of the // global variables filenames(); // write the used filenames d_bim.seekp(0); // rewind d_bim if (not littleEndian()) // and write the header d_header.endian(); d_bim.write(reinterpret_cast(&d_header), sizeof(Header)); return true; } icmake-10.03.00/comp/generator/generator1.cc0000644000175000017500000000045214204126313017447 0ustar frankfrank//#define XERR #include "generator.ih" Generator::Generator(char const *bimName, Parser const &parser) : d_bimName(bimName), d_bim(Exception::factory(bimName)), d_scanner(parser.scanner()), d_functions(parser.functions()), d_symtab(parser.symtab()) { xerr(""); } icmake-10.03.00/comp/generator/variables.cc0000644000175000017500000000032314204126313017345 0ustar frankfrank//#define XERR #include "generator.ih" void Generator::variables() { d_header.variables = d_bim.tellp(); for (auto const &var: d_symtab.globalVars()) d_bim << as(var.varType & e_mask); } icmake-10.03.00/comp/generator/destructor.cc0000644000175000017500000000022614204126313017575 0ustar frankfrank//#define XERR #include "generator.ih" Generator::~Generator() { error_code ec; if (not d_bim) filesystem::remove(d_bimName, ec); } icmake-10.03.00/comp/generator/cleanup.cc0000644000175000017500000000016314204126313017026 0ustar frankfrank//#define XERR #include "generator.ih" int Generator::noBim() { d_bim.setstate(ios::failbit); return 1; } icmake-10.03.00/comp/generator/frame0000644000175000017500000000007014204126313016102 0ustar frankfrank//#define XERR #include "generator.ih" Generator:: { } icmake-10.03.00/comp/README.stackframe0000644000175000017500000000333114204126313016101 0ustar frankfrankSee parser/variable.cc and symtab/find.cc for the way variables are handled. ============================================================================ The stack grows from high SP values to low SP values. When a function is called its arguments are pushed in reversed order, followed by the function's return address. Then the current BP is pushed and BP is set to point to that location. Local variables take up 1 index position per variable. Arguments are reached as 'bp + index', where index value 2 refers to the function's 1st argument; Local variables are reached as 'bp - index' where index is negative (-1, -2, ...) and refers to the '-index'th local variable number. Here's the stack frame organization: high stack offsets | | arg#N BP + N+1 0xc0[N+1 (width 2)] | ... | arg#2 BP + 3 0xc003 | arg#1 BP + 2 0xc002 = 0xc002 + param. offset | RA (ret. addr.) 0xc001 BP--> | old BP 0xc000 | local#1 BP - 1 0xc000 - 1 (0xbfff) | local#2 BP - 2 0xc000 - 2 | ... | local#N BP - N 0xc000 - N | SP--> low stack offsets The Frame class stores the types of the local variables in a vector: its 1st element defines the type of the 1st local variable: access it as element [-index - 1] The values of variables in the symbol table are the above indices: * global variables have values 0..x, * parameters have values 0xc000 + 2 + parameter offset, * local variables have values 0xc000 - 1 - local variable offset Symtab::find() returns 0xc000 if the specified variable name does not exist. icmake-10.03.00/comp/funframe0000644000175000017500000000002314204126313014623 0ustar frankfrank#include "main.ih" icmake-10.03.00/comp/CLASSES0000644000175000017500000000014014204126313014115 0ustar frankfrankgenerator parser scanner args symtab semval stringstore functions opcode builtin exprtype error icmake-10.03.00/contributions/0000755000175000017500000000000014203741153015052 5ustar frankfrankicmake-10.03.00/contributions/solaris0000644000175000017500000000367614204126313016461 0ustar frankfrankDate: Sun, 16 Oct 2011 19:59:00 +0000 Subject: A few hoops for icmake to compile on Solaris From: "Johann 'Myrkraverk' Oskarsson" To: f.b.brokken@rug.nl Hi, Here is a short list of hoops I had to jump through in order to make icmake compile on Solaris. Specifically OpenIndiana 151a. Change to icm_bootstrap: The comp subdirectory does not build with gcc, but does with Solaris Studio 12.3 cc: echo Creating tmp/${LIBDIR}/icm-comp${EXTENSION} try cd comp try cc ${GLB} ${CFLAGS} \ -o ../tmp/${LIBDIR}/icm-comp${EXTENSION} *.c ../tmp/libicrss.a \ ${LDFLAGS} cd .. In the following three files, before #include , exec/string/string.ih, exec/virtual/virtual.ih, exec/list/list.ih: #undef getopt #undef getoptindex #undef getoptval I was unable to find a way to exclude these three symbols from the header file with a -Ddefine. If these symbols are not meant to be there in some Posix standard it should be. The reason: it conflicts with the ic_ definitions from earlier include files. Above, when comp is compiled with gcc, errors similar (or same as) the following spew out: In file included from /usr/include/stdio.h:81:0, from lexer.c:21: /usr/include/iso/stdio_iso.h:212:60: error: redefinition of parameter 'restrict' If you need more information to fix this for future versions of icmake, please just ask, Johann ---------------------------------------- Date: Tue, 22 Apr 2008 00:56:23 +0000 o Bitrot: I had to add -std=c99 to all gcc lines due to some macro defining the "restrict" keyword in my system header files. I suspect something defined in the icmake header files but I 'm not sure. o I had to change all getoptXXX calls to ic_getoptXXX becouse of some conflict with my system getopt/headers/macros or something. o In all build scripts, I had to change the shebang lines from #!tmp/icmake -qt/tmp/pp to #!/opt/myrkraverk/bin/icmake -qt/tmp/pp -- or at least, I had to change them due to something. icmake-10.03.00/dep/0000755000175000017500000000000014204243176012723 5ustar frankfrankicmake-10.03.00/dep/icm_bootstrap0000755000175000017500000000022514204126313015506 0ustar frankfrank#!/bin/bash . ../bootstrap/flags . ../bootstrap/functions echo Creating tmp${LIBDIR}/icm-dep subdirs maindir ${LIBDIR}/icm-dep rm -f */*.gch *.o icmake-10.03.00/dep/usage.cc0000644000175000017500000000525414204126313014335 0ustar frankfrank// usage.cc #include "main.ih" namespace { char const info[] = R"_( [options] [go] Where: [options] - optional arguments (short options between parentheses): --classes (-c) file - file defining the class-subdirectories (default: CLASSES) --gch - inspect/remove .gch precompiled headers, otherwise: don't handle precompiled headers. --help (-h) - provide this help --icmconf (-i) file - icmconf file to use (default: icmconf) --mainih (-m) ihfile - the top directory's main .ih file (default: main.ih) --no-gch - do not inspect .gch precompiled headers. --no-use-all - do not inspect USE_ALL files --use-all file - use 'file' as USE_ALL filename, and add files implied by 'file' where necessary --verbose (-V) - show touched files; more info if specified multiple times --version (-v) - show version information and terminate When neither --gch nor --no-gch is specified icmonf's PRECOMP specification is used; When neither --use-all nor --no-use-all is specified icmonf's USE_ALL specification is used. Files are only changed if the program argument 'go' is specified )_"; } void usage(std::string const &progname) { Tools::usageTop(progname) << info; } /**************************************** All directories mentioned in CLASSES and cwd are inspected for USE_ALL (defined in icmconf) files. If a directory contains a USE_ALL file then a USE_ALL file is also created in all directories including that directory's .h file. When the --precomp option is specified then all not yet visited directories in CLASSES (and the cwd) are scanned for files matching the comma-separated list of files. If the directory has already been visited then nothing happens in that directory. Otherwise the directory is marked as inspected. If no file matches the list of --precomp files then that directory has been processed. If the .gch file does not yet exist or if at least one of the comma separated patterns in --inspect is younger than the .gch file then this directory's .gch file must be (re)compiled If a gch file must be recompiled, then indicate that the gch files of classes depending on the gch file's class must also be recompiled. Once the list of gch files to recompile has been determined - show the files to recompile on stdout, - or rm the gch files if --rm was specified. ****************************************/ icmake-10.03.00/dep/log/0000755000175000017500000000000014203741153013501 5ustar frankfrankicmake-10.03.00/dep/log/log.h0000644000175000017500000000056014204126313014430 0ustar frankfrank#ifndef INCLUDED_LOG_ #define INCLUDED_LOG_ #include #include enum LogLevel { V0 = 4, // initially no messages V1 = 3, // -V specified: basic level V2 = 2, // -VV specified V3 = 1, // -VVV specified V4 = 0, // -VVVV specified (most elaborate) }; extern FBB::Log g_log; #endif icmake-10.03.00/dep/README0000644000175000017500000000106014204126313013571 0ustar frankfrankThe class Dependencies is the workhorse class. Its constructor determines the parser- and scanner-dirs from the icmconf file, Next it adds all directory names from CLASSES to the d_directory string vector, so that each directory name is stored only once. Once all directories have been determined there are size = d_directory.size() directory names. The matrix d_dependency is a bool-matrix of dimension size x size. If element[r][c] is true then class [c] depends on (= includes) class[r]. The the function 'dependsOn' determines these dependencies. icmake-10.03.00/dep/dependencies/0000755000175000017500000000000014204243176015351 5ustar frankfrankicmake-10.03.00/dep/dependencies/dependencies.h0000644000175000017500000000714314204126313020146 0ustar frankfrank#ifndef INCLUDED_DEPENDENCIES_ #define INCLUDED_DEPENDENCIES_ #include #include "../../support/typedefs/typedefs.h" #include "../action/action.h" class Options; namespace FBB { class Pattern; } class Dependencies { Options const &d_options; size_t d_size; // #directories std::string const &d_useAll; StringVect d_directory; // current, scanner, parser and // CLASSES dirs. All dirs end in '/' size_t d_dirWidth; // max. width of the dir. names BoolMatrix d_dependency; // holds the dependencies of row classes // on column classes: if a column class // changes then the row class changes too. StringMatrix d_localHeader; // local header files: the first element // of each row holds the directory's // own .ih file, which is precompiled to // .ih.gch, subsequent elements are // additionally included local headers BoolVect d_indicator; // used with useAll and gch checks UnsignedVect d_classCount; UnsignedVect d_classIdx; // local headers being inspecting -> // dependson.cc std::unordered_set d_inspecting; static FBB::Pattern s_include; // RegEx recognizing various #include // directives public: Dependencies(Options const &options); void find(); // find all dependencies amoung classes void useAll(); // check the 'USE_ALL' option and maybe // touch files in directories void gchFiles(); // check the 'PRECOMP' option and maybe // remove .gch files depending on headers // that were modified void showUsing(); private: void addDirectory(std::string const &dirname); size_t readClasses(); void directDependencies(); void impliedDependencies(); bool updateDependencies(size_t idx); // called via useAll: void useAllIndicator(); void inspectUseAll(size_t idx); void recursiveUseAll(size_t dep); void touchUseAll() const; // called via gchFiles: void inspectGchAges(); void inspectGchAge(size_t dir); void impliedGchRemovals(); void dependentGch(size_t idx); void removeGch(); // determine the dependencies of 'header', // living in d_directory[idx] void dependency(size_t idx, std::string const &header); void localHeader(size_t idx, std::string const &header); void setDependency(size_t idx, std::string const &dirName); void dependsOn(std::string const &line, size_t idx); void showDependencies(char const *label) const; // NEW void setClassIdx(); void setCount(); // === static void tableLine(size_t nBlanks, size_t width); static void numberLine(size_t count); // nrs 1 .. count (inclusive) void checkUseAll(); std::string ihFile(size_t idx) const; static bool orBoolVect(BoolVect &lhs, BoolVect const &rhs); static bool changeDir(std::string const &path); static BoolMatrix identityMatrix(size_t size); }; #endif icmake-10.03.00/dep/dependencies/find.cc0000644000175000017500000000044714204126313016576 0ustar frankfrank//#define XERR #include "dependencies.ih" void Dependencies::find() { directDependencies(); // direct dependencies of .ih files // on other .ih files impliedDependencies(); g_log << level(V4) << "Header file inspection completed\n"; } icmake-10.03.00/dep/dependencies/adddirectory.cc0000644000175000017500000000074514204126313020334 0ustar frankfrank//#define XERR #include "dependencies.ih" void Dependencies::addDirectory(string const &dirname) { if (not dirname.empty()) { if ( std::find(d_directory.begin(), d_directory.end(), dirname) != d_directory.end() ) return; // the class was already present if (dirname.length() > d_dirWidth) d_dirWidth = dirname.length(); d_directory.push_back(dirname); } } icmake-10.03.00/dep/dependencies/numberline.cc0000644000175000017500000000032014204126313020004 0ustar frankfrank//#define XERR #include "dependencies.ih" // static void Dependencies::numberLine(size_t count) { for (size_t col = 1; col <= count; ++col) cout << setw(2) << col << ' '; cout.put('\n'); } icmake-10.03.00/dep/dependencies/data.cc0000644000175000017500000000162314204126313016564 0ustar frankfrank//#define XERR #include "dependencies.ih" Pattern Dependencies::s_include { R"_(^[ \t]*#include[ \t]*)_" // #include " "\"(" // 1 R"_(([^"/]+))_" // #=3, (hdr) @2 // 2 #include "hdr" "|" R"_(\.\./([^"/]+))_" // #=4, ../(hdr) @3 // 3 #include "../hdr" "|" R"_(([^"/]+)/([^"/]+))_" // #=6 (sub)/(hdr), // 4 5 @4 @5 // #include "dir/hdr" "|" R"_(\.\./([^"/]+)/([^"/]+))_" // #=8, ../(sub)/(hdr) // 6 7 @6 @7 // #include "../sub/hdr" ")\"", }; icmake-10.03.00/dep/dependencies/tableline.cc0000644000175000017500000000042414204126313017610 0ustar frankfrank//#define XERR #include "dependencies.ih" // static void Dependencies::tableLine(size_t nBlanks, size_t width) { if (nBlanks) cout << setw(nBlanks) << ' '; if (width) cout << setfill('-') << setw(width) << '-' << setfill(' '); cout.put('\n'); } icmake-10.03.00/dep/dependencies/inspectgchages.cc0000644000175000017500000000023614204126313020641 0ustar frankfrank//#define XERR #include "dependencies.ih" void Dependencies::inspectGchAges() { for (size_t idx = 0; idx != d_size; ++idx) inspectGchAge(idx); } icmake-10.03.00/dep/dependencies/impliedgchremovals.cc0000644000175000017500000000055614204126313021535 0ustar frankfrank//#define XERR #include "dependencies.ih" // find all dirs whose gch files must be removed, and mark the gch files // of depending directories also for removal void Dependencies::impliedGchRemovals() { size_t idx = 0; while ((idx = findIdx(d_indicator, idx, true)) != d_size) { dependentGch(idx); ++idx; } } icmake-10.03.00/dep/dependencies/localheader.cc0000644000175000017500000000067314204126313020122 0ustar frankfrank//#define XERR #include "dependencies.ih" void Dependencies::localHeader(size_t idx, string const &header) { // this header has already been visited if (d_inspecting.find(header) != d_inspecting.end()) return; d_inspecting.insert(header); // we're inspecting a new header d_localHeader[idx].push_back(header); dependency(idx, header); // check it: indirect recursion. } icmake-10.03.00/dep/dependencies/dependency.cc0000644000175000017500000000167314204126313017776 0ustar frankfrank//#define XERR #include "dependencies.ih" // inspect the header files of directory 'idx'. // headers including headers from other project directories depend // on those directories and such dependencies are registered in // d_dependency // Once a dependency has been registered (e.g., dir. b depends on dir. c) // no further action wrt c is taken. // Inside a directory, once a header is being inspected it is registered // to avoid circular inclusion. void Dependencies::dependency(size_t idx, string const &header) { ifstream in{ header }; if (not in) { g_log << level(V4) << "cannot read '`" << header << "': skipped\n"; return; } g_log << level(V4) << "inspecting header `" << header << "'\n"; d_localHeader[idx].push_back(header); string line; while (getline(in, line)) // inspect header's #include dependsOn(line, idx); // directives } icmake-10.03.00/dep/dependencies/setdependency.cc0000644000175000017500000000114514204126313020504 0ustar frankfrank//#define XERR #include "dependencies.ih" // if dirName is a project directory then directory[idx] depends on // that directory, and dependency[idx][dirname's idx] is set to 'true' void Dependencies::setDependency(size_t idx, string const &dirName) { auto iter = std::find(d_directory.begin(), d_directory.end(), dirName); if (iter != d_directory.end()) // dirName is a project dir. d_dependency[idx][iter - d_directory.begin()] = true; // set the dependency. // (dirName may be directory not listed in CLASSES: that's OK) } icmake-10.03.00/dep/dependencies/inspectgchage.cc0000644000175000017500000000165314204126313020462 0ustar frankfrank//#define XERR #include "dependencies.ih" void Dependencies::inspectGchAge(size_t dir) { auto const &hdrs = d_localHeader[dir]; Tools::mustChangeDir(d_directory[dir]); xerr("\n\nInspecting dir. " << dir << ": " << d_directory[dir]); xerr("\t# local headers: " << hdrs.size()); if (hdrs.size() != 0) { Stat gch{ hdrs[0] + ".gch" }; // obtain the .gch file's Stat data for (string const &hdr: hdrs) // inspect all local headers { xerr("\tLocal hdr `" << hdr); if (Tools::younger(hdr, gch)) // hdr file is younger { g_log << level(V4) << '`' << d_directory[dir] << "': " << hdr << " younger " << hdrs[0] << ".gch: recompile\n"; d_indicator[dir] = true; break; } } } d_options.startDir(); } icmake-10.03.00/dep/dependencies/setcount.cc0000644000175000017500000000067014204126313017520 0ustar frankfrank//#define XERR #include "dependencies.ih" void Dependencies::setCount() { for (unsigned idx = 0; idx != d_size; ++idx) d_classCount[idx] = d_size - count(d_dependency[idx].begin(), d_dependency[idx].end(), 0); sort(d_classIdx.begin(), d_classIdx.end(), [&](unsigned lhs, unsigned rhs) { return d_classCount[lhs] > d_classCount[rhs]; } ); } icmake-10.03.00/dep/dependencies/touchuseall.cc0000644000175000017500000000024414204126313020201 0ustar frankfrank//#define XERR #include "dependencies.ih" void Dependencies::touchUseAll() const { if (d_options.go() == GO) Exception::factory(d_useAll); } icmake-10.03.00/dep/dependencies/useall.cc0000644000175000017500000000115714204126313017142 0ustar frankfrank//#define XERR #include "dependencies.ih" void Dependencies::useAll() { xerr("useAll: `" << d_useAll << '\''); if (d_useAll.empty()) // no use-all checks requested return; useAllIndicator(); // prepare d_indicator for useAll // visit all directories and maybe // touch all files in those // directories for (size_t idx = 0; idx != d_size; ++idx) inspectUseAll(idx); g_log << level(V4) << "UseALL inspection completed\n"; } icmake-10.03.00/dep/dependencies/readclasses.cc0000644000175000017500000000123314204126313020141 0ustar frankfrank//#define XERR #include "dependencies.ih" size_t Dependencies::readClasses() { ifstream in{ d_options.classes() }; // this may fail: a CLASSES // file may not exist string line; while (getline(in, line)) { istringstream ins{ line }; if ( not (ins >> line) // no first word or "#/"s.find(line[0]) != string::npos // or 1st char is # or / ) continue; // then ignore this line addDirectory(line); // add the dir-name } return d_directory.size(); } icmake-10.03.00/dep/dependencies/implieddependencies.cc0000644000175000017500000000245414204126313021650 0ustar frankfrank//#define XERR #include "dependencies.ih" // start with the dependencies matrix, initially set all rows to inspect' // for each dependency[idx] to inspect: inspect its 'true' elements, // and bit-or the elements of those vectors with those of dependency[idx]. // Set idx's inspect status to true if dependency[idx] was changed. // Repeat this process untill no more changed were made. void Dependencies::impliedDependencies() { // start with all paths are changed BoolVect inspect( d_size, true ); bool changed; // set to true if changes were made do // visit all rows, update their 'inspect' { // status until no more changes were made changed = false; size_t idx = 0; while ((idx = findIdx(inspect, idx, true)) != d_size) { changed |= inspect[idx] = updateDependencies(idx); ++idx; } } while (changed); // continue until no more changes // the diagonal can be ignored: by definition a class depends on // itself. for (size_t idx = 0; idx != d_size; ++idx) d_dependency[idx][idx] = false; setCount(); showDependencies("Implied class dependencies:"); } icmake-10.03.00/dep/dependencies/identitymatrix.cc0000644000175000017500000000065714204126313020737 0ustar frankfrank//#define XERR #include "dependencies.ih" // static BoolMatrix Dependencies::identityMatrix(size_t dimension) { BoolMatrix ret(dimension); size_t diag = 0; for (auto &vect: ret) { vect.resize(dimension); vect[diag] = true; ++diag; } return ret; // return a bool identity matrix of } // dimension x dimension elements icmake-10.03.00/dep/dependencies/updatedependencies.cc0000644000175000017500000000121314204126313021477 0ustar frankfrank//#define XERR #include "dependencies.ih" // inspect d_dependency[idx]. Find all [dep] elements for which // d_dependency[idx][dep] is true. All elements that were set in // d_dependency[dep] must also be set in d_dependency[idx]. // if no changes were made, return false, otherwise return true bool Dependencies::updateDependencies(size_t idx) { BoolVect &update = d_dependency[idx]; // the vector to inspect bool updated = false; size_t dep = 0; while ((dep = findIdx(update, dep, true)) != d_size) { updated |= orBoolVect(update, d_dependency[dep]); ++dep; } return updated; } icmake-10.03.00/dep/dependencies/gchfiles.cc0000644000175000017500000000231614204126313017437 0ustar frankfrank//#define XERR #include "dependencies.ih" // d_indicator indicates whether a header must be precompiled. // Initially, none are considered too old, indicated by d_indicator's elements // set to false. // In the first round all directories are visited and the ages of their gch // files are compared to the local headers. If the gch file is older than any // of those headers it is marked for recompilation. // At the next round the gch files of all directories whose gch files were not // marked for removal but that depend on directories whose gch files were // marked for removal are also marked for removal. This check is recursively // performed. // Finally, all gch files in directories whose gch files are marked for // removal are actually removed. void Dependencies::gchFiles() { d_indicator = BoolVect(d_size); // no gch files marked so far inspectGchAges(); // mark all old gch files for removal impliedGchRemovals(); // determine implied gch removals removeGch(); // remove gch files indicated by // d_indicator g_log << level(V4) << "Precompiled header inspection completed\n"; } icmake-10.03.00/dep/dependencies/dependencies.ih0000644000175000017500000000063314204126313020314 0ustar frankfrank#include "dependencies.h" #include #include #include #include //#include #include #include #include #include "../../xerr/xerr.ih" #include "../../support/tools/tools.h" #include "../findidx/findidx.h" #include "../options/options.h" #include "../log/log.h" using namespace std; using namespace FBB; icmake-10.03.00/dep/dependencies/showdependencies.cc0000644000175000017500000000454414204126313021207 0ustar frankfrank//#define XERR #include "dependencies.ih" void Dependencies::showDependencies(char const *label) const { if (d_options.verbosity() < 3) return; size_t col1width = d_dirWidth + 4; cout << '\n' << label << '\n'; tableLine(0, col1width + d_size * 3); // 3 positions per class index cout << setw(col1width) << ' ' << "uses:\n"; tableLine(col1width, d_size * 3); cout << setw(d_dirWidth) << "class:" << " "; numberLine(d_size); tableLine(0, col1width + d_size * 3); // element [row][col] indicates whether directory row uses directory // col, which implies that col's being used by row // By visiting all elements in column col all directories that use col // are found for (size_t row = 0; row != d_size; ++row) { unsigned rowIdx = d_classIdx[row]; cout << setw(d_dirWidth) << d_directory[rowIdx] << ' ' << setw(2) << (row + 1) << ' '; BoolVect const &rowVect = d_dependency[rowIdx]; for (size_t col = 0; col != row; ++col) cout << (rowVect[d_classIdx[col]] ? " x " : " "); // diagonal element cout << (rowVect[d_classIdx[row]] ? " x " : " - "); for (size_t col = row + 1; col != d_size; ++col) cout << (rowVect[d_classIdx[col]] ? " x " : " "); // for (size_t col = 0; col != d_size; ++col) // cout << (rowVect[d_classIdx[col]] ? " x " : " "); cout.put('\n'); } tableLine(0, col1width + d_size * 3); cout << setw(col1width) << ' '; numberLine(d_size); tableLine(0, col1width + d_size * 3); cout.put('\n'); } // Before 10.00.00: showing 'used by' instead of 'uses': // // // element [d1][d2] indicates whether directory d1 uses directory d2. // // which amounts to d2 being used by d1 // // By visiting all elements in column d2 all directories that use d2 // // are found // for (size_t d2 = 0; d2 != d_size; ++d2) // { // cout << setw(d_dirWidth) << d_directory[d2] << ' ' << // setw(2) << (d2 + 1) << ' '; // // for (size_t d1 = 0; d1 != d_size; ++d1) // cout << (d_dependency[d1][d2] ? " x " : " "); // // cout.put('\n'); // } icmake-10.03.00/dep/dependencies/removegch.cc0000644000175000017500000000062514204126313017633 0ustar frankfrank#define XERR #include "dependencies.ih" void Dependencies::removeGch() { if (d_options.go() != GO) // no .gch checks requested return; size_t idx = 0; while ((idx = findIdx(d_indicator, idx, true)) != d_size) { Tools::mustChangeDir(d_directory[idx]); Tools::remove(d_localHeader[idx][0] + ".gch"); d_options.startDir(); ++idx; } } icmake-10.03.00/dep/dependencies/inspectuseall.cc0000644000175000017500000000063414204126313020527 0ustar frankfrank//#define XERR #include "dependencies.ih" void Dependencies::inspectUseAll(size_t idx) { if (not d_indicator[idx]) // no useAll file here: skip this dir. return; size_t dep = 0; while ((dep = findIdx(d_indicator, dep, false)) != d_size) { if (d_dependency[dep][idx]) recursiveUseAll(dep); // recursively inspect directory[dep] ++dep; } } icmake-10.03.00/dep/dependencies/dependentgch.cc0000644000175000017500000000144314204126313020303 0ustar frankfrank//#define XERR #include "dependencies.ih" // the gch in directory 'idx' was marked for removal. Mark all gch files // in directories that depend on directory 'idx' also for removal void Dependencies::dependentGch(size_t idx) { // find directories not requiring gch removals size_t dep = 0; while ((dep = findIdx(d_indicator, dep, false)) != d_size) { if (d_dependency[dep][idx]) // if it depends on 'idx' { g_log << level(V4) << '`' << d_directory[dep] << "' depends on `" << d_directory[idx] << "': recompile\n"; d_indicator[dep] = true; // so it's dir. must be removed dependentGch(dep); // recursively inspect directory[dep] } ++dep; } } icmake-10.03.00/dep/dependencies/orboolvect.cc0000644000175000017500000000206514204126313020032 0ustar frankfrank//#define XERR #include "dependencies.ih" // check all elements in rsh and set all 'false' elements in lhs that // correspond to 'true' elements in rhs to 'true' // return 'true' if at least one element in lhs was modified. // static bool Dependencies::orBoolVect(BoolVect &lhs, BoolVect const &rhs) { bool changed = false; auto lhsBegin = lhs.begin(); auto rhsEnd = rhs.end(); // visit all rhs elements auto rhsIter = rhs.begin(); auto rhsBegin = rhsIter; while (true) { rhsIter = std::find(rhsIter, rhsEnd, true); // find 'true' elements if (rhsIter == rhsEnd) // reached the end -> return changed; // return 'changed' // the matching lhs element auto lhsIter = lhsBegin + (rhsIter - rhsBegin); if (not *lhsIter) // update it when needed { changed = true; *lhsIter = true; } ++rhsIter; } } icmake-10.03.00/dep/dependencies/useallindicator.cc0000644000175000017500000000045314204126313021035 0ustar frankfrank//#define XERR #include "dependencies.ih" void Dependencies::useAllIndicator() { d_indicator.clear(); for (size_t idx = 0; idx != d_size; ++idx) { Tools::changeDir(d_directory[idx]); d_indicator.push_back(Tools::exists(d_useAll)); d_options.startDir(); } } icmake-10.03.00/dep/dependencies/recursiveuseall.cc0000644000175000017500000000075414204126313021074 0ustar frankfrank//#define XERR #include "dependencies.ih" // called from inspectUseAll void Dependencies::recursiveUseAll(size_t dep) { d_indicator[dep] = true; Tools::mustChangeDir(d_directory[dep]); g_log << level(V4) << "add implied " << d_directory[dep] << '/' << d_useAll << '\n'; touchUseAll(); d_options.startDir(); inspectUseAll(dep); // check useAll files for directories // depending on dep } icmake-10.03.00/dep/dependencies/dependencies1.cc0000644000175000017500000000104214204126313020355 0ustar frankfrank//#define XERR #include "dependencies.ih" Dependencies::Dependencies(Options const &options) : d_options(options), d_useAll(options.useAll()), d_directory{ "." }, // see also 'readClasses' d_dirWidth(size("class:")) // see showDependencies { addDirectory(options.parser()); addDirectory(options.scanner()); d_size = readClasses(); setClassIdx(); d_classCount.resize(d_size); d_dependency = identityMatrix(d_size); d_localHeader.resize(d_size); // stores locally included header files } icmake-10.03.00/dep/dependencies/setclassidx.cc0000644000175000017500000000045214204126313020200 0ustar frankfrank//#define XERR #include "dependencies.ih" namespace { unsigned idx = 0; } void Dependencies::setClassIdx() { d_classIdx.resize(d_size); for_each(d_classIdx.begin(), d_classIdx.end(), [=](unsigned &dest) { dest = idx; ++idx; } ); } icmake-10.03.00/dep/dependencies/dependson.cc0000644000175000017500000000166314204126313017636 0ustar frankfrank//#define XERR #include "dependencies.ih" void Dependencies::dependsOn(string const &line, size_t idx) { if (not (s_include << line)) // line isn't a local include directive return; xerr("line `" << line << "': regex count = " << s_include.end()); switch (s_include.end()) { case 3: // a local header file (#include "hdr") localHeader(idx, s_include[2]); break; case 4: // a main dir. header (#include "../hdr") d_dependency[idx][0] = true; break; case 6: // main includes a subdir header // (#include "sub/hdr") setDependency(0, s_include[4]); break; case 8: // this dir. includes a subdir header // (#include "../sub/hdr") setDependency(idx, s_include[6]); break; } } icmake-10.03.00/dep/dependencies/ihfile.cc0000644000175000017500000000021614204126313017110 0ustar frankfrank//#define XERR #include "dependencies.ih" string Dependencies::ihFile(size_t idx) const { return d_directory[idx] + d_options.dotIH(); } icmake-10.03.00/dep/dependencies/frame0000644000175000017500000000007614204126313016362 0ustar frankfrank//#define XERR #include "dependencies.ih" Dependencies:: { } icmake-10.03.00/dep/dependencies/directdependencies.cc0000644000175000017500000000147014204126313021474 0ustar frankfrank//#define XERR #include "dependencies.ih" void Dependencies::directDependencies() { if (not d_options.mainIH().empty()) // start with main.ih, if present { g_log << level(V4) << "Inspecting the main project directory\n"; dependency(0, d_options.mainIH()); } // then visit all other dirs. for (size_t idx = 1; idx != d_size; ++idx) { g_log << level(V4) << "Inspecting directory `" << d_directory[idx] << "'\n"; d_inspecting.clear(); // local headers being inspected Tools::mustChangeDir(d_directory[idx]); dependency(idx, ihFile(idx)); d_options.startDir(); } setCount(); showDependencies("Direct class dependencies:"); } icmake-10.03.00/dep/action/0000755000175000017500000000000014203741153014175 5ustar frankfrankicmake-10.03.00/dep/action/action.h0000644000175000017500000000021314204126313015613 0ustar frankfrank#ifndef INCLUDED_ACTION_ #define INCLUDED_ACTION_ enum Action { DRY, GO, NO_GCH, GCH, UNSPECIFIED, }; #endif icmake-10.03.00/dep/icmconf0000644000175000017500000000125414204126761014266 0ustar frankfrank#define CLS //#define LIBRARY "modules" #define MAIN "main.cc" #define SOURCES "*.cc" #define OBJ_EXT ".o" #define TMP_DIR "tmp" #define USE_ECHO ON //#define USE_VERSION #define IH ".ih" #define PRECOMP "-x c++-header" //#define USE_ALL "a" #define CXX "g++" #define CXXFLAGS " --std=c++20 -Wall -O2 " \ " -fdiagnostics-color=never " #define REFRESH #define LDFLAGS "-s" #define ADD_LIBRARIES "support bobcat" #define ADD_LIBRARY_PATHS "../../support/tmp" #define DEFCOM "program" icmake-10.03.00/dep/changelog0000644000175000017500000000020114204126313014557 0ustar frankfrankicm-dep version 10.00.00 * C++ version of icm-dep -- Frank B. Brokken Mon, 03 May 2021 12:51:11 +0200 icmake-10.03.00/dep/main.cc0000644000175000017500000000273214204126313014153 0ustar frankfrank//#define XERR #include "main.ih" namespace { Arg::LongOption longOpts[] = { Arg::LongOption{"classes", 'c' }, Arg::LongOption{"gch", Arg::None }, Arg::LongOption{"help", 'h' }, Arg::LongOption{"mainih", 'm' }, Arg::LongOption{"no-gch", Arg::None }, Arg::LongOption{"no-use-all", Arg::None }, Arg::LongOption{"use-all", Arg::Required }, Arg::LongOption{"verbose", 'V' }, Arg::LongOption{"version", 'v' }, }; auto longEnd = longOpts + size(longOpts); } Log g_log{ cout, 0 }; int main(int argc, char **argv) try { g_log.setTimestamp(NOTIMESTAMPS); Arg const &arg = Arg::initialize("c:hm:Vv", longOpts, longEnd, argc, argv); arg.versionHelp(usage, VERSION, 1); Options options; // handles options, using Arg if (options.go() == UNSPECIFIED) usage(arg.basename()); Dependencies dependencies(options); dependencies.find(); dependencies.useAll(); // when requested: check the useAll files dependencies.gchFiles(); // when requested: check the .gch files } catch(int x) { return Arg::instance().option("hv") ? 0 : x; } catch (exception const &exc) { cerr << exc.what() << '\n'; } catch (...) { cerr << "unexpected exception\n"; return 1; } icmake-10.03.00/dep/findidx/0000755000175000017500000000000014203741153014345 5ustar frankfrankicmake-10.03.00/dep/findidx/findidx.h0000644000175000017500000000475014204126313016145 0ustar frankfrank#ifndef INCLUDED_FINDIDX_ #define INCLUDED_FINDIDX_ #include //Predicate must accept a *RAiter argument and must return a bool // // //RAiter and Type must be comparable: // *RAiter -> Type2 // Type2 == Type // Type2 != Type // //RAiter must have: // RAiter + size_t -> RAiter // RAiter - RAiter -> size_t // //Containers must have: // begin() -> RAiterator // end() -> RAiterator // subrange indices: find a value // template size_t findIdx(Container const &container, size_t begin, size_t end, Type const &value) { auto ret = std::find(container.begin() + begin, container.begin() + end, value); return ret == container.end() ? end : ret - container.begin(); } // indices start at 'begin' to the container's end: find a value // template inline size_t findIdx(Container const &container, size_t begin, Type const &value) { return findIdx(container, begin, container.size(), value); } // // inspect all the container's elements: find a value // // // template // inline size_t findIdx(Container const &container, Type const &value) // { // return findIdx(container, 0, container.size(), value); // } // // subrange indices: use a predicate // // // template // inline size_t findIdx_if(Container const &container, size_t begin, size_t end, // Predicate &&pred) // { // auto ret = std::find_if(container.begin() + begin, container.begin() + end, // std::forward(pred)); // return ret == container.end() ? end : ret - container.begin(); // } // // // indices start at 'begin' to the container's end: use a predicate // // // template // inline void findIdx_if(Container const &container, size_t begin, // Predicate &&pred) // { // findIdx_if(container, begin, container.size(), // std::forward(pred)); // } // // // inspect all the container's elements: use a predicate // // // template // inline void findIdx_if(Container const &container, Predicate &&pred) // { // findIdx_if(container, 0, container.size(), // std::forward(pred)); // } #endif icmake-10.03.00/dep/main.ih0000644000175000017500000000060214204126313014160 0ustar frankfrank#include #include #include #include #include #include "../support/tools/tools.h" #include "action/action.h" #include "options/options.h" #include "dependencies/dependencies.h" #include "../xerr/xerr.ih" using namespace std; using namespace FBB; void copyright(string const &progname); void usage(string const &progname); icmake-10.03.00/dep/install0000755000175000017500000000007714204126313014314 0ustar frankfrank#!/bin/bash cp tmp/bin/binary /usr/lib/icmake/bin/icm-dep.wip icmake-10.03.00/dep/options/0000755000175000017500000000000014204243176014416 5ustar frankfrankicmake-10.03.00/dep/options/parser.f0000644000175000017500000000011314204126313016045 0ustar frankfrankinline std::string const &Options::parser() const { return d_parser; } icmake-10.03.00/dep/options/mainih.f0000644000175000017500000000011314204126313016016 0ustar frankfrankinline std::string const &Options::mainIH() const { return d_mainIH; } icmake-10.03.00/dep/options/data.cc0000644000175000017500000000102714204126313015627 0ustar frankfrank//#define XERR #include "options.ih" Pattern Options::s_icmconf { "^[ \t]*#define[ \t]*" "([^ \t]+)" // [1]: key "[ \t]*\"" "([^\"]+)?" // [2]: value (opt) "\"" }; unordered_map Options::s_icmconfEntry = { { "PRECOMP", &Options::precomp }, { "IH", &Options::ih }, { "USE_ALL", &Options::setUseAll }, { "PARSER_DIR", &Options::parserDir }, { "SCANNER_DIR", &Options::scannerDir }, }; icmake-10.03.00/dep/options/options1.cc0000644000175000017500000000250414204126313016473 0ustar frankfrank//#define XERR #include "options.ih" Options::Options() : d_arg(Arg::instance()), d_cwd(filesystem::current_path().string()) { setVerbosity(); d_arg.option(&d_classes, 'c'); if (d_arg.option(&d_icmconf, 'i')) g_log << level(V2) << "using icmconf `" << d_icmconf << "'\n"; if (d_arg.option(0, "gch")) { d_gch = GCH; g_log << level(V2) << "inspecting .gch files\n"; } if (d_arg.option(&d_mainIH, 'm')) g_log << level(V2) << "using main.ih `" << d_mainIH << "'\n"; if (d_arg.option(0, "no-use-all")) { g_log << level(V2) << "USE_ALL files are not inspected\n"; d_useAll.clear(); } else if (d_arg.option(&d_useAll, "use-all")) g_log << level(V2) << "using USE_ALL filename `" << d_useAll << "'\n"; if (d_arg[0] == "go"s) d_go = GO; if (not Tools::exists(d_classes)) { g_log << level(V2) << "Classes file `" << d_classes << "' not found\n"; throw 0; } scanIcmconf(); if (d_gch == UNSPECIFIED) { g_log << level(V1) << ".gch files are not handled\n"; d_gch = NO_GCH; } if (d_useAll[0] == 0) { g_log << level(V1) << "USE_ALL files are not handled\n"; d_useAll.clear(); } } icmake-10.03.00/dep/options/precomp.cc0000644000175000017500000000031514204126313016362 0ustar frankfrank//#define XERR #include "options.ih" void Options::precomp() { if (d_gch != UNSPECIFIED) return; d_gch = GCH; g_log << level(V1) << "inspecting precompiled headers (.gch files)\n"; } icmake-10.03.00/dep/options/classes.f0000644000175000017500000000011514204126313016210 0ustar frankfrankinline std::string const &Options::classes() const { return d_classes; } icmake-10.03.00/dep/options/setuseall.cc0000644000175000017500000000045514204126313016723 0ustar frankfrank//#define XERR #include "options.ih" void Options::setUseAll() { string const &value = s_icmconf[2]; if (value.empty() || d_useAll[0] != 0) // [0] != 0: already specified return; d_useAll = value; g_log << level(V1) << "inspecting USE_ALL files: `" << d_useAll << "'\n"; } icmake-10.03.00/dep/options/gch.f0000644000175000017500000000007114204126313015315 0ustar frankfrankinline Action Options::gch() const { return d_gch; } icmake-10.03.00/dep/options/ih.cc0000644000175000017500000000034714204126313015322 0ustar frankfrank//#define XERR #include "options.ih" void Options::ih() { string const &value = s_icmconf[2]; if (value.empty()) return; d_ih = value; g_log << level(V2) << "used header extension: `" << d_ih << "'\n"; } icmake-10.03.00/dep/options/parserdir.cc0000644000175000017500000000035414204126313016713 0ustar frankfrank//#define XERR #include "options.ih" void Options::parserDir() { string const &value = s_icmconf[2]; if (value.empty()) return; d_parser = value; g_log << level(V2) << "parser dir.: `" << d_parser << "'\n"; } icmake-10.03.00/dep/options/options.h0000644000175000017500000000336214204126313016257 0ustar frankfrank#ifndef INCLUDED_OPTIONS_ #define INCLUDED_OPTIONS_ #include #include #include #include #include "../action/action.h" namespace FBB { class Pattern; class Arg; } class Options { FBB::Arg const &d_arg; std::string d_cwd; std::string d_classes{ "CLASSES" }; std::string d_icmconf{ "icmconf" }; std::string d_mainIH { "main.ih" }; std::string d_useAll { "\0" }; // by default use the icmconf spec // changed to the name of the USE_ALL // file or empty std::string d_ih { ".ih" }; std::string d_parser; std::string d_scanner; Action d_gch = UNSPECIFIED; Action d_go = DRY; static FBB::Pattern s_icmconf; static std::unordered_map s_icmconfEntry; public: Options(); Action go() const; Action gch() const; void startDir() const; std::string const &classes() const; std::string const &scanner() const; std::string const &parser() const; std::string const &useAll() const; std::string const &mainIH() const; std::string const &dotIH() const; size_t verbosity() const; private: void setVerbosity() const; void scanIcmconf(); void precomp(); void ih(); void setUseAll(); void parserDir(); void scannerDir(); }; #include "go.f" #include "gch.f" #include "startdir.f" #include "classes.f" #include "scanner.f" #include "parser.f" #include "mainih.f" #include "dotih.f" #include "verbosity.f" #include "useall.f" #endif icmake-10.03.00/dep/options/options.ih0000644000175000017500000000041514204126313016424 0ustar frankfrank#include "options.h" #include #include #include #include "../../xerr/xerr.ih" #include "../../support/as/as.h" #include "../../support/tools/tools.h" #include "../log/log.h" using namespace std; using namespace FBB; icmake-10.03.00/dep/options/scannerdir.cc0000644000175000017500000000036014204126313017045 0ustar frankfrank//#define XERR #include "options.ih" void Options::scannerDir() { string const &value = s_icmconf[2]; if (value.empty()) return; d_scanner = value; g_log << level(V2) << "scanner dir.: `" << d_scanner << "'\n"; } icmake-10.03.00/dep/options/scanner.f0000644000175000017500000000011514204126313016204 0ustar frankfrankinline std::string const &Options::scanner() const { return d_scanner; } icmake-10.03.00/dep/options/scanicmconf.cc0000644000175000017500000000105314204126313017200 0ustar frankfrank//#define XERR #include "options.ih" void Options::scanIcmconf() { auto in{ Exception::factory(d_icmconf) }; string line; while (getline(in, line)) { if (not (s_icmconf << line)) // no match continue; // inspect the next line auto iter = s_icmconfEntry.find(s_icmconf[1]); if (iter != s_icmconfEntry.end()) (this->*(iter->second))(); // process s_icmconf[2] if // needed } } icmake-10.03.00/dep/options/go.f0000644000175000017500000000006714204126313015166 0ustar frankfrankinline Action Options::go() const { return d_go; } icmake-10.03.00/dep/options/useall.f0000644000175000017500000000011314204126313016036 0ustar frankfrankinline std::string const &Options::useAll() const { return d_useAll; } icmake-10.03.00/dep/options/setverbosity.cc0000644000175000017500000000075314204126313017465 0ustar frankfrank//#define XERR #include "options.ih" void Options::setVerbosity() const { g_log.setLevel(V0 - min(d_arg.option('V'), as(V0))); // no -V: resistance level == V0, so no levels (V1 .. V3) insert // their messages // one -V: resistance level == V1, so only V1 level messages are // shown // two -Vs: resistance level == V2, so V1 and V2 level messages // are shown (etc, up to four -Vs } icmake-10.03.00/dep/options/verbosity.f0000644000175000017500000000011314204126313016577 0ustar frankfrankinline size_t Options::verbosity() const { return d_arg.option('V'); } icmake-10.03.00/dep/options/frame0000644000175000017500000000006414204126313015424 0ustar frankfrank//#define XERR #include "options.ih" Options:: { } icmake-10.03.00/dep/options/dotih.f0000644000175000017500000000010614204126313015662 0ustar frankfrankinline std::string const &Options::dotIH() const { return d_ih; } icmake-10.03.00/dep/options/startdir.f0000644000175000017500000000012414204126313016407 0ustar frankfrankinline void Options::startDir() const { std::filesystem::current_path(d_cwd); } icmake-10.03.00/dep/frame0000644000175000017500000000002314204126313013724 0ustar frankfrank#include "main.ih" icmake-10.03.00/dep/CLASSES0000644000175000017500000000020214204126313013726 0ustar frankfrank# findidx only .h # log only .h # action only .h options dependencies icmake-10.03.00/doc/0000755000175000017500000000000014204171312012710 5ustar frankfrankicmake-10.03.00/doc/manpage/0000755000175000017500000000000014204245361014326 5ustar frankfrankicmake-10.03.00/doc/manpage/list.inc0000644000175000017500000000211014204126313015761 0ustar frankfrank bf(LIST FUNCTIONS:) itemization( itt(string element(int index, list var))nl() acts identically to the index operator: refer to the index (tt([])) operator in section bf(OPERATORS); itt(int listfind(list lst, string str))nl() returns the smallest 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 the elements of tt(rhs). The original order of the elements in tt(lhs) is kept. Subsequent elements in tt(rhs) that are not available in tt(lhs) are added to the end of tt(lhs); itt(list listunion(list lst, string str))nl() returns a list containing the union of the elements in tt(lst) and tt(str). The original order of the elements in tt(lhs) is kept. If tt(rhs) is not available in tt(lhs) then it is added to the end of tt(lhs). ) icmake-10.03.00/doc/manpage/build0000755000175000017500000000222414204126313015346 0ustar frankfrank#!/usr/bin/icmake -t. void yodl(string dest, string src) { system("yodl2man --no-warnings -o " + dest + " " + src); } string release = "release.yo"; void rmrelease() { echo(OFF); system("rm -f " + release); echo(ON); } void newReleaseYo() { // Std version file in icmake's root dir string versionFile = "../../VERSION"; list line; // get the VERSION and YEARS, and write 'release.yo' while (listlen(line = fgets(versionFile, line))) { list cut = strtok(line[0], "= \t\n"); string key = cut[0]; string value = cut[1]; if (key == "VERSION") fprintf("release.yo", "SUBST(_CurVers_)(", value, ")\n"); else if (key == "YEARS") fprintf("release.yo", "SUBST(_CurYrs_)(", value, ")\n"); } } void main(int argc, list argv) { rmrelease(); newReleaseYo(); yodl("../icmake.1", "-r 20000 icmake.yo"); yodl("../icmstart.1", "icmstart.yo"); yodl("../icmbuild.1", "icmbuild.yo"); yodl("../icmstart.rc.7", "icmstart.rc.yo"); yodl("../icmscript.7", "icmscript.yo"); yodl("../icmconf.7", "icmconf.yo"); rmrelease(); } icmake-10.03.00/doc/manpage/getopt.cc0000644000175000017500000000477014204126313016142 0ustar frankfrank#include #include using namespace std; // see the comment at the end int main(int argc, char **argv) { cout << '\n'; opterr = 0; // no errors while (getopt(argc, argv, "nt:") != -1) ; unsigned optIdx; optind = 1; // return to get the actual indices while (true) { optIdx = optind; char opt = getopt(argc, argv, "nt:"); if (opt == -1) break; switch (opt) { case 'n': cout << "saw option " << opt << " optIdx = " << optIdx << //", optind = " << optind << '\n'; break; case 't': cout << "saw option " << opt << ", value " << optarg << " optIdx = " << optIdx << //", optind = " << optind << '\n'; break; default: cout << "saw undefined option " << " optIdx = " << optIdx << // ", optind = " << optind << '\n'; break; } } cout << "\n" "optIdx = " << optIdx << ", optind = " << optind << ", argc = " << argc << // ", diff optind = " << (argc - optind) << ", argv:\n"; for (int idx = 0; idx != argc; ++idx) cout << " " << idx << ": " << argv[idx] << '\n'; cout << "\n\n"; } // a.out first -a -n -tx -t y one two // // saw undefined option optIdx = 1 // saw option n optIdx = 2 // saw option t, value x optIdx = 3 // saw option t, value y optIdx = 4 // // optIdx = 6, optind = 6, argc = 9, argv: // 0: a.out // 1: -a // 2: -n // 3: -tx // 4: -t // 5: y // 6: first // 7: one // 8: two // // #include // // int getopt_long(int argc, char *const *argv, // char const *optstring, // option const *longopts, int *longindex); // // If longindex is not 0, it points to a variable which is set to the // index of the long option relative to longopts. // struct option // array of long options, final el.: 0 // { // char const *name; // int has_arg; // no_argument, required_argument, // // optional_argument // int *flag; // = 0, // int val; // value to return (e.g. // // the short option equiv. // }; icmake-10.03.00/doc/manpage/trailer.inc0000644000175000017500000000030014204126313016447 0ustar frankfrankmanpagesection(COPYRIGHT) This is free software, distributed under the terms of the GNU General Public License (GPL). manpageauthor() Frank B. Brokken (bf(f.b.brokken@rug.nl)). icmake-10.03.00/doc/manpage/icmbuild.yo0000644000175000017500000003051314204126771016474 0ustar frankfrankincludefile(release.yo) htmlbodyopt(text)(#27408B) htmlbodyopt(bgcolor)(#FFFAF0) whenhtml(mailto(Frank B. Brokken: f.b.brokken@rug.nl)) DEFINEMACRO(sop)(3)(\ it() bf(-ARG1) ARG2 nl()ARG3\ ) DEFINEMACRO(itt)(1)(\ it()tt(ARG1)\ ) DEFINEMACRO(itb)(1)(\ it()bf(ARG1)nl()\ ) DEFINEMACRO(icb)(0)(tt(icmbuild)) DEFINEMACRO(Icb)(0)(tt(Icmbuild)) DELETEMACRO(tt) DEFINEMACRO(tt)(1)(em(ARG1)) COMMENT( man-request, section, date, distribution file, general name) manpage(icmbuild)(1)(_CurYrs_)(icmake._CurVers_) (Icmake's generic program maintenance facility) COMMENT( man-request, larger title ) manpagename(icmbuild)(A generic, C++/C program maintenance facility) COMMENT( all other: add after () ) manpagesynopsis() icb() [-h] [-c] tt(args) manpagedescription() Icb() is a small bf(C) program calling bf(icmake)(1) to do program maintenance as defined by the tt(icmbuild) script that's (commonly) found in tt(/usr/lib/icmake). tt(Icmbuild's) actions are tailored through a configuration file (tt(icmconf)) which must be present in the directory where program maintenance is requested. This file is automatically installed by bf(icmstart)(1). Refer to bf(icmconf)(7)'s man-page for details about this file. 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 it is assumed that bf(C++) sources are maintained, but program maintenance for, e.g., bf(C) sources can also easily be configured. If icb() is called, but tt(icmconf) is not available it displays a usage-summary after which icm() ends. Icb()() handles the maintenance for all sources in each of the subdirectories named in the file tt(CLASSES), and also of all sources in the current working directory. `Maintenance' involves compiling all as yet uncompiled source files, recompilation of modified source files, optionally library maintenance and optionally the pre-compilation of header files, which normally results in a marked reduction of source compilation times. When source files are compiled object modules are produced which may be stored in a library, against which the object module of the program's tt(main) function is linked. It is also possible to specify additional libraries against which the program must be linked. If a library is constructed it is kept up to date by icb(). When a source is successfully compiled its new object module replaces the old one in the library. At that point the separate object files are no longer required and are removed by icb(). manpagesection(KICK-STARTING ICMBUILD) To use icb() do as follows: itemization( it() Install icb() in your path (tt(icmake's) installation procedure should already have taken care of that); it() Copy tt(icmconf) (and probably a file tt(CLASSES)) to your project's base directory (i.e., the directory where and below which the project's sources are found). Usually this has already been taken care of by the (icmstart) script; ) Next: itemization( it() Modify the tt(#defines) in the file tt(icmconf) to taste; 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 tt(CLASSES) em(is) relevant in that new class (subdirectory) names can always be added to the end of the file tt(CLASSES), but reordering the lines in the tt(CLASSES) file should be avoided as that may easily result in overwriting identically named object files from already existing directories. If reordering is necessary, then first run the command tt(icmbuild clean) to remove all files that were 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 because of the number-prefixes replacement of a file tt(x.o) from class tt(A) by file tt(x.o) from class tt(B) is prevented; it() Start tt(icmbuild). ) The next section covers tt(icmbuild's) modes of operation. manpageoptions() Icb() recognizes three options of which only one can be specified. See the following section for information about which option is recognized by by which icb() command. itemization( itt(-h): display usage information (which is also automatically shown when the current directory does not contain a file tt(icmconf)) and terminate icb(); itt(-c): clear the screen (by calling tt(tput clear)) before starting the compilation process; itt(-s): strip the compiled program or library at its installation directory (see the various tt(install) modes below). ) manpagesection(ICMBUILD COMMANDS) Icb() recognizes the following commands (possible options are shown between square brackets). With the tt(install) commands a tt(path) argument must be specified, which must be an existing user-writable directory: itemization( itt(clean)nl() clean up remnants of previous actions (the directory specified by the tt(TMP_DIR) define in tt(icmconf) is removed). If precompiled headers were created (i.e., tt(PRECOMP) in tt(icmconf) was specified) then all files having extension tt(.gch) in the main directory and in the directories listed in the tt(CLASSES) file are also removed. If tt(USE_ALL) was specified then those files are also removed; itt(cleangch)nl() all tt(.gch) files that were precompiled are removed (whether existing in the tt(gch) subdirectory of the tt(TMP_DIR) directory (specified in tt(icmconf)), or in directories specified in the tt(CLASSES) file, or in the project's main directory). If tt(icmconf) does not specify tt(PRECOMP) then nothing happens; itt(cleantmp)nl() same as tt(icmbuild clean), but the tt(.gch) files and files specified by the tt(USE_ALL) define in tt(icmconf) are not removed; itt([-s] install program path)nl() install the constructed program in the specified tt(path) (to be used after issuing icb() tt(program), see below). Path can be absolute or relative and may optionally specify the name of the installed program. Example: verb( icmbuild install program ~/bin/prog ) This installs the constructed binary program in the user's tt(bin) directory with the name tt(prog); itt([-s] install static path)nl() install the constructed static library in the specified path (to be used after issuing icb() tt(library), see below). Path can be absolute or relative and may optionally specify the name of the installed library. Example: verb( icmbuild install static /usr/lib/ ) This installs the constructed static library (assume its name is tt(libspecial.a)) in tt(/usr/lib) as tt(/usr/lib/libspecial.a).nl() itt([-s] install shared path) when using this installation command, tt(icmconf) must contain tt(#define SHARED) (cf. bf(icmconf)(7)). It installs the constructed shared library in the specified path (to be used after issuing icb() tt(library)). Path can be absolute or relative, and must specify an existing directory. Example: verb( icmbuild install shared /usr/lib/ ) This installs the constructed binary shared library (e.g. tt(libspecial.so)) in tt(/usr/lib) as tt(/usr/lib/libspecial.so). In addition, the soft-links verb( libspecial.so -> libspecial.so.X libspecial.so.X -> libspecial.so.X.Y.Y.Z ) are defined in tt(/usr/lib), where tt(X.Y.Z) are the major, minor and subminor versions defined in the file tt(VERSION). itt([-c] library)nl() do library maintenance (builds a static and optionally (if tt(icmconf) defines tt(SHARED)) a shared (dynamic) library); itt([-c] program)nl() do program maintenance (builds a program from the sources in the current working directory and from the sources in the directories specified in the file tt(CLASSES)); it() If no commands are specified (but optionally only tt(-c)) then the tt(DEFCOM) specification in the tt(icmconf) is inspected. Recognized specifications are: verb( #define DEFCOM "program" ) which is quivalent to the command icb() tt([-c] program);nl() if tt(DEFCOM) is specified as verb( #define DEFCOM "library" ) then this is quivalent to the command icb() tt([-c] library).nl() If an explicit command is passed to icb() then tt(DEFCOM) specifications are ignored. ) manpagesection(ICM-DEP) Class dependencies are handled by tt(icmake)'s support program tt(icm-dep). It can be called from tt(icmake) by passing it the option tt(-d). All options and arguments following tt(-d) are forwared to tt(icm-dep). The program tt(icm-dep) is automatically called by tt(icmbuild) to handle class dependencies. Consider two classes tt(Options) and tt(Process). If tt(Process) uses tt(Options) and if precompiled header files are used, then in addition to tt(Option's) header file, tt(Process's) header must also be precompiled if tt(Option's) header file changes. Likewise, if tt(Option's) data organization is altered and tt(Option) defines inline members used by tt(Process) or tt(Process) defines an tt(Option) data member then, in addition to tt(Option's) sources sources tt(Process's) sources must also be compiled. For the latter case tt(icmconf) provides the tt(USE_ALL) specification: if a tt(`USE_ALL') file exists in a directory, then all sources of that directory are recompiled. The program tt(icm_dep) determines the program's class dependencies, and recompiles class header files of all classes depending on classes whose header files must be recompiled. Furthermore, if a tt(`USE_ALL') file exists in a directory then all sources of classes depending on that directory's class are also recompiled. tt(Icm-dep's) options are described in bf(icmake)(1)'s man-page. To start its work, tt(icm_dep) needs one command-line argument: tt(go). Any other argument results in tt(icm_dep) performing a `dry run': it performs all its duties (and verbose messages are displayed as if tt(go) had been specified), but no files (precompiled headers or tt(USE_ALL) files) are touched or removed. If neither options nor arguments are specified tt(icm_dep) writes its usage summary to the standard output. By default tt(icmbuild) calls tt(icmake -d -V go): tt(icm_dep) is called to perform its duties and to show its actions on the standard output stream. By specifying a tt(#define ICM_DEP) parameter in the tt(icmconf) file this default can be overruled (cf. bf(icmconf)(7)). manpagefiles() The mentioned paths are sugestive only and may be installation dependent: itemization( it() bf(/usr/share/icmake/icmconf) Unabbreviated example of an icb() configuration file; it() bf(/usr/share/icmake/CLASSES) Example of an icb() tt(CLASSES) file. ) manpagesection(EXAMPLES) Here is an example of the configuration file tt(icmconf) for a concrete program, using facilities of the tt(bobcat) library: verb( #define CLS #define LIBRARY "modules" #define MAIN "main.cc" #define SOURCES "*.cc" #define OBJ_EXT ".o" #define SHAREDREQ "" #define TMP_DIR "tmp" #define USE_ALL "a" #define USE_ECHO ON #define CXX "g++" #define CXXFLAGS " --std=c++20 -Wall -O2 -pthread" \ " -fdiagnostics-color=never " #define IH ".ih" #define PRECOMP "-x c++-header" #define REFRESH #define LDFLAGS "" #define ADD_LIBRARIES "bobcat" #define ADD_LIBRARY_PATHS "" #define DEFCOM "program" ) manpageseealso() bf(icmake)(1), bf(icmconf)(7), bf(icmstart)(1), bf(icmstart.rc)(7) manpagebugs() None reported includefile(trailer.inc) icmake-10.03.00/doc/manpage/icmscript.yo0000644000175000017500000007357314204126313016706 0ustar frankfrankincludefile(release.yo) htmlbodyopt(text)(#27408B) htmlbodyopt(bgcolor)(#FFFAF0) whenhtml(mailto(Frank B. Brokken: f.b.brokken@rug.nl)) DEFINEMACRO(lsvoption)(3)(\ bf(--ARG1)=tt(ARG3) (bf(-ARG2))\ ) DEFINEMACRO(lsoption)(2)(\ bf(--ARG1) (bf(-ARG2))\ ) DEFINEMACRO(lvoption)(2)(\ bf(--ARG1)=tt(ARG2)\ ) DEFINEMACRO(loption)(1)(\ bf(--ARG1)\ ) DEFINEMACRO(svoption)(2)(\ bf(-ARG1) tt(ARG2)\ ) DEFINEMACRO(soption)(1)(\ bf(-ARG1)\ ) DEFINEMACRO(itt)(1)(\ it()tt(ARG1)\ ) DEFINEMACRO(itb)(1)(\ it()bf(ARG1)nl()\ ) DEFINEMACRO(icm)(0)(bf(icmake)) DEFINEMACRO(Icm)(0)(bf(Icmake)) DELETEMACRO(tt) DEFINEMACRO(tt)(1)(em(ARG1)) COMMENT( man-request, section, date, distribution file, general name) manpage(icmscript)(7)(_CurYrs_)(icmake._CurVers_) (The icmake scripting language) COMMENT( man-request, larger title ) manpagename(icmscript)(The bf(C)-like em(icmake) scripting language) COMMENT( all other: add after () ) manpagedescription() Icm()(1) is a generic tool handling program maintenance that can be used as an alternative for bf(make)(1). It's a generic tool in that tt(icmake)-scripts, written in a language closely resembling the bf(C) programming language, can perform tasks that are traditionally the domain of scripting languages. Icm() allows programmers to use a programming language (closely resembling the bf(C)-programming language) to define the actions that are required for (complex) program maintenance. For this, icm() offers various special operators as well as a set of support functions that have shown their usefulness in program maintenance. This man-page covers the icm() scripting language in de following sections: itemization( itb(DATA TYPES) - tt(int, list, string), and tt(void) (for functions); itb(OUTLINE) - outline of icm() scripts: what are their requirements, the structure and organization of their tt(main)-functions. itb(PREPROCESSOR DIRECTIVES) - supported preprocessor directives, like tt(#include) and tt(#define); itb(PREDEFINED CONSTANTS) - like tt(O_FILE, OFF), and tt(S_IFREG); itb(OPERATORS) - like tt(+, younger), and casts itb(FLOW CONTROL) - tt(if, for, while), etc. (the tt(switch) is not available); itb(PREDEFINED FUNCTIONS) - executing programs, changing directories, operations on tt(string) and tt(list) type variables, etc.. Functions are marked as tt(INT FUNCTIONS), tt(LIST FUNCTIONS), tt(STRING FUNCTIONS) itb(USER DEFINED FUNCTIONS) - at least tt(main), with or without its common parameters tt(argc, argv,) and tt(envp). ) manpagesection(DATA TYPES) Icm() supports the following five data and value types: itemization( itt(ASCII character constants)nl() ASCII character constants are ascii-characters, surrounded by single or double quotes. Single characters (e.g., tt('a')) represent the character itself. Standard escape sequences (e.g., tt('\n')) are supported and are converted to their well-known values (e.g., tt('\n') represents ascii value 10 (decimal)). Non-standard escape sequences (e.g., tt('\x')) are converted to the ascii character following the escape character (so tt('\x') equals tt('x')). Escaped sequences consisting of three octal digits represent the ascii character corresponding to the octal value, modulo 256 (e.g., tt('\113') represents tt('K')). Escape sequences consisting of an x followed by two hexadecimal digits represent the ascii character corresponding to the hexadecimal value (e.g., tt('\x4b'), also representing tt('K')); itt(int)nl() Integral values, ranging from tt(-0x8000) through tt(0x7fff). tt(int) constants may be specified as decimal numbers (starting with digits 1 through 9), octal numbers (starting with 0, followed by one or more octal digits), hexadecimal numbers (starting with 0x, followed by one or more hexadecimal digits), or as tt(ASCII) character constants; itt(string)nl() Text values: text (or `string') constants are delimited by double quotes. Multiple string constants may be concatenated, but a single string constant may not span multiple lines. Multiple string constants, only separated by white space (i.e., blanks, newlines, comment) are concatenated and are considered one single string constant. To indicate an end-of-line in a string constant use the tt(\n) escape sequence; If arithmetic expressions use at least one tt(int) operand then those expressions may also contain single character ASCII constants using double quotes. In those cases they represent the ascii-values of their characters. Conversely, ASCII character constants using single quotes may be used in situations where string operands are expected; itt(list)nl() A tt(list) is a data structure containing a series of individually accessible tt(string) values. When a list contains elements, its first element has index 0; Lists may be written to the standard output stream or to file (using tt(printf) or tt(fprintf)). Lists can also be inserted into tt(string) variables using tt(strformat). In these cases all (space delimited) elements of the lists are inserted into their destinations; Lists can also be defined as constants. They consist of an optional series of comma separated string constants surrounded by a pair of square brackets. E.g., verb( list words = ["a", "list", "constant"]; ) itt(void)nl() The type tt(void) is used when defining functions to indicate that such functions do not return values. Alternatively, functions may return tt(int, string) or tt(list) values (cf. section bf(USER DEFINED FUNCTIONS)). ) Variables can be defined at the global level inside functions (not only at the top of compound statements but also between statements and in the initialization section of for- and if-statements). When defined inside functions, the standard bf(C) scoping and visibility rules apply. Variables are strongly typed, and cannot have type tt(void). Variables may be initialized when they are defined. Initializations are expressions which may use predefined or user-defined functions, constant values, and values of variables. Functions or variables that are used for initialization must be visible at the initialization point. manpagesection(OUTLINE) Icm() scripts require a user-defined function tt(main). The function tt(main) has three optional parameters, which may be omitted from the last one (tt(envp)) to the first one (tt(argc)), like in bf(C). Its full prototype is: verb( void main(int argc, list argv, list envp) ) or verb( int main(int argc, list argv, list envp) ) When a tt(void main) function ends (using a tt(return;) statement or when its execution reaches its body's closing curly) the value 0 is returned to the operating system. When tt(int main) functions end using tt(return) statements then those statements must be provided with tt(int)-expressions. It's OK when the execution of an tt(int main) function reaches its body's closing curly, om which case 0 is automatically returned to the operating system In tt(main) the parameter itemization( itt(argc) represents the number of elements in tt(argv); itt(argv) contains the arguments, with element 0 being equal to the name of the tt(.bim) file, that were passed to the tt(.bim) file. The bf(OPTIONS) section of the bf(icmake)(1) manpage covers how these arguments are forwarded to the icm() script using options tt(-e, -s,) and tt(-t). itt(envp) contains the `environment' variables. The (predefined) function tt(listlen) can be used to determine the number of its elements. Elements in tt(envp) use the format tt(variable=value). Alternatively, the (predefined) function tt(getenv) can be used to retrieve a specific environment variable immediately. ) Example (the implementations of the user-defined functions tt(usage, modified,) and tt(compile) are left as an exercise for the reader): verb( void main(int argc, list argv) { if (argc == 1) usage(argv[0])); if (list toCompile = modified("*.cc")) { for (int idx = listlen(toCompile); idx--; ) compile(toCompile[idx]); } } ) When executing an icm() script bf(icmake's) run-time support system first initializes all all global variables in the order of their definitions. Followin this the function tt(main) is called. The script ens once once tt(main) returns or when the (predefined) function tt(exit) is called by the script). manpagesection(PREPROCESSOR DIRECTIVES) Before actually compiling icm() scripts they are first pre-processed by the icm() pre-processor. The pre-processor removes comment, includes files specified by tt(include)-directives, and processes tt(#define) and comparable directives. The following preprocessor directives are recognized: itemization( it() comment:nl() standard bf(C) comment (everything from tt(/*) through tt(*/)) as well as comment-to-end-of-line (starting at tt(//), continuing to the end of the line) is ignored; it() Shell startup: The first line of the icm()-script may start with tt(#!path), where tt(path) defines the absolute location of the icm() program. By making the script executable, it can be called without explicitly calling icm(). E.g., if the first line of an (executable) icmakefile 'icm' (without extension) contains verb( #!/usr/bin/icmake -t. ) then tt(icm) can be issued as a command, interpreting the remaining content of the script as an icm() source which is compiled and then executed by icm(). In these cases the binary files are removed when the scipts end; 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) is replaced by tt(definition). The definition may contain references to already defined identifiers, using the format tt(${identifier}). If the tt(${identifier}) hasn't been defined (yet), the literal text tt(${identifier}) is used. To prevent infinite recursion at most 100 tt(${identifier}) replacements are accepted; If the last character on a line is a backslash (tt(\)) then definitions continue at the next line. (the backslash is not included in the definition). The preprocessor concatenates double-quoted strings. Double quoted strings may not span multiple lines. Multiple blanks (outside of double quoted strings) in definitions are contracted to a single blank space; Following the tt(#define's) identifier a definition may optional be provided. If omitted, the macro is defined, so it can be used in tt(#if(n)def) directives (see below), but in those cases these intentifiers are simply removed from 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 tt(#ifdef) and tt(#ifndef) directives, 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. 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 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. ) manpagesection(PREDEFINED CONSTANTS) The following predefined tt(int) constants are available (the functions listed in the tt(intended for) column are described in the upcoming sections covering the predefined functions): table(3)(lll)( rowline() row(cell(symbol)cell(value)cell(intended for)) rowline() row(cell(O_ALL)cell(8)cell(makelist)) row(cell(O_DIR)cell(2)cell(makelist)) row(cell(O_FILE)cell(1)cell(makelist)) row(cell(O_SUBDIR)cell(4)cell(makelist)) rowline() row(cell(OFF)cell(0)cell(echo)) row(cell(ON)cell(1)cell(echo)) rowline() row(cell(P_CHECK)cell(0)cell(system calls)) row(cell(P_NOCHECK)cell(1)cell(system calls)) rowline() row(cell(S_IEXEC)cell(32)cell(stat)) row(cell(S_IFCHR)cell(1)cell(stat)) row(cell(S_IFDIR)cell(2)cell(stat)) row(cell(S_IFREG)cell(4)cell(stat)) row(cell(S_IREAD)cell(8)cell(stat)) row(cell(S_IWRITE)cell(16)cell(stat)) rowline() ) The following constants are architecture dependent: table(2)(ll)( rowline() row(cell(symbol)cell(1 when defined on the platform, otherwise 0)) rowline() row(cell(unix) cell(Unix, usually with GNU's gcc compiler)) row(cell(UNIX) cell(may alternatively be available)) row(cell(linux) cell(x86 running Linux (usually with gcc))) row(cell(LINUX) cell(may alternatively be available)) row(cell(M_SYSV, M_UNIX) cell(x86 running SCO/Unix)) row(cell(_POSIX)cell(_SOURCE Unix with Posix compliant compiler)) row(cell(__hpux)cell(HP-UX, with the native HP compiler)) rowline() ) manpagesection(OPERATORS) Since icm() version 10.00.00 the tt(<<) operator can be used like the bf(C++) insertion operator. See the description of the functions tt(printf) and tt(fprintf) below. bf(int-operators:) All bf(C) operators (including the ternary operator) are available (except for pointer operators, as icm() does not support pointers). They operate like their bf(C)-programming language's counterparts. Comparison operators return 1 if the comparison is true, otherwise 0 is returned. bf(string-operators:) For tt(string) variables and/or constants the following operators are available (tt(lhs) and tt(rhs) are tt(string) variables or constants): itemization( itt(lhs + rhs): returns a new tt(string) value containing the concatenation of tt(strings lhs) and tt(rhs). Note that tt(string) constants can also directly be concatetated (not using the tt(+) operator), e.g., the following two lines both define the string tt("hello world"): verb( "hello " "world" "hello " + "world" ) itt(lhs += rhs): tt(lhs) must be a tt(string) variable, to which the tt(string) variable or value tt(rhs) is appended; it() string comparisons: operators tt(== != <= >= < > !=) and tt(==) return 1 if the comparison is true, otherwise 0. The ordering operators (like tt(<) and tt(>=)) use the (case sensitive) character ordering defined by the tt(ASCII) character set; itt(!lhs): the boolean tt(!) (not) operator returns 1 if the tt(string lhs) is empty, otherwise 0 is returned. Strings containing white-space characters are not empty; itt(lhs younger rhs, lhs newer rhs): returns 1 if file tt(lhs) is more recent than file tt(rhs). E.g., tt("source.cc" newer "source.o"). The files tt(lhs) and tt(rhs) do not have to exist: quote( itemization( it() if both don't exist 0 is returned, it() if tt(lhs) doesn't exist 0 is returned, it() if tt(rhs) doesn't exist, 1 is returned, it() if they are equally old 0 is returned. )) The predefined function tt(exists()) (see below, section bf(PREDEFINED FUNCTIONS)) can be used to test whether a file exists; itt(lhs older rhs): returns 1 if file tt(lhs) is older than file tt(rhs). E.g., tt("libprog.a" older "source.o"). The files tt(lhs) and tt(rhs) do not have to exist: quote( itemization( it() if both don't exist 0 is returned, it() if tt(lhs) doesn't exist 1 is returned, it() if tt(rhs) doesn't exist, 0 is returned, it() if they are equally old 0 is returned. )) itt([]): the index operator returns a character from a string variable or constant. A string is returned as an em(rvalue). Thus, the following statement compiles OK: verb( lhs = rhs[3]; ) but the following statement won't compile: verb( lhs[3] = "a"; ) If an invalid (out of bounds) index value is specified an empty string is returned. it() The em(backtick) operator (tt(`string cmd`))nl() A string placed between two backticks is executed as a separate command. Different from the tt(exec) and tt(system) calls the backtick operator collects the standard output produced by `cmd' returning this output as a list. The elements of the list contain the subsequent lines of output (including a final newline, if present) produced by `cmd'. An empty list indicates that the command could not be executed. Note that a command that could be executed but that did not produce any output returns a list containing one string element, which is empty. The command's standard error stream output is ignored by the backtick operator. However, standard shell redirection may be used to collect the standard error stream's output. Example: verb( printf << `"ls"`; // prints the elements in // the current directory ) Also note that the backtick operator requires a string argument: either a string constant or a string variable. The predefined function tt(eval(string cmd)) behaves exactly like the backtick operator: they are synonyms. ) bf(list-operators:) For tt(list) variables and/or values the following operators are available: itemization( itt(lhs + rhs): returns a new tt(list) value containing the concatenation of the values of tt(lists lhs) and tt(rhs). This is em(not) a set operation: if an element appears both in tt(lhs) and in tt(rhs), then both will appear in the resulting list (set-addition is provided by the built-in function tt(listunion)); itt(lhs - rhs): returns a new tt(list) value containing the elements in tt(lhs) that are not present in tt(rhs). This is a set-difference operation. The ordering of the remaining elements in the returned list is equal to the ordering of those elements in tt(lhs); itt(lhs += rhs): elements in tt(rhs) are added to the elements in tt(lhs), which must be a tt(list) variable. This is em(not) a set operation; itt(lhs -= rhs): elements in tt(rhs) are removed from the elements in tt(lhs). This is a set operation: all elements of tt(lhs) that are found in tt(rhs) are removed from tt(lhs). The ordering of the remaining elements in tt(lhs) is not altered; 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, otherwise 0 is returned. Operator tt(!=) reverses the result of tt(==); itt(!lhs): the boolean tt(!) operator returns 1 if the tt(list lhs) is empty, otherwise 0 is returned; itt([]): the index operator retrieves an element from a list variable: it returns a string as an em(rvalue). Thus, the following statement compiles OK: verb( // assume lst is a list, str is a string str = lst[3]; ) but the following statement won't compile: verb( lst[3] = str; ) If an invalid (out of bounds) index value is specified an empty string is returned. ) bf(Casting:) Type-casts using the standard bf(C)-style cast-operator can be used to cast: itemization( it() strings to ints and vice versa (tt((int)"123", (string)55))nl() If the content of a string does not represent a (decimal) tt(int) value 0 the cast returns 0; it() Strings to lists (tt(list lst = (list)"hello")): this returns a list having one element (tt(hello)) (note that casting a string to a list as shown is overkill as tt(list lst = ["hello"]) performs the same initialization). ) manpagesection(FLOW CONTROL) Icm() offers a subset of bf(C)'s flow control statements. They can be used as in the bf(C) programming language. itemization( itt(expression ;)nl() The plain expression statement. Insert-expression statements are defined for the functions tt(fprintf) and tt(printf). Expression statements may start with tt(printf <<) or tt(fprintf << filename <<). The values of all subsequent expressions, separated by tt(<<) operators (which in this context are called em(insertion operators)) are written to the standard output stream (when using tt(printf <<)), or to the file whose name is provided in the tt(string filename) (when using tt(fprintf << filename <<)). Examples: verb( printf << "hello" << ' ' << "world" << '\n'; fprintf << "out.txt" << "hello" << ' ' << "world" << '\n'; ) it() The compound statement nl() Variables may be defined and initialized inside compound statements at locations where expression statements can also be used. The em(visibility) of variables starts at their points of definition; itt(if ([definition;] condition) statement)nl() The tt([definition;]) phrase is optional. If used it defines a type followed by a comma-separated list of variables which may be provided with initialization expressions. The condition phrase is required, and may define and initialize a variable. E.g, verb( if (string str = getText()) process(str); ) In this example, tt(process) is not called if tt(getText()) returns an empty string. Variables defined in the definition and condition phrases do not exist either before or after the tt(if) statement.nl() itt(if ([definition;] condition) statement1 else statement2)nl() Acts like the previous statement. If the condition is true tt(statement1) is executed; if the condition is false tt(statement2) is executed; itt(for (init; condition; increment) statement)nl() Variables (of a single type) may be initialized (and optionally defined) in the tt(init) section. The condition phrase may define and initialize a variable. The tt(init), tt(condition) and tt(increment) sections may remain empty. An empty condition section is interpreted as `always tt(true)'; itt(while (condition) statement)nl() Inside the condition a variable may be defined and initialized. A complementary tt(do ... while()) statement is not available. Note that when a variable is defined and initialized in the condition section the initialization expression is executed at each iteration of the tt(while) statement. Thus the following statement never ends, and displays 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. itt(break)nl() tt(break;) statements can only be used in tt(for) and tt(while) statements, ending those statements; itt(continue)nl() tt(continue;) statements can only be used in tt(for) and tt(while) statements, continuing their next iteration. ) manpagesection(PREDEFINED FUNCTIONS) Icm() provides the following predefined functions, which can be used anywhere in icm() scripts. In the following overview the functions are ordered by categories, and within categories they are ordered alphabetically by function name. Five categories are distinguished: itemization( it() Functions operating on ints (see tt(INT FUNCTIONS) below):nl() these functions receive tt(int) arguments, processing those arguments; it() Functions operating on strings (see tt(STRING FUNCTIONS) below):nl() these functions operate on the strings which are passed to these functions as arguments; it() Functions operating on lists (see tt(LIST FUNCTIONS) below):nl() these functions operate on the lists which are passed to these functions as arguments; it() Functions manipulating file system entries (see tt(FILESYSTEM FUNCTIONS) below):nl() these functions receive the names of file-system entries (files, directories, etc.) as their tt(string) arguments. Note that these functions are not listed in the tt(STRING FUNCTIONS) section, as they do not directly operate on their tt(string) arguments, but merely use those arguments to identify file system entries. On the other hand, functions like tt(change_base) do not operate on file-system entries and are therefore entries in the tt(STRING FUNCTIONS) section; it() System-related functions (see tt(SYSTEM FUNCTIONS) below):nl() these functions interface to facilities provided by the operating system, like executing programs or changing the script's environment variables. Some of these functions use specialized support functions, which are also included in this section. ) bf(INT FUNCTIONS:) itemization( itt(string ascii(int value))nl() returns tt(value) as a string: tt(ascii(65)) returns the string tt("A"); itt(echo(int opt))nl() controls echoing of called programs (and their arguments), specify tt(OFF) if echoing is not requested. By default tt(echo(ON)) is active. ) includefile(string.inc) includefile(list.inc) includefile(filesystem.inc) includefile(system.inc) manpagesection(USER DEFINED FUNCTIONS) In addition to tt(main) additional functions are usually defined. Once defined, they can be called. Forward referencing of either variables or functions is not supported, but calling functions recursively is. As function declarations are not supported indirect recursion cannot be used. User-defined functions must have the following elements: itemization( it() The function's return type, which must be 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 (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(})). ) Function bodies may contain variable definitions (optionally initialized at their definitions). Variable definitions start with a type name, followed by one or more comma separated and optionally initialized variable identifiers. If a variable is not explicitly initialized it is initialized by default: tt(int) variables are initialized to 0, tt(string) variables are initialized to empty strings (tt("")) and tt(list) variables are initialized to empty lists. Function bodies may also contain zero or more statements (cf. section bf(FLOW CONTROL)). Note that variables may be defined (and optionally initialized) anywhere inside functions where expression statements can be used, and also in the condition sections of tt(if, for,) and tt(while) statements and in the initialization sections of tt(if) andd tt(for) statements. manpagesection(EXAMPLE) In the following example all bf(C++) source files in the current directory are compiled unless their object files are more recent. The main function creates a list of source files and then passes each of them to a function tt(inspect). That function inspects whether the source file is younger than its object file, and if so it calls tt(compile). The function tt(compile) uses tt(exec) to call the compiler. If a compilation fails the script stops so the error can be repaired. Source files for which the compilation succeeded are not recompiled when the script is rerun. Assuming the script is named tt(compile.im) then it can be called using tt(icmake -s compile.im). This also creates tt(compile.bim), so after the tt(-s) call the command tt(icmake -e compile.bim) can be used to immediately execute the bim-file: verbinsert(-as4 compile.im) manpageseealso() bf(icmake)(1), bf(icmbuild)(1), bf(icmconf)(7), bf(icmstart)(1), bf(icmstart.rc)(7) manpagebugs() Standard comment starting on lines containing preprocessor directives may not extend over multiple lines. Path names containing blanks are not supported. includefile(trailer.inc) icmake-10.03.00/doc/manpage/icmconf.yo0000644000175000017500000004121114204126771016317 0ustar frankfrankincludefile(release.yo) htmlbodyopt(text)(#27408B) htmlbodyopt(bgcolor)(#FFFAF0) whenhtml(mailto(Frank B. Brokken: f.b.brokken@rug.nl)) DEFINEMACRO(sop)(3)(\ it() bf(-ARG1) ARG2 nl()ARG3\ ) DEFINEMACRO(itt)(1)(\ it()tt(ARG1)\ ) DEFINEMACRO(itb)(1)(\ it()bf(ARG1)nl()\ ) DELETEMACRO(tt) DEFINEMACRO(tt)(1)(em(ARG1)) COMMENT( man-request, section, date, distribution file, general name) manpage(icmconf)(7)(_CurYrs_)(icmake._CurVers_) (configuration file for bf(icmbuild)(1)) COMMENT( man-request, larger title ) manpagename(icmconf)(Configuration file for the bf(icmbuild)(1) program maintenance script) manpagedescription() The tt(icmconf) configuration file is used to specify and fine-tune the program maintenance performed by the bf(icmbuild)(1) program and script. It can be used to activate and specify various directives that 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 also easily be configured. The bf(icmbuild)(1) script ignores empty lines and lines whose first non-blank characters are two consecutive forward slashes (//). Long lines can be split over multiple lines by writing 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 all dependent sources once header files are modified. When developing bf(C++) programs this is hardly ever requird, as adding new member functions to classes does not require you to recompile already existing source files. Recompilation em(is) required when the data member organization of classes is altered. To handle class dependencies in a more sensible way, bf(icmake)(1) checks class dependencies using its support program tt(/usr/lib/icmake/icm-dep), visiting the classes listed in the tt(CLASSES) file if tt(icmconf's USE_ALL) directive was specified. If a directory mentioned in the tt(CLASSES) file contains a file having a name that's equal to the name specified at the tt(USE_ALL) parameter, then all sources of classes that depend on that particular class are also recompiled. In practice this means that when you change the data organization of a class you only need to tt(touch) it that directory the file whose name was specified by the tt(USE_ALL) directive. E.g., if your class is named tt(Data), its sources are in the sub-directory tt(./data), and tt(#define USE_ALL "a") was specified then after modifying the data organization of the class tt(Data) you only need to issue the command tt(touch data/a). Subsequently, at the next tt(icmbuild) call all sources in tt(./data) as well as all sources in directories whose (header) files include tt(data.h) are recompiled as well. Likewise, if tt(PRECOMP) was defined, then a similar action is performed for the precompiled headers: if a local header file that's (directly or indirectly) included by a class's internal header file has changed, then that class's precompiled header as well as all precompiled headers of dependent classes are recompiled. The bf(icmbuild)(1) script itself does not inspect these dependencies, but calls tt(/usr/lib/icmake/icm-dep) to perform the requird tests. The program tt(icm-dep's) short usage summary is written to the standard output stream when calling tt(icmake -d) (or directly: tt(/usr/lib/icmake/icm-dep)). manpagesection(DEFINES IN ICMCONF ) All of the following tt(#defines) are required except those that are shown as commented tt(#defines) (e.g., tt(//#define REFRESH)). itemization( itb(//#define ADD_LIBRARIES "") when a program must be linked against additional libraries (other than the name of the program's library itself (specified at tt(LIBRARY)) then those libraries should be specified here. E.g., when a program is linked against tt(libbobcat) then the specification is: verb( #define ADD_LIBRARIES "bobcat" ) If your program is linked against multiple libraries, then use a blank-separated list of libraries (like tt(#define ADD_LIBRARIES "math bobcat")); itb(//#define ADD_LIBRARY_PATHS "") this directtive must be specified if tt(ADD_LIBRARIES) is also specified, although it may be specified as an empty string. When additional libraries (specified at tt(ADD_LIBRARIES)) are located in non-standard library locations (e.g., not in tt(/lib) and tt(/usr/lib)) then these additional paths are (blank space separated) specified here. Specify only the paths, not the tt(-L) flags. It is stronly advised to specify full pathnames here. Relative path specifications can be used by specify paths relative to the directory that is specified at the tt(TMP_DIR) directive (see below); itb(//#define CLS) the em(clear screen) directive. If defined tt(tput clear) is called to clear the terminal screen before starting compilations. By default it is not defined. Alternatively the tt(-c) option can be passed to tt(icmbuild); itb(#define CXX "g++") the C++ compiler to use. For a bf(C) compiler specify, e.g., tt(#define CC "gcc"). Their settings are overruled by identically named environment variables. If only bf(C) files are compiled then tt(#define CXX) can be omitted; itb(#define CXXFLAGS "--std=c++20 -Wall -O2") bf(C++) compiler options to use (here showing the default options). When the bf(C) compiler is used, use tt(#define CFLAGS) rather than tt(CXXFLAGS). Their settings are overruled by identically named environment variables. If only bf(C) files are compiled then tt(#define CXXFLAGS) can be omitted; itb(//#define DEFCOM "...") a tt(DEFCOM) directive may be added to the tt(icmconf) file (the bf(icmstart)(1) script can do this for you). It can be specified as: verb( #define DEFCOM "program" ) in which case tt(icmbuild) does program maintenance, or as verb( #define DEFCOM "library" ) in which case tt(icmbuild) does library maintenance.; itb(//#define ICM_DEP "-V go") the existence and implied existence of tt(USE_ALL) files (see the description of the tt(USE_ALL) directive), as well as the correct ages of precompiled headers can be checked by tt(icmake's) support program tt(icm_dep). By default tt(icm_dep) is called with the shown default arguments. If tt(icm_dep) should not be called define tt(ICM_DEP) as an empty string (tt("")). bf(Icmake)(1)'s man-page contains a separate section about the tt(icm_dep) support program; itb(//#define IH ".ih") the extension used for internal header files. See tt(#define PRECOMP) below. If tt(PRECOMP) is specified ttIH) must also be specified; itb(//#define LDFLAGS "") linker options to use. By default no options are passed to the linker. Its setting is overruled by an identically named environment variable; itb(//#define LIBRARY "modules") by defining this directive a local library is constructed. When a binary program is built it is linked against this library rather than to the individual object modules. If a library instead of a program must be constructed (see also the tt(DEFCOM) directive), then the tt(LIBRARY) directive specifies the library's base name (without the tt(lib) prefix and without the tt(.a) extension). In that case source files are expected in sub-directories of the project's main directory (i.e., the directory containing tt(icmconf)). In that case avoid having source and header files in the project's main directory. Instead, move such files to a separate sub-directory; itb(//#define MAIN "main.cc") the source file in which the tt(int main) function is defined. This directive is required when doing program (rather than library) maintenance. Note: if source files are located in the project's main directory but library maintenance is intended (e.g., by specifying tt(#define DEFCOM library)) then define tt(MAIN) to specify a pseudo main source, whose base name is the base name of the header file in the project's main directory. This, however, is considered a kludge, and should be avoided by moving those source and header files to a separate sub-directory; itb(//#define NO_PRECOMP_WARNING") when tt(PRECOMP) is defined (see below) a warning is issued when a class-directory does not contain a tt(IH) file. Such warnings are suppressed by defining tt(NO_PRECOMP_WARNING). This option is only considered when tt(PRECOMP) has been defined; itb(#define OBJ_EXT ".o") this directive specifies the extension of object modules created by the compiler; itb(//#define PRECOMP "-x c++-header") define this directive to construct precompiled headers (in which case the tt(IH)) directive must also have been specified). Dependencies between (precompiled) headers are automatically considered. Existing precompiled headers are removed by tt(icmbuild cleangch) (or tt(icmbuild clean). When source files of other languages are compiled the tt(PRECOMP's -x) argument must be adapted to those languages; itb(//#define REFRESH) define tt(REFRESH) to relink the binary program when tt(icmbuild program) is called, even though no file was (re)compiled. This is useful when the program links to external libraries which were updated separately from the currrent project; itb(//#define SHARED) this directive is only interpreted when tt(LIBRARY) is also specified. If defined a shared library (extension tt(.so*)) is built in addition to a static library (extension tt(.a)); The shared library receives tt(VERSION) as its version number while soft links using tt(VERSION)'s (see below) major version number an no version number are also made available. E.g., if tt(VERSION) is defined as tt(1.02.03) and tt(#define LIBRARY "demo") then the shared library becomes tt(libdemo.so.1.02.03), with tt(libdemo.so.1) soft-linking to it, and tt(libdemo.so) soft-linking to tt(libdemo.so.1); itb(//#define SHAREDREQ "") when creating a shared library tt(SHAREDREQ) specifies the names of libraries and library paths that are required by the constructed shared library itself. E.g., if a library is found in tt(/usr/lib/special), assuming that the name of the required library is tt(libspecial.so), then use the specification tt(#define SHAREDREQ "-L/usr/lib/special -lspecial"). The tt(/lib) and tt(/usr/lib) paths are usually automatically visited by the linker and do not have the be specified. This directive is required (possibly as an empty string) if tt(SHARED) is defined; itb(#define SOURCES "*.cc") the pattern to locate sources in directories; itb(#define TMP_DIR "tmp") the directory in which intermediate results are stored. To avoid cross-device communications it's probably best to define tt(TMP_DIR) as a sub-directory of the project's main directory; itb(//#define USE_ALL "a") when defining this directive tt(icmbuild) looks for directories containing files having the names defined by the tt(USE_ALL) specification. All source files in those directories as well as all source files in directories that (recursively) depend on the set of directories under consideration are recompiled, after which the tt(USE_ALL) files are removed; itb(//#define USE_ECHO ON) when defined as tt(ON) (rather than tt(OFF)) (system) commands executed by tt(icmbuild) are echoed; itb(//#define USE_VERSION) when defined (it is defined by default) a file tt(VERSION) is read by tt(icmconf) to determine the program's or library's version, and the project's release years. The file tt(VERSION) must be available in the project's main directory and should contain lines like these: verb( VERSION=9.03.00 YEARS=1992-2020 ) ) 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. By default they're all commented out. itemization( itb(//#define PARSER_DIR "") the sub-directory containing the parser's specification file. If the tt(PARSER_DIR) directory is specified then all other directives in this section must also be specified; 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 is created; itb(//#define PARSFLAGS "-V") the flags that are used 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 (used by tt(icmbuild) when checking the timestamps of parser specification file(s)); itb(//#define PARSSPEC "grammar") the name of the parser specification file. This file is expected in the directory specified by the tt(PARSER_DIR) directive. ) 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. By default they're all commented out. itemization( itb(#define SCANNER_DIR "") the subdirectory containing the scanner's specification file. If the tt(SCANNER_DIR) directory is specified then all other directives in this section must also be specified; 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 is created. By default no additional specification files are used; itb(#define SCANFLAGS "") the flags that are used 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) when checking the timestamps of scanner specification file(s)). itb(#define SCANSPEC "lexer") the name of the lexical scanner specification file. This file is expected in the directory specified by the tt(SCANNER_DIR) directive. ) manpagefiles() The mentioned paths are sugestive only and may be installation dependent: itemization( itb(/usr/share/icmake/CLASSES): example of an bf(icmconf) tt(CLASSES) file; itb(/usr/share/icmake/icmconf): default (skeleton) bf(icmbuild) resource files, like tt(main.cc, usage.cc), etc.; itb(/etc/icmake): directory containing the default system-wide bf(icmstart)(1) configuration file; itb($HOME/.icmake): optional user-defined directory containing user-defined specifications overruling the system-wide definitions. This directory is the proper location for a file tt(AUTHOR) defining the tt(AUTHOR) directive with the user's name. E.g., my tt(.icmake/AUTHOR) file contains: verbinclude(/home/frank/.icmake/AUTHOR) ) manpageseealso() bf(icmake)(1), bf(icmbuild)(1), bf(icmstart)(1), bf(icmstart.rc)(7). manpagebugs() bf(icmbuild)(1) ends, displaying a fatal error message, if the current working directory does not contain a file tt(icmconf). includefile(trailer.inc) icmake-10.03.00/doc/manpage/filesystem.inc0000644000175000017500000001574514204126313017214 0ustar frankfrank bf(FILESYSTEM FUNCTIONS): itemization( itt(string chdir([int check,] string dir))nl() changes the script's working directory to tt(dir) (which may be specified as absolute or relative to the script's current working directory). The first argument is optional: if omitted and changing the working directory fails then the icm()-script ends with exit value 1; by specifying tt(P_NOCHECK) the function won't terminate the script but merely returns the script's current working directory. The script's working directory after completing the change-dir request is returned as an absolute path, ending in a `/' directory separator. Use tt(chdir(".")) to merely obtain the current working directory; use tt(chdir("")) to change-dir to the script's startup working directory; itt(int exists(string file))nl() if tt(file) exists, 1 is returned, otherwise 0 is returned; itt(list fgets(string file, list offset))nl() the next line found at offset value tt(offset[3]) is read from tt(file). Pass an empty list to tt(fgets) to read tt(file) from its beginning. The returned list has four elements: quote( itemization( it() its first element ([0]) contains the read line (without the line's tt(\n) line terminator); it() its second element ([1]) contains the line's tt(\n) line terminator (or an empty string if the line was not terminated by a tt(\n)); it() its third element ([2]) contains the string tt(OK) if the line was successfully read and tt(FAIL) if reading from file failed; it() its fourth element ([3]) contains the offset beyond the last read byte. )) To read multiple lines, pass the returned list as argument to tt(fgets): verb( list ret; while (ret = fgets("filename", ret)) process(ret); ) Be careful not to define tt(list ret) in tt(while's) condition, as this will reset tt(ret) to an empty list at each iteration; itt(int fprintf(string filename, argument(s)))nl() appends all (comma or left-shift (insertion) operator separated) arguments to the file tt(filename). Returns the number of printed arguments. If the first argument (following tt(filename)) contains placeholders (tt(%1, %2, ... %n)) then that argument is considered a format string (see also the function tt(strformat) in the string functions section for additional information about format strings). Some examples: verb( fprintf("out", "hello", "world", '\n'); fprintf << "out" << "hello" << "world" << '\n'; fprintf("out", "%1 %2\n", "hello", "world"); // 1 fprintf << "out" << "hello" << ' ' << "world" << '\n'; // 2 fprintf << "out" << "%1 %2\n" << "hello" << "world"; // 3 ) When writing statement 1 using insertion operators (cf. the expression statement description in section tt(FLOW CONTROL)) statement 2 would normally be encountered, although statement 3, using the format string, would still be accepted; itt(string getch())nl() returns the next pressed key as a string (pressing the `Enter'-key is not required). The pressed key is not echoed. If the key should be echoed use, e.g., tt(printf(getch())); itt(string gets())nl() returns the next line read from the keyboard as a tt(string). The line contains all entered characters until the `Enter'-key was pressed. The `Enter'-key's value itself is not stored in the returned string; itt(list makelist([int type = O_FILE], string mask))nl() the argument tt(type) is optional, in which case tt(O_FILE) is used. tt(Makelist) returns a list of all tt(type) file-system entries matching tt(mask). E.g., tt(makelist("*.c")) returns a list containing all files ending in tt(.c). For tt(type) one of the following set of values can be used to obtain a more specific selection of directory entries: table()(ll)( rowline() row(cell(symbol)cell(meaning)) rowline() row(cell(O_ALL)cell(obtain all directory entries)) row(cell(O_DIR)cell(obtain all directories, including . and ..)) row(cell(O_FILE)cell(obtain a list of regular files)) row(cell(O_SUBDIR)cell(obtain all directories except for . and ..)) rowline() ) In Unix-type operating systems the pattern tt(*) does not match entries starting with a dot (hidden entries). To obtain a list of such entries use the pattern tt(.*); itt(list makelist([int type = O_FILE,] string mask, {newer,older,younger}, string comparefile))nl() the (optional) parameter tt(type) may be specified as in the previous variant of tt(makelist). The third parameter must be either tt(newer) (or tt(younger)) or tt(older). A list of all file-system entries matching mask which are, resp., newer or older than a provided tt(comparefile) is returned. Note that tt(newer) and tt(younger) are operators, not strings; itt(int printf(argument(s)))nl() the function's (comma or left-shift (insertion) operator separated) arguments are written to the standard output file (cf. the expression statement description in section tt(FLOW CONTROL) and this section's description of the tt(fprintf) function). If the first argument contains tt(%1, %2, ... %n) specifications then it's considered a format string (see also the function tt(strformat) in the tt(STRING FUNCTIONS) section for additional information about format strings). Like tt(fprintf printf) returns the number of printed arguments; itt(list stat([int check,] string entry))nl() Returns bf(stat)(2) information of directory entry tt(entry) as a list. The first argument is optional: if omitted and calling the system tt(stat) function fails then the icm()-script ends with exit value 1; by specifying tt(P_NOCHECK) the function won't terminate the script but returns the return value (-1) of the system tt(stat) function. The returned list has two elements: its first element ([0]) holds the entry's attributes. Attributes are returned as the file type and mode of the specified file (cf. bf(stat)(2) and bf(inode)(7)). E.g., verb( S_IRUSR - owner has read permission S_IWUSR - owner has write permission S_IXUSR - owner has execute permission S_IFSOCK - socket S_IFLNK - symbolic link S_IFREG - regular file S_IFBLK - block device S_IFDIR - directory S_IFCHR - character device S_IFIFO - FIFO ) its second element ([1]) contains the entry's size in bytes. If tt(P_NOCHECK) was specified and 'entry' doesn't exists then a list having one element is returned containing -1. ) icmake-10.03.00/doc/manpage/icmstart.rc.yo0000644000175000017500000001155314204126313017130 0ustar frankfrankincludefile(release.yo) htmlbodyopt(text)(#27408B) htmlbodyopt(bgcolor)(#FFFAF0) whenhtml(mailto(Frank B. Brokken: f.b.brokken@rug.nl)) DEFINEMACRO(sop)(3)(\ it() bf(-ARG1) ARG2 nl()ARG3\ ) DEFINEMACRO(itt)(1)(\ it()tt(ARG1)\ ) DEFINEMACRO(itb)(1)(\ it()bf(ARG1)nl()\ ) DELETEMACRO(tt) DEFINEMACRO(tt)(1)(em(ARG1)) COMMENT( man-request, section, date, distribution file, general name) manpage(icmstart.rc)(7)(_CurYrs_)(icmake._CurVers_) (icmstart resource file) COMMENT( man-request, larger title ) manpagename(icmstart.rc)(The icmstart(1) resource file) manpagedescription() The bf(icmstart.rc) file specifies files that are installed by bf(icmstart)(1). A default bf(icmstart.rc) is found in tt(/etc/icmake/icmstart.rc), but if tt($HOME/.icmake/icmstart.rc) exists then the latter file is used by bf(icmstart)(1). tt($HOME/.icmake/icmstart.rc) in turn is overruled by specifying a tt(-c) option when invoking bf(icmstart)(1). The default resource file contains the following specifications, preparing for the construction of a bf(C++) program using bf(icmbuild)(1): verb( CLASSES icmconf P main.cc P main.ih P usage.cc P version.cc P ? scanner P ? parser ) 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() an optional installation mode followed by a source-destination specification. ) manpagesection(INSTALLATION MODE) An installation mode consists of a combination of: itemization( it() either a tt(P) (don't install with tt(icmstart xxx library)) or an tt(L) (don't install with tt(icmstart xxx program)); it() a tt(D), indicating that the source must also be installed by default, i.e., if neither `program' or `library' was specified as second argument; it() a tt(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 tt( P, L, D,) or tt(b) character a space delimited optional tt(?) may be specified. If specified the installation of the file or directory must be confirmed by the user. ) manpagesection(SOURCE-DESTINATION SPECIFICATIONS) The following source-destination specifications can be used in an tt(icmstart.rc) file (using tt(skeletons) below to refer to tt(icmstart's) skeleton files directory): itemization( it() tt(source)nl() a file named tt(source) must exist in tt(skeletons). It is installed in the destination directory tt(`dest') that's specified when calling bf(icmstart)(1). Example: verb( CLASSES ) tt(skeletons/CLASSES) is installed as tt(dest/CLASSES); it() tt(pathspec)nl() if `pathspec' does not begin with a slash it must exist in tt(skeletons). It is installed as `pathspec' in the destination directory specified when calling bf(icmstart)(1). Example: verb( dir/file ) tt(skeletons/file) is installed as tt(dest/dir/file); it() tt(/pathspec) or tt(~/pathspec)nl() 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 # skeletons/CLASSES is installed as # dest/CLASSES dir/file dir/file # skeletons/dir/file is installed as # dest/dir/file ~/.icmake/file .icmake/file # $HOME/.icmake/file is installed as # dest/.icmake/file ) Icmstart converts destination specifications to absolute paths. If these absolute paths do not begin with tt(dest's) absolute path then an error message is displayed and bf(icmstart) ends. manpagefiles() The mentioned paths are sugestive only and may be installation dependent: itemization( it() bf(/usr/share/icmake/icmconf): example of an bf(icmbuild) configuration file; it() bf(/usr/share/icmake/CLASSES): example of an bf(icmbuild) tt(CLASSES) file; it() bf(/usr/share/icmake/icmstart.rc): default skeleton resource file. ) manpageseealso() bf(icmake)(1), bf(icmbuild)(1), bf(icmconf)(7), bf(icmstart)(1) manpagebugs() None reported includefile(trailer.inc) icmake-10.03.00/doc/manpage/icmake.yo0000644000175000017500000006041514204126313016131 0ustar frankfrankincludefile(release.yo) htmlbodyopt(text)(#27408B) htmlbodyopt(bgcolor)(#FFFAF0) whenhtml(mailto(Frank B. Brokken: f.b.brokken@rug.nl)) DEFINEMACRO(lsvoption)(3)(\ bf(--ARG1)=tt(ARG3) (bf(-ARG2))\ ) DEFINEMACRO(lsoption)(2)(\ bf(--ARG1) (bf(-ARG2))\ ) DEFINEMACRO(lvoption)(2)(\ bf(--ARG1)=tt(ARG2)\ ) DEFINEMACRO(loption)(1)(\ bf(--ARG1)\ ) DEFINEMACRO(svoption)(2)(\ bf(-ARG1) tt(ARG2)\ ) DEFINEMACRO(soption)(1)(\ bf(-ARG1)\ ) DEFINEMACRO(itt)(1)(\ it()tt(ARG1)\ ) DEFINEMACRO(itb)(1)(\ it()bf(ARG1)nl()\ ) DEFINEMACRO(icm)(0)(bf(icmake)) DEFINEMACRO(Icm)(0)(bf(Icmake)) DELETEMACRO(tt) DEFINEMACRO(tt)(1)(em(ARG1)) COMMENT( man-request, section, date, distribution file, general name) manpage(icmake)(1)(_CurYrs_)(icmake._CurVers_) (A program maintenance utility) COMMENT( man-request, larger title ) manpagename(icmake)(A program maintenance (em(make)) utility using a bf(C)-like grammar) COMMENT( all other: add after () ) manpagesynopsis() icm() option(s) tt([source [dest]]) [args] manpagedescription() Icm()(1) is a generic tool handling program maintenance that can be used as an alternative for bf(make)(1). It's a generic tool in that tt(icmake)-scripts, written in a language closely resembling the bf(C) programming language, can perform tasks that are traditionally the domain of scripting languages. Icm() allows programmers to use a programming language (closely resembling the well-known bf(C)-programming language) to define the actions that are required for (complex) program maintenance. For this, icm() offers various special operators as well as a set of support functions that have shown their usefulness in program maintenance. Although icm() scripts can be written from scratch, often the required activities are highly comparable. This observation resulted in the construction of two icm() scripts, which are part of the standard icm() distribution: bf(icmstart)(1), initializing a directory for program development and bf(icmbuild)(1), handling the actual program maintenance. By default both scripts are tailored to initializing and maintaining bf(C++) programs (or, after minimal adaptation, bf(C) programs), but can easily be adapted to other programming languages. Both bf(icmstart) and bf(icmbuild) can be run without explicitly calling icm(). This man-page covers icm() (the program), and its support programs. Refer to the bf(icmstart)(1)) man-page for information about how a directory can be initialized (created) in which (by default) a bf(C++) or bf(C) program can be developed and refer to the bf(icmbuild)(1) man-page for information about how bf(icmbuild) can be used to handle program maintenance. Refer to the bv(icmscript)(7) man-page for a description of the syntax and facilities offered by bf(icmake's) scripting language. Icm() does not offer an em(Integrated Development Environment) (IDE). Icm() merely performs tasks for which scripts can be written, and only a minimal set of pre-defined scripts (bf(icmstart) and bf(icmbuild)) that have shown their usefulness when developing and maintaining programs are included in bf(icmake's) distribution. In its standard activation modes, icm() uses the following support programs: itemization( itt(icm-pp) to pre-process the icmake file itt(icm-comp) to byte-code compile the icm() file(s) it()tt(icm-dep) to handle class-dependencies (see the bf(ICM-DEP) section in this man-page for more information about tt(icm-dep)). it()tt(icm-exec) to execute the byte-code file ) In addition, primarily used for illustration, education, and debugging, the program tt(icmun) is available to disassemble compiled icm() byte-code (.bim) files (`tt(bim-files)'). bf(Icmun) is not installed in a standard tt(PATH) directory but in tt(icmake's) tt(lib) directory, which commonly is tt(/usr/lib/icmake) (see also section bf(ICMUN) in this man-page). Traditional make-utilities recompile sources once header files are modified. When developing bf(C++) programs this is often not required, as adding new member functions to classes does not require you to recompile all source files of those classes. To handle class dependencies bf(icmbuld)(1) may optionally inspect class dependencies, (re)compiling sources of dependent classes when necessary. By default, class-dependencies are not interpreted, but they are when the tt(PRECOMP) and/or tt(USE_ALL) defines, found in the file tt(icmconf) file, are activated. Refer to the bf(icmconf)(7) man-page for details. This manpage describes icm()'s options in the next section, followed by two sections covering the support programs itemization( itb(ICM-DEP) - the bf(icm-dep) dependency analyzer; itb(ICMUN) - bf(icmake's) unassembler. ) Refer to the bf(icmscript)(7) man-page for a description of bf(icmake's) bf(C)-like scripting language. manpageoptions() Where available, single letter options are listed between parentheses beyond their associated long-option variants. Icm() defines em(action) options and em(non-action) options. The first action option that is encountered is used. The following action options write some text to the standard output stream, whereafter icm() ends: itemization( it() lsoption(about)(a)nl() Shows some information about icm(); it() lsoption(help)(h)nl() Provides usage info, returning 0 to the operating system. Usage information is also provided if icm() is started without providing arguments. In that case 1 is returned to the operating system; it() lsoption(version)(v)nl() Displays icm()'s version. ) The remaining action options require additional options and/or arguments, and most of them process icm() source- or bim-files. Several of these action options write output files. By default these files are located in the same directories as the source files' directories. The remaining action options are: itemization( it() lsoption(compile)(c) tt([options] source [bim-file]) nl() The tt(source) file is first pre-processed (by tt(icm-pp)) whereafter the pre-processed file is compiled (by tt(icm-comp)), producing a tt(bim-file). If the tt(bim-file) name is not specified then tt(source's) base-name, receiving extension tt(.bim), is used.nl() If the bim-file exists and is younger than tt(source) then tt(source) is not compiled.nl() With this option pre-processor symbol-defining options can be used: symbols having values 1 which can be used in tt(source). E.g., when issuing the command verb( icmake -c -d one --define two source dest.bim ) then icm() compiles tt(source), defines the pre-processor symbols tt(one) and tt(two) (each having value 1), and produces the bim-file tt(dest.bim). Note that instead of using long options tt(--define) short options tt(-d) can also be used.nl() If tt(source) is a previously pre-processed file then option tt(-P) must be specified to compile it. E.g., verb( icmake -c -P source dest.bim ) it() lsoption(dependencies)(d) tt([options] action)nl() Icm() calls bf(icm-dep) to determine the dependencies among classes. All options and arguments following this option are forwarded to bf(icm-dep). Refer to the bf(ICM-DEP) section of this man-page for information about tt(icm-dep); it() lsoption(execute)(e) tt([option] bim-file [arguments])nl() Executes the bim-file, specified as icm()'s first file argument. Before the tt(bim-file) option tt(--no-version-check) (or the equivalent short option tt(-n)) can be specified to allow mismatches between icm()'s main version and the icm() version that was used to compile the bim-file. See also the description of the tt(--no-version-check) option at the description of the non-action options below.nl() Options and arguments specified beyond the tt(bim-file) are forwarded as arguments to the tt(bim-file's main) function (refer to the bf(icmscript)(7) man-page for details about how to write icm()-scripts); it() lsoption(force)(f) tt([options] source [bim-file]) nl() Acts like option tt(--compile), but compilation is always performed, even if the bim-file is up-to-date. As with tt(--compile), if tt(source) is a previously pre-processed file then option tt(-P) must be specified to compile it. E.g., verb( icmake -f -P source dest.bim ) it() lsoption(preprocess)(p) tt([options] source [pim-file]) nl() The file specified as first argument is pre-processed, producing a `tt(.pim)' file. If a second filename argument is provided then that file becomes the tt(.pim) file. If not specified, then the first filename, using the extension tt(.pim), is used. nl() With this option pre-processor symbol-defining options can be used: symbols having values 1 which can be used in tt(source). E.g., when issuing the command verb( icmake -p -d one --define two source dest.pim ) then icm() pre-processes tt(source), defines the pre-processor symbols tt(one) and tt(two) (each having value 1), and produces the pim-file tt(dest.pim). Note that instead of using long options tt(--define) short options tt(-d) can also be used; it() lsoption(source)(s) tt([options] source [arguments]) nl() Icm() uses tt(--compile) to compile the icm() source file specified as first argument (constructing the default bim-file if necessary) and then uses tt(--execute) to execute the bim-file, forwarding any subsequent tt(arguments) as-is to the tt(bim-file's main) function.nl() With this option pre-processor options as well as the tt(--no-version-check) execute option can be used. When using the latter option it must follow the pre-processor options (if specified) and it must be preceded by tt(--execute) (or tt(-e)). E.g., when issuing the command verb( icmake -s -d one -en source ) then icm() first compiles tt(source), defining the pre-processor symbol tt(one), and then executes the bim-file, passing tt(--no-version-check) to tt(icm-exec); it() svoption(t)(tmpspec) tt([options] source [arguments]) nl() This option is intended for icm()-scripts although it can also be used in a command-line icm() call. Its argument tt(tmpspec) is either a single dot (as in tt(-t.)) in which case icm() determines the name of the bim-file in the directory icm() uses for temporary files (see option tt(--tmpdir) below), or it uses tt(tmpspec) as the filename to write the bim-file to (which file is also removed once the script's execution ends).nl() At the tt(options) pre-processor options as well as the tt(--no-version-check) execute option can be specified. When using the latter option it must follow the pre-processor options (if specified) and it must be preceded by tt(--execute) (or tt(-e)).nl() The argument tt(source) is the name of the icm() script to process, and tt(source) may optionally be followed by tt(arguments). Those arguments are forwarded as-is to the script's tt(main) function, where they appear as elements of its tt(list argv) parameter. Rather than using the explicit command-line call tt(icmake -t. ...) the tt(-t) option is normally used in the first line of an (executable) (so usually tt(chmod +x source) has been specified before calling the script), where its pre-processor and execute options can also be specified. For example after writing the executable script tt(hello): verb( #!/usr/bin/icmake -t. int main(int argc, list argv) { printf << "hello: " << argv << '\n'; } ) it can be called as tt(hello one -two --three), producing output like: verb( hello: /tmp/10434.bim.MKqvAb one -two --three ) (the name following tt(hello:) will be different, as it is the name of the compiled temporary bim-file). If icm() pre-process and/or execute options are required they can be specified in the first line, following the tt(-t) option. E.g., verb( #!/usr/bin/icmake -t. -d one --define two ) it() lsoption(unassemble)(u)nl() The file specified as first argument is an icm() bim-file, which is unassembled. Refer to the bf(icmun) section further down this man-page for more information about tt(icmun); The program tt(icmun) unassembles bim-files. This program also supports the tt(--no-version-check) (tt(-n)) option. ) Finally, there are some (non-action) options that can be specified before specifying action options: itemization( it() lsoption(no-process)(N)nl() Implies option tt(--verbose). This option may precede options tt(-d, -e, -s) and tt(-t) (either as two separate options or by `gluing' both options together, like tt(-Ne)). When specified, the actions are not activated, but the command(s) that would have been used are shown to the standard output; it() lsoption(no-version-check)(n)nl() This option is available with the action options tt(--execute, --source, --unassemble), and tt(-t). When specified the main versions of icm-bim files and icm() itself may differ. This option should normally not be used, and was added for development purposes only; it() lsvoption(tmpdir)(T)(directory)nl() The specified directory is used for storing temporary files. E.g., when compiling an icm() script, the output of icm()'s preprocessor is written to a temporary file which is removed when icm() ends. By default tt(/tmp) is used, unless tt(/tmp) is not a writable directory, in which case the current user's tt($HOME) directory is used; it() lsoption(verbose)(V)nl() The child processes and their arguments are written to the standard output stream before they are called. This option may precede options tt(-d, -e, -s) and tt(-t) (either as two separate options or by `gluing' both options together, like tt(-Ve)). ) manpagesection(ICM-DEP) bf(Icm-dep) is a support program called by icm() to determine source- and precompiled-header file dependencies. bf(Icm-dep) can be used for software projects that are developed as described in the url(C++ Annotations)(https://fbb-git.gitlab.io/cppannotations/), section tt(Header file organization) in chapter tt(Classes). For those projects classes are developed in their own directories, which are direct sub-directory of the project's main program directory. Their class interfaces are provided in class-header files bearing the names of the class-directories, and all headers that are required by the class's sources are declared in a separate em(internal header) filed, commonly having extensions tt(.ih). Icm() automatically calls bf(icm-dep)d when tt(USE_ALL) or tt(PRECOMP) is specified in tt(icmconf) files. By default it is called with arguments tt(-V go). The tt(#define ICM_DEP) define-specification in the tt(icmconf) file can be used to specify a different set of options. When bf(icm-dep) is activated (i.e., its argument tt(go) is specified) then bf(icm-dep) determines directory dependencies, touching all files in directories that depend on directories containing modified files, and/or removing precompiled headers if they include headers from other directories that were modified. By providing another argument than tt(go) bf(icm-dep) performs a `dry run': it analyzes dependencies, but it won't remove or touch files. Options of bf(icm-dep) may be specified immediately following icm()'s tt(--dependencies) option. bf(Icm-dep) supports the following options: itemization( it() lsvoption(classes)(c)(filename)nl() By default, bf(icm-dep) inspects dependencies of the directories mentioned in the file tt(CLASSES). Furthermore, if the bf(icmconf)(7) file specifies tt(PARSER_DIR) and tt(SCANNER_DIR) then those directories are also considered. Use this option to specify the file containing the names of directories to be inspected by bf(icm-dep). it() lsoption(help)(h)nl() bf(Icm-dep) writes a summary of its usage to the standard output and terminates, returning 0 to the operating system; it() lsvoption(icmconf)(i)(filename)nl() By default bf(icm-dep) inspects the content of tt(icmconf) files, This option is used if instead of tt(icmconf) another file should be inspected; it() lsvoption(mainih)(m)(mainheader)nl() In the tt(icmconf) file the tt(#define IH) parameter is used to specify the suffix of class header files that should be precompiled, assuming that their filenames are equal to the names of the directories which are listed in the tt(CLASSES) file. But tt(CLASSES) does not specify the name of the program's top-level directory. This option is used to specify the name of the top-level header file to precompile. By default tt(main.ih) is used; it() loption(gch)nl() If tt(icmconf) files contain tt(#define PRECOMP) specifications then bf(icm-dep) checks whether precompiled headers must be refreshed. If an tt(icmconf) file does not contain a tt(#define PRECOMP) specifications, but precompiled headers should nonetheless be inspected, then option tt(--gch) can be specified; it() loption(no-gch)nl() If tt(icmconf) files contain tt(#define PRECOMP) specifications but bf(icm-dep) should not check whether precompiled headers must be refreshed then option tt(--no-gch) should be specified; it() loption(no-use-all)nl() If tt(icmconf) files contain tt(#define USE_ALL "filename") specifications then all source files in directories containing files named tt(filename) are recompiled. When specifying this option inspections of tt(`USE_ALL') specifications is suppressed; it() lvoption(use-all)(filename)nl() If tt(icmconf) files contain tt(#define USE_ALL "filename") specifications then all source files in directories containing files named tt(filename) are recompiled. Specify this option to inspect the presence of tt(filename) files if tt(icmconf) does not contain a tt(`USE_ALL') specification; it() lsoption(verbose)(V)nl() This option can be specified multiple times. The number of times it is specified determines bf(icm-dep's) verbosity. If not used then bf(icm-dep) silently performs its duties. If specified once, then bf(icm-dep) reports to the standard output what actions it performs; if specified twice it also reports non-default options and automatically included directories; if specified three times it also reports class dependencies; if specified more often it reports what files it encountered and what decision it would make when tt(go) would be specified; it() lsoption(version)(v)nl() bf(Icm-dep) reports its version number to the standard output and terminates, returning 0 to the operating system. ) As an example, for icm() itself the class dependencies, obtained using the option tt(-VVV) are shown as: verb( Direct class dependencies: -------------------------- uses: ------------ class: 1 2 3 4 -------------------------- . 1 x x x x options 2 x x handler 3 x x argoptions 4 x -------------------------- 1 2 3 4 -------------------------- Implied class dependencies: -------------------------- uses: ------------ class: 1 2 3 4 -------------------------- . 1 - x x x handler 2 - x x options 3 - x argoptions 4 - -------------------------- 1 2 3 4 -------------------------- ) The second table immediately shows that there are no circular dependencies: its lower triangle remains empty. manpagesection(icmun) The bf(icmun) support program expects one argument, a bim-file. It disassembles the binary file an shows the assembler instructions and the structure of the bim-file. Note that in standard installations bf(icmun) is not located in one of the directories of the tt(PATH) environment variable, but it is available in the tt(/usr/lib/icmake) directory, and the command tt(icmake -u bim-file) is normally used to unassemble the bim-file. As an illustration, assume the following script is compiled by icm() (e.g., by calling tt(icmake -c demo.im)): verb( void main() { printf("hello world"); } ) the resulting tt(demo.bim) file can be processed by bf(icmun) (e.g., calling tt(/usr/lib/icmake/icmun demo.bim). bf(Icmun) then writes the following to the standard output fle: verb( icmun by Frank B. Brokken (f.b.brokken@rug.nl) icmun V10.00.00 Copyright (c) GPL 1992-2021. NO WARRANTY. Binary file statistics: strings at offset 0x0025 variables at offset 0x0032 filename at offset 0x0032 code at offset 0x0014 first opcode at offset 0x0021 String constants dump: [0025 (0000)] "" [0026 (0001)] "hello world" Disassembled code: [0014] 06 01 00 push string "hello world" [0017] 05 01 00 push int 0001 [001a] 1b 1d callrss 1d (printf) [001c] 1c 02 add sp, 02 [001e] 04 push int 0 [001f] 24 pop reg [0020] 23 ret [0021] 21 14 00 call [0014] [0024] 1d exit ) Offsets are shown using the hexadecimal number system and are absolute byte offsets in the bim-file. The string constants dump also shows, between parentheses, the offsets of the individual strings relative to the beginning of the strings section. The disassembled code shows the opcodes of the instructions of the compiled icmake source files. If opcodes use arguments then these argument values are shown following their opcodes. Each opcode line ends by showing the opcode's mnemonic plus (if applicable) the nature of its argument. manpagefiles() The mentioned paths are the ones that are used in the source distribution and are used by the Debian Linux distribution. However, they are sugestive only and may have been configured differently: itemization( it() bf(/usr/bin/icmake): the main icm() program; it() bf(/usr/bin/icmbuild): the wrapper program around the tt(icmbuild) script handling standard program maintenance; it() bf(/usr/bin/icmstart): an icm()-script that is can be used to create the startup-files of new projects; it() bf(/usr/lib/icmake/icm-comp): the compiler called by icm(); it() bf(/usr/lib/icmake/icm-exec): the byte-code interpreter called by icm(); it() bf(/usr/lib/icmake/icm-dep): the support program handling class- and precompiled header dependencies; it() bf(/usr/lib/icmake/icm-pp): the preprocessor called by icm(); it() bf(/usr/lib/icmake/icmun): the icm() unassembler. ) manpagesection(EXAMPLES) The distribution (usually in tt(/usr/share/doc/icmake)) contains a directory tt(examples) containing additional examples of icm() script. The tt(icmstart) script is an icm() script as is tt(/usr/lib/icmake/icmbuild), which is called by the tt(/usr/bin/icmbuild) program. See also the bf(EXAMPLE) section in the bf(icmscript)(7) man-page. manpageseealso() bf(chmod)(1), bf(icmbuild)(1), bf(icmconf)(7), bf(icmscript)(7), bf(icmstart)(1), bf(icmstart.rc)(7), bf(make)(1) manpagebugs() Be advised that starting icm() version 10.00.00 itemization( it() the tt(--summary) (tt(-F)) option has been discontinued; it() the tt(--source) short option tt(-i) has been replaced by tt(-s); it() long option tt(--icm-dep) has been replaced by tt(--dependencies); ) includefile(trailer.inc) icmake-10.03.00/doc/manpage/string.inc0000644000175000017500000001244614204126313016331 0ustar frankfrank bf(STRING FUNCTIONS:) itemization( itt(int ascii(string str))nl() returns the first character of tt(str) as an in: tt(ascii("A")) returns 65; itt(string change_base(string file, string base))nl() returns tt(file) whose base name is changed into tt(base): tt(change_base("/path/demo.im", "out")) returns tt("/path/out.im"); itt(string change_ext(string file, string ext))nl() returns tt(file) whose extension is changed into tt(ext): tt(change_ext("source.cc", "o")) returns tt("source.o"). The extension of the returned tt(string) is separated from the file's base name by a single dot (e.g., tt(change_ext("source.", ".cc")) returns tt("source.cc")); itt(string change_path(string file, string path))nl() return tt(file) whose path is changed into tt(path): tt(change_path("tmp/binary", "/usr/bin")) returns tt("/usr/bin/binary"). To remove the path specify tt(path) as an empty string; itt(string element(int index, string var))nl() acts identically to the index operator: refer to the index (tt([])) operator in section bf(OPERATORS); itt(string get_base(string file))nl() returns the base name of tt(file). The base name is the file without its path prefix and without its extension. The extension is all information starting at the final dot in the filename. If no final dot is found, the file name is the base name. E.g., the base name of tt(a.b) equals tt(a), the base name of tt(a.b.c) equals tt(a.b), the base name of tt(a/b/c) equals tt(c); itt(string get_dext(string file))nl() returns the extension of tt(file), including the separating dot (hence the tt(d) in tt(dext)). The extension is all information starting at the filename's final dot. If tt(file) does not have a final dot then an empty string is returned; itt(string get_ext(string file))nl() returns the extension of tt(file), without the separating dot. The extension are all characters in tt(file) starting at tt(file's) final dot. If no final dot is found, an empty string is returned; itt(string get_path(string file))nl() returns tt(file's) path-prefix. The path prefix is all information up to (and including) the final directory separator (which is, depending on the operating system, a forward slash or a backslash). If tt(file) does not contain a path-element, then an empty string is returned; itt(string resize(string str, int newlength)) returns a copy of string tt(str), resized to tt(newlength) characters. If tt(newlength) is negative then an empty string is returned, if tt(newlength) exceeds tt(str's) length then the newly added characters are initialized to blank spaces; 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 strfind(string haystack, string needle))nl() returns index in tt(haystack) where tt(needle) is found, or -1 if tt(needle) is not found in tt(haystack); itt(string strformat(string format, argument(s)))nl() returns a string constructed from the tt(format) string containing placeholders %1 .. %2 to refer to arguments following the format string. The specification %1 refers to the first argument following the format string. If fewer arguments than tt(n) are provided then additional 0 arguments are provided by icm(). Example:nl() verb( void main() { string s2 = = strformat("%1 %2 %1\n", 10, 20); printf("s2 = ", s2); // shows: s2 = 10 20 10 } ) itt(int strlen(string str))nl() returns the number of characters in tt(str) (not counting the terminating NUL-character); itt(string strlwr(string str))nl() returns a lower-case duplicate of tt(str); itt(list strtok(string str, string separators))nl() returns a list containing all substrings of tt(str) separated by one or more (consecutive) characters in tt(separators): tt(strtok("hello icmake's+world", " +")) returns a list containing the three strings tt("hello"), tt("icmake's"), and tt("world"); itt(string strupr(string str))nl() returns an upper-case duplicate of tt(str). itt(string substr(string text, int offset, int count))nl() returns a substring of tt(text), starting at tt(offset), consisting of tt(count) characters. If tt(offset) exceeds (or equals) the string's length or if tt(count <= 0), then an empty string is returned. If tt(offset) is less than 0 then tt(offset = 0) is used. If tt(offset + count) exceeds tt(text's) length then the available substring starting at tt(text[offset]) is returned (which may be empty); itt(string trim(string str))nl() returns a copy of tt(str) without leading and trailing white spaces; itt(string trimleft(string str))nl() returns a copy of tt(str) without leading white spaces; itt(string trimright(string str))nl() Returns a copy of tt(str) without trailing white spaces. ) icmake-10.03.00/doc/manpage/system.inc0000644000175000017500000001172714204126313016350 0ustar frankfrank bf(SYSTEM FUNCTIONS:) itemization( itt(void arghead(string str))nl() support function of tt(exec()) (see also below at tt(exec())): defines the `argument head' that is used with tt(exec()). By default, the `argument head' is an empty string. The argument head is text that is prefixed to all tt(exec) arguments, like a directory in which provided arguments are found; itt(void argtail (string str))nl() support function of tt(exec()) (see also below at tt(exec())): defines the `argument tail' that is used with tt(exec()). By default, the `argument tail' is an empty string. The argument tail is text that is appended to all tt(exec) arguments, like the extensions of files that are passed as arguments to tt(exec); itt(cmdhead(string str))nl() support function of tt(exec()) (see also below at tt(exec())). Defines a `command head' that is used with tt(exec()). By default it is an empty string. It can be used to specify, e.g., compiler options when the arguments themselves are modified by tt(arghead) and tt(argtail). The tt(cmdhead) argument itself is not modified by tt(arghead) or tt(argtail); itt(cmdtail(string str))nl() support function of tt(exec()) (see also below at tt(exec())). Defines a `command tail that is used with tt(exec()). By default it is an empty string. It can be used to specify a final argument (not modified by tt(arghead) and tt(argtail)); itt(list eval(string str))nl() this function can be used instead of the backtick operator (cf. section tt(OPERATORS)). The example provided with the backtick operator could therefore also have been written like this: verb( printf << eval("ls"); // prints the elements in the current // directory ) itt(int exec([int check,] string cmd, argument(s)))nl() Executes the command tt(cmd) with (optional) arguments. Each argument is prefixed by tt(arghead) and postfixed by tt(argtail). Note that no blanks are inserted between tt(arghead), argument(s), and tt(argtail). The thus modified arguments are concatenated, separated by single blanks. tt(Cmdhead) is inserted between tt(cmd) and the first argument (delimited by single blanks) and tt(cmdtail) is appended to the arguments, separated by a single blank. tt(PATH) is searched to locate tt(cmd). 0 is returned. The first argument is optional: if omitted and the command does not return 0 the icm() script terminates. By specifying tt(P_NOCHECK) tt(exec) won't terminate the script but returns the called command's exit status, or tt(0x7f00) if the command wasn't found. The remaining arguments may be ints, strings or lists. Int and list arguments are cast to strings. Their string representations are then appended to tt(cmd); itt(int execute([int checking,] string cmd, string cmdhead, string arghead, argument(s), string argtail, string cmdtail))nl() Same functionality as the previous function, but the tt(cmdhead, arghead, argtail,) and tt(cmdtail) are explicitly specified (and are reset to empty strings after executing tt(cmd)); itt(exit(expression))nl() Ends the execution of an icm()-script. The tt(expression) must evaluate to an tt(int) value, which is used as the script's exit value; itt(list getenv(string envvar))nl() returns the value of environment variable tt(envvar) in a list containing two elements: if the first element ([0]) is tt("1") then the environment variable was defined; environment variables are of the form tt(variable=value). If element tt([0]) is tt("1") then the returned list's second element [1] holds the tt(value) part of the environment variable, which is empty if the environment variable is merely defined; itt(int getpid())nl() returns the process-id of the icmake byte code interpreter bf(icm-exec); itt(int putenv(string envvar))nl() adds or modifies tt(envvar) to the current icm()-script environment. Use the format: tt("VAR=value"). Use tt("VAR") to remove tt("VAR") from the environment. The function returns 0 unless tt(envvar) is empty, in which case 1 is returned; itt(int system([int check,] string command))nl() executes tt(command) using the bf(system)(3) function. The first argument is optional: if omitted and calling the bf(system)(3) function does not return 0 then the icm()-script ends with exit value 1; by specifying tt(P_NOCHECK) icm()'s tt(system) function won't terminate the script but returns the return value of the bf(system)(3) function (normally the executed command's exit value). The string tt(command) may use redirection and/or piping. ) icmake-10.03.00/doc/manpage/compile.im0000644000175000017500000000120214204126313016273 0ustar frankfrank void compile(string src) { exec("g++ -c " + src); // compile 'src' } void inspect(string src) { // get the obj-file's name: // only compile if necessary if (src younger change_ext(src, ".o")) compile(src); } int main() { // find all .cc source files list sources = makelist("*.cc"); for ( // visit all source files int idx = 0, end = listlen(sources); idx != end; ++idx ) inspect(sources[idx]); // compile if needed } icmake-10.03.00/doc/manpage/icmstart.yo0000644000175000017500000001770214204126313016527 0ustar frankfrankincludefile(release.yo) htmlbodyopt(text)(#27408B) htmlbodyopt(bgcolor)(#FFFAF0) whenhtml(mailto(Frank B. Brokken: f.b.brokken@rug.nl)) DEFINEMACRO(sop)(3)(\ it() bf(-ARG1) ARG2 nl()ARG3\ ) DEFINEMACRO(itt)(1)(\ it()tt(ARG1)\ ) DEFINEMACRO(itb)(1)(\ it()bf(ARG1)nl()\ ) DELETEMACRO(tt) DEFINEMACRO(tt)(1)(em(ARG1)) COMMENT( man-request, section, date, distribution file, general name) manpage(icmstart)(1)(_CurYrs_)(icmake._CurVers_) (starts icmbuild program maintenance) COMMENT( man-request, larger title ) manpagename(icmstart)(A startup script for icmbuild program maintenance) COMMENT( all other: add after () ) manpagesynopsis() bf(icmstart) tt([Options]) top-dir [program|library] manpagedescription() Although tt(icmake)-scripts can be written from scratch to handle program maintenance, often the required actions are highly comparable. This observation resulted in the construction of two tt(icmake)-tools: bf(icmstart)(1), initializing a directory for program development and bf(icmbuild)(1), handling the actual program maintenance. Both come predefined with tt(icmake's) distribution, to initialize and maintain bf(C++) programs (or, after minimal adaptation, bf(C)) programs). They can also easily be tailored to other programming languages. The tt(icmstart) script and tt(icmbuild) program can directly be called: tt(icmstart) is an tt(icmake) script, for which the command-shell calls tt(icmake); tt(icmbuild) is a small bf(C) program calling tt(icmake) to process the tt(icmbuild) script in (commonly) tt(/usr/lib/icmake). This man-page covers bf(icmstart); refer to the bf(icmbuild)(1) man-page for information about how tt(icmbuild) can be used. The bf(icmstart) script is a generic script that is used to initialize a directory with a basic set of files that are commonly used when developing a bf(C++) or bf(C) program. bf(Icmstart) creates an initial directory (here named `tt(top-dir)') and installs the files tt(CLASSES, VERSION) and tt(icmconf) below tt(top-dir). A second argument `tt(program)' or `tt(library)' may be specified as the default mode of operation of the bf(icmbuild)(1) script, usually resulting in adding additional skeleton source files. If the predefined set of files doesn't fit your needs, then the default set can easily be modified. The default set of skeleton files is listed in the file tt(/etc/icmake/icmstart.rc). Refer to the bf(icmstart.rc)(7) man-page for information about how this file is structured and how it can be adapted. After switching to the directory created by bf(icmstart) bf(icmbuild)(1) may be used for program maintenance. manpageoptions() tt(Icmstart) supports the following options, which (when specified) must be tt(icmstart's) first arguments: itemization( itt(-b)nl() basic installation: the files tt(VERSION, usage.cc) and tt(version.cc) are not installed, and the tt(#define USE_VERSION) entry in icmconf is commented out; itt(-c confpath)nl() use the configuration files (tt(icmstart.rc, AUTHOR, YEARS) and tt(VERSION)) if found in `confpath' rather than using the files found in tt(~/.icmake) and/or tt(/etc/icmake/). Once a file is found it is used, allowing partial overrides of the default files provided by bf(icmake)(1); itt(-d)nl() do not execute any commands, but show the commands that would have been executed on the standard output; itt(-I)nl() do not install files; itt(-r)nl() unconditionally replace existing files. If tt(-r) is not provided bf(icmstart) asks the user to confirm that an existing file must be overwritten. If a skeleton specification refers to a directory, the full directory and its subdirectories are replaced; itt(-s skeleton-path) nl() by default skeleton files are listed in the skeleton resource file tt(/usr/share/icmake/icmstart.rc). Alternatively, the skeleton resource file may be specified by the tt(ICM) environment variable, which -in turn- may be overruled by the path specified with the tt(-s) option. The skeleton path may be specified as a full file-path or as a directory, in which case the skeleton resource file is assumed to be tt(icmstart.rc) (see below at bf(SKELETON FILES)). ) Since bf(icmstart) uses tt(cp) to install files, tt(cp) must be available when bf(icmstart) should install skeleton files. manpagesection(SKELETON FILES) Skeleton resource files may contain comment (empty lines and lines beginning with the hash-mark (tt(#))). Comment lines are ignored. Otherwise, lines should contain specifications of resource file(s) to be installed. The default resource specification file is tt(/etc/icmake/icmstart.rc), containing: verb( CLASSES icmconf P main.cc P main.ih P usage.cc P version.cc P ? scanner P ? parser ) This file is overruled by tt(~/.icmake/icmstart.rc). The tt(~/.icmake) directory (called `configuration directory' below) can be prepared using the following system command: verb( cp -r /etc/icmake ~/.icmake ) This directory can also contain skeleton files. Default skeleton files are commonly found in tt(/usr/share/icmake), and could be copied to the configuration directory and referred to by the configuration directory's file tt(icmstart.rc). See bf(icmstart.rc)(7) for details about how skeleton files can be referred to tt(icmstart.rc). manpagesection(CONFIGURATION FILES) The configuration files tt(icmstart.rc, AUTHOR, YEARS) and tt(VERSION) are recognized as skeleton files and are, if available, processed by tt(icmstart). If the tt(-c) option was specified configuration files found in the path specified at this option are used. If not specified or if a file isn't found then the path tt(~/icmake) is inspected. If a configuration file isn't found in tt(~/icmake) either, configuration files in tt(/etc/icmake) are used. Configuration files are optional; if absent tt(icmstart) can still be used, but in normal cases at least tt(icmstart.rc) is provided. In addition to tt(icstart.rc) consider defining the files tt(AUTHOR, VERSION,) and tt(YEARS) in the configuration directory: itemization( it() If the file tt(AUTHOR) exists it should have one line, defining the author of the program. E.g., verb( #define AUTHOR "Frank B. Brokken " ) If it does not exist tt(icmstart) uses the default:nl() tt(#define AUTHOR ""). it() If the file tt(VERSION) exists it should have one line, defining the program's version. E.g., verb( #define VERSION "1.00.00" ) If it does not exist tt(icmstart) uses the default:nl() tt(#define VERSION "0.01.00"). it() If the file tt(YEARS) exists it should have one line, defining the program's initial release year or range of release years. E.g., verb( #define YEARS "2020" ) or a range of years can be defined: verb( #define YEARS "1992-2020" ) If it does not exist tt(icmstart) uses the default:nl() tt(#define YEARS "yyyy") where tt(yyyy) is the current year. ) The tt(AUTHOR, VERSION,) and tt(YEARS) definitions are concatenated to one file, called tt(VERSION), installed in the top-level directory. If the file tt(icmstart.rc) does not exist (or is empty) tt(icmstart) merely installs the top-level directory, tt(icmconf) and tt(VERSION). manpagefiles() The mentioned paths are sugestive only and may be installation dependent: itemization( it() bf(/usr/share/icmake/icmconf) Example of a bf(icmbuild) configuration file; it() bf(/usr/share/icmake/CLASSES) Example of a bf(icmbuild) tt(CLASSES) file. it() bf(/etc/icmake/icmstart.rc) Default skeleton resource file. ) manpageseealso() bf(icmake)(1), bf(icmbuild)(1), bf(icmconf)(7), bf(icmstart.rc)(7). manpagebugs() Path names containing blanks are not supported. includefile(trailer.inc) icmake-10.03.00/doc/manpage/README.options0000644000175000017500000000326514204126313016701 0ustar frankfrankicm_comp itself has no run-time options (--help and --version end icm_comp) Pre-options: --verbose (-V) --no-process (-N) Action options: --about (-a) forward: done --help (-h) forward: done --version (-v) these options end icmake after showing their info --compile (-c) [icm_pp options] im-file [bim-file] (option location of options beyond --compile not critical) forward all from the first non-option --dependencies (-d) ... (all options following -d are forwarded to icm-dep) forward all following -d --execute (-e) [icm_exe options] bim-file [bim's main argv options/args] (option location of options beyond --execute is critical) forward all from the first non-option --force (-f) - as with --compile --preprocess (-p) [icm_pp options] im-file [pim-file] (option location of options beyond --preprocess not critical) forward all --source (-s) [--preprocess (-p) preprocess options] [--execute (-e) icm_exec options] im-file [bim's main argv options/args] (option locations are critical, but -p and -e options may be swapped) forward all from the first non-option -t [-p preprocess options] [-e icm-exec options] option locations are critical. -- is only required if -p and/or -e are specified. forward all from the 1st non-option --unassemble -u forward ALL With -s and -t: if pre-processor follow -s/-t then -p may be omitted. icmake-10.03.00/doc/icmconf.70000644000175000017500000004130014204245361014422 0ustar frankfrank.TH "icmconf" "7" "1992\-2022" "icmake\&.10\&.03\&.00" "configuration file for \fBicmbuild\fP(1)" .PP .SH "NAME" icmconf \- Configuration file for the \fBicmbuild\fP(1) program maintenance script .PP .SH "DESCRIPTION" .PP The \fIicmconf\fP configuration file is used to specify and fine\-tune the program maintenance performed by the \fBicmbuild\fP(1) program and script\&. It can be used to activate and specify various directives that 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 also easily be configured\&. .PP The \fBicmbuild\fP(1) script ignores empty lines and lines whose first non\-blank characters are two consecutive forward slashes (//)\&. Long lines can be split over multiple lines by writing 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 all dependent sources once header files are modified\&. When developing \fBC++\fP programs this is hardly ever requird, as adding new member functions to classes does not require you to recompile already existing source files\&. Recompilation \fIis\fP required when the data member organization of classes is altered\&. .PP To handle class dependencies in a more sensible way, \fBicmake\fP(1) checks class dependencies using its support program \fI/usr/lib/icmake/icm\-dep\fP, visiting the classes listed in the \fICLASSES\fP file if \fIicmconf\(cq\&s USE_ALL\fP directive was specified\&. If a directory mentioned in the \fICLASSES\fP file contains a file having a name that\(cq\&s equal to the name specified at the \fIUSE_ALL\fP parameter, then all sources of classes that depend on that particular class are also recompiled\&. In practice this means that when you change the data organization of a class you only need to \fItouch\fP it that directory the file whose name was specified by the \fIUSE_ALL\fP directive\&. E\&.g\&., if your class is named \fIData\fP, its sources are in the sub\-directory \fI\&./data\fP, and \fI#define USE_ALL \(dq\&a\(dq\&\fP was specified then after modifying the data organization of the class \fIData\fP you only need to issue the command \fItouch data/a\fP\&. Subsequently, at the next \fIicmbuild\fP call all sources in \fI\&./data\fP as well as all sources in directories whose (header) files include \fIdata\&.h\fP are recompiled as well\&. .PP Likewise, if \fIPRECOMP\fP was defined, then a similar action is performed for the precompiled headers: if a local header file that\(cq\&s (directly or indirectly) included by a class\(cq\&s internal header file has changed, then that class\(cq\&s precompiled header as well as all precompiled headers of dependent classes are recompiled\&. .PP The \fBicmbuild\fP(1) script itself does not inspect these dependencies, but calls \fI/usr/lib/icmake/icm\-dep\fP to perform the requird tests\&. The program \fIicm\-dep\(cq\&s\fP short usage summary is written to the standard output stream when calling \fIicmake \-d\fP (or directly: \fI/usr/lib/icmake/icm\-dep\fP)\&. .PP .SH "DEFINES IN ICMCONF " .PP All of the following \fI#defines\fP are required except those that are shown as commented \fI#defines\fP (e\&.g\&., \fI//#define REFRESH\fP)\&. .PP .IP o \fB//#define ADD_LIBRARIES \(dq\&\(dq\&\fP .br when a program must be linked against additional libraries (other than the name of the program\(cq\&s library itself (specified at \fILIBRARY\fP) then those libraries should be specified here\&. E\&.g\&., when a program is linked against \fIlibbobcat\fP then the specification is: .nf #define ADD_LIBRARIES \(dq\&bobcat\(dq\& .fi If your program is linked against multiple libraries, then use a blank\-separated list of libraries (like \fI#define ADD_LIBRARIES \(dq\&math bobcat\(dq\&\fP); .IP .IP o \fB//#define ADD_LIBRARY_PATHS \(dq\&\(dq\&\fP .br this directtive must be specified if \fIADD_LIBRARIES\fP is also specified, although it may be specified as an empty string\&. When additional libraries (specified at \fIADD_LIBRARIES\fP) are located in non\-standard library locations (e\&.g\&., not in \fI/lib\fP and \fI/usr/lib\fP) then these additional paths are (blank space separated) specified here\&. Specify only the paths, not the \fI\-L\fP flags\&. .IP It is stronly advised to specify full pathnames here\&. Relative path specifications can be used by specify paths relative to the directory that is specified at the \fITMP_DIR\fP directive (see below); .IP .IP o \fB//#define CLS\fP .br the \fIclear screen\fP directive\&. If defined \fItput clear\fP is called to clear the terminal screen before starting compilations\&. By default it is not defined\&. Alternatively the \fI\-c\fP option can be passed to \fIicmbuild\fP; .IP .IP o \fB#define CXX \(dq\&g++\(dq\&\fP .br the C++ compiler to use\&. For a \fBC\fP compiler specify, e\&.g\&., \fI#define CC \(dq\&gcc\(dq\&\fP\&. Their settings are overruled by identically named environment variables\&. If only \fBC\fP files are compiled then \fI#define CXX\fP can be omitted; .IP .IP o \fB#define CXXFLAGS \(dq\&\-\-std=c++20 \-Wall \-O2\(dq\&\fP .br \fBC++\fP compiler options to use (here showing the default options)\&. When the \fBC\fP compiler is used, use \fI#define CFLAGS\fP rather than \fICXXFLAGS\fP\&. Their settings are overruled by identically named environment variables\&. If only \fBC\fP files are compiled then \fI#define CXXFLAGS\fP can be omitted; .IP .IP o \fB//#define DEFCOM \(dq\&\&.\&.\&.\(dq\&\fP .br a \fIDEFCOM\fP directive may be added to the \fIicmconf\fP file (the \fBicmstart\fP(1) script can do this for you)\&. It can be specified as: .nf #define DEFCOM \(dq\&program\(dq\& .fi in which case \fIicmbuild\fP does program maintenance, or as .nf #define DEFCOM \(dq\&library\(dq\& .fi in which case \fIicmbuild\fP does library maintenance\&.; .IP .IP o \fB//#define ICM_DEP \(dq\&\-V go\(dq\&\fP .br the existence and implied existence of \fIUSE_ALL\fP files (see the description of the \fIUSE_ALL\fP directive), as well as the correct ages of precompiled headers can be checked by \fIicmake\(cq\&s\fP support program \fIicm_dep\fP\&. By default \fIicm_dep\fP is called with the shown default arguments\&. If \fIicm_dep\fP should not be called define \fIICM_DEP\fP as an empty string (\fI\(dq\&\(dq\&\fP)\&. \fBIcmake\fP(1)\(cq\&s man\-page contains a separate section about the \fIicm_dep\fP support program; .IP .IP o \fB//#define IH \(dq\&\&.ih\(dq\&\fP .br the extension used for internal header files\&. See \fI#define PRECOMP\fP below\&. If \fIPRECOMP\fP is specified ttIH) must also be specified; .IP .IP o \fB//#define LDFLAGS \(dq\&\(dq\&\fP .br linker options to use\&. By default no options are passed to the linker\&. Its setting is overruled by an identically named environment variable; .IP .IP o \fB//#define LIBRARY \(dq\&modules\(dq\&\fP .br by defining this directive a local library is constructed\&. When a binary program is built it is linked against this library rather than to the individual object modules\&. .IP If a library instead of a program must be constructed (see also the \fIDEFCOM\fP directive), then the \fILIBRARY\fP directive specifies the library\(cq\&s base name (without the \fIlib\fP prefix and without the \fI\&.a\fP extension)\&. In that case source files are expected in sub\-directories of the project\(cq\&s main directory (i\&.e\&., the directory containing \fIicmconf\fP)\&. In that case avoid having source and header files in the project\(cq\&s main directory\&. Instead, move such files to a separate sub\-directory; .IP .IP o \fB//#define MAIN \(dq\&main\&.cc\(dq\&\fP .br the source file in which the \fIint main\fP function is defined\&. This directive is required when doing program (rather than library) maintenance\&. .IP Note: if source files are located in the project\(cq\&s main directory but library maintenance is intended (e\&.g\&., by specifying \fI#define DEFCOM library\fP) then define \fIMAIN\fP to specify a pseudo main source, whose base name is the base name of the header file in the project\(cq\&s main directory\&. This, however, is considered a kludge, and should be avoided by moving those source and header files to a separate sub\-directory; .IP .IP o \fB//#define NO_PRECOMP_WARNING\(dq\&\fP .br when \fIPRECOMP\fP is defined (see below) a warning is issued when a class\-directory does not contain a \fIIH\fP file\&. Such warnings are suppressed by defining \fINO_PRECOMP_WARNING\fP\&. This option is only considered when \fIPRECOMP\fP has been defined; .IP .IP o \fB#define OBJ_EXT \(dq\&\&.o\(dq\&\fP .br this directive specifies the extension of object modules created by the compiler; .IP .IP o \fB//#define PRECOMP \(dq\&\-x c++\-header\(dq\&\fP .br define this directive to construct precompiled headers (in which case the \fIIH\fP) directive must also have been specified\&. Dependencies between (precompiled) headers are automatically considered\&. .PP Existing precompiled headers are removed by \fIicmbuild cleangch\fP (or \fIicmbuild clean\fP\&. When source files of other languages are compiled the \fIPRECOMP\(cq\&s \-x\fP argument must be adapted to those languages; .PP .IP o \fB//#define REFRESH\fP .br define \fIREFRESH\fP to relink the binary program when \fIicmbuild program\fP is called, even though no file was (re)compiled\&. This is useful when the program links to external libraries which were updated separately from the currrent project; .PP .IP o \fB//#define SHARED\fP .br this directive is only interpreted when \fILIBRARY\fP is also specified\&. If defined a shared library (extension \fI\&.so*\fP) is built in addition to a static library (extension \fI\&.a\fP); .PP The shared library receives \fIVERSION\fP as its version number while soft links using \fIVERSION\fP\(cq\&s (see below) major version number an no version number are also made available\&. E\&.g\&., if \fIVERSION\fP is defined as \fI1\&.02\&.03\fP and \fI#define LIBRARY \(dq\&demo\(dq\&\fP then the shared library becomes \fIlibdemo\&.so\&.1\&.02\&.03\fP, with \fIlibdemo\&.so\&.1\fP soft\-linking to it, and \fIlibdemo\&.so\fP soft\-linking to \fIlibdemo\&.so\&.1\fP; .PP .IP o \fB//#define SHAREDREQ \(dq\&\(dq\&\fP .br when creating a shared library \fISHAREDREQ\fP specifies the names of libraries and library paths that are required by the constructed shared library itself\&. E\&.g\&., if a library is found in \fI/usr/lib/special\fP, assuming that the name of the required library is \fIlibspecial\&.so\fP, then use the specification \fI#define SHAREDREQ \(dq\&\-L/usr/lib/special \-lspecial\(dq\&\fP\&. The \fI/lib\fP and \fI/usr/lib\fP paths are usually automatically visited by the linker and do not have the be specified\&. This directive is required (possibly as an empty string) if \fISHARED\fP is defined; .PP .IP o \fB#define SOURCES \(dq\&*\&.cc\(dq\&\fP .br the pattern to locate sources in directories; .PP .IP o \fB#define TMP_DIR \(dq\&tmp\(dq\&\fP .br the directory in which intermediate results are stored\&. To avoid cross\-device communications it\(cq\&s probably best to define \fITMP_DIR\fP as a sub\-directory of the project\(cq\&s main directory; .PP .IP o \fB//#define USE_ALL \(dq\&a\(dq\&\fP .br when defining this directive \fIicmbuild\fP looks for directories containing files having the names defined by the \fIUSE_ALL\fP specification\&. All source files in those directories as well as all source files in directories that (recursively) depend on the set of directories under consideration are recompiled, after which the \fIUSE_ALL\fP files are removed; .PP .IP o \fB//#define USE_ECHO ON\fP .br when defined as \fION\fP (rather than \fIOFF\fP) (system) commands executed by \fIicmbuild\fP are echoed; .PP .IP o \fB//#define USE_VERSION\fP .br when defined (it is defined by default) a file \fIVERSION\fP is read by \fIicmconf\fP to determine the program\(cq\&s or library\(cq\&s version, and the project\(cq\&s release years\&. The file \fIVERSION\fP must be available in the project\(cq\&s main directory and should contain lines like these: .nf VERSION=9\&.03\&.00 YEARS=1992\-2020 .fi ) .PP .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\&. By default they\(cq\&re all commented out\&. .PP .IP o \fB//#define PARSER_DIR \(dq\&\(dq\&\fP .br the sub\-directory containing the parser\(cq\&s specification file\&. If the \fIPARSER_DIR\fP directory is specified then all other directives in this section must also be specified; .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 is created; .IP .IP o \fB//#define PARSFLAGS \(dq\&\-V\(dq\&\fP .br the flags that are used 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 (used by \fIicmbuild\fP when checking the timestamps of parser specification \fBs\fP); .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 by the \fIPARSER_DIR\fP directive\&. .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\&. By default they\(cq\&re all commented out\&. .PP .IP o \fB#define SCANNER_DIR \(dq\&\(dq\&\fP .br the subdirectory containing the scanner\(cq\&s specification file\&. If the \fISCANNER_DIR\fP directory is specified then all other directives in this section must also be specified; .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 is created\&. By default no additional specification files are used; .IP .IP o \fB#define SCANFLAGS \(dq\&\(dq\&\fP .br the flags that are used 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 when checking the timestamps of scanner specification \fBs\fP)\&. .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 by the \fISCANNER_DIR\fP directive\&. .PP .SH "FILES" The mentioned paths are sugestive only and may be installation dependent: .IP o \fB/usr/share/icmake/CLASSES\fP .br : example of an \fBicmconf\fP \fICLASSES\fP file; .IP o \fB/usr/share/icmake/icmconf\fP .br : default (skeleton) \fBicmbuild\fP resource files, like \fImain\&.cc, usage\&.cc\fP, etc\&.; .IP o \fB/etc/icmake\fP .br : directory containing the default system\-wide \fBicmstart\fP(1) configuration file; .IP o \fB$HOME/\&.icmake\fP .br : optional user\-defined directory containing user\-defined specifications overruling the system\-wide definitions\&. This directory is the proper location for a file \fIAUTHOR\fP defining the \fIAUTHOR\fP directive with the user\(cq\&s name\&. E\&.g\&., my \fI\&.icmake/AUTHOR\fP file contains: .IP .nf #define AUTHOR \(dq\&Frank B\&. Brokken (f\&.b\&.brokken@rug\&.nl)\(dq\&; .fi .IP .SH "SEE ALSO" \fBicmake\fP(1), \fBicmbuild\fP(1), \fBicmstart\fP(1), \fBicmstart\&.rc\fP(7)\&. .PP .SH "BUGS" \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 GNU General Public License (GPL)\&. .PP .SH "AUTHOR" Frank B\&. Brokken (\fBf\&.b\&.brokken@rug\&.nl\fP)\&. .PP icmake-10.03.00/doc/icmscript.70000644000175000017500000013717314204245361015017 0ustar frankfrank.TH "icmscript" "7" "1992\-2022" "icmake\&.10\&.03\&.00" "The icmake scripting language" .PP .SH "NAME" icmscript \- The \fBC\fP\-like \fIicmake\fP scripting language .PP .SH "DESCRIPTION" .PP \fBIcmake\fP(1) is a generic tool handling program maintenance that can be used as an alternative for \fBmake\fP(1)\&. It\(cq\&s a generic tool in that \fIicmake\fP\-scripts, written in a language closely resembling the \fBC\fP programming language, can perform tasks that are traditionally the domain of scripting languages\&. .PP \fBIcmake\fP allows programmers to use a programming language (closely resembling the \fBC\fP\-programming language) to define the actions that are required for (complex) program maintenance\&. For this, \fBicmake\fP offers various special operators as well as a set of support functions that have shown their usefulness in program maintenance\&. .PP This man\-page covers the \fBicmake\fP scripting language in de following sections: .IP o \fBDATA TYPES\fP .br \- \fIint, list, string\fP, and \fIvoid\fP (for functions); .IP o \fBOUTLINE\fP .br \- outline of \fBicmake\fP scripts: what are their requirements, the structure and organization of their \fImain\fP\-functions\&. .IP o \fBPREPROCESSOR DIRECTIVES\fP .br \- supported preprocessor directives, like \fI#include\fP and \fI#define\fP; .IP o \fBPREDEFINED CONSTANTS\fP .br \- like \fIO_FILE, OFF\fP, and \fIS_IFREG\fP; .IP o \fBOPERATORS\fP .br \- like \fI+, younger\fP, and casts .IP o \fBFLOW CONTROL\fP .br \- \fIif, for, while\fP, etc\&. (the \fIswitch\fP is not available); .IP o \fBPREDEFINED FUNCTIONS\fP .br \- executing programs, changing directories, operations on \fIstring\fP and \fIlist\fP type variables, etc\&.\&. Functions are marked as \fIINT FUNCTIONS\fP, \fILIST FUNCTIONS\fP, \fISTRING FUNCTIONS\fP .IP o \fBUSER DEFINED FUNCTIONS\fP .br \- at least \fImain\fP, with or without its common parameters \fIargc, argv,\fP and \fIenvp\fP\&. .PP .SH "DATA TYPES" .PP \fBIcmake\fP supports the following five data and value types: .PP .IP o \fIASCII character constants\fP .br ASCII character constants are ascii\-characters, surrounded by single or double quotes\&. Single characters (e\&.g\&., \fI\(cq\&a\(cq\&\fP) represent the character itself\&. Standard escape sequences (e\&.g\&., \fI\(cq\&\en\(cq\&\fP) are supported and are converted to their well\-known values (e\&.g\&., \fI\(cq\&\en\(cq\&\fP represents ascii value 10 (decimal))\&. Non\-standard escape sequences (e\&.g\&., \fI\(cq\&\ex\(cq\&\fP) are converted to the ascii character following the escape character (so \fI\(cq\&\ex\(cq\&\fP equals \fI\(cq\&x\(cq\&\fP)\&. Escaped sequences consisting of three octal digits represent the ascii character corresponding to the octal value, modulo 256 (e\&.g\&., \fI\(cq\&\e113\(cq\&\fP represents \fI\(cq\&K\(cq\&\fP)\&. Escape sequences consisting of an x followed by two hexadecimal digits represent the ascii character corresponding to the hexadecimal value (e\&.g\&., \fI\(cq\&\ex4b\(cq\&\fP, also representing \fI\(cq\&K\(cq\&\fP); .IP .IP o \fIint\fP .br Integral values, ranging from \fI\-0x8000\fP through \fI0x7fff\fP\&. \fIint\fP constants may be specified as decimal numbers (starting with digits 1 through 9), octal numbers (starting with 0, followed by one or more octal digits), hexadecimal numbers (starting with 0x, followed by one or more hexadecimal digits), or as \fIASCII\fP character constants; .IP .IP o \fIstring\fP .br Text values: text (or `string\(cq\&) constants are delimited by double quotes\&. Multiple string constants may be concatenated, but a single string constant may not span multiple lines\&. Multiple string constants, only separated by white space (i\&.e\&., blanks, newlines, comment) are concatenated and are considered one single string constant\&. To indicate an end\-of\-line in a string constant use the \fI\en\fP escape sequence; .IP If arithmetic expressions use at least one \fIint\fP operand then those expressions may also contain single character ASCII constants using double quotes\&. In those cases they represent the ascii\-values of their characters\&. .IP Conversely, ASCII character constants using single quotes may be used in situations where string operands are expected; .IP .IP o \fIlist\fP .br A \fIlist\fP is a data structure containing a series of individually accessible \fIstring\fP values\&. When a list contains elements, its first element has index 0; .IP Lists may be written to the standard output stream or to file (using \fIprintf\fP or \fIfprintf\fP)\&. Lists can also be inserted into \fIstring\fP variables using \fIstrformat\fP\&. In these cases all (space delimited) elements of the lists are inserted into their destinations; .IP Lists can also be defined as constants\&. They consist of an optional series of comma separated string constants surrounded by a pair of square brackets\&. E\&.g\&., .nf list words = [\(dq\&a\(dq\&, \(dq\&list\(dq\&, \(dq\&constant\(dq\&]; .fi .IP .IP o \fIvoid\fP .br The type \fIvoid\fP is used when defining functions to indicate that such functions do not return values\&. Alternatively, functions may return \fIint, string\fP or \fIlist\fP values (cf\&. section \fBUSER DEFINED FUNCTIONS\fP)\&. .PP Variables can be defined at the global level inside functions (not only at the top of compound statements but also between statements and in the initialization section of for\- and if\-statements)\&. When defined inside functions, the standard \fBC\fP scoping and visibility rules apply\&. Variables are strongly typed, and cannot have type \fIvoid\fP\&. .PP Variables may be initialized when they are defined\&. Initializations are expressions which may use predefined or user\-defined functions, constant values, and values of variables\&. Functions or variables that are used for initialization must be visible at the initialization point\&. .PP .SH "OUTLINE" .PP \fBIcmake\fP scripts require a user\-defined function \fImain\fP\&. The function \fImain\fP has three optional parameters, which may be omitted from the last one (\fIenvp\fP) to the first one (\fIargc\fP), like in \fBC\fP\&. Its full prototype is: .nf void main(int argc, list argv, list envp) .fi or .nf int main(int argc, list argv, list envp) .fi When a \fIvoid main\fP function ends (using a \fIreturn;\fP statement or when its execution reaches its body\(cq\&s closing curly) the value 0 is returned to the operating system\&. When \fIint main\fP functions end using \fIreturn\fP statements then those statements must be provided with \fIint\fP\-expressions\&. It\(cq\&s OK when the execution of an \fIint main\fP function reaches its body\(cq\&s closing curly, om which case 0 is automatically returned to the operating system .PP In \fImain\fP the parameter .IP o \fIargc\fP represents the number of elements in \fIargv\fP; .IP .IP o \fIargv\fP contains the arguments, with element 0 being equal to the name of the \fI\&.bim\fP file, that were passed to the \fI\&.bim\fP file\&. The \fBOPTIONS\fP section of the \fBicmake\fP(1) manpage covers how these arguments are forwarded to the \fBicmake\fP script using options \fI\-e, \-s,\fP and \fI\-t\fP\&. .IP .IP o \fIenvp\fP contains the `environment\(cq\& variables\&. The (predefined) function \fIlistlen\fP can be used to determine the number of its elements\&. Elements in \fIenvp\fP use the format \fIvariable=value\fP\&. Alternatively, the (predefined) function \fIgetenv\fP can be used to retrieve a specific environment variable immediately\&. .PP Example (the implementations of the user\-defined functions \fIusage, modified,\fP and \fIcompile\fP are left as an exercise for the reader): .nf void main(int argc, list argv) { if (argc == 1) usage(argv[0]) .fi ; .PP if (list toCompile = modified(\(dq\&*\&.cc\(dq\&)) { for (int idx = listlen(toCompile); idx\-\-; ) compile(toCompile[idx]); } } ) When executing an \fBicmake\fP script \fBicmake\(cq\&s\fP run\-time support system first initializes all all global variables in the order of their definitions\&. Followin this the function \fImain\fP is called\&. The script ens once once \fImain\fP returns or when the (predefined) function \fIexit\fP is called by the script)\&. .PP .SH "PREPROCESSOR DIRECTIVES" .PP Before actually compiling \fBicmake\fP scripts they are first pre\-processed by the \fBicmake\fP pre\-processor\&. The pre\-processor removes comment, includes files specified by \fIinclude\fP\-directives, and processes \fI#define\fP and comparable directives\&. .PP The following preprocessor directives are recognized: .IP o comment: .br standard \fBC\fP comment (everything from \fI/*\fP through \fI*/\fP) as well as comment\-to\-end\-of\-line (starting at \fI//\fP, continuing to the end of the line) is ignored; .IP .IP o Shell startup: The first line of the \fBicmake\fP\-script may start with \fI#!path\fP, where \fIpath\fP defines the absolute location of the \fBicmake\fP program\&. By making the script executable, it can be called without explicitly calling \fBicmake\fP\&. .IP E\&.g\&., if the first line of an (executable) icmakefile \(cq\&icm\(cq\& (without extension) contains .nf #!/usr/bin/icmake \-t\&. .fi then \fIicm\fP can be issued as a command, interpreting the remaining content of the script as an \fBicmake\fP source which is compiled and then executed by \fBicmake\fP\&. In these cases the binary files are removed when the scipts end; .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; .IP .IP o \fI#define identifier [definition]\fP .br The text \fIidentifier\fP is replaced by \fIdefinition\fP\&. The definition may contain references to already defined identifiers, using the format \fI${identifier}\fP\&. If the \fI${identifier}\fP hasn\(cq\&t been defined (yet), the literal text \fI${identifier}\fP is used\&. To prevent infinite recursion at most 100 \fI${identifier}\fP replacements are accepted; .IP If the last character on a line is a backslash (\fI\e\fP) then definitions continue at the next line\&. (the backslash is not included in the definition)\&. The preprocessor concatenates double\-quoted strings\&. 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 Following the \fI#define\(cq\&s\fP identifier a definition may optional be provided\&. If omitted, the macro is defined, so it can be used in \fI#if(n)def\fP directives (see below), but in those cases these intentifiers are simply removed from \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 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 \fI#ifdef\fP and \fI#ifndef\fP directives, reversing the 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\&. 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 Remove \fIidentifier\fP from the set of defined symbols\&. This does not affect the specification of any previously defined symbols in which \fIidentifier\(cq\&s\fP definition has been used\&. If \fIidentifier\fP hasn\(cq\&t been defined a warning is issued\&. .PP .SH "PREDEFINED CONSTANTS" .PP The following predefined \fIint\fP constants are available (the functions listed in the \fIintended for\fP column are described in the upcoming sections covering the predefined functions): .TS tab(~); --- lll --- lll lll lll lll --- lll lll --- lll lll --- lll lll lll lll lll lll --- c. symbol~value~intended for O_ALL~8~makelist O_DIR~2~makelist O_FILE~1~makelist O_SUBDIR~4~makelist OFF~0~echo ON~1~echo P_CHECK~0~system calls P_NOCHECK~1~system calls S_IEXEC~32~stat S_IFCHR~1~stat S_IFDIR~2~stat S_IFREG~4~stat S_IREAD~8~stat S_IWRITE~16~stat .TE .PP The following constants are architecture dependent: .TS tab(~); -- ll -- ll ll ll ll ll ll ll -- c. symbol~1 when defined on the platform, otherwise 0 unix~Unix, usually with GNU\(cq\&s gcc compiler UNIX~may alternatively be available linux~x86 running Linux (usually with gcc) LINUX~may alternatively be available M_SYSV, M_UNIX~x86 running SCO/Unix _POSIX~_SOURCE Unix with Posix compliant compiler __hpux~HP\-UX, with the native HP compiler .TE .PP .SH "OPERATORS" .PP Since \fBicmake\fP version 10\&.00\&.00 the \fI<<\fP operator can be used like the \fBC++\fP insertion operator\&. See the description of the functions \fIprintf\fP and \fIfprintf\fP below\&. .PP \fBint\-operators:\fP .PP All \fBC\fP operators (including the ternary operator) are available (except for pointer operators, as \fBicmake\fP does not support pointers)\&. They operate like their \fBC\fP\-programming language\(cq\&s counterparts\&. Comparison operators return 1 if the comparison is true, otherwise 0 is returned\&. .PP \fBstring\-operators:\fP .PP For \fIstring\fP variables and/or constants the following operators are available (\fIlhs\fP and \fIrhs\fP are \fIstring\fP variables or constants): .PP .IP o \fIlhs + rhs\fP: returns a new \fIstring\fP value containing the concatenation of \fIstrings lhs\fP and \fIrhs\fP\&. Note that \fIstring\fP constants can also directly be concatetated (not 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\& .fi .IP .IP o \fIlhs += rhs\fP: \fIlhs\fP must be a \fIstring\fP variable, to which the \fIstring\fP variable or value \fIrhs\fP is appended; .IP .IP o string comparisons: operators \fI== != <= >= < > !=\fP and \fI==\fP return 1 if the comparison is true, otherwise 0\&. The ordering operators (like \fI<\fP and \fI>=\fP) use the (case sensitive) character ordering defined by the \fIASCII\fP character set; .IP .IP o \fI!lhs\fP: the boolean \fI!\fP (not) operator returns 1 if the \fIstring lhs\fP is empty, otherwise 0 is returned\&. Strings containing white\-space characters are not empty; .IP .IP o \fIlhs younger rhs, lhs newer rhs\fP: returns 1 if file \fIlhs\fP is more recent than file \fIrhs\fP\&. E\&.g\&., \fI\(dq\&source\&.cc\(dq\& newer \(dq\&source\&.o\(dq\&\fP\&. The files \fIlhs\fP and \fIrhs\fP do not have to exist: .RS .IP o if both don\(cq\&t exist 0 is returned, .IP o if \fIlhs\fP doesn\(cq\&t exist 0 is returned, .IP o if \fIrhs\fP doesn\(cq\&t exist, 1 is returned, .IP o if they are equally old 0 is returned\&. .RE .IP The predefined function \fIexists()\fP (see below, section \fBPREDEFINED FUNCTIONS\fP) can be used to test whether a file exists; .IP .IP o \fIlhs older rhs\fP: returns 1 if file \fIlhs\fP is older than file \fIrhs\fP\&. E\&.g\&., \fI\(dq\&libprog\&.a\(dq\& older \(dq\&source\&.o\(dq\&\fP\&. The files \fIlhs\fP and \fIrhs\fP do not have to exist: .RS .IP o if both don\(cq\&t exist 0 is returned, .IP o if \fIlhs\fP doesn\(cq\&t exist 1 is returned, .IP o if \fIrhs\fP doesn\(cq\&t exist, 0 is returned, .IP o if they are equally old 0 is returned\&. .RE .IP .IP o \fI[]\fP: the index operator returns a character from a string variable or constant\&. A string is returned as an \fIrvalue\fP\&. Thus, the following statement compiles OK: .nf lhs = rhs[3]; .fi but the following statement won\(cq\&t compile: .nf lhs[3] = \(dq\&a\(dq\&; .fi If an invalid (out of bounds) index value is specified an empty string is returned\&. .IP .IP o The \fIbacktick\fP operator (\fI`string cmd`\fP) .br A string placed between two backticks is executed as a separate command\&. Different from the \fIexec\fP and \fIsystem\fP calls the backtick operator collects the standard output produced by `cmd\(cq\& returning this output as a list\&. The elements of the list contain the subsequent lines of output (including a final newline, if present) produced by `cmd\(cq\&\&. An empty list indicates that the command could not be executed\&. .IP Note that a command that could be executed but that did not produce any output returns a list containing one string element, which is empty\&. The command\(cq\&s standard error stream output is ignored by the backtick operator\&. However, standard shell redirection may be used to collect the standard error stream\(cq\&s output\&. Example: .nf printf << `\(dq\&ls\(dq\&`; // prints the elements in // the current directory .fi .IP Also note that the backtick operator requires a string argument: either a string constant or a string variable\&. .IP The predefined function \fIeval(string cmd)\fP behaves exactly like the backtick operator: they are synonyms\&. .PP \fBlist\-operators:\fP .PP For \fIlist\fP variables and/or values the following operators are available: .PP .IP o \fIlhs + rhs\fP: returns a new \fIlist\fP value containing the concatenation of the values of \fIlists lhs\fP and \fIrhs\fP\&. This is \fInot\fP a set operation: if an element appears both in \fIlhs\fP and in \fIrhs\fP, then both will appear in the resulting list (set\-addition is provided by the built\-in function \fIlistunion\fP); .IP .IP o \fIlhs \- rhs\fP: returns a new \fIlist\fP value containing the elements in \fIlhs\fP that are not present in \fIrhs\fP\&. This is a set\-difference operation\&. The ordering of the remaining elements in the returned list is equal to the ordering of those elements in \fIlhs\fP; .IP .IP o \fIlhs += rhs\fP: elements in \fIrhs\fP are added to the elements in \fIlhs\fP, which must be a \fIlist\fP variable\&. This is \fInot\fP a set operation; .IP .IP o \fIlhs \-= rhs\fP: elements in \fIrhs\fP are removed from the elements in \fIlhs\fP\&. This is a set operation: all elements of \fIlhs\fP that are found in \fIrhs\fP are removed from \fIlhs\fP\&. The ordering of the remaining elements in \fIlhs\fP is not altered; .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, otherwise 0 is returned\&. Operator \fI!=\fP reverses the result of \fI==\fP; .IP .IP o \fI!lhs\fP: the boolean \fI!\fP operator returns 1 if the \fIlist lhs\fP is empty, otherwise 0 is returned; .IP .IP o \fI[]\fP: the index operator retrieves an element from a list variable: it returns a string as an \fIrvalue\fP\&. Thus, the following statement compiles OK: .nf // assume lst is a list, str is a string str = lst[3]; .fi but the following statement won\(cq\&t compile: .nf lst[3] = str; .fi If an invalid (out of bounds) index value is specified an empty string is returned\&. .PP \fBCasting:\fP .PP Type\-casts using the standard \fBC\fP\-style cast\-operator can be used to cast: .IP o strings to ints and vice versa (\fI(int)\(dq\&123\(dq\&, (string)55\fP) .br If the content of a string does not represent a (decimal) \fIint\fP value 0 the cast returns 0; .IP .IP o Strings to lists (\fIlist lst = (list)\(dq\&hello\(dq\&\fP): this returns a list having one element (\fIhello\fP) (note that casting a string to a list as shown is overkill as \fIlist lst = [\(dq\&hello\(dq\&]\fP performs the same initialization)\&. .PP .SH "FLOW CONTROL" .PP \fBIcmake\fP offers a subset of \fBC\fP\(cq\&s flow control statements\&. They can be used as in the \fBC\fP programming language\&. .PP .IP o \fIexpression ;\fP .br The plain expression statement\&. .IP Insert\-expression statements are defined for the functions \fIfprintf\fP and \fIprintf\fP\&. Expression statements may start with \fIprintf <<\fP or \fIfprintf << filename <<\fP\&. The values of all subsequent expressions, separated by \fI<<\fP operators (which in this context are called \fIinsertion operators\fP) are written to the standard output stream (when using \fIprintf <<\fP), or to the file whose name is provided in the \fIstring filename\fP (when using \fIfprintf << filename <<\fP)\&. Examples: .nf printf << \(dq\&hello\(dq\& << \(cq\& \(cq\& << \(dq\&world\(dq\& << \(cq\&\en\(cq\&; fprintf << \(dq\&out\&.txt\(dq\& << \(dq\&hello\(dq\& << \(cq\& \(cq\& << \(dq\&world\(dq\& << \(cq\&\en\(cq\&; .fi .IP .IP o The compound statement .br Variables may be defined and initialized inside compound statements at locations where expression statements can also be used\&. The \fIvisibility\fP of variables starts at their points of definition; .IP .IP o \fIif ([definition;] condition) statement\fP .br The \fI[definition;]\fP phrase is optional\&. If used it defines a type followed by a comma\-separated list of variables which may be provided with initialization expressions\&. .IP The condition phrase is required, and may define and initialize a variable\&. E\&.g, .nf if (string str = getText()) process(str); .fi In this example, \fIprocess\fP is not called if \fIgetText()\fP returns an empty string\&. .IP Variables defined in the definition and condition phrases do not exist either before or after the \fIif\fP statement\&. .br .IP .IP o \fIif ([definition;] condition) statement1 else statement2\fP .br Acts like the previous statement\&. If the condition is true \fIstatement1\fP is executed; if the condition is false \fIstatement2\fP is executed; .IP .IP o \fIfor (init; condition; increment) statement\fP .br Variables (of a single type) may be initialized (and optionally defined) in the \fIinit\fP section\&. The condition phrase may define and initialize a variable\&. The \fIinit\fP, \fIcondition\fP and \fIincrement\fP sections may remain empty\&. An empty condition section is interpreted as `always \fItrue\fP\(cq\&; .IP .IP o \fIwhile (condition) statement\fP .br Inside the condition a variable may be defined and initialized\&. .IP A complementary \fIdo \&.\&.\&. while()\fP statement is not available\&. Note that when a variable is defined and initialized in the condition section the initialization expression is executed at each iteration of the \fIwhile\fP statement\&. Thus the following statement never ends, and displays a never ending stream of values 10: .nf while (int x = 10) printf(x\-\-, \(dq\&\en\(dq\&); .fi .IP .IP o \fIreturn;\fP, and \fIreturn expression;\fP .br Plain \fIreturn\fP statements can be used in \fIvoid\fP functions, and \fIreturn expression\fP statements are used in other type of functions\&. .IP .IP o \fIbreak\fP .br \fIbreak;\fP statements can only be used in \fIfor\fP and \fIwhile\fP statements, ending those statements; .IP .IP o \fIcontinue\fP .br \fIcontinue;\fP statements can only be used in \fIfor\fP and \fIwhile\fP statements, continuing their next iteration\&. .PP .SH "PREDEFINED FUNCTIONS" .PP \fBIcmake\fP provides the following predefined functions, which can be used anywhere in \fBicmake\fP scripts\&. In the following overview the functions are ordered by categories, and within categories they are ordered alphabetically by function name\&. .PP Five categories are distinguished: .IP o Functions operating on ints (see \fIINT FUNCTIONS\fP below): .br these functions receive \fIint\fP arguments, processing those arguments; .IP .IP o Functions operating on strings (see \fISTRING FUNCTIONS\fP below): .br these functions operate on the strings which are passed to these functions as arguments; .IP .IP o Functions operating on lists (see \fILIST FUNCTIONS\fP below): .br these functions operate on the lists which are passed to these functions as arguments; .IP .IP o Functions manipulating file system entries (see \fIFILESYSTEM FUNCTIONS\fP below): .br these functions receive the names of file\-system entries (files, directories, etc\&.) as their \fIstring\fP arguments\&. .IP Note that these functions are not listed in the \fISTRING FUNCTIONS\fP section, as they do not directly operate on their \fIstring\fP arguments, but merely use those arguments to identify file system entries\&. .IP On the other hand, functions like \fIchange_base\fP do not operate on file\-system entries and are therefore entries in the \fISTRING FUNCTIONS\fP section; .IP .IP o System\-related functions (see \fISYSTEM FUNCTIONS\fP below): .br these functions interface to facilities provided by the operating system, like executing programs or changing the script\(cq\&s environment variables\&. Some of these functions use specialized support functions, which are also included in this section\&. .PP \fBINT FUNCTIONS:\fP .PP .IP o \fIstring ascii(int value)\fP .br returns \fIvalue\fP as a string: \fIascii(65)\fP returns the string \fI\(dq\&A\(dq\&\fP; .IP .IP o \fIecho(int opt)\fP .br controls echoing of called programs (and their arguments), specify \fIOFF\fP if echoing is not requested\&. By default \fIecho(ON)\fP is active\&. .PP \fBSTRING FUNCTIONS:\fP .PP .IP o \fIint ascii(string str)\fP .br returns the first character of \fIstr\fP as an in: \fIascii(\(dq\&A\(dq\&)\fP returns 65; .IP .IP o \fIstring change_base(string file, string base)\fP .br returns \fIfile\fP whose base name is changed into \fIbase\fP: \fIchange_base(\(dq\&/path/demo\&.im\(dq\&, \(dq\&out\(dq\&)\fP returns \fI\(dq\&/path/out\&.im\(dq\&\fP; .IP .IP o \fIstring change_ext(string file, string ext)\fP .br returns \fIfile\fP whose extension is changed into \fIext\fP: \fIchange_ext(\(dq\&source\&.cc\(dq\&, \(dq\&o\(dq\&)\fP returns \fI\(dq\&source\&.o\(dq\&\fP\&. The extension of the returned \fIstring\fP is separated from the file\(cq\&s base name by a single dot (e\&.g\&., \fIchange_ext(\(dq\&source\&.\(dq\&, \(dq\&\&.cc\(dq\&)\fP returns \fI\(dq\&source\&.cc\(dq\&\fP); .IP .IP o \fIstring change_path(string file, string path)\fP .br return \fIfile\fP whose path is changed into \fIpath\fP: \fIchange_path(\(dq\&tmp/binary\(dq\&, \(dq\&/usr/bin\(dq\&)\fP returns \fI\(dq\&/usr/bin/binary\(dq\&\fP\&. To remove the path specify \fIpath\fP as an empty string; .IP .IP o \fIstring element(int index, string var)\fP .br acts identically to the index operator: refer to the index (\fI[]\fP) operator in section \fBOPERATORS\fP; .IP .IP o \fIstring get_base(string file)\fP .br returns the base name of \fIfile\fP\&. The base name is the file without its path prefix and without its extension\&. The extension is all information starting at the final dot in the filename\&. If no final dot is found, the file name is the base name\&. E\&.g\&., the base name of \fIa\&.b\fP equals \fIa\fP, the base name of \fIa\&.b\&.c\fP equals \fIa\&.b\fP, the base name of \fIa/b/c\fP equals \fIc\fP; .IP .IP o \fIstring get_dext(string file)\fP .br returns the extension of \fIfile\fP, including the separating dot (hence the \fId\fP in \fIdext\fP)\&. The extension is all information starting at the filename\(cq\&s final dot\&. If \fIfile\fP does not have a final dot then an empty string is returned; .IP .IP o \fIstring get_ext(string file)\fP .br returns the extension of \fIfile\fP, without the separating dot\&. The extension are all characters in \fIfile\fP starting at \fIfile\(cq\&s\fP final dot\&. If no final dot is found, an empty string is returned; .IP .IP o \fIstring get_path(string file)\fP .br returns \fIfile\(cq\&s\fP path\-prefix\&. The path prefix is all information up to (and including) the final directory separator (which is, depending on the operating system, a forward slash or a backslash)\&. If \fIfile\fP does not contain a path\-element, then an empty string is returned; .IP .IP o \fIstring resize(string str, int newlength)\fP returns a copy of string \fIstr\fP, resized to \fInewlength\fP characters\&. If \fInewlength\fP is negative then an empty string is returned, if \fInewlength\fP exceeds \fIstr\(cq\&s\fP length then the newly added characters are initialized to blank spaces; .IP .IP o \fIint strchr(string str, string chars)\fP .br 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 strfind(string haystack, string needle)\fP .br returns index in \fIhaystack\fP where \fIneedle\fP is found, or \-1 if \fIneedle\fP is not found in \fIhaystack\fP; .IP .IP o \fIstring strformat(string format, argument(s))\fP .br returns a string constructed from the \fIformat\fP string containing placeholders %1 \&.\&. %2 to refer to arguments following the format string\&. The specification %1 refers to the first argument following the format string\&. If fewer arguments than \fIn\fP are provided then additional 0 arguments are provided by \fBicmake\fP\&. Example: .br .nf void main() { string s2 = = strformat(\(dq\&%1 %2 %1\en\(dq\&, 10, 20); printf(\(dq\&s2 = \(dq\&, s2); // shows: s2 = 10 20 10 } .fi .IP .IP o \fIint strlen(string str)\fP .br returns the number of characters in \fIstr\fP (not counting the terminating NUL\-character); .IP .IP o \fIstring strlwr(string str)\fP .br returns a lower\-case duplicate of \fIstr\fP; .IP .IP o \fIlist strtok(string str, string separators)\fP .br returns a list containing all substrings of \fIstr\fP separated by one or more (consecutive) characters in \fIseparators\fP: \fIstrtok(\(dq\&hello icmake\(cq\&s+world\(dq\&, \(dq\& +\(dq\&)\fP returns a list containing the three strings \fI\(dq\&hello\(dq\&\fP, \fI\(dq\&icmake\(cq\&s\(dq\&\fP, and \fI\(dq\&world\(dq\&\fP; .IP .IP o \fIstring strupr(string str)\fP .br returns an upper\-case duplicate of \fIstr\fP\&. .IP .IP o \fIstring substr(string text, int offset, int count)\fP .br returns a substring of \fItext\fP, starting at \fIoffset\fP, consisting of \fIcount\fP characters\&. If \fIoffset\fP exceeds (or equals) the string\(cq\&s length or if \fIcount <= 0\fP, then an empty string is returned\&. If \fIoffset\fP is less than 0 then \fIoffset = 0\fP is used\&. If \fIoffset + count\fP exceeds \fItext\(cq\&s\fP length then the available substring starting at \fItext[offset]\fP is returned (which may be empty); .IP .IP o \fIstring trim(string str)\fP .br returns a copy of \fIstr\fP without leading and trailing white spaces; .IP .IP o \fIstring trimleft(string str)\fP .br returns a copy of \fIstr\fP without leading white spaces; .IP .IP o \fIstring trimright(string str)\fP .br Returns a copy of \fIstr\fP without trailing white spaces\&. .PP \fBLIST FUNCTIONS:\fP .PP .IP o \fIstring element(int index, list var)\fP .br acts identically to the index operator: refer to the index (\fI[]\fP) operator in section \fBOPERATORS\fP; .IP .IP o \fIint listfind(list lst, string str)\fP .br returns the smallest 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 the elements of \fIrhs\fP\&. The original order of the elements in \fIlhs\fP is kept\&. Subsequent elements in \fIrhs\fP that are not available in \fIlhs\fP are added to the end of \fIlhs\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\&. The original order of the elements in \fIlhs\fP is kept\&. If \fIrhs\fP is not available in \fIlhs\fP then it is added to the end of \fIlhs\fP\&. .PP \fBFILESYSTEM FUNCTIONS\fP: .PP .IP o \fIstring chdir([int check,] string dir)\fP .br changes the script\(cq\&s working directory to \fIdir\fP (which may be specified as absolute or relative to the script\(cq\&s current working directory)\&. The first argument is optional: if omitted and changing the working directory fails then the \fBicmake\fP\-script ends with exit value 1; by specifying \fIP_NOCHECK\fP the function won\(cq\&t terminate the script but merely returns the script\(cq\&s current working directory\&. The script\(cq\&s working directory after completing the change\-dir request is returned as an absolute path, ending in a `/\(cq\& directory separator\&. .IP Use \fIchdir(\(dq\&\&.\(dq\&)\fP to merely obtain the current working directory; use \fIchdir(\(dq\&\(dq\&)\fP to change\-dir to the script\(cq\&s startup working directory; .IP .IP o \fIint exists(string file)\fP .br if \fIfile\fP exists, 1 is returned, otherwise 0 is returned; .IP .IP o \fIlist fgets(string file, list offset)\fP .br the next line found at offset value \fIoffset[3]\fP is read from \fIfile\fP\&. Pass an empty list to \fIfgets\fP to read \fIfile\fP from its beginning\&. .IP The returned list has four elements: .RS .IP o its first element ([0]) contains the read line (without the line\(cq\&s \fI\en\fP line terminator); .IP .IP o its second element ([1]) contains the line\(cq\&s \fI\en\fP line terminator (or an empty string if the line was not terminated by a \fI\en\fP); .IP .IP o its third element ([2]) contains the string \fIOK\fP if the line was successfully read and \fIFAIL\fP if reading from file failed; .IP .IP o its fourth element ([3]) contains the offset beyond the last read byte\&. .RE .IP To read multiple lines, pass the returned list as argument to \fIfgets\fP: .nf list ret; while (ret = fgets(\(dq\&filename\(dq\&, ret)) process(ret); .fi Be careful not to define \fIlist ret\fP in \fIwhile\(cq\&s\fP condition, as this will reset \fIret\fP to an empty list at each iteration; .IP .IP o \fIint fprintf(string filename, argument(s))\fP .br appends all (comma or left\-shift (insertion) operator separated) arguments to the file \fIfilename\fP\&. Returns the number of printed arguments\&. .IP If the first argument (following \fIfilename\fP) contains placeholders (\fI%1, %2, \&.\&.\&. %n\fP) then that argument is considered a format string (see also the function \fIstrformat\fP in the string functions section for additional information about format strings)\&. Some examples: .nf fprintf(\(dq\&out\(dq\&, \(dq\&hello\(dq\&, \(dq\&world\(dq\&, \(cq\&\en\(cq\&); fprintf << \(dq\&out\(dq\& << \(dq\&hello\(dq\& << \(dq\&world\(dq\& << \(cq\&\en\(cq\&; fprintf(\(dq\&out\(dq\&, \(dq\&%1 %2\en\(dq\&, \(dq\&hello\(dq\&, \(dq\&world\(dq\&); // 1 fprintf << \(dq\&out\(dq\& << \(dq\&hello\(dq\& << \(cq\& \(cq\& << \(dq\&world\(dq\& << \(cq\&\en\(cq\&; // 2 fprintf << \(dq\&out\(dq\& << \(dq\&%1 %2\en\(dq\& << \(dq\&hello\(dq\& << \(dq\&world\(dq\&; // 3 .fi When writing statement 1 using insertion operators (cf\&. the expression statement description in section \fIFLOW CONTROL\fP) statement 2 would normally be encountered, although statement 3, using the format string, would still be accepted; .IP .IP o \fIstring getch()\fP .br returns the next pressed key as a string (pressing the `Enter\(cq\&\-key is not required)\&. The pressed key is not echoed\&. If the key should be echoed use, e\&.g\&., \fIprintf(getch())\fP; .IP .IP o \fIstring gets()\fP .br returns the next line read from the keyboard as a \fIstring\fP\&. The line contains all entered characters until the `Enter\(cq\&\-key was pressed\&. The `Enter\(cq\&\-key\(cq\&s value itself is not stored in the returned string; .IP .IP o \fIlist makelist([int type = O_FILE], string mask)\fP .br the argument \fItype\fP is optional, in which case \fIO_FILE\fP is used\&. \fIMakelist\fP returns a list of all \fItype\fP file\-system entries matching \fImask\fP\&. E\&.g\&., \fImakelist(\(dq\&*\&.c\(dq\&)\fP returns a list containing all files ending in \fI\&.c\fP\&. For \fItype\fP one of the following set of values can be used to obtain a more specific selection of directory entries: .TS tab(~); ll ll ll ll ll c. symbol~meaning~ O_ALL~obtain all directory entries~ O_DIR~obtain all directories, including \&. and \&.\&.~ O_FILE~obtain a list of regular files~ O_SUBDIR~obtain all directories except for \&. and \&.\&.~ .TE In Unix\-type operating systems the pattern \fI*\fP does not match entries starting with a dot (hidden entries)\&. To obtain a list of such entries use the pattern \fI\&.*\fP; .IP .IP o \fIlist makelist([int type = O_FILE,] string mask, {newer,older,younger}, string comparefile)\fP .br the (optional) parameter \fItype\fP may be specified as in the previous variant of \fImakelist\fP\&. The third parameter must be either \fInewer\fP (or \fIyounger\fP) or \fIolder\fP\&. A list of all file\-system entries matching mask which are, resp\&., newer or older than a provided \fIcomparefile\fP is returned\&. Note that \fInewer\fP and \fIyounger\fP are operators, not strings; .IP .IP o \fIint printf(argument(s))\fP .br the function\(cq\&s (comma or left\-shift (insertion) operator separated) arguments are written to the standard output file (cf\&. the expression statement description in section \fIFLOW CONTROL\fP and this section\(cq\&s description of the \fIfprintf\fP function)\&. If the first argument contains \fI%1, %2, \&.\&.\&. %n\fP specifications then it\(cq\&s considered a format string (see also the function \fIstrformat\fP in the \fISTRING FUNCTIONS\fP section for additional information about format strings)\&. Like \fIfprintf printf\fP returns the number of printed arguments; .IP .IP o \fIlist stat([int check,] string entry)\fP .br Returns \fBstat\fP(2) information of directory entry \fIentry\fP as a list\&. The first argument is optional: if omitted and calling the system \fIstat\fP function fails then the \fBicmake\fP\-script ends with exit value 1; by specifying \fIP_NOCHECK\fP the function won\(cq\&t terminate the script but returns the return value (\-1) of the system \fIstat\fP function\&. .IP The returned list has two elements: .IP its first element ([0]) holds the entry\(cq\&s attributes\&. Attributes are returned as the file type and mode of the specified file (cf\&. \fBstat\fP(2) and \fBinode\fP(7))\&. E\&.g\&., .nf S_IRUSR \- owner has read permission S_IWUSR \- owner has write permission S_IXUSR \- owner has execute permission S_IFSOCK \- socket S_IFLNK \- symbolic link S_IFREG \- regular file S_IFBLK \- block device S_IFDIR \- directory S_IFCHR \- character device S_IFIFO \- FIFO .fi its second element ([1]) contains the entry\(cq\&s size in bytes\&. If \fIP_NOCHECK\fP was specified and \(cq\&entry\(cq\& doesn\(cq\&t exists then a list having one element is returned containing \-1\&. .PP \fBSYSTEM FUNCTIONS:\fP .PP .IP o \fIvoid arghead(string str)\fP .br support function of \fIexec()\fP (see also below at \fIexec()\fP): defines the `argument head\(cq\& that is used with \fIexec()\fP\&. By default, the `argument head\(cq\& is an empty string\&. The argument head is text that is prefixed to all \fIexec\fP arguments, like a directory in which provided arguments are found; .IP .IP o \fIvoid argtail (string str)\fP .br support function of \fIexec()\fP (see also below at \fIexec()\fP): defines the `argument tail\(cq\& that is used with \fIexec()\fP\&. By default, the `argument tail\(cq\& is an empty string\&. The argument tail is text that is appended to all \fIexec\fP arguments, like the extensions of files that are passed as arguments to \fIexec\fP; .IP .IP o \fIcmdhead(string str)\fP .br support function of \fIexec()\fP (see also below at \fIexec()\fP)\&. Defines a `command head\(cq\& that is used with \fIexec()\fP\&. By default it is an empty string\&. It can be used to specify, e\&.g\&., compiler options when the arguments themselves are modified by \fIarghead\fP and \fIargtail\fP\&. The \fIcmdhead\fP argument itself is not modified by \fIarghead\fP or \fIargtail\fP; .IP .IP o \fIcmdtail(string str)\fP .br support function of \fIexec()\fP (see also below at \fIexec()\fP)\&. Defines a `command tail that is used with \fIexec()\fP\&. By default it is an empty string\&. It can be used to specify a final argument (not modified by \fIarghead\fP and \fIargtail\fP); .IP .IP o \fIlist eval(string str)\fP .br this function can be used instead of the backtick operator (cf\&. section \fIOPERATORS\fP)\&. The example 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 .fi .IP .IP o \fIint exec([int check,] string cmd, argument(s))\fP .br Executes the command \fIcmd\fP with (optional) arguments\&. Each argument is prefixed by \fIarghead\fP and postfixed by \fIargtail\fP\&. Note that no blanks are inserted between \fIarghead\fP, argument(s), and \fIargtail\fP\&. The thus modified arguments are concatenated, separated by single blanks\&. \fICmdhead\fP is inserted between \fIcmd\fP and the first argument (delimited by single blanks) and \fIcmdtail\fP is appended to the arguments, separated by a single blank\&. \fIPATH\fP is searched to locate \fIcmd\fP\&. 0 is returned\&. .IP The first argument is optional: if omitted and the command does not return 0 the \fBicmake\fP script terminates\&. By specifying \fIP_NOCHECK\fP \fIexec\fP won\(cq\&t terminate the script but returns the called command\(cq\&s exit status, or \fI0x7f00\fP if the command wasn\(cq\&t found\&. .IP The remaining arguments may be ints, strings or lists\&. Int and list arguments are cast to strings\&. Their string representations are then appended to \fIcmd\fP; .IP .IP o \fIint execute([int checking,] string cmd, string cmdhead, string arghead, argument(s), string argtail, string cmdtail)\fP .br Same functionality as the previous function, but the \fIcmdhead, arghead, argtail,\fP and \fIcmdtail\fP are explicitly specified (and are reset to empty strings after executing \fIcmd\fP); .IP .IP o \fIexit(expression)\fP .br Ends the execution of an \fBicmake\fP\-script\&. The \fIexpression\fP must evaluate to an \fIint\fP value, which is used as the script\(cq\&s exit value; .IP .IP o \fIlist getenv(string envvar)\fP .br returns the value of environment variable \fIenvvar\fP in a list containing two elements: .IP if the first element ([0]) is \fI\(dq\&1\(dq\&\fP then the environment variable was defined; .IP environment variables are of the form \fIvariable=value\fP\&. If element \fI[0]\fP is \fI\(dq\&1\(dq\&\fP then the returned list\(cq\&s second element [1] holds the \fIvalue\fP part of the environment variable, which is empty if the environment variable is merely defined; .IP .IP o \fIint getpid()\fP .br returns the process\-id of the icmake byte code interpreter \fBicm\-exec\fP; .IP .IP o \fIint putenv(string envvar)\fP .br adds or modifies \fIenvvar\fP to the current \fBicmake\fP\-script environment\&. Use the format: \fI\(dq\&VAR=value\(dq\&\fP\&. Use \fI\(dq\&VAR\(dq\&\fP to remove \fI\(dq\&VAR\(dq\&\fP from the environment\&. The function returns 0 unless \fIenvvar\fP is empty, in which case 1 is returned; .IP .IP o \fIint system([int check,] string command)\fP .br executes \fIcommand\fP using the \fBsystem\fP(3) function\&. The first argument is optional: if omitted and calling the \fBsystem\fP(3) function does not return 0 then the \fBicmake\fP\-script ends with exit value 1; by specifying \fIP_NOCHECK\fP \fBicmake\fP\(cq\&s \fIsystem\fP function won\(cq\&t terminate the script but returns the return value of the \fBsystem\fP(3) function (normally the executed command\(cq\&s exit value)\&. The string \fIcommand\fP may use redirection and/or piping\&. .PP .SH "USER DEFINED FUNCTIONS" .PP In addition to \fImain\fP additional functions are usually defined\&. Once defined, they can be called\&. Forward referencing of either variables or functions is not supported, but calling functions recursively is\&. As function declarations are not supported indirect recursion cannot be used\&. .PP User\-defined functions must have the following elements: .IP o The function\(cq\&s return type, which must be \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 (\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)\&. .PP Function bodies may contain variable definitions (optionally initialized at their definitions)\&. Variable definitions start with a type name, followed by one or more comma separated and optionally initialized variable identifiers\&. .PP If a variable is not explicitly initialized it is initialized by default: \fIint\fP variables are initialized to 0, \fIstring\fP variables are initialized to empty strings (\fI\(dq\&\(dq\&\fP) and \fIlist\fP variables are initialized to empty lists\&. .PP Function bodies may also contain zero or more statements (cf\&. section \fBFLOW CONTROL\fP)\&. Note that variables may be defined (and optionally initialized) anywhere inside functions where expression statements can be used, and also in the condition sections of \fIif, for,\fP and \fIwhile\fP statements and in the initialization sections of \fIif\fP andd \fIfor\fP statements\&. .PP .SH "EXAMPLE" .PP In the following example all \fBC++\fP source files in the current directory are compiled unless their object files are more recent\&. The main function creates a list of source files and then passes each of them to a function \fIinspect\fP\&. That function inspects whether the source file is younger than its object file, and if so it calls \fIcompile\fP\&. The function \fIcompile\fP uses \fIexec\fP to call the compiler\&. If a compilation fails the script stops so the error can be repaired\&. Source files for which the compilation succeeded are not recompiled when the script is rerun\&. Assuming the script is named \fIcompile\&.im\fP then it can be called using \fIicmake \-s compile\&.im\fP\&. This also creates \fIcompile\&.bim\fP, so after the \fI\-s\fP call the command \fIicmake \-e compile\&.bim\fP can be used to immediately execute the bim\-file: .PP .nf void compile(string src) { exec(\(dq\&g++ \-c \(dq\& + src); // compile \(cq\&src\(cq\& } void inspect(string src) { // get the obj\-file\(cq\&s name: // only compile if necessary if (src younger change_ext(src, \(dq\&\&.o\(dq\&)) compile(src); } int main() { // find all \&.cc source files list sources = makelist(\(dq\&*\&.cc\(dq\&); for ( // visit all source files int idx = 0, end = listlen(sources); idx != end; ++idx ) inspect(sources[idx]); // compile if needed } .fi .PP .SH "SEE ALSO" \fBicmake\fP(1), \fBicmbuild\fP(1), \fBicmconf\fP(7), \fBicmstart\fP(1), \fBicmstart\&.rc\fP(7) .PP .SH "BUGS" Standard comment starting on lines containing preprocessor directives may not extend over multiple lines\&. .PP Path names containing blanks are not supported\&. .PP .SH "COPYRIGHT" This is free software, distributed under the terms of the GNU General Public License (GPL)\&. .PP .SH "AUTHOR" Frank B\&. Brokken (\fBf\&.b\&.brokken@rug\&.nl\fP)\&. .PP icmake-10.03.00/doc/icmstart.rc.70000644000175000017500000001111714204245360015237 0ustar frankfrank.TH "icmstart\&.rc" "7" "1992\-2022" "icmake\&.10\&.03\&.00" "icmstart resource file" .PP .SH "NAME" icmstart\&.rc \- The icmstart(1) resource file .PP .SH "DESCRIPTION" .PP The \fBicmstart\&.rc\fP file specifies files that are installed by \fBicmstart\fP(1)\&. .PP A default \fBicmstart\&.rc\fP is found in \fI/etc/icmake/icmstart\&.rc\fP, but if \fI$HOME/\&.icmake/icmstart\&.rc\fP exists then the latter file is used by \fBicmstart\fP(1)\&. \fI$HOME/\&.icmake/icmstart\&.rc\fP in turn is overruled by specifying a \fI\-c\fP option when invoking \fBicmstart\fP(1)\&. .PP The default resource file contains the following specifications, preparing for the construction of a \fBC++\fP program using \fBicmbuild\fP(1): .nf CLASSES icmconf P main\&.cc P main\&.ih P usage\&.cc P version\&.cc P ? scanner P ? parser .fi 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 an optional installation mode followed by a source\-destination specification\&. .PP .SH "INSTALLATION MODE" .PP An installation mode consists of a combination of: .IP o either a \fIP\fP (don\(cq\&t install with \fIicmstart xxx library\fP) or an \fIL\fP (don\(cq\&t install with \fIicmstart xxx program\fP); .IP .IP o a \fID\fP, 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 \fIb\fP, 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 \fI P, L, D,\fP or \fIb\fP character 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 "SOURCE\-DESTINATION SPECIFICATIONS" .PP The following source\-destination specifications can be used in an \fIicmstart\&.rc\fP file (using \fIskeletons\fP below to refer to \fIicmstart\(cq\&s\fP skeleton files directory): .IP o \fIsource\fP .br a file named \fIsource\fP must exist in \fIskeletons\fP\&. It is installed in the destination directory \fI`dest\(cq\&\fP that\(cq\&s specified when calling \fBicmstart\fP(1)\&. Example: .nf CLASSES .fi \fIskeletons/CLASSES\fP is installed as \fIdest/CLASSES\fP; .IP .IP o \fIpathspec\fP .br if `pathspec\(cq\& does not begin with a slash it must exist in \fIskeletons\fP\&. It is installed as `pathspec\(cq\& in the destination directory specified when calling \fBicmstart\fP(1)\&. Example: .nf dir/file .fi \fIskeletons/file\fP is installed as \fIdest/dir/file\fP; .IP .IP o \fI/pathspec\fP or \fI~/pathspec\fP .br 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 .PP 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 # skeletons/CLASSES is installed as # dest/CLASSES dir/file dir/file # skeletons/dir/file is installed as # dest/dir/file ~/\&.icmake/file \&.icmake/file # $HOME/\&.icmake/file is installed as # dest/\&.icmake/file .fi Icmstart converts destination specifications to absolute paths\&. If these absolute paths do not begin with \fIdest\(cq\&s\fP absolute path then an error message is displayed and \fBicmstart\fP ends\&. .PP .SH "FILES" The mentioned paths are sugestive only and may be installation dependent: .IP o \fB/usr/share/icmake/icmconf\fP: example of an \fBicmbuild\fP configuration file; .IP o \fB/usr/share/icmake/CLASSES\fP: example of an \fBicmbuild\fP \fICLASSES\fP file; .IP o \fB/usr/share/icmake/icmstart\&.rc\fP: default skeleton resource file\&. .PP .SH "SEE ALSO" \fBicmake\fP(1), \fBicmbuild\fP(1), \fBicmconf\fP(7), \fBicmstart\fP(1) .PP .SH "BUGS" None reported .PP .SH "COPYRIGHT" This is free software, distributed under the terms of the GNU General Public License (GPL)\&. .PP .SH "AUTHOR" Frank B\&. Brokken (\fBf\&.b\&.brokken@rug\&.nl\fP)\&. .PP icmake-10.03.00/doc/icmbuild.10000644000175000017500000003047114204245360014574 0ustar frankfrank.TH "icmbuild" "1" "1992\-2022" "icmake\&.10\&.03\&.00" "Icmake\(cq\&s generic program maintenance facility" .PP .SH "NAME" icmbuild \- A generic, C++/C program maintenance facility .PP .SH "SYNOPSIS" \fIicmbuild\fP [\-h] [\-c] \fIargs\fP .PP .SH "DESCRIPTION" .PP \fIIcmbuild\fP is a small \fBC\fP program calling \fBicmake\fP(1) to do program maintenance as defined by the \fIicmbuild\fP script that\(cq\&s (commonly) found in \fI/usr/lib/icmake\fP\&. .PP \fIIcmbuild\(cq\&s\fP actions are tailored through a configuration file (\fIicmconf\fP) which must be present in the directory where program maintenance is requested\&. This file is automatically installed by \fBicmstart\fP(1)\&. Refer to \fBicmconf\fP(7)\(cq\&s man\-page for details about this file\&. .PP \fIIcmbuild\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 \fIicmbuild\fP\&. In that example it is assumed that \fBC++\fP sources are maintained, but program maintenance for, e\&.g\&., \fBC\fP sources can also easily be configured\&. If \fIicmbuild\fP is called, but \fIicmconf\fP is not available it displays a usage\-summary after which icm() ends\&. .PP \fIIcmbuild\fP() handles the maintenance for all sources in each of the subdirectories named in the file \fICLASSES\fP, and also of all sources in the current working directory\&. `Maintenance\(cq\& involves compiling all as yet uncompiled source files, recompilation of modified source files, optionally library maintenance and optionally the pre\-compilation of header files, which normally results in a marked reduction of source compilation times\&. .PP When source files are compiled object modules are produced which may be stored in a library, against which the object module of the program\(cq\&s \fImain\fP function is linked\&. It is also possible to specify additional libraries against which the program must be linked\&. .PP If a library is constructed it is kept up to date by \fIicmbuild\fP\&. When a source is successfully compiled its new object module replaces the old one in the library\&. At that point the separate object files are no longer required and are removed by \fIicmbuild\fP\&. .PP .SH "KICK\-STARTING ICMBUILD" .PP To use \fIicmbuild\fP do as follows: .IP o Install \fIicmbuild\fP in your path (\fIicmake\(cq\&s\fP installation procedure should already have taken care of that); .IP o Copy \fIicmconf\fP (and probably a file \fICLASSES\fP) to your project\(cq\&s base directory (i\&.e\&., the directory where and below which the project\(cq\&s sources are found)\&. Usually this has already been taken care of by the (icmstart) script; .PP Next: .IP o Modify the \fI#defines\fP in the file \fIicmconf\fP to taste; .IP .IP o 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 \fICLASSES\fP \fIis\fP relevant in that new class (subdirectory) names can always be added to the end of the file \fICLASSES\fP, but reordering the lines in the \fICLASSES\fP file should be avoided as that may easily result in overwriting identically named object files from already existing directories\&. .IP If reordering is necessary, then first run the command \fIicmbuild clean\fP to remove all files that were thus far created by \fIicmbuild\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 because of the number\-prefixes replacement of a file \fIx\&.o\fP from class \fIA\fP by file \fIx\&.o\fP from class \fIB\fP is prevented; .IP .IP o Start \fIicmbuild\fP\&. .PP The next section covers \fIicmbuild\(cq\&s\fP modes of operation\&. .PP .SH "OPTIONS" .PP \fIIcmbuild\fP recognizes three options of which only one can be specified\&. See the following section for information about which option is recognized by by which \fIicmbuild\fP command\&. .IP o \fI\-h\fP: display usage information (which is also automatically shown when the current directory does not contain a file \fIicmconf\fP) and terminate \fIicmbuild\fP; .IP o \fI\-c\fP: clear the screen (by calling \fItput clear\fP) before starting the compilation process; .IP o \fI\-s\fP: strip the compiled program or library at its installation directory (see the various \fIinstall\fP modes below)\&. .PP .SH "ICMBUILD COMMANDS" .PP \fIIcmbuild\fP recognizes the following commands (possible options are shown between square brackets)\&. With the \fIinstall\fP commands a \fIpath\fP argument must be specified, which must be an existing user\-writable directory: .IP o \fIclean\fP .br clean up remnants of previous actions (the directory specified by the \fITMP_DIR\fP define in \fIicmconf\fP is removed)\&. If precompiled headers were created (i\&.e\&., \fIPRECOMP\fP in \fIicmconf\fP was specified) then all files having extension \fI\&.gch\fP in the main directory and in the directories listed in the \fICLASSES\fP file are also removed\&. If \fIUSE_ALL\fP was specified then those files are also removed; .IP .IP o \fIcleangch\fP .br all \fI\&.gch\fP files that were precompiled are removed (whether existing in the \fIgch\fP subdirectory of the \fITMP_DIR\fP directory (specified in \fIicmconf\fP), or in directories specified in the \fICLASSES\fP file, or in the project\(cq\&s main directory)\&. If \fIicmconf\fP does not specify \fIPRECOMP\fP then nothing happens; .IP .IP o \fIcleantmp\fP .br same as \fIicmbuild clean\fP, but the \fI\&.gch\fP files and files specified by the \fIUSE_ALL\fP define in \fIicmconf\fP are not removed; .IP .IP o \fI[\-s] install program path\fP .br install the constructed program in the specified \fIpath\fP (to be used after issuing \fIicmbuild\fP \fIprogram\fP, see below)\&. Path can be absolute or relative and may optionally specify the name of the installed program\&. Example: .nf icmbuild install program ~/bin/prog .fi This installs the constructed binary program in the user\(cq\&s \fIbin\fP directory with the name \fIprog\fP; .IP .IP o \fI[\-s] install static path\fP .br install the constructed static library in the specified path (to be used after issuing \fIicmbuild\fP \fIlibrary\fP, see below)\&. Path can be absolute or relative and may optionally specify the name of the installed library\&. Example: .nf icmbuild install static /usr/lib/ .fi This installs the constructed static library (assume its name is \fIlibspecial\&.a\fP) in \fI/usr/lib\fP as \fI/usr/lib/libspecial\&.a\fP\&. .br .IP .IP o \fI[\-s] install shared path\fP when using this installation command, \fIicmconf\fP must contain \fI#define SHARED\fP (cf\&. \fBicmconf\fP(7))\&. It installs the constructed shared library in the specified path (to be used after issuing \fIicmbuild\fP \fIlibrary\fP)\&. Path can be absolute or relative, and must specify an existing directory\&. Example: .nf icmbuild install shared /usr/lib/ .fi This installs the constructed binary shared library (e\&.g\&. \fIlibspecial\&.so\fP) in \fI/usr/lib\fP as \fI/usr/lib/libspecial\&.so\fP\&. In addition, the soft\-links .nf libspecial\&.so \-> libspecial\&.so\&.X libspecial\&.so\&.X \-> libspecial\&.so\&.X\&.Y\&.Y\&.Z .fi are defined in \fI/usr/lib\fP, where \fIX\&.Y\&.Z\fP are the major, minor and subminor versions defined in the file \fIVERSION\fP\&. .IP .IP o \fI[\-c] library\fP .br do library maintenance (builds a static and optionally (if \fIicmconf\fP defines \fISHARED\fP) a shared (dynamic) library); .IP .IP o \fI[\-c] program\fP .br do program maintenance (builds a program from the sources in the current working directory and from the sources in the directories specified in the file \fICLASSES\fP); .IP .IP o If no commands are specified (but optionally only \fI\-c\fP) then the \fIDEFCOM\fP specification in the \fIicmconf\fP is inspected\&. Recognized specifications are: .nf #define DEFCOM \(dq\&program\(dq\& .fi which is quivalent to the command \fIicmbuild\fP \fI[\-c] program\fP; .br if \fIDEFCOM\fP is specified as .nf #define DEFCOM \(dq\&library\(dq\& .fi then this is quivalent to the command \fIicmbuild\fP \fI[\-c] library\fP\&. .br .IP If an explicit command is passed to \fIicmbuild\fP then \fIDEFCOM\fP specifications are ignored\&. .PP .SH "ICM\-DEP" .PP Class dependencies are handled by \fIicmake\fP\(cq\&s support program \fIicm\-dep\fP\&. It can be called from \fIicmake\fP by passing it the option \fI\-d\fP\&. All options and arguments following \fI\-d\fP are forwared to \fIicm\-dep\fP\&. .PP The program \fIicm\-dep\fP is automatically called by \fIicmbuild\fP to handle class dependencies\&. Consider two classes \fIOptions\fP and \fIProcess\fP\&. If \fIProcess\fP uses \fIOptions\fP and if precompiled header files are used, then in addition to \fIOption\(cq\&s\fP header file, \fIProcess\(cq\&s\fP header must also be precompiled if \fIOption\(cq\&s\fP header file changes\&. Likewise, if \fIOption\(cq\&s\fP data organization is altered and \fIOption\fP defines inline members used by \fIProcess\fP or \fIProcess\fP defines an \fIOption\fP data member then, in addition to \fIOption\(cq\&s\fP sources sources \fIProcess\(cq\&s\fP sources must also be compiled\&. For the latter case \fIicmconf\fP provides the \fIUSE_ALL\fP specification: if a \fI`USE_ALL\(cq\&\fP file exists in a directory, then all sources of that directory are recompiled\&. .PP The program \fIicm_dep\fP determines the program\(cq\&s class dependencies, and recompiles class header files of all classes depending on classes whose header files must be recompiled\&. Furthermore, if a \fI`USE_ALL\(cq\&\fP file exists in a directory then all sources of classes depending on that directory\(cq\&s class are also recompiled\&. .PP \fIIcm\-dep\(cq\&s\fP options are described in \fBicmake\fP(1)\(cq\&s man\-page\&. .PP To start its work, \fIicm_dep\fP needs one command\-line argument: \fIgo\fP\&. Any other argument results in \fIicm_dep\fP performing a `dry run\(cq\&: it performs all its duties (and verbose messages are displayed as if \fIgo\fP had been specified), but no files (precompiled headers or \fIUSE_ALL\fP files) are touched or removed\&. If neither options nor arguments are specified \fIicm_dep\fP writes its usage summary to the standard output\&. .PP By default \fIicmbuild\fP calls \fIicmake \-d \-V go\fP: \fIicm_dep\fP is called to perform its duties and to show its actions on the standard output stream\&. By specifying a \fI#define ICM_DEP\fP parameter in the \fIicmconf\fP file this default can be overruled (cf\&. \fBicmconf\fP(7))\&. .PP .SH "FILES" .PP The mentioned paths are sugestive only and may be installation dependent: .IP o \fB/usr/share/icmake/icmconf\fP Unabbreviated example of an \fIicmbuild\fP configuration file; .IP o \fB/usr/share/icmake/CLASSES\fP Example of an \fIicmbuild\fP \fICLASSES\fP file\&. .PP .SH "EXAMPLES" .PP Here is an example of the configuration file \fIicmconf\fP for a concrete program, using facilities of the \fIbobcat\fP library: .nf #define CLS #define LIBRARY \(dq\&modules\(dq\& #define MAIN \(dq\&main\&.cc\(dq\& #define SOURCES \(dq\&*\&.cc\(dq\& #define OBJ_EXT \(dq\&\&.o\(dq\& #define SHAREDREQ \(dq\&\(dq\& #define TMP_DIR \(dq\&tmp\(dq\& #define USE_ALL \(dq\&a\(dq\& #define USE_ECHO ON #define CXX \(dq\&g++\(dq\& #define CXXFLAGS \(dq\& \-\-std=c++20 \-Wall \-O2 \-pthread\(dq\& \(dq\& \-fdiagnostics\-color=never \(dq\& #define IH \(dq\&\&.ih\(dq\& #define PRECOMP \(dq\&\-x c++\-header\(dq\& #define REFRESH #define LDFLAGS \(dq\&\(dq\& #define ADD_LIBRARIES \(dq\&bobcat\(dq\& #define ADD_LIBRARY_PATHS \(dq\&\(dq\& #define DEFCOM \(dq\&program\(dq\& .fi .PP .SH "SEE ALSO" \fBicmake\fP(1), \fBicmconf\fP(7), \fBicmstart\fP(1), \fBicmstart\&.rc\fP(7) .PP .SH "BUGS" None reported .PP .SH "COPYRIGHT" This is free software, distributed under the terms of the GNU General Public License (GPL)\&. .PP .SH "AUTHOR" Frank B\&. Brokken (\fBf\&.b\&.brokken@rug\&.nl\fP)\&. .PP icmake-10.03.00/doc/icmake.10000644000175000017500000006062014204245360014234 0ustar frankfrank.TH "icmake" "1" "1992\-2022" "icmake\&.10\&.03\&.00" "A program maintenance utility" .PP .SH "NAME" icmake \- A program maintenance (\fImake\fP) utility using a \fBC\fP\-like grammar .PP .SH "SYNOPSIS" \fBicmake\fP option(s) \fI[source [dest]]\fP [args] .PP .SH "DESCRIPTION" .PP \fBIcmake\fP(1) is a generic tool handling program maintenance that can be used as an alternative for \fBmake\fP(1)\&. It\(cq\&s a generic tool in that \fIicmake\fP\-scripts, written in a language closely resembling the \fBC\fP programming language, can perform tasks that are traditionally the domain of scripting languages\&. .PP \fBIcmake\fP allows programmers to use a programming language (closely resembling the well\-known \fBC\fP\-programming language) to define the actions that are required for (complex) program maintenance\&. For this, \fBicmake\fP offers various special operators as well as a set of support functions that have shown their usefulness in program maintenance\&. .PP Although \fBicmake\fP scripts can be written from scratch, often the required activities are highly comparable\&. This observation resulted in the construction of two \fBicmake\fP scripts, which are part of the standard \fBicmake\fP distribution: \fBicmstart\fP(1), initializing a directory for program development and \fBicmbuild\fP(1), handling the actual program maintenance\&. By default both scripts are tailored to initializing and maintaining \fBC++\fP programs (or, after minimal adaptation, \fBC\fP programs), but can easily be adapted to other programming languages\&. Both \fBicmstart\fP and \fBicmbuild\fP can be run without explicitly calling \fBicmake\fP\&. .PP This man\-page covers \fBicmake\fP (the program), and its support programs\&. Refer to the \fBicmstart\fP(1)) man\-page for information about how a directory can be initialized (created) in which (by default) a \fBC++\fP or \fBC\fP program can be developed and refer to the \fBicmbuild\fP(1) man\-page for information about how \fBicmbuild\fP can be used to handle program maintenance\&. Refer to the bv(icmscript)(7) man\-page for a description of the syntax and facilities offered by \fBicmake\(cq\&s\fP scripting language\&. .PP \fBIcmake\fP does not offer an \fIIntegrated Development Environment\fP (IDE)\&. \fBIcmake\fP merely performs tasks for which scripts can be written, and only a minimal set of pre\-defined scripts (\fBicmstart\fP and \fBicmbuild\fP) that have shown their usefulness when developing and maintaining programs are included in \fBicmake\(cq\&s\fP distribution\&. .PP In its standard activation modes, \fBicmake\fP uses the following support programs: .IP o \fIicm\-pp\fP to pre\-process the icmake file .IP o \fIicm\-comp\fP to byte\-code compile the \fBicmake\fP \fBs\fP .IP o \fIicm\-dep\fP to handle class\-dependencies (see the \fBICM\-DEP\fP section in this man\-page for more information about \fIicm\-dep\fP)\&. .IP o \fIicm\-exec\fP to execute the byte\-code file .PP In addition, primarily used for illustration, education, and debugging, the program \fIicmun\fP is available to disassemble compiled \fBicmake\fP byte\-code (\&.bim) files (`\fIbim\-files\fP\(cq\&)\&. \fBIcmun\fP is not installed in a standard \fIPATH\fP directory but in \fIicmake\(cq\&s\fP \fIlib\fP directory, which commonly is \fI/usr/lib/icmake\fP (see also section \fBICMUN\fP in this man\-page)\&. .PP Traditional make\-utilities recompile sources once header files are modified\&. When developing \fBC++\fP programs this is often not required, as adding new member functions to classes does not require you to recompile all source files of those classes\&. To handle class dependencies \fBicmbuld\fP(1) may optionally inspect class dependencies, (re)compiling sources of dependent classes when necessary\&. By default, class\-dependencies are not interpreted, but they are when the \fIPRECOMP\fP and/or \fIUSE_ALL\fP defines, found in the file \fIicmconf\fP file, are activated\&. Refer to the \fBicmconf\fP(7) man\-page for details\&. .PP This manpage describes \fBicmake\fP\(cq\&s options in the next section, followed by two sections covering the support programs .IP o \fBICM\-DEP\fP .br \- the \fBicm\-dep\fP dependency analyzer; .IP o \fBICMUN\fP .br \- \fBicmake\(cq\&s\fP unassembler\&. .PP Refer to the \fBicmscript\fP(7) man\-page for a description of \fBicmake\(cq\&s\fP \fBC\fP\-like scripting language\&. .PP .SH "OPTIONS" .PP Where available, single letter options are listed between parentheses beyond their associated long\-option variants\&. \fBIcmake\fP defines \fIaction\fP options and \fInon\-action\fP options\&. The first action option that is encountered is used\&. .PP The following action options write some text to the standard output stream, whereafter \fBicmake\fP ends: .IP o \fB\-\-about\fP (\fB\-a\fP) .br Shows some information about \fBicmake\fP; .IP .IP o \fB\-\-help\fP (\fB\-h\fP) .br Provides usage info, returning 0 to the operating system\&. Usage information is also provided if \fBicmake\fP is started without providing arguments\&. In that case 1 is returned to the operating system; .IP .IP o \fB\-\-version\fP (\fB\-v\fP) .br Displays \fBicmake\fP\(cq\&s version\&. .PP The remaining action options require additional options and/or arguments, and most of them process \fBicmake\fP source\- or bim\-files\&. Several of these action options write output files\&. By default these files are located in the same directories as the source files\(cq\& directories\&. .PP The remaining action options are: .IP o \fB\-\-compile\fP (\fB\-c\fP) \fI[options] source [bim\-file]\fP .br The \fIsource\fP file is first pre\-processed (by \fIicm\-pp\fP) whereafter the pre\-processed file is compiled (by \fIicm\-comp\fP), producing a \fIbim\-file\fP\&. If the \fIbim\-file\fP name is not specified then \fIsource\(cq\&s\fP base\-name, receiving extension \fI\&.bim\fP, is used\&. .br If the bim\-file exists and is younger than \fIsource\fP then \fIsource\fP is not compiled\&. .br With this option pre\-processor symbol\-defining options can be used: symbols having values 1 which can be used in \fIsource\fP\&. E\&.g\&., when issuing the command .nf icmake \-c \-d one \-\-define two source dest\&.bim .fi then \fBicmake\fP compiles \fIsource\fP, defines the pre\-processor symbols \fIone\fP and \fItwo\fP (each having value 1), and produces the bim\-file \fIdest\&.bim\fP\&. Note that instead of using long options \fI\-\-define\fP short options \fI\-d\fP can also be used\&. .br If \fIsource\fP is a previously pre\-processed file then option \fI\-P\fP must be specified to compile it\&. E\&.g\&., .nf icmake \-c \-P source dest\&.bim .fi .IP .IP o \fB\-\-dependencies\fP (\fB\-d\fP) \fI[options] action\fP .br \fBIcmake\fP calls \fBicm\-dep\fP to determine the dependencies among classes\&. All options and arguments following this option are forwarded to \fBicm\-dep\fP\&. Refer to the \fBICM\-DEP\fP section of this man\-page for information about \fIicm\-dep\fP; .IP .IP o \fB\-\-execute\fP (\fB\-e\fP) \fI[option] bim\-file [arguments]\fP .br Executes the bim\-file, specified as \fBicmake\fP\(cq\&s first file argument\&. Before the \fIbim\-file\fP option \fI\-\-no\-version\-check\fP (or the equivalent short option \fI\-n\fP) can be specified to allow mismatches between \fBicmake\fP\(cq\&s main version and the \fBicmake\fP version that was used to compile the bim\-file\&. See also the description of the \fI\-\-no\-version\-check\fP option at the description of the non\-action options below\&. .br Options and arguments specified beyond the \fIbim\-file\fP are forwarded as arguments to the \fIbim\-file\(cq\&s main\fP function (refer to the \fBicmscript\fP(7) man\-page for details about how to write \fBicmake\fP\-scripts); .IP .IP o \fB\-\-force\fP (\fB\-f\fP) \fI[options] source [bim\-file]\fP .br Acts like option \fI\-\-compile\fP, but compilation is always performed, even if the bim\-file is up\-to\-date\&. As with \fI\-\-compile\fP, if \fIsource\fP is a previously pre\-processed file then option \fI\-P\fP must be specified to compile it\&. E\&.g\&., .nf icmake \-f \-P source dest\&.bim .fi .IP .IP o \fB\-\-preprocess\fP (\fB\-p\fP) \fI[options] source [pim\-file]\fP .br The file specified as first argument is pre\-processed, producing a `\fI\&.pim\fP\(cq\& file\&. If a second filename argument is provided then that file becomes the \fI\&.pim\fP file\&. If not specified, then the first filename, using the extension \fI\&.pim\fP, is used\&. .br With this option pre\-processor symbol\-defining options can be used: symbols having values 1 which can be used in \fIsource\fP\&. E\&.g\&., when issuing the command .nf icmake \-p \-d one \-\-define two source dest\&.pim .fi then \fBicmake\fP pre\-processes \fIsource\fP, defines the pre\-processor symbols \fIone\fP and \fItwo\fP (each having value 1), and produces the pim\-file \fIdest\&.pim\fP\&. Note that instead of using long options \fI\-\-define\fP short options \fI\-d\fP can also be used; .IP .IP o \fB\-\-source\fP (\fB\-s\fP) \fI[options] source [arguments]\fP .br \fBIcmake\fP uses \fI\-\-compile\fP to compile the \fBicmake\fP source file specified as first argument (constructing the default bim\-file if necessary) and then uses \fI\-\-execute\fP to execute the bim\-file, forwarding any subsequent \fIarguments\fP as\-is to the \fIbim\-file\(cq\&s main\fP function\&. .br With this option pre\-processor options as well as the \fI\-\-no\-version\-check\fP execute option can be used\&. When using the latter option it must follow the pre\-processor options (if specified) and it must be preceded by \fI\-\-execute\fP (or \fI\-e\fP)\&. E\&.g\&., when issuing the command .nf icmake \-s \-d one \-en source .fi then \fBicmake\fP first compiles \fIsource\fP, defining the pre\-processor symbol \fIone\fP, and then executes the bim\-file, passing \fI\-\-no\-version\-check\fP to \fIicm\-exec\fP; .IP .IP o \fB\-t\fP \fItmpspec\fP \fI[options] source [arguments]\fP .br This option is intended for \fBicmake\fP\-scripts although it can also be used in a command\-line \fBicmake\fP call\&. Its argument \fItmpspec\fP is either a single dot (as in \fI\-t\&.\fP) in which case \fBicmake\fP determines the name of the bim\-file in the directory \fBicmake\fP uses for temporary files (see option \fI\-\-tmpdir\fP below), or it uses \fItmpspec\fP as the filename to write the bim\-file to (which file is also removed once the script\(cq\&s execution ends)\&. .br At the \fIoptions\fP pre\-processor options as well as the \fI\-\-no\-version\-check\fP execute option can be specified\&. When using the latter option it must follow the pre\-processor options (if specified) and it must be preceded by \fI\-\-execute\fP (or \fI\-e\fP)\&. .br The argument \fIsource\fP is the name of the \fBicmake\fP script to process, and \fIsource\fP may optionally be followed by \fIarguments\fP\&. Those arguments are forwarded as\-is to the script\(cq\&s \fImain\fP function, where they appear as elements of its \fIlist argv\fP parameter\&. .IP Rather than using the explicit command\-line call \fIicmake \-t\&. \&.\&.\&.\fP the \fI\-t\fP option is normally used in the first line of an (executable) (so usually \fIchmod +x source\fP has been specified before calling the script), where its pre\-processor and execute options can also be specified\&. For example after writing the executable script \fIhello\fP: .nf #!/usr/bin/icmake \-t\&. int main(int argc, list argv) { printf << \(dq\&hello: \(dq\& << argv << \(cq\&\en\(cq\&; } .fi it can be called as \fIhello one \-two \-\-three\fP, producing output like: .nf hello: /tmp/10434\&.bim\&.MKqvAb one \-two \-\-three .fi (the name following \fIhello:\fP will be different, as it is the name of the compiled temporary bim\-file)\&. If \fBicmake\fP pre\-process and/or execute options are required they can be specified in the first line, following the \fI\-t\fP option\&. E\&.g\&., .nf #!/usr/bin/icmake \-t\&. \-d one \-\-define two .fi .IP .IP o \fB\-\-unassemble\fP (\fB\-u\fP) .br The file specified as first argument is an \fBicmake\fP bim\-file, which is unassembled\&. Refer to the \fBicmun\fP section further down this man\-page for more information about \fIicmun\fP; .IP The program \fIicmun\fP unassembles bim\-files\&. This program also supports the \fI\-\-no\-version\-check\fP (\fI\-n\fP) option\&. .PP Finally, there are some (non\-action) options that can be specified before specifying action options: .PP .IP o \fB\-\-no\-process\fP (\fB\-N\fP) .br Implies option \fI\-\-verbose\fP\&. This option may precede options \fI\-d, \-e, \-s\fP and \fI\-t\fP (either as two separate options or by `gluing\(cq\& both options together, like \fI\-Ne\fP)\&. When specified, the actions are not activated, but the command(s) that would have been used are shown to the standard output; .IP .IP o \fB\-\-no\-version\-check\fP (\fB\-n\fP) .br This option is available with the action options \fI\-\-execute, \-\-source, \-\-unassemble\fP, and \fI\-t\fP\&. When specified the main versions of icm\-bim files and \fBicmake\fP itself may differ\&. This option should normally not be used, and was added for development purposes only; .IP .IP o \fB\-\-tmpdir\fP=\fIdirectory\fP (\fB\-T\fP) .br The specified directory is used for storing temporary files\&. E\&.g\&., when compiling an \fBicmake\fP script, the output of \fBicmake\fP\(cq\&s preprocessor is written to a temporary file which is removed when \fBicmake\fP ends\&. 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; .IP .IP o \fB\-\-verbose\fP (\fB\-V\fP) .br The child processes and their arguments are written to the standard output stream before they are called\&. This option may precede options \fI\-d, \-e, \-s\fP and \fI\-t\fP (either as two separate options or by `gluing\(cq\& both options together, like \fI\-Ve\fP)\&. .PP .SH "ICM\-DEP" .PP \fBIcm\-dep\fP is a support program called by \fBicmake\fP to determine source\- and precompiled\-header file dependencies\&. \fBIcm\-dep\fP can be used for software projects that are developed as described in the C++ Annotations, section \fIHeader file organization\fP in chapter \fIClasses\fP\&. For those projects classes are developed in their own directories, which are direct sub\-directory of the project\(cq\&s main program directory\&. Their class interfaces are provided in class\-header files bearing the names of the class\-directories, and all headers that are required by the class\(cq\&s sources are declared in a separate \fIinternal header\fP filed, commonly having extensions \fI\&.ih\fP\&. .PP \fBIcmake\fP automatically calls \fBicm\-dep\fPd when \fIUSE_ALL\fP or \fIPRECOMP\fP is specified in \fIicmconf\fP files\&. By default it is called with arguments \fI\-V go\fP\&. The \fI#define ICM_DEP\fP define\-specification in the \fIicmconf\fP file can be used to specify a different set of options\&. .PP When \fBicm\-dep\fP is activated (i\&.e\&., its argument \fIgo\fP is specified) then \fBicm\-dep\fP determines directory dependencies, touching all files in directories that depend on directories containing modified files, and/or removing precompiled headers if they include headers from other directories that were modified\&. By providing another argument than \fIgo\fP \fBicm\-dep\fP performs a `dry run\(cq\&: it analyzes dependencies, but it won\(cq\&t remove or touch files\&. .PP Options of \fBicm\-dep\fP may be specified immediately following \fBicmake\fP\(cq\&s \fI\-\-dependencies\fP option\&. \fBIcm\-dep\fP supports the following options: .IP o \fB\-\-classes\fP=\fIfilename\fP (\fB\-c\fP) .br By default, \fBicm\-dep\fP inspects dependencies of the directories mentioned in the file \fICLASSES\fP\&. Furthermore, if the \fBicmconf\fP(7) file specifies \fIPARSER_DIR\fP and \fISCANNER_DIR\fP then those directories are also considered\&. Use this option to specify the file containing the names of directories to be inspected by \fBicm\-dep\fP\&. .IP .IP o \fB\-\-help\fP (\fB\-h\fP) .br \fBIcm\-dep\fP writes a summary of its usage to the standard output and terminates, returning 0 to the operating system; .IP .IP o \fB\-\-icmconf\fP=\fIfilename\fP (\fB\-i\fP) .br By default \fBicm\-dep\fP inspects the content of \fIicmconf\fP files, This option is used if instead of \fIicmconf\fP another file should be inspected; .IP .IP o \fB\-\-mainih\fP=\fImainheader\fP (\fB\-m\fP) .br In the \fIicmconf\fP file the \fI#define IH\fP parameter is used to specify the suffix of class header files that should be precompiled, assuming that their filenames are equal to the names of the directories which are listed in the \fICLASSES\fP file\&. But \fICLASSES\fP does not specify the name of the program\(cq\&s top\-level directory\&. This option is used to specify the name of the top\-level header file to precompile\&. By default \fImain\&.ih\fP is used; .IP .IP o \fB\-\-gch\fP .br If \fIicmconf\fP files contain \fI#define PRECOMP\fP specifications then \fBicm\-dep\fP checks whether precompiled headers must be refreshed\&. If an \fIicmconf\fP file does not contain a \fI#define PRECOMP\fP specifications, but precompiled headers should nonetheless be inspected, then option \fI\-\-gch\fP can be specified; .IP .IP o \fB\-\-no\-gch\fP .br If \fIicmconf\fP files contain \fI#define PRECOMP\fP specifications but \fBicm\-dep\fP should not check whether precompiled headers must be refreshed then option \fI\-\-no\-gch\fP should be specified; .IP .IP o \fB\-\-no\-use\-all\fP .br If \fIicmconf\fP files contain \fI#define USE_ALL \(dq\&filename\(dq\&\fP specifications then all source files in directories containing files named \fIfilename\fP are recompiled\&. When specifying this option inspections of \fI`USE_ALL\(cq\&\fP specifications is suppressed; .IP .IP o \fB\-\-use\-all\fP=\fIfilename\fP .br If \fIicmconf\fP files contain \fI#define USE_ALL \(dq\&filename\(dq\&\fP specifications then all source files in directories containing files named \fIfilename\fP are recompiled\&. Specify this option to inspect the presence of \fIfilename\fP files if \fIicmconf\fP does not contain a \fI`USE_ALL\(cq\&\fP specification; .IP .IP o \fB\-\-verbose\fP (\fB\-V\fP) .br This option can be specified multiple times\&. The number of times it is specified determines \fBicm\-dep\(cq\&s\fP verbosity\&. If not used then \fBicm\-dep\fP silently performs its duties\&. If specified once, then \fBicm\-dep\fP reports to the standard output what actions it performs; if specified twice it also reports non\-default options and automatically included directories; if specified three times it also reports class dependencies; if specified more often it reports what files it encountered and what decision it would make when \fIgo\fP would be specified; .IP .IP o \fB\-\-version\fP (\fB\-v\fP) .br \fBIcm\-dep\fP reports its version number to the standard output and terminates, returning 0 to the operating system\&. .PP As an example, for \fBicmake\fP itself the class dependencies, obtained using the option \fI\-VVV\fP are shown as: .nf Direct class dependencies: \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- uses: \-\-\-\-\-\-\-\-\-\-\-\- class: 1 2 3 4 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \&. 1 x x x x options 2 x x handler 3 x x argoptions 4 x \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- 1 2 3 4 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- Implied class dependencies: \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- uses: \-\-\-\-\-\-\-\-\-\-\-\- class: 1 2 3 4 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \&. 1 \- x x x handler 2 \- x x options 3 \- x argoptions 4 \- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- 1 2 3 4 \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- .fi The second table immediately shows that there are no circular dependencies: its lower triangle remains empty\&. .PP .SH "icmun" .PP The \fBicmun\fP support program expects one argument, a bim\-file\&. It disassembles the binary file an shows the assembler instructions and the structure of the bim\-file\&. Note that in standard installations \fBicmun\fP is not located in one of the directories of the \fIPATH\fP environment variable, but it is available in the \fI/usr/lib/icmake\fP directory, and the command \fIicmake \-u bim\-file\fP is normally used to unassemble the bim\-file\&. .PP As an illustration, assume the following script is compiled by \fBicmake\fP (e\&.g\&., by calling \fIicmake \-c demo\&.im\fP): .nf void main() { printf(\(dq\&hello world\(dq\&); } .fi the resulting \fIdemo\&.bim\fP file can be processed by \fBicmun\fP (e\&.g\&., calling \fI/usr/lib/icmake/icmun demo\&.bim\fP\&. \fBIcmun\fP then writes the following to the standard output fle: .PP .nf icmun by Frank B\&. Brokken (f\&.b\&.brokken@rug\&.nl) icmun V10\&.00\&.00 Copyright (c) GPL 1992\-2021\&. NO WARRANTY\&. Binary file statistics: strings at offset 0x0025 variables at offset 0x0032 filename at offset 0x0032 code at offset 0x0014 first opcode at offset 0x0021 String constants dump: [0025 (0000)] \(dq\&\(dq\& [0026 (0001)] \(dq\&hello world\(dq\& Disassembled code: [0014] 06 01 00 push string \(dq\&hello world\(dq\& [0017] 05 01 00 push int 0001 [001a] 1b 1d callrss 1d (printf) [001c] 1c 02 add sp, 02 [001e] 04 push int 0 [001f] 24 pop reg [0020] 23 ret [0021] 21 14 00 call [0014] [0024] 1d exit .fi .PP Offsets are shown using the hexadecimal number system and are absolute byte offsets in the bim\-file\&. The string constants dump also shows, between parentheses, the offsets of the individual strings relative to the beginning of the strings section\&. The disassembled code shows the opcodes of the instructions of the compiled icmake source files\&. If opcodes use arguments then these argument values are shown following their opcodes\&. Each opcode line ends by showing the opcode\(cq\&s mnemonic plus (if applicable) the nature of its argument\&. .PP .SH "FILES" .PP The mentioned paths are the ones that are used in the source distribution and are used by the Debian Linux distribution\&. However, they are sugestive only and may have been configured differently: .PP .IP o \fB/usr/bin/icmake\fP: the main \fBicmake\fP program; .IP o \fB/usr/bin/icmbuild\fP: the wrapper program around the \fIicmbuild\fP script handling standard program maintenance; .IP o \fB/usr/bin/icmstart\fP: an \fBicmake\fP\-script that is can be used to create the startup\-files of new projects; .IP o \fB/usr/lib/icmake/icm\-comp\fP: the compiler called by \fBicmake\fP; .IP o \fB/usr/lib/icmake/icm\-exec\fP: the byte\-code interpreter called by \fBicmake\fP; .IP o \fB/usr/lib/icmake/icm\-dep\fP: the support program handling class\- and precompiled header dependencies; .IP o \fB/usr/lib/icmake/icm\-pp\fP: the preprocessor called by \fBicmake\fP; .IP o \fB/usr/lib/icmake/icmun\fP: the \fBicmake\fP unassembler\&. .PP .SH "EXAMPLES" .PP The distribution (usually in \fI/usr/share/doc/icmake\fP) contains a directory \fIexamples\fP containing additional examples of \fBicmake\fP script\&. The \fIicmstart\fP script is an \fBicmake\fP script as is \fI/usr/lib/icmake/icmbuild\fP, which is called by the \fI/usr/bin/icmbuild\fP program\&. See also the \fBEXAMPLE\fP section in the \fBicmscript\fP(7) man\-page\&. .PP .SH "SEE ALSO" \fBchmod\fP(1), \fBicmbuild\fP(1), \fBicmconf\fP(7), \fBicmscript\fP(7), \fBicmstart\fP(1), \fBicmstart\&.rc\fP(7), \fBmake\fP(1) .PP .SH "BUGS" .PP Be advised that starting \fBicmake\fP version 10\&.00\&.00 .IP o the \fI\-\-summary\fP (\fI\-F\fP) option has been discontinued; .IP o the \fI\-\-source\fP short option \fI\-i\fP has been replaced by \fI\-s\fP; .IP o long option \fI\-\-icm\-dep\fP has been replaced by \fI\-\-dependencies\fP; .PP .SH "COPYRIGHT" This is free software, distributed under the terms of the GNU General Public License (GPL)\&. .PP .SH "AUTHOR" Frank B\&. Brokken (\fBf\&.b\&.brokken@rug\&.nl\fP)\&. .PP icmake-10.03.00/doc/icmake.ps0000644000175000017500000075326214204126313014525 0ustar frankfrank%!PS-Adobe-2.0 %%Creator: dvips 5.516 Copyright 1986, 1993 Radical Eye Software %%Title: ai.dvi %%CreationDate: Tue Mar 1 13:06:35 1994 %%Pages: 53 %%PageOrder: Ascend %%BoundingBox: 0 0 596 842 %%EndComments %DVIPSCommandLine: dvips -o icmake.ps ai %DVIPSSource: TeX output 1994.03.01:1304 %%BeginProcSet: tex.pro /TeXDict 250 dict def TeXDict begin /N{def}def /B{bind def}N /S{exch}N /X{S N}B /TR{translate}N /isls false N /vsize 11 72 mul N /hsize 8.5 72 mul N /landplus90{false}def /@rigin{isls{[0 landplus90{1 -1}{-1 1} ifelse 0 0 0]concat}if 72 Resolution div 72 VResolution div neg scale isls{landplus90{VResolution 72 div vsize mul 0 exch}{Resolution -72 div hsize mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul TR matrix currentmatrix dup dup 4 get round 4 exch put dup dup 5 get round 5 exch put setmatrix}N /@landscape{/isls true N}B /@manualfeed{ statusdict /manualfeed true put}B /@copies{/#copies X}B /FMat[1 0 0 -1 0 0]N /FBB[0 0 0 0]N /nn 0 N /IE 0 N /ctr 0 N /df-tail{/nn 8 dict N nn begin /FontType 3 N /FontMatrix fntrx N /FontBBox FBB N string /base X array /BitMaps X /BuildChar{CharBuilder}N /Encoding IE N end dup{/foo setfont}2 array copy cvx N load 0 nn put /ctr 0 N[}B /df{/sf 1 N /fntrx FMat N df-tail}B /dfs{div /sf X /fntrx[sf 0 0 sf neg 0 0]N df-tail}B /E{ pop nn dup definefont setfont}B /ch-width{ch-data dup length 5 sub get} B /ch-height{ch-data dup length 4 sub get}B /ch-xoff{128 ch-data dup length 3 sub get sub}B /ch-yoff{ch-data dup length 2 sub get 127 sub}B /ch-dx{ch-data dup length 1 sub get}B /ch-image{ch-data dup type /stringtype ne{ctr get /ctr ctr 1 add N}if}B /id 0 N /rw 0 N /rc 0 N /gp 0 N /cp 0 N /G 0 N /sf 0 N /CharBuilder{save 3 1 roll S dup /base get 2 index get S /BitMaps get S get /ch-data X pop /ctr 0 N ch-dx 0 ch-xoff ch-yoff ch-height sub ch-xoff ch-width add ch-yoff setcachedevice ch-width ch-height true[1 0 0 -1 -.1 ch-xoff sub ch-yoff .1 add]{ ch-image}imagemask restore}B /D{/cc X dup type /stringtype ne{]}if nn /base get cc ctr put nn /BitMaps get S ctr S sf 1 ne{dup dup length 1 sub dup 2 index S get sf div put}if put /ctr ctr 1 add N}B /I{cc 1 add D }B /bop{userdict /bop-hook known{bop-hook}if /SI save N @rigin 0 0 moveto /V matrix currentmatrix dup 1 get dup mul exch 0 get dup mul add .99 lt{/QV}{/RV}ifelse load def pop pop}N /eop{SI restore showpage userdict /eop-hook known{eop-hook}if}N /@start{userdict /start-hook known{start-hook}if pop /VResolution X /Resolution X 1000 div /DVImag X /IE 256 array N 0 1 255{IE S 1 string dup 0 3 index put cvn put}for 65781.76 div /vsize X 65781.76 div /hsize X}N /p{show}N /RMat[1 0 0 -1 0 0]N /BDot 260 string N /rulex 0 N /ruley 0 N /v{/ruley X /rulex X V}B /V {}B /RV statusdict begin /product where{pop product dup length 7 ge{0 7 getinterval dup(Display)eq exch 0 4 getinterval(NeXT)eq or}{pop false} ifelse}{false}ifelse end{{gsave TR -.1 -.1 TR 1 1 scale rulex ruley false RMat{BDot}imagemask grestore}}{{gsave TR -.1 -.1 TR rulex ruley scale 1 1 false RMat{BDot}imagemask grestore}}ifelse B /QV{gsave transform round exch round exch itransform moveto rulex 0 rlineto 0 ruley neg rlineto rulex neg 0 rlineto fill grestore}B /a{moveto}B /delta 0 N /tail{dup /delta X 0 rmoveto}B /M{S p delta add tail}B /b{S p tail} B /c{-4 M}B /d{-3 M}B /e{-2 M}B /f{-1 M}B /g{0 M}B /h{1 M}B /i{2 M}B /j{ 3 M}B /k{4 M}B /w{0 rmoveto}B /l{p -4 w}B /m{p -3 w}B /n{p -2 w}B /o{p -1 w}B /q{p 1 w}B /r{p 2 w}B /s{p 3 w}B /t{p 4 w}B /x{0 S rmoveto}B /y{ 3 2 roll p a}B /bos{/SS save N}B /eos{SS restore}B end %%EndProcSet TeXDict begin 39158280 55380996 1000 300 300 (/home/karel/latex/ai/1994/1/ai.dvi) @start /Fa 2 63 df<00000400001C000070000380000E0000380001C0000700003C0000F000003800000E 000003C00000F000001C000007800001E000003800000C16137E911B>60 D<800000E000003C000007000001C000007800000E000003800000F000001C0000780001 C0000700003C0000E0000380001E0000700000C0000016137D911B>62 D E /Fb 3 111 df<020002000200C218F2783AE00F800F803AE0F278C2180200020002 000D0E7E8E12>3 D106 D110 D E /Fc 20 122 df<00600000600000F00000 F00000F80001F80001F80003FC0003FC00033C00073E00073E000E1F000E1F000FFF001F FF801C0F801807803807C03807C07003E07003E0F807F014177F9617>65 D69 D<01FC0007FF000FFF801F0FC03E07C03C03E07C03E07801F0F801F0F801F0 F801F0F801F0F801F0F801F0F801F0F801E07C03E07C03C03E07C03F0F801FFF000FFE00 03F80014177E9618>79 D<0FC07FF07FF8707C003C007C03FC0FFC3E3C783CF07CFFFC7F BC3F3E0F0E7F8D12>97 D<07E01FF83E387C387800F800F800F800F800FC007E0C7FFC3F F00FC00E0E7F8D10>99 D<007E001E001E001E001E001E001E001E001E001E001E001E07 DE1FFE3E3E7C1E781EF81EF81EF81EF81EFC1E7E3E7FFE3FDE1F9F101A7F9913>I<07C0 1FF03FF87C78783CFFFCFFFCF800F800F8007C047E0E3FFC0FE00F0E7F8D12>I<0FC03F FE78FEF078F078F078F078F8F07FE07F807FF0FFF8FFFCFFFC401EC00EC00EC00EC00CE0 1C78383FF00FC00F177F8D11>103 D<183C3C180000003C7C3C3C3C3C3C3C3C3C3C3C3C FF0815809409>105 D<7C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3CFF 081A809909>108 D<19F000FBF8007FFC007C3C00781E00781E00781E00781E00781E00 781E00781E00781E00781E00FC3F80110E7F8D13>110 D<07E01FF83E7C7C3E7C1EF81F F81FF81FF81F783E7C3E3E7C1FF807E0100E7F8D13>I<19F8FBFC7FFE7C7E783F781F78 1F781F781F781E783E7C7C7FF87BE078007800780078007800780078007800FE0010177F 8D13>I<0F86003FCE007E3E007C1E00F81E00F81E00F81E00F81E00F81E00FC1E007E3E 007FFE003FDE000F9E00001E00001E00001E00001E00001E00001E00001E00001E00003F 8011177F8D13>I<19F0FBF87CF878F8787878007800780078007800780078007C00FE00 0D0E7F8D0E>I<0FF03FF87878780078007FE03FF01FF800FC003CE03CF87CFFF83FE00E 0E7F8D10>I<06001E001E001E001E001E00FFF8FFF81E001E001E001E001E001E001E00 1E001E081F1C0FF803E00E1481930E>I<787EF81E781E781E781E781E781E781E781E78 1E7C3E7FFE3FDE1F9F100E7F8D13>I119 D121 D E /Fd 3 74 df<03E00FF81C1C380C300C70006000E000E000E000E000E000E0007000 700078003C061FFC07E00F137E9211>67 D69 D73 D E /Fe 81 126 df33 DI<0C600C6008400840 084018C018C018C07FF07FF018C018C0108010801080318031803180FFE0FFE031803180 2100210021006300630063000C1C7D9612>I<038007C00E600E600E600E600E600FC007 800F803FC07BCC71CCE1E8E1E8E0F8E0F0E0F0707078F83FB81F1C0E167E9512>38 DI<007001F007800E001C00180030003000600060 006000C000C000C000C000C000C000C000C000C0006000600060003000300018001C000E 00078001F000700C1F7D9712>II<060006000600C630E67070E00B000B0070E0E670C630060006 0006000C0E7D8F12>I<06000600060006000600FFF0FFF0060006000600060006000600 0C0D7D8E12>I<60F0F070606040C0800409788312>III<00300030002000600060004000C000C0018001800180030003000300 0600060006000C000C000C00180018001800300030002000600060004000C000C0000C1F 7D9712>I<0F801FC038E03060707060306038E038E038E038E038E038E038E038E038E0 3060307070306038E01FC00F800D167E9512>I<008003800F803F80F380438003800380 03800380038003800380038003800380038003800380038003800380038009177F9612> I<0F803FC071E060E00070007000700070007000E000E001C001C0038007000E001C0038 006000FFF0FFF0FFE00C167D9512>I<1F807FE060F00070007000700070007000E00F00 0FE000E000700070007000700070007000E0C1E0FFC07F000C167D9512>I<0100038003 00070006000E300C701C70187018703070307070706070E070C070FFFEFFFE0070007000 7000700F167E9512>I<7FE07FE07FE0600060006000600060007F807FC001E000E00070 0070007000700070007000E0C1E0FFC07F000C167D9512>I<07E01FE038007000700060 00E000E7E0EFF0F870F038E038E038E038E038E03860386038707038F01FE00F800D167E 9512>I<7FF8FFF8FFF800380070006000E000C001C00180038003000700070006000E00 0E001C001C001C00380038000D167E9512>I<0FC03FF07838701870187018701878383C 701FE01FE03DF070786038C01CC01CC01CC01C603870783FF00FC00E167E9512>I<0F80 3FC078E07070E030E030E038E038E038E038E078607870F83FB81F380038003000700070 00E03FC03F000D167E9512>I<60F0F060000000000000000060F0F0600410788F12>I<60 F0F060000000000000000060F0F070606040C0800415788F12>I<00180038006001C003 8006001C003800E000E00038001C000600038001C00060003800180D127D9112>II<03C003C003C007E007E006 E006F00C700C700C701C78183818381FFC3FFC301C301C701E600E600EE00FE00F10167F 9512>65 DI<07C01FF03C18780870087000F000E000 E000E000E000E000E000E000E000E00070007000780C3C1C1FF007C00E167E9512>IIII72 DI75 DIII<0FC03FF078787038 703CE01CE01CE01CE01CE01CE01CE01CE01CE01CE01CE01CE01CF038703878783FF00FC0 0E167E9512>II 82 D<1F803FE078E0706070007000700078003C003E001F800FC003E001E000F0007000 70C070C070F0E0FFC01F000C167D9512>IIII<780E380C3C1C1C181E 380E700F60076007C003C003C003E007E006F00EF00C781C78383C381C701E600EE00F10 167F9512>88 D91 DII95 D<3020604040C0E0E0E00409789212>I<0FC07FE070E060 700070007000F003F00F703C707070E070E070F0F07FF03E700C107E8F12>II<0F803FE078607020F000E000E000E000E000E000E0 00F000700078303FE01F800C107D8F12>I<003800380038003800380038003800381FB8 3FF878787038F038E038E038E038E038E038E038F038703878783FF80F380D187E9712> I<0F803FE078707030E018E018FFF8FFF8E000E000E000F0007008781C3FF80FE00E107E 8F12>I<07E00FE01E001C003C00380038003800FFE0FFE0380038003800380038003800 380038003800380038003800380038000B187B9712>I<1F983FF878787038F038E038E0 38E038E038E038E038F038703878783FF80FB800380030007040E07FC07F000D167E8F12 >II<07070707000000FFFF070707070707 070707070707070708177D9612>I<00E000E000E000E00000000000003FE03FE000E000 E000E000E000E000E000E000E000E000E000E000E000E000E001C001C001C00380FF00FE 000B1D7E9612>IIIII<07C01FF038787038 703CE01CE01CE01CE01CE01CE01CF038703878703FE00F800E107E8F12>II<1F983FF878787038F038E038E038E038E038E038E038F0387038 78783FF80FB80038003800380038003800380D167E8F12>II<1FC03FE078607000 700078003E001FC007E000F0007000700070C0F0FFE03F800C107D8F12>I<0C001C001C 001C00FFF8FFF81C001C001C001C001C001C001C001C001C001C001C040E1C07F803E00E 147E9312>IIII<783838303C701EE01EC00FC00780078007C00FC00D E01CE038F030787078E03C0E107E8F12>II<7FF07F F0007000F001E003C007800F000F001E003C007800F000E000FFF0FFF00C107D8F12>I< 01F003F00600060004000C000C000C000C000C000C000C000C001C00F800E00038001C00 1C000C000C000C000C000C000C000E000E000600070003F001F00C1F7D9712>III E /Ff 2 46 df<6006F00FF00FF00FF00FF00F60066006600660066006100B7D9816>34 D45 D E /Fg 31 122 df<1C383C381C38183030206060C0C080 800D087C9412>34 D<003000F003C007800F001E001C003C0038003800700070007000E0 00E000E000E000E000E000E000E000E000700070007000380038001C000E0006000C1E7D 960B>40 D<06000700038001C001C000E000E000E0007000700070007000700070007000 70007000E000E000E001C001C003C0038007800F001E003C00F000C0000C1E81960B>I< 0E0E0E0C0C18102040C0070A80830B>44 DI I<0FE00380038003800300070007000700070007000E000E000E000E000E000E001E001C 001C001C003C003C00FF000B177D960D>73 D84 D<0C08101030306060E0E0E0E0 E0E00D077B9112>92 D<03FC1FFE1C1F180F000F001F00FF07EE1F0E7C0EF01CF07CFF9C 7E1F100E7F8D12>97 D<1F000F000E000E000E001E001E001C001C001C001C003C003CFC 3BFE3E1E380F3807780778077807700E700E701EF87CEFF8C7E0101A7D9914>I<07E01F F83E387C187800F800F000F000F000F000F00078607FC03F000D0E7D8D0F>I<03F00FFC 1C1E380E700E7FFEFFFEE000E000E000F008783C3FF80FC00F0E7D8D12>101 D<007C00FC01CC018003800380078007800700070007000F003FF03FF00E000E000E001E 001E001E001E001C003C003C003C00FE000E1A7F990B>I<03F8000FFFC01F0FC03E0700 3C07003C07003C0F003E1E001FFC001FF0003800003FFC007FFE003FFF00300F00600700 C00700C00700C00600E00E00783C003FF8000FC00012177F8D11>I<07C0000380000380 000380000380000780000700000700000700000700000700000E00000E3E000EFF000F8F 800E07800E07801E07801E07801E07001C07001C0F003C0E003C0E003C0E00FE3F80111A 7F9914>I<0707070000001F3E0E0E0E1E1E1E1C1C1C3C3CFE08147F930A>I<07C00003C0 000380000380000380000780000780000780000700000700000700000F00000F1FC00F0F 000E1C000E78000EE0001FE0001E70001E78001C38001C3C003C1E003C0E003C0F00FE1F C0121A7F9913>107 D<07C003C00380038003800780078007800700070007000F000F00 0F000E000E000E001E001E001E001E001C003C003C003C00FE000A1A7F990A>I<0E3F0F 803EFFBFC00F87E1E00E0380E00E0380E01E0380E01E0380E01E0781E01E0781C01C0701 C01C0701C03C0701C03C0F03C0FE3F8FE01B0E7F8D1E>I<0E3E003EFF000F8F800E0780 0E07801E07801E07801E07001C07001C0F001C0E003C0E003C0E00FE3F80110E7F8D14> I<03F00FFC1C1E380F70077007E007E007E00EE00EF01C78383FF00FC0100E7D8D14>I< 071F801F7FC007C3C00701E00700E00700E00F00E00F00E00E01C00E01C00E03C00F0F80 1DFF001CFC001C00001C00001C00001C0000380000380000380000380000FF0000131780 8D14>I<0EF83FFC0F3C0E1C0E001E001E001E001E001C001C003C003C00FE000E0E7F8D 0E>114 D<03F00FF81E381C001C001E000FE003F000780038E038F078FFF03FC00D0E7F 8D0F>I<06001E001E001C001C001C00FFE0FFE038003800380038003800700070007000 700078C03FC01F000B147E930D>I<7C3EF80E380E380E380E381C781C701C701C701870 1878783FB81F3E0F0E7D8D14>III<1F87E007830003C60003CC0001F80001F000 00F00001F00003F8000738000F3C000E1C003C1E00FE3F80130E808D11>I<3F87F00E01 C00E0180060380070700070E00070E00039C0003B80003B80003F00001E00001E00001C0 000380000380000700000600000E00001C0000180000380000FC000014177F8D12>I E /Fh 65 127 df<00000C0071FC0FF3FC1C370C18360C383E00380E00380E00380E0038 0E00380E00380E00FFFFF0FFFFF0380E00380E00380E00380E00380E00380E00380E0038 0E00380E00380E00380E00FE3F80161A7F9915>11 D<07E0000FF0001C70001800001800 00380000380000380000380000380000380000380000FFFE00FFFE00380E00380E00380E 00380E00380E00380E00380E00380E00380E00380E00380E00FE3F80111A7F9914>I33 D<3E0180630380C1FF00C18200C18600C18C00C18800C198006330003E30000060000040 0000C000018000010000030000061F000631800C60C00860C01860C03060C02060C06060 C0C03180C01F00121A7E9915>37 D<007E0001FF0003C380038180038180038180038180 01C38001CF0000FE0007F8001E701E383818701C10E00E30E00F30E007E0E003E07001C0 7803E03E0EE01FF87007E07C17177E9619>II<018003 8006000C001800180030003000600060006000C000C000C000C000C000C000C000C00060 006000600030003000180018000C00060003800180091E7E960B>II<00400000400000400000400000 4000004000004000004000FFFFC000400000400000400000400000400000400000400000 400000400012127B901B>43 D<60F0F07060606040C08080040B7D830B>III<00060006000C000C0008001800100030002000600040 00C000C001800180030003000600060004000C000800180010003000200060006000C000 C0000F1E7F9611>I<010003000F003F00E7008700070007000700070007000700070007 00070007000700070007000700070007000F807FF00C187D9712>49 D<0F803FE078F070786038603800380078007000F001E003C007800E001C003800300070 006008E008FFF8FFF0FFF00D177E9612>I<1FC07FF07078603860380038003800300060 0F800FE000F00070003800380038003800380030C070E0E0FFC03F000D177E9612>I<00 400000E00000C00001C000018000038000030C00061C00061C000C1C001C1C00181C0038 1C00301C00701C00601C00FFFF80FFFF80001C00001C00001C00001C00007F0011177F96 12>I<7FF07FF07FF0601060106000600060007FC07FE000F00070007800380038003800 3800380070C070E0E0FFC03F000D177E9612>I<03F80FF81C18380030007000600063F0 EFF8F83CF01CF01EE00EE00EE00EE00EE00E600E701C301C38381FF007C00F177E9612> I<60F0F0600000000060F0F060040C7D8B0A>58 D61 D<001800001800003C00003C0000 7E00007E00006E0000EF0000CF0001C7800187800183800383C00303C007FFE00601E00E 01F00C00F00C00F01C00F818007838007CFE00FF1817819617>65 D<01F80007FF000F07801C0380380180300180700000700000E00000E00000E00000E000 00E00000E00000E00000F000007000007000003800003C00C01F03800FFF0003F8001217 7E9615>67 DIII 73 D<3F8007800380038003800380038003800380038003800380038003800380038003 800380038003800380038003800300C700E6007C00091B80960E>I<2000002030000060 380000E0380000E03C0001E03E0003E03E0003E03F0007E037800EE037800CE033C01CE0 31E038E031E030E030F070E03078E0E03038C0E0303DC0E0301F80E0300F00E0300F00E0 300600E0300000E0FC0003F81D177D9623>77 D<2000FC3000303800303C00303E00303F 00303F803037C03033E03031E03030F030307830303C30301E30301F30300FB03007F030 03F03001F03000F0300070300030FC001016177D961B>I<00FC0003FF800F07C01C01E0 3800F0300070700070700038E00038E00038E00038E00038E00038E00038E00038E00070 7000707000607800E03C01C01F07800FFE0001F80015177E9619>I<07E01FF838787018 70007000700078003C003F001F800FE001F000780038001C001C001CC01CE03CF878FFF0 1FC00E177E9612>83 DII87 D<7F00F81E00E00F01C00F018007838003C70003C60001EE0000FC 0000F800007800007800007C0000FE0001CE00038F000307800703800E03C00C01E01800 E03800F0FC03FC16177F9617>I<0E001F00318060C080200B0580950B>94 D<20204040C0E0E0E003087D920A>96 D<0FE07FF0707060380038007801F80FB83E3870 38E038E0F8FFB87E3E0F0E7F8D12>II<0F803FE078E07060E000E000E000E000E000E000700078303FE00F800C0E7E8D0F> I<007C001C001C001C001C001C001C001C001C001C001C001C0FDC3FFC783C701CE01CE0 1CE01CE01CE01CE01C701C783C3FFC1F9F101A7E9914>I<0F803FE078307010F018FFF8 FFF8E000E000E000700078183FFC0FE00E0E7E8D12>I<07C00FC01CC018001800380038 0038003800380038003800FFC0FFC0380038003800380038003800380038003800380038 00FE000A1A7F990B>I<0FC03FFE707EE038E038E038E038F0707FE07F806000FFF0FFF8 7FFC601C400EC006C006C006E00E783C3FF80FE00F177E8D11>II<38383800000038F83838383838383838383838FE07147F930A>I107 DI<18F87E00FBFEFF003E1F8700380E0380380E0380380E0380380E0380380E 0380380E0380380E0380380E0380380E0380380E0380FE3F8FE01B0E7F8D1E>I<18F800 FBFC003E1C00380E00380E00380E00380E00380E00380E00380E00380E00380E00380E00 FE3F80110E7F8D14>I<07E01FF8381C700E6006E007E007E007E0076006700E381C1FF8 07E0100E7E8D14>I<18F8FBFC3C1E380E380738073807380738073807380E3C1E3FFC3B F038003800380038003800380038003800FF0010177F8D14>I<0FCC003FFC00783C0070 1C00E01C00E01C00E01C00E01C00E01C00E01C00701C00787C003FDC001F9C00001C0000 1C00001C00001C00001C00001C00001C00001C00007F8011177E8D14>I<1BE0FFF03CF0 38F0380038003800380038003800380038003800FE000C0E7F8D0E>I<0FC03FE078E070 0070007C003FC00FE000F00070C070F0F0FFE03F800C0E7F8D0F>I<1800380038003800 38003800FFE0FFE03800380038003800380038003800380038003C301FF00FC00C147F93 0D>I<383E00F80E00380E00380E00380E00380E00380E00380E00380E00380E00380E00 3C3E001FFE000FCF80110E7F8D14>IIII I123 DI<7020FC208E2087E081C00B05 80960B>126 D E /Fi 10 58 df<05800BC011C020E060E04070C070C030C030C030C030 C030E020E060706078C03F801E000C127E9011>48 D<047CFC1C1C1C1C1C1C1C1C1C1C1C 1C1C1C1C06127C9111>I<07C00FE030F02070007000700060006000C000C00180030006 000C00080010003FF8FFF80D127F9111>I<0F001F8061C000C000C00080018000000700 1FE001F000F000700070006080E0E1807E000C127E9111>I<00C001C003C006C004C008 C018C010C020C060C0C0C0FFF800E000E000E000E000800D117F9011>I<7FE07FE04000 4000400040005F8061E000E00070007000700070006080E0C1807E000C117E9011>I<00 F003000400180030002000600063C0EFE0F0F0E070E030E030F020706038401F000C117E 9011>I<7FF8FFF000300060004000C0008001000200020004000C000800180030003000 70000D117E9011>I<078018C030603060306038C01F800F000FC031F06078C038C038C0 38E07070E01F800D117E9011>I<078030E06070E030E030E030F02078E03E4000C00180 0100020006000C001C0018000C117E9011>I E /Fj 10 58 df<0F801FC038E070707070 6030E038E038E038E038E038E038E038E03860307070707038E01FC00F800D147E9310> 48 D<0E003E00FE008E000E000E000E000E000E000E000E000E000E000E000E000E000E 000E001F00FFE00B147D9310>I<0F803FE070F0607060700070007000E001C001800700 0C001800300070006000E010FFF0FFF0FFE00C147E9310>I<3F807FE070F04070007000 70007000E00F800FE000E00070007000700070007000F0C1E0FFC07F000C147E9310>I< 0180018003000300060004300C700870187010703070207060704070FFFEFFFE00700070 007001FC0F147F9310>I<7FE07FE07FE060006000600060007F807FC001E000E0007000 7000700070007000E0C1E0FFC07F000C147E9310>I<07E01FE03860700070006000E7C0 EFE0F8F0F070E038E038E038E03860387078707038F01FE00F800D147E9310>I<7FF8FF F8FFF080200060004000C000800180030003000600060006000C000C001C001800380038 000D147E9310>I<0F803FE0787070307030703078703CE01FC01FC039E06070C038C038 C038C038E07870F03FE00F800D147E9310>I<0F803FC078E07070E030E030E038E038E0 38F078707878F83FB81F3800300070007030E03FC03F000D147E9310>I E /Fk 49 122 df<00FC000003FF800007FFC00007FFC0000FE3C0000FE3C0000FC00000 1FC000001FC000001FC000001FC000001FC000001FC000001FC000001FC000001FC00000 1FC000001FC00000FFFFFF80FFFFFF80FFFFFF801FC03F801FC03F801FC03F801FC03F80 1FC03F801FC03F801FC03F801FC03F801FC03F801FC03F801FC03F801FC03F801FC03F80 1FC03F801FC03F801FC03F807FF0FFF07FF0FFF01C2781A61C>12 D<387C7C7C7C3C383830306060C0C0060E7C9F0E>39 D<3C7EFFFFFF7F7E3E1E1C1C1838 307060C0C08008137C870F>44 DI<3C7EFFFFFFFF7E3C08 087B8712>I<000600001E00007E0001FE000FFE003FFE00FFFE00F8FE0040FE0000FE00 00FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE00 00FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0001FF00 1FFFF01FFFF014247DA31B>49 D<01FC000FFF003FFF807FFFC07E1FE07C0FE07807F078 07F00007F00007F00007F0000FF0000FE0001FE0003FC0007F80007F0000FE0001FC0003 F00007E0000FC0001F80001F00003E00003E00007C00107C0030FC0030FFFFF0FFFFE0FF FFE0FFFFE0FFFFE0FFFFE014237CA21B>I<03F8003FFF007FFF807FFFC07C3FC0781FE0 700FE0700FE0000FE0000FE0000FC0001FC0001F80003F0003FC0003FE0003FF8003FFC0 001FE0000FE0000FE00007F00007F00007F00007F00007F00007F0000FF0000FE0001FE0 F03FC0FFFF80FFFF00FFFC001FF00014237CA21B>I<00300000003C0000007C00000078 000000F8000000F0000000F0000001F0000001E0180003E0780003C1F80007C3F8000783 F8000783F8000F83F8000F03F8001F03F8001E03F8003E03F8003C03F8003C03F8007803 F8007803F800FFFFFFC0FFFFFFC0FFFFFF80FFFFFF800003F8000003F8000003F8000003 F8000007FC00001FFF00001FFF001A227FA11B>I<7FFFC07FFFC07FFFC07FFFC07FFFC0 7FFFC07800C07800407800407800007800007800007FFC007FFF007FFF807FFFC0003FC0 001FE0000FE0000FF00007F00007F00007F00007F00007F00007F00007F0000FE0000FE0 001FC0F03FC0FFFF80FFFF00FFFC001FF00014237CA21B>I<003FC000FFE003FFE007FF E00FC0001F80001F00003F00003F00007E00007E00007E1F807E7FE0FEFFF0FFFFF0FF87 F8FF03F8FF03FCFE01FCFE01FCFE01FCFE01FCFE01FCFE01FC7E01FC7E01FC7E01FC3E01 F83F03F81F03F01F87F00FFFE007FFC003FF8000FC0016237DA21B>I<7FFFF87FFFF87F FFF87FFFF87FFFF0FFFFE0C001E0C003C0800380000780000700000F00000E00001E0000 3C00003C00007C0000780000F80000F00000F00001F00001E00003E00003E00007E00007 C00007C0000FC0000FC0001FC0001F80001F80003F80003F800015237CA21B>I<0001C0 00000001C000000003E000000003E000000007F000000007F000000007F00000000FF800 00000FF80000001FFC0000001FFC0000001EFC0000003CFE0000003C7E0000007C7F0000 00787F000000787F000000F83F800000F03F800001F03FC00001E01FC00001E01FC00003 FFFFE00003FFFFE00007FFFFF000078007F000078007F0000F8007F8000F0003F8001F00 03FC001E0003FC001E0001FC003E0001FE00FF0003FF80FF0003FF80212380A222>65 DI<000FF000007FFE0001FFFF8003FFFFC007F83FC00FE00FC01FC007C01F8003C0 3F8000003F0000007F0000007F0000007F000000FE000000FE000000FE000000FE000000 FE000000FE000000FE000000FE000000FE000000FE0000007F0000007F0000007F000000 3F8000003F8000C01FC001E01FE003C00FF80F8007FFFF0003FFFE0000FFF800003FC000 1B237EA21F>I69 D73 D75 DI<38000000000E003C00000000 1E003E000000003E003E000000003E003F000000007E003F80000000FE003FC0000001FE 003FE0000001FE003FE0000003FE003FF0000007FE003FF800000FFE003FFC00001FFE00 3FFE00001FFE003FFE00003EFE003DFF00007CFE003CFF8000FCFE003C7FC000F8FE003C 7FE001F0FE003C3FE003E0FE003C1FF007E0FE003C0FF807C0FE003C07FC0F80FE003C07 FE1F00FE003C03FE3F00FE003C01FF7E00FE003C00FFFC00FE003C00FFF800FE003C007F F800FE003C003FF000FE003C001FE000FE003C000FC000FE003C000FC000FE003E000780 00FE00FF80000003FF80FF80000003FF8031237DA238>I<000FF000007FFE0001FFFF80 03FFFFC007F83FE00FE00FF01FC007F01F8003F83F8003F83F0001FC7F0001FC7F0001FC 7E0000FEFE0000FEFE0000FEFE0000FEFE0000FEFE0000FEFE0000FEFE0000FEFE0000FE FE0000FEFE0000FC7F0001FC7F0001FC7F0001F83F8003F83F8003F01FC007F01FE00FE0 0FF83FC007FFFF8003FFFF0000FFFC00001FE0001F237EA223>79 DI<01FF0007FFE00FFFF01FFFF03F83F03F01F07F00007F00007F00007F00007F80 003F80003FC0001FE0001FF8000FFC0007FF0003FF8001FFC0007FE0003FE0001FF0000F F00007F80003F80003F80003F80003F8F003F8F807F0FE0FF0FFFFE0FFFFC03FFF0007FC 0015237EA21A>83 DII<0C0C183830707070F8F8F8F870060D7B9C0E>96 D<00FF000FFFE03FFFF03FFFF83E03F83801FC0001FC0003FC000FFC007FFC01FFFC07FD FC1FE1FC3F81FC7E01FCFC03FCFC0FFCFFFEFC7FFCFC3FF8FF0FE0FF18157F941A>II<007F8003FFF00FFFF81FFFF83FE0F87F8078 7F0000FF0000FE0000FE0000FE0000FE0000FE0000FF00007F00007F80183FE07C1FFFF8 0FFFF003FFC000FE0016157E9418>I<0001FE000001FE000000FE000000FE000000FE00 0000FE000000FE000000FE000000FE000000FE000000FE000000FE000000FE000000FE00 0000FE000000FE000000FE000000FE0003F8FE000FFEFE001FFFFE003FFFFE007FC1FE00 7F80FE007F00FE00FF00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FF00FE00 7F00FE007F80FE007FC3FE003FFFFE001FFF7E000FFE7F8003F87F8019277EA61D>I<00 FF0003FFE00FFFF01FFFF83FC3F83F81FC7F00FC7FFFFCFFFFFCFFFFFCFE0000FE0000FE 0000FF00007F00007F80083FE07C1FFFFE0FFFFC03FFF000FF0017157E941A>I<007E00 01FF8003FF8007FF8007E3800FE0000FC0000FC0001FC0001FC0001FC0001FC0001FC000 1FC0001FC0001FC0001FC0001FC000FFFF80FFFF80FFFF801FC0001FC0001FC0001FC000 1FC0001FC0001FC0001FC0001FC0001FC0001FC0001FC0001FC0001FC0001FC0001FC000 7FF8007FF800112781A611>I<03FE001FFFFE3FFFFE7F07FE7E03FEFC01F8FC01F8FC01 F8FC01F8FC01F87E03F07F07F03FFFE03FFF803BFE007800007FFFC0FFFFF0FFFFF8FFFF FC7FFFFC3800FC70007EF0003EF0003EF0003EF0003EF8003E7C007C7F01FC3FFFF81FFF F007FFC001FF0017227E941A>II<0F001F 801F801F801F800F00000000000000004007C07FC07FC01FC01FC01FC01FC01FC01FC01F C01FC01FC01FC01FC01FC01FC01FC01FC01FC0FFF8FFF80D1F7F9E0E>I107 D<7FC07FC01FC01FC01FC01FC01FC01FC01FC01FC01F C01FC01FC01FC01FC01FC01FC01FC01FC01FC01FC01FC01FC01FC01FC01FC01FC01FC01F C01FC01FC01FC01FC01FC01FC01FC01FC0FFF8FFF80D277FA60E>I<0300000000001F07 E01FC000FF1FF87FF000FF3FFCFFF8003F7FFFFFFC003FE1FFC3FC003F80FF01FE003F80 7F00FE003F807F00FE003F807F00FE003F807F00FE003F807F00FE003F807F00FE003F80 7F00FE003F807F00FE003F807F00FE003F807F00FE003F807F00FE003F807F00FE003F80 7F00FE00FFE1FFC3FFC0FFE1FFC3FFC02A167E952B>I<030000001F07C000FF1FF000FF 3FF8003F7FFC003FE1FC003F80FE003F80FE003F80FE003F80FE003F80FE003F80FE003F 80FE003F80FE003F80FE003F80FE003F80FE003F80FE003F80FE003F80FE00FFE3FFC0FF E3FFC01A167E951C>I<00FF0003FFC00FFFF01FFFF83FC3FC7F81FE7F00FE7F00FFFE00 7FFE007FFE007FFE007FFE007FFF00FE7F00FE7F81FE3FC3FC1FFFF80FFFF003FFC000FF 0018157E941C>I<030000001F0FE000FF3FF800FF7FFC003FFFFE003FE1FF003F80FF00 3F807F003F807F803F803F803F803F803F803F803F803F803F803F803F807F803F807F00 3F80FF003FC1FF003FFFFE003FFFFC003FBFF8003F8FE0003F8000003F8000003F800000 3F8000003F8000003F8000003F8000003F8000003F8000003F8000003F800000FFF80000 FFF8000019237E951D>I<01F80E000FFE1E001FFF7E003FFFFE007FC1FE007F80FE007F 00FE00FF00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FE00FF00FE007F00FE007F 80FE007FC3FE003FFFFE001FFEFE000FFCFE0003F0FE000000FE000000FE000000FE0000 00FE000000FE000000FE000000FE000000FE000000FE000000FE000000FE000003FFE000 03FFE01B227E941D>I<0300001F1FC0FF3FE0FF7FE03FFFE03FC7E03F87E03F87C03F80 003F80003F80003F80003F80003F80003F80003F80003F80003F80003F80003F8000FFF0 00FFF00013167E9516>I<03FF801FFFF03FFFF07FFFF07F03F07E00007E00003F00003F FF001FFFC00FFFE003FFF00003F00001F80001F8F801F8FE03F8FFFFF8FFFFF0FFFFE00F FF0015157F9418>I<00600007E0000FE0000FE0000FE0000FE0000FE0000FE0000FE000 FFFFE0FFFFE0FFFFE00FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE0000FE000 0FE0000FE0000FE0000FF00007F83007FFF803FFF801FFE0007F00151E819D15>I<0080 00000F81FE00FF81FE00FF80FE003F80FE003F80FE003F80FE003F80FE003F80FE003F80 FE003F80FE003F80FE003F80FE003F80FE003F80FE003F80FE003F80FE001FC3FE001FFF 7E000FFF7E0007FE7F8001F87F8019167F951C>II<7FF1FE007FF1FE001FE0F8000FF1F00007F3E00007FBC00003FF800001FF0000 01FF000000FF0000007F800000FFC00001FFC00003FFE00003DFF000078FF8000F87F800 1F03FC003E03FE00FF87FF80FF87FF8019157F941A>120 DI E /Fl 3 63 df<70F8F8F87005057D830C>58 D<000000C0000003C000000E00000038000000E0 0000078000001E00000078000001E00000070000003C000000F00000003C0000000F0000 0003C0000000F00000003C0000000700000001E0000000780000001E0000000780000001 C0000000401A187E951F>60 D62 D E /Fm 44 122 df<003F80000000FFF0000001FFFC000003FFFC000003FFFC 000007F8FC000007F87C000007F00000000FF00000000FF00000000FF00000000FF00000 000FF00000000FF00000000FF00000000FF00000000FF00000000FF00000000FF0000000 0FF00000000FF0000000FFFFFFFC00FFFFFFFC00FFFFFFFC00FFFFFFFC000FF003FC000F F003FC000FF003FC000FF003FC000FF003FC000FF003FC000FF003FC000FF003FC000FF0 03FC000FF003FC000FF003FC000FF003FC000FF003FC000FF003FC000FF003FC000FF003 FC000FF003FC000FF003FC000FF003FC001FF807FE003FFC0FFF803FFC0FFF80212F81AE 21>12 D<0000400001C00007C0001FC0007FC001FFC007FFC01FFFC0FFFFC07F3FC0783F C0203FC0003FC0003FC0003FC0003FC0003FC0003FC0003FC0003FC0003FC0003FC0003F C0003FC0003FC0003FC0003FC0003FC0003FC0003FC0003FC0003FC0003FC0003FC0003F C0003FC0003FC0003FC0003FC0003FC0007FE001FFF80FFFFF0FFFFF182C7EAB21>49 D<00FF000003FFC0000FFFF0003FFFF8007FFFFC007F07FE007E03FE007C03FF007C01FF 007C01FF000001FF000001FF000001FF000003FE000003FE000007FC000007FC00000FF8 00001FF000003FE000007FC00000FF000001FE000001F8000003F0000007E000000FC000 000F8000001F8000003F0000003F0000007E0001807E0001807E000380FFFFFF80FFFFFF 00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFE00FFFFFE00192A7CA921>I<01FF001F FFC07FFFF07FFFF87FFFFC7F07FC7C03FE7803FE7801FE0001FE0001FE0001FE0001FC00 01FC0003F80003F00007E001FF8001FF0001FFC001FFF001FFF80007FC0003FC0001FE00 01FE0000FF0000FF0000FF0000FF0000FF0000FF0001FF0001FE0003FEF007FCFC1FFCFF FFF8FFFFF0FFFFE03FFF8007FC00182A7CA921>I<00180000001F0000001F0000003E00 00003E0000007E0000007C0000007C000000F8000000F8038001F8078001F01F8001F07F 8003F07F8003E07F8003E07F8007C07F8007C07F800FC07F800F807F800F807F801F007F 801F007F803F007F803E007F803E007F807C007F807C007F80FFFFFFFEFFFFFFFEFFFFFF FEFFFFFFFCFFFFFFFC00007F8000007F8000007F8000007F8000007F800000FFE00003FF F00003FFF01F297FA821>I<000038000000003C000000007C000000007E00000000FE00 000000FE00000001FF00000001FF00000001FF80000003FF80000003FF80000007FFC000 0007FFC0000007BFE000000FBFE000000F1FE000001F1FF000001F1FF000003E0FF80000 3E0FF800003E0FFC00007C07FC00007C07FC0000FC03FE0000F803FE0000F801FF0001FF FFFF0001FFFFFF0003FFFFFF8003FFFFFF8007E000FFC007E000FFC007C0007FC00FC000 7FE00F80003FE01F80003FF01F80003FF03F00001FF83F00001FF87F00001FFCFF80003F FEFF80003FFE272A80A929>65 DI<0003FE0000000FFFC000003FFFF00000FFFFFC0001FFFFFE0003FF 03FE0007FC00FE000FF8007E000FF0003E001FF0003E001FE00000003FE00000003FC000 00007FC00000007FC00000007FC00000007F80000000FF80000000FF80000000FF800000 00FF80000000FF80000000FF80000000FF80000000FF80000000FF80000000FF80000000 7FC00000007FC00000007FC00000003FC00000003FE00000001FE00000001FF00003000F F80007800FFC001F8007FF00FF0003FFFFFC0001FFFFF80000FFFFE000003FFF80000007 FC0000212A7DA925>III I<0001FF0000000FFFE000003FFFF80000FFFFFE0001FFFFFF0003FF81FF0007FE007F00 0FFC003F000FF8001F001FF0001F001FF00000003FE00000003FE00000007FC00000007F C00000007FC00000007F80000000FF80000000FF80000000FF80000000FF80000000FF80 000000FF80000000FF8001FFE0FF8001FFE0FF8000FFC0FF80003FC07FC0003FC07FC000 3FC07FC0003FC03FE0003FC03FF0003FC01FF0003FC01FF8003FC00FFC003FC00FFE003F C007FF80FFC003FFFFFFC001FFFFFFC000FFFFFFC0003FFFC7C00007FE07C0232A7DA928 >III75 D<3C00000000000F003E000000 00001F003F00000000001F003F00000000003F003F80000000007F003FC000000000FF00 3FE000000001FF003FE000000001FF003FF000000003FF003FF800000007FF003FFC0000 000FFF003FFE0000000FFF003FFE0000001FFF003FFF0000003FFF003FFF8000007F7F00 3EFFC000007E7F003EFFE00000FC7F003E7FE00001FC7F003E7FF00003F87F003E3FF800 03F0FF003E1FFC0007E0FF003E0FFC000FE0FF003E0FFE001FC0FF003E07FF001F80FF00 3E03FF803F00FF003E01FFC07F00FF003E00FFC0FE00FF003E00FFE0FC00FF003E007FF1 F800FF003E003FF3F800FF003E001FFBF000FF003E000FFFE000FF003E000FFFC000FF00 3E0007FFC000FF003E0003FF8000FF003E0001FF0000FF003E0001FE0000FF003E0000FE 0000FF003E00007C0000FF007F0000000001FF80FFC000000003FFC0FFC000000003FFC0 3A2A7CA943>77 D<3C00001FF83E00001FF83F000007F03F800003E03FC00003E03FC000 03E03FE00003E03FF00003E03FF80003E03FFC0003E03FFE0003E03FFF0003E03FFF8003 E03FFFC003E03EFFC003E03E7FE003E03E7FF003E03E3FF803E03E1FFC03E03E1FFE03E0 3E0FFF03E03E07FF83E03E03FFC3E03E01FFC3E03E00FFE3E03E007FF3E03E003FF3E03E 001FFBE03E001FFFE03E000FFFE03E0007FFE03E0003FFE03E0001FFE03E0000FFE03E00 007FE03E00003FE03E00001FE03E00001FE03E00000FE07F000007E0FFC00003E0FFC000 01E0252A7CA92E>I<0001FE0000000FFFC000003FFFF00000FFFFFC0001FFFFFE0003FF 07FF0007FC01FF800FF800FFC00FF0007FC01FF0003FE01FE0003FE03FE0001FF03FC000 1FF07FC0001FF07FC0001FF07F80000FF87F80000FF8FF80000FF8FF80000FF8FF80000F F8FF80000FF8FF80000FF8FF80000FF8FF80000FF8FF80000FF8FF80000FF0FF80000FF0 7FC0001FF07FC0001FF07FC0001FE07FC0003FE03FE0003FC03FE0007FC01FF0007F801F F800FF800FFC01FF0007FF07FE0003FFFFFC0001FFFFF800007FFFE000001FFF80000003 FC0000252A7DA92B>I<00FF800007FFF8000FFFFE001FFFFE003FFFFE003FE0FE007FC0 3E007F8000007F8000007F8000007F8000007F8000007FC000007FC000003FE000003FF0 00001FFC00001FFE00000FFF800007FFE00003FFF00001FFF800007FFC00001FFE00000F FE000003FF000001FF000000FF800000FF8000007F8000007F8000007F8000007F80F800 7F80FC007F00FE00FF00FF81FF00FFFFFE00FFFFFC007FFFF8000FFFE00001FF8000192A 7DA91F>83 D II<003FC00001FFF0000FFFFC001FFFFE001FFFFF001FFFFF001F81FF801C007F800000 3FC000003FC000003FC00000FFC00007FFC0001FFFC0007FFFC001FF3FC007F83FC01FE0 3FC03F803FC07F003FC0FF007FC0FF81FFC0FFFFDFC0FFFF9FC0FFFF9FE07FFF1FF03FFE 1FF007F800001C1C7E9A20>97 DI<001FE00000FFFC 0003FFFF0007FFFF800FFFFF801FF83F803FE01F803FC00F807F8000007F800000FF8000 00FF000000FF000000FF000000FF000000FF000000FF000000FF0000007F8000007F8000 007FC001803FE007C03FF81FC01FFFFF800FFFFF0007FFFC0001FFF000007F80001A1C7D 9A1D>I<00007FE000007FE000003FE000001FE000001FE000001FE000001FE000001FE0 00001FE000001FE000001FE000001FE000001FE000001FE000001FE000001FE000001FE0 00001FE000001FE0007E1FE001FF9FE007FFDFE00FFFFFE01FFFFFE03FF87FE03FE01FE0 7FC01FE07F801FE07F801FE0FF801FE0FF001FE0FF001FE0FF001FE0FF001FE0FF001FE0 FF001FE0FF001FE0FF001FE07F801FE07F801FE07FC01FE03FE07FE03FFFFFE01FFFEFF0 0FFFCFF807FF8FF801FE00001D2F7DAD22>I<007FC00001FFF00007FFFC000FFFFE001F FFFF003FE07F003FC03F807FC03F807F801F807F801FC0FFFFFFC0FFFFFFC0FFFFFFC0FF FFFFC0FF000000FF000000FF000000FF000000FF8000007F8000007FC001803FE003C03F F80FE01FFFFFE00FFFFFC007FFFF0001FFFC00003FE0001B1C7D9A20>I<001FE0007FF8 00FFF801FFF803FFF803FC7807F80007F80007F0000FF0000FF0000FF0000FF0000FF000 0FF0000FF0000FF0000FF0000FF0000FF0000FF000FFFFF8FFFFF8FFFFF8FFFFF80FF000 0FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF0000FF000 0FF0000FF0000FF0000FF0000FF0000FF0001FF8003FFE003FFE00152F81AE14>I<007F 800003FFF0000FFFFFF01FFFFFF03FFFFFF07FC1FFF07F80FF00FF007F80FF007F80FF00 7F80FF007F80FF007F80FF007F007F80FF007FC1FE003FFFFC001FFFF8001FFFE0001CFF 00003C0000003C0000007FFFFC007FFFFF00FFFFFF80FFFFFFC0FFFFFFC07FFFFFE01FFF FFE038001FF070000FF0700007F0F00003F0F00003F0F00003F0F00003F0F00003E07800 07E07C000FC03F803F801FFFFF000FFFFE0003FFF800007FC0001C2B7D9A1F>II<07800FC01FE01FE01FE00FC007800000000000000000006003E07FE0 FFE07FE01FE01FE01FE01FE01FE01FE01FE01FE01FE01FE01FE01FE01FE01FE01FE01FE0 1FE01FE01FE03FF0FFFCFFFC0E267FA511>I107 D<7FE07FE03FE01FE01FE01FE01FE01FE01FE01FE01FE01FE01FE01FE01FE01FE01FE01F E01FE01FE01FE01FE01FE01FE01FE01FE01FE01FE01FE01FE01FE01FE01FE01FE01FE01F E01FE01FE01FE01FE01FE01FE01FE03FF0FFFCFFFC0E2E7FAD11>I<00C1FE003F800007 C7FFC0FFE000FFCFFFE1FFF000FFDFFFF3FFF8007FDFFFF7FFF8001FFFFFFFFFFC001FFC 1FFF07FC001FF00FFC03FE001FE00FF803FE001FE007F801FE001FE007F801FE001FE007 F801FE001FE007F801FE001FE007F801FE001FE007F801FE001FE007F801FE001FE007F8 01FE001FE007F801FE001FE007F801FE001FE007F801FE001FE007F801FE001FE007F801 FE001FE007F801FE001FE007F801FE003FF00FFC03FF007FF81FFE07FFC07FF81FFE07FF C0321B7F9A33>I<00C0FE0007C7FF80FFCFFFC0FFDFFFE07FDFFFE01FFFFFF01FFC1FF0 1FF00FF81FE00FF81FE007F81FE007F81FE007F81FE007F81FE007F81FE007F81FE007F8 1FE007F81FE007F81FE007F81FE007F81FE007F81FE007F81FE007F81FE007F83FF00FFC 7FF81FFF7FF81FFF201B7F9A22>I<001FE00000FFFC0003FFFF0007FFFF800FFFFFC01F E0FFE03FC03FE03F801FF07F800FF07F800FF87F0007F8FF0007F8FF0007F8FF0007F8FF 0007F8FF0007F8FF0007F8FF0007F0FF800FF07F800FF07FC00FE03FE01FE03FF83FC01F FFFF800FFFFF0007FFFE0001FFF800003FC0001D1C7D9A22>I<00C1FE0007C7FF80FFCF FFC0FFDFFFE07FFFFFF01FF81FF01FE00FF81FE007F81FE007F81FE003FC1FE003FC1FE0 03FC1FE003FC1FE003FC1FE003FC1FE003FC1FE003FC1FE007FC1FE007F81FE007F81FE0 0FF81FE01FF01FF87FF01FFFFFE01FFFFFC01FEFFF801FE7FE001FE1F8001FE000001FE0 00001FE000001FE000001FE000001FE000001FE000001FE000001FE000001FE000001FE0 00001FE000003FF800007FFE00007FFE00001E2B7F9A22>I<007E000001FF80E007FFC3 E00FFFE7E01FFFFFE03FF87FE03FE01FE07FC01FE07F801FE07F801FE0FF801FE0FF001F E0FF001FE0FF001FE0FF001FE0FF001FE0FF001FE0FF001FE0FF001FE07F801FE07F801F E07FC03FE03FE0FFE03FFFFFE01FFFFFE00FFFDFE007FF9FE001FE1FE000001FE000001F E000001FE000001FE000001FE000001FE000001FE000001FE000001FE000001FE000001F E000001FE000003FF800007FFE00007FFE1F2B7D9A22>I<00C1F807C7FEFFCFFFFFDFFF 7FDFFF1FF8FF1FF0FF1FE0FF1FE0FF1FE07E1FE0001FE0001FE0001FE0001FE0001FE000 1FE0001FE0001FE0001FE0001FE0001FE0001FE0001FE0003FF0007FFC007FFC00181B7F 9A1A>I<01FF800007FFF8001FFFFE003FFFFE007FFFFE007FC0FE007F803E007F800000 7F8000007F8000003FC000003FFFC0001FFFF8000FFFFC0007FFFE0000FFFF000003FF00 0000FF0000007F8000007F80F8007F80FE00FF80FF81FF80FFFFFF80FFFFFF00FFFFFE00 3FFFF80003FFC000191C7E9A1D>I<0018000001F8000007F8000007F8000007F8000007 F8000007F8000007F8000007F8000007F80000FFFFFC00FFFFFC00FFFFFC00FFFFFC0007 F8000007F8000007F8000007F8000007F8000007F8000007F8000007F8000007F8000007 F8000007F8000007F8000007F8000007F8000007F8000007F8000007FC020003FE0F0003 FFFF8001FFFF0000FFFE00007FF800000FE000192581A319>I<0060000003E01FF87FE0 1FF8FFE00FF87FE007F81FE007F81FE007F81FE007F81FE007F81FE007F81FE007F81FE0 07F81FE007F81FE007F81FE007F81FE007F81FE007F81FE007F81FE007F81FE007F81FF0 0FF81FF83FF80FFFFFF80FFFFBF807FFF3FC03FFE3FE01FFC3FE007F00001F1C7F9A22> I119 D<7FFC1FF07FFC1FF01FF81FC00FF8 3F8007FC3F0007FE7E0003FFFC0001FFF80001FFF80000FFF000007FE000007FE000003F F000003FF000003FF800007FFC0000FFFC0001FBFE0003F3FE0003E1FF0007E0FF800FC0 FF801F807FC03F807FE0FFC0FFF8FFC0FFF81D1A7F991F>II E /Fn 61 124 df<03F80007FE000FFE 000FCE000F8E001F80001F80001F80001F80001F80001F80001F80001F80001F8000FFFF F8FFFFF81F81F81F81F81F81F81F81F81F81F81F81F81F81F81F81F81F81F81F81F81F81 F81F81F81F81F81F81F87FE7FE7FE7FE1720809F17>12 D<007FF001FFF803FFF807E1F8 0FC1F80FC1F80F81F81F81F81F81F81F81F81F81F81F81F81F81F81F81F8FFFFF8FFFFF8 1F81F81F81F81F81F81F81F81F81F81F81F81F81F81F81F81F81F81F81F81F81F81F81F8 1F81F81F81F87FE7FE7FE7FE1720809F17>I<381C7C3E7C3E7C3E3C1E381C381C301860 306030C0600F0B7E9914>34 D<00C06000C06001C0E001C0E001C0E001C0E00180C00180 C00381C00381C00381C00381C03FFFF83FFFF83FFFF83FFFF80703800703800703800603 000603000E07000E07000E07000E0700FFFFE0FFFFE0FFFFE0FFFFE01C0E001C0E001C0E 00180C00180C00381C00381C00381C00381C00381C0030180030180015297E9E18>I<00 4001E003E007C00F800F001E001E003C003C00780078007800F000F000F000F000F000F0 00F000F000F000F000F0007800780078003C003C001E001E000F000F8007C003E001E000 400B257E9C0E>40 D<4000F000F8007C003E001E000F000F000780078003C003C003C001 E001E001E001E001E001E001E001E001E001E001E003C003C003C0078007800F000F001E 003E007C00F800F00040000B25809C0E>I<003800003800003800003800003800003800 003800003800003800FFFFFCFFFFFCFFFFFC003800003800003800003800003800003800 00380000380000380000380000380016177B941F>43 D<3C7E7E7E7E3C1C1C1818303060 40C0070F7D850D>II<7CFEFEFEFE7C07067C850F>I<03F0 000FFC001FFE003F3F003E1F007E1F807E0F807C0F807C0FC0FC0FC0FC0FC0FC0FC0FC0F C0FC0FC0FC0FC0FC0FC0FC0FC0FC0FC0FC0FC0FC0FC0FC0F807C0F807C1F807E1F803E1F 003F3F001FFE000FFC0003F000121D7E9C17>48 D<00180000780001F80007F8001FF800 FFF800F9F80041F80001F80001F80001F80001F80001F80001F80001F80001F80001F800 01F80001F80001F80001F80001F80001F80001F80001F80001F80001F80003FC001FFF80 1FFF80111E7F9D17>I<07F0001FFC007FFE007FFF007C3F00781F80701F80001F80001F 80001F80003F00003F00007E0000FC0001F80003F00007C0000F80001F00001E00003C00 007C0000780080780180FFFF80FFFF00FFFF00FFFF00FFFF00111D7D9C17>I<0FF0007F FC007FFE00787F00703F00703F00003F00003F00003E00007E0000FC0007F00007F80007 FC00007E00003F00003F00001F80001F80001F80001F80001F80003F80003F00F07F00FF FE00FFFC00FFF8001FC000111D7D9C17>I<00C00001E00001E00003C00003C000038000 0781800787800F1F800F1F800E1F801E1F801E1F803C1F803C1F80381F80781F80701F80 F01F80FFFFFCFFFFFCFFFFFC001F80001F80001F80001F80007FE0007FE0161C7F9B17> I<7FFE007FFE007FFE007FFE007FFE007002007002007000007000007000007FF0007FFC 007FFE00007F00003F00003F00001F80001F80001F80001F80001F80001F80001F80003F 00E03F00F07E00FFFC00FFF8001FC000111D7D9C17>I<01FE0007FE000FFE001F8E003F 00003E00007E00007E00007C00007C7E00FDFF00FFFF80FF1F80FE0F80FE0FC0FC0FC0FC 0FC0FC0FC0FC0FC0FC0FC0FC0FC07C0FC07C0F807C0F803C0F003E1F001FFE000FFC0003 F000121D7E9C17>I<7FFFC07FFFC07FFFC07FFF80FFFF80C00700800E00000E00001C00 001C0000380000780000700000F00000E00001E00001C00003C00003C000038000078000 0780000F80000F00001F00001F00001F00003F00003F0000121D7D9C17>I<07F8001FFE 003FFF003F07007E03807E03807E03807E03807E03803F07003F8F001FFE000FF80007FC 001FFE003EFF00783F80701F80E00FC0E00FC0E00FC0E00FC0E00FC0E00FC0701F80783F 803FFF001FFE0007F800121D7E9C17>I<03F0000FFC001FFE003E1F007C0F007C0F80FC 0F80FC0F80FC0FC0FC0FC0FC0FC0FC0FC0FC0FC0FC0FC0FC0FC07C0FC07E1FC07FFFC03F EFC01F8F80000F80001F80001F80001F00003F001C7E001FFC001FF8001FE000121D7E9C 17>I<00060000000F0000000F0000001F8000001F8000001F8000003FC000003FC00000 7FE0000077E0000077E00000E3F00000E3F00001E3F80001E1F80001C1F80003C1FC0003 C0FC000780FE0007FFFE0007FFFE000F007F000E003F001E003F801E003F803C001FC03C 001FC0FE003FF0FE003FF01C1D809C1C>65 D<007F8001FFF007FFF80FE0FC1F807C3F00 3C3F003C7E00007E00007E0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC00 00FC00007E00007E00007E00003F00003F800C1FE03E0FFFFC07FFF801FFE0007F00171D 7E9C1A>67 D69 DI73 D75 DI<380000000E003C000000 1E003C0000001E003E0000003E003F0000007E003F800000FE003FC00000FE003FC00001 FE003FE00003FE003FF00007FE003FF80007FE003BF8000F7E003BFC001E7E0039FE003E 7E0038FF003C7E00387F80787E00387F80F07E00383FC1F07E00381FE1E07E00380FF3C0 7E003807F7807E003807FF807E003803FF007E003801FE007E003800FC007E0038007C00 7E00380078007E00FE000001FF80FE000001FF80291D7E9C2F>I<38000FE03C000FE03E 0003803F0003803F8003803FC003803FC003803FE003803FF003803FF803803BFC03803B FE038039FF038038FF8380387FC380383FE380381FF380380FFB803807FB803803FF8038 01FF803800FF8038007F8038007F8038003F8038001F8038000F80FE000780FE0003801B 1D7E9C20>I<007F800001FFE00007FFF8000FC1FC001F807E003F003F003F003F007E00 1F807E001F807E000F80FC000FC0FC000FC0FC000FC0FC000FC0FC000FC0FC000FC0FC00 0FC0FC000FC0FC000FC07C001F807E001F807E001F803F003F003F003F001F807E000FE0 FC0007FFF80001FFE000007F80001A1D7E9C1E>II<03FC000FFF801FFF803F0F803E07807E00007E00007E00007E00007F00 003F80003FE0001FF0000FFC0007FE0003FF0000FF80007F80003FC0001FC0000FC0000F C0000FC0F00FC0F01F80FC3F80FFFF003FFE0007F800121D7E9C16>83 DII<7FE01FE07FE01FE00FC00F0007E01E0007F03E0003F03C0003F878 0001FCF00000FDF00000FDE000007FC000007FC000003F8000001F8000001FC000001FE0 00003FE000007BF00000FBF80000F3F80001E1FC0003C1FE0003C0FE000780FF000F007F 800F003F801E003FC0FF007FF0FF007FF01C1D7F9C1D>88 D<03F8001FFE003FFF003FFF 80381F80000FC0000FC0003FC000FFC003FFC00F8FC03E0FC0780FC0F83FC0FFFFC0FFF7 C07FE7E01F87F014127F9116>97 DI<01FC000FFF001FFF803F0F807E07807E0000FC0000FC0000FC00 00FC0000FC0000FE00007E00007F00803F83C01FFF800FFE0003F80012127E9114>I<00 0FE0000FE00007E00007E00007E00007E00007E00007E00007E00007E00007E00007E000 07E00007E007E7E01FF7E03FFFE07F0FE07E07E07E07E0FC07E0FC07E0FC07E0FC07E0FC 07E0FC07E0FE07E07E07E07F0FE03FFBE01FFBF007E3F815207E9F18>I<03F8000FFE00 1FFF003F1F807E0F807E07C0FC07C0FFFFC0FFFFC0FC0000FC0000FC00007E00007F00C0 3F81E01FFFE00FFF8003FC0013127E9116>I<01F803FC07FC0FCC0F800F801F801F801F 801F801F801F801F801F80FFFCFFFC1F9C1F801F801F801F801F801F801F801F801F801F 801F801F801F807FE07FE00E20809F0E>I<07F0001FFFE03FFFE07C1FE0780F80F80F80 F80F80F80F80F80F00FC1F007FFE003FFC003FF0007000007FFF00FFFF80FFFFC07FFFC0 7007E06003E0E001E0E001E0E001E0E001E07003C07C0FC03FFF801FFF0003F800131D7E 9116>II<1C 003E003E003E001C0000000000000001000F00FF00FF003F003F003F003F003F003F003F 003F003F003F003F003F003F00FFC0FFC00A1B7F9A0C>I107 DI<061F01F000FE7FC7FC00FEFFEFFE003F FFFFFE003F87F87F003F03F03F003F03F03F003F03F03F003F03F03F003F03F03F003F03 F03F003F03F03F003F03F03F003F03F03F003F03F03F003F03F03F00FFCFFCFFC0FFCFFC FFC022127F9124>I<061F00FE7FC0FEFFE03FFFE03F87F03F03F03F03F03F03F03F03F0 3F03F03F03F03F03F03F03F03F03F03F03F03F03F0FFCFFCFFCFFC16127F9117>I<01F8 000FFF001FFF803F0FC07E07E07E07E0FC03F0FC03F0FC03F0FC03F0FC03F0FC03F07E07 E07E07E03F0FC01FFF800FFF0001F80014127E9118>I<061F00FE7FC0FEFFE03F87F03F 03F03F03F83F01F83F01F83F01F83F01F83F01F83F01F83F03F03F03F03F87F03FFFE03F 7FC03F3F003F00003F00003F00003F00003F00003F00003F00003F00003F0000FFE000FF E000151D7F9118>I<03F0600FF9E01FFFE03F0FE07E07E07E07E0FC07E0FC07E0FC07E0 FC07E0FC07E0FC07E0FE07E07E07E07F0FE03FFFE01FF7E007C7E00007E00007E00007E0 0007E00007E00007E00007E00007E00007E0001FFC001FFC161D7E9118>I<067EFEFFFF FF3F9F3F1F3F0F3F003F003F003F003F003F003F003F003F003F00FFC0FFC010127F9112 >I<0FFC003FFF807FFF807E0F807C00007C00003E00003FFC001FFF000FFF80001F8000 07C00007C0F007C0FC0FC0FFFF80FFFF001FF80012127F9114>I<00C0000FC0000FC000 0FC0000FC0000FC0000FC000FFFF00FFFF000FC7000FC0000FC0000FC0000FC0000FC000 0FC0000FC0000FC0000FC0000FC0000FC00007E08007FFC003FF8000FE001219819811> I<0100000F07F0FF07F0FF03F03F03F03F03F03F03F03F03F03F03F03F03F03F03F03F03 F03F03F03F03F03F87F01FFFF01FFDF00FFDFC03F1FC16137F9217>III<7FE3F87FE3F80FC3C007E78007FF0003FE0001FE0001FC0000FC0000FE 0001FF0003FF0003DF80079FC00F0FC01E07E0FF1FFCFF1FFC1612809116>II<7FFFC07FFFC07FFFC0601F80603F00007E00 00FC0001FC0003F80007F0000FE0000FC0001F80003F00607E0060FFFFE0FFFFC0FFFFC0 13127F9113>II E /Fo 7 111 df<018001800180018041 82F18F399C0FF003C003C00FF0399CF18F4182018001800180018010127E9215>3 D<0003FE0000000FFF8000003C01E00000F000780001C0001C0003000006000600000300 0C0000018018000000C018000000C0300000006030000000606000000030600000003060 00000030C000000018C000000018C000000018C000000018C000000018C000000018C000 000018C000000018C0000000186000000030600000003060000000303000000060300000 006018000000C018000000C00C000001800600000300030000060001C0001C0000F00078 00003C01E000000FFF80000003FE000025277E9D2A>13 D<03C00FF01FF83FFC7FFE7FFE FFFFFFFFFFFFFFFF7FFE7FFE3FFC1FF80FF003C010107E9115>15 D<003C00E001C00180038003800380038003800380038003800380038003800380038003 0007001C00F0001C00070003000380038003800380038003800380038003800380038003 800380018001C000E0003C0E297D9E15>102 D I106 D110 D E /Fp 73 124 df<000FC0003FF00070F000E07000E00001C00001C00003C00003C000 0380000380000380000780000780001FFFFC1FFFFC07003C07003C0F00380F00780E0078 0E00780E00781E00781E00F81E00F01C00F01C00F01C00F03C01F03C01F0FF07FC16207F 9F19>12 D<000FFE003FFF00781F00F00F01E00F01E00F03C01F03C01E03C01E03801E07 801E07801E07803E07803E1FFFFC1FFFFC07003C0F003C0F007C0F007C0E00780E00780E 00781E00F81E00F81E00F81C00F01C00F01C00F03C01F03C01F0FF07FC18207F9F19>I< 0700078007800F000F000F000F000E000E000E001E001E001C001C001C001C0038003800 38003800000000000000000000006000F000F0006000091D7A9C11>33 D<0E071E0F1E0F0C061C0E180C30186030C06010097B9916>I<000C06000C0600180C00 180C00180C0030180030180030180020100060300060300060300FFFFE0FFFFE0FFFFE01 80C00180C00180C0030180030180030180020100060300060300060300FFFFC0FFFFC0FF FFC0180C00180C00180C00301800301800301800201000603000603000603000C06000C0 6000C0600017297D9E19>I<0001F0000007F800000F0C00001E0600001C0600003C0600 003C0600003C0600003C0C00003C1C00003E7800001FF000007FC00003FF00000FFF807C 1FE780E03F83C0E07E03C0C07C01E1C0F801F1C0F800F380F8007B80F8007F00F8003E00 7C007E007F01FF003FFFEF801FFF8FC007FC07E01E1D7D9C1F>38 D<0E1E1E0C1C183060C007097B990D>I<000C003C00F801E003C007800F000E001E001C 003C0038007800700070007000F000E000E000E000E000E000E000E000E000E000600070 0070007000380038001C001C000E00070002000E257C9C0E>I<0100038001C000E000E0 007000700038003800380018001C001C001C001C001C001C001C001C001C003C00380038 00380078007000F000E001E001C003C007800F001E007C00F000C0000E25819C0E>I<00 6000006000006000006000006000006000006000006000006000006000FFFFF0FFFFF000 60000060000060000060000060000060000060000060000060000060001416789421>43 D<07000F800F800F800F000E000E001C00180030006000C000090C7F840E>II<60F0F0F06004057B840F>I<00000100000300000700000600000C00001C 0000180000300000700000600000C00000C0000180000300000300000600000E00000C00 00180000380000300000600000E00000C0000180000380000300000600000E00000C0000 180000380000300000600000600000C000008000001825809C16>I<001C00FC07FC1FFC 0C7C00780078007800F800F800F000F000F000F001F001F001E001E001E001E003E003E0 03C003C003C007C007C00FE0FFFC0E1D7C9C17>49 D<003F8000FFE003FFF003C3F00781 F80700F80600F80000F80000F80001F00001F00003E00007C0000F80001E00003C0000F0 0001C0000300000600000C00001800003800003000407000C07FFFC0FFFF80FFFF80FFFF 80151D7D9C17>I<007F0003FFC003C3E00781F00700F00600F00600F00000F00001E000 01E00003C0000F8000FC0000FF80000FC00007C00003E00003E00003E00003E00003E000 07E00007C0000FC0001F80E07F00FFFE00FFF8001FE000141D7D9C17>I<000300000380 000700000F00000E00001C00003C000038300070F000E1F000E1E001C1E00381E00381E0 0703E00E03E00E03C01C03C03803C03807C07007C4FFFFFCFFFFF8000780000780000F80 000F80001FC0007FE0161D7E9C17>I<03FFF003FFF003FFF003FFF00700100700000700 000700000600000600000E00000FFE000FFF800007C00003C00003E00001E00001E00001 E00001E00001E00003C00003C0000380000780E00F00F03E00FFF8001FE000141D7D9C17 >I<003FC001FFC003C1C00780C00F00000F00001E00003E00003E00003C7E007DFF007F 0F807E07807C03C0FC03C0F803C0F803C0F803C0F003C0F003C0F00780F00780F0078070 0F00780F00781E003C3C001FF80007C000121D7C9C17>I<00F80007FE000F0F001E0780 3C03803C03807803C07803C07803C0F003C0F003C0F007C0F007C0F007C0F00FC0F00F80 781F807C3F803FF7801F8700000F00000F00001E00001C00003C00C07800F1F000FFE000 FF0000121D7B9C17>57 D<1C3E3E1C00000000000060F0F0F060070F7C8E0D>I<000030 0000007000000070000000F0000000F8000001F8000001F8000003780000077C0000067C 00000E3C00000C3C00001C3C0000383E0000303E0000701E0000601E0000E01F0000FFFF 0001FFFF0003800F0003000F0007000F8006000F800C0007801C000780180007C0380007 C0FE001FF01C1D7F9C1C>65 D<07FFE001FFF801E07C01E03E01C01E01C01E03C01E03C0 1E03C03C03C03C0380780781F007FF8007FFF00780F807807C0F003C0F003E0F003E0F00 3E0F003E0F003E1E007C1E007C1E00FC1E01F83E07F03FFFE0FFFF00171D7C9C1C>I<00 0FE0007FFC01F83F03E01F07C00F0F80071F00061F00003E00003E00003C00007C00007C 0000780000F80000F80000F80000F80000F80000F80000F80000FC00007C00007E00003F 000C3FC07C1FFFF00FFFC003FE00181D7C9C1B>I<07FFFE0001FFFF8001FFFFC001E01F E001E007E001E003F003C001F003C001F803C000F803C000F803C000F807C000F8078000 F8078000F8078000F8078000F00F8001F00F8001F00F0001E00F0003E00F0003C00F0007 C01F0007801F000F001E001E001E003C003E01F0003FFFE000FFFF00001D1D7C9C21>I< 0FFFFE07FFFE03E00203C00203C00003C00003C00007C00007C000078000078000078000 07FFE00FFFE00F80200F80000F80000F00000F00000F00001F00001F00001F00001E0000 1E00081E00183FFFF03FFFF0FFFFF0171D7C9C19>I<0FFFFF07FFFF03E00103E00103E0 0003E00003C00007C00007C00007C00007C0000780000780000F80000FFFE00FFFE00F80 200F00000F00000F00001F00001F00001E00001E00001E00001E00003E00003F0000FF80 00181D7C9C19>I<000FF000007FFE0001F81F0003E00F8007C007800F8003801F000300 1F0000003E0000003E0000003C0000007C0000007C00000078000000F8000000F8000000 F8007F80F8001F00F8001F00F8001F00F8001E00FC001E007C003E007E003E003F003E00 3FC0FC001FFFFC000FFFDC0003FE0C00191D7C9C1D>I<0FF801FF07E000FC03E0007C03 C0007803C0007803C0007803C0007807C000F807C000F8078000F0078000F0078000F007 FFFFF00FFFFFF00F8001F00F8001F00F0001E00F0003E00F0003E00F0003E01F0003E01F 0003E01E0003C01E0007C01E0007C01E0007C03E0007C03F000FE0FF801FF0201D7C9C23 >I<0FF807E003E003C003C003C003C007C007C007800780078007800F800F800F800F00 0F000F000F001F001F001E001E001E001E003E003F00FF800D1D7C9C11>I<0FF80FF007 E003C003E0078003C00F0003C01C0003C0380003C0700007C1E00007C3C00007C7800007 8F0000079E000007BE00000FFF00000FFF00000FEF80000FC780000F8780000F03C0000F 03C0001F01E0001F01E0001F00F0001E00F0001E0070001E0078003E0038003E003C00FF 00FF001C1D7C9C1D>75 D<07FC0001F00001E00001E00001E00001C00003C00003C00003 C00003C00003C00007C0000780000780000780000780000F80000F80000F00000F00000F 00000F00001F00001F00001E00101E00103E00203FFFE0FFFFE0141D7C9C18>I<010000 0006018000000E018000001E03C000001E03C000003C03E000007C03E00000FC03F00001 FC03F00003FC07F80007FC0778000778067C000E78063C001E78063E003C780E1E0078F8 0E1F00F0F80E0F00E0F00C0F81C0F00C078380F00C07C780F01C03CF01F01C03FE01F018 01FC01F01801F801E01800F001E01800E001E038006003E03C000003E0FF00000FF0271D 7C9C2C>I<018000FF01C0003C01C0001C03E0001803F0001803F0001803F8001803FC00 38037E0038073E0030073F0030061F8030060F8070060FC0700607E0600E03F0600E01F0 600C01F8600C00FCE00C007CE01C007EC01C003FC018001FC018000FC018000FC0180007 C0380003803C000380FF000180201D7C9C22>I<0007F000003FFC0000783F0001E00F80 03C007C0078003C00F0003E01F0003E01E0001F03E0001F03E0001F07C0001F07C0001F0 7C0001F0F80001F0F80003E0F80003E0F80003E0F80007C0F80007C0F80007807C000F80 7C000F003C001E003E003C001F0078000FC1E00003FFC00000FE00001C1D7C9C20>I<07 FFF00001FFFC0001E03E0001E01F0001C00F0001C00F8003C00F8003C00F8003C00F8003 C00F0003801F0007801E0007803E0007807C000781F80007FFE0000FFF80000F0000000F 0000000F0000000F0000000F0000001E0000001E0000001E0000001E0000003E0000003F 000000FF800000191D7C9C1C>I<07FFF80001FFFE0001E03F0001E01F8001C00F8001C0 0F8003C00F8003C00F8003C00F8003C01F0003801F0007803E0007807C0007FFF00007FF C000078380000F83C0000F03C0000F01E0000F01E0000F00E0000F00F0001E00F0001E00 78001E0078001E003C003E003C003F001E00FF801F00191D7C9C1D>82 D<001FE000FFFC01E0FC03C03C03801C07800007800007800007800007C00003E00003F0 0001FC0000FE00007F00003F80000FC00007C00003E00001E00001E00001E00001E06001 C0F003C0F80780FE1F007FFE000FF000161D7E9C17>I<7FFFFEFFFFFE803C02803C0200 3C00007C0000780000780000780000780000F80000F00000F00000F00000F00001F00001 F00001E00001E00001E00003E00003E00003C00003C00003C00007C00007C0000FE0003F F000171D7B9C19>IIII<03FC00FE00F80078007800F0007C01E0003C03C0003E038000 1E0700001F0E00000F1E00000FBC00000FB8000007F0000007E0000003E0000003E00000 07E000000EF000001CF000003CF8000078780000F07C0001E03C0001C03E0003801E0007 001E000E001F001C000F003C000F80FF001FE01F1D7F9C1D>II<03FF8003FF800300000700000700000600000600000600000600000E00000C 00000C00000C00000C00001C000018000018000018000018000038000038000030000030 0000300000300000700000600000600000600000600000E00000C00000C00000C00000C0 0000FFE000FFE00011257B9C14>91 D<03FF8003FF800001800001800001800003800003 00000300000300000300000700000600000600000600000600000E00000C00000C00000C 00000C00000C00001C000018000018000018000018000038000030000030000030000030 00007000007000006000006000FFE000FFE0001125809C14>93 D<00FE000FFF001FFF80 1E07801803C00003C00003C0000FC0007FC001FF800FC7803E0780700780E00F00E03F00 FFE7007FC7003F0FC012127D9116>97 D<1FC0000780000780000780000780000780000F 00000F00000F00000F00000F00001F00001E00001E00001E3F801EFFC01FFFE03F83E03E 01F03E00F03E00F03C00F03C00F07C00F07C00E07C01E07801E07803C07807C0FC1F80E3 FF00C1FC0014207C9F19>I<00FC03FF0F0F1E073C073C007C007800F800F800F800F800 F800FC007E0C7FFC3FF00FC010127D9113>I<0000FE00003C00003C00003C00003C0000 3C0000780000780000780000780000780000F00000F00000F003F8F00FFEF01FC3E03F01 E03E01E07C01E07C01E07803E0F803C0F803C0F803C0F803C0F803C0FC03807E0F807FFF 803FFB801FC7E017207D9F19>I<00FC0003FF000FFF801F83803E01C03C01C07801C07F FFC0FFFFC0F80000F80000F80000F800007801007C03803E0F001FFE0007F00012127D91 16>I<001F80007F8000F38000E18001E00001E00003E00003C00003C00003C00003C000 07C00007C0000780001FFE001FFE000780000F80000F80000F00000F00000F00000F0000 1F00001F00001F00001E00001E00001E00003E00003E0000FF800011207F9F0E>I<007E 0003FFFC0787FC0F03E00F01E01E01E01E01E01E01E01E03C01F03C00F87800FFF000DF8 001800003800003FFF007FFF803FFFC03003C06001E0E001E0C001E0C001E0C003C0E007 C0781F803FFF001FFC0007F000161D7F9116>I<07F00001E00001E00001E00001E00001 E00003E00003C00003C00003C00003C00003C00007C00007C0000787E0079FF007FFF00F C0F80F00780F00780F00780E00780E00781E00781E00F81E00F01E00F01C00F01C00F03C 01F03C01F0FF07FC16207E9F19>I<00C001E001E000C0000000000000000003C00FC003 C003C003C00380078007800780078007800F800F000F000F000F001F00FFC00B1A7F990D >I<07F00001E00001E00001E00001E00001E00003C00003C00003C00003C00003C00003 C0000780000780000783F80781F00783C00F0F000F1E000F78000FF8000FFC000F3C001F 3E001E1E001E0F001E0F801E07801E07C03E03C03E03E0FF07F815207E9F17>107 D<03F800F000F000F000F000F001F001E001E001E001E001E003E003C003C003C003C003 C007C007C007800780078007800F800F800F000F000F001F001F00FFC00D207F9F0D>I< 038FE0FC001FBFF3FE0007FFF7FE0007C1FC1F000700F00F000700F00F000F00F00F000E 00E00F000E00E00F000E00E00F000E01E01F001E01E01E001E01E01E001C01C01E001C01 C01E001C03C03E003C03C03E00FF0FF0FF8021127E9125>I<0387E01FBFF007FFF007C0 F80700780700780F00780E00780E00780E00780E00F81E00F01E00F01C00F01C00F01C01 F03C01F0FF07FC16127E9119>I<00FF0003FFC00FC1E01F00F03E00703C00787C00787C 0078F80078F80078F800F0F800F0F800E07801E07C03C03E0F801FFE0007F80015127D91 19>I<00E3F807EFFC01FFFE01F83E01E01F01E00F03E00F03C00F03C00F03C00F03C00E 07C01E07801E07803C07807C07C1F80FBFF00F0FC00F00000F00000F00001F00001F0000 1E00001E00001E00001E00003E0000FFC000181D809119>I<03F8300FFC701FC3F03F01 F03E01E07C01E07C03E07803E0F803E0F803E0F803C0F803C0F807C0FC07C07E1FC07FFF C03FF7801F8780000780000F80000F80000F80000F80000F00000F00001F00001F00001F 00007FE0141D7D9119>I<03BF001FFF80079F80078F800787000700000F00000F00000F 00000F00000F00001F00001E00001E00001E00001E00003E0000FF800011127E9111>I< 01FE0007FF800F0F801E03801E00001E00001F00000FF00007FC0001FE00007F00001F00 000F00E00F00F00F00FC1E00FFFC001FF00011127E9113>I<03000F000F000E000E001E 00FFFCFFFC1E001C003C003C003C003C003C003800780078007800780078107C303FE01F 800E187C9711>I<3C07E0FC01E03C01E03C01C03801C07803C07803C07803C078038070 0380F00380F00780F00780F00700F81F00FFF7007FE7003F8FC013127B9119>III<0FE0FE03E07801E0F001F1E000F3C000FF80007F00007E0000 3E00007E0000FF0001EF0003CF800787800F07C01E03C03E03E0FF07F81712809115>I< 1FE07F07801C07801803803003C03003C06003C0E001E0C001E18001E38001F30000F700 00F60000FC0000FC0000780000700000700000E00000E00001C000018000038000030000 0600000E00000C00001C0000FF0000181D7F9117>I<0FFFC01FFFC0180F80101F00003E 00007E0000FC0001F80001F00003E00007E0000FC0001F80001F01003E01007C0200FFFE 00FFFE0012127F9111>II E /Fq 77 123 df<00000070001E1FF007FE3FF00FFE78701F0EF0701E06F0701E06E0003C01E0003C01 E0003C01E0003C01E0003C01E0003C01E0003C01E000FFFFFF80FFFFFF803C01E0003C01 E0003C01E0003C01E0003C01E0003C01E0003C01E0003C01E0003C01E0003C01E0003C01 E0003C01E0003C01E0003C01E0003C01F000FF07FC001C207F9F1A>11 D<03F80007FE000F1E000E0E001E00001C00001C00003C00003C00003C00003C00003C00 003C00003C0000FFFFE0FFFFE03C01E03C01E03C01E03C01E03C01E03C01E03C01E03C01 E03C01E03C01E03C01E03C01E03C01E03C01E03C01F0FF07FC16207F9F19>I<00FFC003 FFE00783E00F01E00E01E01E01E01C01E03C01E03C01E03C01E03C01E03C01E03C01E03C 01E0FFFFE0FFFFE03C01E03C01E03C01E03C01E03C01E03C01E03C01E03C01E03C01E03C 01E03C01E03C01E03C01E03C01E03C01F0FF07FC16207F9F19>I<000001F000001E3FF0 0007FE7FF0000FFEF870001F0EF030001E06F030001E07E000003C01E000003C01E00000 3C01E000003C01E000003C01E000003C01E000003C01E00000FFFFFFFF00FFFFFFFF003C 01E00F003C01E00F003C01E00F003C01E00F003C01E00F003C01E00F003C01E00F003C01 E00F003C01E00F003C01E00F003C01E00F003C01E00F003C01E00F003C01E00F003C01E0 0F80FF07F83FE023207F9F25>I33 D<6030F078F0787038603060304020C060804080400D 0A7C9916>I<00C06000C06000C0600080400180C00180C00180C00180C00180C00180C0 0100800301803FFFF83FFFF83FFFF8030180020100060300060300060300060300060300 0603000402000C0600FFFFE0FFFFE0FFFFE00C0600080400180C00180C00180C00180C00 180C00180C0010080030180030180030180030180015297E9E19>I<001F0000007FC000 00F8E00000F0600001E0300001E0300001E0300001E0300001F0600000F0E00000FBC000 007F800001FE000007FC00001F9E01F03E0F03807C0F83807807C300F003C300F001E700 F001F600F000FE00F0007C0078003C007C007E003F01FF001FFFEF8007FF87C001FC03F0 1C1D7E9C1F>38 D<60F0F070606040C08080040A7C990D>I<006001E003C007800F000E 001C001C0038003800780070007000F000E000E000E000E000E000E000E000E000E000F0 00700070007000380038001C001C000E000F00078003C001E000600B257E9C0E>II<0030000030000030000030000030000030000030000030000030000030 00FFFFFCFFFFFC0030000030000030000030000030000030000030000030000030000030 0016167A9421>43 D<3078787838303030202060404080050E7C840D>II<60F0F0F06004057B840F>I<0000400000C00000C00001800001800003000003 00000600000600000C00000C00001C0000180000180000300000300000600000600000C0 0000C0000180000180000300000300000700000600000E00000C00000C00001800001800 00300000300000600000600000C0000040000012257F9C16>I<03F0000FFC001E1E003C 0F003807007807807807807003807003C0F003C0F003C0F003C0F003C0F003C0F003C0F0 03C0F003C0F003C0F003C0F003C0F003807003807807807807803807003C0F001E1E000F FC0003F000121D7E9C17>I<004001C003C00FC03FC0F3C043C003C003C003C003C003C0 03C003C003C003C003C003C003C003C003C003C003C003C003C003C003C003C007E07FFE 0F1E7D9D17>I<07F0001FFC007FFE007C1F00780F007007807007800007800007800007 80000F00000F00001E00003C0000780000E00003C0000700000E00001C00001800003800 00700000700080700080FFFF80FFFF00FFFF00FFFF00111D7D9C17>I<0FF0007FFC0078 3E00701F00600F00600F00000F00000F00000F00000E00001E00007C0007E00007FC0000 1E00000F00000F00000780000780000780000780000780000F80000F00C01F00F07E00FF FC00FFF0001FC000111D7D9C17>I<00300000380000700000700000E00000E00000E000 01C18001C7800387800387800707800707800E07800E07801C07801C0780380780380780 700780700780FFFFF8FFFFF8000780000780000780000780000FC0003FF0151D7F9C17> I<7FFE007FFE007FFE007FFE007002007002007000007000007000007000007000007FF0 007FFC00003E00001F00000F00000F80000780000780000780000780000780000780000F 00C00F00E01E00F07C00FFF8001FC000111D7D9C17>I<01FE0007FE000E0E001C060038 000038000078000070000070000071F800F7FE00FE1F00FC0F80F80780F80780F003C0F0 03C0F003C0F003C0F003C0F003C07003C07003807807803807003C0F001E1E000FFC0003 F000121D7E9C17>I<7FFFC07FFFC07FFF80FFFF80800300800600000600000C00001C00 00180000380000300000700000600000E00000C00001C000018000038000038000070000 0700000F00000F00000E00001E00001E00003E00003C0000121D7D9C17>I<07F8001FFE 003E07003C03007801807801807801807801807801803C03003E06001F9C000FF00003F8 000FFE001E7F00381F80700F806007C0C003C0C003C0C003C0C003C0C003C0600780700F 803C3F001FFE0007F800121D7E9C17>I<03F0000FFC001E1E003C0F00780700780780F0 0380F00380F003C0F003C0F003C0F003C0F003C0F003C07807C07807C07C0FC03E1FC01F FBC007E380000380000380000780000700000700180E001C1C001FF8001FE000121D7E9C 17>I<60F0F06000000000000060F0F0F060040F7C8E0D>I<307878300000000000003078 78783830303020206040408005187D8E0D>I<000200000007000000070000000F800000 0F8000000F8000001FC000001BC000003BE0000031E0000071F0000071F0000060F00000 E0F80000E0780001C07C0001C07C0001803C0003FFFE0003FFFE0007001F0007001F000E 000F800E000F800E000F801C0007C01C0007C03C0007E0FE000FF81D1D809C1C>65 DI<007F8001FFF007C1F80F007C1E 003C3C001C3C001C780000780000780000F00000F00000F00000F00000F00000F00000F0 0000F00000F000007800007800007C00003C00003E00001F00060FC03E07FFF801FFE000 7F00171D7E9C1B>IIII<003FC000 00FFF80003E0FC0007803E000F001E001E000E003C000E003C0000007800000078000000 78000000F0000000F0000000F0000000F0000000F0000000F0007F80F0001F00F0000F00 78000F0078000F007C000F003C000F003E000F001F000F000FC03F0007FFFF0001FFE700 007F8300191D7E9C1D>III75 DI<30000000C030000001C0380000 01C03C000003C03C000003C03E000007C03F00000FC03F00000FC03F80001FC03FC0003F C03BC0003BC03BE00073C039F000F3C038F000E3C038F801C3C0387C03C3C0383C0383C0 383E0703C0381F0F03C0380F8E03C038079C03C03807FC03C03803F803C03801F003C038 01F003C03800E003C038004003C03C000003C0FF00000FF0241D7C9C2C>I<30001FE038 0007803C0003803E0003803E0003803F0003803F8003803FC003803BE0038039F0038039 F8038038F80380387C0380383E0380381F0380380F83803807C3803803E3803803F38038 01F3803800FB8038007F8038003F8038001F8038000F8038000F80380007803C000380FF 0001801B1D7C9C22>I<007F800001FFE00007C0F8000F003C001E001E003C000F003C00 0F00780007807800078078000780F00003C0F00003C0F00003C0F00003C0F00003C0F000 03C0F00003C0F00003C0F00003C07800078078000780780007803C000F003C000F001E00 1E000F003C0007C0F80001FFE000007F80001A1D7E9C1F>II82 D<03FC000FFF801E1F803C07803803807800007800007800007800007C00003E00003F80 001FC0000FF00007FC0001FE00007F00001F80000F800007C00003C00003C00003C0E003 C0F00380F80780FE0F007FFE000FF800121D7E9C17>III87 D<7F800FC01F000F000F801E0007801C0007C03C0003E0780003E0700001F0E00000F8E0 0000F9C000007D8000003F8000003F0000001F0000001F8000001F8000003BC000007BC0 000071E00000E1F00001E0F00003C0780003807C0007003C000F001E000E001E001C000F 003C000F80FE003FE01B1D7F9C1D>I<100830183018603060306030E070F078F0786030 0D0A7C9716>92 D<103030606060E0F0F060040A7C970D>96 D<03FC001FFE003FFF003C 1F00300F80000780000780000F80007F8003F7800F87803E0780780780F00F80F83F80FF F7807FE7801F87E013127E9116>II<07E01FFC3C3C781C780CF000F000F000F000F000F000F800F800 7C007E0E3FFE1FF807E00F127E9112>I<000FC00003C00003C00003C00003C00003C000 03C00003C00003C00003C00003C00003C00003C00003C007E3C01FFBC03F0FC07C03C078 03C07803C0F003C0F003C0F003C0F003C0F003C0F803C0F803C07C03C07E0FC03FFFC01F FBC007E3F014207E9F19>I<03F8000FFE001FFF003E0F007C0780780380FFFF80FFFF80 F00000F00000F00000F00000F800007800007C00803F03C01FFF0007F80012127E9116> I<07F00FF01E701C301C003C003C003C003C003C003C003C003C003C00FFF0FFF03C003C 003C003C003C003C003C003C003C003C003C003C003C003C003E00FF800C207F9F0E>I< 07F0001FFFC03C3FC0781E00700F00F00F00F00F00F00F00F00E00F81E007C3C003FF800 3FE000600000600000FFFC00FFFF007FFF806007804003C0C001C0C001C0C001C0C001C0 400180600380380F001FFE0003F000121D7E9116>II<0C001E001E000C0000000000000002000E007E 005E001E001E001E001E001E001E001E001E001E001E001E001E001E003F00FFC00A1A7F 990D>I<0300078007800300000000000000008003801F80178007800780078007800780 07800780078007800780078007800780078007800780078007800780078007000F000F00 DF00FE00FC00092580990D>II<7E001E001E001E001E001E001E001E001E001E001E001E001E001E00 1E001E001E001E001E001E001E001E001E001E001E001E001E001E001E001E003F00FFC0 0A207F9F0D>I<04000000001C3F01F800FCFFC7FC00BFFFFFFE003F07F83E003C03E01F 003C01E00F003C01E00F003C01E00F003C01E00F003C01E00F003C01E00F003C01E00F00 3C01E00F003C01E00F003C01E00F003C01E00F003C01E00F80FF07F83FE023137E9225> I<0400001C3F00FCFF80BFFFC03F07C03C03E03C01E03C01E03C01E03C01E03C01E03C01 E03C01E03C01E03C01E03C01E03C01E03C01F0FF07FC16137E9219>I<01F8000FFF001E 0F803C03C07801E07801E0F000F0F000F0F000F0F000F0F000F0F000F07801E07801E03C 03C01F07800FFF0001F80014127E9118>I<0400001C7E00FDFF80BFFFC03F07E03C03E0 3C01F03C01F03C00F03C00F03C00F03C00F03C00F03C01E03C01E03C03E03F0FC03DFF80 3C7E003C00003C00003C00003C00003C00003C00003C00003C00003C00003E0000FFC000 141E7E9219>I<07E0C01FF9C03F0FC07C03C07803C07803C0F003C0F003C0F003C0F003 C0F003C0F803C0F803C07C03C07E0FC03FFFC01FFBC007C3C00003C00003C00003C00003 C00003C00003C00003C00003C00003C00003E0000FFC161D7E9119>I<04001CF8FDFCBE 7C3C7C3C7C3C3C3C003C003C003C003C003C003C003C003C003C003E00FF800E137E9211 >I<0FF03FFC7C3C781C780078007C003FE01FF80FFC00FE003E001EE01EF01EFC3CFFF8 1FE00F127E9113>I<06001E001E001E001E001E00FFF8FFF81E001E001E001E001E001E 001E001E001E001E001E001E000F040F8E07FC01F00F187F9710>I<0400001C07E0FC01 E0BC01E03C01E03C01E03C01E03C01E03C01E03C01E03C01E03C01E03C01E03C01E03E01 E01F07E01FFFE00FF9E007E1F815137E9219>III<7F83 F01F03C00F878007870007CE0003FE0001FC0001F80000F80000FC0001FC0003FE00079F 00070F800E07801C03C03C03E0FE0FF81512809115>II<7FFE7FFE403C407800F801F001E003E007C007C00F800F001F003E 013C017803FFFFFFFE10127F9111>I E /Fr 6 110 df73 D<00001FFE0000000003FFFFC00000001FFFFFF0000000FFFFFFFC000003FFFFFFFE0000 07FFFFFFFF000007FFFFFFFF800007FFFFFFFFC00007FFFFFFFFC00007FF807FFFE00007 FC000FFFE00007F00007FFF00007C00003FFF00000000003FFF00000000001FFF8000000 0001FFF80000000001FFF8000000000FFFF8000000003FFFF800000001FFFFF800000007 FFFFF80000003FFFFFF8000000FFFFFFF8000003FFFFFFF800000FFFFDFFF800003FFFE1 FFF800007FFF81FFF80001FFFE01FFF80007FFF001FFF8000FFFC001FFF8001FFF8001FF F8003FFE0001FFF8007FFC0001FFF8007FF80003FFF800FFF80007FFF800FFF8001FFFF8 00FFFC00FE7FF800FFFFFFFE7FF800FFFFFFFC7FF8007FFFFFFC7FF8007FFFFFF87FFC00 3FFFFFF07FFF001FFFFFE07FFF8007FFFF807FFF8001FFFE007FFF00003FF00000000031 2E7DAC36>97 D<00000FFE00000000FFFFE0000007FFFFFC00001FFFFFFF00003FFFFFFF C000FFFFFFFFE001FFFFFFFFE003FFFFFFFFE007FFFE03FFE00FFFF800FFE00FFFE0007F E01FFFC0003FE01FFF80001FE03FFF000000003FFF000000007FFE000000007FFE000000 007FFE00000000FFFE00000000FFFC00000000FFFC00000000FFFC00000000FFFC000000 00FFFC00000000FFFC00000000FFFC00000000FFFC00000000FFFC000000007FFE000000 007FFE000000007FFE000000007FFF000000003FFF000000003FFF800000C01FFFC00001 E01FFFE00007F00FFFF8001FF80FFFFF00FFF807FFFFFFFFF003FFFFFFFFE001FFFFFFFF 8000FFFFFFFF00003FFFFFFC00000FFFFFF0000003FFFF800000007FF800002D2E7CAC32 >99 D<00003FFC00000001FFFFC0000007FFFFF000001FFFFFFC00007FFFFFFE0000FFFF FFFF0001FFFFFFFF8003FFFFFFFFC007FFF80FFFC00FFFE003FFE00FFFC001FFE01FFF80 00FFE01FFF8000FFF03FFF0000FFF03FFF00007FF07FFE00007FF07FFE00007FF87FFFFF FFFFF87FFFFFFFFFF8FFFFFFFFFFF8FFFFFFFFFFF8FFFFFFFFFFF8FFFFFFFFFFF8FFFC00 000000FFFC00000000FFFC00000000FFFC00000000FFFE00000000FFFE000000007FFE00 0000007FFF000000007FFF000000007FFF800000003FFFC00000603FFFE00000F01FFFF0 0003F80FFFFC000FFC0FFFFF807FFE07FFFFFFFFFE03FFFFFFFFFC01FFFFFFFFF000FFFF FFFFC0003FFFFFFF00000FFFFFFC000003FFFFE00000003FFC00002F2E7CAC37>101 D107 D<00038007FC00000FF80000001F803FFF80007FFF000001FF80FFFFE001FFFFC0001FFF 83FFFFF807FFFFE000FFFF87FFFFFC0FFFFFF000FFFF8FFFFFFE1FFFFFF8007FFF9FFFFF FF1FFFFFFC007FFF9FFFFFFF3FFFFFFC0007FFFFFFFFFFBFFFFFFE0007FFFFC1FFFFFF83 FFFE0007FFFE007FFFFC00FFFF0007FFF8003FFFF0007FFF0007FFF0001FFFE0003FFF00 07FFE0001FFFC0003FFF8007FFE0001FFFC0003FFF8007FFE0000FFFC0001FFF8007FFE0 000FFFC0001FFF8007FFE0000FFFC0001FFF8007FFE0000FFFC0001FFF8007FFE0000FFF C0001FFF8007FFE0000FFFC0001FFF8007FFE0000FFFC0001FFF8007FFE0000FFFC0001F FF8007FFE0000FFFC0001FFF8007FFE0000FFFC0001FFF8007FFE0000FFFC0001FFF8007 FFE0000FFFC0001FFF8007FFE0000FFFC0001FFF8007FFE0000FFFC0001FFF8007FFE000 0FFFC0001FFF8007FFE0000FFFC0001FFF8007FFE0000FFFC0001FFF8007FFE0000FFFC0 001FFF8007FFE0000FFFC0001FFF8007FFE0000FFFC0001FFF8007FFE0000FFFC0001FFF 8007FFE0000FFFC0001FFF8007FFE0000FFFC0001FFF8007FFE0000FFFC0001FFF8007FF E0000FFFC0001FFF800FFFF0001FFFE0003FFFC07FFFFE00FFFFFC01FFFFFE7FFFFE00FF FFFC01FFFFFE7FFFFE00FFFFFC01FFFFFE7FFFFE00FFFFFC01FFFFFE572D7DAC59>109 D E /Fs 27 118 df<7CFEFEFEFEFE7C0707798616>46 D<000018000000001800000000 3C000000003C000000007E000000007E000000007E00000000FF00000000FF00000001FF 80000001DF80000001DF800000038FC00000038FC00000078FE000000707E000000707E0 00000F03F000000E03F000001E03F800001E01F800001C01F800003C00FC00003800FC00 0078007E00007FFFFE00007FFFFE0000FFFFFF0000F0003F0001F0003F8001E0001F8001 E0001F8003C0000FC003C0000FC007C0000FE007800007E007800007E00F000003F00F00 0003F01F000003F8FFC0000FFFFFC0000FFF282A80A929>65 DI<0003FE0000000FFFC000003FFFF000 00FFFFFC0001FF03FE0003FC00FE0007F0007E000FE0003E000FC0001E001F80001E001F 800000003F000000003F000000007E000000007E000000007E000000007E00000000FC00 000000FC00000000FC00000000FC00000000FC00000000FC00000000FC00000000FC0000 0000FC00000000FC000000007E000000007E000000007E000000003F000000003F000000 001F800000001F800000000FC00001000FE000078007F8001F0003FE00FE0001FFFFFC00 00FFFFF000003FFF80000007FC0000212A7CA927>I69 DI73 D75 D<180000000001801C0000000003801C0000000003801E0000000007801F00000000 0F801F000000000F801F800000001F801FC00000003F801FE00000003F801FE00000007F 801FF0000000FF801FF8000000FF801FF8000001FF801EFC000003EF801EFE000003CF80 1E7E000007CF801E7F0000078F801E3F80000F0F801E1F80001E0F801E1FC0001E1F801E 0FE0003C1F801E07F000781F801E07F000781F801E03F800F01F801E01FC01E01F801E01 FC01E01F801E00FE03C01F801E007F07801F801E007F07801F801E003F8F001F801E001F 8E001F801E001FDE001F801E000FFC001F801E0007F8001F801E0007F8001F801E0003F0 001F801E0001E0001F801E0001E0001F801E0000C0001F801F000000001F80FFE0000000 FFF0FFE0000000FFF0342A7BA93F>77 D80 D84 D<003FC00003FFF0000FFFF8003FFFFC003F81FC003E00FE0038007E 0030007F0000003F0000003F0000003F000000FF000007FF00001FFF00007FFF0001FE3F 0007F03F001FC03F003F003F007C003F00F8003F00F8007F00F800DF00FC03DF00FFFF9F 007FFF1FE03FFC1FE00FF000001B1C7D9A20>97 DI< 007F0001FFC007FFF00FFFF81FE1F83F80F83F00787E00787E00007E0000FC0000FC0000 FC0000FC0000FC0000FC0000FC0000FC0000FE00007E00007E00007F00003F80183FE07C 1FFFF80FFFF007FFC000FE00161C7C9A1B>I<00007FC000007FC000000FC000000FC000 000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000 000FC000000FC000000FC000000FC000000FC000000FC000FE0FC003FF8FC007FFEFC00F FFFFC01FF07FC03FC01FC03F800FC07F000FC07F000FC07E000FC0FE000FC0FC000FC0FC 000FC0FC000FC0FC000FC0FC000FC0FC000FC0FC000FC0FE000FC07E000FC07E000FC07F 000FC03F801FC03FE0FFC01FFFF7C00FFFE7F807FF87F801FE00001D2F7CAD24>I<007F 800001FFE00007FFF8000FFFFC001FE0FE003F803E003F001F007E001F007E000F807C00 0F80FFFFFF80FFFFFF80FFFFFF80FC000000FC000000FC000000FC000000FC0000007E00 00007E0000007F0000003F8001803FC003801FF01FC00FFFFF8007FFFE0001FFF800007F C0001A1C7C9A20>I<01FE000007FF80001FFFFFC03FFFFFC07F83FFC07E00FFC0FC007C 00FC003E00F8003E00F8003E00F8003E00F8003E00F8007E007C007C007E00FC003F83F8 001FFFF0001FFFC0001DFE00003800000038000000780000007FFFF000FFFFFC00FFFFFE 00FFFFFF007FFFFF001FFFFF8038003F8070000FC0700007C0F00003C0F00003C0F00003 C0F00003C0F00003C0780007807C000F803F807F001FFFFE000FFFFC0003FFF000007F80 001A2B7C9A1F>103 DI<07800FC00FC00FC00FC00780000000 0000000000004003C01FC07FC05FC00FC00FC00FC00FC00FC00FC00FC00FC00FC00FC00F C00FC00FC00FC00FC00FC00FC00FC00FC00FC0FFFCFFFC0E257EA412>I107 D<7FC07FC00FC00FC00FC00FC00FC00FC00FC00FC00FC00FC00FC00FC00F C00FC00FC00FC00FC00FC00FC00FC00FC00FC00FC00FC00FC00FC00FC00FC00FC00FC00F C00FC00FC00FC00FC00FC00FC00FC00FC00FC00FC00FC0FFFCFFFC0E2E7EAD12>I<0101 FC00070FFF003F1FFF80FF3FFF80BF783FC01FE01FC01F800FE01F800FE01F8007E01F80 07E01F8007E01F8007E01F8007E01F8007E01F8007E01F8007E01F8007E01F8007E01F80 07E01F8007E01F8007E01F8007E01F8007E01F8007E01F8007F0FFF03FFEFFF03FFE1F1B 7D9A23>110 D<001FC00000FFF80003FFFE0007FFFF000FE07F801F801FC03F000FC03E 0007E07E0007E07E0007F07C0003F0FC0003F0FC0003F0FC0003F0FC0003F0FC0003F0FC 0003F0FC0003E0FE0007E07E0007E07E0007C03F000FC03F801F801FE07F000FFFFE0007 FFFC0001FFF000003F80001C1C7C9A23>I<010FC0073FF03F7FF8FF7FF8DFE3F81FC3F8 1F83F81F83F81F81F01F80001F80001F80001F80001F80001F80001F80001F80001F8000 1F80001F80001F80001F80001F80001F80001F8000FFF800FFF800151B7D9A19>114 D<01FE000FFFC01FFFF03FFFF07F07F07E01F07C00F07C00007C00003E00003F00001FE0 000FFF0007FFC000FFE0000FF00001F80000F800007C00007CF0007CF8007CFE00FCFF83 F8FFFFF8FFFFF03FFFC003FF00161C7D9A1B>I<01C0000FC0000FC0000FC0000FC0000F C0000FC0000FC0000FC0000FC000FFFFF0FFFFF0FFFFF00FC0000FC0000FC0000FC0000F C0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000F E00007E00807F01C07F83C03FFF801FFF000FFC0003F0016257FA318>I<008000000780 3FE03F803FE0FF8007E0BF8007E01F8007E01F8007E01F8007E01F8007E01F8007E01F80 07E01F8007E01F8007E01F8007E01F8007E01F8007E01F8007E01F8007E01F8007E01F80 07E01FC007E01FC007E00FE01FE00FF07BE00FFFF3E007FFE3FC03FF83FC00FE00001E1C 7E9A23>I E /Ft 7 117 df<00000000000700000000000000000F80000000000000000F 80000000000000001F80000000000000001F80000000000000003F80000000000000003F C0000000000000007FC000000000000000FFC000000000000000FFC000000000000001FF E000000000000001FFE000000000000003FFE000000000000003FFE000000000000007FF E00000000000000FFFF00000000000000FFFF00000000000001FFFF00000000000001FFF F00000000000003F9FF80000000000003F9FF80000000000007F1FF8000000000000FF1F F8000000000000FE1FF8000000000001FE1FFC000000000001FC0FFC000000000003FC0F FC000000000003F80FFC000000000007F00FFE00000000000FF00FFE00000000000FE007 FE00000000001FE007FE00000000001FC007FE00000000003FC007FF00000000003F8007 FF00000000007F0003FF0000000000FF0003FF0000000000FE0003FF8000000001FE0003 FF8000000001FC0001FF8000000003FC0001FF8000000003F80001FF8000000007F00001 FFC00000000FF00001FFC00000000FE00000FFC00000001FFFFFFFFFC00000001FFFFFFF FFE00000003FFFFFFFFFE00000003FFFFFFFFFE00000007FFFFFFFFFE0000000FF000000 7FE0000000FE0000007FF0000001FE0000003FF0000001FC0000003FF0000003FC000000 3FF0000003F80000003FF8000007F80000001FF800000FF00000001FF800000FF0000000 1FF800001FE00000001FF800001FC00000000FFC00003FC00000000FFC00003F80000000 0FFC00007F800000000FFC0000FF000000000FFE0000FF0000000007FE0001FE00000000 07FE0001FE0000000007FE0003FC0000000007FF0007FC0000000007FF001FFC00000000 0FFF80FFFF800000007FFFF8FFFF800000007FFFF8FFFF800000007FFFF8454A7FC947> 65 D<00FFFFFF00FFFFFF00FFFFFF000FFFF00003FFE00001FFE00001FFC00001FFC000 01FFC00001FFC00001FF800001FF800001FF800003FF800003FF800003FF800003FF0000 03FF000003FF000007FF000007FF000007FE000007FE000007FE000007FE00000FFE0000 0FFE00000FFC00000FFC00000FFC00000FFC00001FFC00001FF800001FF800001FF80000 1FF800001FF800003FF800003FF000003FF000003FF000003FF000003FF000007FE00000 7FE000007FE000007FE000007FE00000FFC00000FFC00000FFC00000FFC00000FFC00000 FFC00001FF800001FF800001FF800001FF800001FF800001FF800003FF000003FF000003 FF000003FF000003FF000007FF000007FF000007FF80000FFFE000FFFFFE00FFFFFE00FF FFFE00204875C729>73 D<0000003FF80000000FFFFE0000007FFFFF800003FFFFFFC000 1FFFFFFFE0003FFFFFFFF0003FFFFFFFF0003FFE01FFF8007FE0007FF8007F80003FF800 7E00001FFC007C00001FFC007000000FFC000000000FFC000000000FFC000000000FFC00 0000000FFC000000000FFC000000007FFC00000003FFF80000001FFFF8000000FFFFF800 0007FFFFF800001FFFFFF80000FFFF1FF80003FFF83FF0000FFFE03FF0003FFF003FF000 FFF8003FF003FFE0003FF00FFF00003FE01FFC00007FE03FF000007FE07FE000007FE07F C00000FFE0FFC00001FFE0FFC00007FFC0FFE0003F7FC0FFF801FE7FC0FFFFFFFC7FC07F FFFFF87FC07FFFFFF0FFE03FFFFFE0FFFC1FFFFF80FFFE07FFFC00FFFE00FFC00000002F 2E7BAC38>97 D<000007FE0000007FFFC00001FFFFF00007FFFFFC000FFFFFFE003FFFFF FF007FFE0FFF00FFF803FF01FFE001FF03FFC000FF03FF8000FE07FF00007E0FFE00001E 0FFE0000001FFC0000001FFC0000003FF80000003FF80000003FF80000007FF00000007F F00000007FF00000007FF0000000FFE0000000FFE0000000FFE0000000FFE0000000FFE0 000000FFE0000000FFE0000000FFE0000000FFE0000000FFF00000007FF00000007FF000 00007FF80000003FF80000C03FFC0001E01FFE0007F01FFF807FF00FFFFFFFE007FFFFFF 8003FFFFFE0001FFFFF800007FFFC000000FFC0000282E77AC2E>99 D<00003F0000007F800000FFC00000FFC00000FFC00000FFC00000FFC00000FFC000007F 8000003F0000000000000000000000000000000000000000000000000000000000000000 000000018000003F80000FFF0000FFFF0000FFFF00007FFF000007FF000007FF000007FE 000007FE000007FE000007FE00000FFE00000FFC00000FFC00000FFC00000FFC00000FFC 00001FFC00001FF800001FF800001FF800001FF800001FF800003FF000003FF000003FF0 00003FF000003FF000003FF000007FE000007FE000007FE000007FE000007FE000007FC0 0000FFC00000FFC00000FFC00000FFC00001FFC00003FFE000FFFFFF80FFFFFF80FFFFFF 801A3F7CBE20>105 D<00000FFF00000000FFFFF8000003FFFFFF00000FFFFFFFC0001F FFFFFFC0003FFFFFFFC0007FF80FFFC0007FE001FFC000FFC0007F8000FF80001F8001FF 0000078001FF0000000001FF0000000001FF0000000001FF0000000001FF8000000000FF C000000000FFF0000000007FFE000000007FFFE00000003FFFFC0000001FFFFF0000000F FFFFC0000003FFFFE00000007FFFF000000007FFF800000000FFF8000000003FFC000000 000FFC0000000007FE0000000003FE0000000003FE0000000003FE0000000003FE007800 0003FE007E000007FE007F800007FC007FE0000FFC00FFF8003FF800FFFE00FFF800FFFF FFFFF000FFFFFFFFE0007FFFFFFFC0000FFFFFFF000001FFFFF80000000FFF8000002A2E 7BAC2F>115 D<00003000000001F00000001FF00000003FF00000003FE00000003FE000 00007FE00000007FE00000007FE00000007FC00000007FC00000007FC0000000FFC00000 00FFC0000000FFC0000000FF80000000FF800000FFFFFFFFC0FFFFFFFFC0FFFFFFFFC0FF FFFFFFC0FFFFFFFF8001FF00008003FF00000003FF00000003FF00000003FF00000003FE 00000007FE00000007FE00000007FE00000007FE00000007FC00000007FC0000000FFC00 00000FFC0000000FFC0000000FFC0000000FF80000001FF80000001FF80000001FF80000 001FF80000001FF80000003FF00000003FF00000003FF00000003FF00000003FF0000000 3FF00000003FF00000003FF80008001FF8001C001FFC003E001FFE00FE000FFF83FE000F FFFFFC0007FFFFF80003FFFFE00001FFFF8000007FFE0000001FF00000223E76BC29>I E end %%EndProlog %%BeginSetup %%Feature: *Resolution 300dpi TeXDict begin %%PaperSize: a4 %%EndSetup %%Page: 0 1 0 0 bop 382 255 a Ft(Act)n(a)31 b(Ic)n(cis)302 541 y Fs(The)19 b(ICCE)e(Pr)o(oc)o(eedings)437 996 y Fr(Icmak)o(e)127 1282 y Fs(Fr)o(ank)g(B.)h(Br)o(okk)o(en)f(and)i(K)o(ar)o(el)e(Kubat)542 1686 y Fq(1994-1)p eop %%Page: 1 2 1 1 bop -59 626 a Fp(Act)o(a)16 b(Ic)o(cis)e Fq(is)h(published)f(b)o(y) h(the)h(ICCE)f(\(Int)o(er)o(disciplinar)o(y)h(Centr)o(e)g(for)g(the)-59 676 y(de)o(v)o(elopment)e(of)e(Comput)o(er)i(Coaches)f(and)f(Expert)h (s)o(yst)o(ems\).)-59 843 y(Cop)o(yright)159 842 y(c)148 843 y Fo(\015)i Fq(1994)g(ICCE)h(and)f(the)h(author\(s\))h(of)f(all)f (articles)i(her)o(ein.)27 b(All)-59 893 y(right)o(s)12 b(r)o(eser)o(v)o(ed;)j(r)o(epr)o(oduction)f(in)e(part)i(or)g(in)e (whole)g(without)h(permission)-59 943 y(is)f(pr)o(ohibit)o(ed.)-59 1111 y(ICCE)i(does)g(not)h(mak)o(e)g(any)f(r)o(epr)o(esent)o(ation)j (or)e(warr)o(ant)o(y,)h(e)o(xpr)o(ess)e(or)h(im-)-59 1161 y(plied)j(with)g(r)o(espect)i(t)o(o)g(any)e(c)o(ode)i(or)f(other)h (information)e(her)o(ein.)35 b(ICCE)-59 1211 y(disclaims)14 b(any)h(liabilit)o(y)f(what)o(soe)o(v)o(er)j(for)e(any)f(use)h(of)g (such)f(c)o(ode)j(or)f(other)-59 1260 y(information.)-59 1428 y(All)10 b(c)o(orr)o(espondenc)o(e)j(r)o(egar)o(ding)d(c)o(op)o (yright)o(s,)i(r)o(eprint)o(s)e(or)h(any)f(other)h(matt)o(er)-59 1478 y(c)o(onc)o(erning)i(this)f(public)o(ation)g(c)o(an)h(be)g(dir)o (ect)o(ed)h(t)o(o:)377 1570 y(ICCE)377 1620 y(P)n(.O.)g(Bo)o(x)e(335) 377 1670 y(9700)g(AH)26 b(Gr)o(oningen)377 1719 y(The)13 b(Netherlands)377 1769 y(phone:)k(+31)12 b(50)g(63)g(36)g(36)p eop %%Page: 2 3 2 2 bop -59 -127 a Fn(2)p -24 -127 960 2 v 984 w Fp(Act)o(a)13 b(Ic)o(cis)e(1994-1)-59 -10 y Fm(Cont)o(ent)o(s)-59 122 y Fn(ICMAKE)1142 b(5)3 173 y Fq(1)73 b(Intr)o(oduction)13 b(t)o(o)h(ICMAKE)k Fl(:)i(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g (:)h(:)f(:)g(:)g(:)h(:)f(:)63 b Fq(6)99 223 y(1.1)72 b(Legal)12 b(c)o(onsider)o(ations)34 b Fl(:)21 b(:)f(:)g(:)h(:)f(:)g(:) g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)63 b Fq(6)99 273 y(1.2)72 b(Obt)o(aining)11 b(ICMAKE)25 b Fl(:)20 b(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)63 b Fq(7)3 323 y(2)73 b(The)12 b(pr)o(ogr)o(ams)i(of)e(ICMAKE)31 b Fl(:)20 b(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h (:)f(:)63 b Fq(7)99 373 y(2.1)72 b(The)12 b(t)o(op-le)o(v)o(el)h(pr)o (ogr)o(ams)42 b Fl(:)20 b(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g (:)h(:)f(:)63 b Fq(8)232 423 y(The)12 b(ICMAKE)g(pr)o(ogr)o(am)34 b Fl(:)20 b(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:) 63 b Fq(8)232 473 y(The)12 b(ICMUN)g(pr)o(ogr)o(am)17 b Fl(:)k(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:) 40 b Fq(11)99 523 y(2.2)72 b(The)12 b(`dependent')g(pr)o(ogr)o(ams,)i (used)e(int)o(ernally)21 b Fl(:)f(:)h(:)f(:)40 b Fq(13)232 573 y(The)12 b(pr)o(epr)o(oc)o(essor)j(ICM-PP)20 b Fl(:)h(:)f(:)g(:)g (:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)40 b Fq(13)232 623 y(The)12 b(c)o(ompiler)i(ICM-COMP)24 b Fl(:)d(:)f(:)g(:)g(:)h(:)f (:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)40 b Fq(13)232 674 y(The)12 b(e)o(x)o(ecut)o(or)i(ICM-EXEC)21 b Fl(:)f(:)h(:)f(:)g(:)g(:)h(:)f(:)g (:)h(:)f(:)g(:)g(:)h(:)f(:)40 b Fq(13)99 724 y(2.3)72 b(The)12 b(c)o(alling)g(or)o(der)i(of)e(pr)o(ogr)o(ams)21 b Fl(:)f(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)40 b Fq(14)99 774 y(2.4)72 b(Ex)o(ecut)o(able)13 b(mak)o(e\014les)g(under) f(Unix)23 b Fl(:)e(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)40 b Fq(14)3 824 y(3)73 b(The)12 b(s)o(ynt)o(ax)h(of)f(the)h(mak)o (e\014le)20 b Fl(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:) g(:)g(:)h(:)f(:)40 b Fq(15)99 874 y(3.1)72 b(Comment)13 b(and)f(pr)o(epr)o(oc)o(essor)j(dir)o(ectiv)o(es)20 b Fl(:)h(:)f(:)g(:)g(:)h(:)f(:)40 b Fq(15)232 924 y(The)12 b(#include)g(dir)o(ectiv)o(e)33 b Fl(:)20 b(:)g(:)h(:)f(:)g(:)g(:)h(:)f (:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)40 b Fq(16)232 974 y(The)12 b(#de\014ne)g(dir)o(ectiv)o(e)22 b Fl(:)f(:)f(:)g(:)h(:)f(:)g(:)g(:)h (:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)40 b Fq(16)99 1024 y(3.2)72 b(T)o(ypes,)13 b(c)o(onst)o(ant)o(s)h(and)e(v)o(ariables)30 b Fl(:)20 b(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)40 b Fq(17)99 1074 y(3.3)72 b(Strings)11 b(and)h(esc)o(ape)h(sequenc)o(es) 25 b Fl(:)20 b(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)40 b Fq(18)99 1124 y(3.4)72 b(The)12 b(c)o(ode)i(of)e(a)h(mak)o(e\014le)28 b Fl(:)20 b(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:) 40 b Fq(19)232 1174 y(Flow)12 b(c)o(ontr)o(ol)i(st)o(at)o(ement)o(s)27 b Fl(:)20 b(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)40 b Fq(19)232 1225 y(User-de\014ned)11 b(functions)19 b Fl(:)h(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)40 b Fq(20)232 1275 y(The)12 b(user-de\014ned)g(function)g(main\(\))k Fl(:)21 b(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)40 b Fq(21)99 1325 y(3.5)72 b(Expr)o(essions)11 b(and)h(oper)o(at)o(or)o(s)20 b Fl(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)40 b Fq(23)232 1375 y(Logic)o(al)12 b(oper)o(at)o(or)o(s)35 b Fl(:)20 b(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g (:)h(:)f(:)40 b Fq(24)232 1425 y(Special)12 b(oper)o(at)o(or)o(s)34 b Fl(:)20 b(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g (:)h(:)f(:)40 b Fq(27)232 1475 y(T)o(ype)12 b(c)o(ast)o(s)38 b Fl(:)20 b(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g (:)h(:)f(:)g(:)g(:)h(:)f(:)40 b Fq(27)99 1525 y(3.6)72 b(Built-in)10 b(functions)24 b Fl(:)c(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g (:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)40 b Fq(29)232 1575 y(ar)o(ghead)17 b Fl(:)k(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g (:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)40 b Fq(29)232 1625 y(ar)o(gt)o(ail)16 b Fl(:)k(:)h(:)f(:)g(:)g(:)h(:)f(:) g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f (:)40 b Fq(29)232 1675 y(ascii)22 b Fl(:)e(:)g(:)h(:)f(:)g(:)g(:)h(:)f (:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:) f(:)40 b Fq(29)232 1725 y(ascii)22 b Fl(:)e(:)g(:)h(:)f(:)g(:)g(:)h(:)f (:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:) f(:)40 b Fq(29)232 1776 y(change)p 368 1776 13 2 v 14 w(base)32 b Fl(:)20 b(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h (:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)40 b Fq(29)232 1826 y(change)p 368 1826 V 14 w(e)o(xt)30 b Fl(:)20 b(:)g(:)h(:)f(:)g(:)g(:) h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)40 b Fq(30)p eop %%Page: 3 4 3 3 bop -59 -127 a Fp(Cont)o(ent)o(s)p 127 -127 1114 2 v 1137 w Fn(3)232 -11 y Fq(change)p 368 -11 13 2 v 14 w(path)32 b Fl(:)20 b(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:) h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)40 b Fq(30)232 40 y(chdir)h Fl(:)20 b(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f (:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)40 b Fq(30)232 91 y(cmdhead)30 b Fl(:)20 b(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f (:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)40 b Fq(31)232 142 y(cmdt)o(ail)28 b Fl(:)21 b(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g (:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)40 b Fq(31)232 193 y(echo)18 b Fl(:)i(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)g (:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)40 b Fq(32)232 244 y(element\(int,)13 b(list\))39 b Fl(:)20 b(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f (:)40 b Fq(32)232 295 y(element\(int,)13 b(string\))20 b Fl(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:) f(:)40 b Fq(32)232 346 y(e)o(x)o(ec)26 b Fl(:)20 b(:)g(:)h(:)f(:)g(:)g (:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:) g(:)h(:)f(:)40 b Fq(33)232 397 y(e)o(x)o(ecut)o(e)28 b Fl(:)21 b(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h (:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)40 b Fq(34)232 448 y(e)o(xist)o(s)31 b Fl(:)20 b(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f (:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)40 b Fq(36)232 499 y(fget)o(s)15 b Fl(:)20 b(:)g(:)h(:)f(:)g(:)g(:)h(:)f (:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:) f(:)40 b Fq(36)232 550 y(fprintf)15 b Fl(:)20 b(:)h(:)f(:)g(:)g(:)h(:)f (:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:) f(:)40 b Fq(37)232 601 y(get)p 294 601 V 15 w(base)h Fl(:)20 b(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f (:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)40 b Fq(37)232 652 y(get)o(ch)d Fl(:)20 b(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g (:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)40 b Fq(38)232 703 y(get)p 294 703 V 15 w(e)o(xt)e Fl(:)21 b(:)f(:)g(:)g(:)h(:)f(:)g (:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:) 40 b Fq(38)232 754 y(get)p 294 754 V 15 w(path)h Fl(:)20 b(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h (:)f(:)g(:)g(:)h(:)f(:)40 b Fq(39)232 805 y(getpid)16 b Fl(:)k(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:) h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)40 b Fq(39)232 856 y(get)o(s)29 b Fl(:)20 b(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:) g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)40 b Fq(40)232 907 y(mak)o(elist)g Fl(:)20 b(:)g(:)g(:)h(:)f(:)g(:)g(:)h (:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)40 b Fq(40)232 958 y(mak)o(elist)g Fl(:)20 b(:)g(:)g(:)h(:)f(:)g(:)g(:)h (:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)40 b Fq(41)232 1009 y(printf)29 b Fl(:)20 b(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:) g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)40 b Fq(41)232 1060 y(put)o(env)c Fl(:)21 b(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:) h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)40 b Fq(42)232 1111 y(sizeof)30 b Fl(:)20 b(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:) g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)40 b Fq(42)232 1162 y(sizeo\015ist)c Fl(:)20 b(:)g(:)g(:)h(:)f(:)g(:)g(:)h (:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)40 b Fq(42)232 1213 y(st)o(at)35 b Fl(:)20 b(:)g(:)h(:)f(:)g(:)g(:)h(:)f (:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:) f(:)40 b Fq(42)232 1264 y(strlen)27 b Fl(:)20 b(:)h(:)f(:)g(:)g(:)h(:)f (:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:) f(:)40 b Fq(43)232 1315 y(strlwr)24 b Fl(:)c(:)h(:)f(:)g(:)g(:)h(:)f(:) g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f (:)40 b Fq(43)232 1366 y(strupr)20 b Fl(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g (:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:) 40 b Fq(43)232 1418 y(strt)o(ok)25 b Fl(:)20 b(:)h(:)f(:)g(:)g(:)h(:)f (:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:) f(:)40 b Fq(44)232 1469 y(substr)18 b Fl(:)i(:)h(:)f(:)g(:)g(:)h(:)f(:) g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f (:)40 b Fq(44)232 1520 y(s)o(yst)o(em)d Fl(:)21 b(:)f(:)g(:)g(:)h(:)f (:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:) f(:)40 b Fq(44)99 1571 y(3.7)72 b(Pr)o(eloaded)13 b(s)o(ymbols)29 b Fl(:)20 b(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h (:)f(:)40 b Fq(45)3 1622 y(4)73 b(Summar)o(y)24 b Fl(:)d(:)f(:)g(:)h(:) f(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h (:)f(:)g(:)g(:)h(:)f(:)40 b Fq(46)3 1673 y(A)68 b(K)o(e)o(ywor)o(ds)18 b Fl(:)j(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:) g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)40 b Fq(46)3 1724 y(B)68 b(S)o(ymbolic)11 b(c)o(onst)o(ant)o(s)34 b Fl(:)20 b(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h (:)f(:)g(:)g(:)h(:)f(:)40 b Fq(46)3 1775 y(C)69 b(Binar)o(y)12 b(oper)o(at)o(or)o(s)j Fl(:)20 b(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:) h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)40 b Fq(46)3 1826 y(D)63 b(Unar)o(y)12 b(oper)o(at)o(or)o(s)24 b Fl(:)c(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:) g(:)h(:)f(:)g(:)g(:)h(:)f(:)40 b Fq(47)p eop %%Page: 4 5 4 4 bop -59 -127 a Fn(4)p -24 -127 960 2 v 984 w Fp(Act)o(a)13 b(Ic)o(cis)e(1994-1)3 -11 y Fq(E)71 b(T)o(ype)13 b(c)o(ast)o(s)41 b Fl(:)20 b(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g (:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)40 b Fq(47)3 39 y(F)71 b(Oper)o(and)13 b(matrix)32 b Fl(:)20 b(:)g(:)g(:)h(:)f(:)g (:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:) 40 b Fq(48)3 89 y(G)67 b(Number)o(s)13 b(and)f(identi\014er)o(s)27 b Fl(:)20 b(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g (:)h(:)f(:)40 b Fq(48)3 139 y(H)61 b(Esc)o(ape)13 b(sequenc)o(es)30 b Fl(:)20 b(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g(:)h(:)f(:)g(:)g(:)h(:)f(:)g (:)h(:)f(:)g(:)g(:)h(:)f(:)40 b Fq(49)p eop %%Page: 5 6 5 5 bop -59 -127 a Fp(ICMAKE)p 124 -127 1117 2 v 1142 w Fn(5)486 606 y Fs(ICMAKE)380 774 y Fq(The)13 b Fn(IC)p Fq(CE)f Fn(MAKE)g Fq(Utilit)o(y)581 823 y(or:)274 873 y(the)h Fn(I)p Fq(mpr)o(o)o(v)o(ed)h Fn(C)p Fq(-lik)o(e)e Fn(MAKE)g Fq(Utilit)o(y)441 923 y(Distribution)g(6.17)303 1091 y(Fr)o(ank)h(B.)f(Br)o(okk)o(en)i(and)e(K.)h(Kubat)p eop %%Page: 6 7 6 6 bop -59 -127 a Fn(6)p -24 -127 960 2 v 984 w Fp(Act)o(a)13 b(Ic)o(cis)e(1994-1)-59 -6 y Fm(1)60 b(Intr)o(oduction)17 b(t)o(o)i(ICMAKE)-59 93 y Fq(Welc)o(ome)c(t)o(o)f Fp(icmak)o(e)p Fq(!)19 b Fp(Icmak)o(e)14 b Fq(is)e(a)h(gr)o(oup)g(of)g(pr)o(ogr)o(ams) h(which)e(c)o(onstitut)o(e)-59 143 y(an)j(aut)o(omatic)i(pr)o(ogr)o(am) g(maint)o(enanc)o(e)g(utilit)o(y,)f(c)o(ompar)o(able)h(t)o(o)f(the)g Fp(unix)p Fq(-)-59 193 y(pr)o(ogr)o(am)f Fp(mak)o(e)p Fq(.)23 b(Howe)o(v)o(er,)17 b Fp(icmak)o(e)e Fq(is,)f(in)f(our)h (opinion,)g(mor)o(e)i(`manage-)-59 243 y(able')d(than)g Fp(mak)o(e)p Fq(:)19 b(dependencies)13 b(between)g(\014les)f(and)h (actions)h(t)o(o)g(perform)-59 292 y(c)o(an)i(be)g(st)o(at)o(ed)i(in)d (way)h(which)f(is)g(easily)g(under)o(st)o(ood)i(and)e(quit)o(e)h (`natur)o(al')-59 342 y(t)o(o)g Fn(C)g Fq(pr)o(ogr)o(ammer)o(s.)27 b(Besides)15 b(being)f(a)i(t)o(ool)g(for)g(pr)o(ogr)o(am)h(maint)o(ent) o(anc)o(e,)-59 392 y Fp(icmak)o(e)11 b Fq(has)e(gr)o(own)g(int)o(o)h(a) g(useful)e(shell)g(script)i(language.)15 b(S)o(yst)o(em)9 b(adminis-)-59 442 y(tr)o(ativ)o(e)k(t)o(asks,)g(such)e(as)g(the)h(st)o (arting)g(of)f(backups,)h(c)o(an)h(be)e(ac)o(c)o(omplished)i(b)o(y)-59 492 y Fp(icmak)o(e)g Fq(just)f(as)h(with)f(an)g(other)h(language;)e (but)h(in)g(our)g Fn(C)p Fq(-orient)o(ed)h(opinion)-59 542 y(mor)o(e)h(easily.)-18 596 y(This)j(document)i(is)d(the)i(User)g (Guide)f(t)o(o)i Fp(icmak)o(e)p Fq(.)33 b(The)17 b(pr)o(ogr)o(ams)i(c)o (on-)-59 646 y(stituting)c Fp(icmak)o(e)p Fq(,)k(the)d(s)o(ynt)o(ax)g (of)g(a)h(mak)o(e\014le)g(and)f(se)o(v)o(er)o(al)h(e)o(x)o(amples)f(ar) o(e)-59 695 y(discussed.)f(It)d(is)f(assumed)h(that)h(the)f(r)o(eader)i (is)d(familiar)g(with)h(the)g(c)o(onc)o(ept)o(s)-59 745 y(of)f(a)h(mak)o(e)g(utilit)o(y,)g(with)f(the)h(c)o(onc)o(ept)h(of)e (dependencies)g(between)h(\014les)f(and)-59 795 y(with)h(the)h(c)o(onc) o(ept)i(of)d(aut)o(omatic)j(pr)o(ogr)o(am)f(maint)o(enanc)o(e.)-18 849 y(Furthermor)o(e,)22 b(it)c(is)f(assumed)h(that)g(the)h(r)o(eader)g (is)e(familiar)h(with)f(c)o(on-)-59 899 y(c)o(ept)o(s)g(of)e(pr)o(ogr)o (amming)h(\(such)f(as)h(v)o(ariable)f(de\014nitions,)h(functions,)g(ar) o(gu-)-59 949 y(ment)o(s)e(and)g(r)o(eturn)h(v)o(alues\))f(and)f(with)h (the)g(s)o(ynt)o(ax)g(of)g(the)g Fn(C)g Fq(pr)o(ogr)o(amming)-59 999 y(language.)j(This)12 b(document)i(does)f(not)h(study)e(these)h (themes)h(in)e(depth,)i(but)-59 1049 y(r)o(ather)g(point)o(s)e(out)h (di\013er)o(enc)o(es)h(between)f Fn(C)f Fq(and)g Fp(icmak)o(e)p Fq(.)-18 1103 y Fp(Icmak)o(e)18 b Fq(was)10 b(de)o(v)o(eloped)h(as)e (our)h(answer)g(t)o(o)h(pr)o(oblems)g(e)o(xperienc)o(ed)f(with)-59 1153 y(the)g(mak)o(e)h(utilit)o(y)e(av)o(ailable)h(in)f(UNIX)g(and)h (MS-DOS)e(oper)o(ating)j(s)o(yst)o(em)f(en-)-59 1203 y(vir)o(onment)o(s.)26 b(Initially)14 b(\(that)j(is,)f(aft)o(er)h(the)e (one)h(and)g(a)f(half)g(week)h(it)g(t)o(ook)-59 1252 y(us)c(t)o(o)i(de)o(v)o(elop)g Fp(icmak)o(e)8 b Fq(\))13 b(the)g(pr)o(ogr)o(ams)h(wer)o(e)g(av)o(ailable)f(on)g(MS-DOS)f(s)o (ys-)-59 1302 y(t)o(ems,)f(sinc)o(e)d(the)h(pr)o(ogr)o(ams)h(wer)o(e)f (de)o(v)o(eloped)h(ther)o(e.)16 b(The)9 b Fp(icmak)o(e)g Fq(pr)o(ogr)o(ams)-59 1352 y(wer)o(e)i(then)e(suc)o(c)o(essfully)f (port)o(ed)k(t)o(o)e(UNIX)g(platforms,)h(such)e(as,)h(LINUX)g(and)-59 1402 y(SCO-UNIX.)j(The)i Fp(icmak)o(e)g Fq(pr)o(ogr)o(ams)g(furthermor) o(e)h(also)e(ar)o(e)h(av)o(ailable)f(for)-59 1452 y(HP-UX.)-59 1591 y Fk(1.1)50 b(Legal)16 b(c)o(onsider)o(ations)-59 1676 y Fp(Icmak)o(e)11 b Fq(is)e(shar)o(ewar)o(e.)17 b(This)10 b(means)g(that)h(no)f(fee)g(is)f(char)o(ged)i(for)f(it.)16 b(As)10 b(with)-59 1726 y(e)o(v)o(er)o(ything)g(that's)g(fr)o(ee,)h (ther)o(e's)f(no)g(pay)g(but)f(also)h Fn(absolutely)f(no)h(warranty)p Fq(.)-59 1776 y(Furthermor)o(e,)j(y)o(ou)e(ar)o(e)h(allowed)f(\(and)g (enc)o(our)o(aged\))i(t)o(o)f(distribut)o(e)f Fp(icmak)o(e)p Fq(,)-59 1826 y(pr)o(o)o(vided)i(that)g(y)o(ou)g(include)e(this)h (information)h(with)f(each)h(distribution.)p eop %%Page: 7 8 7 7 bop -59 -127 a Fp(ICMAKE)p 124 -127 1117 2 v 1142 w Fn(7)-18 -11 y Fq(The)13 b(sour)o(c)o(e)g(\014les)f(and)g(the)g (document)o(ation)i(for)f Fp(icmak)o(e)g Fq(ar)o(e)g(c)o(op)o(yright)o (ed)-59 39 y(b)o(y)f(us.)j(The)d(r)o(eason)g(for)g(this)f(is)g(\(a\))i (that)f(we'd)g(lik)o(e)g(t)o(o)h(hav)o(e)e(always)h(the)g(last)-59 89 y(v)o(er)o(sion)h(of)h(Icmak)o(e,)h(and)e(\(b\))h(that)g(we'd)f(lik) o(e)h(t)o(o)g(hav)o(e)g(the)f(last)g(wor)o(d)h(in)f(all)-59 139 y(modi\014c)o(ations.)22 b(If)13 b(y)o(ou)h(hav)o(e)g(r)o(equest)o (s)h(\(or)g(e)o(v)o(en)g(bett)o(er,)h(\\working)e(c)o(ode")-59 188 y(t)o(o)g(include)e(in)h Fp(icmak)o(e)p Fq(\))h(please)f(mail)g(us) f(and)h(we'll)f(gladly)g(oblige)g(when)g(we)-59 238 y(\014nd)g(the)g (time.)-59 366 y Fk(1.2)50 b(Obt)o(aining)16 b(ICMAKE)-59 446 y Fq(The)d Fp(icmak)o(e)h Fq(pack)o(age)f(c)o(an)h(be)e(obt)o (ained)i(b)o(y)e(anonymous)g(ftp)h(fr)o(om)g(the)g(sit)o(e)-59 496 y Fp(beatrix.ic)o(c)o(e.rug.nl)p Fq(,)22 b(dir)o(ect)o(or)o(y)h Fp(pub/unix)p Fq(.)38 b(The)21 b(pack)o(age)g(c)o(omes)h(as)e(an)-59 546 y(ar)o(chiv)o(e,)f(usually)c(in)g(the)i(form)g Fp(icmak)o(e-X.XX.t) o(ar.gz)p Fq(,)i(wher)o(e)e(the)g(curr)o(ent)-59 596 y(v)o(er)o(sion)d(of)g Fp(icmak)o(e)h Fq(is)e(denot)o(ed)i(b)o(y)f Fp(X.XX)679 578 y Fj(1)695 596 y Fq(.)g(This)f(ar)o(chiv)o(e)i(c)o(ont) o(ains)f(a)h(t)o(ar'd)-59 645 y(and)9 b(gzip'd)g(dir)o(ect)o(or)o(y)j (structur)o(e,)g(in)d(which)g(the)h(sour)o(c)o(e)g(\014les)f(for)h Fp(icmak)o(e)h Fq(and)-59 695 y(the)g(e)o(x)o(ecut)o(able)g(pr)o(ogr)o (ams)g(for)g(MS-DOS)e(c)o(an)i(be)f(found.)15 b(The)10 b(same)h(ar)o(chiv)o(e)-59 745 y(sit)o(e)j(also)g(c)o(ont)o(ains)h(the) g(\014le)e Fp(icmak)o(e.doc)p Fq(,)j(which)d(is)g(a)i(guide)e(t)o(o)i (the)f(inst)o(al-)-59 795 y(lation)e(of)h Fp(icmak)o(e)p Fq(.)18 b(This)11 b(\014le)h(is)g(especially)g(useful)f(for)h(UNIX)h (inst)o(allations.)-18 847 y(The)f Fp(icmak)o(e)h Fq(pack)o(age)g(c)o (an)g(also)e(be)h(found)f(at)i(the)f(sit)o(e)g Fp(t)o(s)o(x-11.mit.edu) e Fq(as)-59 897 y(part)i(of)g(the)g(Linux)e(Oper)o(ating)i(S)o(yst)o (em)g(distribution.)j(The)d(\014les)f(ar)o(e)h(usually)-59 946 y(loc)o(at)o(ed)i(in)e Fp(pub/linux/sour)o(c)o(es/usr.bin)o Fq(.)-59 1095 y Fm(2)60 b(The)17 b(pr)o(ogr)o(ams)i(of)f(ICMAKE)-59 1189 y Fp(Icmak)o(e)c Fq(c)o(onsist)o(s)f(of)g(\014v)o(e)f(pr)o(ogr)o (ams)i(which)e(may)h(be)g(nec)o(essar)o(y)h(in)e(the)h(pr)o(o-)-59 1239 y(c)o(ess)j(of)g(r)o(eading)g(a)g(mak)o(e\014le)h(and)e(e)o(x)o (ecuting)h(the)g(c)o(ommands)h(speci\014ed)e(in)-59 1289 y(this)g(\014le.)26 b(The)16 b(pr)o(ogr)o(ams)h(c)o(an)f(be)g(divided)f (in)g(two)h(c)o(at)o(egories:)25 b(pr)o(ogr)o(ams)-59 1339 y(of)12 b(which)g(the)g(c)o(asual)h(user)f(of)g Fp(icmak)o(e)i Fq(must)e(be)g(awar)o(e)i(\(the)f(t)o(op-le)o(v)o(el)g (pr)o(o-)-59 1389 y(gr)o(ams\))g(and)f(pr)o(ogr)o(ams)i(which)e(ar)o(e) h(c)o(alled)g(int)o(ernally)f(b)o(y)g Fp(icmak)o(e)p Fq(.)-18 1441 y(Each)i(of)f(the)g(pr)o(ogr)o(ams)h(of)e(the)i Fp(icmak)o(e)g Fq(family)e(has)g(it)o(s)h(v)o(er)o(sion)g(number.)-59 1491 y(The)k(v)o(er)o(sion)f(number)o(s)h(c)o(onsist)f(of)h(a)g(major)g (and)g(a)f(minor)h(number;)h(e.g.,)-59 1540 y(in)f(the)i(v)o(er)o(sion) g(number)f(5.03,)h(the)g(major)h(v)o(er)o(sion)e(is)g(5)g(and)g(the)g (minor)-59 1590 y(v)o(er)o(sion)d(is)f(03.)24 b(The)16 b(pr)o(ogr)o(ams)g(c)o(an)f(only)g(c)o(ommunic)o(at)o(e)j(when)c(the)h (major)-59 1640 y(v)o(er)o(sion)c(number)o(s)g(of)g(all)f Fp(icmak)o(e)i Fq(pr)o(ogr)o(ams)h(ar)o(e)f(equal:)j(i.e.,)c(a)h (working)e(set)-59 1690 y(of)k(pr)o(ogr)o(ams)i(must)e(hav)o(e)h(the)g (same)g(major)g(v)o(er)o(sion)g(number.)23 b(The)14 b(minor)-59 1740 y(number)e(is)f(used)g(t)o(o)i(indic)o(at)o(e)f(small)g(changes)f (in)g(the)h(separ)o(at)o(e)i(pr)o(ogr)o(ams.)p -59 1786 534 2 v -18 1814 a Fi(1)1 1826 y Fh(Jok)o(e)9 b(of)g(the)h(day:)j Fg(\\The)d(last)g(v)o(er)o(sion)g(if)g(icmak)o(e)g(is)g(bug-fr)o(ee.")p eop %%Page: 8 9 8 8 bop -59 -127 a Fn(8)p -24 -127 960 2 v 984 w Fp(Act)o(a)13 b(Ic)o(cis)e(1994-1)-59 -11 y Fk(2.1)50 b(The)16 b(t)o(op-le)o(v)o(el)g (pr)o(ogr)o(ams)-59 69 y Fq(T)o(wo)d(pr)o(ogr)o(ams)g(of)f(the)g Fp(icmak)o(e)h Fq(gr)o(oup)f(form)h(the)f(int)o(erfac)o(e)h(t)o(o)g (the)g(user:)j Fp(ic-)-59 119 y(mak)o(e)11 b Fq(it)o(self)e(and)g Fp(icmun)p Fq(.)15 b(The)10 b(`dependent')f(pr)o(ogr)o(ams)i(ar)o(e)f (gener)o(ally)f(c)o(alled)-59 168 y(b)o(y)18 b(the)h(t)o(op-le)o(v)o (el)g(pr)o(ogr)o(ams)g(as)g(child-pr)o(oc)o(esses)f(or)h(o)o(v)o (erlay-pr)o(oc)o(esses.)-59 218 y(Howe)o(v)o(er,)d(e)o(v)o(er)o(y)e (dependent)f(pr)o(ogr)o(am)i(is)e(a)g(c)o(omplet)o(e)j(pr)o(ogr)o(am)e (b)o(y)g(it)o(self,)-59 268 y(and)e(c)o(ould)h(as)f(well)g(be)h(activ)o (at)o(ed)h(b)o(y)f(user)o(s)f(of)g Fp(icmak)o(e.)-59 384 y Fn(The)h(ICMAKE)f(program)-59 464 y Fq(The)d(main)f(pr)o(ogr)o (am)i(is)e Fp(icmak)o(e)474 446 y Fj(2)491 464 y Fq(.)15 b(The)9 b Fp(icmak)o(e)h Fq(pr)o(ogr)o(am)g(act)o(s)f(as)g(an)f(int)o (erfac)o(e)-59 514 y(between)i(the)g(user)g(and)f(other)i(pr)o(ogr)o (ams)f(of)g(the)g Fp(icmak)o(e)h Fq(gr)o(oup.)k(Normally,)-59 564 y(the)g(user)g(will)f(hav)o(e)h(no)g(need)g(t)o(o)h(know)f(the)g(e) o(x)o(act)h(names)f(or)h(functions)e(of)-59 613 y(the)f(other)h Fp(icmak)o(e)g Fq(pr)o(ogr)o(ams;)f(only)f(the)h(`t)o(op)h(le)o(v)o (el')f(pr)o(ogr)o(am)h(will)e(hav)o(e)g(t)o(o)-59 663 y(be)g(activ)o(at)o(ed)j(t)o(o)f(st)o(art)f(the)g(pr)o(oc)o(ess)h(of)e (making.)-18 715 y(The)g Fp(icmak)o(e)h Fq(pr)o(ogr)o(am)h(is)d (normally)h(inv)o(ok)o(ed)g(b)o(y)g(one)g(of)g(the)g(two)g(follow-)-59 765 y(ing)f(c)o(ommand)j(lines:)84 864 y Fp(icmak)o(e)27 b([\015ags])d(ascii\014le)g([binar)o(y\014le])i([)p Ff(--)f Fp(ar)o(gument)o(s])222 914 y(icmak)o(e)h([\015ags])f(-i)12 b(ascii\014le)24 b([ar)o(gument)o(s])-59 1012 y Fq(The)14 b(two)g(inv)o(oc)o(ation)h(modes)f(di\013er)g(in)e(the)i(fact)h(that)f (the)g(\014r)o(st)g(inv)o(oc)o(ation,)-59 1062 y(without)i(the)h Fp(-i)e Fq(\015ag,)i(allows)e(the)i(user)f(t)o(o)h(specify)e(the)h (name)h(of)f(a)g(binar)o(y)-59 1111 y(\014le.)k(This)14 b(\014le)f(is)g(an)h(int)o(ermediat)o(e)i(\014le)d(in)h(the)g(making)f (pr)o(oc)o(ess.)22 b(The)15 b(sec-)-59 1161 y(ond)h(inv)o(oc)o(ation)i (allows)e Fp(icmak)o(e)h Fq(t)o(o)h(choose)f(a)g(name)f(for)h(the)g (binar)o(y)f(\014le.)-59 1211 y(When)10 b(not)h(speci\014ed,)g Fp(icmak)o(e)h Fq(uses)d(the)i(name)g(of)f(the)h(ascii\014le)f(but)g (with)g(the)-59 1261 y(e)o(xt)o(ension)i Fp(.bim)p Fq(.)-18 1312 y(In)h(both)i(c)o(ommand)g(lines,)e(the)i Fp(\015ags,)e Fq(or)h(the)h(two)f(c)o(onsecutiv)o(e)h(hyphens)-59 1362 y(and)i(the)g(ar)o(gument)o(s)h(ar)o(e)h(optional.)31 b(The)17 b(ar)o(gument)o(s)h(ar)o(e)g(passed)f(t)o(o)h(the)-59 1412 y(mak)o(e\014le)c(and)g(c)o(an)g(be)g(inspect)o(ed)f(ther)o(e.)22 b(The)13 b(\015ags)g(ar)o(e)i(used)d(for)i(r)o(equest-)-59 1462 y(ing)g(speci\014c)i(actions)g(of)g Fp(icmak)o(e)p Fq(.)27 b(The)16 b(speci\014c)o(ation)h(of)e(the)h(ascii\014le)f(is)g (in)-59 1512 y(both)f(inv)o(oc)o(ations)h(obligat)o(or)o(y:)20 b(this)13 b(\014le)h(is)f(the)i(mak)o(e)g(script,)g(which)e(is)h(in-) -59 1561 y(t)o(erpr)o(et)o(ed)f(b)o(y)d Fp(icmak)o(e)h Fq(and)f(ac)o(c)o(or)o(ding)i(t)o(o)f(which)e(speci\014c)h(actions)h (ar)o(e)g(t)o(ak)o(en.)-18 1613 y(When)i Fp(icmak)o(e)h Fq(is)e(activ)o(at)o(ed)i(without)f(any)g(ar)o(gument)o(s,)g(a)g(help)f (summar)o(y)-59 1663 y(is)i(display)o(ed,)g(showing)f(among)i(other)g (things)e(the)i(\015ags)f(which)g(ar)o(e)h(r)o(ec)o(og-)p -59 1707 534 2 v -18 1735 a Fi(2)1 1747 y Fh(Under)e(MS-DOS,)j(all)f (pr)o(ogr)o(ams)f(of)h(the)f Fg(icmak)o(e)h Fh(gr)o(oup)g(hav)o(e)f(e)o (xt)o(ension)g Fg(e)o(x)o(e)p Fh(.)28 b(In)15 b(this)-59 1786 y(document)9 b(the)i(e)o(xt)o(ension)e(of)i(e)o(x)o(ecut)o(ables)f (is)g(left)h(out,)g(sinc)o(e)f(other)g(oper)o(ating)h(s)o(yst)o(ems)g (than)-59 1826 y(DOS)g(may)e(r)o(equir)o(e)h(other)f(e)o(xt)o(ensions)g (or)g(may)h(r)o(equir)o(e)g(no)f(e)o(xt)o(ensions)f(at)i(all.)p eop %%Page: 9 10 9 9 bop -59 -127 a Fp(ICMAKE)p 124 -127 1117 2 v 1142 w Fn(9)-59 -11 y Fq(nized)18 b(b)o(y)g Fp(icmak)o(e)p Fq(.)36 b(When)18 b Fp(icmak)o(e)i Fq(is)e(st)o(art)o(ed)i(without)e (any)g(ar)o(gument)o(s,)-59 39 y(something)12 b(lik)o(e)h(the)f (following)f(output)i(appear)o(s)g(on)g(the)g(scr)o(een)1074 21 y Fj(3)1090 39 y Fq(:)-59 114 y Fe(ICCE)k(Make)g(Utility)f(Version)g (6.00)-59 154 y(Copyright)g(\(c\))h(ICCE)g(1992,)f(1993.)35 b(All)17 b(rights)f(reserved.)-59 233 y(Usage:)g(ICMAKE)h([flags])f (source[.im])f([dest[.bim]])g([--)j([args]])-59 272 y(where:)83 311 y(flags:)34 b(optional)16 b(flags:)225 351 y(-b)89 b(:)17 b(blunt)g(execution)f(of)h(the)g(destinationfile)225 390 y(-c)89 b(:)17 b(the)g(destination)f(file)h(is)g(compiled)225 430 y(-o)h(file:)e(all)h(icmake)g(output)f(is)i(redirected)d(to)j (`file')225 469 y(-i)g(file:)e(define)h(input)f(file,)h(argument)f (processing)g(stops)225 509 y(-p)89 b(:)17 b(only)g(the)g(preprocessor) e(is)j(activated)225 548 y(-q)89 b(:)17 b(quiet)g(mode:)g(copyright)e (banner)i(not)g(displayed)83 588 y(source:)f(make)h(description)f (source)g(file)225 627 y(\(default)g(extension:)g(.im\))83 666 y(dest:)52 b(binary)17 b(make)g(file)225 706 y(\(default)f (filename:)34 b(source.bim\))83 745 y(--)18 b(:)53 b(optional)16 b(icmake-file)f(arguments)h(separator)83 785 y(args:)35 b(optional)16 b(arguments)f(following)h(--)h(received)f(by)208 824 y(the)h(icmake)f(file)h(in)g(its)g(argv-list)-59 955 y Fq(Fr)o(om)c(this)f(help-summar)o(y)g(it)h(is)e(seen)h(that)i (the)e(following)f(\015ags)h(ar)o(e)h(r)o(ec)o(og-)-59 1005 y(nized:)-59 1091 y Fn(-b.)20 b Fq(When)9 b(this)f(\015ag)g(is)g (used,)h(no)g Fp(r)o(ec)o(enc)o(y)16 b Fq(t)o(est)10 b(is)e(t)o(ak)o(en.)16 b(R)o(ather,)c(the)d(binar)o(y)24 1141 y(mak)o(e)h(\014le)f(is)g(e)o(x)o(ecut)o(ed)h(immediat)o(ely)g (`as)f(is'.)14 b(When)9 b(this)g(\015ag)g(is)f(absent,)24 1190 y Fp(icmak)o(e)i Fq(c)o(ompiles)f(the)g(input)f(\014le)g(\()p Fp(.im)h Fq(\014le\))g(int)o(o)g(a)g(binar)o(y)f(\014le)g(\()p Fp(.bim)i Fq(\014le\))24 1240 y(if)i(the)g(input)g(\014le)g(is)g(mor)o (e)i(r)o(ec)o(ent.)-59 1321 y Fn(-c.)21 b Fq(When)13 b(this)f(\015ag)h(is)f(used,)h(the)g(ascii)g(input)f(\014le)h(is)g(c)o (ompiled)g(t)o(o)i(a)e(binar)o(y)24 1371 y(mak)o(e\014le,)e(but)f(not)g (aut)o(omatic)o(ally)h(e)o(x)o(ecut)o(ed.)16 b(The)10 b(c)o(ompilation)g(oc)o(cur)o(s)24 1421 y(irr)o(espectiv)o(e)k(t)o(o)g (the)e(r)o(ec)o(enc)o(y)j(of)d(the)h(input)f(\014le)g(and)g(the)h (binar)o(y)f(\014le.)-59 1501 y Fn(-i)g(\014le.)21 b Fq(This)11 b(option)i(speci\014es)f Fp(\014le)g Fq(as)g(the)h(input)f (\014le)g(for)h Fp(icmak)o(e)g Fq(and)f(st)o(ops)24 1551 y(the)h(further)f(pr)o(oc)o(essing)g(of)g(the)h(ar)o(gument)o(s.)k(The) 12 b(name)h(of)f(the)h(binar)o(y)24 1601 y(mak)o(e\014le)18 b(\()p Fp(.bim)f Fq(\014le\))g(is)g(then)f(the)i(name)f(of)g(the)g (input)f(\014le)h(but)g(with)24 1651 y(the)e(e)o(xt)o(ension)f Fp(.bim)p Fq(.)23 b(The)14 b(default)h(input)e(\014le)i(e)o(xt)o (ension,)g Fp(.im)p Fq(,)g(is)f Fn(not)24 1701 y Fq(supplied)d(b)o(y)h Fp(icmak)o(e)i Fq(when)e(this)f(\015ag)h(is)g(giv)o(en:)k(the)c (speci\014ed)h(name)f(is)24 1750 y(t)o(ak)o(en)i(lit)o(er)o(ally.)p -59 1786 534 2 v -18 1814 a Fi(3)1 1826 y Fh(The)9 b(actual)h(summar)o (y)f(may)h(v)o(ar)o(y)h(with)f(di\013er)o(ent)g(v)o(er)o(sions)g(of)f Fg(icmak)o(e)p Fh(.)p eop %%Page: 10 11 10 10 bop -59 -127 a Fn(10)p -1 -127 937 2 v 961 w Fp(Act)o(a)13 b(Ic)o(cis)e(1994-1)-59 -11 y Fn(-o)h(\014le.)21 b Fq(With)15 b(this)g(option,)i(an)e(e)o(xtr)o(a)h(\014lename)f(is)g(r)o(equir)o (ed.)26 b(When)15 b(used,)24 39 y(all)h Fp(icmak)o(e)h Fq(output)g(is)e(r)o(edir)o(ect)o(ed)k(t)o(o)e(`\014le',)g(and)f(will)f (not)i(appear)g(on)24 89 y(the)h(scr)o(een)227 71 y Fj(4)244 89 y Fq(.)31 b(This)17 b(\015ag)g(is)f(only)h(av)o(ailable)g(in)g (MS-DOS)f(v)o(er)o(sions)i(of)24 139 y Fp(icmak)o(e)p Fq(:)27 b(under)17 b Fh(DOS)p Fq(,)j(an)d(`or)o(dinar)o(y')h(r)o(edir)o (ection)h(st)o(at)o(ement)h(on)d(the)24 188 y(c)o(ommand)k(line)d (fails)g(t)o(o)i(r)o(edir)o(ect)i(child)c(pr)o(ogr)o(ams)i(and)f(ther)o (efor)o(e)i(a)24 238 y(separ)o(at)o(e)11 b(r)o(edir)o(ection)h (mechanism,)e(activ)o(at)o(ed)i(b)o(y)e(this)f(\015ag,)h(is)f(needed.) 24 288 y(Under)j(UNIX,)h(r)o(edir)o(ection)h(of)e Fp(icmak)o(e)i Fq(and)d(of)i(it)o(s)f(child)g(pr)o(ogr)o(ams)h(c)o(an)24 338 y(be)g(achie)o(v)o(ed)g(using)d(the)j Fl(>)g Fq(sign)e(on)h(the)h (c)o(ommand)h(line.)-59 437 y Fn(-p.)20 b Fq(When)15 b(this)f(option)h(is)f(used,)h(only)g(the)g Fp(Icmak)o(e)g(pr)o(epr)o (oc)o(essor)23 b Fq(is)14 b(acti-)24 487 y(v)o(at)o(ed.)k(The)12 b(output)g(of)g(the)h(pr)o(epr)o(oc)o(essor)h(is)e(sent)g(t)o(o)h(a)f (\014le)g(having)e(the)24 537 y(same)g(name)h(as)f(the)g(input)f (\014le,)i(but)f(e)o(xt)o(ension)f Fp(.pim)p Fq(.)16 b(When)10 b(this)g(\015ag)f(is)24 586 y(absent,)k Fp(icmak)o(e)p Fq('s)g(pr)o(epr)o(oc)o(essor)i(still)c(gener)o(at)o(es)i(a)g Fp(.pim)f Fq(\014le;)g(but)g(this)24 636 y(\014le)g(is)g(delet)o(ed)h (when)f(no)g(longer)h(r)o(equir)o(ed.)-59 736 y Fn(-q.)20 b Fq(When)13 b(this)e(option)i(is)f(used,)g Fp(Icmak)o(e)21 b Fq(oper)o(at)o(es)14 b Fp(quiet)p Fq(.)i(I.e.,)d(the)g(c)o(op)o(y-)24 785 y(right)f(banner)g(is)g(not)h(display)o(ed.)-59 885 y Ff(--)p Fn(.)21 b Fq(By)16 b(default,)h(the)g(\014r)o(st)f (non-\015ag)g(ar)o(gument)g(on)h(the)f(c)o(ommand)i(line)d(is)24 934 y(the)h(input)f(\014le,)h(for)g(which)f(the)h(e)o(xt)o(ension)f Fp(.im)h Fq(is)f(assumed.)26 b(When)15 b(a)24 984 y(sec)o(ond)c (non-\015ag)f(ar)o(gument)h(is)f(giv)o(en,)h(then)f(this)g(name)h(is)f (used)g(for)h(the)24 1034 y(binar)o(y)17 b(\014le)g(\()p Fp(.bim)i Fq(\014le\).)31 b(The)18 b(pr)o(oc)o(essing)g(of)f(ar)o (gument)o(s)h(st)o(ops)g(only)24 1084 y(when)c(two)i(c)o(onsecutiv)o(e) g(hyphens)d(ar)o(e)j(enc)o(ount)o(er)o(ed.)26 b(All)15 b(ar)o(gument)o(s)24 1134 y(which)d(follow)g(the)h Ff(--)g Fq(\015ag)e(c)o(an)j(be)e(inspect)o(ed)h(b)o(y)f(the)h(mak)o(e\014le.) 24 1208 y(Not)o(e)19 b(that)f(the)f Ff(--)h Fq(\015ag)e(is)h(not)g(r)o (equir)o(ed)h(when)f Fp(icmak)o(e)h Fq(is)f(activ)o(at)o(ed)24 1258 y(with)12 b(the)h Fp(-i)f Fq(\015ag)g(pr)o(esent.)-18 1365 y(The)18 b Fp(ascii\014le)e Fq(speci\014c)o(ation)i(is)e(obligat)o (or)o(y.)32 b(This)16 b(is)g(the)i(ascii)f(mak)o(e\014le)-59 1415 y(which)12 b(will)g(be)h(c)o(ompiled)h(and)e(t)o(est)o(ed)j(b)o(y) d Fp(icmak)o(e)p Fq(.)20 b Fp(Icmak)o(e)14 b Fq(assumes)e(a)h(de-)-59 1465 y(fault)f(e)o(xt)o(ension)h Fp(.im)p Fq(.)18 b(E.g.,)13 b(the)g(c)o(ommand)h(line)e Fp(icmak)o(e)i(t)o(est)f Fq(will)e(activ)o(at)o(e)-59 1515 y Fp(icmak)o(e)k Fq(t)o(o)f(pr)o(oc)o (ess)h(the)f Fh(ASCII)g Fq(mak)o(e\014le)g Fp(t)o(est.im)p Fq(.)19 b(Not)o(e)c(howe)o(v)o(er)g(that)f(the)-59 1565 y(c)o(ommand)i(line)f Fp(icmak)o(e)h(-i)e(t)o(est)h Fq(will)f(st)o(art) i Fp(icmak)o(e)h Fq(t)o(o)f(pr)o(oc)o(ess)g(the)g(mak)o(e-)-59 1614 y(\014le)h Fp(t)o(est)p Fq(;)h(the)g(pr)o(esenc)o(e)g(of)f(the)h Fp(-i)e Fq(\015ag)h(for)o(c)o(es)h Fp(icmak)o(e)g Fq(not)g(t)o(o)g (supply)e(an)-59 1664 y(e)o(xt)o(ension.)p -59 1707 534 2 v -18 1735 a Fi(4)1 1747 y Fh(The)8 b Fd(IC)o(C)o(E)16 b Fh(pr)o(ogr)o(am)9 b Fg(t)o(ee)15 b Fh(is)9 b(another)e(useful)h(t)o (ool)h(her)o(e,)f(allowing)h(the)g(display)g(of)f(output)g(t)o(o)-59 1786 y(the)h(scr)o(een,)g(and)f(the)i Fg(simult)o(aneous)k Fh(gener)o(ation)9 b(of)g(a)g(c)o(op)o(y)g(of)g(the)g(display)o(ed)h (information)d(t)o(o)-59 1826 y(a)j(\014le.)p eop %%Page: 11 12 11 11 bop -59 -127 a Fp(ICMAKE)p 133 -127 1075 2 v 1119 w Fn(11)-18 -11 y Fq(The)17 b Fp(binar)o(y\014le)f Fq(speci\014c)o (ation)h(is)f(optional.)27 b(When)16 b(giv)o(en,)h Fp(icmak)o(e)g Fq(uses)-59 39 y(this)12 b(\014le)h(as)g(the)g(binar)o(y)g(int)o (ermediat)o(e)i(\014le)e(in)f(the)i(pr)o(oc)o(ess)g(of)f(making.)18 b(Ex-)-59 89 y(t)o(ension)d Fp(.bim)g Fq(is)f(the)h(default.)24 b(When)14 b(not)i(giv)o(en,)f Fp(icmak)o(e)h Fq(uses)e(the)h(base-)-59 139 y(name)e(of)f(the)h Fp(ascii\014le)e Fq(but)i(with)f(e)o(xt)o (ension)g Fp(.bim)p Fq(.)-18 190 y(Following)21 b(the)i Fp(binar)o(y\014le)g Fq(speci\014c)o(ation,)j(se)o(v)o(er)o(al)d(ar)o (gument)o(s)g(t)o(o)g(the)-59 240 y(mak)o(e\014le)16 b(it)o(self)e(may)i(be)f(giv)o(en.)23 b(Howe)o(v)o(er,)18 b(befor)o(e)e(any)e(e)o(xtr)o(a)i(ar)o(gument)o(s)-59 290 y(ar)o(e)g(speci\014ed)f(two)h(c)o(onsecutiv)o(e)h(hyphens)d(ar)o (e)i(needed.)25 b(Following)14 b(these)-59 340 y(hyphens)e(e)o(xtr)o(a) j(ar)o(gument)o(s)f(may)h(follow)e(which)g(will)g(be)h(passed)f(t)o(o)i (the)g Fp(ic-)-59 389 y(mak)o(e)23 b Fq(dependent)14 b(pr)o(ogr)o(ams.)23 b(As)15 b(described)f(abo)o(v)o(e,)i(the)f (delimiting)e(two)-59 439 y(hyphens)e(ar)o(e)i(not)g(nec)o(essar)o(y)g (when)f(the)h Fp(-i)f Fq(\015ag)g(is)g(used.)-18 491 y(The)17 b Fp(icmak)o(e)25 b Fq(speci\014c)o(ation)17 b(\014le)f(is)g(writt)o(en)h(as)f(a)h Fn(C)f Fq(pr)o(ogr)o(am,)k(and)c (c)o(on-)-59 540 y(t)o(ains)f(a)g Fp(main\(\))22 b Fq(function)15 b(which)f(r)o(ec)o(eiv)o(es)i(some)f(of)g(the)g(ar)o(gument)o(s)h (spec-)-59 590 y(i\014ed)g(on)h(the)g(c)o(ommand)h(line.)28 b(The)17 b(\014r)o(st)g(ar)o(gument)g(is)f(always)g(the)h(name)-59 640 y(of)f(the)g(binair)o(y)g(mak)o(e)h(\014le)f(\(normally)g(having)f (the)h Fp(.bim)24 b Fq(e)o(xt)o(ension\).)j(R)o(e-)-59 690 y(maining)13 b(ar)o(gument)o(s)j(ar)o(e)f(the)h(ar)o(gument)o(s)f (that)g(follow)g(the)g(two)g(hyphens.)-59 740 y(The)e(hyphens)f (themselv)o(es)h(ar)o(e)h Fp(not)19 b Fq(included)12 b(in)g(the)h(series)g(of)g(ar)o(gument)o(s)-59 790 y(which)e(ar)o(e)i (passed)e(t)o(o)i Fp(main\(\))8 b Fq(\))k(\(See)g(also)g(the)g(par)o (agr)o(aph)h(below)f(about)g Fp(the)-59 839 y(user-de\014ned)h (function)c(main\(\))f Fq(\).)-59 956 y Fn(The)13 b(ICMUN)e(program)-59 1036 y Fq(The)i Fp(icmun)g Fq(pr)o(ogr)o(am)h(is)f(mainly)f(used)g(in)h (de)o(v)o(eloping)f Fp(icmak)o(e)p Fq(.)20 b(The)13 b Fp(icmun)-59 1085 y Fq(pr)o(ogr)o(am)20 b(is)e(an)g(unassembler)f(for)i (the)g(binar)o(y)f(mak)o(e)i(\014le)e(cr)o(eat)o(ed)i(b)o(y)f Fp(ic-)-59 1135 y(mak)o(e.)31 b(Icmun)23 b Fq(e)o(xpect)o(s)17 b(a)g(binar)o(y)f(mak)o(e\014le)i(as)e(ar)o(gument)h(and)g(pr)o(oduc)o (es)-59 1185 y(an)g(assembly-lik)o(e)g(listing)e(of)i(the)h (instructions)f(c)o(ont)o(ained)i(in)d(the)i(binar)o(y)-59 1235 y(mak)o(e\014le.)k(The)14 b(r)o(emainder)h(of)f(this)f(section)h (c)o(an)h(be)f(skipped)f(without)h(loss)-59 1285 y(of)i(c)o(ontinuit)o (y.)27 b(It)16 b(is)f(mainly)g(included)g(for)i(those)f(who)g(ar)o(e)h (int)o(er)o(est)o(ed)g(in)-59 1334 y(the)11 b(way)f(the)h(binar)o(y)g (mak)o(e\014le)g(is)f(or)o(ganized.)16 b(Further)11 b(information)g(on) f(this)-59 1384 y(subject)j(c)o(an)g(be)f(obt)o(ained)i(fr)o(om)f(the)g (author)o(s)g(of)f Fp(icmak)o(e)-18 1434 y Fq(An)h(e)o(x)o(ample)f(of)h (a)f(mak)o(e-sour)o(c)o(e\014le)j(is:)-59 1513 y Fe(void)i(main\(\))-59 1552 y({)12 1592 y(printf\("Hello)e(world\\n"\);)-59 1631 y(})-59 1776 y Fq(A)e(he)o(x)o(dump)e(of)h(the)h(binar)o(y)f(mak)o (e\014le)h(which)f(is)g(gener)o(at)o(ed)h(fr)o(om)g(this)f(small)-59 1826 y Fp(icmak)o(e)20 b Fq(pr)o(ogr)o(am)14 b(is:)p eop %%Page: 12 13 12 12 bop -59 -127 a Fn(12)p -1 -127 937 2 v 961 w Fp(Act)o(a)13 b(Ic)o(cis)e(1994-1)-59 29 y Fe(00000000:)33 b(32)18 b(2E)f(31)g(32)h(26)f(00)g(00)h(00)f(33)g(00)h(00)f(00)g(33)h(00)f(00)g (00)36 b(2.12&...3...3.)o(..)-59 68 y(00000010:)e(22)17 b(00)g(00)g(00)h(06)f(00)g(00)h(05)f(00)g(00)h(05)f(02)g(00)h(1B)f(0D)g (1C)36 b(".............)o(..)-59 107 y(00000020:)e(03)17 b(23)g(21)g(14)h(00)f(1D)g(48)h(65)f(6C)g(6C)h(6F)f(20)g(77)h(6F)f(72)g (6C)36 b(.#!...Hello)15 b(worl)-59 147 y(00000030:)34 b(64)17 b(0A)g(00)g(74)h(65)f(73)g(74)h(2E)f(69)g(6D)h(0A)302 b(d..test.im.)-59 253 y Fq(Another)24 b(way)g(t)o(o)h(look)f(at)g(the)g (binar)o(y)f(mak)o(e\014le)h(is)f(t)o(o)i(use)e Fp(icmun)29 b Fq(t)o(o)-59 302 y(unassemble)11 b(the)i(binar)o(y)e(\014le.)16 b(When)c Fp(icmun)19 b Fq(is)11 b(c)o(alled)i(t)o(o)g(unassemble)e (this)-59 352 y(binar)o(y)h(\014le,)h(the)f(following)f(output)i(is)f (obt)o(ained:)-59 413 y Fe(ICCE)17 b(ICMAKE)f(Binary)h(Make)g(File)f (Unassembler)34 b(Version)16 b(2.01)-59 453 y(Copyright)g(\(c\))h(ICCE) g(1992,)f(1993.)h(All)g(rights)g(reserved.)-59 532 y(Binary)f(file)h (statistics:)83 571 y(strings)194 b(at)17 b(offset)88 b(0026)83 611 y(variables)158 b(at)17 b(offset)88 b(0033)83 650 y(filenames)158 b(at)17 b(offset)88 b(0033)83 689 y(first)17 b(instruction)e(at)i(offset)88 b(0022)-59 768 y(String)16 b(constants)g(dump:)83 808 y("Hello)h(world.")-59 887 y(Disassembled)e(code:)83 926 y([0014])i(06)g(00)g(00)53 b(push)17 b(string)f("Hello)h(world.")83 965 y([0017])g(05)g(00)g(00)53 b(push)17 b(int)g(0000)83 1005 y([001a])g(05)g(02)g(00)53 b(push)17 b(int)g(0002)83 1044 y([001d])g(1b)g(0d)106 b(callrss)16 b(13)i(\(print\))83 1084 y([001f])f(1c)g(03)106 b(add)17 b(sp,)g(3)83 1123 y([0021])g(23)159 b(ret)83 1163 y([0022])17 b(21)g(14)g(00)53 b(call)17 b([0014])83 1202 y([0025])g(1d)159 b(exit)-59 1308 y Fq(This)13 b(\014nal)g(output) i(clearly)f(shows)f(the)h(or)o(ganization)h(of)f(the)g(binar)o(y)g(mak) o(e-)-59 1358 y(\014le:)h(The)9 b(strings,)h(v)o(ariables)f(\(in)h (this)f(e)o(x)o(ample)g(ther)o(e)i(ar)o(e)g(none\),)f(\014lenames,)-59 1407 y(and)15 b(\014r)o(st)h(instruction)f(o\013set)i(is)d(clearly)i (mark)o(ed,)i(the)e(strings)e(ar)o(e)j(shown,)-59 1457 y(and)12 b(the)h(instructions)g(ar)o(e)h(display)o(ed)d(in)h(an)h (assembly-lik)o(e)f(way.)17 b(The)c(dis-)-59 1507 y(assembled)h(c)o (ode)i(c)o(onsist)o(s)f(of)f(lines,)h(one)g(line)e(for)i(each)g (disassembled)f(in-)-59 1557 y(struction.)22 b(Within)14 b(each)g(line)g(thr)o(ee)h(part)o(s)g(ar)o(e)g(r)o(ec)o(ognized.)23 b(The)14 b(leftmost)-59 1607 y(part)h(is)e(between)i(squar)o(e)f(br)o (ack)o(et)o(s,)j(showing)c(the)h(b)o(yt)o(e-o\013set)i(of)e(the)g (\014r)o(st)-59 1656 y(b)o(yt)o(e)f(of)e(the)h(instruction.)17 b(The)12 b(middle)f(part)i(shows)e(the)h(b)o(yt)o(es)g(forming)f(the) -59 1706 y(instruction,)k(and)e(the)i(rightmost)f(part)h(is)e(a)h (legible)f(tr)o(anslation)h(of)g(the)g(bi-)-59 1756 y(nar)o(y)j(c)o (ode.)32 b(For)17 b(e)o(x)o(ample,)i(st)o(arting)f(at)f(o\013set)h(1f) 838 1738 y Fj(5)871 1756 y Fq(ther)o(e)g(ar)o(e)g(t)o(ow)h(b)o(yt)o (es,)p -59 1786 534 2 v -18 1814 a Fi(5)1 1826 y Fg(Icmun)c Fh(displays)10 b(v)o(alues)g(in)f(he)o(x)o(adecimal)g(form)p eop %%Page: 13 14 13 13 bop -59 -127 a Fp(ICMAKE)p 124 -127 1094 2 v 1119 w Fn(13)-59 -11 y Fq(having)10 b(v)o(alues)i(of)g(r)o(espectiv)o(ely)h (1c)f(and)g(03.)k(These)c(v)o(alues)f(ar)o(e)i(int)o(erpr)o(et)o(ed)-59 39 y(as)f(the)h(instruction)f(t)o(o)i(add)f(a)f(v)o(alue)g(3)h(t)o(o)g Fp(sp,)f Fq(the)h(st)o(ack)h(point)o(er.)-59 190 y Fk(2.2)50 b(The)16 b(`dependent')f(pr)o(ogr)o(ams,)h(used)g(int)o(ernally)-59 279 y Fq(The)10 b(following)f(pr)o(ogr)o(ams)i(ar)o(e)g(the)f (`dependent')g(pr)o(ogr)o(am)i(of)e Fp(icmak)o(e.)17 b Fq(Nor-)-59 328 y(mally)d(these)g(pr)o(ogr)o(ams)h(ar)o(e)g(not)g(st) o(art)o(ed)h(b)o(y)e(the)g(user)g(of)g Fp(icmak)o(e,)h Fq(but)g(ar)o(e)-59 378 y(\(e)o(v)o(entually\))e(st)o(art)o(ed)h(as)f (child-)e(or)i(o)o(v)o(erlay-pr)o(oc)o(esses)h(of)f Fp(icmak)o(e.)-59 521 y Fn(The)g(preprocessor)e(ICM-PP)-59 609 y Fp(Icm-pp)18 b Fq(is)g(the)h(pr)o(epr)o(oc)o(essor)i(of)d(the)h Fp(icmak)o(e)h Fq(c)o(ompiler.)36 b(This)18 b(pr)o(ogr)o(am)-59 659 y(sc)o(ans)j(the)g(user-supplied)e(mak)o(e\014le)j(for)f(pr)o(epr)o(oc) o(essor)i(dir)o(ectiv)o(es)f(\(e.g.,)-59 709 y Fp(#include)p Fq(,)14 b(see)h(section)g(3.1\))g(and)g(t)o(ak)o(es)h(appr)o(opriat)o (e)g(actions.)24 b(An)15 b(output)-59 759 y(\014le)j(is)g(writt)o(en)h (in)f(which)f(the)i(pr)o(epr)o(oc)o(essor)i(dir)o(ectiv)o(es)e(ar)o(e)h (`e)o(xpanded'.)-59 809 y(This)12 b(\(t)o(empor)o(ar)o(y\))k(\014le)c (is)f(used)h(b)o(y)h(the)f(ne)o(xt)g(st)o(age)h(of)g Fp(icmak)o(e)p Fq(.)-18 865 y(The)j(pr)o(ogr)o(am)h Fp(icm-pp)e Fq(is)g(furthermor)o(e)i(r)o(esponsible)e(for)h(the)f(de\014nition)-59 915 y(of)j(`pr)o(e-loaded)h(s)o(ymbols',)h(such)e(as)h Fp(MSDOS)e Fq(or)i Fp(UNIX)p Fq(.)g(This)f(is)f(further)-59 965 y(described)c(in)e(section)i(3.7.)-59 1107 y Fn(The)g(compiler)e (ICM-COMP)-59 1196 y Fq(The)e(following)e(st)o(age)i(of)f Fp(icmak)o(e)i Fq(is)e(the)h(c)o(ompiler)h Fp(icm-c)o(omp)p Fq(.)k(This)8 b(pr)o(ogr)o(am)-59 1246 y(tr)o(anslat)o(es)15 b(an)f Fh(ASCII)h Fq(\014le,)g(gener)o(at)o(ed)g(b)o(y)f Fp(icm-pp)p Fq(,)h(t)o(o)g(a)g(binar)o(y)f(format)h(and)-59 1295 y(performs)g(err)o(or)h(checking.)22 b(The)15 b(r)o(esulting)e (binar)o(y)h(\014le)g(c)o(ont)o(ains)h Fp(opc)o(odes)p Fq(,)-59 1345 y(much)g(lik)o(e)h(the)g(output)f(\014le)g(of)h(a)f(c)o (ompiler)i(of)e(a)h(pr)o(ogr)o(amming)g(language.)-59 1395 y(When)d(a)h(binar)o(y)f(mak)o(e\014le)i(is)e(gener)o(at)o(ed,)i (the)f(int)o(ermediat)o(e)i(output)e(\014le)f(of)-59 1445 y(the)g(pr)o(epr)o(oc)o(essor)i(is)d(no)g(longer)g(needed)h(and)f (is)g(delet)o(ed.)-59 1587 y Fn(The)h(e)o(xecutor)f(ICM-EXEC)-59 1676 y Fp(Icm-e)o(x)o(ec)18 b Fq(is)g(the)h(e)o(x)o(ecut)o(or)h(of)f (the)g(binar)o(y)g(mak)o(e\014le)g(gener)o(at)o(ed)h(b)o(y)f Fp(icm-)-59 1726 y(c)o(omp)p Fq(.)30 b(This)16 b(st)o(age)i(r)o(eads)g (the)f(binar)o(y)g(mak)o(e\014le)h(and)e(int)o(erpr)o(et)o(s)j(the)f (op-)-59 1776 y(c)o(odes:)g(list)o(s)13 b(of)g(\014les)f(ar)o(e)i (built,)f(\014les)f(ar)o(e)i(c)o(ompar)o(ed)i(b)o(y)d(dat)o(es,)h (actions)g(ar)o(e)-59 1826 y(t)o(ak)o(en.)p eop %%Page: 14 15 14 14 bop -59 -127 a Fn(14)p -1 -127 937 2 v 961 w Fp(Act)o(a)13 b(Ic)o(cis)e(1994-1)-59 -11 y Fk(2.3)50 b(The)16 b(c)o(alling)g(or)o (der)f(of)g(pr)o(ogr)o(ams)-59 66 y Fq(The)d Fp(icmak)o(e)i Fq(gr)o(oup)e(of)h(pr)o(ogr)o(ams)g(att)o(empt)o(s)i(t)o(o)e(mak)o(e)h (use)e(of)g(the)h(av)o(ailable)-59 115 y(memor)o(y)h(as)e(e\016cient)h (as)g(possible.)i(Memor)o(y)e(pr)o(oblems)g(may)g(arise)f(during)-59 165 y(the)h(e)o(x)o(ecution)g(phase)f(of)g(a)h(pr)o(ogr)o(am;)g(i.e.,)g (during)e(the)i(run)f(of)g Fp(icm-e)o(x)o(ec)p Fq(.)-18 215 y(The)k(main)f(pr)o(ogr)o(am)i Fp(icmak)o(e)f Fq(spawns)e(the)i(pr) o(epr)o(oc)o(essor)i(and)d(the)g(c)o(om-)-59 265 y(piler)i(as)f(child)h (pr)o(oc)o(esses.)31 b(Howe)o(v)o(er,)20 b(when)d(the)g(e)o(x)o(ecut)o (or)i(is)d(c)o(alled)h(the)-59 315 y Fp(icmak)o(e)k Fq(pr)o(ogr)o(am)g (it)o(self)e(is)g(o)o(v)o(erlay)o(ed,)k(ther)o(eb)o(y)e(making)f(the)g (maximum)-59 365 y(amount)11 b(of)f(memor)o(y)i(av)o(ailable.)k(Due)10 b(t)o(o)i(this)e(setup,)h Fp(icm-e)o(x)o(ec)f Fq(may)g(spawn)-59 414 y(child)f(pr)o(oc)o(esses)h(which)f(ar)o(e)i(speci\014ed)e(b)o(y)g (the)h(user)g(with)f(a)h(maximum)f(mem-)-59 464 y(or)o(y)k(pool)g(av)o (ailable.)-59 579 y Fk(2.4)50 b(Ex)o(ecut)o(able)17 b(mak)o(e\014les)g (under)e(Unix)-59 656 y Fq(Under)9 b(the)h(oper)o(ating)g(s)o(yst)o(em) g(UNIX)f(it)h(is)f(possible)f(t)o(o)i(cr)o(eat)o(e)i(mak)o(e\014les)e (for)-59 706 y Fp(icmak)o(e)15 b Fq(which)f(ar)o(e)h(themselv)o(es)g(e) o(x)o(ecut)o(able.)23 b(E.g.,)15 b(a)f(setup)g(is)g(feasible)f(in)-59 756 y(which)d(a)g(mak)o(e\014le)i Fp(backup)e Fq(e)o(xist)o(s,)h(which) e(c)o(an)i(be)g(st)o(art)o(ed)h(b)o(y)e(the)h(c)o(ommand)-59 805 y Fp(backup)p Fq(.)16 b(In)9 b(such)g(a)h(setup)f(the)h(same)g (e\013ect)i(may)e(be)g(achie)o(v)o(ed)g(b)o(y)g(cr)o(eating)g(a)-59 855 y(mak)o(e\014le)j Fp(backup.im)g Fq(and)f(b)o(y)g(st)o(arting)g(it) h(with)f(the)g(c)o(ommand)i(line)d Fp(icmak)o(e)-59 905 y(backup)p Fq(.)-59 955 y(T)o(o)i(cr)o(eat)o(e)i(an)d(e)o(x)o(ecut)o (able)h(mak)o(e\014le,)h(the)f(following)e(st)o(eps)i(may)f(be)h(t)o (ak)o(en.)-18 1042 y Fo(\017)21 b Fq(The)15 b(mak)o(e\014le)i(c)o(an)e (be)h(r)o(enamed)g(t)o(o)h(a)e(suit)o(able)g(name.)25 b(This)15 b(name)g(is)24 1091 y(lat)o(er)f(used)d(t)o(o)j(inv)o(ok)o(e) f(the)g(pr)o(oc)o(ess)g(which)f(e)o(x)o(ecut)o(es)h(the)g(mak)o (e\014le;)g(for)24 1141 y(this)f(r)o(eason,)h(the)g(name)g Fp(backup)g Fq(may)f(be)h(pr)o(efer)o(able)g(t)o(o)h Fp(backup.im)p Fq(.)-18 1222 y Fo(\017)21 b Fq(The)10 b(mak)o(e\014le)h(is)e(made)h(e)o(x)o(ecut)o(able)h(using)c(the)k(UNIX) e Fp(chmod)g Fq(pr)o(ogr)o(am.)24 1272 y(E.g.,)k(the)f(c)o(ommand)476 1375 y Fp(chmod)f(+x)i(backup)24 1477 y Fq(labels)f(the)g(\014le)h Fp(backup)f Fq(as)g(an)h(e)o(x)o(ecut)o(able)g(pr)o(ogr)o(am.)24 1542 y(The)j(mak)o(e\014le)h(may)f(furthermor)o(e)h(be)f(plac)o(ed)g (in)f(a)h(dir)o(ect)o(or)o(y)i(point)o(ed)24 1592 y(t)o(o)e(b)o(y)e (the)h Fp(P)n(A)n(TH)g Fq(envir)o(onment.)23 b(E.g.,)15 b(the)g(mak)o(e\014le)h(may)e(be)h(plac)o(ed)24 1642 y(in)d(a)g(user's)g(priv)o(at)o(e)i Fp(bin)e Fq(dir)o(ect)o(or)o(y.)-18 1723 y Fo(\017)21 b Fq(The)13 b(following)d(line)i(is)g(added)g(as)h (the)f(\014r)o(st)h(line)f(in)g(the)h(mak)o(e\014le:)432 1826 y Fp(#!/usr/bin/icmak)o(e)f(-qi)p eop %%Page: 15 16 15 15 bop -59 -127 a Fp(ICMAKE)p 124 -127 1094 2 v 1119 w Fn(15)24 -11 y Fq(This)14 b(line)h(informs)g(the)g(oper)o(ating)h(s)o (yst)o(em)g(that)g(when)f(e)o(x)o(ecuting)f(the)24 39 y(\014le,)j(the)f(pr)o(ogr)o(am)h Fp(/usr/bin/icmak)o(e)f Fq(should)e(be)i(st)o(art)o(ed,)j(supplying)24 89 y(the)13 b(\015ags)e Fp(-qi)h Fq(and)g(supplying)d(the)k(name)f(of)h(the)f(mak)o (e\014le.)18 b(The)12 b(\015ag)g Fp(-q)24 139 y Fq(suppr)o(esses)i Fp(icmak)o(e)p Fq('s)i(c)o(op)o(yright)g(header;)h(the)e(\015ag)g Fp(-i)f Fq(c)o(auses)h Fp(icmak)o(e)24 188 y Fq(t)o(o)d(t)o(ak)o(e)g (the)f(following)f(\014le)g(ar)o(gument)h(as)g(the)g(lit)o(er)o(al)g (input)f(\014le)h(inst)o(ead)24 238 y(of)h(supplying)e(the)j(default)f (e)o(xt)o(ension)g Fp(.im)p Fq(.)17 b(See)12 b(also)h(section)g(2.1)f (for)g(a)24 288 y(description)h(of)f(these)h(\015ags.)24 356 y(Not)o(e)19 b(that)f(this)f(line)f(must)h(c)o(ont)o(ain)i(a)e (full)f(r)o(efer)o(enc)o(e,)21 b(including)15 b(the)24 405 y(path,)27 b(t)o(o)e(the)f(pr)o(ogr)o(am)h Fp(icmak)o(e)p Fq(.)52 b(In)23 b(this)g(e)o(x)o(ample)g(this)g(path)h(is)24 455 y Fp(/usr/bin)p Fq(.)-18 549 y(The)9 b(binar)o(y)f(mak)o(e\014le)i (\()p Fp(.bim)f Fq(\014le\))f(is)g(plac)o(ed)h(b)o(y)f Fp(icmak)o(e)i Fq(in)d(the)i(same)g(dir)o(ec-)-59 599 y(t)o(or)o(y)k(as)e(the)h(ascii)f(mak)o(e\014le.)17 b(This)11 b(dir)o(ect)o(or)o(y)j(must)d(ther)o(efor)o(e)i(be)f(ac)o(c)o(essible) -59 648 y(t)o(o)i(the)e(user)h(inv)o(oking)e(the)i(mak)o(e\014le.)-59 788 y Fm(3)60 b(The)17 b(s)o(ynt)o(ax)h(of)g(the)f(mak)o(e\014le)-59 880 y Fq(The)12 b(user-supplied)f(mak)o(e\014le)i(must)f(follow)g(a)g (well-de\014ned)f(s)o(ynt)o(ax,)i(which)-59 930 y(r)o(esembles)k(the)f Fn(C)g Fq(pr)o(ogr)o(amming)h(language.)27 b(This)15 b(section)i(describes)f(the)-59 980 y(s)o(ynt)o(ax)c(of)h(the)g(mak)o (e\014le.)-59 1099 y Fk(3.1)50 b(Comment)16 b(and)f(pr)o(epr)o(oc)o (essor)i(dir)o(ectiv)o(es)-59 1176 y Fq(One)d(of)g(the)g(t)o(asks)h(of) f(the)g(pr)o(epr)o(oc)o(essor)j(is)c(t)o(o)i(strip)f(the)h(mak)o (e\014le)g(of)e(c)o(om-)-59 1226 y(ment.)18 b Fp(Icmak)o(e)c Fq(r)o(ec)o(ognizes)f(two)h(t)o(ypes)f(of)g(c)o(omment:)19 b(the)13 b(st)o(andar)o(d)h Fn(C)p Fq(-lik)o(e)-59 1276 y(c)o(omment)20 b(and)d(end-of-line)g(c)o(omment)i(which)f(is)f (implement)o(ed)h(in,)h(e.g.,)-59 1326 y(the)13 b(Micr)o(osoft)g(6.00a) f Fn(C)h Fq(c)o(ompiler.)-18 1376 y(St)o(andar)o(d)h(c)o(omment)i(must) d(be)h(pr)o(ec)o(eded)h(b)o(y)e(/)p Fo(\003)f Fq(and)h(must)h(be)f (closed)h(b)o(y)-59 1426 y Fo(\003)p Fq(/.)i(This)11 b(t)o(ype)h(of)g(c)o(omment)i(may)e(str)o(et)o(ch)i(o)o(v)o(er)f(mor)o (e)h(than)e(one)g(line.)j(End-)-59 1476 y(of-line)c(c)o(omment)k(is)d (pr)o(ec)o(eded)i(b)o(y)e(//)g(and)g(ends)g(when)g(a)g(new)h(line)e(st) o(art)o(s.)-18 1526 y(Lines)16 b(which)g(st)o(art)i(with)f Fp(#!)28 b Fq(ar)o(e)18 b(skipped)e(b)o(y)h(the)g(pr)o(epr)o(oc)o (essor.)31 b(This)-59 1576 y(featur)o(e)19 b(is)f(included)g(t)o(o)h (allow)g(e)o(x)o(ecut)o(able)g(mak)o(e\014les)g(under)g(UNIX,)f(see)-59 1626 y(section)13 b(2.4.)-18 1676 y(Apart)k(fr)o(om)f(the)g Fp(#!)25 b Fq(dir)o(ectiv)o(e,)18 b Fp(icmak)o(e)e Fq(r)o(ec)o(ognizes) g(two)g(mor)o(e)h(pr)o(epr)o(o-)-59 1726 y(c)o(essor)12 b(dir)o(ectiv)o(es:)17 b Fp(#include)10 b Fq(and)i Fp(#de\014ne)p Fq(.)k(Both)c(dir)o(ectiv)o(es)g(must)g(be)f(pr)o(e-)-59 1776 y(c)o(eded)h(b)o(y)f(a)h(`#'-sign)d(which)h(must)h(be)h(loc)o(at)o (ed)h(at)f(the)g(\014r)o(st)f(c)o(olumn)h(of)f(a)g(line)-59 1826 y(in)h(the)g(mak)o(e\014le.)p eop %%Page: 16 17 16 16 bop -59 -127 a Fn(16)p -1 -127 937 2 v 961 w Fp(Act)o(a)13 b(Ic)o(cis)e(1994-1)-59 -11 y Fn(The)i(#include)g(directive)-59 66 y Fq(The)g Fp(#include)e Fq(dir)o(ectiv)o(e)i(must)g(obe)o(y)g(the)g (following)e(s)o(ynt)o(ax)992 48 y Fj(6)1008 66 y Fq(:)412 152 y Fn(#)h(include)h(")p Fp(\014lename)p Fn(")395 202 y(#)f(include)h Fl(<)p Fp(\014lename)h Fl(>)-59 288 y Fq(When)g Fp(icmak)o(e)g Fq(\(or,)i(mor)o(e)f(e)o(x)o(actly)f(the)g(pr) o(epr)o(oc)o(essor)j Fp(icm-pp)p Fq(\))c(enc)o(ount)o(er)o(s)-59 338 y(this)e(dir)o(ectiv)o(e,)k(the)d Fp(\014lename)h Fq(which)e(is)h(st)o(at)o(ed)i(following)c(the)j Fp(#include)d Fq(di-)-59 388 y(r)o(ectiv)o(e)j(is)d(r)o(ead.)17 b(The)11 b(\014lename)g(may)g(include)f(a)i(path)f(speci\014c)o(ation)1118 370 y Fj(7)1135 388 y Fq(.)16 b(When)-59 438 y(the)c(\014lename)f(is)g (enclosed)g(b)o(y)h(double)f(quot)o(es,)h Fp(icmak)o(e)h Fq(att)o(empt)o(s)h(t)o(o)e(ac)o(c)o(ess)-59 488 y(this)f(\014le)h(e)o (x)o(actly)g(as)g(st)o(at)o(ed.)18 b(When)12 b(the)g(\014lename)g(is)g (enclosed)g(b)o(y)g Fl(<)g Fq(and)g Fl(>)p Fq(,)-59 537 y Fp(icmak)o(e)g Fq(att)o(empt)o(s)h(t)o(o)g(ac)o(c)o(ess)f(this)e (\014le)h(r)o(elativ)o(e)h(t)o(o)g(the)g(dir)o(ect)o(or)o(y)h(point)o (ed)e(t)o(o)-59 587 y(b)o(y)h(the)h(s)o(yst)o(em)g(v)o(ariable)g Fp(IM)p Fq(.)f(This)g(setup)g(is)g(analogous)g(t)o(o)i(the)f(pr)o(oc)o (essing)-59 637 y(of)f(include-\014les)f(b)o(y)h(the)h(Micr)o(osoft)g Fn(C)g Fq(c)o(ompiler)g(under)g(MS-DOS.)-18 687 y(Any)h(information)f (enc)o(ount)o(er)o(ed)i(be)o(y)o(ond)f(the)f(\014lename)h(is)e(ignor)o (ed)i(until)-59 737 y(end-of-line.)-59 844 y Fn(The)f(#de\014ne)g (directive)-59 920 y Fq(The)d Fp(#de\014ne)g Fq(dir)o(ectiv)o(e)h(is)e (a)h(means)g(of)g(inc)o(orpor)o(ating)h(c)o(onst)o(ant)o(s)g(in)e(a)i (mak)o(e-)-59 970 y(\014le.)16 b(The)d(dir)o(ectiv)o(e)g(follows)f(the) h(following)e(s)o(ynt)o(ax:)190 1056 y Fn(#)i(de\014ne)g Fp(identi\014er)f(r)o(ede\014nition-of-identi\014)o(er)-59 1143 y Fq(The)d(de\014ned)g(name)h(\(the)g(name)f(of)g(the)h(de\014ned) f(c)o(onst)o(ant\))i(must)e(be)g(an)h(iden-)-59 1193 y(ti\014er)18 b(ac)o(c)o(or)o(ding)h(t)o(o)g(the)f Fn(C)f Fq(pr)o(ogr)o(amming)h(language:)26 b(the)18 b(\014r)o(st)g(char)o(act) o(er)-59 1242 y(must)g(be)g(an)g(under)o(sc)o(or)o(e)i(or)f(a)f(char)o (act)o(er)j(of)d(the)h(alphabet,)h(subsequent)-59 1292 y(char)o(act)o(er)o(s)15 b(may)e(be)g(under)o(sc)o(or)o(es)g(or)g (alphanumeric)o(s.)-18 1342 y(The)20 b(r)o(ede\014nition)f(part)h(of)g (the)f Fp(#de\014ne)g Fq(dir)o(ectiv)o(e)i(c)o(onsist)o(s)f(of)f(spac)o (es,)-59 1392 y(number)o(s,)f(or)g(what)o(e)o(v)o(er)h(is)d(appr)o (opriat)o(e.)32 b(The)18 b(pr)o(epr)o(oc)o(essor)h(simply)d(r)o(e-)-59 1442 y(plac)o(es)h(all)f(oc)o(curr)o(enc)o(es)j(of)d(the)h(de\014ned)f (c)o(onst)o(ant)i(following)d(the)i Fp(#de\014ne)-59 1491 y Fq(dir)o(ectiv)o(e)12 b(b)o(y)f(the)g(r)o(ede\014nition)f(part.) 17 b(Not)o(e)c(that)e(r)o(ede\014nitions)g(ar)o(e)g(not)g(fur-)-59 1541 y(ther)j(e)o(xpanded;)e(i.e.,)i(an)f(alr)o(eady)h(de\014ned)e (name)i(which)e(oc)o(cur)o(s)j(in)e(the)g(r)o(e-)-59 1591 y(de\014nition)f(part)h(is)f(not)h(pr)o(oc)o(essed)g(but)g(is)f (left)g(as)g(is.)p -59 1627 534 2 v -18 1655 a Fi(6)1 1667 y Fh(S)o(ynt)o(actic)o(al)d(rules)g(ar)o(e)g(r)o(epr)o(esent)o(ed) g(in)g(this)g(document)e(b)o(y)j(two)f(font)o(s:)k(the)8 b(boldfac)o(e)h(part)o(s)-59 1706 y(must)f(appear)g(e)o(x)o(actly)g(in) g(the)h(mak)o(e\014le.)j(The)c(slant)o(ed)g(part)o(s)h(may)f(be)h (substitut)o(ed)f(b)o(y)h(the)f(user.)-18 1735 y Fi(7)1 1747 y Fh(Under)g(MS-DOS,)i(the)f(path)h(speci\014c)o(ation)e(may)h (include)g(slashes)g(as)g(well)h(as)f(backslashes.)-59 1786 y(When)18 b(backslashes)f(ar)o(e)h(used,)i(only)f(one)f(backslash) f(must)h(be)h(used)f(t)o(o)h(separ)o(at)o(e)g(\(sub-)-59 1826 y(\)dir)o(ect)o(ories.)p eop %%Page: 17 18 17 17 bop -59 -127 a Fp(ICMAKE)p 124 -127 1094 2 v 1119 w Fn(17)-18 -11 y Fq(Howe)o(v)o(er,)14 b(c)o(omment)g(may)d(be)h(found) e(on)h(the)h(line)f(be)o(y)o(ond)g(the)h Fp(identi\014er)-59 39 y Fq(of)d(a)h Fp(#de\014ne.)15 b Fq(Both)10 b(c)o(omment)i(t)o(o)e (end-of-line)e(and)h(st)o(andar)o(d)h(c)o(omment)i(ar)o(e)-59 89 y(ac)o(c)o(ept)o(ed,)20 b(albeit)c(that)h(st)o(andar)o(d)g(c)o (omment)h(must)e(end)g(at)h(the)f(line)f(it)o(self:)-59 139 y(st)o(andar)o(d)k(c)o(omment)h(enc)o(ount)o(er)o(ed)g(in)d(a)i Fp(#de\014ne-)p Fq(line)e(c)o(an)h(curr)o(ently)h(not)-59 188 y(e)o(xt)o(end)g(o)o(v)o(er)h(multiple)e(lines.)34 b(No)19 b(c)o(omment)i(is)d(ac)o(c)o(ept)o(ed)j(between)e(the)-59 238 y Fp(#de\014ne)12 b Fq(and)h(the)f Fp(identi\014er.)-59 363 y Fk(3.2)50 b(T)o(ypes,)16 b(c)o(onst)o(ant)o(s)h(and)e(v)o (ariables)-59 443 y Fp(Icmak)o(e)j Fq(r)o(ec)o(ognizes)f(four)g(t)o (ypes:)26 b Fp(int,)16 b(string,)g(list)23 b Fq(and)16 b Fp(v)o(oid.)29 b Fq(The)17 b(t)o(ypes)-59 492 y(ser)o(v)o(e)c(the)g (following)e(purposes:)-18 590 y Fo(\017)21 b Fq(The)13 b(t)o(ype)g Fp(v)o(oid)20 b Fq(is)12 b(used)g(only)g(with)h(functions,) f(t)o(o)i(indic)o(at)o(e)g(that)f(these)24 640 y(functions)f(do)g(not)h (r)o(eturn)g(v)o(alues.)-18 730 y Fo(\017)21 b Fq(Const)o(ant)o(s)13 b(may)f(be)g(used)g(in)f(the)i(mak)o(e\014le)g(t)o(o)g(indic)o(at)o(e)g (a)f(number)h(or)f(a)24 780 y(string.)j(The)c(c)o(onst)o(ant)o(s)h (then)e(ob)o(viously)g(hav)o(e)h(t)o(ype)g Fp(int)e Fq(or)j(t)o(ype)f Fp(string)p Fq(.)24 829 y Fp(Int)e Fq(c)o(onst)o(ant)o(s)j(ar)o(e)f (denot)o(ed)g(b)o(y)f(numeric)h(char)o(act)o(er)o(s;)i(e.g.,)e Fp(13)f Fq(is)g(an)g Fp(int)24 879 y Fq(c)o(onst)o(ant.)27 b Fp(String)14 b Fq(c)o(onst)o(ant)o(s)j(ar)o(e)g(denot)o(ed)f(b)o(y)g (t)o(e)o(xt)g(between)g(double)24 929 y(quot)o(e)i(marks;)j(e.g.,)d Fp("a)g(string")e Fq(is)h(a)h(piec)o(e)g(of)f(t)o(e)o(xt.)32 b(List)17 b(c)o(onst)o(ant)o(s)24 979 y(ar)o(e)f(not)g(allowed)g(in)e Fp(icmak)o(e)p Fq(:)24 b(list)o(s)14 b(of)i(\014les)e(always)h(hav)o(e) g(t)o(o)i(be)e(built)24 1029 y(run-time.)24 1098 y(A)10 b(sec)o(ond)g(way)g(t)o(o)g(denot)o(e)h(an)e Fp(int)g Fq(c)o(onst)o(ant)i(is)e(b)o(y)g(enclosing)g(a)h(char)o(act)o(er)24 1148 y(in)k(single)g(quot)o(es.)25 b(The)15 b(numeric)g(v)o(alue)g(of)g (the)g(c)o(onst)o(ant)i(is)d(then)h(the)24 1198 y Fh(ASCII)c Fq(number)g(of)f(the)h(char)o(act)o(er;)j(e.g.,)e(the)f(c)o(onst)o(ant) h Fp('A')f Fq(has)f(the)h(v)o(alue)24 1248 y(65.)16 b(The)11 b(char)o(act)o(er)j(between)e(quot)o(es)g(may)f(not)h(be)f(`esc)o (aped',)i(such)d(as,)24 1298 y(e.g.,)15 b Fp(')p Fo(n)p Fp(n')p Fq(.)22 b(Only)14 b(single)e(char)o(act)o(ers)17 b(ar)o(e)e(allowed)g(in)e(this)h(not)o(ation)i(of)24 1347 y(int)o(eger)d(c)o(onst)o(ant)o(s.)-18 1437 y Fo(\017)21 b Fq(The)14 b(thr)o(ee)i(t)o(ypes)e(further)g(ser)o(v)o(e)h(the)g (de\014nition)e(of)h(v)o(ariables)h(and)e(ar-)24 1487 y(gument)o(s.)i Fp(Icmak)o(e)d Fq(allows)d(global)g(v)o(ariables)h(and) g(loc)o(al)h(v)o(ariables.)k(The)24 1537 y(declar)o(ation)d(of)f(a)f(v) o(ariable)h(or)g(of)g(an)f(ar)o(gument)i(must)e(st)o(at)o(e)i(the)f(t)o (ype)h(of)24 1587 y(the)h(v)o(ariable:)18 b(e.g.,)c Fp(int)e Fq(for)h(a)g(c)o(ount)o(er)i(v)o(ariable)e(or)h Fp(list)e Fq(for)h(a)g(v)o(ariable)24 1636 y(holding,)e(e.g.,)i(the)g(names)f(of) h(all)f(\014les)f(having)g(e)o(xt)o(ension)h(`.c'.)-18 1726 y Fo(\017)21 b Fq(Some)14 b(of)f(the)h(built-in)d(functions)h(of)i Fp(icmak)o(e)g Fq(\(see)g(section)f(3.6\))h(r)o(eturn)24 1776 y(a)f(v)o(alue)f(of)h(one)g(of)f(the)h(t)o(ypes)g Fp(int)p Fq(,)g Fp(string)e Fq(or)i Fp(list)p Fq(.)j(The)d(r)o(eturned) h(v)o(alue)24 1826 y(may)e(be)f(assigned)f(t)o(o)j(a)e(v)o(ariable)h (of)f(the)h(same)g(t)o(ype)g(or)g(may)g(be)f(passed)p eop %%Page: 18 19 18 18 bop -59 -127 a Fn(18)p -1 -127 937 2 v 961 w Fp(Act)o(a)13 b(Ic)o(cis)e(1994-1)24 -11 y Fq(t)o(o)17 b(another)f(function.)25 b(Additionally,)16 b(all)f(built-in)f(functions)h(r)o(equir)o(e)24 39 y(ar)o(gument)o(s)e(of)f(a)h(c)o(ert)o(ain)h(t)o(ype.)-18 117 y Fo(\017)21 b Fq(Similarly)g(t)o(o)i(built-in)d(functions,)k (user-de\014ned)d(functions)g(ar)o(e)i(as-)24 167 y(sumed)16 b(t)o(o)h(r)o(eturn)g(a)g(v)o(alue)f(which)f(is)h(either)g Fp(int)p Fq(,)h Fp(string)e Fq(or)i Fp(list)p Fq(.)26 b(The)24 217 y Fp(int)11 b Fq(t)o(ype)j(is)d(the)i(default.)-59 297 y(The)18 b(de\014nition)f(of)h(v)o(ariables)g(follows)f(a)h Fn(C)p Fq(-lik)o(e)g(s)o(ynt)o(ax.)33 b(Ar)o(gument)o(s)19 b(ar)o(e)-59 347 y(de\014ned)12 b(as)g(in)g Fh(ANSI)p Fq(-)p Fn(C)p Fq(.)-59 397 y(Some)k(e)o(x)o(amples)e(of)h(the)h(usage)e (of)h(t)o(ypes)g(ar)o(e)h(giv)o(en)f(in)f(the)h(listing)f(below.)-59 447 y(Not)o(e)g(also)f(the)f(use)g(of)h(the)f(c)o(onst)o(ant)o(s)i Fp(55)f Fq(and)f Fp("main.c")p Fq(.)12 516 y Fe(string)17 b(myfun)f(\(int)h(x,)g(string)g(y,)g(list)g(z\))35 b(//)17 b(a)h(user-defined)d(function)12 556 y({)693 b(//)17 b(of)h(type)f(string,)f(having)g(3)83 595 y(int)586 b(//)17 b(parameters)154 635 y(counter,)425 b(//)17 b(local)g(variables:)f(2)h (ints,)154 674 y(i;)533 b(//)17 b(1)h(string)e(and)i(1)f(list)83 713 y(string)154 753 y(name;)83 792 y(list)154 832 y(cfiles;)83 911 y(counter)f(=)i(55;)408 b(//)17 b(counter)g(is)g(set)g(to)g(55)83 950 y(name)g(=)h("main.c";)353 b(//)17 b(name)g(is)h(set)f(to)g(string) g(main.c)83 990 y(.)83 1029 y(.)83 1068 y(.)83 1108 y(return)g (\(name\);)389 b(//)17 b(a)h(string)e(is)i(returned)e(to)h(the)12 1147 y(})693 b(//)17 b(caller)-59 1301 y Fk(3.3)50 b(Strings)15 b(and)g(esc)o(ape)i(sequenc)o(es)-59 1377 y Fq(Strings)g(in)h(mak)o (e\014les)h(ar)o(e)g(used)f(t)o(o)h(r)o(epr)o(esent)h(both)f (\014lenames)f(and)g(dis-)-59 1427 y(play)o(ed)11 b(t)o(e)o(xt.)17 b Fp(Icmak)o(e)c Fq(allows)e(a)h(number)f(of)g(special)h(formatting)g (sequenc)o(es)-59 1477 y(in)f(strings)g(t)o(o)i(facilit)o(at)o(e)g(the) f(display)e(of)i(t)o(e)o(xt.)17 b(These)12 b(sequenc)o(es)g(ar)o(e)h(c) o(alled,)-59 1527 y(in)f(analogy)g(t)o(o)h(the)g Fn(C)f Fq(pr)o(ogr)o(amming)i(language,)d(esc)o(ape)j(sequenc)o(es.)-18 1577 y(Esc)o(ape)19 b(sequenc)o(es)e(in)g(strings)f(ar)o(e)j (identi\014ed)d(b)o(y)i(a)f(backslash)g(char)o(ac-)-59 1626 y(t)o(er)d(\()p Fo(n)p Fq(\),)f(followed)g(b)o(y)f(a)h(char)o(act) o(er)i(which)d(identi\014es)g(the)h(esc)o(ape)g(sequenc)o(e.)-59 1676 y(The)i(esc)o(ape)i(sequenc)o(es)e(r)o(ec)o(ognized)h(b)o(y)g Fp(icmak)o(e)g Fq(\(or,)i(mor)o(e)f(ac)o(cur)o(at)o(ely)h(b)o(y)-59 1726 y(the)g(c)o(ompiler)i Fp(icm-c)o(omp)p Fq(\))e(ar)o(e)h (summarized)f(in)g(\014gur)o(e)f(1.)34 b(E.g.,)20 b(when)d(a)-59 1776 y(string)d Fp("St)o(arting.)p Fo(n)p Fp(n")g Fq(is)h(display)o (ed,)g(the)g(string)g Fp(St)o(arting.)23 b Fq(is)14 b(print)o(ed)i(and) -59 1826 y(the)d(cur)o(sor)g(is)f(set)h(t)o(o)g(the)g(st)o(art)h(of)f (the)f(following)f(line.)p eop %%Page: 19 20 19 19 bop -59 -127 a Fp(ICMAKE)p 124 -127 1094 2 v 1119 w Fn(19)p 228 -51 740 2 v 253 -23 a Fc(Escape)10 b(sequence)48 b(Action)p 228 -10 V 364 18 a Fb(n)p Fh(a)161 b(alert)9 b(\(bell\))363 57 y Fb(n)p Fh(b)160 b(backspac)o(e)8 b(char)o(act)o(er)368 97 y Fb(n)p Fh(f)164 b(formfeed)8 b(char)o(act)o(er)363 136 y Fb(n)p Fh(n)160 b(newline)366 176 y Fb(n)p Fh(r)j(c)o(arriage)9 b(r)o(eturn)h(char)o(act)o(er)367 215 y Fb(n)p Fh(t)163 b(t)o(ab)364 255 y Fb(n)p Fh(v)e(v)o(ertic)o(al) 10 b(t)o(ab)331 294 y Fb(n)p Fg(other)127 b Fh(lit)o(er)o(al)11 b Fg(other)p 228 308 V 398 335 a Fh(Figur)o(e)f(1:)j(Esc)o(ape)d (sequenc)o(es)-18 472 y Fq(As)j(a)g(side)g(e\013ect,)i(the)e(backslash) g(char)o(act)o(er)i(it)o(self)e(must)g(be)g(r)o(epr)o(esent)o(ed)-59 522 y(as)f(`)p Fo(nn)p Fq('.)k(This)11 b(may)i(be)f(needed)h(when,)f (e.g.,)g(strings)g(r)o(epr)o(esent)h(pathnames)-59 572 y(under)c(MS-DOS.)e(The)i Fn(only)g Fq(e)o(x)o(c)o(eption)h(t)o(o)g (this)f(rule)f(is)h(the)g Fp(#include)e Fq(pr)o(epr)o(o-)-59 622 y(c)o(essor)14 b(dir)o(ectiv)o(e)g(\(see)g(section)f(3.1\):)18 b(this)13 b(dir)o(ectiv)o(e)h(t)o(ak)o(es)g(strings)e(lit)o(er)o(ally) -59 671 y(as)g(the)o(y)h(appear)g(in)f(a)h(mak)o(e\014le.)-18 723 y(Lik)o(e)h Fn(C,)g Fp(Icmak)o(e)21 b Fq(allows)13 b Fp(string-c)o(onc)o(at)o(enation.)j Fq(Long)d(strings,)g(e)o(xt)o (end-)-59 773 y(ing)i(o)o(v)o(er)i(se)o(v)o(er)o(al)f(lines)f(of)h(t)o (e)o(xt,)h(c)o(an)g(be)f(built)f(b)o(y)g(separ)o(ating)h(string)f(c)o (on-)-59 823 y(st)o(ant)o(s)e(b)o(y)f(whit)o(e-spac)o(e)i(char)o(act)o (er)o(s)h(\(blanks,)e(t)o(abs,)g(newlines\).)-59 948 y Fk(3.4)50 b(The)16 b(c)o(ode)g(of)f(a)g(mak)o(e\014le)-59 1028 y Fq(This)g(section)g(discusses)f(the)i(user-de\014ned)e (functions)h(which)f(may)i(appear)-59 1078 y(in)c(a)g(mak)o(e\014le)i (and)e(list)o(s)g(the)h(most)g(c)o(ommon)h(st)o(at)o(ement)o(s.)-59 1195 y Fn(Flow)e(control)g(statements)-59 1275 y Fp(Icmak)o(e)i Fq(r)o(ec)o(ognizes)f(six)e(c)o(ontr)o(ol)j(st)o(at)o(ement)o(s:)-18 1374 y Fo(\017)21 b Fp(if)e Fq(st)o(at)o(ement)o(s,)c(including)10 b Fp(if-else,)-18 1464 y Fo(\017)21 b Fp(while)e Fq(st)o(at)o(ement)o (s)-18 1555 y Fo(\017)i Fp(for)e Fq(st)o(at)o(ement)o(s)-18 1645 y Fo(\017)i Fp(r)o(eturn)f Fq(st)o(at)o(ement)o(s)-18 1735 y Fo(\017)h Fp(br)o(eak)g Fq(st)o(at)o(ement)o(s)-18 1826 y Fo(\017)g Fp(e)o(xit)d Fq(st)o(at)o(ement)o(s)p eop %%Page: 20 21 20 20 bop -59 -127 a Fn(20)p -1 -127 937 2 v 961 w Fp(Act)o(a)13 b(Ic)o(cis)e(1994-1)-59 -11 y Fq(The)17 b Fp(e)o(xit\(\))h Fq(st)o(at)o(ement,)j(though)c(a)g(function)g(in)g Fn(C)p Fq(,)h(is)e(part)i(of)g(the)f Fp(icmak)o(e)-59 39 y Fq(language.)k (Following)13 b(the)i Fp(e)o(xit)e Fq(k)o(e)o(ywor)o(d,)k(an)d(e)o(xpr) o(ession)g(yielding)e(an)j Fp(int)-59 89 y Fq(may)10 b(follow.)16 b(If)9 b(an)g Fp(int)g Fq(e)o(xpr)o(ession)h(follows,)g (it)o(s)g(v)o(alue)g(is)f(r)o(eturned)i(as)f(an)g Fp(int)-59 139 y Fq(t)o(o)k(the)g(oper)o(ating)f(s)o(yst)o(em;)h(otherwise,)g(the) g(r)o(eturned)g(v)o(alue)f(is)f(unde\014ned.)-59 188 y(The)e(other)h(\015ow)f(c)o(ontr)o(ol)i(st)o(at)o(ement)o(s)h(ar)o(e)e (analogous)e(t)o(o)j(the)e(c)o(orr)o(esponding)-59 238 y(ones)i(in)g(the)h Fn(C)f Fq(pr)o(ogr)o(amming)h(language.)-59 358 y Fn(User-de\014ned)g(functions)-59 438 y Fp(Icmak)o(e)i Fq(allows)e(the)h(c)o(onstruction)h(of)f(user-de\014ned)f(functions)g (in)g(a)h(mak)o(e-)-59 488 y(\014le.)25 b(The)16 b(de\014nition)e(of)i (a)f(function)g(must)g(follow)g(an)h Fh(ANSI)p Fq(-)p Fn(C)p Fq(-lik)o(e)f(s)o(ynt)o(ax,)-59 538 y(howe)o(v)o(er,)f(slight)d (di\013er)o(enc)o(es)j(e)o(xist)d(between)i(an)f Fp(icmak)o(e)i Fq(function)e(and)g(a)h Fn(C)-59 588 y Fq(function.)j(These)c(di\013er) o(enc)o(es)i(ar)o(e)g(highlight)o(ed)c(in)i(this)f(section.)-59 640 y(The)i(de\014nition)e(of)i(a)f(function)g(must)h(follow)f(the)h(s) o(ynt)o(ax:)-18 740 y Fo(\017)21 b Fq(Optionally)13 b(the)h(r)o(eturn)h (t)o(ype)f(of)g(the)g(function)f(is)f(speci\014ed.)20 b(The)14 b(t)o(ype)24 790 y(is)e Fp(v)o(oid,)f(int,)g(string)18 b Fq(or)13 b Fp(list)p Fq(.)j(The)c(default)g(r)o(eturn)i(t)o(ype)f(is) f Fp(int)p Fq(.)24 860 y(Not)o(e)h(that)f(when)f(a)h(function)e(e)o (xplicitly)g(r)o(eturns)i(using)e(a)h Fp(r)o(eturn)h Fq(st)o(at)o(e-)24 910 y(ment,)g(the)f(r)o(eturned)h(v)o(alue)e(must)h (mat)o(ch)h(the)f(r)o(eturn)g(t)o(ype.)17 b(A)11 b(function)24 960 y(r)o(eturns)i(an)f(unde\014ned)f(v)o(alue)h(if)g(it)h(does)f(not)h (use)f(a)g Fp(r)o(eturn)h Fq(st)o(at)o(ement.)24 1010 y(Functions)8 b(which)g(ar)o(e)i(de\014ned)f(as)g Fp(v)o(oid)15 b Fq(c)o(an)9 b(also)g(use)g(the)g Fp(r)o(eturn)16 b Fq(st)o(at)o(e-)24 1060 y(ment,)e(albeit)e(without)h(an)f(e)o(xpr)o (ession.)-18 1152 y Fo(\017)21 b Fq(Following)12 b(the)h(optional)h(r)o (eturn)g(t)o(ype,)g(the)g(function)f(name)g(must)g(fol-)24 1201 y(low.)j(The)9 b(name)h(must)g(be)g(an)f(identi\014er;)h(i.e.,)h (the)f(\014r)o(st)g(char)o(act)o(er)j(must)24 1251 y(be)f(an)f(under)o (sc)o(or)o(e)j(or)e(a)g(char)o(act)o(er)j(of)c(the)h(alphabet)g(and)f (optional)h(fol-)24 1301 y(lowing)f(char)o(act)o(ers)k(may)d(be)h (under)o(sc)o(or)o(es)h(or)f(alphanumeric)o(s.)-18 1393 y Fo(\017)21 b Fq(Following)11 b(the)i(function)f(name,)h(a)g Fn(\()f Fq(is)g(e)o(xpect)o(ed.)-18 1485 y Fo(\017)21 b Fq(A)c(par)o(amet)o(er)i(list)e(may)g(follow,)g(c)o(onsisting)f(of)h (par)o(amet)o(er)i(speci\014c)o(a-)24 1535 y(tions)d(separ)o(at)o(ed)h (b)o(y)f Fn(,)h Fq(\(this)f(is)f(r)o(eferr)o(ed)j(t)o(o)f(as)f(an)g Fh(ANSI)p Fq(-)p Fn(C)g Fq(par)o(amet)o(er)24 1584 y(list\).)g(P)o(ar)o (amet)o(er)f(speci\014c)o(ations)d(c)o(onsist)g(of)g(the)g(par)o(amet)o (er)i(t)o(ype)f(\()p Fp(int)p Fq(,)24 1634 y Fp(string)d Fq(or)h Fp(list)p Fq(\))f(and)h(the)g(par)o(amet)o(er)j(name)d(\(an)g (identi\014er\).)16 b(In)10 b(c)o(ontr)o(ast)24 1684 y(t)o(o)15 b Fn(C)p Fq(,)f Fp(icmak)o(e)i Fq(does)e(not)g(allow)g (functions)f(having)f(a)i(v)o(ariable)h(number)24 1734 y(of)d(par)o(amet)o(er)o(s.)-18 1826 y Fo(\017)21 b Fq(Following)11 b(the)i(optional)g(par)o(amet)o(er)i(list)d(a)g Fn(\))g Fq(is)g(e)o(xpect)o(ed.)p eop %%Page: 21 22 21 21 bop -59 -127 a Fp(ICMAKE)p 124 -127 1094 2 v 1119 w Fn(21)-18 -11 y Fo(\017)21 b Fq(Ne)o(xt,)16 b(the)f(c)o(ode)g(of)g (the)g(function)e(is)h(e)o(xpect)o(ed:)22 b(st)o(at)o(ement)o(s)16 b(enclosed)24 39 y(b)o(y)c Fo(f)h Fq(and)f Fo(g)p Fq(.)-18 120 y Fo(\017)21 b Fq(Following)10 b(the)h(\014r)o(st)h Fo(f)e Fq(of)h(the)h(c)o(ode)g(block,)h(loc)o(al)e(v)o(ariables)g(may)h (be)f(de-)24 170 y(\014ned.)25 b(Not)o(e)18 b(that)e Fp(icmak)o(e)h Fq(allows)e(the)h(de\014nition)f(of)g(loc)o(al)i(v)o (ariables)24 220 y(only)f(aft)o(er)h(the)f(out)o(er)i(curly)e(br)o(ac)o (e)h(of)f(the)h(function)e(c)o(ode)j(block;)g(the)24 270 y(de\014nition)12 b(within)g(any)h(block)h(of)e(st)o(at)o(ement)o (s)k(is)c(not)h(allowed)g(\(in)g(c)o(on-)24 319 y(tr)o(ast)h(t)o(o)f Fn(C)p Fq(\).)24 385 y(The)e(de\014nition)f(of)h(loc)o(al)h(v)o (ariables)f(c)o(onsist)o(s)g(of)g(the)h(v)o(ariable)f(t)o(ype,)h(one)24 435 y(or)j(mor)o(e)h(v)o(ariable)f(names)f(separ)o(at)o(ed)j(b)o(y)d(c) o(ommas)i(and)e(a)h(semic)o(olon.)24 485 y(In)d(c)o(ontr)o(ast)i(t)o(o) g Fn(C)p Fq(,)f Fp(icmak)o(e)h Fq(initializes)c(all)i(loc)o(al)i(v)o (ariables)e(t)o(o)i(zer)o(o.)-18 572 y Fp(Icmak)o(e)f Fq(does)f(not)g(allow)f(forwar)o(d)i(r)o(efer)o(enc)o(es.)18 b(This)11 b(means)g(that)i(a)f(func-)-59 621 y(tion)j(may)f(only)g(be)h (c)o(alled)f Fp(aft)o(er)h Fq(it)g(has)f(been)g(de\014ned.)22 b(Furthermor)o(e,)17 b(the)-59 671 y(st)o(at)o(ement)d(which)d(c)o (alls)g(a)h(function)f(must)h(supply)e(the)i(e)o(x)o(act)g(number)g(of) f(r)o(e-)-59 721 y(quir)o(ed)f(ar)o(gument)o(s)i(and)e(each)h(ar)o (gument)g(t)o(ype)g(must)g(mat)o(ch)h(the)f(par)o(amet)o(er)-59 771 y(list)16 b(of)h(the)g(function.)28 b(The)17 b(built-in)e (functions)g(ar)o(e)j(pr)o(ede\014ned)f(and)f(may)-59 821 y(ther)o(efor)o(e)e(be)f(used)f(anywher)o(e)g(within)g(functions.) -59 928 y Fn(The)h(user-de\014ned)g(function)h(main\(\))-59 1004 y Fq(The)d(c)o(ode)i(section)f(of)f(a)h(mak)o(e\014le)g(must)g(c)o (ont)o(ain)g(at)g(least)g(one)g(user-de\014ned)-59 1054 y(function,)20 b(c)o(alled)g Fp(main\(\))p Fq(.)37 b(The)19 b(e)o(x)o(ecution)g(of)g(a)g(mak)o(e\014le)h(st)o(art)o(s)h(at)e(this) -59 1104 y(function.)j(The)14 b(run-time)g(support)h(s)o(yst)o(em)g(of) f Fp(icmak)o(e)i Fq(\(or,)g(mor)o(e)g(e)o(x)o(actly,)-59 1154 y(the)f(e)o(x)o(ecut)o(or)h Fp(icm-e)o(x)o(ec)p Fq(\))e(pr)o(o)o(vides)h(thr)o(ee)g(ar)o(gument)o(s)h(which)d(the)i (function)-59 1203 y Fp(main\(\))g Fq(may)g(use.)23 b(The)14 b(ar)o(gument)o(s)h(ar)o(e)h(used)e(t)o(o)h(hold)g(the)f(c)o(ommand)i (line)-59 1253 y(par)o(amet)o(er)o(s)f(of)d(the)h Fp(icmak)o(e)h Fq(inv)o(oc)o(ation)f(and)f(the)h(envir)o(onment)g(setting.)-18 1303 y(The)i(thr)o(ee)g(ar)o(gument)o(s)g(ar)o(e)g(most)h(c)o(ommonly)f (r)o(eferr)o(ed)h(t)o(o)f(as)f Fp(ar)o(gc)p Fq(,)i Fp(ar)o(gv)-59 1353 y Fq(and)d Fp(envp)p Fq(.)18 b Fp(Ar)o(gc)c Fq(is)e(an)h Fp(int)g Fq(ar)o(gument,)h(holding)d(the)j(number)f(of)g(c)o(ommand)-59 1403 y(line)e(par)o(amet)o(er)o(s.)19 b Fp(Ar)o(gv)13 b Fq(is)e(a)h Fp(list)p Fq(,)f(holding)f(the)j(c)o(ommand)g(line)e(par) o(amet)o(er)o(s)-59 1452 y(themselv)o(es.)24 b Fp(Envp)15 b Fq(is)f(a)h(list)f(holding)g(the)h(envir)o(onment)g(setting.)24 b(A)15 b(de\014-)-59 1502 y(nition)d(of)g(the)h Fp(main\(\))g Fq(function)f(which)f(uses)h(all)g(ar)o(gument)o(s)h Fp(ar)o(gc)p Fq(,)g Fp(ar)o(gv)g Fq(and)-59 1552 y Fp(envp)f Fq(is)g(giv)o(en)g(below:)244 1639 y Fp(int)g(main)h(\(int)e(ar)o(gc,)i (list)e(ar)o(gv,)i(list)e(envp)p Fq(\))-59 1726 y(User)o(s)20 b(may)g(wish)f(t)o(o)i(de\014ne)e(the)h Fp(main\(\))h Fq(function)e(without)h(ar)o(gument)o(s,)-59 1776 y(when)15 b(the)h(c)o(ommand)h(line)e(par)o(amet)o(er)o(s)k(need)c(not)h(be)g(e)o (x)o(amined.)26 b(In)15 b(this)-59 1826 y(c)o(ase,)f(the)f Fp(main\(\))g Fq(function)f(c)o(an)h(be)g(de\014ned)f(as:)p eop %%Page: 22 23 22 22 bop -59 -127 a Fn(22)p -1 -127 937 2 v 961 w Fp(Act)o(a)13 b(Ic)o(cis)e(1994-1)506 -11 y(int)g(main)i(\(\))-59 82 y Fq(Also)i(it)g(is)f(possible)g(t)o(o)i(de\014ne)f(the)g Fp(main\(\))h Fq(function)e(t)o(o)i(use)f(only)f(the)h(\014r)o(st)-59 132 y(two)e(ar)o(gument)o(s)g Fp(ar)o(gc)g Fq(and)f Fp(ar)o(gv)p Fq(:)342 225 y Fp(int)f(main)i(\(int)f(ar)o(gc,)g(list)f(ar)o(gv\))-59 317 y Fq(Following)c(the)i(same)g(r)o(easoning,)g(it)f(is)g(possible)f (t)o(o)j(de\014ne)e(a)h Fp(main\(\))g Fq(function)-59 367 y(using)i(only)h(it)o(s)g(\014r)o(st)h(ar)o(gument)h Fp(ar)o(gc)p Fq(.)j(Howe)o(v)o(er,)e(this)d(does)h(not)g(seem)g(v)o(er) o(y)-59 417 y(useful,)h(sinc)o(e)h(such)f(a)g Fp(main\(\))i Fq(function)e(c)o(ould)h(inv)o(estigat)o(e)g(the)g(number)g(of)-59 467 y(c)o(ommand)k(line)e(ar)o(gument)o(s)h(but)f(would)g(not)i(be)e (able)h(t)o(o)g(inv)o(estigat)o(e)g(the)-59 516 y(ar)o(gument)o(s)13 b(themselv)o(es.)-18 567 y(A)d(sample)f(mak)o(e\014le)h(which)e(print)o (s)h(it)o(s)g(c)o(ommand)h(line)f(ar)o(gument)o(s)g(is)f(giv)o(en)-59 616 y(below)58 599 y Fj(8)74 616 y Fq(:)83 699 y Fe(void)17 b(main)g(\(int)g(argc,)f(list)h(argv\))83 738 y({)154 778 y(int)225 817 y(i;)154 896 y(for)g(\(i)h(=)f(0;)h(i)f(<)h(argc;)e (i++\))225 936 y(printf)h(\("Argument)e(",)j(i,)f(")h(is)f(",)g (element)f(\(i,)i(argv\),)e("\\n"\);)83 975 y(})-18 1107 y Fq(The)f(ar)o(gument)o(s)g(passed)f(t)o(o)h(the)g Fp(main\(\))g Fq(function)f(of)h Fp(icmak)o(e)g Fq(as)f(the)h(list)-59 1157 y Fp(ar)o(gv)e Fq(ar)o(e:)-18 1249 y Fo(\017)21 b Fq(The)f(\014r)o(st)g(ar)o(gument)g(is)f(always)g(the)h(name)g(of)f (the)h(binar)o(y)g(mak)o(e\014le)24 1299 y(which)12 b(is)g(int)o(erpr)o (et)o(ed)i(b)o(y)f Fp(icm-e)o(x)o(ec.)-18 1384 y Fo(\017)21 b Fq(R)o(emaining)d(ar)o(gument)o(s)g(ar)o(e)h Fp(only)24 b Fq(those)18 b(ar)o(gument)o(s)h(which)e(ar)o(e)i(e)o(x-)24 1433 y(plicit)o(ely)12 b(supplied)f(on)i(the)f(c)o(ommand)i(line.)-59 1526 y(E.g.,)e(t)o(o)g(supply)e(the)i(ar)o(gument)o(s)g Fp(one)p Fq(,)f Fp(two)g Fq(and)g Fp(thr)o(ee)h Fq(t)o(o)g(a)g(mak)o (e\014le)g(c)o(alled)-59 1576 y Fp(t)o(est.im)p Fq(,)h(one)f(of)h(the)f (following)f(inv)o(oc)o(ations)i(c)o(an)g(be)g(used:)326 1669 y Fp(icmak)o(e)g(t)o(est)f Ff(--)h Fp(one)f(two)g(thr)o(ee)300 1719 y(icmak)o(e)h(-i)f(t)o(est.im)g(one)g(two)g(thr)o(ee)p -59 1746 534 2 v -18 1774 a Fi(8)1 1786 y Fh(The)i(functions)g Fg(printf\(\))i Fh(and)e Fg(element\(\))i Fh(used)f(in)f(this)h(e)o(x)o (ample)f(ar)o(e)h(discussed)f(in)h(sec-)-59 1826 y(tion)9 b(3.6.)p eop %%Page: 23 24 23 23 bop -59 -127 a Fp(ICMAKE)p 124 -127 1094 2 v 1119 w Fn(23)-59 -11 y Fq(In)16 b(both)g(c)o(ases,)j(the)e(\014r)o(st)g Fp(int)e Fq(ar)o(gument)i(of)g(the)f(function)g Fp(main)h(\(\))g Fq(equals)-59 39 y(four.)k(The)14 b(\014r)o(st)g(element)h(of)f(the)g (list)f Fp(ar)o(gv)i Fq(holds)e(the)h(name)h(of)f(the)g(binar)o(y)-59 89 y(mak)o(e\014le)k(\()p Fp(t)o(est.bim)p Fq(\),)h(the)f(r)o(emaining) f(element)o(s)h(of)f Fp(ar)o(gv)h Fq(hold)e(the)i(ar)o(gu-)-59 139 y(ment)o(s)13 b Fp(one)p Fq(,)g Fp(two)e Fq(and)h Fp(thr)o(ee)p Fq(.)-18 188 y(The)i(thir)o(d)g(ar)o(gument)g(of)f Fp(main\(\))p Fq(,)i Fp(envp)p Fq(,)f(is)f(a)g(list)g(holding)f(the)i (setting)f(of)-59 238 y(the)h(envir)o(onment)h(\(the)f(envir)o(onment)h (v)o(ariables\).)21 b(An)14 b(e)o(x)o(ample)g(of)g(such)f(a)-59 288 y(v)o(ariable)d(is)f(the)i Fp(P)n(A)n(TH)f Fq(setting)g(under)g (MS-DOS,)f(which)g(det)o(ermines)i(wher)o(e)-59 338 y(the)h(oper)o (ating)g(s)o(yst)o(em)h(sear)o(ches)f(for)g(e)o(x)o(ecut)o(able)h (\014les.)i(The)d Fp(envp)g Fq(list)f(c)o(on-)-59 388 y(sist)o(s)i(of)h(pair)o(s)g(of)f(element)o(s,)j(wher)o(e)e(each)h (\014r)o(st)f(element)h(of)e(the)i(pair)e(holds)-59 437 y(the)18 b(v)o(ariable)f(name)h(\(e.g.,)h(the)f(string)f(\\P)n(A)n (TH"\))i(and)e(wher)o(e)h(the)g(sec)o(ond)-59 487 y(element)g(of)f (each)h(pair)f(holds)f(the)i(v)o(alue)e(of)i(the)f(v)o(ariable)g (\(e.g,,)j(a)d(list)g(of)-59 537 y(dir)o(ect)o(ories)d(wher)o(e)f(e)o (x)o(ecut)o(able)h(\014les)d(may)i(be)g(found\).)-18 587 y(An)g(e)o(x)o(ample)g(of)g(a)g(mak)o(e\014le)g(which)g(print)o(s)f (the)h(settings)f(of)h(envir)o(onment)-59 637 y(v)o(ariables)f(is)g (giv)o(en)g(below:)83 713 y Fe(void)17 b(main)g(\(int)g(argc,)f(list)h (argv,)g(list)g(envp\))83 752 y({)154 792 y(int)225 831 y(i;)154 910 y(for)g(\(i)h(=)f(0;)h(i)f(<)h(sizeof)e(\(envp\);)g(i)i (+=)f(2\))225 949 y(printf)g(\("variable)e(",)j(element)e(\(i,)h (envp\),)f(")i(has)f(value)g(",)350 989 y(element)f(\(i)h(+)h(1,)f (envp\)\);)83 1028 y(})-59 1183 y Fk(3.5)50 b(Expr)o(essions)17 b(and)e(oper)o(at)o(or)o(s)-59 1259 y Fp(Icmak)o(e)i Fq(allows)f(a)h(lar)o(ge)g(number)f(of)g(oper)o(at)o(ors)j(t)o(o)e (form)g(or)g(c)o(ombine)g(e)o(x-)-59 1309 y(pr)o(essions.)27 b(Each)17 b(oper)o(at)o(or)i(has)d(it)o(s)g(own)h(char)o(act)o(eristic) o(s,)j(which)c(ar)o(e)h(the)-59 1359 y(following:)-18 1446 y Fo(\017)k Fq(The)14 b(number)g(of)g(oper)o(ands)h(which)e(an)h (oper)o(at)o(or)j(uses)c(may)i(be)f(two)h(or)24 1495 y(one.)23 b(In)14 b(analogy)g(t)o(o)i Fn(C)p Fq(,)f Fp(icmak)o(e)h Fq(r)o(ec)o(ognizes)f(binar)o(y)g(or)g(unar)o(y)g(oper)o(a-)24 1545 y(t)o(or)o(s.)-18 1626 y Fo(\017)21 b Fq(Each)d(binar)o(y)f(oper)o (at)o(or)j(must)d(be)g(used)g(with)g(two)h(v)o(ariables)f(or)h(c)o(on-) 24 1676 y(st)o(ant)o(s)c(of)e(the)i(same)f(t)o(ype.)18 b(E.g.,)c(the)f(addition)g(of)f(an)h Fp(int)f Fq(and)h(a)g Fp(string)24 1726 y Fq(is)k(not)i(allowed:)27 b Fp(icmak)o(e)19 b Fq(performs)f(no)g(default)g(t)o(ype)h(c)o(asting.)32 b(The)24 1776 y(oper)o(and)10 b(t)o(ypes)f(for)h(which)e(oper)o(at)o (or)o(s)k(ar)o(e)e(allowed)g(is)e(giv)o(en)g(in)h(\014gur)o(e)g(2.)24 1826 y(The)k(shown)e(matrix)i(shows)f(which)g(t)o(ypes)h(may)f(use)g (which)g(oper)o(at)o(or)o(s.)p eop %%Page: 24 25 24 24 bop -59 -127 a Fn(24)p -1 -127 937 2 v 961 w Fp(Act)o(a)13 b(Ic)o(cis)e(1994-1)p 365 -13 2 40 v 433 -25 a Fc(int)p 540 -13 V 140 w(string)p 777 -13 V 146 w(list)p 969 -13 V 226 -11 744 2 v 365 28 2 40 v 403 16 a Fg(all)f(but)p 540 28 V 777 28 V 969 28 V 365 68 V 406 56 a Fh(newer)p 540 68 V 777 68 V 969 68 V 251 95 a Fc(int)p 365 107 V 120 w Fh(older)p 540 107 V 148 w(|)p 777 107 V 181 w(|)p 969 107 V 365 146 V 391 135 a(y)o(ounger)p 540 146 V 777 146 V 969 146 V 365 186 V 540 186 V 777 186 V 969 186 V 226 188 744 2 v 365 227 2 40 v 540 227 V 589 215 a(==)g(!=)f Fa(>)p 777 227 V 969 227 V 365 266 V 540 266 V 582 255 a(<)h(<)p Fh(=)g Fa(>)p Fh(=)p 777 266 V 969 266 V 251 294 a Fc(string)p 365 306 V 97 w Fh(|)p 540 306 V 126 w(+)g(+=)f(=)p 777 306 V 134 w(|)p 969 306 V 365 345 V 540 345 V 566 333 a(newer)h(older)p 777 345 V 969 345 V 365 385 V 540 385 V 597 373 a(y)o(ounger)p 777 385 V 969 385 V 226 386 744 2 v 365 426 2 40 v 540 426 V 777 426 V 969 426 V 365 465 V 540 465 V 777 465 V 823 453 a(==)f(!=)p 969 465 V 251 493 a Fc(list)p 365 505 V 138 w Fh(|)p 540 505 V 173 w(|)p 777 505 V 171 w(+)h({)p 969 505 V 365 544 V 540 544 V 777 544 V 803 532 a(+=)f({=)g(=)p 969 544 V 365 584 V 540 584 V 777 584 V 969 584 V 226 585 744 2 v 219 615 a(Figur)o(e)h(2:)k(The)c(oper)o (and)e(matrix)i(for)f(binar)o(y)h(oper)o(at)o(or)o(s)-18 739 y Fo(\017)21 b Fq(Some)16 b(oper)o(at)o(or)o(s,)i(unar)o(y)d(and)g (binar)o(y,)h(may)f(not)h(be)f(used)f(with)h(some)24 789 y(t)o(ypes.)h(E.g.,)c(string)f(subtr)o(action)i(is)d(not)i (allowed,)h(but)e(string)g(addition)24 839 y(is.)-18 917 y Fo(\017)21 b Fq(The)15 b(oper)o(at)o(or)o(s)j(hav)o(e)d(a)g(c)o (ert)o(ain)h(priorit)o(y:)22 b(some)16 b(oper)o(at)o(or)o(s)h(ar)o(e)f (e)o(v)o(al-)24 967 y(uat)o(ed)i(befor)o(e)g(other)o(s.)32 b(The)18 b(priorit)o(y)g(of)f(oper)o(at)o(or)o(s)j(is)d(analogous)f(t)o (o)24 1016 y Fn(C)p Fq(.)-18 1096 y(The)f(binar)o(y)f(oper)o(at)o(or)o (s)i(r)o(ec)o(ognized)g(b)o(y)e Fp(icmak)o(e)h Fq(ar)o(e)g(summarized)f (in)g(\014g-)-59 1145 y(ur)o(e)20 b(3.)38 b(All)20 b(binar)o(y)f(oper)o (at)o(or)o(s)k(with)c(the)h(e)o(x)o(c)o(eption)h(of)f(the)g(assignment) -59 1195 y(oper)o(at)o(or)o(s)f(ar)o(e)f(left-associativ)o(e.)30 b(The)16 b(assignment)g(oper)o(at)o(or)o(s)k(ar)o(e)d(right-)-59 1245 y(associativ)o(e.)27 b(The)15 b(oper)o(at)o(ors)j(at)e(the)g(t)o (op)h(of)e(this)g(\014gur)o(e)h(hav)o(e)f(the)h(lowest)-59 1295 y(priorit)o(y;)h(the)e(oper)o(at)o(or)o(s)i(at)f(the)f(bott)o(om)i (of)e(this)f(\014gur)o(e)h(hav)o(e)g(the)g(highest)-59 1345 y(priorit)o(y.)i(Oper)o(at)o(or)o(s)e(with)e(di\013er)o(ent)g (priorit)o(y)g(ar)o(e)h(separ)o(at)o(ed)g(b)o(y)e(lines.)-18 1394 y(The)19 b(unar)o(y)g(oper)o(at)o(or)o(s)j(ar)o(e)e(summarized)f (in)f(t)o(able)h(4.)36 b(The)19 b(unar)o(y)g(op-)-59 1444 y(er)o(at)o(or)o(s)j(hav)o(e)e(higher)f(priorit)o(y)i(than)f (binar)o(y)g(oper)o(at)o(or)o(s,)25 b(and)19 b(ar)o(e)i(right-)-59 1494 y(associativ)o(e.)f(The)14 b(e)o(x)o(c)o(eption)g(is)f(the)g(e)o (xpr)o(ession-nesting)e(oper)o(at)o(or,)17 b(which)-59 1544 y(surr)o(ounds)12 b(an)g(e)o(xpr)o(ession)g(and)g(does)g(not)h (associat)o(e.)-59 1649 y Fn(Logical)e(operators)-59 1726 y Fp(Icmak)o(e)16 b Fq(r)o(ec)o(ognizes)g(thr)o(ee)h(logic)o(al)e (oper)o(at)o(or)o(s:)25 b(the)15 b(logic)o(al)g(and)g(\(&&\),)j(the)-59 1776 y(logic)o(al)c(or)h(\()p Fo(jj)p Fq(\))f(and)g(the)g(logic)o(al)g (not)h(\(!\).)22 b(These)14 b(oper)o(at)o(or)o(s)j(c)o(an)e(be)f(used)f (t)o(o)-59 1826 y(c)o(ombine)g(or)g(r)o(e)o(v)o(er)o(se)i(logic)o(al)d (e)o(xpr)o(essions.)p eop %%Page: 25 26 25 25 bop -59 -127 a Fp(ICMAKE)p 124 -127 1094 2 v 1119 w Fn(25)p 92 89 1014 2 v 168 116 a Fc(Operator)100 b(Operation)243 b(Allowed)10 b(types)p 92 130 V 232 157 a Fh(,)165 b(sequential)9 b(e)o(v)o(aluation)63 b(all)10 b(\(mix)o(ed\))p 92 171 V 224 198 a(=)157 b(assignment)221 b(all)130 238 y({=)9 b(+=)g Fb(\003)p Fh(=)h(/=)63 b(c)o(ompound)8 b(assignment)49 b(arithm.)10 b(oper)o(at)o(or)o(s)160 277 y(\045=)f(&=)h Fb(j)p Fh(=)214 317 y(^)f(=)p 92 330 V 227 358 a Fb(jj)161 b Fh(logic)o(al)10 b(or)254 b(all)10 b(\(mix)o(ed\))p 92 371 V 212 399 a(&&)146 b(logic)o(al)10 b(and)230 b(all)10 b(\(mix)o(ed\))p 92 412 V 232 440 a Fb(j)166 b Fh(bitwise)10 b(or)241 b Fg(int)p 92 454 V 232 481 a Fh(^)165 b(e)o(x)o(clusiv)o(e)10 b(or)215 b Fg(int)p 92 495 V 225 522 a Fh(&)158 b(bitwise)10 b(and)217 b Fg(int)p 92 536 V 142 563 a Fa(<)10 b(>)g(<)p Fh(=)f Fa(>)p Fh(=)75 b(c)o(omparison)216 b Fg(int,)10 b(string)116 603 y Fh(newer,)g(y)o(ounger)49 b(\014le)10 b(dat)o(e)271 b Fg(string)197 642 y Fh(older)129 b(\014le)10 b(dat)o(e)271 b Fg(string)p 92 656 V 210 683 a Fa(<<)144 b Fh(left)o(shift)277 b Fg(int)210 723 y Fa(>>)144 b Fh(right)o(shift)p 92 736 V 224 764 a(+)157 b(addition)266 b(all)229 803 y({)162 b(subtr)o(action)220 b Fg(int,)10 b(list)p 92 817 V 228 844 a Fb(\003)162 b Fh(multiplic)o(ation)179 b Fg(int)229 884 y Fh(/)162 b(division)274 b Fg(int)227 923 y Fh(\045)160 b(modulo)277 b Fg(int)p 92 937 V 306 967 a Fh(Figur)o(e)10 b(3:)k(Ov)o(er)o(view)d(of)f(binar)o(y)g(oper)o (at)o(or)o(s)p 172 1289 853 2 v 197 1317 a Fc(Operator)48 b(Operation)182 b(Allowed)10 b(types)p 172 1330 V 260 1358 a Fh(!)112 b(logic)o(al)10 b(not)174 b(all)261 1397 y(~)113 b(bitwise)11 b(not)160 b Fg(int)253 1437 y Fh(+)105 b(unar)o(y)10 b(plus)172 b(all)258 1476 y({)110 b(unar)o(y)10 b(minus)142 b Fg(int)240 1516 y Fh(++)91 b(incr)o(ement)179 b Fg(int)10 b Fh(\(v)o(ariable)h(only\))245 1555 y({)e({)97 b(decr)o(ement)171 b Fg(int)10 b Fh(\(v)o(ariable)h(only\))220 1594 y(\()p Fg(t)o(ype)p Fh(\))75 b(t)o(ype)11 b(c)o(ast)197 b(see)10 b(3.5)250 1634 y(\()g(\))103 b(e)o(xpr)o(ession)9 b(nesting)49 b(all)p 172 1647 V 311 1677 a(Figur)o(e)10 b(4:)k(Ov)o(er)o(view)e(of)d(unar)o(y)g(oper)o(at)o(or)o(s)p eop %%Page: 26 27 26 26 bop -59 -127 a Fn(26)p -1 -127 937 2 v 961 w Fp(Act)o(a)13 b(Ic)o(cis)e(1994-1)-18 -11 y Fq(The)i(logic)o(al)f(not)h(oper)o(at)o (or)i(r)o(e)o(v)o(er)o(ses)f(the)f(logic)o(al)g(out)o(c)o(ome)i(of)d (an)g(e)o(xpr)o(es-)-59 39 y(sion.)k(The)c(logic)o(al)g(and)g(oper)o (at)o(or)j(and)d(the)g(logic)o(al)g(or)h(oper)o(at)o(or)i(gr)o(oup)d(c) o(on-)-59 89 y(ditions.)j Fp(Icmak)o(e)10 b Fq(e)o(v)o(aluat)o(es)g(a)f (c)o(ombined)g(c)o(ondition)h(using)d(these)i(oper)o(at)o(or)o(s)-59 139 y(until)i(the)i(out)o(c)o(ome)i(of)e(the)f(c)o(ondition)h(is)f(det) o(ermined,)i(in)e(analogy)g(t)o(o)h Fn(C)p Fq(:)-18 236 y Fo(\017)21 b Fq(In)16 b(the)h(c)o(ondition)g Fp(c1)f(&&)i(c2)p Fq(,)f Fp(c2)f Fq(is)g(not)h(e)o(v)o(aluat)o(ed)h(if)e Fp(c1)g Fq(yields)f(zer)o(o)24 286 y(sinc)o(e)f(when)g Fp(c1)f Fq(yields)g(zer)o(o,)k(the)d(c)o(ombined)h(c)o(ondition)g(c)o (an)g(only)f(fail.)24 335 y(Ther)o(efor)o(e,)h Fp(c2)d Fq(is)f(only)h(e)o(v)o(aluat)o(ed)i(if)e Fp(c1)f Fq(yields)h(not)h(zer) o(o.)-18 424 y Fo(\017)21 b Fq(In)13 b(the)h(c)o(ondition)g Fp(c1)f Fo(jj)g Fp(c2)p Fq(,)h Fp(c2)f Fq(is)g(not)h(e)o(v)o(aluat)o (ed)h(if)e Fp(c1)g Fq(yields)f(not)i(zer)o(o)24 474 y(sinc)o(e)h(when)g Fp(c1)g Fq(yields)f(not)h(zer)o(o,)j(the)e(c)o(ombined)g(c)o(ondition)f (c)o(an)h(only)24 524 y(suc)o(c)o(eed.)i(Ther)o(efor)o(e,)c Fp(c2)e Fq(is)g(only)g(e)o(v)o(aluat)o(ed)i(if)d Fp(c1)h Fq(yields)f(zer)o(o.)-59 621 y(This)h(is)f(illustr)o(at)o(ed)i(in)f (the)h(following)e(c)o(ode)i(fr)o(agment:)83 709 y Fe(if)k(\(exists)g (\("main.c"\))e(&&)j(exists)e(\("main.exe"\)\))154 748 y(print)h(\(0,)g("main.c)f(and)h(main.exe)f(both)h(found.\\n"\);)83 788 y(if)g(\(exists)g(\("main.c"\))e(||)j(exists)e(\("main.exe"\)\))154 827 y(print)h(\(0,)g("main.c)f(exists,\\n",)332 867 y("or)h(main.c)g (not)g(found)f(but)h(main.exe)f(found.\\n"\);)-18 1003 y Fq(Logic)o(al)j(oper)o(at)o(or)o(s)i(may)e(be)g(used)e(with)h(any)h (t)o(ype)g(of)f(e)o(xpr)o(ession.)34 b(An)-59 1053 y Fp(int)17 b Fq(c)o(onst)o(ant)j(or)f(v)o(ariable)g(yields)e(it)o(s)i (int)o(eger)f(r)o(epr)o(esent)o(ation.)37 b(A)19 b Fp(string)-59 1103 y Fq(c)o(onst)o(ant)d(or)g(v)o(ariable)f(yields)f(not)h(zer)o(o)h (when)f(the)g(length)f(of)h(the)g(string)f(is)-59 1153 y(non-zer)o(o;)f(e.g.,)f(string)g Fp("a")h Fq(yields)e(not)i(zer)o(o.) -18 1204 y(A)19 b Fp(list)f Fq(or)h(v)o(ariable)g(yields)e(not)i(zer)o (o)h(when)e(the)h(number)f(of)h(strings)e(in)-59 1254 y(the)e(list)e(is)h(not)h(zer)o(o.)23 b(E.g.,)15 b(in)e(the)i (following)e(c)o(ode)i(fr)o(agment)g(the)g(making)-59 1304 y(pr)o(oc)o(ess)f(is)d(st)o(opped)i(when)f(no)h(\014les)e(with)i (e)o(xt)o(ension)f Fp(".c")g Fq(ar)o(e)h(found:)83 1392 y Fe(list)154 1431 y(cfiles;)83 1510 y(//)18 b(cfiles)e(is)h(set)g(to)h (hold)f(all)g(filenames)e(with)i(extension)f(.c)83 1550 y(cfiles)h(=)g(makelist)f(\("*.c"\);)83 1589 y(//)i(if)f(no)g(such)g (files)g(found...)f(terminate!)83 1628 y(if)h(\(!)h(cfiles\))83 1668 y({)154 1707 y(print)f(\(0,)g("No)g(files)g(with)g(extension)e(.c) j(found!!\\n"\);)154 1747 y(exit)f(\(1\);)83 1786 y(})p eop %%Page: 27 28 27 27 bop -59 -127 a Fp(ICMAKE)p 124 -127 1094 2 v 1119 w Fn(27)-59 -11 y(Special)12 b(operators)-59 66 y Fq(In)g(addition)h(t) o(o)i(the)f(oper)o(at)o(or)o(s)i(of)d(the)g Fn(C)h Fq(pr)o(ogr)o (amming)g(language,)e Fp(icmak)o(e)-59 115 y Fq(r)o(ec)o(ognizes)h(a)g (few)f(`special')g(oper)o(at)o(or)o(s.)19 b(These)13 b(ar)o(e:)-18 202 y Fo(\017)21 b Fq(The)13 b Fp(y)o(ounger)f Fq(oper)o(at)o(or)k(is)c(used)g(t)o(o)i(c)o(ompar)o(e)h(two)e(strings)f (which)g(r)o(ep-)24 251 y(r)o(esent)18 b(\014lenames.)32 b(An)17 b(e)o(xpr)o(ession)g(using)f Fp(y)o(ounger)h Fq(is)g(e)o(v)o(aluat)o(ed)h(t)o(o)24 301 y(non-zer)o(o)d(or)g(zer)o(o) h(and)e(may)h(be)g(used)f(in)g(a)h(c)o(ondition.)23 b(The)15 b(oper)o(at)o(or)24 351 y Fp(newer)e Fq(is)f(an)g(alias)g(for)h Fp(y)o(ounger)p Fq(.)24 416 y(The)k(e)o(xpr)o(ession)f(using)e(the)j Fp(y)o(ounger)g Fq(oper)o(at)o(or)i(yields)c(non-zer)o(o)j(if)d(a)24 466 y(\014le)10 b(with)h(the)g(name)g(r)o(epr)o(esent)o(ed)i(b)o(y)d (the)h(left)g(oper)o(and)g(is)f(mor)o(e)j(r)o(ec)o(ent)24 516 y(than)f(the)h(\014le)f(r)o(epr)o(esent)o(ed)j(b)o(y)d(the)h(right) f(oper)o(and.)24 582 y(E.g.,)18 b(the)e(following)f(c)o(ode)j(print)o (s)e(a)h(message)f(if)g(\014le)g Fp(main.c)g Fq(is)g(mor)o(e)24 631 y(r)o(ec)o(ent)e(than)f Fp(main.e)o(x)o(e)p Fq(:)237 723 y Fe(if)18 b(\("main.c")d(newer)i("main.exe"\))308 762 y(printf)g(\("main.c)f(is)h(more)g(recent)g(than)f(main.exe\\n"\);) -18 903 y Fo(\017)21 b Fq(The)14 b Fp(older)f Fq(oper)o(and)h(c)o (ompar)o(es)i(two)e(\014les)e(and)i(yields)e(non-zer)o(o)i(if)e(the)24 953 y(\014le)i(r)o(epr)o(esent)o(ed)j(b)o(y)d(the)h(left)g(oper)o(and)g (is)f(older)h(than)g(the)g(\014le)f(r)o(epr)o(e-)24 1003 y(sent)o(ed)f(b)o(y)f(the)h(right)f(oper)o(and.)-59 1089 y(When)g(the)g(dat)o(e)h(of)f(a)g(\014le)g(is)f(c)o(ompar)o(ed)j(using) c Fp(older)i Fq(or)h Fp(y)o(ounger)f Fq(and)f(when)-59 1139 y(no)g(\014le)g(with)g(such)f(a)i(name)f(is)g(pr)o(esent,)h(then)f (the)h(age)f(if)f(the)i(\014le)f(is)f(assumed)-59 1189 y(t)o(o)16 b(be)g(in\014nit)o(e.)24 b(A)15 b(c)o(onsequenc)o(e)h(of)f (this)g(implement)o(ation)h(is)f(that,)i(in)d(the)-59 1239 y(following)c(c)o(ode)i(e)o(x)o(ample,)g(a)g(message)f(is)g (display)o(ed)f(if)g Fp("t)o(est.e)o(x)o(e")i Fq(does)f(not)-59 1288 y(e)o(xist:)83 1364 y Fe(if)17 b(\("test.c")f(younger)g ("test.exe"\))154 1404 y(printf)h(\("test.c)f(should)g(be)h (compiled!!\\n"\);)-59 1550 y Fn(Type)12 b(casts)-59 1626 y Fq(Though)d Fp(icmak)o(e)i Fq(does)f(not)g(allow)g(the)g(use)f (of)h(oper)o(at)o(or)o(s)i(on)e(di\013er)o(ent)h(t)o(ypes,)-59 1676 y(a)k(possibilit)o(y)f(c)o(onsist)o(s)i(of)f(the)g(c)o(onv)o(er)o (sion)i(of)e(one)g(t)o(ype)h(t)o(o)h(another.)25 b(The)-59 1726 y(c)o(onv)o(er)o(sion)13 b(of)g(a)g(t)o(ype)g(is)e(r)o(eferr)o(ed) j(t)o(o)g(as)e(`t)o(ype)h(c)o(ast'.)-18 1776 y(T)o(ype)j(c)o(ast)o(s)g (ar)o(e)g(denot)o(ed)h(b)o(y)e(a)g(t)o(ype)h(name)f(in)g(par)o (entheses)g(befor)o(e)h(the)-59 1826 y(oper)o(and)11 b(which)f(should)f(be)h(c)o(onv)o(ert)o(ed.)18 b(E.g.,)11 b Fp(\(int\)x)f Fq(c)o(onv)o(ert)o(s)i(the)f(oper)o(and)p eop %%Page: 28 29 28 28 bop -59 -127 a Fn(28)p -1 -127 937 2 v 961 w Fp(Act)o(a)13 b(Ic)o(cis)e(1994-1)-59 -11 y(x)i Fq(t)o(o)i(int)o(eger)g(r)o(epr)o (esent)o(ation.)22 b(T)o(ype)15 b(c)o(ast)o(s)f(ar)o(e)h(not)g(allowed) e(on)h(all)f(t)o(ypes;)-59 39 y(e.g.,)g(a)f(list)g(v)o(ariable)h(c)o (an)g(not)g(be)f(c)o(onv)o(ert)o(ed)j(t)o(o)f Fp(int)p Fq(.)-59 93 y(Allowed)f(t)o(ype)g(c)o(ast)o(s)g(ar)o(e)h(the)f (following:)-18 201 y Fo(\017)21 b Fq(An)c(int)o(eger)g(may)h(be)f(c)o (ast)h(t)o(o)g Fp(string)p Fq(.)29 b(E.g.,)18 b(in)f(the)g(following)e (listing)24 251 y Fp(stringv)o(ar)e Fq(is)f(assigned)f(t)o(o)j(hold)e (the)h(t)o(e)o(xt)h(r)o(epr)o(esent)o(ation)h(of)e(the)g(v)o(alue)24 301 y Fp(14)p Fq(.)237 419 y Fe(string)308 459 y(stringvar;)237 538 y(stringvar)j(=)i(\(string\))e(14;)141 b(//)18 b(now,)e(stringvar)g (is)i("14")-18 706 y Fo(\017)j Fq(A)13 b(string)e(may)i(be)f(c)o(ast)i (t)o(o)f Fp(int)p Fq(.)j(This)11 b(is)h(the)h(r)o(e)o(v)o(er)o(se)h (action)f(of)f(the)h(t)o(ype)24 756 y(c)o(ast)h(shown)d(in)h(the)h (listing)e(abo)o(v)o(e.)-18 856 y Fo(\017)21 b Fq(A)c(string)g(may)g (be)g(c)o(ast)i(t)o(o)f(a)f Fp(list)p Fq(.)29 b(This)16 b(may)i(be)f(particularly)g(useful)24 905 y(when)11 b(\014lenames)h (should)f(be)h(added)g(t)o(o)h(or)g(r)o(emo)o(v)o(ed)h(fr)o(om)e(a)h (list.)i(E.g.,)24 955 y(in)f(the)h(listing)e(below)i(the)g(\014lename)g Fp("main.c")f Fq(\(a)i Fp(string)p Fq(\))e(is)g(r)o(emo)o(v)o(ed)24 1005 y(fr)o(om)f(the)g(list)f Fp(c\014les)p Fq(:)237 1124 y Fe(list)308 1163 y(cfiles;)237 1242 y(//)18 b(cfiles)e(is)h(set) h(to)f(hold)g(a)g(list)g(of)237 1281 y(//)h(all)f(filenames)f(with)g (extension)g(.c)237 1321 y(cfiles)h(=)g(makelist)f(\("*.c"\);)237 1360 y(//)i(filename)e(main.c)g(is)h(removed)g(from)g(the)g(list)237 1400 y(cfiles)g(-=)g(\(list\))g("main.c";)24 1568 y Fq(Not)o(e)d(that)e (the)g(string)f Fp("main.c")h Fn(must)h Fq(be)e(c)o(onv)o(ert)o(ed)k(t) o(o)e(a)f Fp(list)e Fq(t)o(ype)i(t)o(o)24 1618 y(allow)g(the)h(subtr)o (action)h(fr)o(om)f(the)g(list.)-59 1726 y(Other)j(t)o(ypec)o(ast,)i (speci\014c)o(ally)d(fr)o(om)h(a)f(string)f(t)o(o)i(an)f Fh(ASCII)p Fq(-r)o(epr)o(esent)o(ation,)-59 1776 y(c)o(an)g(be)g(r)o (ealized)g(thr)o(ough)f(specialized)g(functions)g(\(see,)i(e.g.,)f(the) g(function)-59 1826 y Fp(ascii\(\))p Fq(.\))p eop %%Page: 29 30 29 29 bop -59 -127 a Fp(ICMAKE)p 124 -127 1094 2 v 1119 w Fn(29)-59 -11 y Fk(3.6)50 b(Built-in)16 b(functions)-59 66 y Fq(Built)11 b(int)o(o)h Fp(icmak)o(e)h Fq(is)d(a)i(number)g(of)f (functions)g(which)f(may)i(be)g(used)f(t)o(o)i(per-)-59 115 y(form)d(special)f(oper)o(ations,)j(such)c(as)h(sc)o(anning)g(a)g (dir)o(ect)o(or)o(y)j(for)e(\014les,)f(display-)-59 165 y(ing)i(information,)i(et)o(c..)18 b(This)12 b(section)h(describes)f (all)g(built-in)f(functions.)-59 270 y Fn(arghead)-59 346 y Fp(\(int\))f(ar)o(ghead)i(\(string\):)22 b Fq(This)10 b(function)g(set)o(s)h(the)f(ar)o(gument)i(head)e(t)o(o)i Fp(string)p Fq(.)-59 396 y(See)g Fp(e)o(x)o(ec\(\))i Fq(and)e Fp(e)o(x)o(ecut)o(e\(\))p Fq(.)-59 500 y Fn(argtail)-59 577 y Fp(\(int\))k(ar)o(gt)o(ail)h(\(string\):)31 b Fq(This)15 b(function)h(set)o(s)h(the)g(ar)o(gument)g(t)o(ail)f(t)o(o)i Fp(string)p Fq(.)-59 627 y(See)12 b Fp(e)o(x)o(ec\(\))i Fq(and)e Fp(e)o(x)o(ecut)o(e\(\))p Fq(.)-59 731 y Fn(ascii)-59 807 y Fp(\(int\))g(ascii)g(\(string\):)17 b Fq(This)12 b(function)g(r)o(eturns)i(the)f Fh(ASCII)p Fq(-number)g(of)g(the)g (\014r)o(st)-59 857 y(char)o(act)o(er)g(in)c(the)i(string,)f(supplied)e (as)i(ar)o(gument.)17 b(E.g.,)11 b Fp(ascii)e(\("A"\))i Fq(r)o(eturns)-59 907 y(65.)-59 1011 y Fn(ascii)-59 1088 y Fp(\(string\))i(ascii)f(\(int\):)18 b Fq(The)13 b(o)o(v)o(erloaded)i (function,)f(which)e(e)o(xpect)o(s)i(an)f Fp(int)f Fq(ar-)-59 1138 y(gument,)17 b(r)o(eturns)f(a)h(string)e(r)o(epr)o(esent)o(ation)j (of)e(a)g(numeric)g Fh(ASCII)h Fq(number.)-59 1187 y(E.g.,)c Fp(ascii)e(\(65\))i Fq(r)o(eturns)g("A".)-59 1292 y Fn(change)p 75 1292 13 2 v 16 w(base)-59 1368 y Fp(\(string\))f(change)p 231 1368 V 15 w(base)h(\(string,)f(string\):)23 b Fq(This)12 b(function)g(changes)h(the)g(base-)-59 1418 y(name)f(in)e(the)i(string) e(which)h(is)f(supplied)g(as)h(it)o(s)g(\014r)o(st)h(ar)o(gument)g(t)o (o)g(the)g(base-)-59 1468 y(name)20 b(which)e(is)h(supplied)f(as)h(sec) o(ond)h(ar)o(gument.)37 b(The)20 b(string)e(with)h(the)-59 1518 y(changed)12 b(basename)h(is)f(r)o(eturned.)-18 1567 y(Ex)o(ample:)154 1628 y Fe(string)225 1668 y(name;)154 1747 y(name)17 b(=)h(change_base)d(\("main.c",)h("test"\);)154 1786 y(//)i(name)e(now)i(is)f("test.c")p eop %%Page: 30 31 30 30 bop -59 -127 a Fn(30)p -1 -127 937 2 v 961 w Fp(Act)o(a)13 b(Ic)o(cis)e(1994-1)-59 -11 y Fn(change)p 75 -11 13 2 v 16 w(e)o(xt)-59 66 y Fp(\(string\))j(change)p 233 66 V 14 w(e)o(xt)g(\(string,)f(string\):)27 b Fq(This)13 b(function)h(changes)g(the)h(e)o(xt)o(en-)-59 116 y(sion)h(in)g(the)h (string)f(which)h(is)f(supplied)f(as)i(it)o(s)g(\014r)o(st)g(ar)o (gument)g(t)o(o)h(the)f(e)o(x-)-59 165 y(t)o(ension)12 b(which)f(is)g(supplied)f(as)h(sec)o(ond)i(ar)o(gument.)k(The)12 b(modi\014ed)f(string)g(is)-59 215 y(r)o(eturned.)-18 265 y(The)h(e)o(xt)o(ension)g(\(the)g(sec)o(ond)g(ar)o(gument\))h(may)f (be)g(speci\014ed)f(as)h(an)g(empt)o(y)-59 315 y(string)f(\(""\);)i(in) e(this)h(c)o(ase)g Fp(change)p 525 315 V 15 w(e)o(xt\(\))g Fq(r)o(emo)o(v)o(es)h(the)g(e)o(xt)o(ension.)j(Also,)c(the)-59 365 y(e)o(xt)o(ension)h(may)g(be)h(speci\014ed)f(as)g(one)g(dot)h (\("."\);)h(in)d(this)h(c)o(ase)h Fp(change)p 1176 365 V 15 w(e)o(xt\(\))-59 414 y Fq(r)o(emo)o(v)o(es)g(the)f(e)o(xt)o (ension)f(but)g(leav)o(es)h(the)g(dot.)-18 464 y(Ex)o(ample:)154 545 y Fe(char)225 585 y(name;)154 664 y(name)k(=)h(rss_changeExt)d (\("main.c",)h("obj"\);)154 703 y(//)i(name)e(now)i(is)f("main.obj")154 743 y(name)g(=)h(rss_changeExt)d(\(name,)i(""\);)154 782 y(//)h(name)e(now)i(is)f("main")154 821 y(name)g(=)h(rss_changeExt)d (\(name,)i("."\);)154 861 y(//)h(name)e(now)i(is)f("main.")-59 1008 y Fn(change)p 75 1008 V 16 w(path)-59 1085 y Fp(\(string\))d (change)p 233 1085 V 15 w(path)g(\(string,)g(string\):)28 b Fq(This)14 b(function)g(changes)g(the)h(path)-59 1135 y(in)c(the)i(string)e(which)h(is)f(supplied)g(as)h(it)o(s)g(\014r)o(st) g(ar)o(gument)h(t)o(o)g(the)g(path)f(which)-59 1184 y(is)g(supplied)f (as)h(sec)o(ond)h(ar)o(gument.)-18 1234 y(Ex)o(ample:)154 1315 y Fe(string)225 1355 y(name;)154 1434 y(name)k(=)h(change_path)d (\("c:/prog/c/prog)o(.c",)f("/bin"\);)154 1473 y(//)k(name)e(now)i(is)f ("c:/bin/prog.c")154 1512 y(name)g(=)h(change_path)d(\(name,)h(""\);) 154 1552 y(//)i(name)e(now)i(is)f("c:prog.c")-59 1699 y Fn(chdir)-59 1776 y Fp(\(string\))f(chdir)f(\(int,)h(string\):)30 b Fq(This)16 b(function)f(changes)h(the)g(curr)o(ent)i(work-)-59 1826 y(ing)d(dir)o(ect)o(or)o(y)k(t)o(o)f(the)f(supplied)e(name.)29 b(The)16 b(\014r)o(st)h Fp(int)f Fq(ar)o(gument)h(may)f(be)p eop %%Page: 31 32 31 31 bop -59 -127 a Fp(ICMAKE)p 124 -127 1094 2 v 1119 w Fn(31)-59 -11 y Fp(P)p -29 -11 13 2 v 14 w(CHECK)16 b Fq(or)f Fp(P)p 228 -11 V 15 w(NOCHECK)p Fq(.)g(This)f(ar)o(gument)i (is)e(optional;)i(when)e(absent,)-59 39 y Fp(P)p -29 39 V 14 w(CHECK)i Fq(is)e(assumed.)23 b(Failur)o(e)15 b(t)o(o)h(change)f(the)g(working)g(dir)o(ect)o(or)o(y)i(with)-59 89 y(the)11 b(pr)o(esenc)o(e)h(of)e Fp(P)p 273 89 V 15 w(CHECK)h Fq(leads)f(t)o(o)i(the)f(t)o(ermination)g(of)g(the)g(making)f (pr)o(o-)-59 139 y(c)o(ess.)-18 188 y(When)k(the)f(pr)o(oc)o(essing)g (of)h(the)f(mak)o(e\014le)h(t)o(erminat)o(es)h(the)f(original)e(dir)o (ec-)-59 238 y(t)o(or)o(y)i(is)e(r)o(est)o(or)o(ed.)-18 288 y(A)19 b(string)f(c)o(ont)o(aining)g(the)g(new)g(working)g(dir)o (ect)o(or)o(y,)23 b(always)18 b(ending)e(in)-59 338 y(a)f(dir)o(ect)o (or)o(y)i(separ)o(at)o(or)349 320 y Fj(9)382 338 y Fq(is)c(r)o (eturned.)24 b(The)15 b Fp(string)21 b Fq(ar)o(gument)15 b(may)g(t)o(ermi-)-59 388 y(nat)o(e)d(in)f(a)h(\014nal)f (\(back\)slash.)17 b(The)11 b(r)o(eturned)i(string)e(c)o(an)h(be)g (used)f(t)o(o)i(inspect)-59 437 y(whether)j(the)f(r)o(equest)o(ed)i (dir)o(ect)o(or)o(y)g(is)e(r)o(eached,)j(giv)o(en)c(that)i(the)g (modi\014er)-59 487 y Fp(P)p -29 487 V 14 w(NOCHECK)d Fq(is)f(supplied)f(as)h(\014r)o(st)h(ar)o(gument.)-59 537 y(T)o(wo)g(special)g(string)e(ar)o(gument)o(s)i(ar)o(e)h(r)o(ec)o (ognized)f(b)o(y)g Fp(chdir)e(\(\))p Fq(:)-18 620 y Fo(\017)21 b Fq(A)16 b(dir)o(ect)o(or)o(y)i(ar)o(gument)e(which)f(c)o(onsist)o(s)h (of)f(one)h(dot)g(\(i.e.,)h(the)f(string)24 669 y("."\))g(c)o(auses)11 b Fp(icmak)o(e)h Fq(t)o(o)g(change)e(t)o(o)i(the)f(curr)o(ent)h(dir)o (ect)o(or)o(y.)18 b(The)11 b(r)o(eturn)24 719 y(v)o(alue)h(is)g(then)g (a)h(string)f(holding)f(the)h(curr)o(ent)i(dir)o(ect)o(or)o(y.)-18 799 y Fo(\017)21 b Fq(A)10 b(dir)o(ect)o(or)o(y)j(ar)o(gument)e(which)e (is)h(an)g(empt)o(y)h(string)e(\(i.e.,)i(the)g(string)e(""\))24 849 y(c)o(auses)15 b Fp(icmak)o(e)g Fq(not)h(t)o(o)f(change)g(the)g (curr)o(ent)g(dir)o(ect)o(or)o(y)i(but)e(t)o(o)h(r)o(eturn)24 898 y(the)d(st)o(artup-dir)o(ect)o(or)o(y,)j(fr)o(om)d(which)f Fp(icmak)o(e)h Fq(was)g(st)o(art)o(ed.)-18 981 y(Ex)o(ample:)154 1053 y Fe(//)18 b(print)e(the)h(current)g(working)f(directory)154 1092 y(printf\("Current)f(dir:)i(",)g(chdir)g(\("."\),)f("\\n"\);)154 1132 y(//)i(change)e(to)h(directory)f(/c/prog)154 1171 y(chdir)h(\("/c/prog"\);)154 1211 y(//)h(print)e(startup)g(directory) 154 1250 y(printf)h(\("Startup)e(dir:)i(",)h(chdir)e(\(""\),)h ("\\n"\);)-59 1396 y Fn(cmdhead)-59 1472 y Fp(\(int\))22 b(cmdhead)h(\(string\):)42 b Fq(This)22 b(function)f(set)o(s)i(the)g(c) o(ommand)g(head)f(t)o(o)-59 1522 y Fp(string)p Fq(.)15 b(See)e Fp(e)o(x)o(ec\(\))g Fq(and)f Fp(e)o(x)o(ecut)o(e\(\))p Fq(.)-59 1628 y Fn(cmdtail)-59 1705 y Fp(\(int\))i(cmdt)o(ail)g (\(string\):)27 b Fq(This)13 b(function)h(set)o(s)g(the)h(c)o(ommand)h (t)o(ail)e(t)o(o)i Fp(string)p Fq(.)-59 1755 y(See)c Fp(e)o(x)o(ec\(\))i Fq(and)e Fp(e)o(x)o(ecut)o(e\(\))p Fq(.)p -59 1786 534 2 v -18 1814 a Fi(9)1 1826 y Fh(The)d(dir)o(ect)o (or)o(y)i(separ)o(at)o(or)e(is)h(a)g(backslash)e(under)h(MS-DOS)i(and)e (a)h(slash)f(under)g(UNIX.)p eop %%Page: 32 33 32 32 bop -59 -127 a Fn(32)p -1 -127 937 2 v 961 w Fp(Act)o(a)13 b(Ic)o(cis)e(1994-1)-59 -11 y Fn(echo)-59 66 y Fp(\(int\))i(echo)g (\(int\):)26 b Fq(This)13 b(function)g(det)o(ermines)h(whether)g(befor) o(e)h(the)f(e)o(x)o(ecu-)-59 116 y(tion)f(of)f(a)h(c)o(ommand)h(the)f (c)o(ommand)h(will)d(be)i(display)o(ed.)j(The)c(ar)o(gument)i(of)-59 165 y(the)g(function)f(det)o(ermines)i(the)f(displaying)d(mode:)20 b(when)13 b(zer)o(o,)j(displaying)-59 215 y(is)e(suppr)o(essed;)h (else,)g(c)o(ommands)h(ar)o(e)f(display)o(ed)f(befor)o(e)h(e)o(x)o (ecution.)24 b(T)o(wo)-59 265 y(pr)o(ede\014ned)15 b(c)o(onst)o(ant)o (s)g(ar)o(e)h(av)o(ailable)e(for)h(use)f(as)g(an)g(ar)o(gument)h(t)o(o) h Fp(echo\(\))p Fq(:)-59 315 y(the)11 b(c)o(onst)o(ant)o(s)h Fp(ON)f Fq(and)g Fp(OFF)p Fq(.)f(The)h(v)o(alues)f(of)h(these)g(c)o (onst)o(ant)o(s)h(ar)o(e,)h(r)o(espec-)-59 365 y(tiv)o(ely,)g(1)f(and)g (0.)17 b(Initially,)11 b(echoing)h(is)g(on.)-18 414 y(Ex)o(ample:)154 496 y Fe(echo)17 b(\(ON\);)70 b(//)17 b(commands)f(will)h(be)h (displayed)154 535 y(.)154 574 y(.)154 614 y(echo)f(\(OFF\);)52 b(//)17 b(commands)f(will)h(not)g(be)h(displayed)-59 761 y Fn(element\(int,)12 b(list\))-59 838 y Fp(\(string\))e(element)i (\(int,)e(list\):)22 b Fq(This)10 b(function)g(r)o(etrie)o(v)o(es)j(a)e (string)f(fr)o(om)i(a)f(list.)-59 888 y(The)k(or)o(der)i(number)e(of)g (the)h(name)f(in)g(the)g(list)g(is)f(giv)o(en)h(b)o(y)g(the)g(\014r)o (st)h(ar)o(gu-)-59 937 y(ment.)h(Not)o(e)12 b(that)f(this)f(inde)o(x)g (is)g(zer)o(o-based;)h(i.e.,)h(the)f(\014r)o(st)g(element)g(in)f(the) -59 987 y(list)h(has)h(inde)o(x)e(0.)16 b(The)c(last)g(element)h(in)e (the)h(list)g(has)f(inde)o(x)g Fp(sizeo\015ist\(list\))e({)-59 1037 y(1)p Fq(.)-18 1087 y(Ex)o(ample:)154 1168 y Fe(list)225 1207 y(l;)154 1247 y(string)225 1286 y(n;)154 1326 y(int)225 1365 y(i;)154 1444 y(l)18 b(=)f(makelist)f(\("*.c"\);)154 1483 y(for)h(\(i)h(=)f(0;)h(i)f(<)h(sizeoflist)d(\(l\);)i(i++\))225 1523 y(if)h(\(element)e(\(i,)h(l\))g(newer)g("main.exe"\))296 1562 y(printf)g(\("Source)f(file)h(",)g(element)f(\(i,)h(l\),)350 1602 y(")g(is)h(more)f(recent)f(than)h(main.exe\\n"\);)-59 1749 y Fn(element\(int,)12 b(string\))-59 1826 y Fp(\(string\))k (element)h(\(int,)f(string\):)31 b Fq(This)16 b(function)g(r)o(etrie)o (v)o(es)i(a)f(substring)e(of)p eop %%Page: 33 34 33 33 bop -59 -127 a Fp(ICMAKE)p 124 -127 1094 2 v 1119 w Fn(33)-59 -11 y Fq(one)13 b(char)o(act)o(er)i(fr)o(om)e(the)g(string) f(giv)o(en)g(as)g(it)o(s)g(sec)o(ond)h(ar)o(gument.)-18 40 y(The)e(char)o(act)o(er)h(which)e(is)f(r)o(eturned)i(is)e(found)g (in)g(the)h(sec)o(ond)h(\(string\))f(ar)o(gu-)-59 90 y(ment)k(at)g(the)g(o\013set)h(position)e(speci\014ed)g(in)g(the)h (\014r)o(st)g(\(int\))g(ar)o(gument.)20 b(This)-59 140 y(inde)o(x)11 b(is)h(zer)o(o-based;)h(i.e.,)f(the)h(\014r)o(st)g(char)o (act)o(er)j(of)c(the)h(string)f(has)f(inde)o(x)h(0.)-18 191 y(Ex)o(ample:)154 279 y Fe(string)225 318 y(s;)154 358 y(int)225 397 y(count;)225 436 y(i;)154 515 y(count)17 b(=)g(0;)154 555 y(s)h(=)f("Hello)g(world";)154 594 y(for)g(\(i)h(=)f (0;)h(element\(i,)d(s\);)i(i++\))225 634 y(count++;)154 712 y(printf\("String)e('",)i(s,)g("')h(contains)e(",)279 752 y(count,)g(")i(characters.\\n"\))o(;)-59 906 y Fn(e)o(xec)-59 985 y Fp(\(int\))i(e)o(x)o(ec)h(\(int,)g(string,)g(...\):)41 b Fq(This)19 b(function)h(e)o(x)o(ecut)o(es)i(a)f(c)o(ommand)h(b)o(y) -59 1035 y(spawning)11 b(a)h(child)g(pr)o(oc)o(ess.)18 b(The)12 b(ar)o(gument)o(s)h(ar)o(e:)-18 1132 y Fo(\017)21 b Fq(The)g(\014r)o(st)h(ar)o(gument)g(is)e(an)h Fp(optional)26 b Fq(mode)c(\(an)f Fp(int)p Fq(\).)42 b(It)21 b(may)g(be)24 1181 y Fp(P)p 54 1181 13 2 v 14 w(CHECK)f Fq(\(0\))g(or)g Fp(P)p 391 1181 V 14 w(NOCHECK)g Fq(\(2\).)37 b(These)19 b(pr)o(ede\014ned)g(c)o(onst)o(ant)o(s)24 1231 y(det)o(ermine)i (whether)f(the)f(e)o(xit)g(st)o(atus)h(of)g(the)f(c)o(ommand)i(should)d (be)24 1281 y(check)o(ed)d(or)f(not.)19 b(If)13 b(the)g(e)o(xit)g(st)o (atus)h(should)e(be)h(check)o(ed,)j(and)d(a)g(non-)24 1331 y(zer)o(o)k(v)o(alue)g(is)e(r)o(eturned)j(b)o(y)e(the)g(c)o(alled) h(pr)o(ogr)o(am,)j(the)c(pr)o(oc)o(essing)h(of)24 1381 y(the)c(icmak)o(e)h(\014le)e(is)g(abort)o(ed.)24 1450 y(If)h(the)i(\014r)o(st)f(ar)o(gument)h(is)e(omitt)o(ed)j(\(i.e.,)f(if) f(the)g(\014r)o(st)h(ar)o(gument)f(is)g Fp(not)24 1499 y Fq(an)e(int\),)h Fp(P)p 207 1499 V 15 w(CHECK)20 b Fq(is)12 b(assumed.)-18 1588 y Fo(\017)21 b Fq(The)16 b(sec)o(ond)g(ar)o(gument)g(is)f(the)h(c)o(ommand)h(t)o(o)f(run)f(\(a)i Fp(string)p Fq(\).)25 b(This)14 b(is)24 1638 y(the)f(name)g(of)f(the)h (pr)o(ogr)o(am)h(t)o(o)f(be)g(activ)o(at)o(ed.)-18 1726 y Fo(\017)21 b Fq(The)h(following)f(ar)o(gument)o(s)i(ar)o(e)g(the)g (ar)o(gument)o(s)g(which)e(should)g(be)24 1776 y(passed)10 b(t)o(o)i(the)g(c)o(alled)f(pr)o(ogr)o(am.)17 b(These)11 b(ar)o(gument)o(s)h(may)f(be)g Fp(int)p Fq(s,)f Fp(list)p Fq(s)24 1826 y(or)j Fp(string)p Fq(s.)p eop %%Page: 34 35 34 34 bop -59 -127 a Fn(34)p -1 -127 937 2 v 961 w Fp(Act)o(a)13 b(Ic)o(cis)e(1994-1)-18 -11 y Fq(Each)16 b(c)o(ommand)g(is)e(c)o (omposed)j(of)e(the)g(pr)o(ogr)o(am)h(name)f(\(the)h(sec)o(ond)f(ar-) -59 39 y(gument\),)h(followed)e(b)o(y)h(the)g(curr)o(ent)h(setting)f (of)f(the)h(c)o(ommand)h(head)f(\(see)-59 89 y Fp(cmdhead\(\))p Fq(,)g(followed)d(b)o(y)h(all)g(ar)o(gument)o(s)g(and)g(t)o(erminat)o (ed)i(with)d(the)h(c)o(om-)-59 139 y(mand)f(t)o(ail)h(\(see)g Fp(cmdt)o(ail\(\))p Fq(\).)k(Each)c(ar)o(gument)g(t)o(o)g(the)g(c)o (ommand)h(is)d(pr)o(e\014x)o(ed)-59 188 y(with)d(the)h(ar)o(gument)g (head)g(\(see)g Fp(ar)o(ghead\(\))p Fq(\))i(and)d(post\014x)o(ed)h(b)o (y)f(the)h(ar)o(gument)-59 238 y(t)o(ail)k(\(see)g Fp(ar)o(gt)o (ail\(\))p Fq(\).)-18 288 y(Ex)o(ample:)k(see)c Fp(e)o(x)o(ecut)o (e\(\))g Fq(below.)-59 395 y Fn(e)o(xecute)-59 471 y Fp(\(int\))g(e)o(x)o(ecut)o(e)h(\(int,)f(string,)f(string,)h(string,)f (...,)i(string,)e(string\))p Fq(:)19 b(This)13 b(func-)-59 521 y(tion)d(e)o(x)o(ecut)o(es)h(a)f(c)o(ommand)h(b)o(y)f(spawning)e(a) i(child)f(pr)o(oc)o(ess.)17 b(The)10 b(ar)o(gument)o(s)-59 571 y(ar)o(e:)-18 657 y Fo(\017)21 b Fq(The)g(\014r)o(st)h(ar)o(gument) g(is)e(an)h Fp(optional)26 b Fq(mode)c(\(an)f Fp(int)p Fq(\).)42 b(It)21 b(may)g(be)24 707 y Fp(P)p 54 707 13 2 v 14 w(CHECK)f Fq(\(0\))g(or)g Fp(P)p 391 707 V 14 w(NOCHECK)g Fq(\(2\).)37 b(These)19 b(pr)o(ede\014ned)g(c)o(onst)o(ant) o(s)24 757 y(det)o(ermine)i(whether)f(the)f(e)o(xit)g(st)o(atus)h(of)g (the)f(c)o(ommand)i(should)d(be)24 807 y(check)o(ed)d(or)f(not.)19 b(If)13 b(the)g(e)o(xit)g(st)o(atus)h(should)e(be)h(check)o(ed,)j(and)d (a)g(non-)24 857 y(zer)o(o)k(v)o(alue)g(is)e(r)o(eturned)j(b)o(y)e(the) g(c)o(alled)h(pr)o(ogr)o(am,)j(the)c(pr)o(oc)o(essing)h(of)24 907 y(the)c(icmak)o(e)h(\014le)e(is)g(abort)o(ed.)24 972 y(If)h(the)i(\014r)o(st)f(ar)o(gument)h(is)e(omitt)o(ed)j(\(i.e.,)f (if)f(the)g(\014r)o(st)h(ar)o(gument)f(is)g Fp(not)24 1022 y Fq(an)e(int\),)h Fp(P)p 207 1022 V 15 w(CHECK)20 b Fq(is)12 b(assumed.)-18 1103 y Fo(\017)21 b Fq(The)16 b(sec)o(ond)g(ar)o(gument)g(is)f(the)h(c)o(ommand)h(t)o(o)f(run)f(\(a)i Fp(string)p Fq(\).)25 b(This)14 b(is)24 1153 y(the)f(name)g(of)f(the)h (pr)o(ogr)o(am)h(t)o(o)f(be)g(activ)o(at)o(ed.)-18 1234 y Fo(\017)21 b Fq(The)14 b(thir)o(d)h(ar)o(gument)g(is)f(the)g(c)o (ommand)i(head)e(\(a)h Fp(string)p Fq(\).)22 b(This)13 b(string)24 1284 y(is)h(used)g(as)h(\014r)o(st)h(ar)o(gument)f(t)o(o)h (the)f(pr)o(ogr)o(am)i(name.)24 b(The)15 b(string)f(may)24 1333 y(be)f(empt)o(y)g(\(i.e.,)g Ff("")p Fq(\),)h(in)e(which)f(c)o(ase) j(no)e(c)o(ommand)i(head)e(is)g(used.)-18 1414 y Fo(\017)21 b Fq(The)13 b(fourth)f(ar)o(gument)h(is)f(the)g(ar)o(gument)i(head)e (\(a)h Fp(string)p Fq(\).)j(This)11 b(string)24 1464 y(is)i(pr)o(e\014x)o(ed)h(t)o(o)h(all)e(following)f(ar)o(gument)o(s.)21 b(The)14 b(string)f(may)h(be)g(empt)o(y)24 1514 y(\(i.e.,)f Ff("")p Fq(\),)h(in)e(which)f(c)o(ase)j(no)e(ar)o(gument)h(head)g(is)e (used.)-18 1595 y Fo(\017)21 b Fq(The)h(following)f(ar)o(gument)o(s)i (ar)o(e)g(the)g(ar)o(gument)o(s)g(which)e(should)g(be)24 1645 y(passed)10 b(t)o(o)i(the)g(c)o(alled)f(pr)o(ogr)o(am.)17 b(These)11 b(ar)o(gument)o(s)h(may)f(be)g Fp(int)p Fq(s,)f Fp(list)p Fq(s)24 1695 y(or)j Fp(string)p Fq(s.)-18 1776 y Fo(\017)21 b Fq(The)16 b(one)g(but)g(last)f(ar)o(gument)i(is)e(the)h (ar)o(gument)g(t)o(ail)g(\(a)h Fp(string)p Fq(\).)25 b(This)24 1826 y(string)9 b(is)f(post\014x)o(ed)i(t)o(o)g(each)g(ar)o (gument)g(passed)f(t)o(o)i(the)e(c)o(alled)h(pr)o(ogr)o(am.)p eop %%Page: 35 36 35 35 bop -59 -127 a Fp(ICMAKE)p 133 -127 1075 2 v 1119 w Fn(35)24 -11 y Fq(The)10 b(string)f(may)i(be)f(empt)o(y)h(\(i.e.,)g Ff("")p Fq(\),)h(in)d(which)h(c)o(ase)h(no)f(ar)o(gument)g(t)o(ail)24 39 y(is)i(used.)-18 121 y Fo(\017)21 b Fq(The)13 b(last)h(ar)o(gument)g (is)e(the)i(c)o(ommand)h(t)o(ail)e(\(a)h Fp(string)p Fq(\).)19 b(The)13 b(c)o(ommand)24 171 y(run)j(b)o(y)g(the)h Fp(e)o(x)o(ecut)o(e\(\))g Fq(function)f(is)g(post\014x)o(ed)h(with)f (this)g(string.)27 b(The)24 221 y(string)13 b(may)g(be)g(empt)o(y)i (\(i.e.,)f Ff("")p Fq(\),)g(in)f(which)g(c)o(ase)h(no)f(c)o(ommand)i(t) o(ail)e(is)24 271 y(used.)-18 360 y(Aft)o(er)f(e)o(x)o(ecution,)g Fp(e)o(x)o(ecut)o(e\(\))f Fq(r)o(eset)o(s)h(the)f(c)o(ommand)h(head,)g (c)o(ommand)g(t)o(ail,)-59 410 y(ar)o(gument)h(head)f(and)h(ar)o (gument)g(t)o(ail)f(t)o(o)i(empt)o(y)g(strings.)-18 460 y(The)21 b(following)e(listing)f(shows)i(an)g(e)o(x)o(ample)g(of)g(the) h(use)f(of)g Fp(e)o(x)o(ecut)o(e\(\))p Fq(.)-59 509 y(It)c(inv)o(olv)o (es)g(the)g(Micr)o(osoft)h(Libr)o(ar)o(y)g(Manager.)28 b(This)16 b(pr)o(ogr)o(am,)j(which)c(is)-59 559 y(c)o(alled)d Fp("lib")p Fq(,)h(has)e(always)h(the)g(libr)o(ar)o(y)h(name)f(t)o(o)h (pr)o(oc)o(ess)h(as)d(\014r)o(st)i(ar)o(gument)-59 609 y(\(the)h(c)o(ommand)g(head\).)19 b(Following)12 b(this)h(ar)o(gument,) h(all)f(object)i(\014les)d(which)-59 659 y(should)i(be)i(pr)o(oc)o (essed)h(ar)o(e)f(st)o(at)o(ed)h(pr)o(ec)o(eded)g(b)o(y)f(a)f(string)g (which)g(speci\014es)-59 709 y(the)j(t)o(ype)h(of)f(oper)o(ation.)35 b(The)18 b(t)o(ype)h(of)f(oper)o(ation)h(is,)g(e.g.,)h Fp("{+")e Fq(which)-59 758 y(speci\014es)c(that)h(an)f(object)i(should) d(be)h(r)o(eplac)o(ed)i(in)e(the)g(libr)o(ar)o(y.)23 b(Following)-59 808 y(this,)12 b(a)g(semic)o(olon)h(must)g(close)f(the) h(c)o(ommand)g(line)f(t)o(o)h(pr)o(e)o(v)o(ent)h(the)e(libr)o(ar)o(y) -59 858 y(manager)h(of)f(asking)g(for)g(the)h(new)f(libr)o(ar)o(y)h (name)g(et)o(c..)154 937 y Fe(list)225 977 y(objfiles;)154 1055 y(//)18 b(objfiles)e(is)h(set)g(to)g(a)h(list)f(of)g(all)g (objects)154 1095 y(objfiles)f(=)i(makelist)e(\("*.obj"\);)154 1174 y(execute)g(\(0,)195 b(//)18 b(REQUIRE_ZERO)314 1213 y("lib",)123 b(//)18 b(the)f(program)f(name)314 1253 y("prog.lib",)33 b(//)18 b(the)f(command)f(head)314 1292 y("-+",)141 b(//)18 b(the)f(argument)f(head:)g(replacement)314 1331 y(objfiles,)69 b(//)53 b(of)18 b(all)f(object)f(files)314 1371 y("",)177 b(//)18 b(no)f(argument)f(tail)314 1410 y(";"\);)141 b(//)18 b(command)e(tail:)h(semicolon)154 1489 y(//)h(this)e(may)i(lead)e(to)i(e.g.:)154 1529 y(//)g("lib)e (prog.lib)g(-+a.obj)h(-+b.obj)f(-+c.obj)g(;")-18 1657 y Fq(The)e(same)f(e\013ect)i(using)c(function)i Fp(e)o(x)o(ec\(\))g Fq(c)o(ould)h(be)f(ac)o(c)o(omplished)h(in)e(the)-59 1707 y(following)f(manner:)154 1786 y Fe(list)225 1826 y(objfiles;)p eop %%Page: 36 37 36 36 bop -59 -127 a Fn(36)p -1 -127 937 2 v 961 w Fp(Act)o(a)13 b(Ic)o(cis)e(1994-1)154 29 y Fe(objfiles)16 b(=)i(makelist)e (\("*.obj"\);)154 107 y(cmdhead)g(\("prog.lib"\);)f(//)j(set)f(command) f(head)154 147 y(cmdtail)g(\(";"\);)141 b(//)35 b(and)18 b(tail)154 186 y(arghead)e(\("-+"\);)123 b(//)18 b(set)f(argument)f (head)154 226 y(argtail)g(\(""\);)159 b(//)35 b(and)18 b(tail)154 265 y(exec)f(\(0,)g("lib",)g(objfiles\);)154 305 y(cmdhead)f(\(""\);)159 b(//)18 b(clear)e(command)h(head)154 344 y(cmdtail)f(\(""\);)159 b(//)35 b(and)18 b(tail)154 384 y(arghead)e(\(""\);)159 b(//)18 b(clear)e(argument)g(head)154 423 y(argtail)g(\(""\);)159 b(//)35 b(and)18 b(tail)154 502 y(//)g(this)e(may)i(lead)e(to)i(e.g.:)154 541 y(//)g("lib)e (prog.lib)g(-+a.obj)h(-+b.obj)f(-+c.obj)g(;")-18 671 y Fq(Both)10 b(the)g Fp(e)o(x)o(ec\(\))f Fq(and)g Fp(e)o(x)o(ecut)o (e\(\))h Fq(function)f(t)o(erminat)o(e)i(the)f(making)e(pr)o(oc)o(ess) -59 721 y(if)17 b(err)o(or)j(checking)e(is)f(turned)h(on)g(\(mode)h (\015ag)e Fp(P)p 806 721 13 2 v 14 w(CHECK)p Fq(\))i(and)f(if)f(the)h (run)-59 771 y(c)o(ommand)12 b(e)o(xit)o(s)e(with)h(a)g(non-zer)o(o)g (e)o(xit)f(v)o(alue.)16 b(If)10 b(err)o(or)i(checking)f(is)f(o\013,)i (the)-59 821 y(e)o(xit)g(st)o(atus)h(of)f(the)h(child)f(pr)o(oc)o(ess)h (is)f(r)o(eturned.)-59 928 y Fn(e)o(xists)-59 1005 y Fp(\(int\))i(e)o(xist)o(s)f(\(string\):)26 b Fq(This)14 b(function)f(t)o(est)o(s)j(if)d(a)h(\014le)g(e)o(xist)o(s.)21 b(The)14 b(\014le)g(name)-59 1055 y(is)f(supplied)g(as)h(ar)o(gument.) 23 b(A)14 b(non-zer)o(o)h(v)o(alue)f(is)g(r)o(eturned)h(when)e(the)i (\014le)-59 1105 y(e)o(xist)o(s,)d(else,)h(zer)o(o)g(is)f(r)o(eturned.) -18 1154 y(Ex)o(ample:)154 1235 y Fe(if)18 b(\(exists)e(\("main.c"\)\)) 225 1274 y(printf)h(\("file)f(main.c)h(found\\n"\);)154 1314 y(else)225 1353 y(printf)g(\("file)f(main.c)h(not)g(found\\n"\);) -59 1500 y Fn(fgets)-59 1577 y Fp(\(list\))g(fget)o(s)f(\(string,)i (int\):)32 b Fq(This)17 b(function)g(r)o(eads)h(a)f(line)g(of)g(t)o(e)o (xt)h(fr)o(om)g(the)-59 1626 y(\014le)12 b(whose)g(name)h(is)f(giv)o (en)g(as)g(it)o(s)g(\014r)o(st)h(\(string\))g(ar)o(gument.)k(R)o (eading)12 b(st)o(art)o(s)-59 1676 y(at)j(the)f(o\013setposition)h (speci\014ed)e(in)g(the)i(sec)o(ond)f(\(int\))h(ar)o(gument.)22 b(A)14 b(list)f(is)-59 1726 y(r)o(eturned,)19 b(c)o(ont)o(aining)e(as)f (it)o(s)h(\014r)o(st)g(element)h(the)f(string)f(which)g(was)g(r)o(ead,) -59 1776 y(including)g(the)i(\014nal)f(newline)g(char)o(act)o(er)k (\(as)d(it)h(is)e(r)o(eturned)i(b)o(y)f(the)g Fn(C++)-59 1826 y Fq(function)e Fp(fget)o(s\(\))7 b Fq(\).)30 b(The)17 b(sec)o(ond)g(element)h(of)f(the)g(r)o(eturned)h(list)e(c)o(ont)o(ains) p eop %%Page: 37 38 37 37 bop -59 -127 a Fp(ICMAKE)p 124 -127 1094 2 v 1119 w Fn(37)-59 -11 y Fq(the)17 b(string)f(r)o(epr)o(esent)o(ation)i(of)f (the)f(o\013set)i(of)e(the)h(\014le)f Fp(aft)o(er)24 b Fq(the)17 b(line)f(was)-59 39 y(r)o(ead.)h(This)12 b(string)g(c)o(an)h(be)f(c)o(ast)i(t)o(o)g(an)e(int.)-18 91 y(Ex)o(ample:)154 184 y Fe(//)18 b(showing)e(the)h(file)g(info.doc)f (on)h(the)g(screen:)154 223 y(int)225 263 y(offset;)154 302 y(list)225 342 y(l;)154 421 y(for)154 460 y(\()225 499 y(offset)g(=)g(0;)296 539 y(l)h(=)g(fgets\("info.do)o(c",)d (offset\);)368 578 y(offset)h(=)i(\(int\)element\(1)o(,)d(l\))154 618 y(\))225 657 y(printf\(element\(0,)f(l\)\);)-59 817 y Fn(fprintf)-59 898 y Fp(\(int\))j(fprintf)e(\(string,)i Fl(:)7 b(:)g(:)e Fp(\):)33 b Fq(This)16 b(function)h(appends)f (information)h(t)o(o)h(the)-59 948 y(\014le)c(whose)g(name)h(is)f(giv)o (en)g(as)g(it)o(s)h(\014r)o(st)g(string)f(ar)o(gument.)23 b(The)15 b(r)o(emaining)-59 997 y(ar)o(gument)o(s)i(de\014ne)g(the)g (information)g(which)g(is)f(writt)o(en)i(t)o(o)g(the)f(\014le.)29 b(The)-59 1047 y(information)11 b(is)f(always)g(appended)g(t)o(o)i(an)f (e)o(xisting)d(\014le,)j(which)f(is)g(opened)h(in)-59 1097 y(t)o(e)o(xtmode.)-18 1149 y Fp(fprintf\(\))20 b Fq(act)o(s)14 b(analogously)e(t)o(o)j Fp(printf\(\))20 b Fq(\(see)14 b(below\),)g(but)f(the)h(informa-)-59 1199 y(tion)f(is)e(writt)o(en)j(t)o(o)f(\014le,)g(r)o(ather)h(than)e(t)o(o)i (scr)o(een.)-18 1251 y(The)e(ar)o(gument)o(s)g(be)o(y)o(ond)g(the)g (\014r)o(st)g(ar)o(gument)g(of)f Fp(fprintf\(\))18 b Fq(de\014ne)11 b(the)h(in-)-59 1301 y(formation)h(t)o(o)h(print)e(and)g (may)h(be)g Fp(int)p Fq(s,)e Fp(list)p Fq(s)g(or)i Fp(string)p Fq(s.)-18 1353 y(Ex)o(ample:)154 1446 y Fe(fprintf)j(\("file.txt",)g (1,)314 1485 y(")i(line)f(written)f(to)h(file.txt\\n"\);)-59 1645 y Fn(get)p 4 1645 13 2 v 15 w(base)-59 1726 y Fp(\(string\))c(get) p 158 1726 V 15 w(base)h(\(string\):)26 b Fq(This)13 b(function)g(r)o(eturns)h(the)g(basename)h(of)e(the)-59 1776 y(\014lename)f(st)o(or)o(ed)i(in)e(the)g(string)g(ar)o(gument.)17 b(The)12 b(empt)o(y)h(string)f(is)g(r)o(eturned)-59 1826 y(if)g(the)i(ar)o(gument)f(c)o(ont)o(ains)h(no)f(basename.)19 b(This)12 b(happens)h(when)f(a)h(disk)g(or)p eop %%Page: 38 39 38 38 bop -59 -127 a Fn(38)p -1 -127 937 2 v 961 w Fp(Act)o(a)13 b(Ic)o(cis)e(1994-1)-59 -11 y Fq(a)g(r)o(oot)h(dir)o(ect)o(or)o(y)h(is) d(speci\014ed)g(in)g Fp(string.)k Fq(It)d(may)g(also)f(happen)g(if)g (the)h(s)o(ynt)o(ax)-59 39 y(rules)h(for)h(a)f(\014lename)h(speci\014c) o(ation)g(ar)o(e)g(violat)o(ed.)-18 93 y(Ex)o(ample:)154 193 y Fe(printf\(get_base)i(\("c:/path/main.)o(c"\)\))o(;)154 233 y(//)j(prints)e(`main')154 312 y(printf\(get_base)f (\("c:main.c"\)\);)154 351 y(//)j(prints)e(`main')154 430 y(printf\("No)g(basename:)g(",)h(get_base)f(\("c:/"\)\);)154 469 y(//)i(prints)e(`No)h(basename:)f(')-59 638 y Fn(getch)-59 721 y Fp(\(string\))d(get)o(ch)f(\(\):)25 b Fq(This)12 b(function)h(r)o(eturns)h(one)f(char)o(act)o(er)j(as)d(a)g(ministring.) -59 771 y(The)d(char)o(act)o(er)i(is)d(r)o(ead)h(fr)o(om)g(the)g(st)o (andar)o(d)h(input)d(str)o(eam)j(\(usually)d(the)i(k)o(e)o(y-)-59 821 y(boar)o(d\).)-18 875 y(Under)17 b(UNIX,)g(this)f(function)f(wait)o (s)i(until)f(a)g(k)o(e)o(y)h(and)g(the)f(ent)o(er)i(k)o(e)o(y)f(is)-59 925 y(pr)o(essed.)g(Under)12 b(DOS,)h(only)f(one)h(k)o(e)o(y)g(needs)f (t)o(o)i(be)e(pr)o(essed.)-18 978 y(Ex)o(ample:)154 1079 y Fe(printf\(getch\(\)\);)32 b(//)18 b(prints)e(a)i(character)474 1118 y(//)g(\(or)f(an)g(empty)g(string\))-59 1287 y Fn(get)p 4 1287 13 2 v 15 w(e)o(xt)-59 1370 y Fp(\(string\))g(get)p 162 1370 V 15 w(e)o(xt)g(\(string\):)34 b Fq(This)17 b(function)g(r)o(eturns)i(the)f(e)o(xt)o(ension)f(in)g(the)-59 1420 y(string)12 b(ar)o(gument)h(of)f(the)h(function.)-18 1474 y(The)e(empt)o(y)g(string)e(is)h(r)o(eturned)h(if)f(the)g(ar)o (gument)h(c)o(ont)o(ains)g(no)f(e)o(xt)o(ension.)-18 1528 y(Ex)o(ample:)154 1628 y Fe(printf\(get_ext)15 b (\("c:/path/main.c)o("\)\);)154 1668 y(//)j(prints)e(`c')154 1747 y(printf\(get_ext)f(\("c:main"\)\);)154 1786 y(//)j(returns)e (empty)g(string)p eop %%Page: 39 40 39 39 bop -59 -127 a Fp(ICMAKE)p 124 -127 1094 2 v 1119 w Fn(39)-59 -11 y(get)p 4 -11 13 2 v 15 w(path)-59 66 y Fp(\(string\))10 b(get)p 155 66 V 15 w(path)g(\(string\):)23 b Fq(This)10 b(function)g(r)o(eturns)h(the)h(path)f(st)o(or)o(ed)h(in)e (the)-59 116 y(string)h(ar)o(gument)i(of)f(the)g(function.)k(An)c(empt) o(y)h(string)e(is)h(r)o(eturned)h(if)e Fp(string)-59 165 y Fq(c)o(ont)o(ains)h(neither)g(a)g(disk)f(speci\014er)h(nor)g(a)g (dir)o(ect)o(or)o(y)i(separ)o(at)o(or)g(\(a)e(forwar)o(d-)-59 215 y(or)j(backwar)o(d)h(slash\).)22 b(The)15 b(function)f(r)o(eturns)h (the)g(longest)f(possible)g(path-)-59 265 y(name)f(which)f(c)o(an)h(be) f(deriv)o(ed)h(fr)o(om)g(the)g(string)f(ar)o(gument.)-18 315 y(Ex)o(ample:)154 396 y Fe(printf\(get_path)j(\("c:/path/main.)o (c"\)\))o(;)154 436 y(//)j(prints)e(`c:/path/')154 515 y(printf\(get_path)f(\("c:main.c"\)\);)154 554 y(//)j(prints)e(`c:')154 633 y(printf\(get_path)f(\("c:/"\)\);)154 672 y(//)j(prints)e(`c:/')-59 820 y Fn(getpid)-59 897 y Fp(\(int\))9 b(getpid)f(\(\))h Fq(This)f(function)h(r)o(eturns)g(under)g(UNIX)g(the)g(pr)o(oc)o(ess)h (number)f(of)-59 946 y(the)i(curr)o(ently)g(e)o(x)o(ecuting)f Fp(icmak)o(e)i Fq(pr)o(ogr)o(am.)17 b(Under)11 b(MS-DOS,)f(wher)o(e)h (pr)o(o-)-59 996 y(c)o(ess)k(ID)f(number)o(s)h(hav)o(e)g(no)f(special)h (meaning)f(sinc)o(e)h(no)f(par)o(allel)h(pr)o(ogr)o(am)-59 1046 y(may)i(be)g(run,)i Fp(getpid)d(\(\))i Fq(r)o(eturns)g(the)f (segment)g(of)g(the)h(memor)o(y)g(loc)o(ation)-59 1096 y(wher)o(e)11 b(the)g(e)o(x)o(ecut)o(or)i Fp(icm-e)o(x)o(ec)d Fq(is)f(loaded)i(\(this)g(v)o(alue)f(is)g(the)h(PSP)g(addr)o(ess\).)-18 1146 y(Ex)o(ample:)83 1227 y Fe(//)18 b(this)e(function)g(kills)h(the)g (current)f(process..)83 1266 y(//)i(analogous)d(to)j(exit\(\))83 1306 y(//)g(works)e(only)h(under)g(UNIX)83 1345 y(void)g(harakiri)f (\(\))83 1385 y({)154 1424 y(exec)h(\("kill",)f("-9",)h(getpid)f (\(\)\);)83 1464 y(})83 1542 y(//)i(this)e(function)g(returns,)g(under) h(UNIX,)83 1582 y(//)h(a)f(name)g(for)g(a)h(temporary)d(file)83 1621 y(//)j(based)e(on)h(the)h(process)e(ID)h(number)83 1661 y(//)h(file)e(names)h(are,)g(eg:)g("/tmp/_TMPFILE.1)o(256")83 1700 y(string)g(tempfilename)e(\(\))83 1740 y({)154 1779 y(return)i(\("/tmp/")f(+)h("_TMPFILE.")f(+)h(\(string\))f(getpid)h (\(\)\);)83 1819 y(})p eop %%Page: 40 41 40 40 bop -59 -127 a Fn(40)p -1 -127 937 2 v 961 w Fp(Act)o(a)13 b(Ic)o(cis)e(1994-1)-59 -11 y Fn(gets)-59 73 y Fp(\(string\))j(get)o(s) h(\(\):)29 b Fq(This)14 b(function)g(r)o(eturns)h(the)g(r)o(eturnv)o (alue)h(of)f(the)g Fn(C)g Fq(func-)-59 123 y(tion)21 b Fp(get)o(s\(\))29 b Fq(as)21 b(a)g(string.)42 b(The)21 b(function)g(ac)o(c)o(ept)o(s)i(char)o(act)o(er,)k(including)-59 173 y(backspac)o(es)15 b(allowing)d(c)o(orr)o(ections,)17 b(until)12 b(the)i Fp(ent)o(er-k)o(e)o(y)22 b Fq(is)13 b(pr)o(essed.)19 b(The)-59 222 y(ent)o(er)o(ed)14 b(char)o(act)o(er)o (s)h(ar)o(e)f(r)o(eturned)f(in)f(a)h(string.)-18 276 y(Ex)o(ample:)154 377 y Fe(printf\(gets\(\)\);)32 b(//)18 b(prints)e(a)i(string)456 416 y(//)g(\(or)f(an)g(empty)g(string\))-59 584 y Fn(makelist)-59 668 y Fp(\(list\))12 b(mak)o(elist)h(\(int,)e (string\):)23 b Fq(This)12 b(function)g(mak)o(es)h(a)g(list)f(of)g (strings,)g(r)o(ep-)-59 718 y(r)o(esenting)g(\014lenames)g(which)g(mat) o(ch)i(the)f(e)o(xpanded)e(form)i(of)f(it)o(s)h(ar)o(gument.)-59 768 y(The)c(ar)o(gument)o(s)h(ar)o(e)g(an)g(optional)f Fp(int)p Fq(,)g(specifying)f(the)h(t)o(ype)h(of)f(dir)o(ect)o(or)o(y)j (en-)-59 818 y(tries)e(t)o(o)h(sear)o(ch)f(for,)h(and)f(a)g Fp(string)p Fq(,)f(specifying)f(the)i(\014le)g(mask.)16 b(The)10 b(r)o(eturned)-59 867 y(list)i(may)h(hold)f(zer)o(o)h(or)g (mor)o(e)h(names.)-18 921 y(The)f(\014r)o(st)g Fp(int)f Fq(ar)o(gument)h(speci\014es)f(the)h(t)o(ype)g(of)g(entries)f(t)o(o)i (sear)o(ch)f(for.)18 b(It)-59 971 y(may)13 b(be)f Fp(O)p 129 971 13 2 v 15 w(FILE)g Fq(\(when)g(sear)o(ching)g(for)h(\014les\),) g Fp(O)p 791 971 V 14 w(DIR)g Fq(\(when)f(sear)o(ching)g(for)-59 1021 y(dir)o(ect)o(ories\))19 b(or)f Fp(O)p 271 1021 V 15 w(SUBDIR)f Fq(\(when)g(sear)o(ching)f(for)i(subdir)o(ect)o (ories\).)31 b(The)-59 1071 y(di\013er)o(enc)o(e)13 b(between)f(the)f (sear)o(ching)g(for)h(dir)o(ect)o(ories)h(and)e(the)g(sear)o(ching)g (for)-59 1120 y(subdir)o(ect)o(ories)k(lies)f(in)g(the)h(fact)g(that)g (the)g(curr)o(ent)h(dir)o(ect)o(or)o(y,)i(denot)o(ed)e(b)o(y)-59 1170 y(".",)k(and)d(the)i(par)o(ent)g(dir)o(ect)o(or)o(y,)j(denot)o(ed) d(b)o(y)f("..",)h(ar)o(e)g(not)g(c)o(onsider)o(ed)-59 1220 y(subdir)o(ect)o(ories)14 b(but)f(ar)o(e)g(c)o(onsider)o(ed)h(dir) o(ect)o(ories.)20 b(This)12 b(ar)o(gument)h(may)g(be)-59 1270 y(absent,)g(in)f(which)f(c)o(ase)j Fp(O)p 399 1270 V 14 w(FILE)f Fq(is)e(assumed.)-18 1324 y(A)f(fourth)g(t)o(ype)g(is)f Fp(O)p 321 1324 V 14 w(ALL)p Fq(.)h(When)g(this)f(t)o(ype)h(is)f(giv)o (en,)h Fp(mak)o(elist)g(\(\))g Fq(sear)o(ches)-59 1373 y(for)15 b(all)g(dir)o(ect)o(or)o(y)i(entries)f(irr)o(espectiv)o(e)g (of)f(their)g(t)o(ype.)25 b(E.g.,)16 b(under)f(DOS,)-59 1423 y(hidden)23 b(and)h(s)o(yst)o(em)i(\014les)d(ar)o(e)j(mat)o(ched)g (as)e(well)g(as)g(normal)h(\014les)f(or)-59 1473 y(\(sub\)dir)o(ect)o (ories.)-18 1527 y(The)e(behavior)g(of)f Fp(mak)o(elist\(\))i Fq(is)d(dependent)i(on)f(the)h(used)f(platform.)-59 1577 y(E.g.,)h(t)o(o)f(sear)o(ch)f(for)g(all)f(\014les)g(or)i(\(sub\)dir)o (ect)o(ories)g(under)f(DOS,)g(the)g(\014le)-59 1626 y(mask)15 b(")p Fo(\003)p Fl(:)p Fo(\003)p Fq(")e(must)i(be)f(giv)o(en.)22 b(The)14 b(\014le)g(mask)h(")p Fo(\003)p Fq(")f(will)g(fail)f(t)o(o)j (\014nd)d(\014les)h(or)-59 1676 y(\(sub\)dir)o(ect)o(ories)f(with)f(an) f(e)o(xt)o(ension.)16 b(Furthermor)o(e,)e Fp(mak)o(elist)e(\(\))h Fq(behav)o(es)-59 1726 y(under)k(DOS)f(similar)h(t)o(o)h(the)f Fn(C)g Fq(run-time)g(functions)p 894 1726 V 31 w Fp(dos)p 978 1726 V 14 w(\014nd\014r)o(st)f(\(\))i Fq(and)p -59 1776 V -47 1776 a Fp(dos)p 24 1776 V 15 w(\014ndne)o(xt)12 b(\(\))p Fq(:)21 b(e.g.,)15 b Fp(mak)o(elist)g(\(O)p 600 1776 V 15 w(DIR,)f("."\))h Fq(r)o(eturns)g(a)g(list)f(c)o(ont)o (aining)-59 1826 y(the)f(name)g(of)f(the)h(curr)o(ent)h(dir)o(ect)o(or) o(y.)p eop %%Page: 41 42 41 41 bop -59 -127 a Fp(ICMAKE)p 124 -127 1094 2 v 1119 w Fn(41)-18 -11 y Fq(In)12 b(a)h(similar)f(v)o(ein,)g(the)h(\014lemask) g(")p Fo(\003)p Fq(")f(under)g(UNIX)g(will)g(fail)f(t)o(o)j(\014nd)d (\014les)-59 39 y(or)i(\(sub\)dir)o(ect)o(ories)h(st)o(arting)f(with)f (a)h(dot.)-18 89 y(Ex)o(ample:)154 155 y Fe(list)225 194 y(l;)154 273 y(l)18 b(=)f(makelist)f(\("*.c"\);)154 313 y(printf)h(\("All)f(found)h(*.c)g(files)g(are:)g(",)314 352 y(l,)h("\\n"\);)154 391 y(l)g(=)f(makelist)f(\(IS_SUBDIR,)g ("*.*"\);)154 431 y(printf)h(\("All)f(found)h(subdirectories)e(are:)i (",)314 470 y(l,)h("\\n"\);)-59 615 y Fn(makelist)-59 691 y Fq(The)13 b(function)f Fp(mak)o(elist\(\))i Fq(furthermor)o(e)h (has)d(o)o(v)o(erloaded)i(v)o(er)o(sions,)g(which,)-59 741 y(apart)g(fr)o(om)f(a)g(\014r)o(st)g(optional)g Fp(int)e Fq(indic)o(ating)h(the)h(t)o(ype)g(of)f(entries)h(t)o(o)h(sear)o(ch)-59 791 y(for,)j(e)o(xpect)f(thr)o(ee)h(ar)o(gument)o(s)486 773 y Fj(10)518 791 y Fq(.)26 b(The)16 b(ar)o(gument)o(s)g(of)f(these)h (v)o(er)o(sions)g(ar)o(e)-59 841 y(a)c Fp(string)g(mask)p Fq(;)h(a)f(c)o(omparison)i(oper)o(at)o(or)h(which)c(must)i(be)f Fp(y)o(ounger)p Fq(,)h Fp(newer)-59 891 y Fq(or)g Fp(older)p Fq(;)e(and)h(a)g Fp(string)f(r)o(efer)o(enc)o(e\014le)p Fq(.)18 b(The)12 b(function)g(r)o(eturns)g(a)g(list)g(of)f(\014les)-59 941 y(mat)o(ching)h(the)h(mask)f(which)f(ar)o(e)i(older)g(or)f(newer)h (than)f(the)g(r)o(efer)o(enc)o(e\014le)1227 923 y Fj(11)1261 941 y Fq(.)-59 990 y(An)j(optional)h(\014r)o(st)f Fp(int)f Fq(ar)o(gument,)j(which)e(speci\014es)g(the)g(t)o(ype)h(of)f(dir)o(ect) o(or)o(y)-59 1040 y(entr)o(y)e(\()p Fp(O)p 104 1040 13 2 v 15 w(FILE,)f(O)p 268 1040 V 14 w(DIR)h Fq(or)g Fp(O)p 460 1040 V 15 w(SUBDIR)p Fq(\))g(may)f(be)h(pr)o(esent.)-18 1090 y(Ex)o(ample:)154 1156 y Fe(list)225 1195 y(l;)154 1274 y(l)18 b(=)f(makelist)f(\("*.c",)h(newer,)f("myprog.lib"\);)154 1314 y(printf)h(\("All)f(.c)i(files)e(newer)h(than)g(")296 1353 y("myprog.lib)f(are:)h(",)g(l,)g("\\n"\);)-59 1498 y Fn(printf)-59 1574 y Fp(\(int\))e(printf)g(\(int,)h(...\):)31 b Fq(This)15 b(function)g(displays)f(information.)27 b(The)16 b(ar)o(gu-)-59 1624 y(ment)o(s)10 b(de\014ne)f(the)h (information)g(t)o(o)g(print)g(and)f(may)g(be)h Fp(int)p Fq(s,)f Fp(list)p Fq(s)f(or)i Fp(string)p Fq(s.)-18 1674 y(A)f(list)f(is)g(print)o(ed)h(as)f(a)h(series)f(of)g(all)g(it)o(s)h (element)o(s)g(with)f(spac)o(es)h(in)f(between.)p -59 1706 534 2 v -35 1734 a Fi(10)1 1745 y Fh(The)h(o)o(v)o(erloaded)h(v)o (er)o(sions)f(ar)o(e)h(in)g(fact)g(macr)o(os,)e(e)o(xpanded)h(b)o(y)h (the)g(c)o(ompiler.)-35 1774 y Fi(11)1 1786 y Fh(The)f(o)o(v)o (erloaded)h(functions)e(ar)o(e)i(handled)f(b)o(y)h(the)g(c)o(ompiler)f Fg(icm-c)o(omp)p Fh(,)h(which)g(gener)o(at)o(es)-59 1826 y(appr)o(opriat)o(e)f(c)o(ode)h(t)o(o)g(mak)o(e)f(a)h(list)g(of)g (\014les)f(and)g(t)o(o)i(weed)e(out)h(a)f(part)h(of)f(this)h(list.)p eop %%Page: 42 43 42 42 bop -59 -127 a Fn(42)p -1 -127 937 2 v 961 w Fp(Act)o(a)13 b(Ic)o(cis)e(1994-1)-59 -11 y Fn(putenv)-59 66 y Fp(put)o(env)i (\(string\):)25 b Fq(This)12 b(function)h(may)h(be)g(used)e(t)o(o)j (set)f(envir)o(onment)g(v)o(ari-)-59 116 y(ables)k(during)f(the)h(e)o (x)o(ecution)h(of)f Fp(icmak)o(e)26 b Fq(pr)o(ogr)o(ams.)36 b(The)18 b(envir)o(onment)-59 166 y(v)o(ariables)12 b(r)o(emain)h (activ)o(e)h(during)d(the)i(c)o(omplet)o(e)i Fp(icmak)o(e)20 b Fq(run.)-18 213 y(Ex)o(ample:)83 287 y Fe(main\(\))83 326 y({)154 366 y(putenv\("CL=/c"\);)32 b(//)18 b(set)f(variable)154 405 y(system\("set"\);)68 b(//)18 b(show)e(settings)83 444 y(})-59 592 y Fn(sizeof)-59 669 y Fp(\(int\))j(sizeof)f(\(list\):) 37 b Fq(This)19 b(function)f(performs)i(the)g(same)g(action)g(as)f Fp(size-)-59 719 y(o\015ist\(\))p Fq(.)-59 828 y Fn(sizeo\015ist)-59 904 y Fp(\(int\))14 b(sizeo\015ist)f(\(list\):)28 b Fq(This)13 b(function)i(det)o(ermines)g(the)g(number)g(of)g(names)-59 954 y(held)d(in)g(a)g(list.)-18 1004 y(Ex)o(ample:)154 1086 y Fe(list)225 1125 y(l;)154 1165 y(int)225 1204 y(i;)154 1283 y(list)17 b(=)h(makelist)e(\("*.c"\);)154 1323 y(i)i(=)f(sizeoflist)f(\(l\);)154 1362 y(printf)h(\("There)f(are)h (",)g(i,)296 1402 y(")h(names)f(in)g(the)g(list.\\n"\);)-59 1550 y Fn(stat)-59 1626 y Fp(\(list\))8 b(st)o(at)g(\(int,)h(string\))p Fq(:)14 b(This)8 b(function)g(att)o(empt)o(s)j(t)o(o)f(r)o(etrie)o(v)o (e)h(\014le)d(attribut)o(es)-59 1676 y(of)j(the)h(\014le)g(speci\014ed) f(b)o(y)g(the)h(sec)o(ond)g Fp(string)f Fq(ar)o(gument.)17 b(The)11 b(\014r)o(st)h Fp(int)f Fq(ar)o(gu-)-59 1726 y(ment)16 b(may)g(be)f Fp(P)p 247 1726 13 2 v 15 w(CHECK)h Fq(or)g Fp(P)p 506 1726 V 15 w(NOCHECK)p Fq(.)g(When)f(absent,)i Fp(P)p 1073 1726 V 14 w(CHECK)f Fq(is)-59 1776 y(assumed.)g(The)c (making)f(pr)o(oc)o(ess)i(is)e(abort)o(ed)i(when)f Fp(st)o(at)f(\(\))h Fq(fails)f(t)o(o)h(r)o(etrie)o(v)o(e)-59 1826 y(\014le)g(attribut)o(es) i(and)e(when)g Fp(P)p 448 1826 V 14 w(CHECK)h Fq(is)f(giv)o(en)g(for)g (the)h(\014r)o(st)g(ar)o(gument.)p eop %%Page: 43 44 43 43 bop -59 -127 a Fp(ICMAKE)p 124 -127 1094 2 v 1119 w Fn(43)-59 -11 y Fq(The)13 b(r)o(eturned)g(list)f(holds)g(the)g (following)f(information:)-18 98 y Fo(\017)21 b Fq(The)c(\014r)o(st)g (element)h(is)e(a)h Fp(string)e Fq(r)o(epr)o(esent)o(ation)k(of)e(the)g (mode)h(of)e(the)24 148 y(\014le)11 b(or)h(dir)o(ect)o(or)o(y.)19 b(This)11 b(string)f(c)o(an)i(be)g(c)o(onv)o(ert)o(ed)i(t)o(o)e(an)g Fp(int)e Fq(wher)o(e)i(the)24 198 y(following)f(bit)o(s)h(r)o(epr)o (esent)i(the)f(modes:)74 312 y Fn({)20 b Fq(The)13 b(bit)f Fp(S)p 291 312 13 2 v 15 w(IFDIR)g Fq(is)g(set)h(when)f(the)g(entr)o(y) i(is)d(a)i(dir)o(ect)o(or)o(y.)74 387 y Fn({)20 b Fq(The)11 b(bit)g Fp(S)p 288 387 V 15 w(IFCHR)g Fq(is)f(set)h(when)f(the)h(entr)o (y)g(is)f(a)h(char)o(act)o(er-special.)74 462 y Fn({)20 b Fq(The)13 b(bit)f Fp(S)p 291 462 V 15 w(IFREG)h Fq(is)f(set)h(when)f (the)g(entr)o(y)i(is)d(a)i(r)o(egular)g(\014le.)74 538 y Fn({)20 b Fq(The)13 b(bit)f Fp(S)p 291 538 V 15 w(IREAD)i Fq(is)d(set)i(when)f(the)h(entr)o(y)g(is)f(r)o(eadable.)74 613 y Fn({)20 b Fq(The)13 b(bit)f Fp(S)p 291 613 V 15 w(IWRITE)h Fq(is)e(set)i(when)f(the)h(entr)o(y)g(is)f(writ)o(eable.)74 689 y Fn({)20 b Fq(The)13 b(bit)f Fp(S)p 291 689 V 15 w(IEXEC)h Fq(is)e(set)i(when)f(the)h(entr)o(y)g(is)f(e)o(x)o(ecut)o (able.)-18 802 y Fo(\017)21 b Fq(The)13 b(sec)o(ond)g(element)g(is)f (the)g(\014le)g(size,)h(also)f(r)o(epr)o(esent)o(ed)j(as)d(a)h Fp(string)p Fq(.)-59 934 y Fn(strlen)-59 1018 y Fp(\(int\))e(strlen)g (\(string\))p Fq(:)16 b(This)10 b(function)h(r)o(eturns)h(the)g(number) f(of)h(char)o(act)o(er)o(s)i(in)-59 1068 y(the)d(string)g(which)f(is)h (supplied)e(as)i(it)o(s)g(ar)o(gument.)17 b(It)o(s)11 b(working)g(is)f(analogous)-59 1118 y(t)o(o)k(the)e(function)g Fp(strlen\(\))h Fq(in)f Fn(C)471 1100 y Fj(12)503 1118 y Fq(.)-59 1249 y Fn(strlwr)-59 1334 y Fp(\(string\))d(strlwr)g (\(string\))p Fq(:)14 b(This)8 b(function)h(r)o(eturns)h(a)f(c)o(op)o (y)h(of)f(the)h(string)e(which)-59 1384 y(is)k(supplied)f(as)h(ar)o (gument)h(in)f(lower)h(c)o(ase)666 1366 y Fj(13)699 1384 y Fq(.)-59 1515 y Fn(strupr)-59 1600 y Fp(\(string\))8 b(strupr)h(\(string\))p Fq(:)14 b(This)8 b(function)g(r)o(eturns)i(a)e (c)o(op)o(y)i(of)f(the)g(string)f(which)-59 1650 y(is)k(supplied)f(as)h (ar)o(gument)h(in)f(upper)g(c)o(ase.)p -59 1706 534 2 v -35 1734 a Fi(12)1 1745 y Fh(This)e(function)e(is)i(a)g(macr)o(o,)f (e)o(xpanded)f(b)o(y)i(the)g(c)o(ompiler.)-35 1774 y Fi(13)1 1786 y Fh(The)15 b(string)h(functions)e Fg(strlwr\(\))k Fh(and)d Fg(strupr\(\))i Fh(ar)o(e)e(in)h(fact)f(macr)o(o's,)i(e)o (xpanded)d(b)o(y)i(the)-59 1826 y(c)o(ompiler.)p eop %%Page: 44 45 44 44 bop -59 -127 a Fn(44)p -1 -127 937 2 v 961 w Fp(Act)o(a)13 b(Ic)o(cis)e(1994-1)-59 -11 y Fn(strtok)-59 67 y Fp(\(list\))17 b(strt)o(ok)h(\(string,)g(string\):)34 b Fq(This)17 b(function)g(par)o (ses)h(the)h(\014r)o(st)f(string)f(in)-59 116 y(substrings,)c(separ)o (at)o(ed)k(fr)o(om)e(each)g(other)g(b)o(y)g(the)g(separ)o(at)o(or)o(s)h (speci\014ed)e(in)-59 166 y(the)g(sec)o(ond)h(string.)20 b(Each)15 b(substring)d(is)h(an)h(element)h(of)f(the)g(r)o(eturned)h (list.)-59 216 y(If)g(no)h(separ)o(at)o(or)o(s)i(ar)o(e)g(speci\014ed)d (\(i.e.,)j(the)e(sec)o(ond)h(string)e(is)h(empt)o(y\),)i(the)-59 266 y(individual)c(char)o(act)o(er)o(s)20 b(of)c(the)h(\014r)o(st)g (string)f(bec)o(ome)i(the)f(element)o(s)h(of)e(the)-59 316 y(r)o(eturned)d(list.)-18 366 y(Ex)o(ample:)154 449 y Fe(list)225 489 y(l;)154 528 y(int)225 567 y(i;)154 646 y(l)18 b(=)f(strtok\("Hello-worl)o(d\\n")o(,)e("-"\);)154 686 y(printf\("Two)h(elements:)f(",)j(l,)f("\\n"\);)154 765 y(l)h(=)f(strtok\("Hello-worl)o(d\\n")o(,)e(""\);)154 804 y(printf\("A)h(string)g(of)i(",)f(sizeof\(l\),)279 844 y(")g(characters\\n"\);)-59 1033 y Fn(substr)-59 1110 y Fp(\(int\))10 b(substr)e(\(string,)i(string\):)k Fq(This)9 b(function)g(sear)o(ches)i(for)f(the)g(string)f(which)-59 1160 y(is)i(giv)o(en)h(as)f(the)i(sec)o(ond)f(ar)o(gument)h(in)f(the)g (string)f(giv)o(en)h(as)f(\014r)o(st)i(ar)o(gument.)-59 1210 y(The)i(position)g(wher)o(e)h(the)f(sec)o(ond)g(string)g(oc)o(cur) o(s)h(in)f(the)g(\014r)o(st)g(string)g(is)f(r)o(e-)-59 1259 y(turned.)31 b(The)18 b(v)o(alue)f(-1)g(is)f(r)o(eturned)j(when)d (the)i(sec)o(ond)g(string)f(does)g(not)-59 1309 y(oc)o(cur)d(in)e(the)h (\014r)o(st)f(string)382 1291 y Fj(14)414 1309 y Fq(.)-59 1419 y Fn(system)-59 1497 y Fp(\(int\))j(s)o(yst)o(em)h(\(int,)g (string\):)29 b Fq(This)15 b(function)g(activ)o(at)o(es)j(the)e(oper)o (ating)h(s)o(ys-)-59 1547 y(t)o(em's)12 b(c)o(ommand)h(int)o(erpr)o(et) o(er)g(t)o(o)g(run)d(the)i(c)o(ommand)h(de\014ned)d(b)o(y)h(the)h(ar)o (gu-)-59 1596 y(ment.)26 b(The)16 b(string)e(holds)h(the)h(c)o(ommand)h (t)o(o)f(e)o(x)o(ecut)o(e)h(and,)f(if)f(needed,)i(it)o(s)-59 1646 y(ar)o(gument)o(s.)-18 1696 y(The)12 b(\014r)o(st)g(ar)o(gument)g (speci\014es)e(whether)i(a)f(failur)o(e)g(of)h(the)f Fp(s)o(yst)o(em)h(\(\))g Fq(func-)-59 1746 y(tion)h(should)f(t)o (erminat)o(e)k(the)d(making)g(pr)o(oc)o(ess.)20 b(The)13 b(v)o(alue)g(of)h(this)e Fp(int)g Fq(may)p -59 1786 534 2 v -35 1814 a Fi(14)1 1826 y Fh(This)e(function)e(is)i(a)g(macr)o(o,)f (which)h(is)g(e)o(xpanded)e(b)o(y)i(the)g(c)o(ompiler.)p eop %%Page: 45 46 45 45 bop -59 -127 a Fp(ICMAKE)p 124 -127 1094 2 v 1119 w Fn(45)-59 -11 y Fq(be)10 b Fp(P)p 28 -11 13 2 v 15 w(CHECK)h Fq(or)g Fp(P)p 277 -11 V 14 w(NOCHECK)p Fq(.)g(This)f(ar)o (gument)g(may)h(be)f(absent,)i(in)d(which)-59 39 y(c)o(ase)j Fp(P)p 63 39 V 14 w(CHECK)g Fq(is)e(assumed.)16 b(The)11 b(r)o(eturn)h(v)o(alue)f(of)g Fp(s)o(yst)o(em)g(\(\))h Fq(is)e(zer)o(o)i(when)-59 89 y(the)g(c)o(ommand)i(c)o(ould)e(suc)o(c)o (essfully)f(be)h(e)o(x)o(ecut)o(ed.)17 b(A)12 b(r)o(eturn)h(v)o(alue)f (which)f(is)-59 139 y(not)16 b(zer)o(o)g(c)o(an)h(only)e(be)g(r)o(ec)o (eiv)o(ed)i(b)o(y)f(the)f(mak)o(e\014le)i(when)e Fp(P)p 1007 139 V 14 w(NOCHECK)h Fq(is)-59 188 y(giv)o(en)c(as)g(\014r)o(st)h (ar)o(gument.)-18 247 y(The)k(de\014nition)e(of)h(a)g(suc)o(c)o(ess)h (or)f(failur)o(e)g(of)g Fp(s)o(yst)o(em)g(\(\))h Fq(depends)e(on)h(the) -59 297 y(used)e(platform.)26 b(Under)15 b(MS-DOS,)f Fp(s)o(yst)o(em)i(\(\))f Fq(suc)o(c)o(eeds)h(if)f(the)g(c)o(ommand)-59 347 y(c)o(ould)c(be)g(e)o(x)o(ecut)o(ed,)i(but)e(no)g(checks)h(on)f (the)g(r)o(eturn)h(v)o(alue)f(of)g(the)g(c)o(ommand)-59 397 y(it)o(self)i(c)o(an)g(be)h(made.)19 b(Under)13 b(UNIX,)h Fp(s)o(yst)o(em)f(\(\))h Fq(suc)o(c)o(eeds)g(if)f(the)g(c)o(ommand)-59 447 y(c)o(ould)18 b(be)f(e)o(x)o(ecut)o(ed)i(and)e(if)g(the)h(r)o (eturn)g(v)o(alue)g(of)f(the)h(c)o(ommand)h(it)o(self)e(is)-59 496 y(zer)o(o.)-59 661 y Fk(3.7)50 b(Pr)o(eloaded)16 b(s)o(ymbols)-59 754 y Fq(Sinc)o(e)d Fp(icmak)o(e)g Fq(c)o(an)h(be)e (used)h(on)f(a)h(v)o(ariet)o(y)h(of)e(platforms,)i(the)f(pr)o(epr)o(oc) o(essor)-59 804 y Fp(icm-pp)i Fq(tries)g(t)o(o)h(mak)o(e)h(an)e(educ)o (at)o(ed)i(guess)d(c)o(onc)o(erning)i(this)e(platform)i(in)-59 854 y(or)o(der)j(t)o(o)f(pr)o(ede\014ne)g(s)o(ymbols,)g(which)f(then)g (c)o(an)h(be)f(used)g(t)o(o)h(c)o(ontr)o(ol)h(the)-59 904 y(\015ow)12 b(of)h(the)g(mak)o(e\014le.)-18 963 y(The)18 b(s)o(ymbols)e(which)h(ar)o(e)h(pr)o(eloaded)g(b)o(y)f Fp(icm-pp)g Fq(ar)o(e)h Fp(MSDOS,)e(UNIX,)-59 1012 y(unix,)d(LINUX,)h (linux,)f(M)p 386 1012 V 14 w(SYSV,)h(M)p 574 1012 V 15 w(UNIX)g Fq(and)p 801 1012 V 29 w Fp(POSIX)p 945 1012 V 13 w(SOURCE)1124 995 y Fj(15)1156 1012 y Fq(.)g(Each)-59 1062 y(of)g(these)g(s)o(ymbols)g(is)f(r)o(ede\014ned)h(t)o(o)i(a)e (number:)20 b(r)o(espectiv)o(ely)15 b(1)e(when)h(`on')-59 1112 y(or)f(0)f(when)g(`o\013'.)17 b(E.g.,)c(the)g(c)o(ode)g(fr)o (agment)12 1239 y Fe(if)k(\(MSDOS\))83 1278 y(printf)g(\("Hey,)f(we're) h(running)f(under)h(DOS!\\n"\);)12 1317 y(else)83 1357 y(printf)g(\("Hmmm..)f(no)h(DOS..\\n"\);)-59 1524 y Fq(should)11 b(print)h(a)g(message)g(c)o(onc)o(erning)h(the)g(usage)e(of)h(an)g (MSDOS)g(platform.)-18 1583 y(Not)o(e)i(that)e Fp(icmak)o(e)h Fq(support)o(s)f(no)g Fp(#ifdef)e Fq(-)i Fp(#else)f Fq(-)h Fp(#endif)f Fq(c)o(onstructions:)-59 1633 y(the)i(pr)o(eloaded)g(s)o (ymbols)f(must)h(be)f(used)g(in)g Fp(if)g Fq(-)g Fp(else)g Fq(c)o(onstruct)o(s.)p -59 1707 534 2 v -35 1735 a Fi(15)1 1747 y Fh(These)g(names)g(ar)o(e)h(v)o(alid)g(for)g(the)f(default)h (inst)o(allation)f(of)h Fg(icmak)o(e)p Fh(.)22 b(An)12 b(actual)g(inst)o(alla-)-59 1786 y(tion)f(on)f(an)h(`e)o(x)o(otic')h (platform)e(may)h(use)g(an)g(additional)f(or)h(slightly)h(di\013er)o (ent)f(s)o(ymbol)h(name,)-59 1826 y(depending)d(on)g(the)h(c)o (ompilation)f(of)g(the)h Fg(icmak)o(e)p Fh(.)j(pr)o(ogr)o(ams)p eop %%Page: 46 47 46 46 bop -59 -127 a Fn(46)p -1 -127 937 2 v 961 w Fp(Act)o(a)13 b(Ic)o(cis)e(1994-1)-59 -10 y Fm(4)60 b(Summar)o(y)-59 109 y(A)f(K)o(e)o(ywor)o(ds)-59 203 y Fq(The)13 b(following)d(t)o(able) k(shows)d(the)i(k)o(e)o(ywor)o(ds)h(of)e(the)h Fp(icmak)o(e)h Fq(language.)p -23 271 1262 2 v 2 306 a(ar)o(ghead)71 b(ar)o(gt)o(ail)84 b(ascii)202 b(br)o(eak)148 b(chdir)2 356 y(cmdhead)51 b(cmdt)o(ail)64 b(change)p 570 356 13 2 v 15 w(base)50 b(change)p 857 356 V 15 w(e)o(xt)f(change)p 1113 356 V 15 w(path)2 406 y(echo)136 b(element)50 b(else)211 b(e)o(x)o(ec)175 b(e)o(x)o(ecut)o(e)2 456 y(e)o(xist)o(s)117 b(fget)o(s)e(for)232 b(fprintf)132 b(get)p 1039 456 V 16 w(base)2 505 y(get)p 64 505 V 16 w(e)o(xt)91 b(get)o(ch)105 b(get)p 496 505 V 16 w(path)123 b(get)o(s)178 b(if)2 555 y(int)171 b(list)146 b(mak)o(elist)123 b(newer)137 b(older)2 605 y(printf)115 b(put)o(env)72 b(r)o(eturn)166 b(sizeof)147 b(sizeo\015ist)2 655 y(st)o(at)153 b(string)95 b(strlwr)172 b(strt)o(ok)142 b(strupr)2 705 y(s)o(yst)o(em)91 b(while)101 b(y)o(ounger)p -23 721 1262 2 v -59 844 a Fm(B)60 b(S)o(ymbolic)18 b(c)o(onst)o(ant)o(s)-59 939 y Fq(The)13 b(following)d(s)o(ymbolic)j(c)o(onst)o(ant)o(s)h(ar)o(e)f (de\014ned:)p 175 1007 866 2 v 200 1042 a(Name)143 b(v)o(alue)50 b(Name)186 b(v)o(alue)p 175 1058 V 200 1093 a(OFF)258 b(0)50 b(ON)317 b(1)p 175 1110 V 200 1144 a(P)p 229 1144 13 2 v 16 w(CHECK)153 b(0)50 b(P)p 641 1144 V 15 w(NOCHECK)132 b(2)p 175 1161 866 2 v 200 1196 a(O)p 233 1196 13 2 v 16 w(FILE)201 b(1)50 b(O)p 645 1196 V 15 w(DIR)257 b(2)200 1246 y(O)p 233 1246 V 16 w(SUBDIR)130 b(4)50 b(O)p 645 1246 V 15 w(ALL)260 b(8)p 175 1262 866 2 v 200 1297 a(S)p 225 1297 13 2 v 15 w(IFDIR)180 b(1)50 b(S)p 637 1297 V 14 w(IFCHR)212 b(2)200 1347 y(S)p 225 1347 V 15 w(IFREG)176 b(4)50 b(S)p 637 1347 V 14 w(IREAD)213 b(8)200 1397 y(S)p 225 1397 V 15 w(IWRITE)127 b(16)50 b(S)p 637 1397 V 14 w(IEXEC)199 b(32)p 175 1413 866 2 v -59 1532 a Fm(C)60 b(Binar)o(y)18 b(oper)o(at)o(or)o(s)-59 1626 y Fq(In)d(the)g(following) f(t)o(able,)k(`all')d(means)g(that)h(the)g(t)o(ype)g(of)g(the)f(oper)o (and)i(left)-59 1676 y(of)h(the)g(oper)o(at)o(or)j(must)d(be)g(equal)g (t)o(o)h(the)f(t)o(ype)h(of)f(the)g(oper)o(and)h(right)f(of)-59 1726 y(the)d(oper)o(at)o(or.)25 b(The)15 b(oper)o(at)o(or)o(s)i(at)f (the)e(t)o(op)i(of)f(the)f(t)o(able)i(hav)o(e)e(the)h(lowest)-59 1776 y(priorit)o(y.)30 b(The)17 b(assignment)e(oper)o(at)o(or)o(s)20 b(ar)o(e)d(right-associativ)o(e,)i(the)e(other)-59 1826 y(binar)o(y)12 b(oper)o(at)o(or)o(s)j(ar)o(e)f(left-associativ)o(e.)p eop %%Page: 47 48 47 47 bop -59 -127 a Fp(ICMAKE)p 124 -127 1094 2 v 1119 w Fn(47)p 102 -51 1014 2 v 178 -23 a Fc(Operator)100 b(Operation)243 b(Allowed)10 b(types)p 102 -10 V 242 18 a Fh(,)165 b(sequential)9 b(e)o(v)o(aluation)63 b(all)10 b(\(mix)o(ed\))p 102 31 V 234 59 a(=)157 b(assignment)221 b(all)140 99 y({=)9 b(+=)g Fb(\003)p Fh(=)h(/=)63 b(c)o(ompound)8 b(assignment)49 b(arithm.)10 b(oper)o(at)o(or)o(s)170 138 y(\045=)f(&=)g Fb(j)p Fh(=)224 177 y(^)g(=)p 102 191 V 237 219 a Fb(jj)161 b Fh(logic)o(al)10 b(or)254 b(all)10 b(\(mix)o(ed\))p 102 232 V 222 260 a(&&)146 b(logic)o(al)10 b(and)230 b(all)10 b(\(mix)o(ed\))p 102 273 V 242 301 a Fb(j)166 b Fh(bitwise)10 b(or)241 b Fg(int)p 102 314 V 242 342 a Fh(^)165 b(e)o(x)o(clusiv)o(e)10 b(or)215 b Fg(int)p 102 355 V 235 383 a Fh(&)158 b(bitwise)10 b(and)217 b Fg(int)p 102 396 V 151 424 a Fa(<)11 b(>)f(<)p Fh(=)f Fa(>)p Fh(=)75 b(c)o(omparison)216 b Fg(int,)10 b(string)126 463 y Fh(newer,)g(y)o(ounger)49 b(\014le)10 b(dat)o(e)271 b Fg(string)207 503 y Fh(older)129 b(\014le)10 b(dat)o(e)271 b Fg(string)p 102 516 V 220 544 a Fa(<<)144 b Fh(left)o(shift)277 b Fg(int)220 583 y Fa(>>)144 b Fh(right)o(shift)p 102 597 V 234 624 a(+)157 b(addition)266 b(all)239 664 y({)162 b(subtr)o(action)220 b Fg(int,)10 b(list)p 102 677 V 238 705 a Fb(\003)162 b Fh(multiplic)o(ation)179 b Fg(int)239 744 y Fh(/)162 b(division)274 b Fg(int)237 784 y Fh(\045)160 b(modulo)277 b Fg(int)p 102 797 V -59 903 a Fm(D)60 b(Unar)o(y)17 b(oper)o(at)o(or)o(s)-59 993 y Fq(All)25 b(unar)o(y)h(oper)o(at)o(or)o(s)i(ar)o(e)f (right-associativ)o(e.)56 b(The)26 b(e)o(x)o(c)o(eption)g(is)f(the)-59 1043 y(e)o(xpr)o(ession-nesting)7 b(oper)o(at)o(or,)14 b(which)9 b(surr)o(ounds)g(an)h(e)o(xpr)o(ession)f(and)g(does)-59 1093 y(not)k(associat)o(e.)p 182 1122 853 2 v 207 1150 a Fc(Operator)48 b(Operation)182 b(Allowed)10 b(types)p 182 1163 V 270 1191 a Fh(!)112 b(logic)o(al)10 b(not)174 b(all)271 1230 y(~)113 b(bitwise)11 b(not)160 b Fg(int)263 1269 y Fh(+)105 b(unar)o(y)10 b(plus)172 b(all)268 1309 y({)110 b(unar)o(y)10 b(minus)142 b Fg(int)250 1348 y Fh(++)91 b(incr)o(ement)179 b Fg(int)10 b Fh(\(v)o(ariable)h(only\))255 1388 y({)e({)97 b(decr)o(ement)171 b Fg(int)10 b Fh(\(v)o(ariable)h (only\))230 1427 y(\()p Fg(t)o(ype)p Fh(\))75 b(t)o(ype)11 b(c)o(ast)197 b(see)10 b(3.5)260 1467 y(\()g(\))103 b(e)o(xpr)o(ession) 9 b(nesting)49 b(all)p 182 1480 V -59 1585 a Fm(E)60 b(T)o(ype)18 b(c)o(ast)o(s)-59 1676 y Fq(The)12 b(following)f(t)o(able) i(shows)f(the)g(allowed)g(t)o(ype)h(c)o(ast)o(s.)18 b(\(Ok\))c(is)d (used)h(in)f(the)-59 1726 y(t)o(able)17 b(t)o(o)h(indic)o(at)o(e)f (that)h(no)e(special)h(action)g(is)f(needed.)29 b(The)17 b(c)o(onv)o(er)o(sions)-59 1776 y Fp(it)o(oa)p Fq(,)i Fp(at)o(oi)e Fq(and)g Fp(at)o(ol)g Fq(specify)g(r)o(espectiv)o(ely)i Fp(int)d(t)o(o)h(ascii)p Fq(,)i Fp(ascii)d(t)o(o)h(int)g Fq(and)-59 1826 y Fp(ascii)11 b(t)o(o)h(list)p Fq(.)p eop %%Page: 48 49 48 48 bop -59 -127 a Fn(48)p -1 -127 937 2 v 961 w Fp(Act)o(a)13 b(Ic)o(cis)e(1994-1)p 280 -51 657 2 v 537 -11 2 40 v 653 -23 a Fh(c)o(ast)f(r)o(esult:)p 538 -10 399 2 v 537 28 2 40 v 563 16 a(\(int\))51 b(\(string\))f(\(list\))p 280 30 657 2 v 305 57 a(c)o(ast)10 b(oper)o(and:)p 537 69 2 40 v 280 71 259 2 v 387 97 a(int)p 537 109 2 40 v 135 w(\(ok\))79 b(it)o(oa)94 b(|)364 136 y(string)p 537 148 V 113 w(at)o(oi)78 b(\(ok\))j(at)o(ol)p 280 150 657 2 v 288 180 a(\(ok\))11 b(means:)h(no)d(special)h(c)o(asting)g (performed)-59 440 y Fm(F)59 b(Oper)o(and)18 b(matrix)p 375 584 2 40 v 443 573 a Fc(int)p 550 584 V 140 w(string)p 787 584 V 146 w(list)p 979 584 V 236 586 744 2 v 375 625 2 40 v 413 614 a Fg(all)10 b(but)p 550 625 V 787 625 V 979 625 V 375 665 V 416 653 a Fh(newer)p 550 665 V 787 665 V 979 665 V 261 693 a Fc(int)p 375 704 V 120 w Fh(older)p 550 704 V 148 w(|)p 787 704 V 181 w(|)p 979 704 V 375 744 V 401 732 a(y)o(ounger)p 550 744 V 787 744 V 979 744 V 375 783 V 550 783 V 787 783 V 979 783 V 236 785 744 2 v 375 824 2 40 v 550 824 V 599 812 a(==)g(!=)f Fa(>)p 787 824 V 979 824 V 375 864 V 550 864 V 592 852 a(<)h(<)p Fh(=)g Fa(>)p Fh(=)p 787 864 V 979 864 V 261 891 a Fc(string)p 375 903 V 97 w Fh(|)p 550 903 V 126 w(+)g(+=)f(=)p 787 903 V 134 w(|)p 979 903 V 375 943 V 550 943 V 576 931 a(newer)h(older)p 787 943 V 979 943 V 375 982 V 550 982 V 607 970 a(y)o(ounger)p 787 982 V 979 982 V 236 984 744 2 v 375 1023 2 40 v 550 1023 V 787 1023 V 979 1023 V 375 1063 V 550 1063 V 787 1063 V 832 1051 a(==)g(!=)p 979 1063 V 261 1090 a Fc(list)p 375 1102 V 138 w Fh(|)p 550 1102 V 173 w(|)p 787 1102 V 171 w(+)g({)p 979 1102 V 375 1141 V 550 1141 V 787 1141 V 813 1130 a(+=)f({=)g(=)p 979 1141 V 375 1181 V 550 1181 V 787 1181 V 979 1181 V 236 1183 744 2 v -59 1419 a Fm(G)60 b(Number)o(s)18 b(and)f(identi\014er)o(s)-59 1553 y Fq(Number)o(s)c(ar)o(e)h(int)o(egr)o(al)f(v)o(alues)g(of)f(at)i (most)g(32767)e(\(negativ)o(e)h(number)o(s)g(ar)o(e)-59 1603 y(obt)o(ained)g(using)e(e.g.,)h(the)h(unar)o(y)f(minus.)-18 1676 y(Identi\014er)o(s)22 b(ar)o(e)h Fn(C)p Fq(-lik)o(e)e (identi\014er)o(s:)35 b(the)o(y)22 b(st)o(art)h(with)e(an)h(under)o(sc) o(or)o(e)-59 1726 y(or)i(lett)o(er,)29 b(and)23 b(c)o(onsist)h (furthermor)o(e)h(of)f(alphanumeric)f(char)o(act)o(ers)j(or)-59 1776 y(under)o(sc)o(or)o(es.)49 b(The)23 b Fp(icm-c)o(omp)29 b Fq(c)o(ompiler)24 b(int)o(erpr)o(et)o(s)g(identi\014er)o(s)f(c)o (ase-)-59 1826 y(sensitiv)o(ely.)p eop %%Page: 49 50 49 49 bop -59 -127 a Fp(Inde)o(x)p 61 -127 1156 2 v 1180 w Fn(49)-59 -10 y Fm(H)60 b(Esc)o(ape)18 b(sequenc)o(es)p 238 52 740 2 v 263 80 a Fc(Escape)10 b(sequence)48 b(Action)p 238 93 V 374 121 a Fb(n)p Fh(a)161 b(alert)9 b(\(bell\))373 161 y Fb(n)p Fh(b)160 b(backspac)o(e)8 b(char)o(act)o(er)378 200 y Fb(n)p Fh(f)164 b(formfeed)8 b(char)o(act)o(er)373 239 y Fb(n)p Fh(n)160 b(newline)376 279 y Fb(n)p Fh(r)j(c)o(arriage)9 b(r)o(eturn)h(char)o(act)o(er)377 318 y Fb(n)p Fh(t)163 b(t)o(ab)374 358 y Fb(n)p Fh(v)e(v)o(ertic)o(al)10 b(t)o(ab)341 397 y Fb(n)p Fg(other)127 b Fh(lit)o(er)o(al)11 b Fg(other)p 238 411 V eop %%Page: 50 51 50 50 bop -59 -127 a Fn(50)p -1 -127 937 2 v 961 w Fp(Act)o(a)13 b(Ic)o(cis)e(1994-1)p eop %%Page: 51 52 51 51 bop -59 -127 a Fp(Inde)o(x)p 61 -127 1156 2 v 1180 w Fn(51)p eop %%Page: 52 53 52 52 bop -59 -127 a Fn(52)p -1 -127 937 2 v 961 w Fp(Act)o(a)13 b(Ic)o(cis)e(1994-1)p eop %%Trailer end userdict /end-hook known{end-hook}if %%EOF icmake-10.03.00/doc/icmstart.10000644000175000017500000001764314204245360014640 0ustar frankfrank.TH "icmstart" "1" "1992\-2022" "icmake\&.10\&.03\&.00" "starts icmbuild program maintenance" .PP .SH "NAME" icmstart \- A startup script for icmbuild program maintenance .PP .SH "SYNOPSIS" \fBicmstart\fP \fI[Options]\fP top\-dir [program|library] .PP .SH "DESCRIPTION" .PP Although \fIicmake\fP\-scripts can be written from scratch to handle program maintenance, often the required actions are highly comparable\&. This observation resulted in the construction of two \fIicmake\fP\-tools: \fBicmstart\fP(1), initializing a directory for program development and \fBicmbuild\fP(1), handling the actual program maintenance\&. Both come predefined with \fIicmake\(cq\&s\fP distribution, to initialize and maintain \fBC++\fP programs (or, after minimal adaptation, \fBC\fP) programs)\&. They can also easily be tailored to other programming languages\&. The \fIicmstart\fP script and \fIicmbuild\fP program can directly be called: \fIicmstart\fP is an \fIicmake\fP script, for which the command\-shell calls \fIicmake\fP; \fIicmbuild\fP is a small \fBC\fP program calling \fIicmake\fP to process the \fIicmbuild\fP script in (commonly) \fI/usr/lib/icmake\fP\&. .PP This man\-page covers \fBicmstart\fP; refer to the \fBicmbuild\fP(1) man\-page for information about how \fIicmbuild\fP can be used\&. .PP The \fBicmstart\fP script is a generic script that is used to initialize a directory with a basic set of files that are commonly used when developing a \fBC++\fP or \fBC\fP program\&. .PP \fBIcmstart\fP creates an initial directory (here named `\fItop\-dir\fP\(cq\&) and installs the files \fICLASSES, VERSION\fP and \fIicmconf\fP below \fItop\-dir\fP\&. A second argument `\fIprogram\fP\(cq\& or `\fIlibrary\fP\(cq\& may be specified as the default mode of operation of the \fBicmbuild\fP(1) script, usually resulting in adding additional skeleton source files\&. If the predefined set of files doesn\(cq\&t fit your needs, then the default set can easily be modified\&. The default set of skeleton files is listed in the file \fI/etc/icmake/icmstart\&.rc\fP\&. Refer to the \fBicmstart\&.rc\fP(7) man\-page for information about how this file is structured and how it can be adapted\&. .PP After switching to the directory created by \fBicmstart\fP \fBicmbuild\fP(1) may be used for program maintenance\&. .PP .SH "OPTIONS" .PP \fIIcmstart\fP supports the following options, which (when specified) must be \fIicmstart\(cq\&s\fP first arguments: .IP o \fI\-b\fP .br basic installation: the files \fIVERSION, usage\&.cc\fP and \fIversion\&.cc\fP are not installed, and the \fI#define USE_VERSION\fP entry in icmconf is commented out; .IP .IP o \fI\-c confpath\fP .br use the configuration files (\fIicmstart\&.rc, AUTHOR, YEARS\fP and \fIVERSION\fP) if found in `confpath\(cq\& rather than using the files found in \fI~/\&.icmake\fP and/or \fI/etc/icmake/\fP\&. Once a file is found it is used, allowing partial overrides of the default files provided by \fBicmake\fP(1); .IP .IP o \fI\-d\fP .br do not execute any commands, but show the commands that would have been executed on the standard output; .IP .IP o \fI\-I\fP .br do not install files; .IP .IP o \fI\-r\fP .br unconditionally replace existing files\&. If \fI\-r\fP is not provided \fBicmstart\fP asks the user to confirm that an existing file must be overwritten\&. If a skeleton specification refers to a directory, the full directory and its subdirectories are replaced; .IP .IP o \fI\-s skeleton\-path\fP .br by default skeleton files are listed in the skeleton resource file \fI/usr/share/icmake/icmstart\&.rc\fP\&. Alternatively, the skeleton resource file may be specified by the \fIICM\fP environment variable, which \-in turn\- may be overruled by the path specified with the \fI\-s\fP option\&. The skeleton path may be specified as a full file\-path or as a directory, in which case the skeleton resource file is assumed to be \fIicmstart\&.rc\fP (see below at \fBSKELETON FILES\fP)\&. Since \fBicmstart\fP uses \fIcp\fP to install files, \fIcp\fP must be available when \fBicmstart\fP should install skeleton files\&. .PP .SH "SKELETON FILES" .PP Skeleton resource files may contain comment (empty lines and lines beginning with the hash\-mark (\fI#\fP))\&. Comment lines are ignored\&. Otherwise, lines should contain specifications of resource \fBs\fP to be installed\&. .PP The default resource specification file is \fI/etc/icmake/icmstart\&.rc\fP, containing: .nf CLASSES icmconf P main\&.cc P main\&.ih P usage\&.cc P version\&.cc P ? scanner P ? parser .fi This file is overruled by \fI~/\&.icmake/icmstart\&.rc\fP\&. The \fI~/\&.icmake\fP directory (called `configuration directory\(cq\& below) can be prepared using the following system command: .nf cp \-r /etc/icmake ~/\&.icmake .fi This directory can also contain skeleton files\&. Default skeleton files are commonly found in \fI/usr/share/icmake\fP, and could be copied to the configuration directory and referred to by the configuration directory\(cq\&s file \fIicmstart\&.rc\fP\&. See \fBicmstart\&.rc\fP(7) for details about how skeleton files can be referred to \fIicmstart\&.rc\fP\&. .PP .SH "CONFIGURATION FILES" .PP The configuration files \fIicmstart\&.rc, AUTHOR, YEARS\fP and \fIVERSION\fP are recognized as skeleton files and are, if available, processed by \fIicmstart\fP\&. .PP If the \fI\-c\fP option was specified configuration files found in the path specified at this option are used\&. If not specified or if a file isn\(cq\&t found then the path \fI~/icmake\fP is inspected\&. If a configuration file isn\(cq\&t found in \fI~/icmake\fP either, configuration files in \fI/etc/icmake\fP are used\&. .PP Configuration files are optional; if absent \fIicmstart\fP can still be used, but in normal cases at least \fIicmstart\&.rc\fP is provided\&. .PP In addition to \fIicstart\&.rc\fP consider defining the files \fIAUTHOR, VERSION,\fP and \fIYEARS\fP in the configuration directory: .IP o If the file \fIAUTHOR\fP exists it should have one line, defining the author of the program\&. E\&.g\&., .nf #define AUTHOR \(dq\&Frank B\&. Brokken \(dq\& .fi If it does not exist \fIicmstart\fP uses the default: .br \fI#define AUTHOR \(dq\&\(dq\&\fP\&. .IP .IP o If the file \fIVERSION\fP exists it should have one line, defining the program\(cq\&s version\&. E\&.g\&., .nf #define VERSION \(dq\&1\&.00\&.00\(dq\& .fi If it does not exist \fIicmstart\fP uses the default: .br \fI#define VERSION \(dq\&0\&.01\&.00\(dq\&\fP\&. .IP .IP o If the file \fIYEARS\fP exists it should have one line, defining the program\(cq\&s initial release year or range of release years\&. E\&.g\&., .nf #define YEARS \(dq\&2020\(dq\& .fi or a range of years can be defined: .nf #define YEARS \(dq\&1992\-2020\(dq\& .fi If it does not exist \fIicmstart\fP uses the default: .br \fI#define YEARS \(dq\&yyyy\(dq\&\fP where \fIyyyy\fP is the current year\&. .PP The \fIAUTHOR, VERSION,\fP and \fIYEARS\fP definitions are concatenated to one file, called \fIVERSION\fP, installed in the top\-level directory\&. .PP If the file \fIicmstart\&.rc\fP does not exist (or is empty) \fIicmstart\fP merely installs the top\-level directory, \fIicmconf\fP and \fIVERSION\fP\&. .PP .SH "FILES" The mentioned paths are sugestive only and may be installation dependent: .IP o \fB/usr/share/icmake/icmconf\fP Example of a \fBicmbuild\fP configuration file; .IP o \fB/usr/share/icmake/CLASSES\fP Example of a \fBicmbuild\fP \fICLASSES\fP file\&. .IP o \fB/etc/icmake/icmstart\&.rc\fP Default skeleton resource file\&. .PP .SH "SEE ALSO" \fBicmake\fP(1), \fBicmbuild\fP(1), \fBicmconf\fP(7), \fBicmstart\&.rc\fP(7)\&. .PP .SH "BUGS" Path names containing blanks are not supported\&. .PP .SH "COPYRIGHT" This is free software, distributed under the terms of the GNU General Public License (GPL)\&. .PP .SH "AUTHOR" Frank B\&. Brokken (\fBf\&.b\&.brokken@rug\&.nl\fP)\&. .PP icmake-10.03.00/etc/0000755000175000017500000000000014203741153012723 5ustar frankfrankicmake-10.03.00/etc/icmake/0000755000175000017500000000000014203741153014154 5ustar frankfrankicmake-10.03.00/etc/icmake/icmstart.rc0000644000175000017500000000110314204126313016317 0ustar frankfrank# This file contains lines mentioning frame files to install by icmstart(1) # empty lines and lines starting with # are ignored. # Files and directories are installed by tar, see icmstart(1)'s man-page # Lines starting with P are not installed when 'icmstart xxx library' is # issued. # Lines starting with L are not installed when 'icmstart xxx program' is # issued. # User-confirmation is required for entries on lines having a ? following # the optional P or L. CLASSES icmconf P main.cc P main.ih P usage.cc P version.cc P ? scanner P ? parser icmake-10.03.00/examples/0000755000175000017500000000000014203741153013766 5ustar frankfrankicmake-10.03.00/examples/8.00/0000755000175000017500000000000014203741153014353 5ustar frankfrankicmake-10.03.00/examples/8.00/strformat.im0000644000175000017500000000036014204126313016716 0ustar frankfrank#!/usr/bin/icmake -qi int main(int argc, list argv) { int i; string str; for (i = 0 ; i != listlen(argv); ++i) { if (strlen(argv[i]) != 0) str += strformat("arg %1 is '%2'\n", i + 1, argv[i]); } printf("%1", str); return 0; } icmake-10.03.00/examples/7.00/0000755000175000017500000000000014203741153014352 5ustar frankfrankicmake-10.03.00/examples/7.00/index.im0000644000175000017500000000026714204126313016011 0ustar frankfrankvoid main(int argc, list argv) { list lst = strtok("aap noot mies", " "); int idx; for (idx = listlen(lst); idx--; ) printf(lst[idx][idx], "\n"); exit(0); } icmake-10.03.00/examples/7.00/getenv.im0000644000175000017500000000021514204126313016163 0ustar frankfrankvoid main(int argc, list argv) { list term = getenv("TERM"); printf(element(0, term), ": ", element(1, term), "\n"); exit(0); } icmake-10.03.00/examples/7.00/backtick.im0000644000175000017500000000013214204126313016444 0ustar frankfrankvoid main(int argc, list argv) { string cmd = "ls"; printf(`cmd`); exit(0); } icmake-10.03.00/examples/7.00/strfind.im0000644000175000017500000000050414204126313016345 0ustar frankfrankvoid main(int argc, list argv) { if (argc < 3) { printf("Argc = ", argc, ": provide needle (arg1) and haystack (arg2)\n"); exit(1); } printf(element(1, argv), ": `", element(2, argv), "' at ", strfind(element(1, argv), element(2, argv)), "\n"); exit(0); } icmake-10.03.00/examples/7.00/strlwr.im0000644000175000017500000000037514204126313016237 0ustar frankfrankvoid main(int argc, list argv) { string line; if (argc == 1) { printf("provide string to be changed to lowercase\n"); exit(1); } line = element(1, argv); printf(line, ": ", strlwr(line), "\n"); exit(0); } icmake-10.03.00/examples/7.00/define.im0000644000175000017500000000022214204126313016123 0ustar frankfrank#define SUBST "substituted" #define LINE "This is " ${SUBST} " as one line\n" void main(int argc, list argv) { printf(LINE); exit(0); } icmake-10.03.00/examples/7.00/ifdef.im0000644000175000017500000000047314204126313015756 0ustar frankfrank//#define X #define Y void main(int argc, list argv) { #ifdef X printf("X, "); #ifdef Y printf("Y"); #else printf("NON-Y"); #endif #else printf("NON-X, "); #ifdef Y printf("Y"); #else printf("NON-Y"); #endif #endif printf("\n"); exit(0); } icmake-10.03.00/examples/7.00/substr.im0000644000175000017500000000070114204126313016215 0ustar frankfrankvoid main(int argc, list argv) { if (argc < 4) { printf("Argc = ", argc, ": provide string (arg1), offset (arg2) and count (arg3)\n"); exit(1); } printf(element(1, argv), ": from ", element(2, argv), " over ", element(3, argv), " chars: ", substr(element(1, argv), (int)element(2, argv), (int)element(3, argv)), "\n"); exit(0); } icmake-10.03.00/examples/am0000755000175000017500000001500514204126313014306 0ustar frankfrank#! /usr/bin/icmake -t. // This script implements a non-destructive rm (am: attic move) #define YEAR "1994--2016" #define VERSION "1.14.01" #define ATTIC_DIR "/.attic" // append after $HOME #define ATTIC_ZIP "attic.zip" // the zip-name int flags_done, extract, viewmode, debug; string home, attic, cwd, progname, recurs, forced, unzipflag; void kill(string s) { printf(s, "\n\n"); exit(1); } void preamble(list argv, list envp) { int index; cwd = chdir("."); // get cwd for (index = 0; home = element(index, envp); index += 2) { if (home == "HOME") // HOME found { // get it home = element(index + 1, envp); break; // and done } } if (!home) kill("$HOME not found"); progname = change_ext(element(0, argv), ""); attic = home + ATTIC_DIR; // set $HOME/.attic, change to } void check_attic() { if (!exists(attic)) // attic should exist { printf(attic, " does not exist. Create it [y/n] ? "); if (getch() != "y") // not a "y" ? kill("ok."); system("mkdir " + attic); // make the attic subdir exec("chmod", 700, attic); // private use } // else attic must be dir else if (!((int)element(0, stat(attic)) & S_IFDIR)) kill("'" + attic + "' is not a directory"); attic += "/" + ATTIC_ZIP; // append the zip-name chdir("/"); // go to the root } void set_flags(string arg) { int index; string flag; // process all arguments for (index = 1; flag = element(index, arg); index++) { if (flag == "r") // process encountered options recurs = "-r"; else if (flag == "d") debug++; else if (flag == "f") forced = "-f"; else if (flag == "x") extract++; else if (flag == "v") { extract++; viewmode++; unzipflag = "-l "; } else kill("Unrecognized flag '-" + flag + "': " + progname + "aborted"); } if (extract && unzipflag == "") unzipflag = "-u "; // use proper unzip flag } list options(int argc, list argv) { int index; list ret; string arg; for (index = 0; index < argc; index++) { arg = element(index, argv); // get next argument if (element(0, arg) == "-") // first element is a - ? set_flags(arg); // then set flags else ret += (list)arg; // or add to list to return } return (ret); // returned list } void usage() { printf ( "\n" "ICCE AM (Attic Move) non-destructive remove. Version " VERSION "\n" "Copyright (c) ICCE " YEAR ". All Rights Reserved\n" "\n" "AM by Frank B. Brokken\n" "\n" "Usage: ", progname, " [options] file(s)\n" "Where:\n" " options:\n" " -d: Debug mode: no execution but display of commands\n" " -f: Forced processing of indicated files\n" " -r: Recursive removal of directory contents\n" " -v: View current contents of the attic\n" " -x: Extract files from the attic to their original place\n" " (i.e., if you are permitted to do so...\n" "\n" " file(s): names of files and directories to move to/from the attic\n" "\n" " ", home, ATTIC_DIR, "/", ATTIC_ZIP, " is used to store the files.\n" "\n" ); exit (1); } string prefix_path(string file) { string el, ret; int index; if (element(0, file) != "/") // if file isn't an absolute path file = cwd + file; // then make an absolute path for (index = 1; el = element(index, file); index++) ret += el; // remove first char from abs path return (ret); // return modified string } void retrieve(string file) { string cmd; cmd = "unzip " // update only + unzipflag + attic; if (!viewmode) cmd += " " + prefix_path(file); // and the file (+ path prefix) if (debug) printf("( cd /; ", cmd, " )\n"); // debug: show command else system(cmd); // else exec cmd } void remove(string file) { string cmd; cmd = "zip -my " // remove, remove links as links + forced // maybe forced + " " + recurs // maybe recursive + " " + attic // target zip + " " + prefix_path(file); // and the file (+ path prefix) if (debug) printf("( cd /; ", cmd, " )\n"); // debug: show command else system(cmd); // else exec cmd } void one_file(string file) { if (extract) // either retrieve or remove retrieve(file); // the file else remove(file); } void process(int argc, list argv) { int index; for (index = 1; index < argc; index++) one_file(element(index, argv)); // process one file } int main(int argc, list argv, list envp) { echo (OFF); preamble(argv, envp); // set progname and attic dir. argv = options(argc, argv); // get the options argc = listlen(argv); // determine remaining arguments if (argc == 1 && !viewmode) // none left and no viewmode ? usage(); // give usage and exit 1 check_attic(); // check accessability of attic if (viewmode) // view contents retrieve(""); else // or process(argc, argv); // process remaining arguments return (0); // done } icmake-10.03.00/examples/initialization0000755000175000017500000000026414204126313016741 0ustar frankfrank#!/usr/bin/icmake -t. int main() { int one; // = 5; string a, b; a = "initialization"; b = "initialization"; if (a older b) printf(one, "\n"); } icmake-10.03.00/examples/r0000755000175000017500000000633514204126313014160 0ustar frankfrank#!/usr/bin/icmake -t. /* This simple icmake script starts a given command in the current directory, and then recursively in all subdirectories. For the installation: see the sample script "tolower" (or, "tolower.im"). */ #define VER "1.04" int haswildcard (string s) // does s have wildcards { // in it? if (strfind(s, "?") > -1 || // if ? or * occurs: strfind(s, "*") > -1 // yes -- it has wildcards ) return (1); return (0); // otherwise, none } string makecmd (list cmd) // make one long cmd by { // expanding list elements string ret; // returned cmd int i, // outer/inner loop j, // counters expanded; // flag: expanded stuff? list aux; // expanded inner list expanded = listlen (cmd) <= 1; // expansion must occur when // arguments are in cmd ret = element (0, cmd); // add program name itself for (i = 1; i < listlen (cmd); i++) // for all other elements: if (aux = makelist (element (i, cmd))) // expand element, and add { expanded = 1; // argument expanded for (j = 0; j < listlen (aux); j++) // add expansion ret += " " + element (j, aux); } else if (! haswildcard (element (i, // when no expansion: add cmd))) // only if no wildcards in it ret += " " + element (i, cmd); if (expanded) // when args expanded: return (ret); // return the string return (""); // else, it's a non-valid cmd } void process (list cmd) { list dirs; // list of subdirs int i; // counter for subdirs or string // command name list cwd, // stored current working dir sys; // expanded command to run cwd = chdir ("."); // get cwd if (sys = makecmd (cmd)) // make cmd { printf ("==== r: directory ", cwd, // print this dir " ====\n"); system (P_NOCHECK, sys); // run the cmd } if (dirs = makelist (O_SUBDIR, "*")) // get list of subdirs { for (i = 0; i < listlen (dirs); i++) // for each one: { chdir (element (i, dirs)); // go there process (cmd); // recursively run cmd chdir (cwd); // and.. back again } } } void main (int argc, list argv) { echo (0); // suppress re-echoing if (argc == 1) // usage info if no { // cmdline arguments printf ("ICCE Recursive Command-expander Version ", VER, "\n" "Copyright (c) ICCE 1993,1994. All rights reserved.\n" "\n" "Usage: r program arguments\n" "Will run \"program arguments\" in this directory and" " recursively in the\n" "subdirectories.\n" "\n"); exit (1); } argv -= (list) element (0, argv); // remove makefile name process (argv); // and.. start at current // dir exit (0); // done. } icmake-10.03.00/examples/keep0000755000175000017500000000542114204126313014636 0ustar frankfrank#!/bin/sh ########################################################################### # Shell script to remove all but the arguments on the commandline, # assuming that you're removing stuff from the current dir. VER=1.03 PROG=`basename $0` # print info and die usage () { cat << ENDUSAGE ICCE Directory Cleaner $VER Copyright (c) K. Kubat (karel@icce.rug.nl) / ICCE 1995. All rights reserved. Another MegaHard Production! Usage: keep [-t] [-v] [-rf] file(s) where: -t : (optional) flag, tryout mode -- must be first argument -v : (optional) flag, increases verbosity -r : (optional) flag, specifying recursive removal of files -f : (optional) flag, specifying forced removal of files file(s) : files to keep, others are removed the files must be in the current directory ENDUSAGE exit 1 } # print error msg and die error () { echo $PROG: $* exit 1 } # verbose message chat () { if [ "$VERBOSE" != "" ] ; then echo keep: $@ fi } ############################################################################ # main starts here # assume options are off RECURSIVE="" FORCED="" TRYOUT=no VERBOSE="" # parse flags moreargs=yes while [ $moreargs = yes ] ; do case $1 in -t ) TRYOUT=yes chat "tryout mode" shift ;; -rf ) RECURSIVE=-r FORCED=-f chat "recursive and forced removal" shift ;; -fr ) RECURSIVE=-r FORCED=-f chat "recursive and forced removal" shift ;; -r ) RECURSIVE=-r chat "recursive removal" shift ;; -f ) FORCED=-f chat "forced removal" shift ;; -v ) VERBOSE=yes shift ;; -* ) error no such flag $1 defined, -r -f -fr -rf -v supported only ;; * ) moreargs=no ;; esac done # any arguments? if [ "$1" = "" ] ; then usage fi # build list of files] for f in $* ; do FILES=`echo $FILES $f | sed 's/\///'` done chat "all files or directories to keep: $FILES" # check that all files are real ones for f in $FILES ; do if [ ! -f $f -a ! -d $f ] ; then error specified file or directory $f not found, cannot keep it fi done # get a listing of cur dir LST=`ls -1` # if not recursive removal: keep only true files in the list if [ "$RECURSIVE" != "-r" ] ; then for f in $LST ; do if [ -f $f ] ; then NEWLIST=`echo $NEWLIST $f` fi done LST=$NEWLIST fi for f in $FILES ; do LST=`echo $LST | tr ' ' '\n' | grep -v "^$f$"` done chat "list of files to remove: $LST" if [ "$LST" = "" ] ; then error "no files to remove" fi if [ "$TRYOUT" = "yes" ] ; then echo 'Files that would be removed:' echo "$LST" else rm $RECURSIVE $FORCED `echo "$LST"` \ || error 'problem while removing files' fi exit 0 icmake-10.03.00/examples/ftpxfer0000755000175000017500000001347714204126313015402 0ustar frankfrank#!/usr/bin/icmake -qi /*************************************************************************** This file shows an example of a shell around ftp. I use this program a lot in situations where I want to transfer a file from one unix host to another, and when I know beforehand what file from what directory I want to transfer. For the installation: - copy this file to your personal bin directory, under the name ftpxfer - make the file executable: chmod +x ftpxfer The program will prompt for the user name and password to use for the ftp transfer. If you often access one host with this program, and don't wont to type the user/password all the time, you can do the follwing for bash: > set FTPUSER my_login_name_on_that_host > export FTPUSER > set FTPASS my_password_on_that_host > export FTPASS For tcsh, try: > setenv FTPUSER my_login_name_on_that_host > setenv FTPASS my_password_on_that_host Net result: this program won't prompt you for the strings, but will retrieve them from the environment table. You can, of course, place these commands in your .login or .tcshrc file, to be executed automatically during the login procedure. But then it may be a good idea to make these files read/write only for you and for nobody else (e.g., by: chmod 644 .login). OB The actual ftp transfer occurs using an intermediate temporary file, TMPFILE in the below #define's. The user name and password _are_ stated in that file, but this should not be a security risk. First, the file is read/write for the user only, and for no-one else. Second, the file gets deleted as soon as it's no longer needed. If you consider this feature still a security hazard, take a valium and don't use this program. *****************************************************************************/ // here's a couple of defines, no need to change them.. #define VER "1.02" #define YEARS "1993" // the following define controls ftp's `verbatim' mode, set it to "-v" // if you want verbatim, or to "" if you don't #define VERBATIM "-v" list envp; // environment strings string tmpfile, // temp file for ftp use host, // host to transfer from/to dir, // foreign directory file, // local file direction; // "get" or "put" file? void inittmp () // purpose: initialize temp { // file if (exists (tmpfile)) // remove any old version exec ("rm", tmpfile); // if it exists exec ("touch", tmpfile); // make empty file exec ("chmod", "600", tmpfile); // make it r/w only for user } void process () // purpose: do the actual { // ftp transfer string foreignfile; // full name of foreign file inittmp (); // make new temp file if (dir) // if foreign dir specified: foreignfile = change_path (file, dir); // use that else if (get_path (file)) // if file spec has its own foreignfile = file; // directory: keep it else // otherwise: use current foreignfile = change_path (file, // directory as dest dir chdir (".")); string user; string password; if (list xuser = getenv ("FTPUSER") ) // get username from envp user = xuser[1]; else { // or prompt for it printf ("User name: "); user = gets (); } if (list xpassword = getenv ("FTPASS") ) // get passwd from envp password = xpassword[1]; else { // or prompt for it printf ("Password : "); password = gets (); } fprintf (tmpfile, // write ftp login procedure "open ", host, "\n", // to tmpfile, followed "user ", user, " ", password, "\n", // by transfer commands "binary\n", direction, " ", file, " ", foreignfile, "\n", "quit\n"); exec (P_NOCHECK, "ftp", VERBATIM, // do the ftp transfer "-n -i", "< ", tmpfile); exec (P_NOCHECK, "rm", tmpfile); // remove temp file } void usage () // purpose: print usage info { // and die printf ("\n" "ICCE Ftp-based File Transfer Shell V", VER, "\n" "Copyright (c) ICCE ", YEARS, ". All rights reserved.\n" "\n" "Usage: ftpxfer -p|-g host file [directory]\n" "where:\n" " -p : selects putting of file\n" " -g : selects getting of file\n" " host : host to put/get from/to\n" " file : file to transfer\n" " directory : optional directory at foreign host, if " "not given:\n" " directory in file argument is used, if not " "present:\n" " current directory is used for destination\n" "Ftpxfer will use the environment variables FTPUSER and FTPASS " "when available,\n" "or will prompt for the user and password.\n" "\n"); exit (1); } void main (int argc, list argv, list evp) // main function { envp = evp; // store environment echo (OFF); // no re-echoing of commands tmpfile = "/tmp/ftpxfer." // make temporary filename + (string) getpid (); if (element (1, argv) == "-p") // first argument: must direction = "put"; // be -p or -g else if (element (1, argv) == "-g") direction = "get"; else usage (); if (! (host = element (2, argv)) ) // second argument: must be usage (); // foreign host if (! (file = element (3, argv)) ) // third argument: must be usage (); // file to transfer if (direction == "put" && ! exists (file)) // if putting: file must { // exist printf ("File to put does not exist.\n"); exit (1); } dir = element (4, argv); // fourth element: may be // foreign directory process (); // hit it! exit (0); // exitstatus: success } icmake-10.03.00/examples/killprog0000755000175000017500000000247214204126313015540 0ustar frankfrank#!/usr/bin/icmake -qi /* Sample Icmake script. Kills programs; you can type 'killprog progname' instead of having to look up the program PID using 'ps' and then typing 'kill -1 '. For the installation: see the notes in the script file 'tolower'. */ #define VER "1.00" #define TMPFILE "/tmp/killprog.out" int kill (string prog) { int nkilled; list readstat; list psline; system ("ps -al > " + TMPFILE); while (readstat = fgets (TMPFILE, readstat)) { psline = strtok (element (0, readstat), " \n\t"); if (element (12, psline) == prog) { exec (P_NOCHECK, "kill", "-1", element (2, psline)); exec (P_NOCHECK, "kill", "-9", element (2, psline)); nkilled++; } } system ("rm " + TMPFILE); return (nkilled); } void main (int argc, list argv) { echo (0); if (argc != 2) { printf ("\n" "ICCE Program Slayer V", VER, "\n" "Copyright (c) ICCE, 1993. All rights reserved.\n" "\n" "Usage: killprog prog\n" "Will send a 'kill -1' signal to all programs matching " "'prog', followed\n" "by a 'kill -9'.\n" "\n"); exit (1); } printf ("Processes slayed: ", kill (element (1, argv)), "\n"); exit (0); } icmake-10.03.00/examples/nesteddirectives0000755000175000017500000000106014204126313017251 0ustar frankfrank#!/usr/bin/icmake -t. /* This simple icmake script illustrates the use of nested directives */ #ifdef HELLO this is not compiled #ifdef ALSO_NOT this is also not compiled #else but this isn't compiled either, since we're in the not-defined HELLO section #endif #define NESTED nested is not defined #include file is not included #else void fun() { printf("The function fun() is defined\n"); } #endif void main (int argc, list argv) { fun(); exit(0); } icmake-10.03.00/examples/defines0000755000175000017500000000042314204126313015324 0ustar frankfrank#!/usr/bin/icmake -t. #define FIRST "This text" #define SECOND "will be printed, starting with: " ${FIRST} #define TEXT ${FIRST} ${SECOND} "${UNCHANGED}\n" #define BASE /usr/local // #define BIN "${BASE}/bin" int main() { printf(TEXT); printf(BIN "\n"); } icmake-10.03.00/examples/tolower0000755000175000017500000000421614204126313015406 0ustar frankfrank#!/usr/bin/icmake -qi /* tolower: Icmake script to rename files to lower case. Use as follows. (1) Place this file in a given directory, e.g., $HOME/im. (2) To rename all *.C in a directory to lowercase, try this (assuming that the tcsh is used) icmake -q ~/im/tolower -- *.C (3) Alternatively, try the following tcsh alias (e.g., in your .tcshrc): alias tolower 'icmake -q ~/im/tolower -- \!*' (the quotes are needed here.) then do: tolower *.C (4) Or another: make a shell script 'tolower' in your $HOME/bin directory, containing: #!/bin/sh icmake -q $HOME/im/tolower -- $* Make the shell script executable, with "chmod +x tolower". (5) Yet another method, which is preferred, is the following: You can use this script as a literal executable, by renaming it to an extension-less file in your local bin directory: mv ~/bin/tolower Then, make it executable: chmod +x ~/bin/tolower Finally, add the following string as the first line to this file: #!/usr/local/bin/icmake -qi This line may actually be at the top of this file, check there. This will cause the command "tolower" to start Icmake, with "-qi tolower" as arguments. Make sure that the /usr/local/bin/icmake part of the text points to your icmake program; e.g., if you have icmake in /usr/bin, then that part should be /usr/bin/icmake. */ #define VERSION "1.01" void process (string file) { string lower; lower = strlwr (file); if (lower != file) if (exec (P_NOCHECK, "mv", file, lower)) printf ("tolower: can't rename ", file, " to ", lower, "\n"); } void main (int argc, list argv) { int i; echo (0); if (argc < 2) { printf ("\n" "ICCE Filecase Converter Version ", VERSION, "\n" "Copyright (c) ICCE 1993. All rights reserved.\n" "\n" "Usage: tolower file(s)\n" "Where: file(s) are the filenames to be renamed to their " "lower case names\n" "\n" ); exit (1); } for (i = 1; i < listlen (argv); i++) process (element (i, argv)); exit (0); } icmake-10.03.00/examples/bup0000755000175000017500000000401114204126313014472 0ustar frankfrank#!/usr/bin/icmake -qi #define ETCDIR "/usr/local/etc" #define VER "1.00" list volumes; // backup volumes void init () // definition of backup volumes { // always: dirs, descrip, etc volumes += (list) "dummy_1" + // bup 0: dummy (list) "dummy_2" + (list) "/" + // bup 1: whole disk (list) "whole UNIX disk" + (list) "/home/karel/dos" + // bup 2: DOS disk (list) "DOS partition" + (list) "/usr/local/bin /conf" + //bup 3: local stuff (list) "local UNIX stuff" + (list) "/home/karel" + // bup 4: user Karel (list) "user Karel, except for DOS" ; } void usage () { int i; printf ("\n" "ICCE Backup Runner V", VER, "\n" "Copyright (c) ICCE 1993. All rights reserved.\n" "\n" "Bup by Karel Kubat.\n" "\n" "Usage: bup volume-number\n" "Where:\n" " volume-number: number of volume to show/run\n" "\n" "Volumes may be:\n"); for (i = 2; i < listlen (volumes); i += 2) printf (i / 2, ": ", element (i + 1, volumes), " (", element (i, volumes), ")\n"); printf ("\n" "The actual backup is perfomed by the Icmake program `backup'.\n" "If the file ", ETCDIR, "/bup..exclude exists,\n" "then the files listed in this file are excluded from the backup.\n" "\n"); exit (1); } void main (int argc, list argv) // start of program { string excludefile, volstring; int volnum, showsize; init (); volstring = element (1, argv); volnum = (int) volstring * 2; if (volnum < 2 || volnum >= listlen (volumes)) usage (); excludefile = ETCDIR + "/" + "bup." + volstring + ".exclude"; if (exists (excludefile)) exec ("backup", "-v", "store", element (volnum, volumes), "--exclude-from", excludefile); else exec ("backup", "-v", "store", element (volnum, volumes)); exit (0); } icmake-10.03.00/examples/ds0000755000175000017500000000732514204126313014325 0ustar frankfrank#!/usr/bin/icmake -t. #define VERSION "1.06.01" #define YEAR "1994--2016" int debug; string progname; string xdev; void kill(string s) { printf(s, "\n\n"); exit(1); } string backslash_wild(string spec) { string s; string ret; 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 } void preamble(list argv) { progname = get_base(element(0, argv)); // determine progname without .bim xdev = "-xdev"; // no X-device find echo(OFF); // no display of the exec-ed cmnd } void option(string arg) { string optchar; // process all option characters for (int index = 1; optchar = arg[index]; ++index) { if (optchar == "x") // X-dev ok ? xdev == ""; // set appropriate flag else if (optchar == "d") // debug request debug++; // set flag else // kill DS if optchar not found kill("Unrecognized option: '-" + optchar); } } list options(int argc, list argv) { list new; for (int index = 0; index != argc; ++index) // all cmd line arguments { 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 } void usage() { printf ( "\n" "DS (Disk Search). Version " VERSION "\n" "Copyright (c) GPL " YEAR ". All Rights Reserved\n" "\n" "DS by Frank B. Brokken\n" "\n" "Usage: ", progname, " [options] [dir-spec] file\n" "Where:\n" " options:\n" " -d: Display rather than execute the search command\n" " -x: Allow cross-device searches\n" " dir-spec: specification of the directory where the search is to\n" " be started. By default: / (the root).\n" " file: name of file to search.\n" "\n" "For the 'file' argument quoted wildcards (e.g., ds '*.local') are ok.\n" "\n" ); exit(0); } void process(int argc, list argv) { 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 string filespec = backslash_wild(element(argc - 1, argv)); string cmd = "find " + startdir + " " + xdev + " -name " + filespec + " 2>/dev/null"; if (!debug) system(P_NOCHECK, cmd); else printf(cmd, "\n"); } void main(int argc, list argv) { preamble(argv); // preamble: determine progname etc. argv = options(argc, argv); // process options argc = listlen(argv); if (argc == 1) // no arguments ? usage(); // give help process(argc, argv); // else process arguments } icmake-10.03.00/examples/idir0000755000175000017500000000343114204126313014640 0ustar frankfrank#!/usr/bin/icmake -qi /* Example of the Icmake 'stat()' function. This simple makefile prints something of a directory listing. For installation: see the sample file 'tolower'. */ int stringlength (string s) { int len; len = 0; while (element (len, s)) len++; return (len); } void showatt (string file, list statbuf) { int i, att; string size; printf (" "); att = (int) element (0, statbuf); if (att & S_IFDIR) printf ("d"); else printf ("-"); if (att & S_IFCHR) printf ("c"); else printf ("-"); if (att & S_IFREG) printf ("f"); else printf ("-"); if (att & S_IREAD) printf ("r"); else printf ("-"); if (att & S_IWRITE) printf ("w"); else printf ("-"); if (att & S_IEXEC) printf ("x"); else printf ("-"); size = element (1, statbuf); printf (" " , size, " "); for (i = stringlength (size); i < 10; i++) printf (" "); printf (file, "\n"); } void show (string filemask) { list statbuf, files; string file; int i; printf ("\n", filemask, ": "); if (! (files = makelist (O_ALL, filemask)) ) { printf ("not found\n"); return; } printf ("\n"); for (i = 0; i < listlen (files); i++) { file = element (i, files); if (! (statbuf = stat (P_NOCHECK, file))) printf (" can't stat ", file, "\n"); else showatt (file, statbuf); } } void main (int argc, list argv) { int i; if (argc == 1) show ("*"); else for (i = 1; i < listlen (argv); i++) show (element (i, argv)); exit (0); } icmake-10.03.00/exec/0000755000175000017500000000000014204243365013077 5ustar frankfrankicmake-10.03.00/exec/variable/0000755000175000017500000000000014204243365014664 5ustar frankfrankicmake-10.03.00/exec/variable/operatorassign3.cc0000644000175000017500000000025114204126313020305 0ustar frankfrank//#define XERR #include "variable.ih" Variable &Variable::operator=(string &&str) { Variable tmp{ new String{ move(str) } }; swap(tmp); return *this; } icmake-10.03.00/exec/variable/variable.ih0000644000175000017500000000023514204126313016764 0ustar frankfrank#include "variable.h" #include "../../xerr/xerr.ih" #include "../int/int.h" #include "../string/string.h" #include "../list/list.h" using namespace std; icmake-10.03.00/exec/variable/list.f0000644000175000017500000000013414204126313015775 0ustar frankfrankinline std::vector const &Variable::list() const { return get()->list(); } icmake-10.03.00/exec/variable/opinsert.f0000644000175000017500000000016314204126313016667 0ustar frankfrankinline std::ostream &operator<<(std::ostream &out, Variable const &var) { return var.get()->insertInto(out); } icmake-10.03.00/exec/variable/variable2.cc0000644000175000017500000000020614204126313017031 0ustar frankfrank// #define XERR #include "variable.ih" Variable::Variable(Variable const &other) : unique_ptr{ other.get()->copy() } {} icmake-10.03.00/exec/variable/tostring.f0000644000175000017500000000015614204126313016677 0ustar frankfrankinline std::string Variable::to_string() const // convert an argument to { return get()->to_string(); } icmake-10.03.00/exec/variable/variable.h0000644000175000017500000000404114204126313016612 0ustar frankfrank#ifndef INCLUDED_VARIABLE_ #define INCLUDED_VARIABLE_ #include #include #include #include "../varbase/varbase.h" class Variable: private std::unique_ptr { friend std::ostream &operator<<(std::ostream &out, Variable const &var); friend bool operator==(Variable const &lhs, Variable const &rhs); friend std::strong_ordering operator<=>(Variable const &lhs, Variable const &rhs); public: Variable(VarBase *ptr = 0); Variable(Variable const &other); Variable(Variable &&tmp); Variable &operator=(Variable const &other); Variable &operator=(Variable &&tmp) = default; Variable &operator=(int value); // 1.cc Variable &operator=(std::string const &str); // 2.cc Variable &operator=(std::string &&tmp); // 3.cc Variable &operator=(std::vector &&tmp); // 4.cc bool isTrue() const; // Int, String, List bool isString() const; // Int, String, List int value() const; int &valueRef(); // force the interpretation as int int forcedInt() const; // (used by d_reg when run() ends std::string const &str() const; std::vector const &list() const; Variable &operator+=(Variable const &rhs); // Int, String, List Variable &operator-=(Variable const &rhs); // Int, List std::string to_string() const; // convert an argument to // a string void swap(Variable &other); }; #include "forcedint.f" #include "isstring.f" #include "istrue.f" #include "list.f" #include "str.f" #include "tostring.f" #include "value.f" #include "valueref.f" #include "opaddis.f" #include "opequal.f" #include "opinsert.f" #include "opspaceship.f" #include "opsubis.f" #endif icmake-10.03.00/exec/variable/opspaceship.f0000644000175000017500000000024614204126313017344 0ustar frankfrankinline std::strong_ordering operator<=>(Variable const &lhs, Variable const &rhs) { return *lhs.get() <=> *rhs.get(); } icmake-10.03.00/exec/variable/istrue.f0000644000175000017500000000010514204126313016333 0ustar frankfrankinline bool Variable::isTrue() const { return get()->isTrue(); } icmake-10.03.00/exec/variable/operatorassign2.cc0000644000175000017500000000025514204126313020310 0ustar frankfrank//#define XERR #include "variable.ih" Variable &Variable::operator=(std::string const &str) { Variable tmp{ new String{ str } }; swap(tmp); return *this; } icmake-10.03.00/exec/variable/operatorassign0.cc0000644000175000017500000000022214204126313020300 0ustar frankfrank//#define XERR #include "variable.ih" Variable &Variable::operator=(Variable const &other) { reset(other.get()->copy()); return *this; } icmake-10.03.00/exec/variable/isstring.f0000644000175000017500000000011114204126313016657 0ustar frankfrankinline bool Variable::isString() const { return get()->isString(); } icmake-10.03.00/exec/variable/str.f0000644000175000017500000000011514204126313015631 0ustar frankfrankinline std::string const &Variable::str() const { return get()->str(); } icmake-10.03.00/exec/variable/icmconf0000777000175000017500000000000014204126313020757 2../../icmconf.dirustar frankfrankicmake-10.03.00/exec/variable/opequal.f0000644000175000017500000000015214204126313016470 0ustar frankfrankinline bool operator==(Variable const &lhs, Variable const &rhs) { return *lhs.get() == *rhs.get(); } icmake-10.03.00/exec/variable/value.f0000644000175000017500000000010214204126313016131 0ustar frankfrankinline int Variable::value() const { return get()->value(); } icmake-10.03.00/exec/variable/opsubis.f0000644000175000017500000000015314204126313016507 0ustar frankfrankinline Variable &Variable::operator-=(Variable const &rhs) { *get() -= *rhs.get(); return *this; } icmake-10.03.00/exec/variable/variable3.cc0000644000175000017500000000016414204126313017035 0ustar frankfrank//#define XERR #include "variable.ih" Variable::Variable(Variable &&tmp) : unique_ptr{ move(tmp) } {} icmake-10.03.00/exec/variable/swap.cc0000644000175000017500000000016614204126313016141 0ustar frankfrank//#define XERR #include "variable.ih" void Variable::swap(Variable &other) { unique_ptr::swap(other); } icmake-10.03.00/exec/variable/forcedint.f0000644000175000017500000000011214204126313016773 0ustar frankfrankinline int Variable::forcedInt() const { return get()->forcedInt(); } icmake-10.03.00/exec/variable/opaddis.f0000644000175000017500000000015314204126313016446 0ustar frankfrankinline Variable &Variable::operator+=(Variable const &rhs) { *get() += *rhs.get(); return *this; } icmake-10.03.00/exec/variable/operatorassign4.cc0000644000175000017500000000026114204126313020307 0ustar frankfrank//#define XERR #include "variable.ih" Variable &Variable::operator=(vector &&vect) { Variable tmp{ new List{ move(vect) } }; swap(tmp); return *this; } icmake-10.03.00/exec/variable/valueref.f0000644000175000017500000000010414204126313016630 0ustar frankfrankinline int &Variable::valueRef() { return get()->valueRef(); } icmake-10.03.00/exec/variable/variable1.cc0000644000175000017500000000020314204126313017025 0ustar frankfrank//#define XERR #include "variable.ih" Variable::Variable(VarBase *ptr) : unique_ptr{ ptr != 0 ? ptr : new Int } {} icmake-10.03.00/exec/variable/frame0000644000175000017500000000006614204126313015674 0ustar frankfrank//#define XERR #include "variable.ih" Variable:: { } icmake-10.03.00/exec/variable/operatorassign1.cc0000644000175000017500000000023714204126313020307 0ustar frankfrank//#define XERR #include "variable.ih" Variable &Variable::operator=(int value) { Variable tmp{ new Int{ value } }; swap(tmp); return *this; } icmake-10.03.00/exec/variable/operatoris.cc0000644000175000017500000000000014204126313017341 0ustar frankfrankicmake-10.03.00/exec/stack/0000755000175000017500000000000014204243365014204 5ustar frankfrankicmake-10.03.00/exec/stack/stack.h0000644000175000017500000000235714204126313015462 0ustar frankfrank#ifndef INCLUDED_STACK_ #define INCLUDED_STACK_ #include #include #include class Variable; // the abstract base class for Ints, Strings, // and Lists. // conceptually the stack grows from high to low, but the vector // grows from low to high. For pushing and popping that's irrelevant, // but when accessing a stack element based on its index the // sign of the index is negated. class Stack { std::string d_bimFilename; std::vector d_stack; unsigned d_BP = 0; public: Stack(unsigned idx, unsigned argc, char **argv); Variable &operator[](int index); void push(Variable &&tmp); // 1 void push(Variable const &var); // 2 Variable topMove() noexcept; Variable &top(); // .f void pop(); // .f void pushBP(); void popBP(); void asp(uint16_t nElements); // .f private: void pushCharPtrPtr(char **src); void pushArgs(unsigned idx, unsigned argc, char **argv); }; #include "asp.f" #include "pop.f" #include "top.f" #endif icmake-10.03.00/exec/stack/push2.cc0000644000175000017500000000017014204126313015543 0ustar frankfrank//#define XERR #include "stack.ih" void Stack::push(Variable const &var) { xerr(""); d_stack.push_back(var); } icmake-10.03.00/exec/stack/pushbp.cc0000644000175000017500000000065014204126313016006 0ustar frankfrank//#define XERR #include "stack.ih" void Stack::pushBP() { xerr("size: " << d_stack.size() << ", BP = " << d_BP); d_stack.push_back(new Int{ as(d_BP) }); // save the current BP xerr("BP pushed"); d_BP = d_stack.size() - 1; // BP points at the saved BP // offset xerr("done BP = " << d_BP << ", size = " << d_stack.size()); } icmake-10.03.00/exec/stack/operatorindex.cc0000644000175000017500000000054414204126313017372 0ustar frankfrank//#define XERR #include "stack.ih" Variable &Stack::operator[](int index) { // negative indices refer to local vars // which are at locations beyond d_bp xerr("bp: " << d_BP << ", index: " << index << ", element at "\ << (d_BP - index)); return d_stack[d_BP - index]; } icmake-10.03.00/exec/stack/README0000644000175000017500000000352114204126313015056 0ustar frankfrankThe vector-based stack grows from low to high indices. The original OS-RSS stack has a fixed size and grows from high to low values. The compiler uses the original OS-RSS indices. Here is the correspondence between the compiler's and current idea of the stack: compiler vector-stack BP + 4 100 arg3 13 BP - 4 BP + 3 99 arg2 14 BP - 3 BP + 2 98 arg1 15 BP - 2 BP + 1 97 RA 16 BP - 1 BP-> 96 old BP 17 <-- BP BP - 1 95 local 1 18 BP + 1 BP - 2 94 local 2 19 BP - 1 So, indices are sign-toggled by Stack. When calling RSS functions (like printf) there's no real RA, but the BP must be pushed. In order to maintain the above stack organization a dummy value is pushed when executing a RSS function. ----------------------------------------------------------------------------- When a function is called, the arguments are pushed from the last argument to the first. Then the return address is pushed, and then the current BP. The current BP is then pointing at the index of the stack where the old BP was pushed. Next the local variables are stored on the stack in their order of definition. When calling a function like fun(int param1, int param2) { int local1; int local2; } the stack orgaization therefore looks like this: [ param2 ] [ param1 ] [ RA ] [ old BP ] [ local1 ] [ local2 ] And therefore param1 is reached as d_stack[BP + 2], while local1 is reached as d_stack[BP - 1]. The class Stack's index operator handles the BP offsets, and so in code referring to the Stack object d_stack[2] is used to reach param1, and d_stack[-1] is used to reach local1. icmake-10.03.00/exec/stack/popbp.cc0000644000175000017500000000100614204126313015621 0ustar frankfrank//#define XERR #include "stack.ih" // ... previously pushed stuff // ... args // BP: [ old frame BP ] // ... whatever void Stack::popBP() { //xerr("current BP = " << d_BP); d_stack.resize(d_BP + 1); // remove local variables d_BP = top().value(); // restore BP so it points at the previous // stack frame //xerr("next BP = " << d_BP); pop(); xerr("done: BP = " << d_BP << ", size: " << d_stack.size()); } icmake-10.03.00/exec/stack/asp.f0000644000175000017500000000017314204126313015130 0ustar frankfrankinline void Stack::asp(uint16_t nElements) // called from cpu/asp { d_stack.resize(d_stack.size() - nElements); } icmake-10.03.00/exec/stack/pop.f0000644000175000017500000000006514204126313015143 0ustar frankfrankinline void Stack::pop() { d_stack.pop_back(); } icmake-10.03.00/exec/stack/icmconf0000777000175000017500000000000014204126313020277 2../../icmconf.dirustar frankfrankicmake-10.03.00/exec/stack/push1.cc0000644000175000017500000000021314204126313015540 0ustar frankfrank//#define XERR #include "stack.ih" void Stack::push(Variable &&tmp) { xerr(""); d_stack.push_back(move(tmp)); xerr("done"); } icmake-10.03.00/exec/stack/top.f0000644000175000017500000000007514204126313015150 0ustar frankfrankinline Variable &Stack::top() { return d_stack.back(); } icmake-10.03.00/exec/stack/topmove.cc0000644000175000017500000000020614204126313016173 0ustar frankfrank//#define XERR #include "stack.ih" Variable Stack::topMove() noexcept { Variable ret = move(top()); pop(); return ret; } icmake-10.03.00/exec/stack/stack1.cc0000644000175000017500000000062114204126313015671 0ustar frankfrank//#define XERR #include "stack.ih" // /usr/lib/icmake/icm-exec /tmp/15632.bim // 0 1 # = 2 // 0 # = 1 Stack::Stack(unsigned idx, unsigned argc, char **argv) { d_bimFilename = argv[idx]; pushCharPtrPtr(environ); pushArgs(idx, argc, argv); push(new Int{ as(argc - idx) }); // 4 for 'bim a b c' } icmake-10.03.00/exec/stack/pushargs.cc0000644000175000017500000000035314204126313016341 0ustar frankfrank//#define XERR #include "stack.ih" void Stack::pushArgs(unsigned idx, unsigned argc, char **argv) { vector vect; for ( ; idx != argc; ++idx) vect.push_back(argv[idx]); push(new List{ move(vect) }); } icmake-10.03.00/exec/stack/frame0000644000175000017500000000006014204126313015206 0ustar frankfrank//#define XERR #include "stack.ih" Stack:: { } icmake-10.03.00/exec/stack/stack.ih0000644000175000017500000000047014204171312015624 0ustar frankfrank#include "stack.h" #include #include // #include "bobcat/arg" #include "../../xerr/xerr.ih" #include "../../support/as/as.h" #include "../variable/variable.h" #include "../int/int.h" #include "../list/list.h" extern char **environ; using namespace std; using namespace FBB; icmake-10.03.00/exec/stack/pushcharptrptr.cc0000644000175000017500000000033214204126313017573 0ustar frankfrank//#define XERR #include "stack.ih" void Stack::pushCharPtrPtr(char **src) { vector vect; while (*src) { vect.push_back(*src); ++src; } push(new List{ move(vect) }); } icmake-10.03.00/exec/hierarchy.odp0000644000175000017500000003174714204126313015566 0ustar frankfrankPK1E¥R3&¬¨//mimetypeapplication/vnd.oasis.opendocument.presentationPK1E¥RConfigurations2/toolbar/PK1E¥RConfigurations2/floater/PK1E¥RConfigurations2/menubar/PK1E¥RConfigurations2/popupmenu/PK1E¥RConfigurations2/toolpanel/PK1E¥RConfigurations2/progressbar/PK1E¥RConfigurations2/statusbar/PK1E¥RConfigurations2/images/Bitmaps/PK1E¥RConfigurations2/accelerator/PK1E¥R styles.xmlí]K“ã¶¾çW¨”Šo¤ø¥±g]v\vRµc»v7®ÊÉE‘D/E°Hj4ãSþA9äÿå—O%ê12×UÞк?4@£~õõË&=ƒ$ `ô8ÖUm<‘ý Z=Žÿñé{e6þúÝŸ¾‚ËeàzÛ ˆ2%Í^CŽPá(} ™ÂÇñ:Ëâ‡ÉÆ ¢©*LVCÓæú{ÌʸQ°yo“èºi>D÷€‹òf Z7C >þhbº BÙ 0­âÁMŒjY„@¬&N@ŠIõ²Õ‰eĺ¼45³ƒÝn§îL"ÿ§œ§dà%›pê$ÎZð²' ˆa’qjßˉãm2ß›€`ÆÒ‰®êyÍÞÚM2Yaq Øç•4®Ï«XýÄÝÉÖ‚i‘º‰Å1P²Å1­Xé¡×¬5ñÜÐË…Åz,-.&Þkj×ÚÔ. 2pò È\Ù¶0­ØÔKDŸëtKŸÏç’ËI—P¶‘—4T–°¡ Ûdzµ7žé/Ù†™9))ŒéË+Œé—´Å]Èw"!KGÛÍ$Òm»™[Õƒ¥¼à¨œ‘T¤‰…¦'«Ü¾.á6ò©}¡µ—$ÎrCRì¡TCCƘ‰ƒµµ€®M0 §_%¾Öé"ªÚœ »„0Rž°û3/Â#ÄdJ"ÔPR¸i`AŸ ‹·‘—mÉR†Ôæ»`ã 9ÍǪ¬,ÐZâ3ÊÉЄ˜ñìP ¢•‚ôHå%[”&É òÞb-©3B|¹K7LAÚÿ#PaœâY´Y¬œËU‘v›e‡Z„;…4ÎÌ<ËÐ ;ÄÍc]š$ðÙ´rGà“ü4øåVœ‘´ w…’°EG ÜFY‚êýÇÇJ½ Ú$»QeaTáÊ9m‚ÁÎZáy¿¯ykŽgüõÇj£Ø‰‚—¦5ã^ë9umûyî:Øç Ïúûã¢ïJã„wš8h(ÞhìG¾›øãîC‰Ù<–P=0 ü±8¼v="š·uÔL(Ôñ‚ª‹Vó=€=1\}KØZ5'°¦0ó¹ÍV€ä`µwQW*k˜¿Cì B9X!øm›fÁò•(cìúø¼DAã ³¢6fFÈXÀ,Ã¼,3"À~F¬ÖB퀵ë—sàûÅÚ†$*hÍ›‚Ly)£QÎ|­Íä²Ï4üÒâRƒ´lx÷tH$ Á3)±²Ø¢):ÑLœŽ&’1ýI³|äð8þßÿ+œP‰ s¤Ì&ˆ”Ð] œ¼¯§H€I“iâ„ëöGÔƒ_7 ŽeÌVÙY6™Ý&m’vÀÁ82£( °„ à ÜBfoéTÏï!«G„fw‰ÝB†jÝ%BÓÞ2ï§?|îÔNÏzCȺS;=ï¡û´ÓºÖDöÛ2ÔB6Û±Mš6^­NÔ6Úí¬°ÀtÁ¶,‘ï Ê©t—RNË7(,™¸Ö€–§n ”J ˆs’Ä”8ë1u“µd ÚÓSñF@ éF©n3Ìu¾Ù²ˆ4Ù:ÛÕZaŽ6±Õ*QöïÑ4x-Èæ~_ƒÎwº§múŒùGh—¬ 5ß3V$Þ¢žL¨“HÄ„W·cÝÏëcCdhK­ vDÜJ´k<0‡\! F}ü1¯¡éÔˆç86xƒ( b&·,·Œ„R AÙ7Ôvö%EÄΉEÎ)š…ÎIÄÎó›o !ú6ñÚ¥ŠZI °¬QJø\§“uÌ6vBð‡ðƒÁÅoÀËvA¶FV»šbÜ_ë&yЫRqƒ´ų̂¿‰ˆ!ÍßO„?|‚yÄGÿ×…ÿFM‰ Îhù°„V3ÂuŒ"8Â¥G¨(þ·Xè BsG!í½£qø„:¼_eíyÉ· š'¼Ê$!Ä}ÔO½‡}ÈAúÕ½ÛI7tÓóöe0{ÉëB…ë{!AYÛ ÁèùP™N -)Ÿeu‘ïoÀÅnß6 É-Éht’+Rk¢üKI÷‡.ZëpÑnF•æÓc‡Kƒ„ùp¹ã¨áÒÔ…d¸\F:9Ž(7ÝuÎ>0 ³8ùIøÆvjÒ0òÈ®ýúCǵQeyÆÃTDôyšRâMÖhYâ•o)0ôåÑàAz]Ñ`œÊ)„䌎|qyuC¸˜×U@ÆŒ€õ²ä¼µõæ~Ñž†x‡ŽÀ„Eçµ€R¢¸0*´íSa¹)‹tD}(†]sÐáUúçƒxÛãrJËã[0)“\ÖøÅù‰:]ÏgœG©ÚLoˆ:ÒÈŸü\¼vÎ©Ž´â9†i¶LWó€í^ºú€íÎÁ8Òz‰ Ò–AƒÇs÷†F£•̱8ÊN‰‹á–A‚‡{÷†D›yÌÁ8Ö@Êà!éùcaß2ññ“0zø¾Àr¾Yà“-! äÆ]ü¾ÑÛLHFïr,S€É)†æ±å]BJAä×–kˆ$M×p§l£ cÇ\ÝÑúÎM×MÖâU¦è1®>jEžýïX4ñÂõ>¯|G{Ÿ?ñŒÓê!M­=o2ªq¦œÅ”£ý¾9ëÛ”ÓŽ™Úê Ÿdšš­;¶S¹¶$:?k3 'a§€Ì=èÌ~zÀ8_8š~ž°§ªmþÜ0mªÙm=`µ÷@§«{ÐUÂòëó|=`M§çéËiüâû®ºÆÅÜîsë|˜æA>ír{€\r§ȧäÒÏúÜ —†|Þä³òçÛE†/Ûý\6KzÆ%½"*iø~({Öš³;<ð7<ð7<ðw#'ªÃç8Qøøøøø»ñÕ7úróT"8[òӧχsÓ[<75‡“ÒᤴAàᤴ“Ò·äoœ-ƒ³ep¶ ΖEhp¶ ΖÁÙ28[gËm#48[zp¶ÔxPgÉ•_ÎÔLÕü%ö—X•ØÍ?„¿¤Aì;ñ—ˆ%Æ ÝWdSJn‰oÞkŸ ½&R?Ä!š Ö0DCiTÊ ïé<Ž×.²h[ Þóê‡Ê¨š=ãïòá³TÇ2ùo6•èšjÛSžÈßPpìIç˜ÓxÐÑD¦[Wfb´†Õkq &ö@</7^ ˆã˜˜´§ŽãMÿ¤unÜÁ)?Ø S}Î¥Bs«æƒ¬ÔÖÔ½3s&ŃnÒ`?`'p¹ È·µ$K³$¤©h»Y_Ó®%ôÝ í0,O·‡æžVI¥W.öA¢æo xðë7RîÜ’©æÜwǵûLšµK‚ ÷âúˆ¯0Q²E'´*ºr3h5‹Q›q³˜ÆU ì_}fòVôR›M/„á©·SoÃËéá©÷K/á[ñ?W’´X|`)S°f´²y¼<)#+þ>¬K•E¯sÞ@ÝÐ !>a!ÍÓžH•xgi¨è·©†£ÛžäQ5ù®¨÷>‚¨Tͦjàií‚„r3ê–³„̦t¹–Ò >B¹°’]F¬“x„:±eÈ/¡RqˆŠbFfá©u·n?FeQæ”$‹_aè˰‘•Qñ¥(i2“K¥ÚC”ú9§t-¡ê^ ô©ª)'»’ñ½r Výt+Wõ»§o˜¡n°FÏf“¢fdC•¶¥X¨faмŒh±èm‚W$ø¼Éyn;Ö"ªRÕ2ßAö5%ÆV¿Ñ ,.ЇQ‘ÅäÒwVòìõ‚H¥]›å®I\L BòFÕ2JÚ9¦D—ðÂóáÕj³¥$¼bÙ«0~“ȲÉI¶‚¶8#9?ªÔº? IvÐ4MDT8Z0^Î>Cƒ”¥´ž>u lÚb&}gT?J-½Žâ¸•í :ÑuõÓÔðm3èEÔ-Ë£ßO—UGÈÿbº.)>gT åÜm¶e‹õ ò…<+nð]³e¥] Có°$]y#Œ4;PÜÅ€‰T0ˆ ÔU|͉Ã3Ð/WËÕ-±ó›ƒúrMoì ¬aÏ{ŒƒÌÛTÉCTnÙ®ä(^õTBòÏ4Waßô¤ü*ʰ¼µÜÐLÇyu~Ùó΃“W’( 㛇õ——yé¸gÇyisPy]'7Øoþ¹äŸ±oŒÇøÅòËÐrHéP¾ˆ~¿!–fã$LÌò.ðá'º&»¸TS·¸JŠi¯Nùkà„5ÛÅðÂ/cDÚ‘ÀÌúö’™WÙ|‡u%Ÿã&ÕömêôЬê9;žÓÖ ~<˵F(+o€g”~<—Au+#›éP~}òæRª?¿÷å%Vô­¤Ž£ÜBÔñëC4Z:¿?¾¦£uæ6#f䴜ŸF1™£s‡¿yÅf¼X%EDÒ©J~ùÓcS-oÉ(|ÞiÉhäê^?ŽŠf¹îŸ#EˆéžÆÍª¾ÚÅ1-u%/Ë”ú±®RùOÊÿþûŸN[¡Açª _»c²‚šnoØËm‡†¶þhQù©ÞÇ—dÅâ¯]A¡¯4„L¡’l8Øe ‚;-û¯.—,½|EÆTWtÍrÚ‚ðö2gCiøM"d͈÷&²gCkÖ›DÈ™ !óMâã·ÏÓÞlYo4Nû3"ô6ã42fƒÈþsj¡ºÉµõÉ+ò¦bÅ—îAÔÒ1ya»vñÃ{ôÉP-Ö9”­nh»£×Þé?$;&ñ2 Ÿ”(lÅúO0¿<®‡­O‚»›£:é®Êº>ͨo-x!ì«|Í5ÝöŒ-­:lt®TZ±cÃܬù Kª êÂþñ9!QÚ¸ µî„†ú CýÊ5€°$@F!C"£!D†æW78-DŽæ¾r5ÃFw`T”$øü¥ ,MiP²üPæ$Pø<µôKÆ ¢ö&áˆxüÑ\»3ˆQKà¡`S3ê®&ÁÊ”ØÞù‰¯uñ&ÞQ5cQÊñnjøg'Ž…BQ¸yå ü®m,°åbc¯"Ëðë*þáÅ üf,ŒZ ív<Ó[D;¯QÏ’£žÙcžy•x¦†Ñhnމg:"ï|ÍôÍ;x·ÚEqù¦§=‰‘)bdõ0²$0²íkyš°ˆ‘¥!ë‹ãVžÛW¶þ¨†{ MÌZ$¤¹è*J¾æUÄé‚<ÖL|“‚l÷àø5A—âWksÀ\Íw¼^34Ó› `ø¶fJ0 zÅ*v=¬"ßÂg¢Ô™ ¨3ïdÎ$´ŽÈ?¿Ç?_b’"Ç¿Î?dˆüs5×»°€Ž9÷‹]ÍÌ)è,“Q ¯†'1ëêdDXó]1åªZÖ­h—‰„ÛC•H¬Ü“ÑÓ´À½°ôE@e¥›Gba÷°°%°8“‡±°áÙ¾ ¾iz¹¤ã¹b0î–é.;šï÷‚1Bš…½©`lÝŒm™` :òlѱj:žYg‚±éø<"#ûëc§Ç4gžYñÇ1-‘jWö3ç¹¶‰ÙŠÄ¯“m×V~ Ÿûló4ÃôgZúÛ–~–w¸~–lØõP'A¶W4™2sÏf÷¦Ù¼ŸšÈHr? XSs}¿l³\ÀÕÓ\g’¶Þm°ú°š â–e@D2VÇEçx‹d¬Ž‹_¼cÞÞ ¯;?¼5k9¼û)dÑ낵¿nÏ€ª=;ªhØp¶Z×§(Ë×õW…mƒŠ„ ÞÖ—_ÈÌÛÀEÆut]Ðö¦ WŒTdÚç"-^@Å+Š´2KX?Ͻ„yÒÁ JH«P;•òPûªV²>)‘a^Êl ™SèvD”„×’â-¬d.èxžŠ||.*@ˆùøõD…Aò:¼Îìè" tlàUMÓBSøB¾Žoïέz~Œ1ÿÌS¸ïSËí.Y¥$ŠÏ¹ãú Rw Yw}«›ÛmæùnJ³<ñkŸpî}߉w‡ALŠ¢¾Œäעޱ'&*ž]¸+”0ÉÕ€Î#“Úwþ[“À»wße¶ÍΩ_™0¸I@·,>}!;ØZêƒý¡>vp+Áá  %ÉuðenÂøUt÷UrýÑ–ðáuÿ^Xï]ëÿ&íùÿPKÊÁ¼ È gMPK1E¥R settings.xmlÝZ[sâ¸~ß_1EͩڭS ¹ Ô$[æb`B¸šKü2%,šÈ’W’1ä×ÉL†˜ kã­S›‡¶ô}Ý­Vw«í/®=òa…¸ÀŒÞä ŸŒÜD]1]ÜäF¶uö9÷çío_Ø|Ž]T†Ì ~€@òøÆÍöBÀ£\ûw:8¦ï“ÍH ^œ>IW°TŠÚÚñFƒööÂÇßg\·tÁpòG^,Gy¥úÏyåãïðy!Õ`Àá'ÁfɤR¥ ª€ãUæéf¡îÙJ¤“ÖrQÅœ™æn2¡j@,3“ &” ÍA@¤k(ã‹£ä!¶îÍ4tèrìK‹½s"MqÄÖ4Ú™ZgOô.vŠ·UùŒÕ¥QØ9¡.‡;¤ã3 !¢/û>}¿´­7AÌño·‰M4Íu4LXf®vÀ~©·C=¢µPA Luï01BÂwç§M ¿âop±Ë,ö-’­Œn3²@Š&ãøIm@N¿ßš@ºÙýeÒºôqEæ^@]¼Û%H×ÎÕ¼ cJ™Ì *À}Ì¢¥òšãݧ©IT!˜Mói‹ÎA¨=.+é-,3:0ìv;6C‚(Ui%2yRqt˜<Œž^…n ÉÛhBmNVO™"”­#Ù8ùušUÙ6³xŸT,àÈTÝ—Ö‘Cª°äªØó@lW+aµ§jÆþrx^VY*òˆ~–ûæIÓwŽ`o©2I¿G¢  6ؼ^Ï^AXx¦ŽÃŒZÍT”1»ó™¥ÙûÖ^PùŠä·gß>_Òé×¾Zxμ!’Áþ òd˃x,üOO7fó¿ycÙŸ%ÏñÈwgäh•ú®WšwkîúÞüÿúëÆýÑ“ßY¥žã9þCq|çLóQóëjú´8¿·_†NLóÞ¼ü1µeZÎH}>Îú¦9ôJxаŒ‡¡¹®ÒÊL. gÚ* ­ÊÜ.:˜tÈÐÓBe3+|¾è<ÕêWRãÆTóÀ¤ôÆ••K›‡ 1ª^gå6qŸŒµþ>k¬—°1*9ž%Üâèn6±6N‘NÃú N;ÆLãÔŒ°]3Å}5 ·sJ§1acQºÿÞ¿s›áL2S㔌Ž7 P¯‘ýÌ/jY{¶y7²*õ~±¤ä_DºõýþÃ’Q‘\9¶¯ì¤u4‡“ËN¶šotÉ8tãYÜÆš š_‡ÓŠâ]vg…Aa6ù*e¯ú¢R³B¿?ÌÖ¸o×ÇS£ÐÔG£—¹õÂÊiŒ®ºëÕ̃–Ó€$a¬½TᑜÁC÷o ui•0‘E^{yÜ_€ízu ß×ùPU½:‚ØÈóÉ;ða+ìáæß¼Ž—?ôÂæíÿPKŒZ¶1øò)PK1E¥R#eɽââThumbnails/thumbnail.png‰PNG  IHDR¾:<±PLTEnnnttt}}}7h¥=l¨Cp«Oy°T}²^…¶bˆ¸l¼q“¿{šÃƒƒƒŒŒŒ“““›››¢¢¢«««´´´»»»€žÆ†£È‹§Ë¨Ë“¬Îœ´Ò¤ºÕ©½Ø­ÀÚ²ÄܸÉß¼ÌàÃÃÃËËËÔÔÔÛÛÛÀÏâÄÒäÉÕæË×èËØçÍÙèÑÜêÖàìÚâíÞæðãããëëëàçðãêòéîôíñöóóóòõøöøúþþþÿÿÿq(ìIDATxÚíÜm{›6à6k·5 /¯k›%µ KÁÎÿÿeƒ¤NìØNRÛéÚC°¹üáÉçH²ß‘ÓÛ;ðÁ|ðÁ|ðÁ|ðÁ|ðÁ|ðÁ|ðÁ|ðÁ|ðÁ|ðäÒF‘ÖL“ìv;§ø*fü½ñ” Ÿ{‚±‰[Áó^†žftDQ̃(Vnñ }BÔúšîÐü/^]\\9Êof_.§Ÿ¿—.òë´èö—Ÿ¨­ÒÊ5~•þ¼æùý³¥KüùãõÎïeV»ÂÏÓfíÉêA‘5ð›,o7þ—LJEÖZÏŸfOnÅÚã4·š¿HÛ‘´ñ¬¶ò‹ÝËÓ Þ¤…üzOËܾf†œç”|tLÒ$ÑFƯUh´T“Vt‡‡Óý+µ`6ñ;LHž”%‰Ÿt'}e˜ŒX蛇ó¡ BÙĤôô„©pýd¿d$<ÁYxöxS<1›bßÜýÙ:I}©B´,æa‡¦{2~ûõûδx»—Ÿ^ÚØq¦®wœÍ>?=óí·ÂF>Õ厔æê|«ŠImÍyê´})i¨nlÎ8·ËÂM~9·;aÞ  çùEïaåÊf¾?hÁx`¿Ÿ-öð§ÃV‹‡¾m-nvñ›©+# ë´âW™;%k”ßåœ ç©Ò ~± §øÔþ  ;~6 ۱g^®øw9'J˜ï(¾Ë9Y¾?­)_¦ä*Ÿò⺠wùT¦?¿¯t»¿Ä¸ÅO(I8E2–ݯ/Ebbé?PÌ3Œ{œ‡2™°È¥àñ‰¦»þqˆ›H;uõ(ٳݺÜóLÿ¸,?þå*¿žÍ¯ÓÆIþbU¡ä3ùéíãmÈ ÇøËÍ!«zø…Çðób;}®]á7;[« ÓÒý6ß7ýô'o[Š÷aOÊ\º1Â\ÝîìÛ뜜à÷ÃËÕÈ=þ‘M·ÜêcƘÞ:f|³$™ñ™Ëc:Îb}$9ÊäîQý~½/ã,H:ÉZ¶^ߺȧêÞ],ÉIþýÔn5Òg½O‘óÜfÍX+ñN’²µ£é±žG­Œ1Žò Ó>K8s•ô߆®éK_gƒÇõ¦Ûm—nó?.\æW7N_ý™ÛÁ“ƒþÿ”_¸Í'ðÇáOÎî¾—ž[àc1?fQèkFÏ-¯²˜¯•R‰™<·< ±>øàƒ>øàƒ>øàƒ>øàƒ>øàƒ>øàƒ>øàƒ>øàƒ>øàƒ>øàƒ>øàƒ>øàƒ>øàƒ>øàƒ>øàƒ>øàƒ>øàƒÐö_XŽ”eÃIEND®B`‚PK1E¥Rmeta.xml“M›0†ïýˆÝ+ø ’Å"¬ÔCÕÃV­ÔTê-"¶—u 6²Í’þû‚”ÝDU$0¼ÏŒçõLþxjêàU+µÚ…(†a Ó\ªjþØŠÂÇâC®ŸŸ%”kÖ5B¹¨® TYÚa‡Pé|†Î(ªK+-Ue#,uŒêV¨¤— õE§øTFk½ _œk)#ëû¾{²h ¨/]½JÑß-D©dsëIGíÅ1ÇîoM0j׬md}+;j#¦›v8Á±ë4œ[n;Sû†9¢#oŠX´§Zªß×BY–ÿ÷|ÿµ>ygýôuk7ó ù&æ÷Õà‘°X¦l´¬È½qÌï~4Ü¢(0Ä(‚8BpM EY¼ÝnFI–äà ‘sFWh:<{i‚(!q·g˜À,²©ªàÒ ñÎø\Å·=ùœ¦_pú}®r¡x ²?¬¶ ä|ŽOâJ(1ÐÚOòhÄWß<ØÆ0Nb|ÿ$Uw:ü|Ø6I°Z£ æ„÷;YóÏEþå›òŸ—ÕŽ‹fdëãÈsÕ)· “4EÞX®­{ñPK)FÃ,PK1E¥RMETA-INF/manifest.xml­“MjÃ0…÷9…ÑÞR6EÄɢФPí‘#FB?Á¾}%Ç.%Cv3Ìè½OiŒ®.àƒ²ØWúB*ÀÖv û†|Ÿ¾êr<ìöF ’"Ÿ‹*ŸÃpk’øtNæ…ÒŹ¤û;&ʈX™or1Ńè{öï;~PKµºâ&ÉPK1E¥R3&¬¨//mimetypePK1E¥RUConfigurations2/toolbar/PK1E¥R‹Configurations2/floater/PK1E¥RÁConfigurations2/menubar/PK1E¥R÷Configurations2/popupmenu/PK1E¥R/Configurations2/toolpanel/PK1E¥RgConfigurations2/progressbar/PK1E¥R¡Configurations2/statusbar/PK1E¥RÙConfigurations2/images/Bitmaps/PK1E¥RConfigurations2/accelerator/PK1E¥R óŸqtÑ Pstyles.xmlPK1E¥RÊÁ¼ È gM ùcontent.xmlPK1E¥RŒZ¶1øò) úsettings.xmlPK1E¥R#eɽââ,&Thumbnails/thumbnail.pngPK1E¥R)FÃ,D,meta.xmlPK1E¥Rµºâ&É=.META-INF/manifest.xmlPK+¦/icmake-10.03.00/exec/icm_bootstrap0000755000175000017500000000023214204126313015660 0ustar frankfrank#!/bin/bash . ../bootstrap/flags . ../bootstrap/functions echo Creating tmp${LIBDIR}/icm-exec subdirs maindir ${LIBDIR}/icm-exec -s rm -f */*.gch *.o icmake-10.03.00/exec/string/0000755000175000017500000000000014204243365014405 5ustar frankfrankicmake-10.03.00/exec/string/string.ih0000644000175000017500000000011114204126313016217 0ustar frankfrank#include "string.h" #include "../../xerr/xerr.ih" using namespace std; icmake-10.03.00/exec/string/vequal.cc0000644000175000017500000000016614204126313016205 0ustar frankfrank//#define XERR #include "string.ih" bool String::vEqual(VarBase const &rhs) const { return d_str == rhs.str(); } icmake-10.03.00/exec/string/vtostring.cc0000644000175000017500000000013514204126313016743 0ustar frankfrank//#define XERR #include "string.ih" string String::vto_string() const { return d_str; } icmake-10.03.00/exec/string/vaddis.cc0000644000175000017500000000017714204126313016164 0ustar frankfrank//#define XERR #include "string.ih" VarBase &String::vAddIs(VarBase const &rhs) { d_str += rhs.str(); return *this; } icmake-10.03.00/exec/string/icmconf0000777000175000017500000000000014204126313020500 2../../icmconf.dirustar frankfrankicmake-10.03.00/exec/string/vstr.cc0000644000175000017500000000013614204126313015703 0ustar frankfrank//#define XERR #include "string.ih" string const &String::vStr() const { return d_str; } icmake-10.03.00/exec/string/vinsertinto.cc0000644000175000017500000000016314204126313017271 0ustar frankfrank//#define XERR #include "string.ih" ostream &String::vInsertInto(ostream &out) const { return out << d_str; } icmake-10.03.00/exec/string/destructor.cc0000644000175000017500000000007214204126313017102 0ustar frankfrank//#define XERR #include "string.ih" String::~String() {} icmake-10.03.00/exec/string/vcopy.cc0000644000175000017500000000015014204126313016041 0ustar frankfrank//#define XERR #include "string.ih" VarBase *String::vcopy() const { return new String{ d_str }; } icmake-10.03.00/exec/string/vbool.cc0000644000175000017500000000014214204126313016023 0ustar frankfrank//#define XERR #include "string.ih" bool String::vBool() const { return not d_str.empty(); } icmake-10.03.00/exec/string/string1.f0000644000175000017500000000010214204126313016125 0ustar frankfrankinline String::String(std::string const &str) : d_str(str) {} icmake-10.03.00/exec/string/vorder.cc0000644000175000017500000000041514204126313016206 0ustar frankfrank//#define XERR #include "string.ih" strong_ordering String::vOrder(VarBase const &rhs) const { return d_str < rhs.str() ? strong_ordering::less : d_str > rhs.str() ? strong_ordering::greater : strong_ordering::equal; } icmake-10.03.00/exec/string/frame0000644000175000017500000000006214204126313015411 0ustar frankfrank//#define XERR #include "string.ih" String:: { } icmake-10.03.00/exec/string/visstring.cc0000644000175000017500000000013114204126313016730 0ustar frankfrank//#define XERR #include "string.ih" bool String::vIsString() const { return true; } icmake-10.03.00/exec/string/string.h0000644000175000017500000000157214204126313016062 0ustar frankfrank#ifndef INCLUDED_STRING_ #define INCLUDED_STRING_ #include #include "../varbase/varbase.h" class String: public VarBase { std::string d_str; public: String(std::string const &str = ""); // 1.f ~String() override; private: // these members *may* be overridden: std::string const &vStr() const override; std::strong_ordering vOrder(VarBase const &rhs) const override; // these members *must* be overridden: bool vEqual(VarBase const &rhs) const override; std::ostream &vInsertInto(std::ostream &out) const override; bool vBool() const override; VarBase &vAddIs(VarBase const &rhs) override; std::string vto_string() const override; bool vIsString() const override; VarBase *vcopy() const override; }; #include "string1.f" #endif icmake-10.03.00/exec/usage.cc0000644000175000017500000000123314204126313014502 0ustar frankfrank// usage.cc #include "main.ih" namespace { char const info[] = R"( [options] bimfile [args] Where: [options] - optional arguments (short options between parentheses): --no-version-check (-n) - the bimfile's main version may differ from )"; char const info2[] = R"() bimfile - binary icmake '.bim' file (default extension: .bim) [args] - optional additional arguments passed on to the bimfile )"; } void usage(std::string const &progname) { Tools::usageTop(progname) << info << progname << "'s main version (" << stoul(VERSION) << info2; } icmake-10.03.00/exec/global/0000755000175000017500000000000014204243365014337 5ustar frankfrankicmake-10.03.00/exec/global/global.ih0000644000175000017500000000045214204126313016113 0ustar frankfrank#include "global.h" #include #include "../../xerr/xerr.ih" #include "../../support/exprtype/exprtype.h" #include "../../support/bimheader/bimheader.h" #include "../int/int.h" #include "../string/string.h" #include "../list/list.h" using namespace std; using namespace FBB; icmake-10.03.00/exec/global/global1.cc0000644000175000017500000000143714204126313016165 0ustar frankfrank//#define XERR #include "global.ih" Global::Global(BimHeader &hdr) { hdr.varsSection(); while (not hdr.endVars()) { xerr("at offset " << hex << hdr.offset() << ' ' <()) { case e_int: xerr("int"); push_back(new Int); break; case e_str: xerr("string"); push_back(new String); break; case e_list: xerr("list"); push_back(new List); break; default: throw Exception{} << "invalid variable type at offset " << hex << (hdr.offset() - 1); } } xerr("done"); } icmake-10.03.00/exec/global/icmconf0000777000175000017500000000000014204126313020432 2../../icmconf.dirustar frankfrankicmake-10.03.00/exec/global/global.h0000644000175000017500000000045014204126313015740 0ustar frankfrank#ifndef INCLUDED_GLOBAL_ #define INCLUDED_GLOBAL_ #include #include "../variable/variable.h" class BimHeader; class Global: private std::vector { public: Global(BimHeader &hdr); using std::vector::operator[]; private: }; #endif icmake-10.03.00/exec/global/frame0000644000175000017500000000006214204126313015343 0ustar frankfrank//#define XERR #include "global.ih" Global:: { } icmake-10.03.00/exec/list/0000755000175000017500000000000014204243365014052 5ustar frankfrankicmake-10.03.00/exec/list/vequal.cc0000644000175000017500000000016614204126313015652 0ustar frankfrank//#define XERR #include "list.ih" bool List::vEqual(VarBase const &rhs) const { return d_list == rhs.list(); } icmake-10.03.00/exec/list/vtostring.cc0000644000175000017500000000021114204126313016403 0ustar frankfrank//#define XERR #include "list.ih" string List::vto_string() const { ostringstream os; vInsertInto(os); return os.str(); } icmake-10.03.00/exec/list/list.ih0000644000175000017500000000022714204126313015341 0ustar frankfrank#include "list.h" #include #include #include #include #include "../../xerr/xerr.ih" using namespace std; icmake-10.03.00/exec/list/vaddis.cc0000644000175000017500000000031714204126313015625 0ustar frankfrank//#define XERR #include "list.ih" VarBase &List::vAddIs(VarBase const &rhs) { auto const &rhsList = rhs.list(); std::copy(rhsList.begin(), rhsList.end(), back_inserter(d_list)); return *this; } icmake-10.03.00/exec/list/icmconf0000777000175000017500000000000014204126313020145 2../../icmconf.dirustar frankfrankicmake-10.03.00/exec/list/vlist.cc0000644000175000017500000000014514204126313015513 0ustar frankfrank//#define XERR #include "list.ih" vector const &List::vList() const { return d_list; } icmake-10.03.00/exec/list/list.h0000644000175000017500000000164414204126313015174 0ustar frankfrank#ifndef INCLUDED_LIST_ #define INCLUDED_LIST_ #include #include #include "../varbase/varbase.h" class List: public VarBase { std::vector d_list; public: List() = default; List(std::vector &&tmp); // 1.cc ~List() override; std::string const &operator[](size_t idx) const; private: std::vector const &vList() const override; VarBase &vSubIs(VarBase const &rhs) override; // these members *must* be overridden: bool vEqual(VarBase const &rhs) const override; std::ostream &vInsertInto(std::ostream &out) const override; bool vBool() const override; VarBase &vAddIs(VarBase const &rhs) override; std::string vto_string() const override; bool vIsString() const override; VarBase *vcopy() const override; }; #endif icmake-10.03.00/exec/list/vinsertinto.cc0000644000175000017500000000041114204126313016732 0ustar frankfrank//#define XERR #include "list.ih" ostream &List::vInsertInto(ostream &out) const { if (d_list.empty()) return out; std::copy(d_list.begin(), d_list.end() - 1, ostream_iterator(out, " ")); return out << d_list.back(); } icmake-10.03.00/exec/list/destructor.cc0000644000175000017500000000006414204126313016550 0ustar frankfrank//#define XERR #include "list.ih" List::~List() {} icmake-10.03.00/exec/list/vcopy.cc0000644000175000017500000000016514204126313015514 0ustar frankfrank//#define XERR #include "list.ih" VarBase *List::vcopy() const { return new List{ vector{ d_list } }; } icmake-10.03.00/exec/list/list1.cc0000644000175000017500000000013714204126313015407 0ustar frankfrank//#define XERR #include "list.ih" List::List(vector &&tmp) : d_list(move(tmp)) {} icmake-10.03.00/exec/list/vbool.cc0000644000175000017500000000014014204126313015466 0ustar frankfrank//#define XERR #include "list.ih" bool List::vBool() const { return not d_list.empty(); } icmake-10.03.00/exec/list/frame0000644000175000017500000000005614204126313015061 0ustar frankfrank//#define XERR #include "list.ih" List:: { } icmake-10.03.00/exec/list/vsubis.cc0000644000175000017500000000100214204126313015656 0ustar frankfrank//#define XERR #include "list.ih" VarBase &List::vSubIs(VarBase const &rhs) { auto rhsList = rhs.list(); // vector of strings in rhs List auto iter = remove_if(d_list.begin(), d_list.end(), [&](string const &element) { // returns true is element is in rhs return find(rhsList.begin(), rhsList.end(), element) != rhsList.end(); } ); d_list.resize(iter - d_list.begin()); return *this; } icmake-10.03.00/exec/list/visstring.cc0000644000175000017500000000012614204126313016401 0ustar frankfrank//#define XERR #include "list.ih" bool List::vIsString() const { return false; } icmake-10.03.00/exec/icmconf0000644000175000017500000000124414204171312014431 0ustar frankfrank#define PRECOMP "-x c++-header" #define USE_ALL "a" //#define CLS #define LIBRARY "modules" #define MAIN "main.cc" #define SOURCES "*.cc" #define OBJ_EXT ".o" #define TMP_DIR "tmp" #define USE_ECHO ON //#define USE_VERSION #define CXX "g++" #define CXXFLAGS " --std=c++20 -Wall -O2" \ " -fdiagnostics-color=never " #define IH ".ih" #define REFRESH #define LDFLAGS "-s" #define ADD_LIBRARIES "support bobcat" #define ADD_LIBRARY_PATHS "../../support/tmp" #define DEFCOM "program" icmake-10.03.00/exec/changelog0000644000175000017500000000057514204126313014751 0ustar frankfrankicm-exec version 10.00.00 * C++ version of icm-exec * As with flexc++ canonical paths are not used anymore. Instead absolute paths are used (builtin/chdir.cc) * Added option -n: drops the requirement that icm-exec and the bim file to unassemble must have identical main version numbers. -- Frank B. Brokken Wed, 05 May 2021 11:09:34 +0200 icmake-10.03.00/exec/builtin/0000755000175000017500000000000014204243365014545 5ustar frankfrankicmake-10.03.00/exec/builtin/getbase.cc0000644000175000017500000000020414204126313016453 0ustar frankfrank//#define XERR #include "builtin.ih" void Builtin::getBase() { d_reg = filesystem::path{ d_stack[2].str() }.stem().string(); } icmake-10.03.00/exec/builtin/name.f0000644000175000017500000000013714204126313015626 0ustar frankfrankinline char const *Builtin::name(size_t funIdx) { return BuiltinFunctions::name(funIdx); } icmake-10.03.00/exec/builtin/strchr.cc0000644000175000017500000000046114204126313016353 0ustar frankfrank//#define XERR #include "builtin.ih" // the lowest index in a string // haystack [2] where a character in needle [3] was found. // If not found, -1 is returned. void Builtin::strChr() { size_t idx = d_stack[2].str().find_first_of(d_stack[3].str()); d_reg = idx == string::npos ? -1 : idx; } icmake-10.03.00/exec/builtin/asciistr2int.cc0000644000175000017500000000054414204126313017466 0ustar frankfrank#define XERR #include "builtin.ih" // ascii("Abc") returns the ascii value of the first char in the string as int // value (in the example: 'A' -> 65). For an empty string 0 is returned void Builtin::asciiStr2int() { xerr(""); string const &str = d_stack.top().str(); d_reg = as( str.empty() ? '\0' : str[0] ); xerr("done"); } icmake-10.03.00/exec/builtin/changebase.cc0000644000175000017500000000063514204126313017131 0ustar frankfrank//#define XERR #include "builtin.ih" // the stack's top contains the filename, the element before that // the new basename. void Builtin::changeBase() { filesystem::path name{ d_stack[2].str() }; string ext = name.extension(); // keep the extension // at stacktop - 1: the new basename d_reg = name.replace_filename(d_stack[3].str()).string() + ext; } icmake-10.03.00/exec/builtin/listlen.cc0000644000175000017500000000015014204126313016513 0ustar frankfrank//#define XERR #include "builtin.ih" void Builtin::listLen() { d_reg = d_stack[2].list().size(); } icmake-10.03.00/exec/builtin/strformat.cc0000644000175000017500000000077714204126313017101 0ustar frankfrank//#define XERR #include "builtin.ih" // prints the formatted (%\d+) arguments into a string // // The arguments are: the number of arguments [2], and then the // remaining arguments (the format string at [3]) in the order in which they // are referred to by %\d. (%1 = [3 + 1], etc) // // Since this is a formatted string print, insertReplace instead of insert is // called directly void Builtin::strFormat() { ostringstream out; insertReplace(out, d_stack[3].str(), 3); d_reg = out.str(); } icmake-10.03.00/exec/builtin/unionadd.cc0000644000175000017500000000047214204126313016651 0ustar frankfrank//#define XERR #include "builtin.ih" // static void Builtin::unionAdd(vector &dest, string const &src) { // src not yet available if (find(dest.begin(), dest.end(), src) == dest.end()) dest.push_back(src); // then add it. } icmake-10.03.00/exec/builtin/getch.cc0000644000175000017500000000016014204126313016134 0ustar frankfrank//#define XERR #include "builtin.ih" void Builtin::getCh() { d_reg = string{ as(OneKey{}.get()) }; } icmake-10.03.00/exec/builtin/insert.cc0000644000175000017500000000071114204126313016350 0ustar frankfrank//#define XERR #include "builtin.ih" // begin is the stack location of the 1st argument to process, // end is the stack location just beyond the last arg. to process void Builtin::insert(ostream &out, size_t begin, size_t end) const { xerr(""); auto const &arg1 = d_stack[begin]; if (not arg1.isString() || not (s_percent << arg1.str()) ) insertDirect(out, begin, end); else insertReplace(out, arg1.str(), begin); } icmake-10.03.00/exec/builtin/stat.cc0000644000175000017500000000125314204126313016021 0ustar frankfrank#define XERR #include "builtin.ih" // This function expects a filename as last pushed // value. The file attributes are retrieved by Stat // A list is returned, containing: // // [0]: the file's attributes. // [1]: the file size. void Builtin::stat() { int check = d_stack[2].value(); Stat st{ d_stack[3].str() }; if (not st) { if (check == P_CHECK) throw Exception{} << "can't stat `" << st.name() << '\''; d_reg = vector{ "-1" }; } else { auto &stat = st.statStruct(); d_reg = vector{ to_string(stat.st_mode), to_string(stat.st_size) }; } } icmake-10.03.00/exec/builtin/youngerlist.f0000644000175000017500000000014214204126313017266 0ustar frankfrankinline vector Builtin::youngerList() const { return patternCompare(Tools::younger); } icmake-10.03.00/exec/builtin/trim.cc0000644000175000017500000000015314204126313016017 0ustar frankfrank//#define XERR #include "builtin.ih" void Builtin::trim() { d_reg = String::trim(d_stack[2].str()); } icmake-10.03.00/exec/builtin/removeenv.cc0000644000175000017500000000046614204126313017061 0ustar frankfrank#define XERR #include "builtin.ih" // an environ spec without '=' was found void Builtin::removeEnv(string &spec) { putenv(&spec.front()); // remove the environment specification if (auto iter = d_environment.find(spec); iter != d_environment.end()) d_environment.erase(iter); } icmake-10.03.00/exec/builtin/data.cc0000644000175000017500000000421314204126313015756 0ustar frankfrank//#define XERR #include "builtin.ih" char const Builtin::s_space[] = " \t\f\n\r\v"; // 1 Pattern Builtin::s_percent{ R"(%(\d+))" }; std::unordered_map const Builtin::s_globSpecs = { // type flags { O_ALL, { Glob::ANY, Glob::PERIOD | Glob::NOMATCH } }, { O_DIR, { Glob::DIRECTORY, Glob::PERIOD | Glob::NOMATCH } }, { O_FILE, { Glob::REGULAR_FILE, Glob::PERIOD | Glob::NOMATCH } }, { O_SUBDIR, { Glob::DIRECTORY, Glob::NOMATCH } }, }; // See ../../support/builtinfunctions/builtinfunctions.h void(Builtin::*Builtin::s_function[])() = { // 0 &Builtin::argHead, &Builtin::argTail, &Builtin::asciiStr2int, &Builtin::asciiInt2str, // 4 &Builtin::backtick, &Builtin::changeBase, &Builtin::changeExtension, &Builtin::changePath, // 8 &Builtin::chdir, &Builtin::cmdHead, &Builtin::cmdTail, &Builtin::echo, // c &Builtin::listElement, &Builtin::backtick, // the eval() call is handled by backtick &Builtin::exec, &Builtin::exec, // execute is only used by the compiler, // there's no need for a separate function // 10 &Builtin::exists, &Builtin::fgets, &Builtin::fprintf, &Builtin::getBase, // 14 &Builtin::getDotExtension, &Builtin::getExtension, &Builtin::getPath, &Builtin::getCh, // 18 &Builtin::getEnvironVar, &Builtin::getPid, &Builtin::gets, &Builtin::listLen, // 1c &Builtin::makeList, &Builtin::printf, &Builtin::putEnvironment, &Builtin::stat, // 20 &Builtin::strElement, &Builtin::strFind, &Builtin::strFormat, &Builtin::strLength, // 24 &Builtin::strLowercase, &Builtin::resize, &Builtin::strTok, &Builtin::strUppercase, // 28 &Builtin::substring, &Builtin::system, &Builtin::trim, &Builtin::trimLeft, // 2c &Builtin::trimRight, &Builtin::strChr, &Builtin::listFind, &Builtin::listUnion, // 30 &Builtin::listConstruct, }; icmake-10.03.00/exec/builtin/changeextension.cc0000644000175000017500000000042614204126313020231 0ustar frankfrank//#define XERR #include "builtin.ih" // the stack's top contains the filename, the element before that // the new extension void Builtin::changeExtension() { filesystem::path name{ d_stack[2].str() }; d_reg = name.replace_extension(d_stack[3].str()).string(); } icmake-10.03.00/exec/builtin/cmdtail.cc0000644000175000017500000000014414204126313016461 0ustar frankfrank//#define XERR #include "builtin.ih" void Builtin::cmdTail() { d_cmdTail = d_stack[2].str(); } icmake-10.03.00/exec/builtin/insertdirect.cc0000644000175000017500000000050514204126313017544 0ustar frankfrank//#define XERR #include "builtin.ih" // the 1st arg is begin, beyond the last is at end void Builtin::insertDirect(ostream &out, size_t begin, size_t end) const { for (; begin != end; ++begin) { xerr(begin << ": `" << d_stack[begin] << "' (begin: " << begin << ")'"); out << d_stack[begin]; } } icmake-10.03.00/exec/builtin/getpid.cc0000644000175000017500000000014014204126313016314 0ustar frankfrank//#define XERR #include "builtin.ih" void Builtin::getPid() { d_reg = as(getpid()); } icmake-10.03.00/exec/builtin/getpath.cc0000644000175000017500000000021714204126313016501 0ustar frankfrank//#define XERR #include "builtin.ih" void Builtin::getPath() { d_reg = filesystem::path{ d_stack[2].str() }.remove_filename().string(); } icmake-10.03.00/exec/builtin/cmdhead.cc0000644000175000017500000000014414204126313016431 0ustar frankfrank//#define XERR #include "builtin.ih" void Builtin::cmdHead() { d_cmdHead = d_stack[2].str(); } icmake-10.03.00/exec/builtin/gets.cc0000644000175000017500000000020114204126313016000 0ustar frankfrank//#define XERR #include "builtin.ih" void Builtin::gets() { string line; getline(cin, line); d_reg = move(line); } icmake-10.03.00/exec/builtin/printf.cc0000644000175000017500000000055714204126313016356 0ustar frankfrank//#define XERR #include "builtin.ih" // prints the arguments of a printf call. // // The arguments are: the number of arguments [2], and then the // remaining argument in the order in which they must be printed // ([3], [4], etc) void Builtin::printf() { d_reg = d_stack[2]; insert(cout, 3, 3 + d_reg.value()); xerr("returns: " << d_reg.value()); } icmake-10.03.00/exec/builtin/getdotextension.cc0000644000175000017500000000022114204126313020263 0ustar frankfrank//#define XERR #include "builtin.ih" void Builtin::getDotExtension() { d_reg = filesystem::path{ d_stack[2].str() }.extension().string(); } icmake-10.03.00/exec/builtin/listconstruct.cc0000644000175000017500000000050514204126313017765 0ustar frankfrank//#define XERR #include "builtin.ih" void Builtin::listConstruct() { xerr(""); vector vs; for (size_t begin = 3, end = begin + d_stack[2].value(); begin != end; ++begin ) vs.push_back(d_stack[begin].str()); xerr("1"); d_reg = move(vs); xerr("2"); } icmake-10.03.00/exec/builtin/builtin1.cc0000644000175000017500000000024614204126313016576 0ustar frankfrank//#define XERR #include "builtin.ih" Builtin::Builtin(Variable ®, Stack &stack) : d_orgDir(filesystem::current_path()), d_stack(stack), d_reg(reg) {} icmake-10.03.00/exec/builtin/makelist.cc0000644000175000017500000000240114204126313016653 0ustar frankfrank#define XERR #include "builtin.ih" // This function converts the last pushed string into a listvariable // holding expanded filenames. On return d_reg contains the // (alphabetically, case-sensitively sorted) list. // // The stack is organized as follows: // // 1: without older/younger // // stack[2] : Opcode::hlt // stack[3] : filemask value (file type) // stack[4] : pattern // // 2: with older/younger // // stack[2] : Opcode::older or Opcode::younger // stack[3] : filemask value // stack[4] : pattern // stack[5] : reference filename // // filemask values: O_ALL, O_DIR, O_FILE, O_SUBDIR // Glob Type: ANY, DIRECTORY, REGULAR_FILE, DIRECTORY // Glob Flags: PERIOD PERIOD PERIOD // NOMATCH NOMATCH NOMATCH NOMATCH void Builtin::makeList() { Opcodes::Byte selector = as(d_stack[2].value()); vector ret; switch (selector) { case Opcodes::younger: ret = youngerList(); break; case Opcodes::older: ret = olderList(); break; default: ret = patternList(); break; } d_reg = move(ret); } icmake-10.03.00/exec/builtin/getextension.cc0000644000175000017500000000031214204126313017555 0ustar frankfrank//#define XERR #include "builtin.ih" void Builtin::getExtension() { string ext{ filesystem::path{ d_stack[2].str() }.extension().string() }; d_reg = move(ext.empty() ? ext : ext.substr(1)); } icmake-10.03.00/exec/builtin/execute.cc0000644000175000017500000000122014204126313016502 0ustar frankfrank//#define XERR #include "builtin.ih" void Builtin::execute(bool check, char const *label, Process &process, void (Process::*member)() ) { if (d_echo) cout << process.str() << endl; (process.*member)(); // execute the command (using // start or system) int ret = process.waitForChild(); // get the return value if (check and ret != 0) // on failure... throw Exception{} << label << " `" << process.str() << "' failed. Exit value = " << ret << '\n'; d_reg = ret; } icmake-10.03.00/exec/builtin/asciiint2str.cc0000644000175000017500000000035714204126313017470 0ustar frankfrank//#define XERR #include "builtin.ih" // ascii(25) returns the string "A": the value is converted to an ascii // character in a returned String void Builtin::asciiInt2str() { d_reg = string{ as( d_stack.top().value() ) }; } icmake-10.03.00/exec/builtin/strelement.cc0000644000175000017500000000041314204126313017225 0ustar frankfrank//#define XERR #include "builtin.ih" void Builtin::strElement() { unsigned idx = d_stack[2].value(); // requested element auto &str = d_stack[3].str(); // the string to process d_reg = idx >= str.size() ? string{} : string{ str[idx] }; } icmake-10.03.00/exec/builtin/exec.cc0000644000175000017500000000204414204126313015771 0ustar frankfrank//#define XERR #include "builtin.ih" // This function is called to execute a command, (PATH is used). The stack // contains: // // stack[2]: the total number of arguments of the exec() statement. // including the execution mode and the command (so, if // 1 argument is provided, stack[2] == 3. // stack[3]: the execution mode (P_(NO)CHECK) // stack[4]: the command to execute // stack[5..]: any additional arguments void Builtin::exec() { Process process{ Process::NONE, Process::USE_SHELL, d_stack[4].str() }; // the cmd to execute // add the arguments for ( size_t idx = 5, end = idx + d_stack[2].value() - 2; idx != end; ++idx) process += ' ' + d_stack[idx].to_string(); // assigns d_ret execute(d_stack[3].value() == P_CHECK, "executing", process, &Process::start); } icmake-10.03.00/exec/builtin/trimleft.cc0000644000175000017500000000034014204126313016670 0ustar frankfrank//#define XERR #include "builtin.ih" void Builtin::trimLeft() { string const &str = d_stack[2].str(); auto from = str.find_first_not_of(s_space); d_reg = from == string::npos ? string{} : str.substr(from); } icmake-10.03.00/exec/builtin/strfind.cc0000644000175000017500000000025314204126313016516 0ustar frankfrank//#define XERR #include "builtin.ih" void Builtin::strFind() { size_t idx = d_stack[2].str().find(d_stack[3].str()); d_reg = idx == string::npos ? -1 : idx; } icmake-10.03.00/exec/builtin/resize.cc0000644000175000017500000000037214204126313016350 0ustar frankfrank//#define XERR #include "builtin.ih" void Builtin::resize() { string str{ d_stack[2].str() }; int16_t size = d_stack[3].value(); // new value if (size < 0) size = 0; str.resize(size, ' '); d_reg = move(str); } icmake-10.03.00/exec/builtin/builtin.ih0000644000175000017500000000162214204126313016527 0ustar frankfrank#ifndef INCLUDED_BUILTIN_IH_ #define INCLUDED_BUILTIN_IH_ #include "builtin.h" #include #include #include #include #include #include #include #include #include #include #include #include "../../xerr/xerr.ih" #include "../../support/constants/constants.h" #include "../../support/tools/tools.h" // not needed, but mentioned for reference purposes only: it defines the // ordering of the builtin-functions in data.cc // #include "../../support/builtinfunction/builtinfunction.h" #include "../../support/opcodes/opcodes.h" #include "../../support/as/as.h" #include "../variable/variable.h" #include "../stack/stack.h" #include "../list/list.h" using namespace std; using namespace FBB; #include "youngerlist.f" #include "olderlist.f" #endif icmake-10.03.00/exec/builtin/strlowercase.cc0000644000175000017500000000016114204126313017560 0ustar frankfrank//#define XERR #include "builtin.ih" void Builtin::strLowercase() { d_reg = String::lc(d_stack[2].str()); } icmake-10.03.00/exec/builtin/olderlist.f0000644000175000017500000000013614204126313016706 0ustar frankfrankinline vector Builtin::olderList() const { return patternCompare(Tools::older); } icmake-10.03.00/exec/builtin/listelement.cc0000644000175000017500000000050014204126313017365 0ustar frankfrank//#define XERR #include "builtin.ih" void Builtin::listElement() { xerr(d_stack[2] << ", " << d_stack[3]); auto &strVector = d_stack[3].list(); // vector with list strings unsigned idx = d_stack[2].value(); // requested element d_reg = idx >= strVector.size() ? string{} : strVector[idx]; } icmake-10.03.00/exec/builtin/backtick.cc0000644000175000017500000000221314204126313016616 0ustar frankfrank//#define XERR #include "builtin.ih" // This function expects a string specifying an executable command as argument // value. The command is executed by system(). The standard output produced by // the call is returned as a list, one element per output line. If the list is // empty the command has failed. A command not producing any output at least // results in a list having one (empty) string. void Builtin::backtick() { string const &cmd = d_stack[2].str(); // get the cmd // prepare for its execution Process process{ Process::COUT | Process::IGNORE_CERR, Process::USE_SHELL, cmd }; if (d_echo) cout << process.str() << endl; process.start(); vector lines; string line; while (getline(process, line)) { xerr(line); if (not process.eof()) line += '\n'; lines.push_back(move(line)); } int ret = process.waitForChild(); xerr("exit: " << ret); if (ret != 0) lines.clear(); else if (lines.empty()) lines.push_back(string{}); d_reg = move(lines); } icmake-10.03.00/exec/builtin/chdir.cc0000644000175000017500000000235114204126313016137 0ustar frankfrank//#define XERR #include "builtin.ih" // This function expects a string to change-dir to as second // argument on the stack. The stack top is the mode, // P_CHECK or P_NOCHECK. // // If the directory name is not empty, then the current working // directory is set to the indicated path. If the requested directory is an // empty string, then a change-dir is performed to the startup directory. // // Mode P_CHECK causes this function to abort upon failure. // // The return register is set to the resulting working directory. void Builtin::chdir() { auto mode = d_stack[2].value(); string const &requestDir = d_stack[3].str(); string dir = requestDir; if (dir.empty()) dir = d_orgDir; error_code ec; dir = filesystem::absolute(dir, ec); // abs. destination dir filesystem::current_path(dir, ec); // change to the path dir = filesystem::current_path().string(); // obtain the cwd's path if (ec and mode == P_CHECK) // chdir failed throw Exception{} << "can't chdir to `" << requestDir << '\''; if (dir.back() != '/') // make sure there's a final / dir += '/'; d_reg = move(dir); // assign the return register } icmake-10.03.00/exec/builtin/system.cc0000644000175000017500000000106714204126313016375 0ustar frankfrank//#define XERR #include "builtin.ih" void Builtin::system() { string const &cmd = d_stack[3].str(); // get the cmd // prepare for its execution Process process{ Process::NONE, Process::USE_SHELL, cmd }; // process.system(); // cout << "\n" // "DONE: process `" << cmd << "' returns " << // process.waitForChild() << endl; execute(d_stack[2].value() == P_CHECK, "system", process, &Process::system); } icmake-10.03.00/exec/builtin/substring.cc0000644000175000017500000000044614204126313017071 0ustar frankfrank//#define XERR #include "builtin.ih" void Builtin::substring() { string const &str = d_stack[2].str(); uint16_t idx = d_stack[3].value(); d_reg = idx >= str.length() ? string{} : str.substr(idx, as(d_stack[4].value())); } icmake-10.03.00/exec/builtin/listunion.cc0000644000175000017500000000072614204126313017076 0ustar frankfrank//#define XERR #include "builtin.ih" void Builtin::listUnion() { vector ret{ d_stack[2].list() }; // the source list if (d_stack[3].isString()) // the added element(s) unionAdd(ret, d_stack[3].str()); // a string: add it else { for (auto const &str: d_stack[3].list()) // a list... unionAdd(ret, str); // add its elements } d_reg = move(ret); } icmake-10.03.00/exec/builtin/icmconf0000777000175000017500000000000014204126313020640 2../../icmconf.dirustar frankfrankicmake-10.03.00/exec/builtin/strlength.cc0000644000175000017500000000015314204126313017056 0ustar frankfrank//#define XERR #include "builtin.ih" void Builtin::strLength() { d_reg = d_stack[2].str().length(); } icmake-10.03.00/exec/builtin/struppercase.cc0000644000175000017500000000016114204126313017563 0ustar frankfrank//#define XERR #include "builtin.ih" void Builtin::strUppercase() { d_reg = String::uc(d_stack[2].str()); } icmake-10.03.00/exec/builtin/arghead.cc0000644000175000017500000000014414204126313016437 0ustar frankfrank//#define XERR #include "builtin.ih" void Builtin::argHead() { d_argHead = d_stack[2].str(); } icmake-10.03.00/exec/builtin/insertreplace.cc0000644000175000017500000000141214204126313017703 0ustar frankfrank//#define XERR #include "builtin.ih" // at stack[from] the # arguments to process is stored. // the 1st arg is therefore at from + 1 void Builtin::insertReplace(ostream &out, string arg, size_t from) const { while (s_percent << arg) // find a %\d+ match { size_t idx = stoul(s_percent[1]); auto pos = s_percent.position(0); // get the indices out << arg.substr(0, pos.first); // insert info up to the % out << d_stack[from + idx]; // insert the arg. value arg.erase(0, pos.second); // remove the processed // %\d } out << arg; // insert the tail } icmake-10.03.00/exec/builtin/fgets.cc0000644000175000017500000000172514204126313016162 0ustar frankfrank#define XERR #include "builtin.ih" // The list has 4 values (output): // [0] - the read line // [1] - a '\n' if a newline was read // [2] - input: "OK": proceed; output: "OK" or "FAIL" // [3] - input: starting offset, output: next offset // // or empty: start reading from the file's beginning void Builtin::fgets() { enum { LINE, NL, OK, OFFSET }; string const &fileName = d_stack[2].str(); vectorlist = d_stack[3].list(); if (list.empty()) list = { "", "\n", "OK", "0" }; if (list[OK] == "OK") { ifstream in{ fileName }; in.seekg(stoull(list[OFFSET])); // go to the stream's offset if (not getline(in, list[LINE])) // no more lines list.clear(); else { list[OFFSET] = to_string(in.tellg()); if (in.eof()) list[OK] = "FAIL"; } } d_reg = move(list); } icmake-10.03.00/exec/builtin/echo.cc0000644000175000017500000000014614204126313015764 0ustar frankfrank//#define XERR #include "builtin.ih" void Builtin::echo() { d_echo = d_stack[2].value() == ON; } icmake-10.03.00/exec/builtin/getenvironvar.cc0000644000175000017500000000051314204126313017735 0ustar frankfrank#define XERR #include "builtin.ih" void Builtin::getEnvironVar() { char const *env = getenv( (char *)d_stack[2].str().c_str() ); d_reg = env == 0 ? vector{ "0", "" } // no such env. var : vector{ "1", env }; // return the env.var's value } icmake-10.03.00/exec/builtin/strtok.cc0000644000175000017500000000124214204126313016372 0ustar frankfrank#define XERR #include "builtin.ih" // This function is called at opcode op_strtok. The last pushed string is // converted to a list, by splitting it according to the separators which are // found in the one-but-last pushed string. // When the separator-string is empty, then the string to split is split // into separate characters. void Builtin::strTok() { string const &str = d_stack[2].str(); string const &sep = d_stack[3].str(); vector ret; if (not sep.empty()) String::split(&ret, str, String::TOK, sep.c_str()); else { for (char ch: str) ret.push_back(string{ ch }); } d_reg = move(ret); } icmake-10.03.00/exec/builtin/changepath.cc0000644000175000017500000000044214204126313017147 0ustar frankfrank//#define XERR #include "builtin.ih" // stack[2] contains the filename, [3] specifies the new path component void Builtin::changePath() { filesystem::path file{ filesystem::path{ d_stack[2].str() }.filename() }; d_reg = (filesystem::path{ d_stack[3].str() } /= file).string(); } icmake-10.03.00/exec/builtin/fprintf.cc0000644000175000017500000000111214204126313016510 0ustar frankfrank//#define XERR #include "builtin.ih" // prints the arguments of an fprintf call. // // The arguments are: the number of arguments ([2]), a filename ([3]), and // then the remaining arguments in the order in which they must be printed // ([4], [5], ...) void Builtin::fprintf() { d_reg = d_stack[2]; ofstream out = Exception::factory( d_stack[3].str(), ios::in | ios::ate, ios::out); // first arg = [2] (#args) insert(out, 4, 3 + d_reg.value()); } icmake-10.03.00/exec/builtin/echo.f0000644000175000017500000000007114204126313015621 0ustar frankfrankinline bool Builtin::echo() const { return d_echo; } icmake-10.03.00/exec/builtin/setenv.cc0000644000175000017500000000051614204126313016353 0ustar frankfrank//#define XERR #include "builtin.ih" bool Builtin::setEnv(string const &spec) { size_t pos = spec.find('='); // find the var/value separator if (pos == string::npos) // not found, so remove the env. return false; putenv(&(d_environment[spec.substr(0, pos)] = spec).front()); return true; } icmake-10.03.00/exec/builtin/argtail.cc0000644000175000017500000000014414204126313016467 0ustar frankfrank//#define XERR #include "builtin.ih" void Builtin::argTail() { d_argTail = d_stack[2].str(); } icmake-10.03.00/exec/builtin/patternlist.cc0000644000175000017500000000103214204126313017412 0ustar frankfrank#define XERR #include "builtin.ih" // stack[2] : Opcode::hlt (already handled by makeList()) // stack[3] : filemask value // stack[4] : pattern vector Builtin::patternList() const { auto const &specs = s_globSpecs.find(d_stack[3].value()); if (specs == s_globSpecs.end()) // invalid filemask return vector{}; Glob gl{ specs->second.type, d_stack[4].str().c_str(), specs->second.flags }; return vector{ gl.begin(), gl.end() }; } icmake-10.03.00/exec/builtin/trimright.cc0000644000175000017500000000034114204126313017054 0ustar frankfrank//#define XERR #include "builtin.ih" void Builtin::trimRight() { string const &str = d_stack[2].str(); auto to = str.find_last_not_of(s_space); d_reg = to == string::npos ? string{} : str.substr(0, to + 1); } icmake-10.03.00/exec/builtin/call.f0000644000175000017500000000012014204126313015611 0ustar frankfrankinline void Builtin::call(size_t funIdx) { (this->*s_function[funIdx])(); } icmake-10.03.00/exec/builtin/builtin.h0000644000175000017500000001015714204126313016361 0ustar frankfrank#ifndef INCLUDED_BUILTIN_ #define INCLUDED_BUILTIN_ #include #include #include #include #include #include "../../support/builtinfunctions/builtinfunctions.h" // see stack/README for a description of the organization of the stack. class Variable; class Stack; namespace FBB { class Pattern; class Process; class Stat; } class Builtin { struct GlobSpecs { FBB::Glob::Type type; int flags; }; std::filesystem::path d_orgDir; // startup working directory std::string d_cmdHead; std::string d_cmdTail; std::string d_argHead; std::string d_argTail; Stack &d_stack; bool d_echo = true; Variable &d_reg; std::unordered_map d_environment; static char const s_space[]; // all isspace() characters static FBB::Pattern s_percent; static std::unordered_map const s_globSpecs; static void(Builtin::*s_function[])(); public: Builtin(Variable ®, Stack &stack); void call(size_t funIdx); // call builtin function 'funIdx' static char const *name(size_t funIdx); bool echo() const; private: // begin: index of 1st arg to process, // end: index beyond the last arg void insert(std::ostream &out, size_t begin, size_t end) const; // insert the args without // arg-replacements void insertDirect(std::ostream &out, size_t begin, size_t end) const; // insert the args replacing // %\d elements. void insertReplace(std::ostream &out, std::string arg1, size_t begin) const; std::vector patternList() const; std::vector olderList() const; // .f std::vector youngerList() const; // .f std::vector patternCompare( bool (*keep)(std::string const &, FBB::Stat const &) ) const; void execute(bool check, char const *label, FBB::Process &process, void (FBB::Process::*member)()); bool setEnv(std::string const &spec); // called by putEnvironment void removeEnv(std::string &spec); static void unionAdd(std::vector &dest, std::string const &src); // See ../../support/builtinfunctions/builtinfunctions.h // 0 void argHead(); void argTail(); void asciiStr2int(); void asciiInt2str(); // 4 void backtick(); void changeBase(); void changeExtension(); void changePath(); // 8 void chdir(); void cmdHead(); void cmdTail(); void echo(); // c void listElement(); // eval() eval: handled by backtick void exec(); // ececute() // execute: only used by the compiler(); // no separate function required // 10 void exists(); void fgets(); void fprintf(); void getBase(); // 14 void getDotExtension(); void getExtension(); void getPath(); void getCh(); // 18 void getEnvironVar(); void getPid(); void gets(); void listLen(); // 1c void makeList(); void printf(); void putEnvironment(); void stat(); // 20 void strElement(); void strFind(); void strFormat(); void strLength(); // 24 void strLowercase(); void resize(); void strTok(); void strUppercase(); // 28 void substring(); void system(); void trim(); void trimLeft(); // 2c void trimRight(); void strChr(); void listFind(); void listUnion(); // 30 void listConstruct(); }; #include "call.f" #include "name.f" #include "echo.f" #endif icmake-10.03.00/exec/builtin/listfind.cc0000644000175000017500000000062014204126313016657 0ustar frankfrank//#define XERR #include "builtin.ih" // the index of the first element in the stack.top()'s list which is equal // to the stack[-1] string // // -1 is returned if such an element was not found. void Builtin::listFind() { auto const &list = d_stack[2].list(); auto iter = find(list.begin(), list.end(), d_stack[3].str()); d_reg = iter == list.end() ? -1 : iter - list.begin(); } icmake-10.03.00/exec/builtin/frame0000644000175000017500000000007114204126313015551 0ustar frankfrank//#define XERR #include "builtin.ih" void Builtin:: { } icmake-10.03.00/exec/builtin/patterncompare.cc0000644000175000017500000000151514204126313020073 0ustar frankfrank//#define XERR #include "builtin.ih" // stack[5] : reference filename vector Builtin::patternCompare( bool (*keep)(string const &entry, Stat const &reference) ) const { // last modification time of the // reference file Stat reference{ d_stack[5].str() }; vector ret = patternList(); // entries matching the pattern // move all entries that shouldn't auto iter = remove_if(ret.begin(), ret.end(), // be kept to the back [&](string const &entry) { return not keep(entry, reference); } ); ret.resize(iter - ret.begin()); // reduce to the remaining size return ret; } icmake-10.03.00/exec/builtin/exists.cc0000644000175000017500000000015614204126313016366 0ustar frankfrank//#define XERR #include "builtin.ih" void Builtin::exists() { d_reg = Tools::exists(d_stack[2].str()); } icmake-10.03.00/exec/builtin/putenvironment.cc0000644000175000017500000000074214204126313020145 0ustar frankfrank#define XERR #include "builtin.ih" // x=y: adds or replaces x in the environment with y // x : removes x from the environment void Builtin::putEnvironment() { string arg = d_stack[2].str(); // get the spec if (arg.empty()) { d_reg = 1; // empty spec: return 1 return; } if (!setEnv(arg)) // not set/change a specification removeEnv(arg); // then remove it d_reg = 0; } icmake-10.03.00/exec/main.cc0000644000175000017500000000457314204126313014334 0ustar frankfrank#define XERR #include "main.ih" // When called from icmake: the bim-file must be the first argument following // icmake's -e option. The initial .bim file and any subsequent arguments // are passed to icm-exec // // When called directly as '/usr/lib/icmake/icm-exec /tmp/input.bim: // ICM-EXEC ARGS: /usr/lib/icmake/icm-exec /tmp/input.bim // arguments: // nargs: 1, args: /tmp/input.bim // When called as 'icmake -e /tmp/input.bim: // ICM-EXEC ARGS: /usr/lib/icmake/icm-exec /tmp/input.bim // program name: // icm-exec // arguments: // nargs: 1, args: /tmp/input.bim // When called as 'icmake -e /tmp/input.bim -t: // ICM-EXEC ARGS: /usr/lib/icmake/icm-exec /tmp/input.bim -t // program name: // icm-exec // arguments: // nargs: 1, args: /tmp/input.bim // and /tmp/input.bim is removed namespace { option options[] = { { "help", no_argument, 0, 'h' }, { "no-version-check", no_argument, 0, 'n' }, { "version", no_argument, 0, 'v' }, { 0 } }; } int main(int argc, char **argv) try { int opt; bool versionCheck = true; string program{ basename(*argv) }; opterr = 0; while (true) { opt = getopt_long(argc, argv, "+hnv", options, 0); if (opt == -1) break; switch (opt) { case 'h': usage(program); return 0; case 'v': cout << program << " V" VERSION "\n"; return 0; case 'n': versionCheck = false; break; case '?': throw Exception{} << '`' << argv[optind] << "': not a valid icm_exec option"; }; } if (optind == argc) { usage(program); return 1; } cerr << hex; Stack stack(optind, argc, argv); // read the .bim-file header BimHeader bimHdr{ argv[optind], VERSION, versionCheck }; CPU cpu{ bimHdr, stack }; // create the icmake cpu processing bim-file // instructions. This bootstraps the cpu return cpu.run(); // run the program in the .bim file } catch (int ret) { return ret; } catch (exception const &exc) { cout << exc.what() << '\n'; return 1; } catch (...) { cout << "\n" "fatal: unaccounted for exception\n"; return 1; } icmake-10.03.00/exec/cpu/0000755000175000017500000000000014204243365013666 5ustar frankfrankicmake-10.03.00/exec/cpu/mul.cc0000644000175000017500000000022414204126313014761 0ustar frankfrank//#define XERR #include "cpu.ih" void CPU::mul() { int rhs = d_stack.top().value(); d_stack.pop(); d_stack.top().valueRef() *= rhs; } icmake-10.03.00/exec/cpu/smeq.cc0000644000175000017500000000021114204126313015125 0ustar frankfrank//#define XERR #include "cpu.ih" void CPU::smeq() { Variable rhs{ d_stack.topMove() }; d_stack.top() = d_stack.top() <= rhs; } icmake-10.03.00/exec/cpu/younger.cc0000644000175000017500000000036714204126313015664 0ustar frankfrank//#define XERR #include "cpu.ih" void CPU::younger() { Stat rhs{ d_stack.top().str() }; d_stack.pop(); xerr(d_stack.top().str() << " younger " << rhs.name()); d_stack.top() = as(Tools::younger(d_stack.top().str(), rhs)); } icmake-10.03.00/exec/cpu/popvar.cc0000644000175000017500000000036614204126313015502 0ustar frankfrank//#define XERR #include "cpu.ih" // This function is executed when an op_pop_var opcode is read // Follwing the opcode a variable index (either global or on the stack) // is expected. void CPU::popVar() { variable() = d_stack.topMove(); } icmake-10.03.00/exec/cpu/greq.cc0000644000175000017500000000021214204126313015117 0ustar frankfrank//#define XERR #include "cpu.ih" void CPU::greq() { Variable rhs{ d_stack.topMove() }; d_stack.top() = d_stack.top() >= rhs; } icmake-10.03.00/exec/cpu/asp.cc0000644000175000017500000000024714204126313014754 0ustar frankfrank//#define XERR #include "cpu.ih" // asp is followed by a 1 byte argument specifying the #elements to pop. void CPU::asp() { d_stack.asp(d_hdr.get()); } icmake-10.03.00/exec/cpu/dec.cc0000644000175000017500000000012314204126313014715 0ustar frankfrank//#define XERR #include "cpu.ih" void CPU::dec() { --variable().valueRef(); } icmake-10.03.00/exec/cpu/data.cc0000644000175000017500000000321414204126313015077 0ustar frankfrank//#define XERR #include "cpu.ih" void (CPU::*CPU::s_execute[])() = { &CPU::jmp, // 00 &CPU::jmpFalse, // 01 &CPU::jmpTrue, // 02 &CPU::push1jmpEnd, // 03 &CPU::push0, // 04 &CPU::pushImm, // 05 &CPU::pushStrConst, // 06 &CPU::pushVar, // 07 &CPU::pushReg, // 08 &CPU::popVar, // 09 &CPU::umin, // 0a &CPU::atoi, // 0b &CPU::itoa, // 0c &CPU::atol, // 0d &CPU::mul, // 0e &CPU::div, // 0f &CPU::mod, // 10 &CPU::add, // 11 &CPU::sub, // 12 &CPU::eq, // 13 &CPU::neq, // 14 &CPU::sm, // 15 &CPU::gr, // 16 &CPU::younger, // 17 &CPU::older, // 18 &CPU::smeq, // 19 &CPU::greq, // 1a &CPU::callRss, // 1b &CPU::asp, // 1c &CPU::nc<&CPU::exit>, // 1d const &CPU::copyVar, // 1e &CPU::inc, // 1f &CPU::dec, // 20 &CPU::call, // 21 &CPU::frame, // 22 &CPU::ret, // 23 &CPU::popReg, // 24 &CPU::band, // 25 &CPU::bor, // 26 &CPU::bnot, // 27 &CPU::bxor, // 28 &CPU::shl, // 29 &CPU::shr, // 2a }; icmake-10.03.00/exec/cpu/eq.cc0000644000175000017500000000021014204126313014564 0ustar frankfrank//#define XERR #include "cpu.ih" void CPU::eq() { Variable rhs{ d_stack.topMove() }; d_stack.top() = d_stack.top() == rhs; } icmake-10.03.00/exec/cpu/exit.cc0000644000175000017500000000015514204126313015140 0ustar frankfrank//#define XERR #include "cpu.ih" // d_reg's forced int-value is the return value void CPU::exit() const {} icmake-10.03.00/exec/cpu/cpu1.cc0000644000175000017500000000024314204126313015035 0ustar frankfrank//#define XERR #include "cpu.ih" CPU::CPU(BimHeader &hdr, Stack &stack) : d_hdr(hdr), d_stack(stack), d_global(hdr), d_builtin(d_reg, d_stack) {} icmake-10.03.00/exec/cpu/pushreg.cc0000644000175000017500000000034614204126313015646 0ustar frankfrank//#define XERR #include "cpu.ih" // This function is called when the return register must be pushed. The // return register is used to return information from built-in functions. void CPU::pushReg() { d_stack.push(d_reg); } icmake-10.03.00/exec/cpu/bor.cc0000644000175000017500000000022414204126313014746 0ustar frankfrank//#define XERR #include "cpu.ih" void CPU::bor() { int rhs = d_stack.top().value(); d_stack.pop(); d_stack.top().valueRef() |= rhs; } icmake-10.03.00/exec/cpu/run.cc0000644000175000017500000000154414204126313014776 0ustar frankfrank//#define XERR #include "cpu.ih" size_t counter = 0; int CPU::run() { d_hdr.start(); // at the first instruction to execute Opcodes::Byte opcode; do { uint32_t offset = d_hdr.offset(); opcode = as(d_hdr.get()); // next opcode if (not Opcodes::valid(opcode)) throw Exception{} << "At offset 0x" << setw(4) << offset << ": opcode 0x" << setw(2) << opcode << " not defined"; xerr(ios::dec << ++counter << hex << ": at " << offset << \ ": opcode " << opcode << " (" << Opcodes::mnemonic(opcode) << ')'); (this->*s_execute[opcode])(); // xerr("executed " << opcode); } while (opcode != Opcodes::Byte::exit); xerr("leaving"); return d_reg.forcedInt(); // force an int-value } icmake-10.03.00/exec/cpu/umin.cc0000644000175000017500000000015614204126313015140 0ustar frankfrank//#define XERR #include "cpu.ih" void CPU::umin() { d_stack.top().valueRef() = -d_stack.top().value(); } icmake-10.03.00/exec/cpu/inc.cc0000644000175000017500000000012314204126313014733 0ustar frankfrank//#define XERR #include "cpu.ih" void CPU::inc() { ++variable().valueRef(); } icmake-10.03.00/exec/cpu/cpu.ih0000644000175000017500000000075614204126313015000 0ustar frankfrank#include "cpu.h" #include #include #include #include #include "../../xerr/xerr.ih" #include "../../support/opcodes/opcodes.h" #include "../../support/bimheader/bimheader.h" #include "../../support/as/as.h" #include "../../support/builtinfunctions/builtinfunctions.h" #include "../../support/tools/tools.h" #include "../int/int.h" #include "../string/string.h" #include "../list/list.h" using namespace std; using namespace FBB; icmake-10.03.00/exec/cpu/gr.cc0000644000175000017500000000032414204126313014575 0ustar frankfrank//#define XERR #include "cpu.ih" void CPU::gr() { Variable rhs{ d_stack.topMove() }; xerr(d_stack.top() << " > " << rhs); d_stack.top() = d_stack.top() > rhs; xerr(" = " << d_stack.top()); } icmake-10.03.00/exec/cpu/shl.cc0000644000175000017500000000022514204126313014753 0ustar frankfrank//#define XERR #include "cpu.ih" void CPU::shl() { int rhs = d_stack.top().value(); d_stack.pop(); d_stack.top().valueRef() <<= rhs; } icmake-10.03.00/exec/cpu/call.cc0000644000175000017500000000136214204126313015103 0ustar frankfrank//#define XERR #include "cpu.ih" void CPU::call() { auto offset = d_hdr.get(); // the address of the fun to call // (in the .bim file, so wrt its // beginning xerr("call function at " << offset); // push the called function's RA d_stack.push( new Int{ as(d_hdr.offset()) } ); xerr("RA is " << d_hdr.offset()); d_stack.pushBP(); // save the BP, set it to the // current SP d_hdr.seekg(offset); // continue at the function's address } icmake-10.03.00/exec/cpu/ret.cc0000644000175000017500000000046714204126313014767 0ustar frankfrank//#define XERR #include "cpu.ih" void CPU::ret() { d_stack.popBP(); xerr("ret " << d_stack.top().value()); // continue at the function's return address d_hdr.seekg(d_stack.top().value()); d_stack.pop(); // remove the return value fm the stack } icmake-10.03.00/exec/cpu/bxor.cc0000644000175000017500000000022514204126313015137 0ustar frankfrank//#define XERR #include "cpu.ih" void CPU::bxor() { int rhs = d_stack.top().value(); d_stack.pop(); d_stack.top().valueRef() ^= rhs; } icmake-10.03.00/exec/cpu/push1jmpend.cc0000644000175000017500000000066414204126313016432 0ustar frankfrank//#define XERR #include "cpu.ih" // This function serves the evaluation of logical expressions. It is // executed when an op_push_1_jmp_end opcode is found in the // bim file. A variable of type Int{1} is pushed on the stack. // After this, the next opcode (which is by definition 'push 0') is skipped. void CPU::push1jmpEnd() { d_stack.push( new Int{ 1 } ); d_hdr.seekg(1, ios::cur); // skip the next opcode (= 'push 0') } icmake-10.03.00/exec/cpu/copyvar.cc0000644000175000017500000000054614204126313015656 0ustar frankfrank//#define XERR #include "cpu.ih" // This function is executed when an op_copy_var opcode is read // Following the opcode a variable index (either global or on the stack) // is expected. The value of the variable on top of the stack is assigned to // the variable whose index is provided as argument void CPU::copyVar() { variable() = d_stack.top(); } icmake-10.03.00/exec/cpu/istrue.cc0000644000175000017500000000025414204126313015502 0ustar frankfrank//#define XERR #include "cpu.ih" bool CPU::isTrue() { xerr(""); bool ret = d_stack.top().isTrue(); xerr("ret = " << ret); d_stack.pop(); return ret; } icmake-10.03.00/exec/cpu/popreg.cc0000644000175000017500000000013014204126313015454 0ustar frankfrank//#define XERR #include "cpu.ih" void CPU::popReg() { d_reg = d_stack.topMove(); } icmake-10.03.00/exec/cpu/callrss.cc0000644000175000017500000000304014204126313015626 0ustar frankfrank//#define XERR #include "cpu.ih" // This function is executed when an op_call_rss opcode is encountered in the // .bim file. Following this opcode a function index is expected (an // uint8_t value), indicating the function number to call (see the // enumeration BuiltinFunction in the file // support/builtinfunction/builtinfunction.h // // If the index exceeds or equals BuiltinSize, an error occurs. Otherwise, the // indicated built in function is called (see the class Builtin) // See stack/README for a description of how to interpret the indices: when // calling functions use indices >= 2 to access arguments (the 1st function // argument is at d_stack[2]), and use indices < 0 to access local variables // (the 1st local variable is at d_stack[-1]) void CPU::callRss() { size_t funIdx = d_hdr.get(); // get the function's index xerr("call rss " << funIdx << ": " << BuiltinFunctions::name(funIdx)); d_stack.push(Variable{}); // push a dummy RA // xerr("dummy pushed"); d_stack.pushBP(); // xerr("BP pushed"); if (funIdx >= BuiltinFunctions::BuiltinSize) throw Exception{} << "invalid rss function call at offset " << (d_hdr.offset() - 2); // xerr("Calling " << funIdx); d_builtin.call(funIdx); // call the builtin function // xerr("Called " << funIdx); d_stack.popBP(); // xerr("Popped BP"); d_stack.pop(); // remove the dummy RA // xerr("Popped dummy"); } icmake-10.03.00/exec/cpu/frame.cc0000644000175000017500000000050614204126313015261 0ustar frankfrank//#define XERR #include "cpu.ih" void CPU::frame() { xerr(""); for ( // get the # local variables uint16_t idx = 0, end = d_hdr.get(); idx != end; ++idx ) d_stack.push( variableFactory() ); // push them on the stack } icmake-10.03.00/exec/cpu/atoi.cc0000644000175000017500000000015014204126313015116 0ustar frankfrank//#define XERR #include "cpu.ih" void CPU::atoi() { d_stack.top() = stoi(d_stack.top().str()); } icmake-10.03.00/exec/cpu/sub.cc0000644000175000017500000000016714204126313014763 0ustar frankfrank//#define XERR #include "cpu.ih" void CPU::sub() { Variable rhs = d_stack.topMove(); d_stack.top() -= rhs; } icmake-10.03.00/exec/cpu/jmptrue.cc0000644000175000017500000000034114204126313015652 0ustar frankfrank//#define XERR #include "cpu.ih" void CPU::jmpTrue() { auto step = d_hdr.get(); xerr("step: " << step); if (isTrue()) d_hdr.seekg(step, ios::cur); xerr("leaving at " << d_hdr.offset()); } icmake-10.03.00/exec/cpu/neq.cc0000644000175000017500000000021114204126313014743 0ustar frankfrank//#define XERR #include "cpu.ih" void CPU::neq() { Variable rhs = d_stack.topMove(); d_stack.top() = d_stack.top() != rhs; } icmake-10.03.00/exec/cpu/pushimm.cc0000644000175000017500000000015714204126313015653 0ustar frankfrank//#define XERR #include "cpu.ih" void CPU::pushImm() { d_stack.push( new Int{ d_hdr.get() } ); } icmake-10.03.00/exec/cpu/mod.cc0000644000175000017500000000036214204126313014746 0ustar frankfrank//#define XERR #include "cpu.ih" void CPU::mod() { int rhs = d_stack.top().value(); if (rhs == 0) throw Exception{} << "division by 0 at " << (d_hdr.offset() - 1); d_stack.pop(); d_stack.top().valueRef() %= rhs; } icmake-10.03.00/exec/cpu/bnot.cc0000644000175000017500000000015614204126313015132 0ustar frankfrank//#define XERR #include "cpu.ih" void CPU::bnot() { d_stack.top().valueRef() = ~d_stack.top().value(); } icmake-10.03.00/exec/cpu/icmconf0000777000175000017500000000000014204126313017761 2../../icmconf.dirustar frankfrankicmake-10.03.00/exec/cpu/jmpfalse.cc0000644000175000017500000000031414204126313015765 0ustar frankfrank//#define XERR #include "cpu.ih" void CPU::jmpFalse() { auto step = d_hdr.get(); if (not isTrue()) // look at the stack top's value d_hdr.seekg(step, ios::cur); } icmake-10.03.00/exec/cpu/band.cc0000644000175000017500000000022514204126313015071 0ustar frankfrank//#define XERR #include "cpu.ih" void CPU::band() { int rhs = d_stack.top().value(); d_stack.pop(); d_stack.top().valueRef() &= rhs; } icmake-10.03.00/exec/cpu/push0.cc0000644000175000017500000000013214204126313015221 0ustar frankfrank//#define XERR #include "cpu.ih" void CPU::push0() { d_stack.push( new Int{ 0 } ); } icmake-10.03.00/exec/cpu/pushstrconst.cc0000644000175000017500000000020614204126313016743 0ustar frankfrank//#define XERR #include "cpu.ih" void CPU::pushStrConst() { d_stack.push( new String{ d_hdr.string(d_hdr.get()) } ); } icmake-10.03.00/exec/cpu/sm.cc0000644000175000017500000000020614204126313014603 0ustar frankfrank//#define XERR #include "cpu.ih" void CPU::sm() { Variable rhs = d_stack.topMove(); d_stack.top() = d_stack.top() < rhs; } icmake-10.03.00/exec/cpu/pushvar.cc0000644000175000017500000000043114204126313015654 0ustar frankfrank//#define XERR #include "cpu.ih" // This function is executed when an op_push_var opcode is read // Follwing the opcode a variable index (either global or on the stack) // is expected. This variable is pushed onto the stack. void CPU::pushVar() { d_stack.push(variable()); } icmake-10.03.00/exec/cpu/cpu.h0000644000175000017500000000576214204126313014631 0ustar frankfrank#ifndef INCLUDED_ICMAKECPU_ #define INCLUDED_ICMAKECPU_ #include "../../support/exprtype/exprtype.h" #include "../../support/constmember/constmember.h" #include "../variable/variable.h" #include "../stack/stack.h" #include "../builtin/builtin.h" #include "../global/global.h" class BimHeader; class CPU: public ConstMember { BimHeader &d_hdr; Stack &d_stack; // the function call stack Global d_global; // global variables Variable d_reg; // register storing return values of // functions Builtin d_builtin; // builtin functions handler static void (CPU::*s_execute[])(); // functions called at the // various opcodes public: CPU(BimHeader &hdr, Stack &stack); int run(); private: Variable variableFactory(); bool isTrue(); Variable &variable(); // reads the Var's index, then returns its // reference. void jmp(); // 00 void jmpFalse(); // 01 void jmpTrue(); // 02 void push1jmpEnd(); // 03 - void push0(); // 04 void pushImm(); // 05 void pushStrConst(); // 06 void pushVar(); // 07 void pushReg(); // 08 void popVar(); // 09 void umin(); // 0a void atoi(); // 0b void itoa(); // 0c void atol(); // 0d void mul(); // 0e void div(); // 0f void mod(); // 10 void add(); // 11 void sub(); // 12 void eq(); // 13 void neq(); // 14 void sm(); // 15 void gr(); // 16 void younger(); // 17 void older(); // 18 void smeq(); // 19 void greq(); // 1a void callRss(); // 1b void asp(); // 1c void exit() const; // 1d void copyVar(); // 1e void inc(); // 1f void dec(); // 20 void call(); // 21 void frame(); // 22 void ret(); // 23 void popReg(); // 24 void band(); // 25 void bor(); // 26 void bnot(); // 27 void bxor(); // 28 void shl(); // 29 void shr(); // 2a }; #endif icmake-10.03.00/exec/cpu/atol.cc0000644000175000017500000000031414204126313015123 0ustar frankfrank//#define XERR #include "cpu.ih" void CPU::atol() { // define a list of 1 element d_stack.top() = new List{ vector{ d_stack.top().str() } }; } icmake-10.03.00/exec/cpu/older.cc0000644000175000017500000000036214204126313015274 0ustar frankfrank//#define XERR #include "cpu.ih" void CPU::older() { Stat rhs{ d_stack.top().str() }; d_stack.pop(); xerr(d_stack.top().str() << " older " << rhs.name()); d_stack.top() = as(Tools::older(d_stack.top().str(), rhs)); } icmake-10.03.00/exec/cpu/variable.cc0000644000175000017500000000052514204126313015755 0ustar frankfrank//#define XERR #include "cpu.ih" Variable &CPU::variable() { auto index = d_hdr.get(); // see the unassembler/handleVar function about the 0xc000 shift. // if (index >= 0) // xerr("global: " << index << ", value: " << d_global[index]); return index >= 0 ? d_global[index] : d_stack[index -= 0xc000]; } icmake-10.03.00/exec/cpu/jmp.cc0000644000175000017500000000024114204126313014751 0ustar frankfrank//#define XERR #include "cpu.ih" void CPU::jmp() { auto step = d_hdr.get(); xerr("jmp step " << step); d_hdr.seekg(step, ios::cur); } icmake-10.03.00/exec/cpu/div.cc0000644000175000017500000000036014204126313014747 0ustar frankfrank#define XERR #include "cpu.ih" void CPU::div() { int rhs = d_stack.top().value(); if (rhs == 0) throw Exception{} << "division by 0 at " << (d_hdr.offset() - 1); d_stack.pop(); d_stack.top().valueRef() /= rhs; } icmake-10.03.00/exec/cpu/frame0000644000175000017500000000006114204126313014671 0ustar frankfrank//#define XERR #include "cpu.ih" void CPU:: { } icmake-10.03.00/exec/cpu/add.cc0000644000175000017500000000017014204126313014714 0ustar frankfrank//#define XERR #include "cpu.ih" void CPU::add() { Variable rhs{ d_stack.topMove() }; d_stack.top() += rhs; } icmake-10.03.00/exec/cpu/variablefactory.cc0000644000175000017500000000073714204126313017352 0ustar frankfrank//#define XERR #include "cpu.ih" Variable CPU::variableFactory() { switch (as(d_hdr.get()) ) { case e_int: xerr("e_int"); return new Int; case e_str: xerr("e_str"); return new String; case e_list: xerr("e_list"); return new List; default: throw Exception{} << "Invalid Expression Type at offset " << (d_hdr.offset() - 1); } } icmake-10.03.00/exec/cpu/itoa.cc0000644000175000017500000000041714204126313015124 0ustar frankfrank//#define XERR #include "cpu.ih" void CPU::itoa() { d_stack.top() = new String{ to_string(d_stack.top().value()) }; // using promotion to } // assign Variable{ string } icmake-10.03.00/exec/cpu/shr.cc0000644000175000017500000000022514204126313014761 0ustar frankfrank//#define XERR #include "cpu.ih" void CPU::shr() { int rhs = d_stack.top().value(); d_stack.pop(); d_stack.top().valueRef() >>= rhs; } icmake-10.03.00/exec/main.ih0000644000175000017500000000051714204126313014341 0ustar frankfrank#include #include #include #include #include #include #include "../support/tools/tools.h" #include "../support/bimheader/bimheader.h" #include "cpu/cpu.h" #include "../xerr/xerr.ih" using namespace std; using namespace FBB; void usage(string const &progname); icmake-10.03.00/exec/frame0000644000175000017500000000002314204126313014100 0ustar frankfrank#include "main.ih" icmake-10.03.00/exec/int/0000755000175000017500000000000014204243365013671 5ustar frankfrankicmake-10.03.00/exec/int/vequal.cc0000644000175000017500000000016414204126313015467 0ustar frankfrank//#define XERR #include "int.ih" bool Int::vEqual(VarBase const &rhs) const { return d_value == rhs.value(); } icmake-10.03.00/exec/int/vvalueref.cc0000644000175000017500000000012014204126313016161 0ustar frankfrank//#define XERR #include "int.ih" int &Int::vValueRef() { return d_value; } icmake-10.03.00/exec/int/vtostring.cc0000644000175000017500000000015114204126313016225 0ustar frankfrank//#define XERR #include "int.ih" string Int::vto_string() const { return std::to_string(d_value); } icmake-10.03.00/exec/int/int.ih0000644000175000017500000000015514204126313014777 0ustar frankfrank#include "int.h" #include #include #include "../../xerr/xerr.ih" using namespace std; icmake-10.03.00/exec/int/int1.f0000644000175000017500000000006314204126313014703 0ustar frankfrankinline Int::Int(int value) : d_value(value) {} icmake-10.03.00/exec/int/vaddis.cc0000644000175000017500000000017514204126313015446 0ustar frankfrank//#define XERR #include "int.ih" VarBase &Int::vAddIs(VarBase const &rhs) { d_value += rhs.value(); return *this; } icmake-10.03.00/exec/int/int.h0000644000175000017500000000173514204126313014633 0ustar frankfrank#ifndef INCLUDED_INT_ #define INCLUDED_INT_ #include "../varbase/varbase.h" class Int: public VarBase { int d_value = 0; public: Int(int value = 0); // 1.f ~Int() override; private: // these members *may* be overridden: int vValue() const override; int &vValueRef() override; std::strong_ordering vOrder(VarBase const &rhs) const override; VarBase &vSubIs(VarBase const &rhs) override; // these members *must* be overridden: bool vEqual(VarBase const &rhs) const override; std::ostream &vInsertInto(std::ostream &out) const override; bool vBool() const override; VarBase &vAddIs(VarBase const &rhs) override; int vForcedInt() const override; std::string vto_string() const override; bool vIsString() const override; VarBase *vcopy() const override; }; #include "int1.f" #endif icmake-10.03.00/exec/int/icmconf0000777000175000017500000000000014204126313017764 2../../icmconf.dirustar frankfrankicmake-10.03.00/exec/int/vinsertinto.cc0000644000175000017500000000015714204126313016560 0ustar frankfrank//#define XERR #include "int.ih" ostream &Int::vInsertInto(ostream &out) const { return out << d_value; } icmake-10.03.00/exec/int/destructor.cc0000644000175000017500000000006114204126313016364 0ustar frankfrank//#define XERR #include "int.ih" Int::~Int() {} icmake-10.03.00/exec/int/vforcedint.cc0000644000175000017500000000012614204126313016333 0ustar frankfrank//#define XERR #include "int.ih" int Int::vForcedInt() const { return d_value; } icmake-10.03.00/exec/int/vcopy.cc0000644000175000017500000000014114204126313015325 0ustar frankfrank//#define XERR #include "int.ih" VarBase *Int::vcopy() const { return new Int{ d_value }; } icmake-10.03.00/exec/int/vbool.cc0000644000175000017500000000012714204126313015312 0ustar frankfrank//#define XERR #include "int.ih" bool Int::vBool() const { return d_value != 0; } icmake-10.03.00/exec/int/vorder.cc0000644000175000017500000000045614204126313015477 0ustar frankfrank//#define XERR #include "int.ih" strong_ordering Int::vOrder(VarBase const &rhs) const { return d_value < rhs.value() ? strong_ordering::less : d_value > rhs.value() ? strong_ordering::greater : strong_ordering::equal; } icmake-10.03.00/exec/int/frame0000644000175000017500000000005414204126313014676 0ustar frankfrank//#define XERR #include "int.ih" Int:: { } icmake-10.03.00/exec/int/vsubis.cc0000644000175000017500000000017614204126313015510 0ustar frankfrank//#define XERR #include "int.ih" VarBase &Int::vSubIs(VarBase const &rhs) { d_value -= rhs.value(); return *this; } icmake-10.03.00/exec/int/vvalue.cc0000644000175000017500000000012214204126313015466 0ustar frankfrank//#define XERR #include "int.ih" int Int::vValue() const { return d_value; } icmake-10.03.00/exec/int/visstring.cc0000644000175000017500000000012414204126313016216 0ustar frankfrank//#define XERR #include "int.ih" bool Int::vIsString() const { return false; } icmake-10.03.00/exec/varbase/0000755000175000017500000000000014204243365014522 5ustar frankfrankicmake-10.03.00/exec/varbase/list.f0000644000175000017500000000012514204126313015633 0ustar frankfrankinline std::vector const &VarBase::list() const { return vList(); } icmake-10.03.00/exec/varbase/undefined.cc0000644000175000017500000000020614204126313016761 0ustar frankfrank//#define XERR #include "varbase.ih" void VarBase::undefined() const { throw Exception{} << "virtual function not overloaded"; } icmake-10.03.00/exec/varbase/vvalueref.cc0000644000175000017500000000015614204126313017023 0ustar frankfrank//#define XERR #include "varbase.ih" // virtual int &VarBase::vValueRef() { xerr(""); undefined(); } icmake-10.03.00/exec/varbase/tostring.f0000644000175000017500000000014714204126313016535 0ustar frankfrankinline std::string VarBase::to_string() const // convert an argument to { return vto_string(); } icmake-10.03.00/exec/varbase/opspaceship.f0000644000175000017500000000016014204126313017175 0ustar frankfrankinline std::strong_ordering operator<=>(VarBase const &lhs, VarBase const &rhs) { return lhs.vOrder(rhs); } icmake-10.03.00/exec/varbase/istrue.f0000644000175000017500000000007414204126313016176 0ustar frankfrankinline bool VarBase::isTrue() const { return vBool(); } icmake-10.03.00/exec/varbase/isstring.f0000644000175000017500000000010214204126313016515 0ustar frankfrankinline bool VarBase::isString() const { return vIsString(); } icmake-10.03.00/exec/varbase/varbase.h0000644000175000017500000000540314204126313016311 0ustar frankfrank#ifndef INCLUDED_VARBASE_ #define INCLUDED_VARBASE_ #include #include #include #include class VarBase { friend bool operator==(VarBase const &lhs, VarBase const &rhs); friend std::strong_ordering operator<=>(VarBase const &lhs, VarBase const &rhs); public: VarBase(VarBase const &other) = delete; virtual ~VarBase(); VarBase *copy() const; bool isTrue() const; // Int, String, List bool isString() const; // Int, String, List int forcedInt() const; // Int, String, List int value() const; // Int int &valueRef(); // Int std::vector const &list() const; // List std::string const &str() const; // String VarBase &operator+=(VarBase const &rhs); // Int, String, List VarBase &operator-=(VarBase const &rhs); // Int, List std::ostream &insertInto(std::ostream &out); // Int, String, List std::string to_string() const; // convert an argument to // a string protected: VarBase() = default; private: // shouldn't happen, but called when // derived classes didn't override a // virtual function [[noreturn]] void undefined() const; // these members *may* be overridden: virtual std::vector const &vList() const; virtual int vValue() const; virtual int &vValueRef(); virtual std::string const &vStr() const; virtual std::strong_ordering vOrder(VarBase const &rhs) const; virtual VarBase &vSubIs(VarBase const &rhs); virtual int vForcedInt() const; // 0 for String and List // these members *must* be overridden: virtual bool vEqual(VarBase const &rhs) const = 0; virtual std::ostream &vInsertInto(std::ostream &out) const = 0; virtual bool vBool() const = 0; virtual VarBase &vAddIs(VarBase const &rhs) = 0; virtual std::string vto_string() const = 0; virtual bool vIsString() const = 0; virtual VarBase *vcopy() const = 0; }; #include "copy.f" #include "forcedint.f" #include "insertinto.f" #include "isstring.f" #include "istrue.f" #include "list.f" #include "str.f" #include "tostring.f" #include "value.f" #include "valueref.f" #include "opaddis.f" #include "opequal.f" #include "opspaceship.f" #include "opsubis.f" #endif icmake-10.03.00/exec/varbase/str.f0000644000175000017500000000010614204126313015467 0ustar frankfrankinline std::string const &VarBase::str() const { return vStr(); } icmake-10.03.00/exec/varbase/icmconf0000777000175000017500000000000014204126313020615 2../../icmconf.dirustar frankfrankicmake-10.03.00/exec/varbase/opequal.f0000644000175000017500000000013714204126313016331 0ustar frankfrankinline bool operator==(VarBase const &lhs, VarBase const &rhs) { return lhs.vEqual(rhs); } icmake-10.03.00/exec/varbase/vlist.cc0000644000175000017500000000020114204126313016154 0ustar frankfrank//#define XERR #include "varbase.ih" // virtual vector const &VarBase::vList() const { xerr(""); undefined(); } icmake-10.03.00/exec/varbase/vstr.cc0000644000175000017500000000017014204126313016016 0ustar frankfrank//#define XERR #include "varbase.ih" // virtual string const &VarBase::vStr() const { xerr(""); undefined(); } icmake-10.03.00/exec/varbase/varbase.ih0000644000175000017500000000021614204126313016457 0ustar frankfrank#include "varbase.h" #include #include #include "../../xerr/xerr.ih" using namespace std; using namespace FBB; icmake-10.03.00/exec/varbase/value.f0000644000175000017500000000007314204126313015776 0ustar frankfrankinline int VarBase::value() const { return vValue(); } icmake-10.03.00/exec/varbase/opsubis.f0000644000175000017500000000012414204126313016343 0ustar frankfrankinline VarBase &VarBase::operator-=(VarBase const &rhs) { return vSubIs(rhs); } icmake-10.03.00/exec/varbase/copy.f0000644000175000017500000000007614204126313015637 0ustar frankfrankinline VarBase *VarBase::copy() const { return vcopy(); } icmake-10.03.00/exec/varbase/destructor.cc0000644000175000017500000000007514204126313017222 0ustar frankfrank//#define XERR #include "varbase.ih" VarBase::~VarBase() {} icmake-10.03.00/exec/varbase/forcedint.f0000644000175000017500000000010314204126313016631 0ustar frankfrankinline int VarBase::forcedInt() const { return vForcedInt(); } icmake-10.03.00/exec/varbase/vforcedint.cc0000644000175000017500000000021014204126313017156 0ustar frankfrank//#define XERR #include "varbase.ih" int VarBase::vForcedInt() const { xerr(""); return 0; // String, List } icmake-10.03.00/exec/varbase/opaddis.f0000644000175000017500000000012414204126313016302 0ustar frankfrankinline VarBase &VarBase::operator+=(VarBase const &rhs) { return vAddIs(rhs); } icmake-10.03.00/exec/varbase/valueref.f0000644000175000017500000000007414204126313016474 0ustar frankfrankinline int &VarBase::valueRef() { return vValueRef(); } icmake-10.03.00/exec/varbase/vorder.cc0000644000175000017500000000021614204126313016322 0ustar frankfrank//#define XERR #include "varbase.ih" // virtual strong_ordering VarBase::vOrder(VarBase const &rhs) const { xerr(""); undefined(); } icmake-10.03.00/exec/varbase/frame0000644000175000017500000000006414204126313015530 0ustar frankfrank//#define XERR #include "varbase.ih" VarBase:: { } icmake-10.03.00/exec/varbase/vsubis.cc0000644000175000017500000000020114204126313016326 0ustar frankfrank//#define XERR #include "varbase.ih" // virtual VarBase &VarBase::vSubIs(VarBase const &rhs) { xerr(""); undefined(); } icmake-10.03.00/exec/varbase/vvalue.cc0000644000175000017500000000016014204126313016321 0ustar frankfrank//#define XERR #include "varbase.ih" // virtual int VarBase::vValue() const { xerr(""); undefined(); } icmake-10.03.00/exec/varbase/insertinto.f0000644000175000017500000000013514204126313017057 0ustar frankfrankinline std::ostream &VarBase::insertInto(std::ostream &out) { return vInsertInto(out); } icmake-10.03.00/exec/CLASSES0000644000175000017500000000007214204126313014107 0ustar frankfrankcpu builtin stack global variable int string list varbase icmake-10.03.00/icmake/0000755000175000017500000000000014204243616013403 5ustar frankfrankicmake-10.03.00/icmake/icm_bootstrap0000755000175000017500000000023114204126313016164 0ustar frankfrank#!/bin/bash . ../bootstrap/flags . ../bootstrap/functions echo Creating tmp${BINDIR}/icmake subdirs maindir ${BINDIR}/icmake -s rm -f */*.gch *.o icmake-10.03.00/icmake/usage.cc0000644000175000017500000000740114204126313015012 0ustar frankfrank// usage.cc #include "main.ih" namespace { char const info[] = R"_( [options] argument(s) Where: [options] - optional arguments (short options between parentheses): --about (-a) - shows some info about icmake and terminates --compile (-c) - the file specified as first argument is compiled if it's younger than the .bim file or if the .bim file doesn't exist. The .bim file is the 2nd file argument or, if not specified, then the first filename (using the extension .bim) is used. --dependencies (-d) - determines the dependencies among classes. All options and arguments following this option are forwarded to the icm-dep support program. --execute (-e) - executes the (.bim) file specified as first argument. Options following --execute are forwarded to icm-exec. Use option -- to separate options forwared to icm-exec from options to be forwarded to the .bim file. --force (-f) - same as option as --compile, but compilation is always performed, even if the .bim file is up-to-date. --help (-h) - provide this help --no-prcoess (-N) - implies -V. Child processes are not executed. To use this option it must be specified before a -[dest] option --no-version-check (-n) - when executing or unassembling .bim files the icmake-versions used when constructing the .bim files is not checked. Use only if you know what you're doing. --preprocess (-p) - the file specified as first argument is pre-processed. The .pim file is the 2nd file argument or, if not specified, the first filename (using the extension .pim), is used. --source (-s) - uses --compile to compile the icmake source file specified as first argument and then uses --execute to execute the compiled .bim file. -t - this option is provided for icmake-scripts. is either a single . (as in -t.) or the path-base of the .bim-file (which is removed after its execution). All arguments and options specified when calling the icmake-script are forwarded as arguments to the .bim file's main function. The -- option should not be specified. --tmpdir (-T) - is the name of a (user-writable) directory used by icmake to store temporary files. By default /tmp is used. If /tmp is not writable the user's HOME directory is used. --unassemble (-u) - the file specified as first argument is an icmake .bim file, which is unassembled. --verbose (-V) - the full child process calls are written to the std. output stream. --version (-v) - show version information and terminate argument(s): for options requiring a file argument the first argument must be a file. Depending on the specified option subsequent arguments can be filenames or options that are forwared to the option handler or to a .bim file. )_"; } void usage(std::string const &progname) { Tools::usageTop(progname) << info; } icmake-10.03.00/icmake/icmconf0000644000175000017500000000125514204126763014752 0ustar frankfrank#define PRECOMP "-x c++-header" #define USE_ALL "a" #define CLS //#define LIBRARY "modules" #define MAIN "main.cc" #define SOURCES "*.cc" #define OBJ_EXT ".o" #define TMP_DIR "tmp" #define USE_ECHO ON //#define USE_VERSION #define IH ".ih" #define CXX "g++" #define CXXFLAGS " --std=c++20 -Wall -O2 " \ " -fdiagnostics-color=never " #define REFRESH #define LDFLAGS "-s" #define ADD_LIBRARIES "support bobcat" #define ADD_LIBRARY_PATHS "../../support/tmp" #define DEFCOM "program" icmake-10.03.00/icmake/splitter/0000755000175000017500000000000014204243616015251 5ustar frankfrankicmake-10.03.00/icmake/splitter/endaction.cc0000644000175000017500000000023014204126313017511 0ustar frankfrank#define XERR #include "splitter.ih" void Splitter::endAction() { d_action = static_cast(s_xlat.find(d_opt)); d_actionIdx = d_optIdx; } icmake-10.03.00/icmake/splitter/data.cc0000644000175000017500000000172414204126313016467 0ustar frankfrank//#define XERR #include "splitter.ih" // static char Splitter::s_empty[] = { 0 }; // static // chars must follow Action's ordering string Splitter::s_xlat{ "cdefpstu" "ahv" }; // static option Splitter::s_options[] = { { "dependencies", no_argument, 0, 'd' }, { "about", no_argument, 0, 'a' }, { "compile", no_argument, 0, 'c' }, { "execute", no_argument, 0, 'e' }, { "force", no_argument, 0, 'f' }, { "help", no_argument, 0, 'h' }, { "no-version-check", no_argument, 0, 'n' }, { "no-process", no_argument, 0, 'N' }, { "preprocess", no_argument, 0, 'p' }, { "source", no_argument, 0, 's' }, { "tmpdir", required_argument, 0, 'T' }, { "unassemble", no_argument, 0, 'u' }, { "verbose", no_argument, 0, 'V' }, { "version", no_argument, 0, 'v' }, { 0 } }; icmake-10.03.00/icmake/splitter/splitter1.cc0000644000175000017500000000121214204126313017475 0ustar frankfrank#define XERR #include "splitter.ih" Splitter::Splitter(unsigned argc, char **argv) : // d_ptrs(argv, argv + argc), d_argc(argc), // update d_argc and d_argv when d_argv(argv), d_optstring("+acefhnNpPqst:T:uvVd"), // d must be last: becomes d: // q is recognized but ignored d_scriptBim(".") { getOpts(); if (d_action == UNUSED) throw Exception{} << "action option not specified"; setFiles(); // d_file[12] and d_nFiles setTmpDir(); d_pidName = d_tmpDir + to_string(getpid()); setScriptBim(); } icmake-10.03.00/icmake/splitter/gethome.cc0000644000175000017500000000023514204126313017202 0ustar frankfrank//#define XERR #include "splitter.ih" // static char const *Splitter::getHome() { char const *cp = getenv("HOME"); return cp != 0 ? cp : s_empty; } icmake-10.03.00/icmake/splitter/splitter.ih0000644000175000017500000000042214204126313017431 0ustar frankfrank#include "splitter.h" #include "../../xerr/xerr.ih" #include #include #include #include #include #include #include #include using namespace std; using namespace FBB; icmake-10.03.00/icmake/splitter/show.cc0000644000175000017500000000132614204126313016534 0ustar frankfrank//#define XERR #include "splitter.ih" void Splitter::show() const { cout << " versionCheck: " << d_versionCheck << "\n" " process: " << d_process << "\n" " verbose: " << d_verbose << "\n" " tmpDir: `" << d_tmpDir << "'\n" " action: " << (char)d_action << "\n" " files at: " << d_optIdx << "\n" " actionIdx: " << d_actionIdx << "\n" " execute: " << d_execute << "\n" " preProcess: " << d_preProcess << "\n\n"; cout << "file arguments at " << d_optIdx << '\n'; for (unsigned idx = 0; idx != d_argc; ++idx) cout << " " << idx << ": " << d_argv[idx] << '\n'; } icmake-10.03.00/icmake/splitter/setfiles.cc0000644000175000017500000000063614204126313017375 0ustar frankfrank#define XERR #include "splitter.ih" void Splitter::setFiles() { switch (d_argc - d_optIdx) { case 0: return; case 1: d_file1 = setFile(d_optIdx); return; default: d_file1 = setFile(d_optIdx); if (not d_file1.empty() and d_action != SOURCE) d_file2 = setFile(d_optIdx + 1); return; } } icmake-10.03.00/icmake/splitter/setaction.cc0000644000175000017500000000045614204126313017550 0ustar frankfrank#define XERR #include "splitter.ih" void Splitter::setAction() { if (d_action == UNUSED) { d_action = static_cast(s_xlat.find(d_opt)); d_actionIdx = d_optIdx; s_options[0] = { "define", required_argument, 0, 'd' }; d_optstring += ':'; } } icmake-10.03.00/icmake/splitter/setfile.cc0000644000175000017500000000034014204126313017202 0ustar frankfrank//#define XERR #include "splitter.ih" string Splitter::setFile(unsigned idx) { if (d_argv[idx][0] != '-') // not an option { ++d_nFiles; return d_argv[idx]; } return s_empty; } icmake-10.03.00/icmake/splitter/splitter.h0000644000175000017500000001124114204126313017261 0ustar frankfrank#ifndef INCLUDED_SPLITTER_ #define INCLUDED_SPLITTER_ #include #include struct option; struct Splitter { enum Action { COMPILE, DEP, EXEC, FORCED, PREPROCESS, SOURCE, SCRIPT, UNASSEMBLE, ABOUT, HELP, VERS, UNUSED, }; std::vector d_ptrs; // ptrs to the argv-like args unsigned d_argc; char **d_argv; bool d_process = true; bool d_verbose = false; bool d_pimFile = false; // by default -c/-f assume their // input files are scripts, With // -P they assume input files are // .pim files std::string d_versionCheck; std::string d_optstring; std::string d_tmpDir; std::string d_scriptBim; std::string d_pidName; std::string d_file1; std::string d_file2; unsigned d_nFiles = 0; int d_opt = 0; Action d_action = UNUSED; unsigned d_optIdx = 0; unsigned d_actionIdx = 0; unsigned d_execute = 0; unsigned d_preProcess = 0; static std::string s_xlat; static option s_options[]; static char s_empty[]; public: Splitter(unsigned argc, char **argv); unsigned argc() const; char const *const *argv() const; char const *argv(unsigned idx) const; void setArgv(unsigned idx, char *ptr); void show() const; std::string const &versionCheck() const; // empty or starts with ' ' bool process() const; bool verbose() const; bool pimFile() const; std::string const &tmpDir() const; std::string const &scriptBim() const; std::string const &pidName() const; Action actionOpt() const; // requested action (like -c) unsigned actionIdx() const; // idx of the action option unsigned endOpts() const; // 1st non-option (file or // undefined option) std::string const &file1() const; // empty string or ' '+name at // endOpts std::string const &file2() const; // empty string or ' '+name // following file1 unsigned nFiles() const; // #files at endOpts() unsigned actionArgsIdx() const; // idx following the action option unsigned execute() const; // idx of -e option (-s, -t) unsigned preProcess() const; // idx of -p option (-s, -t) private: void getOpts(); void endAction(); void setAction(); void action(unsigned *index); void depOrDef(); void setFiles(); // assign d_file[12] / d_nFiles std::string setFile(unsigned idx); // "" or " filename" void setTmpDir(); void setScriptBim(); void scriptOption(); void inspect(char *tArguments); void sourceOption(); bool writable(std::string &dirName); static char const *getHome(); }; inline std::string const &Splitter::versionCheck() const { return d_versionCheck; } inline bool Splitter::process() const { return d_process; } inline bool Splitter::pimFile() const { return d_pimFile; } inline bool Splitter::verbose() const { return d_verbose; } inline std::string const &Splitter::tmpDir() const { return d_tmpDir; } inline std::string const &Splitter::scriptBim() const { return d_scriptBim; } inline unsigned Splitter::endOpts() const { return d_optIdx; } inline unsigned Splitter::actionArgsIdx() const { return d_actionIdx + 1; } inline Splitter::Action Splitter::actionOpt() const { return d_action; } inline unsigned Splitter::actionIdx() const { return d_actionIdx; } inline unsigned Splitter::execute() const { return d_execute; } inline unsigned Splitter::preProcess() const { return d_preProcess; } inline unsigned Splitter::argc() const { return d_argc; } inline char const *const *Splitter::argv() const { return d_argv; } inline char const *Splitter::argv(unsigned idx) const { return d_argv[idx]; } inline void Splitter::setArgv(unsigned idx, char *ptr) { d_argv[idx] = ptr; } inline std::string const &Splitter::file1() const { return d_file1; } inline std::string const &Splitter::file2() const { return d_file2; } inline unsigned Splitter::nFiles() const { return d_nFiles; } inline std::string const &Splitter::pidName() const { return d_pidName; } #endif icmake-10.03.00/icmake/splitter/scriptoption.cc0000644000175000017500000000251014204126313020305 0ustar frankfrank#define XERR #include "splitter.ih" void Splitter::scriptOption() { if (d_action == UNUSED) d_preProcess = d_optIdx; setAction(); // with -t . -p -done -d two -e n // // at d_optIdx: `-t . -p -done -d two -e n' // optarg: ` . -p -done -d two -e n' // // with -t. -p -done -d two -e n // // at d_optIdx: `-t. -p -done -d two -e n' // optarg: `. -p -done -d two -e n' // assign all ptrs until // d_argv[optIdx] to d_ptrs d_ptrs = std::vector{ d_argv, d_argv + d_optIdx }; inspect(d_argv[d_optIdx]); // inspect this possibly multi-valued // element // add the remaining elements + // final zero-element d_ptrs.insert(d_ptrs.end(), d_argv + d_optIdx + 1, d_argv + d_argc + 1); d_argv = &d_ptrs.front(); // update d_argc and d_argv d_argc = d_ptrs.size() - 1; // don't count the final 0 ! // cout << "\n" // "post:\n"; // for (unsigned idx = 0; idx != d_argc; ++idx) // cout << " " << idx << ": `" << d_argv[idx] << "'\n"; // cout << '\n'; } icmake-10.03.00/icmake/splitter/setscriptbim.cc0000644000175000017500000000037314204126313020265 0ustar frankfrank#define XERR #include "splitter.ih" void Splitter::setScriptBim() { if (d_scriptBim == ".") // use the default -t path d_scriptBim = d_tmpDir + to_string(getpid()) + ".bim."; else d_scriptBim += '.'; } icmake-10.03.00/icmake/splitter/writable.cc0000644000175000017500000000050114204126313017357 0ustar frankfrank#define XERR #include "splitter.ih" bool Splitter::writable(string &dirName) { if (Stat{ dirName }.isType(Stat::DIRECTORY) and access(dirName.c_str(), R_OK | W_OK | X_OK) == 0 ) { if (dirName.back() != '/') dirName += '/'; return true; } return false; } icmake-10.03.00/icmake/splitter/action.cc0000644000175000017500000000022414204126313017025 0ustar frankfrank//#define XERR #include "splitter.ih" void Splitter::action(unsigned *index) { if (*index == 0) *index = d_optIdx; setAction(); } icmake-10.03.00/icmake/splitter/getopts.cc0000644000175000017500000000353714204126313017247 0ustar frankfrank#define XERR #include "splitter.ih" void Splitter::getOpts() { opterr = 0; // global getopt variable while (true) { d_optIdx = optind; d_opt = getopt_long(d_argc, d_argv, d_optstring.c_str(), s_options, 0); if (d_opt == -1) break; switch (d_opt) { case 'a': case 'h': case 'v': endAction(); return; case 'c': case 'f': case 's': if (d_action == UNUSED) d_preProcess = d_optIdx; [[fallthrough]]; case 'u': setAction(); break; case 'd': depOrDef(); break; case 'e': action(&d_execute); break; case 'n': d_versionCheck = " -n"; // argv[d_optIdx] = s_empty; break; case 'N': d_process = false; [[fallthrough]]; case 'V': d_verbose = true; break; case 'P': d_pimFile = true; break; case 'p': if (d_preProcess != 0) d_preProcess = d_optIdx; action(&d_preProcess); break; case 'q': // recognized but ignored break; case 'T': d_tmpDir = optarg; break; case 't': scriptOption(); break; case '?': throw Exception{} << "argument index " << d_optIdx << ": option `" << d_argv[d_optIdx] << "' not supported"; break; } } } icmake-10.03.00/icmake/splitter/frame0000644000175000017500000000006614204126313016262 0ustar frankfrank//#define XERR #include "splitter.ih" Splitter:: { } icmake-10.03.00/icmake/splitter/settmpdir.cc0000644000175000017500000000104114204126313017561 0ustar frankfrank//#define XERR #include "splitter.ih" void Splitter::setTmpDir() { if (d_tmpDir.empty()) // no 'T' option { d_tmpDir = "/tmp/"; // first try /tmp if (writable(d_tmpDir)) return; d_tmpDir = getHome(); // else try HOME if (writable(d_tmpDir)) return; } else if (writable(d_tmpDir)) // 'T' option specified return; throw Exception{} << "tmp. dir `" << d_tmpDir << "' not writable"; } icmake-10.03.00/icmake/splitter/depordef.cc0000644000175000017500000000020614204126313017340 0ustar frankfrank#define XERR #include "splitter.ih" void Splitter::depOrDef() { if (s_options[0].name == "dependencies"s) setAction(); } icmake-10.03.00/icmake/splitter/inspect.cc0000644000175000017500000000053014204126313017215 0ustar frankfrank#define XERR #include "splitter.ih" void Splitter::inspect(char *tArguments) { d_ptrs.push_back(strtok(tArguments, " \t")); while (true) { char *field = strtok(0, " \t"); // get subsequent fields if (field == 0) break; d_ptrs.push_back(field); // store them } } icmake-10.03.00/icmake/main.cc0000644000175000017500000000074314204126313014634 0ustar frankfrank#define XERR #include "main.ih" int main(int argc, char **argv) try { if (argc == 1) { usage(*argv); return 1; } Splitter splitter(argc, argv); if (done(*argv, splitter.actionOpt())) return 0; Handler handler{ splitter }; return handler.process(); } catch(int x) { return x; } catch (exception const &exc) { cerr << "Error: " << exc.what() << '\n'; } catch (...) { cerr << "unexpected exception\n"; return 1; } icmake-10.03.00/icmake/version.cc0000644000175000017500000000035314204126313015372 0ustar frankfrank#include "main.ih" void version(string const &progname) { size_t idx = progname.rfind('/'); if (idx == string::npos) idx = 0; else ++idx; cout << progname.substr(idx) << " V" VERSION "\n"; } icmake-10.03.00/icmake/main.ih0000644000175000017500000000062214204126313014643 0ustar frankfrank#include #include #include #include "../xerr/xerr.ih" #include "../support/tools/tools.h" #include "splitter/splitter.h" #include "handler/handler.h" using namespace std; using namespace FBB; bool done(char const *program, Splitter::Action action); void about(char const *program); void usage(string const &progname); void version(string const &progname); icmake-10.03.00/icmake/frame0000644000175000017500000000002314204126313014405 0ustar frankfrank#include "main.ih" icmake-10.03.00/icmake/handler/0000755000175000017500000000000014204243616015020 5ustar frankfrankicmake-10.03.00/icmake/handler/data.cc0000644000175000017500000000041714204126313016234 0ustar frankfrank//#define XERR #include "handler.ih" int (Handler::*Handler::s_action[])() { &Handler::compile, &Handler::dependencies, &Handler::exec, &Handler::forced, &Handler::preprocess, &Handler::source, &Handler::script, &Handler::unassemble, }; icmake-10.03.00/icmake/handler/run.cc0000644000175000017500000000034114204126313016123 0ustar frankfrank//#define XERR #include "handler.ih" bool Handler::run(string const &cmd) { d_process.setCommand(LIBDIR "/" + cmd); if (d_verbose) cout << "calling `" << d_process.str() << "'\n"; return d_doProcess; } icmake-10.03.00/icmake/handler/range.cc0000644000175000017500000000070614204126313016420 0ustar frankfrank#define XERR #include "handler.ih" string Handler::range(unsigned begin, unsigned end) const { if (begin == 0) // no begin option (e.g., -p) return ""; if (begin > end) // begin > end -> endOpts end = d_splitter.endOpts(); // (e.g. at -e or else the // actual options end) return catArgs(begin + 1, end); } icmake-10.03.00/icmake/handler/dependencies.cc0000644000175000017500000000026114204126313017746 0ustar frankfrank#define XERR #include "handler.ih" int Handler::dependencies() { return direct("icm-dep" + catArgs(d_splitter.actionArgsIdx(), d_splitter.argc())); } icmake-10.03.00/icmake/handler/handler.h0000644000175000017500000000323014204126313016576 0ustar frankfrank#ifndef INCLUDED_HANDLER_ #define INCLUDED_HANDLER_ #include #include #include class Splitter; class Handler { Splitter &d_splitter; FBB::Process d_process; unsigned d_idx; bool d_verbose; bool d_doProcess; std::string d_tmpDir; std::string d_file2; std::string d_preOptions; std::string d_execOptions; static int (Handler::*s_action[])(); public: Handler(Splitter &splitter); int process(); private: int compile(); int dependencies(); int exec(); // 1 int forced(); int preprocess(); int source(); int script(); int unassemble(); bool run(std::string const &cmd); // how is &direct or &child int exec(int (Handler::*how)(std::string const &cmd)); // 2 int direct(std::string const &cmd); // calls LIBDIR/cmd // using Process::DIRECT int child(std::string const &cmd); // same, uses PRocess::NONE std::string const &file2(char const *extension); // concatenate all argv elements from // begin to end, starting with an initial // space std::string catArgs(unsigned begin, unsigned end) const; bool doCompile() const; void setPreOptions(); // .ih void setExecOptions(); std::string range(unsigned begin, unsigned end) const; }; #endif icmake-10.03.00/icmake/handler/source.cc0000644000175000017500000000031214204126313016615 0ustar frankfrank#define XERR #include "handler.ih" int Handler::source() { if (not compile()) return 1; d_splitter.setArgv(d_splitter.endOpts(), &d_file2.front()); return exec(&Handler::child); } icmake-10.03.00/icmake/handler/direct.cc0000644000175000017500000000063514204126313016577 0ustar frankfrank#define XERR #include "handler.ih" int Handler::direct(string const &cmd) { // returns d_doProcess if false -> 0 is returned // or execution fails -> 1 is returned if (not run(cmd)) // don't run if d_doProcess is false return 0; d_process.start(Process::DIRECT); return 1; // not reached when exec succeeds } icmake-10.03.00/icmake/handler/handler.ih0000644000175000017500000000104414204126313016750 0ustar frankfrank#include "handler.h" #include "../../xerr/xerr.ih" #include #include #include #include #include #include "../../tmp/INSTALL.im" #include "../splitter/splitter.h" using namespace std; using namespace FBB; using namespace filesystem; inline void Handler::setPreOptions() { d_preOptions = range(d_splitter.preProcess(), d_splitter.execute()); } inline void Handler::setExecOptions() { d_execOptions = range(d_splitter.execute(), d_splitter.preProcess()); } icmake-10.03.00/icmake/handler/handler1.cc0000644000175000017500000000033714204126313017022 0ustar frankfrank#define XERR #include "handler.ih" Handler::Handler(Splitter &splitter) : d_splitter(splitter), d_verbose(d_splitter.verbose()), d_doProcess(d_splitter.process()) { setPreOptions(); setExecOptions(); } icmake-10.03.00/icmake/handler/exec2.cc0000644000175000017500000000050414204126313016326 0ustar frankfrank//#define XERR #include "handler.ih" // how is &direct or &child int Handler::exec(int (Handler::*how)(std::string const &cmd)) { return (this->*how)("icm-exec" + d_splitter.versionCheck() + d_execOptions + catArgs(d_splitter.endOpts(), d_splitter.argc())); } icmake-10.03.00/icmake/handler/forced.cc0000644000175000017500000000071214204126313016563 0ustar frankfrank#define XERR #include "handler.ih" int Handler::forced() { file2(".bim"); if (d_splitter.pimFile()) direct("icm-comp " + d_splitter.file1() + ' ' + d_file2); TempStream pim{ d_splitter.pidName() }; return child("icm-pp" + d_preOptions + ' ' + d_splitter.file1() + ' ' + pim.fileName() ) == 0 and child("icm-comp " + pim.fileName() + ' ' + d_file2) == 0; } icmake-10.03.00/icmake/handler/docompile.cc0000644000175000017500000000041314204126313017272 0ustar frankfrank#define XERR #include "handler.ih" bool Handler::doCompile() const { Stat outFile{ d_file2 }; return not outFile or Stat{ d_splitter.file1() }.statStruct().st_mtime >= outFile.statStruct().st_mtime; } icmake-10.03.00/icmake/handler/script.cc0000644000175000017500000000132214204126313016623 0ustar frankfrank#define XERR #include "handler.ih" // an executable source file 'src' starting with // #!/usr/bin/icmake -t. [-p preprocess options] [-e execute options] // results in calling // /usr/bin/icmake -t. src + any additional options specified after src. // If additional arguments on the #!/usr/bin/icmake line are specified then // those arguments are listed between -t. and 'src', probably causing icmake // to fail. Extra arguments should therefore be avoided. int Handler::script() { TempStream bim{ d_splitter.scriptBim() }; d_file2 = bim.fileName(); if (not forced()) return 1; d_splitter.setArgv(d_splitter.endOpts(), &d_file2.front()); return exec(&Handler::child); } icmake-10.03.00/icmake/handler/exec1.cc0000644000175000017500000000014114204126313016322 0ustar frankfrank//#define XERR #include "handler.ih" int Handler::exec() { return exec(&Handler::direct); } icmake-10.03.00/icmake/handler/compile.cc0000644000175000017500000000060214204126313016747 0ustar frankfrank#define XERR #include "handler.ih" int Handler::compile() { file2(".bim"); if (doCompile()) return forced(); if (d_verbose) cout << '`' << d_file2 << "' is up-to-date. Not calling\n" " `" LIBDIR "/icm-comp" << catArgs(d_splitter.actionArgsIdx(), d_splitter.argc()) << "'\n"; return 0; } icmake-10.03.00/icmake/handler/unassemble.cc0000644000175000017500000000031114204126313017452 0ustar frankfrank#define XERR #include "handler.ih" int Handler::unassemble() { return direct("icmun " + d_splitter.versionCheck() + catArgs(d_splitter.actionArgsIdx(), d_splitter.argc())); } icmake-10.03.00/icmake/handler/process.cc0000644000175000017500000000017014204126313016775 0ustar frankfrank#define XERR #include "handler.ih" int Handler::process() { return (this->*s_action[d_splitter.actionOpt()]) (); } icmake-10.03.00/icmake/handler/catargs.cc0000644000175000017500000000057614204126313016755 0ustar frankfrank#define XERR #include "handler.ih" string Handler::catArgs(unsigned begin, unsigned end) const { string ret; for ( char const *const *beginArgs = d_splitter.argv() + begin, *const *endArgs = d_splitter.argv() + end; beginArgs != endArgs; ++beginArgs ) (ret += ' ') += *beginArgs; return ret; } icmake-10.03.00/icmake/handler/file2.cc0000644000175000017500000000146514204126313016330 0ustar frankfrank#define XERR #include "handler.ih" string const &Handler::file2(char const *extension) { string const &file1 = d_splitter.file1(); if (d_file2.empty()) { switch (d_splitter.nFiles()) { case 0: throw Exception{} << "filename missing for option `" << d_splitter.argv(d_splitter.actionIdx()) << '\''; case 1: d_file2 = path { file1 }.replace_extension(extension).string(); break; default: d_file2 = d_splitter.file2(); break; } } if (absolute(file1) == absolute(d_file2)) throw Exception{} << '`' << file1 << "' and `" << d_file2 << "' are the same files"; return d_file2; } icmake-10.03.00/icmake/handler/child.cc0000644000175000017500000000030114204126313016376 0ustar frankfrank#define XERR #include "handler.ih" int Handler::child(string const &cmd) { if (not run(cmd)) return 0; d_process.start(Process::NONE); return d_process.waitForChild(); } icmake-10.03.00/icmake/handler/frame0000644000175000017500000000006414204126313016027 0ustar frankfrank//#define XERR #include "handler.ih" Handler:: { } icmake-10.03.00/icmake/handler/preprocess.cc0000644000175000017500000000033614204126313017510 0ustar frankfrank//#define XERR #include "handler.ih" int Handler::preprocess() { return direct( "icm-pp" + d_preOptions + ' ' + d_splitter.file1() + ' ' + file2(".pim") ); } icmake-10.03.00/icmake/about.cc0000644000175000017500000000173114204126313015020 0ustar frankfrank#include "main.ih" namespace { char const info[] = R"( Icmake consists of a set of six programs. Together they can be used for program maintenance, comparable to, e.g., the UNIX make facility, or they can be used for other tasks, comparable to the facilities offered by scripting languages. Icmake was originally developed using the C programming language by Frank B. Brokken and (until version 6.xx) Karel Kubat. Since version 10.00.00 icmake's source files are written in C++. Icmake is available on various UNIX-platforms and is included in several Linux distributions (e.g., Debian). Icmake's home page is: https://fbb-git.gitlab.io/icmake/ Questions, remarks, etc. about Icmake should be sent to: Frank B. Brokken, phone: (+31) 6 5353 2509 e-mail: f.b.brokken@rug.nl University of Groningen the Netherlands )"; } void about(char const *program) { Tools::usageTop(program) << info; } icmake-10.03.00/icmake/done.cc0000644000175000017500000000062414204126313014633 0ustar frankfrank#define XERR #include "main.ih" bool done(char const *program, Splitter::Action action) { switch (action) { case Splitter::ABOUT: about(program); break; case Splitter::HELP: usage(program); break; case Splitter::VERS: version(program); break; default: return false; } return true; } icmake-10.03.00/icmake/CLASSES0000644000175000017500000000002114204126313014406 0ustar frankfranksplitter handler icmake-10.03.00/icm_bootstrap0000755000175000017500000000414714204126313014745 0ustar frankfrank#!/bin/bash if [ "$#" == "0" ] ; then echo " Usage: icm_bootstrap Parser and scanner files generated by bisonc++ and flexc++ must already be available (which holds true for the standard distribution) Before calling this script icm_prepare must have been called. " exit 0 fi if [ ! -e tmp/INSTALL.sh ] ; then echo tmp/INSTALL.sh does not exist. Execute ./icm_prepare to create it exit 1 fi . bootstrap/functions . tmp/INSTALL.sh # now BINDIR, SKELDIR, .... etc have been defined # the @SKELDIR@ etc. names in icmbuild and icmstart are converted by # icm_install, calling scripts/convert # build icmake and its support programs for target in support comp dep exec pp un icmake icmbuild do cd $target ./icm_bootstrap || exit 1 cd .. done # cp /usr/bin/{icmake,icmbuild} tmp/usr/bin/ || exit 1 # cp /usr/lib/icmake/{icm-*,icmun} tmp/usr/lib/icmake/ || exit 1 # echo echo echo ./scripts to ./tmp/{icmbuild.in,icmstart.in} # conversions by icm_install cd scripts cp icmstart.sh ../tmp/icmstart.sh ./catim ib ../tmp/icmbuild.in ./catim is ../tmp/icmstart.in cd .. echo echo skeleton files in usr/share/icmake/ to tmp${SKELDIR} try cp -r usr/share/icmake/* tmp${SKELDIR} echo echo configuration files in etc/icmake/ to tmp${CONFDIR} try cp -r etc/icmake/* tmp${CONFDIR} echo cd doc echo man-pages *.1 to tmp${MANDIR}/man1 for x in *.1 ; do gzip -9cn $x > ../tmp${MANDIR}/man1/$x.gz || exit 1 done echo echo man-pages *.7 to tmp${MANDIR}/man7 for x in *.7 ; do gzip -9cn $x > ../tmp${MANDIR}/man7/$x.gz || exit 1 done echo echo ./changelog to tmp${DOCDIR} cd .. gzip -9cn changelog > tmp${DOCDIR}/changelog.gz || exit 1 echo echo ./examples files to tmp${DOCDIR} try cp -r examples tmp${DOCDIR} echo ./etc files to tmp/etc try cp -r etc tmp/ echo echo Done. # The obsoleted document icmake.ps is no longer included in the distributions # echo doc/icmake.ps and ./changelog to tmp${DOCDIR} # gzip -9cn icmake.ps > ../tmp${DOCDOCDIR}/icmake.ps.gz || exit 1 icmake-10.03.00/icmbuild/0000755000175000017500000000000014204243623013740 5ustar frankfrankicmake-10.03.00/icmbuild/build0000755000175000017500000000003114204126313014753 0ustar frankfrank#!/bin/bash icmbuild $1 icmake-10.03.00/icmbuild/icm_bootstrap0000755000175000017500000000021414204126313016524 0ustar frankfrank#!/bin/bash . ../bootstrap/flags . ../bootstrap/functions echo Creating tmp${BINDIR}/icmbuild maindir ${BINDIR}/icmbuild -s rm -f *.o icmake-10.03.00/icmbuild/usage.cc0000644000175000017500000000365414204126313015357 0ustar frankfrank// usage.cc #include "main.ih" namespace { char const info[] = R"_( [option] command Where: [options] - optional arguments (short options between parentheses, only one option can be specified): --help (-h) - provide this help (ends `icmbuild') [also shown if `icmconf', required by `icmbuild', does not exist in the current working directory] -c - clears the screen ('tput clear') just before starting the compilation process -s - strip the compilation products at their installation directories command: clean - remove remnants of previous activities cleangch - remove all precompiled header files cleantmp - remove files created during compilation from TMP_DIR (precompiled headers stored under TMP_DIR are kept install what where - install a compilation product (this command may be preceded by option -s) what: use 'program', 'static', or 'shared' to install, resp., the program, the static library, or the shared library where: path (directory) to install the compilation product in. The path may start with ~/ library - build a static library (requires icmconf's LIBRARY specification). When icmconf also specifies SHARED then a shared library is also built (this command may be preceded by option -c) program - build a program (requires icmconf's MAIN specification) (this command may be preceded by option -c) )_"; } void usage(std::string progname) { if (size_t idx = progname.rfind('/'); idx != string::npos) progname.erase(0, idx + 1); Tools::usageTop(progname) << info; } icmake-10.03.00/icmbuild/icmconf0000644000175000017500000000105214204126764015305 0ustar frankfrank#define CLS #define MAIN "main.cc" #define SOURCES "*.cc" #define OBJ_EXT ".o" #define TMP_DIR "tmp" #define USE_ECHO ON #define IH ".ih" #define CXX "g++" #define CXXFLAGS " --std=c++20 -Wall -O2 " \ " -fdiagnostics-color=never " #define REFRESH #define LDFLAGS "-s" #define ADD_LIBRARIES "support bobcat" #define ADD_LIBRARY_PATHS "../../support/tmp" #define DEFCOM "program" icmake-10.03.00/icmbuild/main.cc0000644000175000017500000000147114204126313015172 0ustar frankfrank//#define XERR #include "main.ih" // argument 1 is -h or --help ? -> usage // no arguments ? // no icmconf available -> error // start icmconf with the provided arguments int main(int argc, char **argv) { if (argc > 1 and (argv[1] == "-h"s or argv[1] == "--help"s)) { usage(argv[0]); return 0; } if (not Tools::exists("icmconf")) { cerr << "no `icmconf' file in the current directory\n"; return 1; } string cmd{ "/usr/bin/icmake -t. " LIBDIR "/icmbuild" }; for_each(argv + 1, argv + argc, [&](char *arg) { (cmd += ' ') += arg; } ); Process icmbuild{ cmd }; icmbuild.start(Process::DIRECT, Process::USE_PATH); cerr << "Could not execute `" << cmd << "'\n"; return 1; } icmake-10.03.00/icmbuild/main.ih0000644000175000017500000000033514204126313015203 0ustar frankfrank#include #include #include #include #include "../support/tools/tools.h" #include "../xerr/xerr.ih" using namespace std; using namespace FBB; void usage(string argv0); icmake-10.03.00/icmbuild/main/0000755000175000017500000000000014055137601014666 5ustar frankfrankicmake-10.03.00/icmconf.dir0000644000175000017500000000007514204126313014264 0ustar frankfrank#define LIBRARY "obj" #include "../../icmconf.lib" icmake-10.03.00/icmconf.lib0000644000175000017500000000065714204126767014277 0ustar frankfrank#define CLS #define SOURCES "*.cc" #define OBJ_EXT ".o" #define TMP_DIR "tmp" #define USE_ECHO ON #define IH ".ih" #define CXX "g++" #define CXXFLAGS " --std=c++20 -Wall -O2 " \ " -fdiagnostics-color=never " #define ADD_LIBRARIES "bobcat" #define ADD_LIBRARY_PATHS "" #define DEFCOM "library" icmake-10.03.00/icm_gitlab0000755000175000017500000000127014204126313014164 0ustar frankfrank#!/bin/bash echo -n "This script is for internal use only. Are you sure you want to run it [y/n] ?" read yesno [ "$yesno" == "y" ] || exit 0 . icm_prepare / cp doc/*.1 tmp/${MANDIR}/man1 cp doc/*.7 tmp/${MANDIR}/man7 cp changelog ../../wip/changelog.txt grep -v ^AUTHOR VERSION | sed ' s/VERSION=\(.*\)/SUBST\(_CurVers_\)\(\1\)/ s/YEARS=\(.*\)/SUBST\(_CurYrs_\)\(\1\)/ ' > release.yo cp release.yo required ../../wip/ cd doc/manpage ln -sf ../../release.yo . for yo in ic*yo do yodl2html --no-warnings $yo done cd .. mkdir -p ../../../wip/manpages cp -r manpage/*.html ../../../wip/manpages rm -f manpage/{*.html,release.yo} cd .. rm -r tmp release.yo icmake-10.03.00/icm_install0000755000175000017500000000531214204126313014371 0ustar frankfrank#!/bin/bash usage() { echo " Usage: $0 [strip] all|progs|scripts|man|skel|doc|etc|docdoc [installdir] " exit 1 } [ -e tmp/ROOT ] || usage . scripts/conversions echo ROOT DIRECTORY: ${ROOT} if [ "$1" == "strip" ] ; then STRIP=strip shift fi if [ "$2" != "" ] ; then INSTALLDIR=$2 else INSTALLDIR=${ROOT} fi try() { echo $* $* || exit 1 } progs() { if [ "$STRIP" == "strip" ] ; then try strip tmp${BINDIR}/icmake tmp${BINDIR}/icmbuild \ tmp${LIBDIR}/* fi try mkdir -p $INSTALLDIR${BINDIR} $INSTALLDIR${LIBDIR} try cp tmp${BINDIR}/icmake tmp${BINDIR}/icmbuild \ $INSTALLDIR${BINDIR} if [ -e $INSTALLDIR${LIBDIR}/icm-exec ] ; then try rm $INSTALLDIR${LIBDIR}/icm-exec fi try cp -r tmp${LIBDIR}/* $INSTALLDIR${LIBDIR} } scripts() { try mkdir -p $INSTALLDIR${BINDIR} $INSTALLDIR${LIBDIR} \ $INSTALLDIR${DOCDIR} # convert icmstart.sh to INSTALLDIR/usr/bin/icmstart try scripts/convert tmp/icmstart.sh $INSTALLDIR$BINDIR/icmstart try chmod +x $INSTALLDIR$BINDIR/icmstart # convert icmbuild.in to icmbuild try scripts/convert tmp/icmbuild.in $INSTALLDIR$LIBDIR/icmbuild # convert icmstart.in to docdir/icmstart.im try scripts/convert tmp/icmstart.in tmp/icmstart.im echo gzip -9cn tmp/icmstart.im \> $INSTALLDIR${DOCDIR}/icmstart.im.gz gzip -9cn tmp/icmstart.im > $INSTALLDIR${DOCDIR}/icmstart.im.gz || exit 1 # compile icmstart.im to $INSTALLDIR$LIBDIR//icmstart.bim try tmp${LIBDIR}/icm-pp tmp/icmstart.im tmp/icmstart.pim try tmp${LIBDIR}/icm-comp tmp/icmstart.pim \ $INSTALLDIR${LIBDIR}/icmstart.bim } into() { try mkdir -p $INSTALLDIR/$1 try cp -r tmp/$1/* $INSTALLDIR/$1 } case $1 in (all) echo installing programs progs echo echo installing scripts scripts echo echo installing man-pages in ${MANDIR} into ${MANDIR} echo echo installing skeleton files in ${SKELDIR} into ${SKELDIR} echo echo installing files to ${DOCDIR} into ${DOCDIR} echo # echo installing # into ${DOCDOCDIR} # echo echo installing /etc/icmake files into ${CONFDIR} echo ;; (progs) progs ;; (scripts) scripts ;; (man) into ${MANDIR} ;; (skel) into ${SKELDIR} ;; (doc) into ${DOCDIR} ;; (etc) into ${CONFDIR} ;; # (docdoc) # into ${DOCDOCDIR} # ;; (*) usage ;; esac icmake-10.03.00/icm_prepare0000755000175000017500000000273314204126313014365 0ustar frankfrank#!/bin/bash if [ "$#" == "0" ] ; then echo " Usage: icm_prepare rootdir In standard situations specify / as rootdir. The physical installation dir is specified when calling icm_install. The here specified rootdir is hard-coded in icmake's programs, so eventually the icmake files should be available under rootdir. " exit 0 fi try() { echo " $*" $* || exit 1 } echo Creating the intermediate destination directory ./tmp try rm -rf tmp # icmake/tmp icmun/tmp/ icm-*/tmp # try find -name '*.o' -exec rm -f '{}' \; try mkdir -p tmp echo Writing tmp/ROOT ROOT=`echo $1 | sed 's_/$__'` echo "ROOT=${ROOT}/" > tmp/ROOT . scripts/conversions echo " #define BINDIR \"${BINDIR}\" #define SKELDIR \"${SKELDIR}\" #define MANDIR \"${MANDIR}\" #define LIBDIR \"${LIBDIR}\" #define CONFDIR \"${CONFDIR}\" #define DOCDIR \"${DOCDIR}\" #define AUTHOR \"${AUTHOR}\" #define VERSION \"${VERSION}\" #define YEARS \"${YEARS}\" " > tmp/INSTALL.im echo " BINDIR=\"${BINDIR}\" SKELDIR=\"${SKELDIR}\" MANDIR=\"${MANDIR}\" LIBDIR=\"${LIBDIR}\" CONFDIR=\"${CONFDIR}\" DOCDIR=\"${DOCDIR}\" VERSION=\"${VERSION}\" YEARS=\"${YEARS}\" " > tmp/INSTALL.sh echo Creating the intermediate destination directories try mkdir -p tmp${BINDIR} tmp${LIBDIR} tmp${SKELDIR} try mkdir -p tmp${CONFDIR} tmp${MANDIR}/man1 tmp${MANDIR}/man7 try mkdir -p tmp${DOCDIR} icmake-10.03.00/INSTALL0000644000175000017500000001526714204126313013210 0ustar frankfrankINSTALLING ICMAKE ================= Version 10.00.00 (and beyond). 1. Unpack the archive: ====================== The installation files for Icmake comes as an archive, e.g., "icmake_10.00.00.tar.gz". These archives unpack to several directories and files. The archive unpacks to a directory icmake-10.00.00 below the current directory. The version number in this directory may change to newer release versions. So, if you unpack icmake_10.00.00.tar.gz (or later versions) in the directory /usr/local/src, a directory /usr/local/src/icmake/icmake-10.00.00 is created, as well as other subdirectories below /usr/local/src/icmake/icmake-10.00.00 To unpack the archives, create an appropriate directory (e.g., `/usr/local/src/icmake' E.g, tar xvzf icmake_10.00.00.tar.gz The extraction of files from the archive should yield a lot of C source files in various directories. Icmake's default distribution does not contain makefiles for the Unix-utility `make' anymore. 2. Compile the programs ======================= Change to the directory into which the sources were unpacked. E.g., do cd icmake-10.00.00 This directory should contain this file (i.e., INSTALL). Icmake uses several support programs, which do not have to be stored in the PATH diretories. Before starting the compilation, make sure their locations are in accordance with your local requirements: - Inspect (and optionally modify) the path-settings in INSTALL.im. In particular check: #define BINDIR "usr/bin" #define SKELDIR "usr/share/icmake" #define MANDIR "usr/share/man" #define LIBDIR "usr/lib/icmake" #define CONFDIR "etc/icmake" #define DOCDIR "usr/share/doc/icmake" #define DOCDOCDIR "usr/share/doc/icmake-doc" These locations are all are relative to a specifiable base-directory. Meaning: BINDIR the binary programs and scripts SKELDIR the icmstart-script skeleton files MANDIR the base directory of man-pages (under MANDIR/man1 and MANDIR/man2) LIBDIR icmake's support programs CONFDIR the system-wide configuration files (AUTHOR, VERSION, icmstart.rc) DOCDIR various doc-files (e.g., changelog) DOCDOCDIR more extensive documentation (icmake.ps, examples) - Inspect (and optionally modify) the availability of the program mentioned in ./def/programs (they should be available on any Unix(like) systems). - Prepare for the program construction by running the shell-script `icm_prepare' as follows: ./icm_prepare / (this assumes that you want to prepend all base locations mentioned in INSTALL.im with /; other base locations are also possible, e.g., ./icm_prepare /tmp prepares for installation of all files in the specified locations, all below /tmp. - Next run the shell-script `icm_bootstrap' as follows: ./icm_bootstrap x This constructs the icmake files under the ./tmp directory, preparing for an installation under the directory specified at ./icm_prepare. It puts all icmake related files in tmp/$BINDIR, tmp/$SKELDIR, tmp/$MANDIR, tmp/$LIBDIR, tmp/$CONFDIR, tmp/$DOCDIR, tmp/$DOCDOCDIR NOTE: There have been reports about failing compilations of the file ./icm-comp/lexer.c. This is usually caused by incompatibilities between the existing lexer.c file and the lex(1) run-time library. These problems are commonly solved after running in the directory ./icm-comp the command ./updatescanner 3. Install the files ==================== You probably must do this as `root': ./icm_install [strip] all This installs all files under the root directory (which was initially specied when calling icm_bootstrap) When providing the strip arguments binaries will be stripped. Note that by default unstripped binaries will be installed. Separate parts may be installed as well. E.g., ./icm_install [strip] progs / - installs all executables ./icm_install scripts / - installs the icmstart/icmbuild scripts ./icm_install man / - installs the man-pages ./icm_install skel / - installs the skeletons ./icm_install etc / - installs the default icmstart.rc related files ./icm_install doc / - installs the docs ./icm_install docdoc / - installs the extended docs and examples 4. Clean up the garbage ======================= rm -rf tmp 5. Predefined symbols ===================== Icmake does not require special modifications. However, you may wish to take a look at the file icm-pp/loadsymbols.c. In this file the function 'loadSymbols()' of the preprocessor icm-pp is found. The preloaded symbols of Icmake are defined in this function. If you plan to use these predefined symbols in your Icmake scripts, make sure that the conditional code in the file pp/loadsym.c recognizes your platform. If you are unsure whether this code recognizes your compiler, build Icmake as distributed and try out the sample icmake file examples/defines.im (i.e., say: "icmake examples/defines"). If the output of the makefile is not satisfatory, modify pp/loadsym.c. E.g., if your MegaC compiler defines the symbol MEGA_C, you might want to add the following lines to pp/loadsym.c: #ifdef MEGA_C preload("MEGA_C", "1"); #else preload("MEGA_C", "0"); #endif Currently the following symbols are predefined: -------------------------------------------------------------- symbol 1 when defined on the platform ... otherwise 0 -------------------------------------------------------------- unix Unix, usually with GNU's gcc compiler UNIX same linux '386 or '486 running Linux (usually with gcc) LINUX same M_SYSV, M_UNIX '386 or '486 running SCO/Unix (usually with Microsoft C) _POSIX_SOURCE Unix with Posix compliant compiler __hpux HP-UX, with the native HP compiler -------------------------------------------------------------- If you want to modify something here which hasn't been done before, please email me about it, and I'll include it in the standard distribution. icmake-10.03.00/INSTALL.im0000644000175000017500000000214614204126313013604 0ustar frankfrank// The locations of the binaries, the man pages and the documentation // ================================================================== // // The settings in this file are according to the Debian File Standard // Change them according to your tastes if you think they should be // different. // // All locations are relative to a specifiable base-directory. // // BINDIR the binary programs and scripts // SKELDIR the icmstart-script skeleton files // MANDIR the base directory of man-pages (under MANDIR/man1 and // MANDIR/man2) // LIBDIR icmake's support programs // CONFDIR the system-wide configuration files (AUTHOR, VERSION, // icmstart.rc) // DOCDIR various doc-files (e.g., changelog) // this file is included by icmake/handler/handler.im, so icmake knows // where its sub-programs live #define BINDIR "usr/bin" #define SKELDIR "usr/share/icmake" #define MANDIR "usr/share/man" #define LIBDIR "usr/libexec/icmake" #define CONFDIR "etc/icmake" #define DOCDIR "usr/share/doc/icmake" icmake-10.03.00/iuo/0000755000175000017500000000000014203741153012744 5ustar frankfrankicmake-10.03.00/iuo/bootstrapinstall0000755000175000017500000000046714204126313016301 0ustar frankfrank#!/bin/bash cd /usr/bin if [ -f icmake ] ; then mv icmake icmake.org ln -sf /home/frank/src/icmake/tmp/usr/bin/icmake . fi cd /usr/lib/icmake for x in icm-pp icm-comp icm-exec do if [ -f $x ] ; then mv $x $x.org ln -sf /home/frank/src/icmake/tmp/usr/lib/icmake/$x . fi done icmake-10.03.00/iuo/uninstall0000755000175000017500000000033714204126313014702 0ustar frankfrank#!/bin/bash cd /usr/bin if [ -h icmake ] ; then rm icmake mv icmake.org icmake fi cd /usr/lib/icmake for x in icm-pp icm-comp icm-exec do if [ -h $x ] ; then rm $x mv $x.org $x fi done icmake-10.03.00/iuo/install0000755000175000017500000000052214204126313014333 0ustar frankfrank#!/bin/bash cd /usr/bin if [ -f icmake ] ; then mv icmake icmake.org ln -sf /home/frank/git/icmake/src/icmake/icmake/tmp/bin/binary icmake fi cd /usr/lib/icmake for x in icm-pp icm-comp icm-exec do if [ -f $x ] ; then mv $x $x.org ln -sf /home/frank/git/icmake/src/icmake/$x/tmp/bin/binary $x fi done icmake-10.03.00/legacy/0000755000175000017500000000000014203741153013414 5ustar frankfrankicmake-10.03.00/legacy/lsm.org/0000755000175000017500000000000014203741153014775 5ustar frankfrankicmake-10.03.00/legacy/lsm.org/icmake.lsm0000644000175000017500000000346614204126313016750 0ustar frankfrankBegin2 Title = Icmake - an Intelligent C-like Maker Version = 6.20 Desc1 = Icmake is yet another maker -- but this time, one that uses Desc2 = a C-like syntaxis. The Icmake scripts should feel `natural' to Desc3 = all C programmers. Icmake is furthermore a powerful shell script Desc4 = language: it can be used for program maintenance as well as for Desc5 = system administrative tasks. Author = Frank B. Brokken and Karel Kubat AuthorEmail = frank@icce.rug.nl and karel@icce.rug.nl Maintainer = Frank B. Brokken and Karel Kubat MaintEmail = frank@icce.rug.nl and karel@icce.rug.nl Site1 = ftp.icce.rug.nl Path1 = pub/unix File1 = icmake-6.20.tgz FileSize1 = xxx Site2 = tsx-11.mit.edu Path2 = pub/linux/sources/usr.bin File2 = icmake-6.20.tgz FileSize2 = xxx Site3 = sunsite.unc.edu Path3 = pub/Linux/devel/make File3 = icmake-6.20.tgz FileSize3 = xxx Required1 = No special hardware or software is required, except for Required2 = a C compiler. GNU's gcc 2.6.2. will do nicely. Furthermore, Required3 = libc.4.6.27 is expected with the linux-executables. CopyPolicy1 = The Icmake package may be freely distributed, provided that CopyPolicy2 = no changes are made to the software or documentation. Keywords = icmake make C Comment1 = The package contains the following documentation: Comment2 = icmake.doc and INSTALL - installation guide Comment3 = doc/icmake.ps - 300dpi LaserJet documentation, gs-printable Comment4 = doc/icmake.1 - simple man page RelFiles1 = icmake.doc, icmake-6.20.bin.tgz (containing binaries): Found RelFiles2 = at the sites. Read icmake.doc before installing Entered = 10MAY1995 EnteredBy = Frank Brokken CheckedEmail = frank@icce.rug.nl End icmake-10.03.00/legacy/lsm.org/icmakebin.lsm0000644000175000017500000000315514204126313017434 0ustar frankfrankBegin2 Title = Icmake - an Intelligent C-like Maker Version = 6.20 Desc1 = Icmake is yet another maker -- but this time, one that uses Desc2 = a C-like syntaxis. The Icmake scripts should feel `natural' to Desc3 = all C programmers. Icmake is furthermore a powerful shell script Desc4 = language: it can be used for program maintenance as well as for Desc5 = system administrative tasks. Author = Frank B. Brokken and Karel Kubat AuthorEmail = frank@icce.rug.nl and karel@icce.rug.nl Maintainer = Frank B. Brokken and Karel Kubat MaintEmail = frank@icce.rug.nl and karel@icce.rug.nl Site1 = ftp.icce.rug.nl Path1 = pub/unix File1 = icmake-6.20.bin.tgz FileSize1 = xxx Site2 = tsx-11.mit.edu Path2 = pub/linux/binaries/usr.bin File2 = icmake-6.20.bin.tgz FileSize2 = xxx Site3 = sunsite.unc.edu Path3 = pub/Linux/devel/make File3 = icmake-6.20.bin.tgz FileSize3 = xxx Required1 = libc.4.6.27 is expected with the linux-executables. CopyPolicy1 = The Icmake package may be freely distributed, provided that CopyPolicy2 = no changes are made to the software or documentation. Keywords = icmake make C Comment1 = The package contains the following documentation: Comment2 = icmake.doc and INSTALLBIN - installation guide. READ ! Comment3 = doc/icmake.ps - 300dpi LaserJet documentation, gs-printable Comment4 = doc/icmake.1 - simple man page RelFiles1 = icmake-6.20.tgz: Sources found at the sites. Entered = 10MAY1995 EnteredBy = Frank Brokken CheckedEmail = frank@icce.rug.nl End icmake-10.03.00/legacy/mail.frank0000644000175000017500000000236214204126313015360 0ustar frankfrankMichael Meskes Von: Frank B. Brokken [frank@suffix.icce.rug.nl] Gesendet: Dienstag, 18. November 1997 16:44 An: meskes@topsystem.de Betreff: Re: icmake copyright Dear Michael Meskes, you wrote: > Hi, > > in your copyright you say: whatever... but in our website www.icce.rug.nl/docs/software.html, we explicitly state that ALL software that we make publicly available is distributed according to the GPL, whatever the docs (still) tell you. So don't worry. It's ony a bit inconvenient that the copyright-information that is distributed with (some) of our software is still a bit incongruent with the GPL. But again: ignore that, and consider all our software free. If you have a patch and want it to be part of icmake of whatever software we distribute, go ahead! Which doesn't mean that we're not interested in receiving information about that patch :-) But I guess that goes without saying. Have a nice day, -- | ---|--- -----+--0--+----- | | Frank (al sinds enige jaren uitgedost (untranslatable)) E-mail: frank@icce.rug.nl or f.b.brokken@icce.rug.nl Fax: (+31) 50 363 6686: office hrs, (+31) 50 403 2341 otherwise. Phone: (+31) 50 363 3688: office hrs, (+31) 50 403 2223 otherwise. icmake-10.03.00/legacy/dos-msc.im0000644000175000017500000001531014204126313015304 0ustar frankfrank// These two defines are the C compiler and the flags. -c is needed to // ensure compilation-only; -O is selected to turn debugging off. #define CC "cl" #define CFLAGS "-c -W3 -O -AS" // The following two macros are the library manager. That program // is started as "AR ARFLAGS library-name object-files". #define AR "lib" // A remove program.. #define RM "del" // The destination directory to copy executables to, and your install // program ("cp" for a poor man's solution). #define BINDIR "c:\\sys\\ec" #define CP "copy" // You've edited enough now. Try making it. #define LIB_ICRSS "icrss.lib" #define LIB_ICMAKE "icmake.lib" #define LIB_ICMPP "icmpp.lib" #define LIB_ICMCOMP "icmcomp.lib" #define LIB_ICMEXEC "icmexec.lib" #define LIB_ICMUN "icmun.lib" #define ZIP "icmake.zip" list loadass (string dir, string lib) { int i; string ofile; list ofiles; chdir (dir); printf ("Checking asm/*.obj files against library ", lib, "\n"); ofiles = makelist ("asm\\*.obj"); // list of obj files for (i = 0; i < sizeof (ofiles); i++) { ofile = element (i, ofiles); if (ofile older lib) { ofiles -= (list) ofile; i--; } } chdir (".."); return (ofiles); } void makelib (string dir, string lib, string mainobj, list extraobj) { list cfiles, ofiles; string ofile, cfile; int i; chdir (dir); mainobj = rss_changeExt (mainobj, ".obj"); printf ("Checking .c files against library ", lib, "\n"); cfiles = makelist ("*.c"); for (i = 0; i < sizeof (cfiles); i++) { cfile = element (i, cfiles); ofile = rss_changeExt (cfile, ".obj"); if (cfile older lib || (exists (ofile) && ofile younger cfile) ) { cfiles -= (list) cfile; i--; } } if (cfiles) execute (CC, CFLAGS, "", cfiles, "", ""); printf ("Checking .obj files against library ", lib, "\n"); ofiles = makelist ("*.obj") - (list) mainobj; if (ofiles) { execute (AR, lib, "-+", ofiles, "", ";"); for (i = 0; i < sizeof (ofiles); i++) system (RM + " " + element (i, ofiles)); } if (extraobj) execute (AR, lib, "-+", extraobj, "", ";"); system (RM + " " + rss_changeExt(lib, "bak")); chdir (".."); } void makelibs () { printf ("\nLoading Assembler modules in RSS Library\n"); printf ("\nMaking Run Time Support System library\n"); makelib ("rss", LIB_ICRSS, "", loadass ("rss", LIB_ICRSS)); printf ("\nMaking lib for shell program icmake\n"); makelib ("make", LIB_ICMAKE, "icmake", (list)""); printf ("\nMaking lib for preprocessor icm-pp\n"); makelib ("pp", LIB_ICMPP, "icm-pp", (list)""); printf ("\nMaking lib for compiler icm-comp\n"); makelib ("comp", LIB_ICMCOMP, "icm-comp", (list)""); printf ("\nMaking lib for executor icm-exec\n"); makelib ("exec", LIB_ICMEXEC, "icm-exec", (list)""); printf ("\nMaking lib for unassembler icmun\n"); makelib ("un", LIB_ICMUN, "icmun", (list)""); } void makeprog (string dir, string lib, string prog) { string exepacked_prog, rsslib; rsslib = "..\\rss\\icrss.lib"; exepacked_prog = "..\\bindos\\" + prog; chdir (dir); printf ("Checking prog ", exepacked_prog, " against libs ", lib, " and ", rsslib, "\n"); if (lib younger exepacked_prog || rsslib younger exepacked_prog) { exec (CC, rss_changeExt (prog, ".obj"), lib, rsslib); exec ("exepack", prog, exepacked_prog); system("del " + prog); } chdir (".."); } void makeprogs () { makelibs (); printf ("\nMaking shell program icmake\n"); makeprog ("make", LIB_ICMAKE, "icmake.exe"); printf ("\nMaking preprocessor program icm-pp\n"); makeprog ("pp", LIB_ICMPP, "icm-pp.exe"); printf ("\nMaking compiler program icm-comp\n"); makeprog ("comp", LIB_ICMCOMP, "icm-comp.exe"); printf ("\nMaking executor program icm-exec\n"); makeprog ("exec", LIB_ICMEXEC, "icm-exec.exe"); printf ("\nMaking unassembler program icmun\n"); makeprog ("un", LIB_ICMUN, "icmun.exe"); } void inst (string prog) { string dest; chdir ("bindos"); dest = BINDIR + "\\" + prog; if (prog newer dest) system (CP + " " + prog + " " + BINDIR); chdir (".."); } void install () { makeprogs (); printf ("\nInstalling shell program icmake\n"); inst ("icmake.exe"); printf ("\nInstalling preprocessor program icm-pp\n"); inst ("icm-pp.exe"); printf ("\nInstalling compiler program icm-comp\n"); inst ("icm-comp.exe"); printf ("\nInstalling executor program icm-exec\n"); inst ("icm-exec.exe"); printf ("\nInstalling unassembler program icmun\n"); inst ("icmun.exe"); } void clean (string dir, string lib, string prog) { chdir (dir); printf ("Cleaning ", dir, "\n"); lib = rss_changeExt (lib, ".bak"); if (exists (lib)) system (RM + " " + lib); if (prog && exists (prog)) system (RM + " " + prog); chdir (".."); printf (dir, ": clean.\n"); } void cleanup () { clean ("rss", LIB_ICRSS, ""); clean ("make", LIB_ICMAKE, "icmake.exe"); clean ("pp", LIB_ICMPP, "icm-pp.exe"); clean ("comp", LIB_ICMCOMP, "icm-comp.exe"); clean ("exec", LIB_ICMEXEC, "icm-exec.exe"); clean ("un", LIB_ICMUN, "icmun.exe"); } void main (int argc, list argv) { string av1; echo (1); av1 = element (1, argv); if (av1 == "libs") makelibs (); else if (av1 == "progs") makeprogs (); else if (av1 == "install") install (); else if (av1 == "clean") cleanup (); else if (av1 == "fresh") { install (); cleanup (); } else printf ("Make what?\n" "Select one of the following:\n" " \"icmake dos-msc -- libs\" to make libraries\n" " \"icmake dos-msc -- progs\" to make programs\n" " \"icmake dos-msc -- install\" to install programs to ", BINDIR, "\n" " \"icmake dos-msc -- clean\" to remove old mush\n" " \"icmake dos-msc -- fresh\" to install and clean\n" "\n"); } icmake-10.03.00/LICENSE0000644000175000017500000010451314204245537013167 0ustar frankfrank GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . icmake-10.03.00/pp/0000755000175000017500000000000014204243436012571 5ustar frankfrankicmake-10.03.00/pp/state/0000755000175000017500000000000014204243436013711 5ustar frankfrankicmake-10.03.00/pp/state/state.h0000644000175000017500000000245414204126313015201 0ustar frankfrank#ifndef INCLUDED_STATE_ #define INCLUDED_STATE_ #include "../../support/constmember/constmember.h" #include "../scanner/scanner.h" class State: private ConstMember { friend class ConstMember; enum States { START, CONTENT, WS, NL0, NL1, NLn, nStates }; States d_state = START; Scanner d_scanner; static void (State::*s_state[][nStates])(); static char const *s_stateName[]; public: State() = default; int run(); private: void text2content(); // text -> CONTENT void writeNLtext(); // \n and text void writeHashLine(); // #\n -> START void writeLineNrText(); // #lineNr()\n and text void nop() const; void err() const; void ws(); // these functions check wether void text(); // scanner.active() void nlText(); // void spaceText(); // void lineNrText(); // void nlLineNrText(); // void filename(); // void nlFilename(); // void hashLine(); // void nlHashLine(); // void nl0(); void nl1(); void nlN(); }; #endif icmake-10.03.00/pp/state/text.cc0000644000175000017500000000015714204126313015201 0ustar frankfrank//#define XERR #include "state.ih" void State::text() { if (d_scanner.active()) text2content(); } icmake-10.03.00/pp/state/nln.cc0000644000175000017500000000011514204126313014776 0ustar frankfrank//#define XERR #include "state.ih" void State::nlN() { d_state = NLn; } icmake-10.03.00/pp/state/nllinenrtext.cc0000644000175000017500000000024614204126313016742 0ustar frankfrank//#define XERR #include "state.ih" void State::nlLineNrText() { if (not d_scanner.active()) return; d_scanner.write('\n'); writeLineNrText(); } icmake-10.03.00/pp/state/data.cc0000644000175000017500000000601514204126313015125 0ustar frankfrank//#define XERR #include "state.ih" void (State::*State::s_state[][nStates])() { // Tokens: // ALL_DONE (unused): { 0, 0, 0, 0, 0, 0 }, // SPACE: { // current state: &State::nc<&State::nop>, // START &State::ws, // CONTENT &State::nc<&State::nop>, // WS &State::nc<&State::nop>, // NL0 &State::nc<&State::nop>, // NL1 &State::nc<&State::nop> // NLn }, // TEXT: { // current state: &State::text, // START -> CONTENT &State::text, // CONTENT &State::spaceText, // WS -> CONTENT &State::lineNrText, // NL0 -> CONTENT &State::nlText, // NL1 -> CONTENT &State::nlLineNrText, // NLn -> CONTEXT }, // NL: { // current state: &State::nl0, // START -> NL0 &State::nl1, // CONTENT -> NL1 &State::nl1, // WS -> NL1 &State::nc<&State::nop>, // NL0 &State::nlN, // NL1 -> NLn &State::nc<&State::nop>, // NLn }, // NEXT: { // current state: &State::filename, // START &State::nc<&State::err>, // CONTENT &State::nlFilename, // WS -> START &State::filename, // NL0 -> START &State::nlFilename, // NL1 -> START &State::nlFilename, // NLn -> START }, // AT_EOF: { // current state: &State::hashLine, // START &State::nlHashLine, // CONTENT -> START &State::nlHashLine, // WS -> START &State::hashLine, // NL0 -> START &State::nlHashLine, // NL1 -> START &State::nlHashLine, // NLn -> START }, }; char const *State::s_stateName[] = { "START", "CONTENT", "WS", "NL0", "NL1", "NLn", }; icmake-10.03.00/pp/state/nlhashline.cc0000644000175000017500000000024214204126313016335 0ustar frankfrank//#define XERR #include "state.ih" void State::nlHashLine() { if (not d_scanner.active()) return; d_scanner.write('\n'); writeHashLine(); } icmake-10.03.00/pp/state/nl1.cc0000644000175000017500000000011514204126313014701 0ustar frankfrank//#define XERR #include "state.ih" void State::nl1() { d_state = NL1; } icmake-10.03.00/pp/state/state.ih0000644000175000017500000000017314204126313015346 0ustar frankfrank#include "state.h" #include "../../xerr/xerr.ih" #include using namespace std; using namespace FBB; icmake-10.03.00/pp/state/spacetext.cc0000644000175000017500000000022714204126313016213 0ustar frankfrank//#define XERR #include "state.ih" void State::spaceText() { if (not d_scanner.active()) return; d_scanner.write(' '); text(); } icmake-10.03.00/pp/state/run.cc0000644000175000017500000000102514204126313015014 0ustar frankfrank//#define XERR #include "state.ih" int State::run() { int token; d_scanner.writeFilename(); while (true) { token = d_scanner.lex(); xerr("token = " << d_scanner.tokenName(token) << \ ", state = " << s_stateName[d_state]); if (token == Scanner::ALL_DONE) return d_scanner.nErrors(); (this->*s_state[token][d_state])(); // see data.cc, d_state may be // altered by the member functions } } icmake-10.03.00/pp/state/hashline.cc0000644000175000017500000000016414204126313016006 0ustar frankfrank//#define XERR #include "state.ih" void State::hashLine() { if (d_scanner.active()) writeHashLine(); } icmake-10.03.00/pp/state/linenrtext.cc0000644000175000017500000000017014204126313016404 0ustar frankfrank//#define XERR #include "state.ih" void State::lineNrText() { if (d_scanner.active()) writeLineNrText(); } icmake-10.03.00/pp/state/writelinenrtext.cc0000644000175000017500000000022014204126313017453 0ustar frankfrank//#define XERR #include "state.ih" void State::writeLineNrText() { d_scanner.write('#'); d_scanner.writeLineNr(); writeNLtext(); } icmake-10.03.00/pp/state/README0000644000175000017500000000575114204126313014573 0ustar frankfrank=: stay in the current state -: no action at all (= nop) START, CONTENT, WS, SPACE, - ->WS - initial blanks prepare for multiple spaces are ignored writing 1 become 1 space space TEXT, ->CONTENT = ->CONTENT write TEXT write TEXT write a space and write TEXT NL, ->NL0 ->NL1 ->NL1 initial newlines prepare for ignore the are ignored, but ending this trailing will be # line, maybe blanks marks at text using # NEXT, = err: ->START #>filename\n cannot happen \n#>filename\n remain in the as file switching there is content START state occurs at BOL so the line is terminated before writing the filename AT_EOF, = ->START ->START at the top line: write \n#\n write \n#\n merely write and continue with and continue with #\n to indicate the former file the former file a return to a previous file NL0: initial line(s) seen at the top of a file NL1: 1 \n seen in the CONTENT (or WS) state: just an EOLN NLn: > 1 \n seen in the CONTENT (or WS) state: may need # NL0, NL1, NLn, SPACE, - - - space chars at ignore spaces ignore spaces the top line at the begin at the begin are ignored of lines of lines TEXT, ->CONTENT ->CONTENT ->CONTENT \n#\n write \n and write \n#\n write TEXT TEXT and TEXT NL, - ->NLn - NEXT, ->START ->START ->START #>filename\n \n#>filename\n \n#>filename\n ignore the end the line end the multiple initial line(s) and continue with lines and continue and continue the next file with the next file with the next file AT_EOF, ->START ->START ->START write #\n write \n#\n write \n#\n and continue and continue and continue with the former with the former with the former file file file icmake-10.03.00/pp/state/ws.cc0000644000175000017500000000011314204126313014636 0ustar frankfrank//#define XERR #include "state.ih" void State::ws() { d_state = WS; } icmake-10.03.00/pp/state/nltext.cc0000644000175000017500000000016014204126313015525 0ustar frankfrank//#define XERR #include "state.ih" void State::nlText() { if (d_scanner.active()) writeNLtext(); } icmake-10.03.00/pp/state/nl0.cc0000644000175000017500000000011514204126313014700 0ustar frankfrank//#define XERR #include "state.ih" void State::nl0() { d_state = NL0; } icmake-10.03.00/pp/state/filename.cc0000644000175000017500000000017614204126313015776 0ustar frankfrank//#define XERR #include "state.ih" void State::filename() { if (d_scanner.active()) d_scanner.writeFilename(); } icmake-10.03.00/pp/state/nop.cc0000644000175000017500000000007714204126313015012 0ustar frankfrank//#define XERR #include "state.ih" void State::nop() const {} icmake-10.03.00/pp/state/nlfilename.cc0000644000175000017500000000030214204126313016317 0ustar frankfrank//#define XERR #include "state.ih" void State::nlFilename() { if (not d_scanner.active()) return; d_scanner.write('\n'); d_scanner.writeFilename(); d_state = START; } icmake-10.03.00/pp/state/err.cc0000644000175000017500000000020514204126313014777 0ustar frankfrank//#define XERR #include "state.ih" void State::err() const { throw Exception{} << "internal error: reset request not at BOL"; } icmake-10.03.00/pp/state/writenltext.cc0000644000175000017500000000015114204126313016600 0ustar frankfrank//#define XERR #include "state.ih" void State::writeNLtext() { d_scanner.write('\n'); text(); } icmake-10.03.00/pp/state/text2content.cc0000644000175000017500000000016014204126313016650 0ustar frankfrank//#define XERR #include "state.ih" void State::text2content() { d_scanner.text(); d_state = CONTENT; } icmake-10.03.00/pp/state/frame0000644000175000017500000000006014204126313014714 0ustar frankfrank//#define XERR #include "state.ih" State:: { } icmake-10.03.00/pp/state/writehashline.cc0000644000175000017500000000016514204126313017062 0ustar frankfrank//#define XERR #include "state.ih" void State::writeHashLine() { d_scanner.write("#\n"); d_state = START; } icmake-10.03.00/pp/symtab/0000755000175000017500000000000014204243436014070 5ustar frankfrankicmake-10.03.00/pp/symtab/symtab.ih0000644000175000017500000000011314204126313015676 0ustar frankfrank#include "symtab.h" #include "../../xerr/xerr.ih" using namespace std; icmake-10.03.00/pp/symtab/contains.f0000644000175000017500000000014214204126313016044 0ustar frankfrankinline bool Symtab::contains(std::string const &ident) const { return find(ident) != end(); } icmake-10.03.00/pp/symtab/symtab.h0000644000175000017500000000071614204126313015536 0ustar frankfrank#ifndef INCLUDED_SYMTAB_ #define INCLUDED_SYMTAB_ #include #include class Symtab: private std::unordered_map { typedef std::unordered_map Map; public: bool contains(std::string const &ident) const; void remove(std::string const &ident); using Map::operator[]; using Map::find; using Map::end; }; #include "contains.f" #endif icmake-10.03.00/pp/symtab/frame0000644000175000017500000000006214204126313015075 0ustar frankfrank//#define XERR #include "symtab.ih" Symtab:: { } icmake-10.03.00/pp/symtab/remove.cc0000644000175000017500000000022714204126313015667 0ustar frankfrank//#define XERR #include "symtab.ih" void Symtab::remove(string const &ident) { if (auto iter = find(ident); iter != end()) erase(iter); } icmake-10.03.00/pp/icm_bootstrap0000755000175000017500000000022614204126313015356 0ustar frankfrank#!/bin/bash . ../bootstrap/flags . ../bootstrap/functions echo Creating tmp${LIBDIR}/icm-pp subdirs maindir ${LIBDIR}/icm-pp -s rm -f */*.gch *.o icmake-10.03.00/pp/usage.cc0000644000175000017500000000117614204126313014203 0ustar frankfrank#include "main.ih" namespace { char const info[] = R"_(" [options] input output Where: [options] - optional arguments (short options between parentheses): --define=SYM (-d) - defines preprocessor symbol SYM having value "1" --help (-h) - provide this help --version (-v) - show version information and terminate input - icmake script source file output - preprocessed icmake script (ready to be passed to icm-comp) )_"; } void usage(std::string const &progname) { Tools::usageTop(progname) << info; } icmake-10.03.00/pp/README0000644000175000017500000000036514204126313013447 0ustar frankfrankThe scanner reads the input files. See scanner/lexer for details. The #if(n)def directives may change the scanner's d_active value from true to false (and vv). It is used by Out to decide whether or not to insert information into the out-file. icmake-10.03.00/pp/scanner/0000755000175000017500000000000014204243436014222 5ustar frankfrankicmake-10.03.00/pp/scanner/text.cc0000644000175000017500000000012714204126313015507 0ustar frankfrank//#define XERR #include "scanner.ih" void Scanner::text() { out() << matched(); } icmake-10.03.00/pp/scanner/lexer.output0000644000175000017500000005653214204126313016630 0ustar frankfrankRANGES: Nsubsets: 40 0: 0 - 8 1: 9 2: 10 3: 11 - 31 4: 32(' ') 5: 33('!') 6: 34('"') 7: 35('#') 8: 36('$') - 41(')') 9: 42('*') 10: 43('+') - 46('.') 11: 47('/') 12: 48('0') - 57('9') 13: 58(':') - 59(';') 14: 60('<') 15: 61('=') - 64('@') 16: 65('A') - 90('Z') 17: 91('[') 18: 92('\') 19: 93(']') - 94('^') 20: 95('_') 21: 96('`') 22: 97('a') - 98('b') 23: 99('c') 24: 100('d') 25: 101('e') 26: 102('f') 27: 103('g') - 104('h') 28: 105('i') 29: 106('j') - 107('k') 30: 108('l') 31: 109('m') 32: 110('n') 33: 111('o') - 114('r') 34: 115('s') 35: 116('t') 36: 117('u') 37: 118('v') - 122('z') 38: 123('{') - 255 EOF: 39 RULES: Rules active for `INITIAL': 0, 1, 2, 6, 7, 13, 14, 15, 16, 17, 18, 19, 20, 24, 25, 26, 27, 28, Rules active for `string': 8, 9, 10, 11, 12, Rules active for `comment': 3, 4, 5, Rules active for `directive': 21, 22, 23, rule 0 (lexer 17). Startstate 1 rule 1 (lexer 20). Startstate 10 rule 2 (lexer 23). Startstate 20 rule 3 (lexer 29). Startstate 22 rule 4 (lexer 30). Startstate 29 rule 5 (lexer 31). Startstate 32 rule 6 (lexer 34). Startstate 34 rule 7 (lexer 36). Startstate 36 rule 8 (lexer 39). Startstate 40 rule 9 (lexer 41). Startstate 43 rule 10 (lexer 43). Startstate 45 rule 11 (lexer 44). Startstate 48 rule 12 (lexer 46). Startstate 50 rule 13 (lexer 49). Startstate 53 rule 14 (lexer 50). Startstate 74 rule 15 (lexer 51). Startstate 79 rule 16 (lexer 52). Startstate 89 rule 17 (lexer 53). Startstate 116 rule 18 (lexer 54). Startstate 138 rule 19 (lexer 55). Startstate 154 rule 20 (lexer 57). Startstate 176 rule 21 (lexer 60). Startstate 185 rule 22 (lexer 62). Startstate 188 rule 23 (lexer 64). Startstate 190 rule 24 (lexer 68). Startstate 193 rule 25 (lexer 69). Startstate 200 rule 26 (lexer 71). Startstate 202 rule 27 (lexer 73). Startstate 206 rule 28 (lexer 75). Startstate 213 STATES: E: EMPTY, F: FINAL, S: SET, : range NR TYPE F N1 N2 [range-indices] --------------------------------------------------- 1: E -> 2, 0 2: E -> 3, 6 3: S -> 4, 0 [ 1 4 ] 4: E -> 3, 6 5: S -> 9, 0 [ 0 1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 ] 6: 7 -> 7, 0 7: 5 -> 8, 0 8: E -> 5, 11 9: E -> 5, 11 10: E -> 12, 0 11: F -> 0, 0 12: E -> 13, 16 13: S -> 14, 0 [ 1 4 ] 14: E -> 13, 16 15: S -> 19, 0 [ 1 4 ] 16: 11 -> 17, 0 17: 9 -> 18, 0 18: F -> 0, 0 19: E -> 15, 21 20: E -> 15, 21 21: 11 -> 23, 0 22: 9 -> 25, 0 23: 9 -> 24, 0 24: F -> 0, 0 25: 11 -> 26, 0 26: E -> 27, 30 27: S -> 28, 0 [ 1 4 ] 28: E -> 27, 30 29: S -> 31, 0 [ 0 1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 ] 30: F -> 0, 0 31: F -> 0, 0 32: 2 -> 33, 0 33: F -> 0, 0 34: 6 -> 35, 0 35: F -> 0, 0 36: S -> 37, 0 [ 16 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 ] 37: E -> 38, 41 38: S -> 39, 0 [ 12 16 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 ] 39: E -> 38, 41 40: 6 -> 42, 0 41: F -> 0, 0 42: F -> 0, 0 43: 18 -> 44, 0 44: S -> 46, 0 [ 0 1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 ] 45: S -> 47, 0 [ 0 1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 ] 46: F -> 0, 0 47: F -> 0, 0 48: 18 -> 49, 0 49: 2 -> 51, 0 50: 2 -> 52, 0 51: F -> 0, 0 52: F -> 0, 0 53: E -> 54, 0 54: E -> 55, 58 55: S -> 56, 0 [ 1 4 ] 56: E -> 55, 58 57: S -> 66, 0 [ 1 4 ] 58: 7 -> 59, 0 59: 24 -> 60, 0 60: 25 -> 61, 0 61: 26 -> 62, 0 62: 28 -> 63, 0 63: 32 -> 64, 0 64: 25 -> 65, 0 65: E -> 57, 0 66: E -> 57, 68 67: S -> 72, 0 [ 1 4 ] 68: S -> 69, 0 [ 16 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 ] 69: E -> 70, 73 70: S -> 71, 0 [ 12 16 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 ] 71: E -> 70, 73 72: E -> 67, 75 73: E -> 67, 75 74: E -> 76, 0 75: F -> 0, 0 76: E -> 77, 80 77: S -> 78, 0 [ 1 4 ] 78: E -> 77, 80 79: E -> 86, 0 80: 7 -> 81, 0 81: 25 -> 82, 0 82: 30 -> 83, 0 83: 34 -> 84, 0 84: 25 -> 85, 0 85: F -> 0, 0 86: E -> 87, 90 87: S -> 88, 0 [ 1 4 ] 88: E -> 87, 90 89: E -> 97, 0 90: 7 -> 91, 0 91: 25 -> 92, 0 92: 32 -> 93, 0 93: 24 -> 94, 0 94: 28 -> 95, 0 95: 26 -> 96, 0 96: F -> 0, 0 97: E -> 98, 101 98: S -> 99, 0 [ 1 4 ] 99: E -> 98, 101 100: S -> 108, 0 [ 1 4 ] 101: 7 -> 102, 0 102: 28 -> 103, 0 103: 26 -> 104, 0 104: 24 -> 105, 0 105: 25 -> 106, 0 106: 26 -> 107, 0 107: E -> 100, 0 108: E -> 100, 110 109: S -> 114, 0 [ 1 4 ] 110: S -> 111, 0 [ 16 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 ] 111: E -> 112, 115 112: S -> 113, 0 [ 12 16 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 ] 113: E -> 112, 115 114: E -> 109, 117 115: E -> 109, 117 116: E -> 118, 0 117: F -> 0, 0 118: E -> 119, 122 119: S -> 120, 0 [ 1 4 ] 120: E -> 119, 122 121: S -> 130, 0 [ 1 4 ] 122: 7 -> 123, 0 123: 28 -> 124, 0 124: 26 -> 125, 0 125: 32 -> 126, 0 126: 24 -> 127, 0 127: 25 -> 128, 0 128: 26 -> 129, 0 129: E -> 121, 0 130: E -> 121, 132 131: S -> 136, 0 [ 1 4 ] 132: S -> 133, 0 [ 16 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 ] 133: E -> 134, 137 134: S -> 135, 0 [ 12 16 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 ] 135: E -> 134, 137 136: E -> 131, 139 137: E -> 131, 139 138: E -> 140, 0 139: F -> 0, 0 140: E -> 141, 144 141: S -> 142, 0 [ 1 4 ] 142: E -> 141, 144 143: S -> 153, 0 [ 1 4 ] 144: 7 -> 145, 0 145: 28 -> 146, 0 146: 32 -> 147, 0 147: 23 -> 148, 0 148: 30 -> 149, 0 149: 36 -> 150, 0 150: 24 -> 151, 0 151: 25 -> 152, 0 152: E -> 143, 0 153: E -> 143, 155 154: E -> 157, 0 155: S -> 156, 0 [ 6 14 ] 156: F -> 0, 0 157: E -> 158, 161 158: S -> 159, 0 [ 1 4 ] 159: E -> 158, 161 160: S -> 168, 0 [ 1 4 ] 161: 7 -> 162, 0 162: 36 -> 163, 0 163: 32 -> 164, 0 164: 24 -> 165, 0 165: 25 -> 166, 0 166: 26 -> 167, 0 167: E -> 160, 0 168: E -> 160, 170 169: S -> 174, 0 [ 1 4 ] 170: S -> 171, 0 [ 16 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 ] 171: E -> 172, 175 172: S -> 173, 0 [ 12 16 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 ] 173: E -> 172, 175 174: E -> 169, 177 175: E -> 169, 177 176: E -> 178, 0 177: F -> 0, 0 178: E -> 179, 182 179: S -> 180, 0 [ 1 4 ] 180: E -> 179, 182 181: S -> 184, 0 [ 0 3 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 ] 182: 7 -> 183, 0 183: E -> 181, 186 184: E -> 181, 186 185: S -> 187, 0 [ 0 1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 ] 186: F -> 0, 0 187: F -> 0, 0 188: 18 -> 189, 0 189: 2 -> 191, 0 190: 2 -> 192, 0 191: F -> 0, 0 192: F -> 0, 0 193: E -> 194, 0 194: E -> 195, 0 195: S -> 196, 0 [ 1 4 ] 196: E -> 195, 198 197: S -> 199, 0 [ 1 4 ] 198: F -> 0, 0 199: E -> 197, 201 200: E -> 197, 0 201: F -> 0, 0 202: S -> 203, 0 [ 0 1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 ] 203: F -> 0, 0 204: S -> 205, 0 [ 1 4 ] 205: E -> 204, 207 206: E -> 204, 207 207: E -> 208, 214 208: 11 -> 209, 0 209: 11 -> 210, 0 210: E -> 211, 214 211: S -> 212, 0 [ 0 1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 ] 212: E -> 211, 214 213: 39 -> 216, 0 214: 2 -> 215, 0 215: F -> 0, 0 216: F -> 0, 0 DFA for INITIAL ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 F -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 0 1 2 3 1 2 1 4 5 1 1 1 6 1 1 1 1 7 1 1 1 7 1 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 1 8 1 26 2 2 3 2 9 10 25,24 3 27 4 6 5 11 11 12 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 13 14 11 11 15 11 11 11 11 11 11 11 16 11 11 26,20 6 17 18 26 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 8 28 9 11 11 12 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 13 14 11 11 15 11 11 11 11 11 11 11 16 11 11 20 10 17 18 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 20 12 12 19 12 19 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 0 13 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 20 11 11 11 11 11 11 11 11 11 11 11 11 11 20 14 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 21 11 22 11 11 11 11 11 11 20 15 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 23 11 11 11 11 11 24 11 11 11 11 11 11 20 16 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 25 11 11 11 11 11 11 20 17 2,1 18 18 18 3 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 0 20 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 26 11 11 11 11 11 11 11 11 11 11 11 11 20 21 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 27 11 11 11 11 20 22 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 28 11 11 11 11 11 11 11 11 11 11 11 11 11 11 20 23 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 29 11 11 11 11 11 11 11 30 11 11 11 11 11 11 20 24 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 31 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 20 25 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 32 11 11 11 11 11 11 11 11 11 11 11 11 11 11 20 26 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 33 11 11 11 11 11 11 11 11 11 11 20 27 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 34 11 11 11 11 11 11 11 11 11 11 11 11 11 20 28 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 35 11 11 11 11 11 11 11 11 11 11 20 29 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 36 11 11 11 11 11 11 11 11 11 11 11 11 11 20 30 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 37 11 11 11 11 11 11 11 11 11 11 11 11 11 11 20 31 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 38 11 11 11 11 11 11 11 11 20 32 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 39 11 11 11 11 11 11 11 11 11 11 11 11 11 20 33 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 40 11 11 11 11 11 11 20 34 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 14 35 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 41 11 11 11 11 11 11 11 11 11 11 11 11 20 36 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 42 11 11 11 11 11 11 11 11 11 11 11 11 20 37 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 43 11 11 11 11 11 11 11 11 11 11 11 11 11 20 38 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 44 11 11 20 39 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 45 11 11 11 11 11 11 11 11 11 11 11 11 20 40 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 46 11 11 11 11 11 11 11 11 11 11 11 11 11 20 41 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 15 42 11 47 11 47 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 20 43 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 48 11 11 11 11 11 11 11 11 11 11 11 11 20 44 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 49 11 11 11 11 11 11 11 11 11 11 11 11 11 11 20 45 11 50 11 50 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 20 46 11 51 11 51 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 20 47 47 47 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 48 11 53 11 53 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 20 49 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 54 11 11 11 11 11 11 11 11 11 11 11 11 11 20 50 50 50 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 51 51 51 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 52 57 57 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 16 53 53 53 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 54 11 59 11 59 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 20 55 60 60 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 19 56 61 61 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 13 57 57 57 16 58 62 62 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 17 59 59 59 63 63 60 60 60 19 61 61 61 13 62 62 62 17 63 18 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- DFA for string --------------------------------------------------------------------------------------------------------------------------------------------------------------- 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 F ---------------------------------------------------------------------------------------------------------------------------------------------------------- 0 1 1 2 1 1 1 3 1 1 1 1 1 1 1 1 1 1 1 4 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 10 2 12 3 8 4 5 5 6 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 10 5 9 6 11 --------------------------------------------------------------------------------------------------------------------------------------------------------------- DFA for comment -------------------------------------------------------------------------------------------------------------------------------------------------------------- 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 F --------------------------------------------------------------------------------------------------------------------------------------------------------- 0 1 1 2 1 1 1 1 1 1 3 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 4 2 5 3 4 4 4 4 4 3 -------------------------------------------------------------------------------------------------------------------------------------------------------------- DFA for directive --------------------------------------------------------------------------------------------------------------------------------------------------------------- 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 F ---------------------------------------------------------------------------------------------------------------------------------------------------------- 0 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 21 2 23 3 4 21 4 22 --------------------------------------------------------------------------------------------------------------------------------------------------------------- icmake-10.03.00/pp/scanner/tokenname.f0000644000175000017500000000013214204126313016340 0ustar frankfrankinline char const *Scanner::tokenName(int token) const { return s_tokenName[token]; } icmake-10.03.00/pp/scanner/identcharat.cc0000644000175000017500000000056514204126313017017 0ustar frankfrank//#define XERR #include "scanner.ih" bool Scanner::identCharAt(int pos) const { return (pos == -1 or static_cast(pos) == d_defineBuffer.length()) ? // no ident char if at false // the buffer's ends : isalnum(d_defineBuffer[pos]) or d_defineBuffer[pos] == '_'; } icmake-10.03.00/pp/scanner/lex.cc0000644000175000017500000007432114204126313015322 0ustar frankfrank// Generated by Flexc++ V2.07.07 on Wed, 12 Feb 2020 16:19:50 +0100 #include #include #include #include // $insert class_ih #include "scanner.ih" // s_ranges_: use (unsigned) characters as index to obtain // that character's range-number. // The range for EOF is defined in a constant in the // class header file size_t const ScannerBase::s_ranges_[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 5, 6, 7, 8, 8, 8, 8, 8, 8, 9,10,10,10,10,11,12,12, 12,12,12,12,12,12,12,12,13,13,14,15,16,17,17,18,18,18,18,18,18,18,18,18,18, 18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,19,20,21,21,22,23,24,24,25, 26,27,28,29,29,30,31,31,32,33,34,35,35,35,35,36,37,38,39,39,39,39,39,40,40, 40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40, 40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40, 40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40, 40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40, 40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40, 40,40,40,40,40,40, }; // $insert startcondinfo // s_dfa_ contains the rows of *all* DFAs ordered by start state. The // enum class StartCondition_is defined in the baseclass header. // StartCondition_::INITIAL is always 0. Each entry defines the row to // transit to if the column's character range was sensed. Row numbers are // relative to the used DFA, and d_dfaBase_ is set to the first row of // the subset to use. The row's final two values are respectively the // rule that may be matched at this state, and the rule's FINAL flag. If // the final value equals FINAL (= 1) then, if there's no continuation, // the rule is matched. If the BOL flag (8) is also set (so FINAL + BOL (= // 9) is set) then the rule only matches when d_atBOL is also true. int const ScannerBase::s_dfa_[][44] = { // INITIAL { 1, 2, 3, 1, 2, 1, 4, 5, 1, 1, 1, 6, 1, 1, 1, 1, 1, 1, 7, 1, 1, 1, 7, 1, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 1, 8, -1, -1}, // 0 {-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,-1,-1,-1,-1,-1, -1,-1, 29, -1}, // 1 {-1, 2,-1,-1, 2,-1,-1, 9,-1,-1,-1,10,-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,-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,-1,-1, -1,-1, 3, -1}, // 3 {-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,-1,-1,-1,-1,-1, -1,-1, 8, -1}, // 4 {11,-1,-1,11,-1,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,11,11,11,11,11,13,14,11,11,15,11,11,11,11,11,11,11,16,11, 11,-1, 29, 20}, // 5 {-1,-1,-1,-1,-1,-1,-1,-1,-1,17,-1,18,-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, 29, -1}, // 6 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 7,-1,-1,-1,-1,-1, 7,-1, -1,-1, 7,-1, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, -1,-1, 14, -1}, // 7 {-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,-1,-1,-1,-1,-1, -1,-1, 30, -1}, // 8 {11,-1,-1,11,-1,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,11,11,11,11,11,13,14,11,11,15,11,11,11,11,11,11,11,16,11, 11,-1, -1, 20}, // 9 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,18,-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}, // 10 {11,-1,-1,11,-1,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,-1, -1, 20}, // 11 {12,19,-1,12,19,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, 12,-1, -1, 0}, // 12 {11,-1,-1,11,-1,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,20,11,11,11,11,11,11,11,11,11,11,11,11, 11,-1, -1, 20}, // 13 {11,-1,-1,11,-1,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,11,11,11,11,11,21,11,22,11,11,11,11,11, 11,-1, -1, 20}, // 14 {11,-1,-1,11,-1,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,11,23,11,11,11,11,11,24,11,11,11,11,11, 11,-1, -1, 20}, // 15 {11,-1,-1,11,-1,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,11,11,11,11,11,11,11,25,11,11,11,11,11, 11,-1, -1, 20}, // 16 {-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,-1,-1,-1,-1,-1, -1,-1, 4, -1}, // 17 {18,18,-1,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18, 18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18,18, 18,-1, 2, -1}, // 18 {19,19,-1,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19, 19,-1, -1, 0}, // 19 {11,-1,-1,11,-1,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,11,26,11,11,11,11,11,11,11,11,11,11,11, 11,-1, -1, 20}, // 20 {11,-1,-1,11,-1,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,27,11,11,11, 11,-1, -1, 20}, // 21 {11,-1,-1,11,-1,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,11,11,11,11,11,28,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,-1, -1, 20}, // 22 {11,-1,-1,11,-1,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,11,11,11,11,11,29,11,11,11,11,11,11,11,30,11,11,11,11,11, 11,-1, -1, 20}, // 23 {11,-1,-1,11,-1,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,11,11,11,11,31,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,-1, -1, 20}, // 24 {11,-1,-1,11,-1,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,11,11,11,11,11,32,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,-1, -1, 20}, // 25 {11,-1,-1,11,-1,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,11,11,11,33,11,11,11,11,11,11,11,11,11, 11,-1, -1, 20}, // 26 {11,-1,-1,11,-1,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,34,11,11,11,11,11,11,11,11,11,11,11,11, 11,-1, -1, 20}, // 27 {11,-1,-1,11,-1,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,11,11,11,35,11,11,11,11,11,11,11,11,11, 11,-1, -1, 20}, // 28 {11,-1,-1,11,-1,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,36,11,11,11,11,11,11,11,11,11,11,11,11, 11,-1, -1, 20}, // 29 {11,-1,-1,11,-1,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,11,11,11,11,11,37,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,-1, -1, 20}, // 30 {11,-1,-1,11,-1,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,11,11,11,11,11,38,11,11,11,11,11,11,11, 11,-1, -1, 20}, // 31 {11,-1,-1,11,-1,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,39,11,11,11,11,11,11,11,11,11,11,11,11, 11,-1, -1, 20}, // 32 {11,-1,-1,11,-1,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,11,11,11,11,11,11,11,40,11,11,11,11,11, 11,-1, -1, 20}, // 33 {11,-1,-1,11,-1,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,-1, -1, 18}, // 34 {11,-1,-1,11,-1,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,11,41,11,11,11,11,11,11,11,11,11,11,11, 11,-1, -1, 20}, // 35 {11,-1,-1,11,-1,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,11,42,11,11,11,11,11,11,11,11,11,11,11, 11,-1, -1, 20}, // 36 {11,-1,-1,11,-1,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,43,11,11,11,11,11,11,11,11,11,11,11,11, 11,-1, -1, 20}, // 37 {11,-1,-1,11,-1,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,44,11, 11,-1, -1, 20}, // 38 {11,-1,-1,11,-1,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,11,45,11,11,11,11,11,11,11,11,11,11,11, 11,-1, -1, 20}, // 39 {11,-1,-1,11,-1,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,46,11,11,11,11,11,11,11,11,11,11,11,11, 11,-1, -1, 20}, // 40 {11,-1,-1,11,-1,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,-1, -1, 19}, // 41 {11,47,-1,11,47,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,-1, -1, 20}, // 42 {11,-1,-1,11,-1,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,11,48,11,11,11,11,11,11,11,11,11,11,11, 11,-1, -1, 20}, // 43 {11,-1,-1,11,-1,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,11,11,11,11,11,49,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,-1, -1, 20}, // 44 {11,50,-1,11,50,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,-1, -1, 20}, // 45 {11,51,-1,11,51,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,-1, -1, 20}, // 46 {-1,47,-1,-1,47,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,52,-1, -1,-1,52,-1,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52, -1,-1, -1, -1}, // 47 {11,53,-1,11,53,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,-1, -1, 20}, // 48 {11,-1,-1,11,-1,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,54,11,11,11,11,11,11,11,11,11,11,11,11, 11,-1, -1, 20}, // 49 {-1,50,-1,-1,50,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,55,-1, -1,-1,55,-1,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55, -1,-1, -1, -1}, // 50 {-1,51,-1,-1,51,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,56,-1, -1,-1,56,-1,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56, -1,-1, -1, -1}, // 51 {-1,57,-1,-1,57,-1,-1,-1,-1,-1,-1,-1,52,-1,-1,-1,-1,-1,52,-1, -1,-1,52,-1,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52, -1,-1, -1, 15}, // 52 {-1,53,-1,-1,53,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,58,-1, -1,-1,58,-1,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58, -1,-1, -1, -1}, // 53 {11,59,-1,11,59,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 11,-1, -1, 20}, // 54 {-1,60,-1,-1,60,-1,-1,-1,-1,-1,-1,-1,55,-1,-1,-1,-1,-1,55,-1, -1,-1,55,-1,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55,55, -1,-1, -1, 17}, // 55 {-1,61,-1,-1,61,-1,-1,-1,-1,-1,-1,-1,56,-1,-1,-1,-1,-1,56,-1, -1,-1,56,-1,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56, -1,-1, -1, 23}, // 56 {-1,57,-1,-1,57,-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, -1,-1, -1, 15}, // 57 {-1,62,-1,-1,62,-1,-1,-1,-1,-1,-1,-1,58,-1,-1,-1,-1,-1,58,-1, -1,-1,58,-1,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58,58, -1,-1, -1, 16}, // 58 {-1,59,-1,-1,59,-1,63,-1,-1,-1,-1,-1,-1,-1,64,-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}, // 59 {-1,60,-1,-1,60,-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, -1,-1, -1, 17}, // 60 {-1,61,-1,-1,61,-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, -1,-1, -1, 23}, // 61 {-1,62,-1,-1,62,-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, -1,-1, -1, 16}, // 62 {65,65,-1,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65, 65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65, 65,-1, -1, -1}, // 63 {66,66,-1,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66, 66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66, 66,-1, -1, -1}, // 64 {65,65,-1,65,65,65,67,65,65,65,65,65,65,65,65,65,65,65,65,65, 65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65, 65,-1, -1, -1}, // 65 {66,66,-1,66,66,66,66,66,66,66,66,66,66,66,66,66,68,66,66,66, 66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66, 66,-1, -1, -1}, // 66 {65,65,-1,65,65,65,67,65,65,65,65,65,65,65,65,65,65,65,65,65, 65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65,65, 65,-1, -1, 21}, // 67 {66,66,-1,66,66,66,66,66,66,66,66,66,66,66,66,66,68,66,66,66, 66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66, 66,-1, -1, 22}, // 68 // string { 1, 1, 2, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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}, // 0 {-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,-1,-1,-1,-1,-1, -1,-1, 11, -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,-1,-1,-1,-1,-1,-1,-1, -1,-1, 13, -1}, // 2 {-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,-1,-1,-1,-1,-1, -1,-1, 9, -1}, // 3 { 5, 5, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,-1, 11, -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,-1,-1,-1,-1,-1, -1,-1, 10, -1}, // 5 {-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,-1,-1,-1,-1,-1, -1,-1, 12, -1}, // 6 // comment { 1, 1, 2, 1, 1, 1, 1, 1, 1, 3, 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}, // 0 {-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,-1,-1,-1,-1,-1, -1,-1, 6, -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,-1,-1,-1,-1,-1,-1,-1, -1,-1, 7, -1}, // 2 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-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, 6, -1}, // 3 {-1, 4,-1,-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, -1,-1, 5, -1}, // 4 // define { 1, 2, 3, 1, 2, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,-1, -1, -1}, // 0 {-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,-1,-1,-1,-1,-1, -1,-1, 26, -1}, // 1 {-1, 6,-1,-1, 6,-1,-1,-1,-1,-1,-1, 7,-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, 26, -1}, // 2 {-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,-1,-1,-1,-1,-1, -1,-1, 28, -1}, // 3 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 8,-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, 26, -1}, // 4 { 9, 9,10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,-1, 26, -1}, // 5 {-1, 6,-1,-1, 6,-1,-1,-1,-1,-1,-1, 7,-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}, // 6 {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 8,-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}, // 7 { 8, 8,-1, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,-1, 27, -1}, // 8 {-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,-1,-1,-1,-1,-1, -1,-1, 25, -1}, // 9 {-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,-1,-1,-1,-1,-1, -1,-1, 24, -1}, // 10 }; int const (*ScannerBase::s_dfaBase_[])[44] = { s_dfa_ + 0, s_dfa_ + 69, s_dfa_ + 76, s_dfa_ + 81, }; size_t ScannerBase::s_istreamNr = 0; // $insert inputImplementation ScannerBase::Input::Input() : d_in(0), d_lineNr(1) {} ScannerBase::Input::Input(std::istream *iStream, size_t lineNr) : d_in(iStream), d_lineNr(lineNr) {} size_t ScannerBase::Input::get() { switch (size_t ch = next()) // get the next input char { case '\n': ++d_lineNr; [[fallthrough]]; default: return ch; } } size_t ScannerBase::Input::next() { size_t ch; if (d_deque.empty()) // deque empty: next char fm d_in { if (d_in == 0) return AT_EOF; ch = d_in->get(); return *d_in ? ch : static_cast(AT_EOF); } ch = d_deque.front(); d_deque.pop_front(); return ch; } void ScannerBase::Input::reRead(size_t ch) { if (ch < 0x100) { if (ch == '\n') --d_lineNr; d_deque.push_front(ch); } } void ScannerBase::Input::reRead(std::string const &str, size_t fm) { for (size_t idx = str.size(); idx-- > fm; ) reRead(str[idx]); } ScannerBase::ScannerBase(std::istream &in, std::ostream &out) : d_filename("-"), d_out(new std::ostream(out.rdbuf())), // $insert interactiveInit d_in(0), d_input(new std::istream(in.rdbuf())), d_dfaBase_(s_dfa_) {} void ScannerBase::switchStream_(std::istream &in, size_t lineNr) { d_input.close(); d_input = Input(new std::istream(in.rdbuf()), lineNr); } ScannerBase::ScannerBase(std::string const &infilename, std::string const &outfilename) : d_filename(infilename), d_out(outfilename == "-" ? new std::ostream(std::cout.rdbuf()) : outfilename == "" ? new std::ostream(std::cerr.rdbuf()) : new std::ofstream(outfilename)), d_input(new std::ifstream(infilename)), d_dfaBase_(s_dfa_) {} void ScannerBase::switchStreams(std::istream &in, std::ostream &out) { switchStream_(in, 1); switchOstream(out); } void ScannerBase::switchOstream(std::ostream &out) { *d_out << std::flush; d_out.reset(new std::ostream(out.rdbuf())); } // $insert debugFunctions void ScannerBase::setDebug(bool onOff) {} bool ScannerBase::debug() const { return false; } void ScannerBase::redo(size_t nChars) { size_t from = nChars >= length() ? 0 : length() - nChars; d_input.reRead(d_matched, from); d_matched.resize(from); } void ScannerBase::switchOstream(std::string const &outfilename) { *d_out << std::flush; d_out.reset( outfilename == "-" ? new std::ostream(std::cout.rdbuf()) : outfilename == "" ? new std::ostream(std::cerr.rdbuf()) : new std::ofstream(outfilename)); } void ScannerBase::switchIstream(std::string const &infilename) { d_input.close(); d_filename = infilename; d_input = Input(new std::ifstream(infilename)); d_atBOL = true; } void ScannerBase::switchStreams(std::string const &infilename, std::string const &outfilename) { switchOstream(outfilename); switchIstream(infilename); } void ScannerBase::pushStream(std::istream &istr) { std::istream *streamPtr = new std::istream(istr.rdbuf()); p_pushStream("(istream)", streamPtr); } void ScannerBase::pushStream(std::string const &name) { std::istream *streamPtr = new std::ifstream(name); if (!*streamPtr) { delete streamPtr; throw std::runtime_error("Cannot read " + name); } p_pushStream(name, streamPtr); } void ScannerBase::p_pushStream(std::string const &name, std::istream *streamPtr) { if (d_streamStack.size() == s_maxSizeofStreamStack_) { delete streamPtr; throw std::length_error("Max stream stack size exceeded"); } d_streamStack.push_back(StreamStruct{d_filename, d_input}); d_filename = name; d_input = Input(streamPtr); d_atBOL = true; } bool ScannerBase::popStream() { d_input.close(); if (d_streamStack.empty()) return false; StreamStruct &top = d_streamStack.back(); d_input = top.pushedInput; d_filename = top.pushedName; d_streamStack.pop_back(); return true; } // See the manual's section `Run-time operations' section for an explanation // of this member. ScannerBase::ActionType_ ScannerBase::actionType_(size_t range) { d_nextState = d_dfaBase_[d_state][range]; if (d_nextState != -1) // transition is possible return ActionType_::CONTINUE; if (knownFinalState()) // FINAL state reached return ActionType_::MATCH; if (d_matched.size()) return ActionType_::ECHO_FIRST; // no match, echo the 1st char return range != s_rangeOfEOF_ ? ActionType_::ECHO_CH : ActionType_::RETURN; } void ScannerBase::accept(size_t nChars) // old name: less { if (nChars < d_matched.size()) { d_input.reRead(d_matched, nChars); d_matched.resize(nChars); } } void ScannerBase::setMatchedSize(size_t length) { d_input.reRead(d_matched, length); // reread the tail section d_matched.resize(length); // return what's left } // At this point a rule has been matched. The next character is not part of // the matched rule and is sent back to the input. The final match length // is determined, the index of the matched rule is determined, and then // d_atBOL is updated. Finally the rule's index is returned. // The numbers behind the finalPtr assignments are explained in the // manual's `Run-time operations' section. size_t ScannerBase::matched_(size_t ch) { d_input.reRead(ch); FinalData *finalPtr; if (not d_atBOL) // not at BOL finalPtr = &d_final.std; // then use the std rule (3, 4) // at BOL else if (not available(d_final.std.rule)) // only a BOL rule avail. finalPtr = &d_final.bol; // use the BOL rule (6) else if (not available(d_final.bol.rule)) // only a std rule is avail. finalPtr = &d_final.std; // use the std rule (7) else if ( // Both are available (8) d_final.bol.length != // check lengths of matched texts d_final.std.length // unequal lengths, use the rule ) // having the longer match length finalPtr = d_final.bol.length > d_final.std.length ? &d_final.bol : &d_final.std; else // lengths are equal: use 1st rule finalPtr = d_final.bol.rule < d_final.std.rule ? &d_final.bol : &d_final.std; setMatchedSize(finalPtr->length); d_atBOL = d_matched.back() == '\n'; return finalPtr->rule; } size_t ScannerBase::getRange_(int ch) // using int to prevent casts { return ch == AT_EOF ? as(s_rangeOfEOF_) : s_ranges_[ch]; } // At this point d_nextState contains the next state and continuation is // possible. The just read char. is appended to d_match void ScannerBase::continue_(int ch) { d_state = d_nextState; if (ch != AT_EOF) d_matched += ch; } void ScannerBase::echoCh_(size_t ch) { *d_out << as(ch); d_atBOL = ch == '\n'; } // At this point there is no continuation. The last character is // pushed back into the input stream as well as all but the first char. in // the buffer. The first char. in the buffer is echoed to stderr. // If there isn't any 1st char yet then the current char doesn't fit any // rules and that char is then echoed void ScannerBase::echoFirst_(size_t ch) { d_input.reRead(ch); d_input.reRead(d_matched, 1); echoCh_(d_matched[0]); } // Update the rules associated with the current state, do this separately // for BOL and std rules. // If a rule was set, update the rule index and the current d_matched // length. void ScannerBase::updateFinals_() { size_t len = d_matched.size(); int const *rf = d_dfaBase_[d_state] + s_finIdx_; if (rf[0] != -1) // update to the latest std rule { d_final.std = FinalData { as(rf[0]), len }; } if (rf[1] != -1) // update to the latest bol rule { d_final.bol = FinalData { as(rf[1]), len }; } } void ScannerBase::reset_() { d_final = Final{ FinalData{s_unavailable, 0}, FinalData {s_unavailable, 0} }; d_state = 0; d_return = true; if (!d_more) d_matched.clear(); d_more = false; } int Scanner::executeAction_(size_t ruleIdx) try { switch (ruleIdx) { // $insert actions case 1: { #line 15 "lexer" return SPACE; } break; case 3: { #line 19 "lexer" return NL; } break; case 4: { #line 21 "lexer" begin(StartCondition_::comment); } break; case 5: { #line 24 "lexer" return endComment(); } break; case 7: { #line 28 "lexer" return NL; } break; case 8: { #line 32 "lexer" startString(); } break; case 9: { #line 35 "lexer" return endString(); } break; case 10: case 11: { #line 38 "lexer" more(); } break; case 12: case 13: { #line 41 "lexer" invalidString(); } break; case 14: { #line 45 "lexer" { if (ident() == TEXT) return TEXT; } } break; case 15: { #line 52 "lexer" ifdefDirective(); } break; case 16: { #line 53 "lexer" ifndefDirective(); } break; case 17: { #line 54 "lexer" undefDirective(); } break; case 18: { #line 57 "lexer" elseDirective(); } break; case 19: { #line 58 "lexer" endifDirective(); } break; case 20: { #line 61 "lexer" noDirective(); } break; case 21: { #line 65 "lexer" { if (includeLocal()) return NEXT; } } break; case 22: { #line 70 "lexer" { if (includeIM()) return NEXT; } } break; case 23: { #line 77 "lexer" defineDirective(); } break; case 25: case 26: { #line 85 "lexer" addBuffer(); } break; case 28: { #line 89 "lexer" return storeIdentValue(); } break; case 29: { #line 93 "lexer" return TEXT; } break; case 30: { #line 95 "lexer" return atEOF(); } break; } noReturn_(); return 0; } catch (Leave_ value) { return static_cast(value); } int Scanner::lex_() { reset_(); preCode(); while (true) { size_t ch = get_(); // fetch next char size_t range = getRange_(ch); // determine the range updateFinals_(); // update the state's Final info switch (actionType_(range)) // determine the action { case ActionType_::CONTINUE: continue_(ch); continue; case ActionType_::MATCH: { d_token_ = executeAction_(matched_(ch)); if (return_()) { print(); postCode(PostEnum_::RETURN); return d_token_; } break; } case ActionType_::ECHO_FIRST: echoFirst_(ch); break; case ActionType_::ECHO_CH: echoCh_(ch); break; case ActionType_::RETURN: if (!popStream()) { postCode(PostEnum_::END); return 0; } postCode(PostEnum_::POP); continue; } // switch postCode(PostEnum_::WIP); reset_(); preCode(); } // while } void ScannerBase::print_() const { } icmake-10.03.00/pp/scanner/error.cc0000644000175000017500000000026214204126313015654 0ustar frankfrank#include "scanner.ih" ostream &Scanner::error() { ++d_nErrors; out().setstate(ios::failbit); return cerr << '\n' << filename() << " [" << lineNr() << "] error: "; } icmake-10.03.00/pp/scanner/data.cc0000644000175000017500000000214114204126313015432 0ustar frankfrank#include "scanner.ih" // directive ident: [1] Pattern Scanner::s_matchIdent{ "#\\w+" "\\s+" "(\\S+)" }; // directive Pattern Scanner::s_matchDirective{ "#\\S+" }; // [3] is the var.name // no \ ${ defVar } Pattern Scanner::s_matchDefVar{ "([^\\\\]|^)" "(\\$\\{" "((\\w|_)+)" "\\})" }; // 1 2 34 char const *Scanner::s_tokenName[] = { "ALL_DONE", "SPACE", "TEXT", "NL", "NEXT", "AT_EOF", }; ////////////////// // // update if enum Directive (scanner.h) changes // Scanner::Token (Scanner::*Scanner::s_startDirective[])() = // { // &Scanner::ignore, // &Scanner::define, // }; // Following #define [1] is the defined word, [3] is the rest. // after matching, remove the //... comment from [3] // 1 2 3 //Pattern Scanner::s_directive{ "#\\w+\\s+(\\S+)(\\s+(.*)?)?" }; icmake-10.03.00/pp/scanner/ident.cc0000644000175000017500000000151114204126313015624 0ustar frankfrank//#define XERR #include "scanner.ih" int Scanner::ident() { if (not d_active) return nTokens; // no action required xerr("matched: " << matched()); string const &text = matched(); auto iter = d_symtab.find(text); // if a defined identifier, then // push its value, oterwise // insert the identifier itself // xerr("identifier " << text << // (iter == d_symtab.end() ? " not" : "") << " found"); if (iter == d_symtab.end()) // not a defined name? return TEXT; // then insert the name push(iter->second); // or process the #defined name's return nTokens; // and lex() won't return } icmake-10.03.00/pp/scanner/ifdefdirective.cc0000644000175000017500000000050414204126313017476 0ustar frankfrank#include "scanner.ih" void Scanner::ifdefDirective() { d_nest.push(d_active); if (d_active) // only interpret if the current level is active { assignIdent(); // get the ident: if #defined d_active = d_symtab.contains(d_ident); // then remain active }; } icmake-10.03.00/pp/scanner/includeim.cc0000644000175000017500000000130114204126313016467 0ustar frankfrank//#define XERR #include "scanner.ih" bool Scanner::includeIM() { if (not d_active) return false; string next = nextName('<', '>'); char const *im; if (im = getenv("IM"); im == 0) // no IM env. var throw fatal() << "IM environment variable not defined"; for (auto const &pair: String::split(im, String::TOK, ":")) { string fullName{ pair.first + '/' + next }; xerr("fullname: " << fullName); if (Tools::exists(fullName)) { nextStream(fullName); return true; } } throw fatal() << "can't find `" << next << "' in IM directories (" << im << ')'; } icmake-10.03.00/pp/scanner/precode.f0000644000175000017500000000004314204126313016001 0ustar frankfrankinline void Scanner::preCode() {} icmake-10.03.00/pp/scanner/print.f0000644000175000017500000000006014204126313015513 0ustar frankfrankinline void Scanner::print() { print_(); } icmake-10.03.00/pp/scanner/definedirective.cc0000644000175000017500000000057514204126313017663 0ustar frankfrank//#define XERR #include "scanner.ih" // format: #define NAME void Scanner::defineDirective() { xerr(""); if (not d_active) return; begin(StartCondition_::define); assignIdent(); // assign d_ident d_defineBuffer.clear(); if (d_symtab.contains(d_ident)) error() << '`' << d_ident << "' multiply defined\n"; } icmake-10.03.00/pp/scanner/includelocal.cc0000644000175000017500000000023514204126313017161 0ustar frankfrank//#define XERR #include "scanner.ih" bool Scanner::includeLocal() { if (d_active) nextStream(nextName('"', '"')); return d_active; } icmake-10.03.00/pp/scanner/lexer.org0000644000175000017500000000410014204126313016037 0ustar frankfrank%filenames scanner //%debug %x string comment directive ident [[:alpha:]_][[:alnum:]_]* s [ \t] S [^ \t\n] n {s}*("//".*)?\n // blanks, maybe ending in EOLN comment, // plus a newline %% ^{s}*"#!".* // ignore #! specs at line begin // comment, starting on a line is ignored ^{s}*"/*" begin(StartCondition_::comment); {s}*"/*" { // in-text comment becomes 1 space char insert(' '); begin(StartCondition_::comment); } { // ignore comment content "*/"{s}* begin(StartCondition_::INITIAL); . \n } \" startString(); {ident} ident(); // in text: replace #defined idents' meanings { \" endString(); \\. | . activeInsert(); // append all chars to strings \\\n | // no line continuations or \n in strings \n invalidString(); } ^{s}*#define{s}+{ident}{s}* defineDirective(); ^{s}*#else elseDirective(); ^{s}*#endif endifDirective(); ^{s}*#ifdef{s}+{ident}{s}* ifdefDirective(); ^{s}*#ifndef{s}+{ident}{s}* ifndefDirective(); ^{s}*#include{s}+["<] includeDirective(); ^{s}*#undef{s}+{ident}{s}* undefDirective(); ^{s}*#{S}* noDirective(); { . addBuffer(matched()[0]); // store the char \\\n addBuffer(' '); // store ' ' at line // continuation {n} endDirective(); } ^{s}+ // ignore initial blanks on lines {s}+ | // embedded blanks -> one space . insert(matched()[0]); // process single characters {n} insert('\n'); <> atEOF(); icmake-10.03.00/pp/scanner/lex.f0000644000175000017500000000006114204126313015150 0ustar frankfrankinline int Scanner::lex() { return lex_(); } icmake-10.03.00/pp/scanner/scanner.ih0000644000175000017500000000053014204126313016165 0ustar frankfrank#include "scanner.h" #include "../../xerr/xerr.ih" #include "unistd.h" #include #include #include #include #include #include "../../support/tools/tools.h" using namespace std; using namespace FBB; #include "addbuffer.f" #include "precode.f" #include "postcode.f" icmake-10.03.00/pp/scanner/endstring.cc0000644000175000017500000000015214204126313016516 0ustar frankfrank#include "scanner.ih" int Scanner::endString() { begin(StartCondition_::INITIAL); return TEXT; } icmake-10.03.00/pp/scanner/nodirective.cc0000644000175000017500000000107714204126313017043 0ustar frankfrank#include "scanner.ih" void Scanner::noDirective() { if (d_active) { s_matchDirective << matched(); // obtain the identifier beyond '#' fatal() << "directive `" << s_matchDirective[0] << "' not supported\n"; } while (true) // skip all chars to \n or EOF { switch (lex()) { case 0: return; case '\n': redo(1); return; default: break; } } } icmake-10.03.00/pp/scanner/ifndefdirective.cc0000644000175000017500000000062514204126313017660 0ustar frankfrank#include "scanner.ih" void Scanner::ifndefDirective() { d_nest.push(d_active); if (d_active) // if the current level is active { assignIdent(); // then get the #define ident: d_active = not d_symtab.contains(d_ident); // remain active unless // the ident was defined } } icmake-10.03.00/pp/scanner/ateof.cc0000644000175000017500000000060114204126313015616 0ustar frankfrank//#define XERR #include "scanner.ih" int Scanner::atEOF() { if (not popStream()) { out().put('\n'); // end the last line leave(0); // processed all nested streams } StreamData const &sd = d_streamData.top(); Tools::changeDir(sd.path); // return to the former dir. d_streamData.pop(); return AT_EOF; } icmake-10.03.00/pp/scanner/assignident.cc0000644000175000017500000000027114204126313017033 0ustar frankfrank#include "scanner.ih" void Scanner::assignIdent() { s_matchIdent << matched(); // retrieve the directive identifier d_ident = s_matchIdent[1]; // assign it } icmake-10.03.00/pp/scanner/postcode.f0000644000175000017500000000010314204126313016175 0ustar frankfrankinline void Scanner::postCode([[maybe_unused]] PostEnum_ type) {} icmake-10.03.00/pp/scanner/checkidentrecursion.cc0000644000175000017500000000115414204126313020557 0ustar frankfrank//#define XERR #include "scanner.ih" void Scanner::checkIdentRecursion() const { size_t pos = 0; while (true) { pos = d_defineBuffer.find(d_ident, pos); if (pos == string::npos) { xerr("OK"); return; // d_ident not found } if (identCharAt(pos - 1) or identCharAt(pos + d_ident.length())) { pos += d_ident.length(); continue; } throw fatal() << '[' << pos << "] recursively defined #define " << d_ident << ": `" << d_defineBuffer << '\''; } } icmake-10.03.00/pp/scanner/nextstream.cc0000644000175000017500000000127214204126313016717 0ustar frankfrank//#define XERR #include "scanner.ih" void Scanner::nextStream(string next) { xerr(next << " at line " << lineNr()); // remember where we came from and // how many eolns were encountered d_streamData.push({ filesystem::current_path() }); pushStream(next); // then switch to the 'next' stream // as with flexc++: changed canonical to // absolute filesystem::path nextPath{ filesystem::absolute(next).remove_filename() }; if (not Tools::changeDir(nextPath)) throw fatal() << "cannot chdir to " << nextPath; } icmake-10.03.00/pp/scanner/defineoptions.cc0000644000175000017500000000100714204130007017362 0ustar frankfrank#define XERR #include "scanner.ih" void Scanner::defineOptions() { Arg const &arg = Arg::instance(); for ( // determine the number of -d options unsigned idx = 0, count = arg.option('d'); idx != count; ++idx ) { string id; arg.option(idx, &id, 'd'); // get this option if (d_symtab.contains(id)) error() << '`' << id << "' multiply defined\n"; else d_symtab[id] = "1"s; } } icmake-10.03.00/pp/scanner/setfiles.cc0000644000175000017500000000131314204126313016337 0ustar frankfrank//#define XERR #include "scanner.ih" void Scanner::setFiles() { Arg const &arg = Arg::instance(); if (arg.nArgs() == 0) // no input file was specified return; filesystem::path inFile{ arg[0] }; // determine the input filename filesystem::path outFile; if (arg.nArgs() > 1) outFile = arg[1]; // 2nd file was specified: use it else { outFile = inFile; // use inFile's base name, outFile.replace_extension(".pim"); // change its extension to .pim } if (inFile == outFile) throw Exception{} << "input/output filenames must differ"; switchStreams(inFile.string(), outFile.string()); } icmake-10.03.00/pp/scanner/startstring.cc0000644000175000017500000000015014204126313017103 0ustar frankfrank#include "scanner.ih" void Scanner::startString() { more(); begin(StartCondition_::string); } icmake-10.03.00/pp/scanner/addbuffer.f0000644000175000017500000000010614204126313016302 0ustar frankfrankinline void Scanner::addBuffer() { d_defineBuffer += matched(); } icmake-10.03.00/pp/scanner/scanner.h0000644000175000017500000000747414204126313016032 0ustar frankfrank// Generated by Flexc++ V2.07.06 on Sun, 12 Jan 2020 21:04:35 +0100 #ifndef Scanner_H_INCLUDED_ #define Scanner_H_INCLUDED_ // $insert baseclass_h #include "scannerbase.h" #include #include #include "../symtab/symtab.h" namespace FBB { class Exception; } // $insert classHead class Scanner: public ScannerBase { enum { s_maxReplacements = 100 }; std::string d_defineBuffer; // filled at the unsigned d_nErrors = 0; bool d_active = true; struct StreamData { std::string path; // this file// lastWritten; }; std::stack d_streamData; std::stack d_nest; // active #if.. nesting level std::string d_ident; // in #define / #if(n)def Symtab d_symtab; static FBB::Pattern s_matchIdent; static FBB::Pattern s_matchDirective; static FBB::Pattern s_matchDefVar; public: enum Token { ALL_DONE, SPACE, TEXT, NL, NEXT, // next stream: continue with START AT_EOF, // return to the previous file nTokens, // also used in 'lexer' to avoid returning }; // a token (cf.: ident.cc) private: static Token (Scanner::*s_startDirective[])(); static char const *s_tokenName[]; public: Scanner(); // $insert lexFunctionDecl int lex(); unsigned nErrors() const; void text(); // writes matched() void write(int ch); // writes ch void write(char const *txt);// writes txt void writeLineNr(); // writes lineNr() void writeFilename(); // writes #>filename\n bool active() const; // .h char const *tokenName(int token) const; // .h private: int lex_(); int executeAction_(size_t ruleNr); void print(); void preCode(); // re-implement this function for code that must // be exec'ed before the patternmatching starts void postCode(PostEnum_ type); // re-implement this function for code that must // be exec'ed after the rules's actions. void setFiles(); // if args were specified, then switch files int endComment(); void startString(); // at initial " int endString(); // at ending " void invalidString(); // at \n void defineOptions(); // handle -d options void defineDirective(); void assignIdent(); // assign d_ident from matched() Token storeIdentValue(); void replaceDefines(); void checkIdentRecursion() const; bool identCharAt(int pos) const; void elseDirective(); void endifDirective(); void ifdefDirective(); void ifndefDirective(); void undefDirective(); void noDirective(); void addBuffer(); // .ih, adds matched() bool includeIM(); bool includeLocal(); std::string nextName(char sep0, char sep1); void nextStream(std::string next); // switch to the next stream int ident(); // insert ident or push a #defined // name's value int atEOF(); FBB::Exception fatal() const; std::ostream &error(); // error message }; #include "lex.f" #include "print.f" #include "nerrors.f" #include "active.f" #include "tokenname.f" #endif // Scanner_H_INCLUDED_ icmake-10.03.00/pp/scanner/replacedefines.cc0000644000175000017500000000372214204126313017500 0ustar frankfrank//#define XERR // When a defined identifier is encountered then its name is replaced // by its value. elements in the definition may be enclosed by ${ and } in // which case its content is checked for being a defined identifier. If so // the ${...} part is replaced by its definition // // Caveat: a replaced definition is re-inserted into the input stream: when // a definition contains its own identifier it cannot be used because of // unending recursion. replaceDefines's called (storeIdentValue) checks for // this situation #include "scanner.ih" void Scanner::replaceDefines() { vector dollars; // positions of the $s in ${...} size_t count = 0; while (s_matchDefVar << d_defineBuffer) // find ${xxx} elements { xerr("match: " << s_matchDefVar[3]); if (++count > s_maxReplacements) throw fatal() << d_defineBuffer << ": max. #replacements (" << s_maxReplacements << ") exceeded"; // first/beyond positions of // ${varname} auto matchPos = s_matchDefVar.position(2); size_t dollarIdx = matchPos.first; // the index of the $: if ( // if varname is a #defined name auto iter = d_symtab.find(s_matchDefVar[3]); iter != d_symtab.end() ) // then replace ${varname} by d_defineBuffer.replace( // its value dollarIdx, matchPos.second - dollarIdx, iter->second ); else // if not defined, then tempo. { // remove the $: dollars.push_back(dollarIdx); d_defineBuffer[dollarIdx] = ' '; } } // restore the $s of ${name} of un-#defined name: for (size_t idx: dollars) d_defineBuffer[idx] = '$'; } icmake-10.03.00/pp/scanner/scanner1.cc0000644000175000017500000000026414204126313016237 0ustar frankfrank//#define XERR #include "scanner.ih" Scanner::Scanner() : ScannerBase(cin, cout) { defineOptions(); setFiles(); // switch files if args were specified } icmake-10.03.00/pp/scanner/nerrors.f0000644000175000017500000000010314204126313016047 0ustar frankfrankinline unsigned Scanner::nErrors() const { return d_nErrors; } icmake-10.03.00/pp/scanner/lexer0000644000175000017500000000554614204126313015270 0ustar frankfrank%filenames scanner //%debug %x string comment define ident [[:alpha:]_][[:alnum:]_]* s [ \t] S [^ \t\n] %% ^{s}*"#!".* // ignore #! specs at the beginning of lines {s}+ return SPACE; {s}*"//".* // ignore eoln comment \n return NL; "/*" begin(StartCondition_::comment); { // ignore comment "*/"{s}* return endComment(); // returns SPACE . // ignored \n return NL; } \" startString(); // all string chars are returned // as WORD tokens { \" return endString(); // returns TEXT \\. | . more(); // append all chars to strings \\\n | // line continuations or \n: invalid \n invalidString(); } {ident} { // replaces #defined idents if (ident() == TEXT) // by their definitions return TEXT; } // determine the identifier, handle it, and continue beyond the identifier // at START ^{s}*#ifdef{s}+{ident}{s}* ifdefDirective(); ^{s}*#ifndef{s}+{ident}{s}* ifndefDirective(); ^{s}*#undef{s}+{ident}{s}* undefDirective(); // continue beyond at START ^{s}*#else elseDirective(); ^{s}*#endif endifDirective(); // noDirective while active results in a fatal error. ^{s}*#{S}* noDirective(); // not active, and skipped // switch to a local or IM file, state: START. At EOF continue beyond this // point, again at START ^{s}*#include{s}+\"[^\n]+\" { if (includeLocal()) return NEXT; } ^{s}*#include{s}+\<[^\n]+\> { if (includeIM()) return NEXT; } // determine the identifier, and continue with to read the // identifier's definition ^{s}*#define{s}+{ident}{s}* defineDirective(); // pick up all the characters following the #define's identifier. // Handle the definition once the \n is read, and continue at state START { \\\n // continue at a final backslash \\. | . addBuffer(); // store (escaped) char(s) {s}*"//".* // ignore eoln comment \n return storeIdentValue(); // continues at state START } . return TEXT; // process single characters // (not blanks: handled above) <> return atEOF(); icmake-10.03.00/pp/scanner/fatal.cc0000644000175000017500000000033614204126313015614 0ustar frankfrank//#define XERR #include "scanner.ih" Exception Scanner::fatal() const { return Exception{} << '\n' << filename() << " [" << lineNr() << "] fatal: "; } icmake-10.03.00/pp/scanner/writelinenr.cc0000644000175000017500000000013514204126313017064 0ustar frankfrank//#define XERR #include "scanner.ih" void Scanner::writeLineNr() { out() << lineNr(); } icmake-10.03.00/pp/scanner/scannerbase.h0000644000175000017500000002753114204126313016661 0ustar frankfrank// Generated by Flexc++ V2.07.07 on Wed, 12 Feb 2020 16:19:50 +0100 #ifndef ScannerBASE_H_INCLUDED #define ScannerBASE_H_INCLUDED #include #include #include #include #include #include class ScannerBase { // idx: rule, value: tail length (NO_INCREMENTS if no tail) typedef std::vector VectorInt; static size_t const s_unavailable = std::numeric_limits::max(); enum { AT_EOF = -1 }; protected: enum Leave_ {}; enum class ActionType_ { CONTINUE, // transition succeeded, go on ECHO_CH, // echo ch itself (d_matched empty) ECHO_FIRST, // echo d_matched[0], push back the rest MATCH, // matched a rule RETURN, // no further continuation, lex returns 0. }; enum class PostEnum_ { END, // postCode called when lex_() ends POP, // postCode called after switching files RETURN, // postCode called when lex_() returns WIP // postCode called when a non-returning rule // was matched }; public: // $insert startcondenum enum class StartCondition_{ INITIAL, string, comment, define, }; private: struct FinalData { size_t rule; size_t length; }; struct Final { FinalData std; FinalData bol; }; // class Input encapsulates all input operations. // Its member get() returns the next input character // $insert inputInterface class Input { std::deque d_deque; // pending input chars std::istream *d_in; // ptr for easy streamswitching size_t d_lineNr; // line count public: Input(); // iStream: dynamically allocated Input(std::istream *iStream, size_t lineNr = 1); size_t get(); // the next range void reRead(size_t ch); // push back 'ch' (if < 0x100) // push back str from idx 'fmIdx' void reRead(std::string const &str, size_t fmIdx); size_t lineNr() const { return d_lineNr; } size_t nPending() const { return d_deque.size(); } void setPending(size_t size) { d_deque.erase(d_deque.begin(), d_deque.end() - size); } void close() // force closing the stream { delete d_in; d_in = 0; // switchStreams also closes } private: size_t next(); // obtain the next character }; protected: struct StreamStruct { std::string pushedName; Input pushedInput; }; private: std::vector d_streamStack; std::string d_filename; // name of the currently processed static size_t s_istreamNr; // file. With istreams it receives // the name "", where // # is the sequence number of the // istream (starting at 1) int d_startCondition = 0; int d_lopSC = 0; size_t d_state = 0; int d_nextState; std::shared_ptr d_out; bool d_atBOL = true; // the matched text starts at BOL Final d_final; // only used interactively: std::istream *d_in; // points to the input stream std::shared_ptr d_line; // holds line fm d_in Input d_input; std::string d_matched; // matched characters std::string d_lopMatched; // matched lop-rule characters std::string::iterator d_lopIter; std::string::iterator d_lopTail; std::string::iterator d_lopEnd; size_t d_lopPending; // # pending input chars at lop1_ bool d_return; // return after a rule's action bool d_more = false; // set to true by more() size_t (ScannerBase::*d_get)() = &ScannerBase::getInput; protected: std::istream *d_in_; int d_token_; // returned by lex_ int const (*d_dfaBase_)[44]; static int const s_dfa_[][44]; static int const (*s_dfaBase_[])[44]; enum: bool { s_interactive_ = false }; enum: size_t { s_rangeOfEOF_ = 41, s_finIdx_ = 42, s_nRules_ = 31, s_maxSizeofStreamStack_ = 10 }; static size_t const s_ranges_[]; static size_t const s_rf_[][2]; public: ScannerBase(ScannerBase const &other) = delete; ScannerBase &operator=(ScannerBase const &rhs) = delete; bool debug() const; std::string const &filename() const; std::string const &matched() const; size_t length() const; size_t lineNr() const; void setDebug(bool onOff); void switchOstream(std::ostream &out); void switchOstream(std::string const &outfilename); void switchStreams(std::istream &in, std::ostream &out = std::cout); void switchIstream(std::string const &infilename); void switchStreams(std::string const &infilename, std::string const &outfilename); // $insert interactiveDecl protected: ScannerBase(std::istream &in, std::ostream &out); ScannerBase(std::string const &infilename, std::string const &outfilename); ~ScannerBase(); bool popStream(); std::ostream &out(); void echo() const; void leave(int retValue) const; // `accept(n)' returns all but the first `n' characters of the current // token back to the input stream, where they will be rescanned when the // scanner looks for the next match. // So, it matches n of the characters in the input buffer, and so it accepts // n characters, rescanning the rest. void accept(size_t nChars = 0); // former: less void redo(size_t nChars = 0); // rescan the last nChar // characters, reducing // length() by nChars void more(); void push(size_t ch); // push char to Input void push(std::string const &txt); // same: chars std::vector const &streamStack() const; void pushStream(std::istream &curStream); void pushStream(std::string const &curName); void setFilename(std::string const &name); void setMatched(std::string const &text); static std::string istreamName_(); // members used by lex_(): they end in _ and should not be used // otherwise. ActionType_ actionType_(size_t range); // next action bool return_(); // 'return' from codeblock size_t matched_(size_t ch); // handles a matched rule size_t getRange_(int ch); // convert char to range size_t get_(); // next character size_t state_() const; // current state void continue_(int ch); // handles a transition void echoCh_(size_t ch); // echoes ch, sets d_atBOL void echoFirst_(size_t ch); // handles unknown input void updateFinals_(); // update a state's Final info void noReturn_(); // d_return to false void print_() const; // optionally print token void pushFront_(size_t ch); // return char to Input void reset_(); // prepare for new cycle // next input stream: void switchStream_(std::istream &in, size_t lineNr); void lopf_(size_t tail); // matched fixed size tail void lop1_(int lopSC); // matched ab for a/b void lop2_(); // matches the LOP's b tail void lop3_(); // catch-all while matching b void lop4_(); // matches the LOP's a head // $insert startconddecl StartCondition_ startCondition() const; // current start condition void begin(StartCondition_ startCondition); private: static StartCondition_ constexpr SC(int sc); static int constexpr SC(StartCondition_ sc); size_t getInput(); size_t getLOP(); void p_pushStream(std::string const &name, std::istream *streamPtr); void setMatchedSize(size_t length); bool knownFinalState(); template static ReturnType constexpr as(ArgType value); static bool constexpr available(size_t value); }; inline ScannerBase::~ScannerBase() { d_input.close(); } template inline ReturnType constexpr ScannerBase::as(ArgType value) { return static_cast(value); } // $insert startcondimpl inline ScannerBase::StartCondition_ constexpr ScannerBase::SC(int sc) { return as(sc); } inline int constexpr ScannerBase::SC(StartCondition_ sc) { return as(sc); } inline ScannerBase::StartCondition_ ScannerBase::startCondition() const { return SC(d_startCondition); } inline void ScannerBase::begin(StartCondition_ startCondition) { // d_state is reset to 0 by reset_() d_dfaBase_ = s_dfaBase_[d_startCondition = SC(startCondition)]; } inline bool ScannerBase::knownFinalState() { return (d_atBOL && available(d_final.bol.rule)) || available(d_final.std.rule); } inline bool constexpr ScannerBase::available(size_t value) { return value != std::numeric_limits::max(); } inline std::ostream &ScannerBase::out() { return *d_out; } inline void ScannerBase::push(size_t ch) { d_input.reRead(ch); } inline void ScannerBase::push(std::string const &str) { d_input.reRead(str, 0); } inline std::vector const &ScannerBase::streamStack() const { return d_streamStack; } inline void ScannerBase::setFilename(std::string const &name) { d_filename = name; } inline void ScannerBase::setMatched(std::string const &text) { d_matched = text; } inline std::string const &ScannerBase::matched() const { return d_matched; } inline std::string const &ScannerBase::filename() const { return d_filename; } inline void ScannerBase::echo() const { *d_out << d_matched; } inline size_t ScannerBase::length() const { return d_matched.size(); } inline void ScannerBase::leave(int retValue) const { throw as(retValue); } inline size_t ScannerBase::lineNr() const { return d_input.lineNr(); } inline void ScannerBase::more() { d_more = true; } inline size_t ScannerBase::state_() const { return d_state; } inline size_t ScannerBase::get_() { return (this->*d_get)(); } inline size_t ScannerBase::getInput() { return d_input.get(); } inline bool ScannerBase::return_() { return d_return; } inline void ScannerBase::noReturn_() { d_return = false; } #endif // ScannerBASE_H_INCLUDED icmake-10.03.00/pp/scanner/undefdirective.cc0000644000175000017500000000027014204126313017522 0ustar frankfrank#include "scanner.ih" void Scanner::undefDirective() { if (not d_active) return; assignIdent(); d_symtab.remove(d_ident); // OK if d_ident wasn't defined } icmake-10.03.00/pp/scanner/writefilename.cc0000644000175000017500000000016114204126313017354 0ustar frankfrank//#define XERR #include "scanner.ih" void Scanner::writeFilename() { out() << "#>" << filename() << '\n'; } icmake-10.03.00/pp/scanner/nextname.cc0000644000175000017500000000070014204126313016337 0ustar frankfrank//#define XERR #include "scanner.ih" // filenames are either "name" or . Name may be anything, // even nested separators, but can only be valid if such a filename // exists. string Scanner::nextName(char sep0, char sep1) { size_t begin = matched().find_first_of(sep0) + 1; return matched().substr( begin, matched().find_last_of(sep1) - begin ); } icmake-10.03.00/pp/scanner/storeidentvalue.cc0000644000175000017500000000045614204126313017745 0ustar frankfrank//#define XERR #include "scanner.ih" Scanner::Token Scanner::storeIdentValue() { xerr(""); begin(StartCondition_::INITIAL); if (d_active) { replaceDefines(); checkIdentRecursion(); d_symtab[d_ident] = String::trim(d_defineBuffer); } return NL; } icmake-10.03.00/pp/scanner/active.f0000644000175000017500000000007514204126313015640 0ustar frankfrankinline bool Scanner::active() const { return d_active; } icmake-10.03.00/pp/scanner/elsedirective.cc0000644000175000017500000000042314204126313017351 0ustar frankfrank#include "scanner.ih" void Scanner::elseDirective() { if (d_nest.empty()) error() << "#else without matching #if\n"; else if (d_nest.top()) // previous level active, d_active = not d_active; // else toggle the activation level } icmake-10.03.00/pp/scanner/endcomment.cc0000644000175000017500000000015414204126313016654 0ustar frankfrank#include "scanner.ih" int Scanner::endComment() { begin(StartCondition_::INITIAL); return SPACE; } icmake-10.03.00/pp/scanner/frame0000644000175000017500000000007114204126313015227 0ustar frankfrank//#define XERR #include "scanner.ih" void Scanner:: { } icmake-10.03.00/pp/scanner/write1.cc0000644000175000017500000000013114204126313015731 0ustar frankfrank//#define XERR #include "scanner.ih" void Scanner::write(int ch) { out().put(ch); } icmake-10.03.00/pp/scanner/invalidstring.cc0000644000175000017500000000023214204126313017375 0ustar frankfrank#include "scanner.ih" void Scanner::invalidString() { error() << "double quote at end of string not found\n"; begin(StartCondition_::INITIAL); } icmake-10.03.00/pp/scanner/endifdirective.cc0000644000175000017500000000043114204126313017505 0ustar frankfrank#include "scanner.ih" void Scanner::endifDirective() { if (d_nest.empty()) error() << "#endif without matching #if\n"; else { d_active = d_nest.top(); // return to the previous activation d_nest.pop(); // level } } icmake-10.03.00/pp/scanner/write2.cc0000644000175000017500000000014114204126313015733 0ustar frankfrank//#define XERR #include "scanner.ih" void Scanner::write(char const *txt) { out() << txt; } icmake-10.03.00/pp/icmconf0000644000175000017500000000160614204126762014137 0ustar frankfrank#define CLS #define LIBRARY "modules" #define MAIN "main.cc" #define SOURCES "*.cc" #define OBJ_EXT ".o" #define TMP_DIR "tmp" //#define USE_ALL "a" #define USE_ECHO ON //#define USE_VERSION #define CXX "g++" #define CXXFLAGS " --std=c++20 -Wall -O2" \ " -fdiagnostics-color=never " #define IH ".ih" #define PRECOMP "-x c++-header" #define REFRESH #define LDFLAGS "" #define ADD_LIBRARIES "support bobcat" #define ADD_LIBRARY_PATHS "../../support/tmp" #define SCANNER_DIR "scanner" #define SCANGEN "flexc++" #define SCANFLAGS "" #define SCANSPEC "lexer" //#define SCANFILES "" #define SCANOUT "lex.cc" #define DEFCOM "program" icmake-10.03.00/pp/changelog0000644000175000017500000000066614204126313014445 0ustar frankfrankicm-pp version 10.00.00 * As with flexc++ canonical paths are not used anymore. Instead absolute paths are used. * icm-pp doesn't use a parser: removed from the source tree * the test/ directory contains various icmake scripts which can be preprocessed by icm-pp. It also contains example .pim files which may be used for regression testing -- Frank B. Brokken Mon, 03 May 2021 11:36:46 +0200 icmake-10.03.00/pp/main.cc0000644000175000017500000000205014204126313014013 0ustar frankfrank//#define XERR #include "main.ih" // main() checks if two arguments are present on the // invoking command line. If not std in and std out are used. // // The environment variable IM is inspected to ensure that // included files are searched from this directory. When not set, // included files are searched in the current directory. namespace { Arg::LongOption longOpts[] = { Arg::LongOption{"define", 'd'}, Arg::LongOption{"help", 'h'}, Arg::LongOption{"version", 'v'}, }; auto longEnd = longOpts + size(longOpts); } int main(int argc, char **argv) try { Arg const &arg = Arg::initialize("d:hv", longOpts, longEnd, argc, argv); arg.versionHelp(usage, VERSION, 2); State state; return state.run(); } catch (int retValue) { return retValue; } catch (exception const &exc) { cerr << exc.what() << '\n'; return 1; } catch (...) { cerr << "\n" "fatal: unaccounted for exception\n"; return 1; } icmake-10.03.00/pp/main.ih0000644000175000017500000000037614204126313014037 0ustar frankfrank#include #include #include #include #include "../xerr/xerr.ih" #include "../support/tools/tools.h" #include "state/state.h" using namespace std; using namespace FBB; void usage(string const &progname); icmake-10.03.00/pp/install0000755000175000017500000000012314204126313014153 0ustar frankfrank#!/bin/bash strip tmp/bin/binary cp tmp/bin/binary /usr/lib/icmake/bin/icm-pp.wip icmake-10.03.00/pp/frame0000644000175000017500000000002314204126313013573 0ustar frankfrank#include "main.ih" icmake-10.03.00/pp/CLASSES0000644000175000017500000000002514204126313013600 0ustar frankfrankscanner symtab state icmake-10.03.00/QUICKINSTALL0000644000175000017500000000326314204126767014013 0ustar frankfrank0. After unpacking the icmake_XX.YY.ZZ.tar.gz icmake archive, make your current working directory equal to the directory in which you found this file. 1. Inspect and modify if necessary the current locations in INSTALL.im. 2. If you want the compiler to insert debugging code in the icmake programs then define a CXXFLAGS environment variable. E.g., CXXFLAGS="--std=c++20 -Wall -O2 -g" 3. To prepare for the compilations of the programs, run ./icm_prepare / 3. Compile the various programs (x is a dummy argument required by ./icm_bootstrap to run): ./icm_bootstrap x 4. As root: install the programs and documentation: ./icm_install strip all (the elements of the installation are under tmp/etc and tmp/usr) For debian, the following install commands are issued, installing under debian/icmake and debian/icmake-doc ./icm_install strip progs debian/icmake ./icm_install scripts debian/icmake ./icm_install skel debian/icmake ./icm_install man debian/icmake ./icm_install doc debian/icmake ./icm_install etc debian/icmake ./icm_install docdoc debian/icmake-doc 5. Remove intermediate construction area: rm -rf tmp Following these commands (referring to the #defines in INSTALL.im): icmake is in /BINDIR skeleton files, installed by icmstart, are in /SKELDIR manual pages are in /MANDIR/man{1,7} icmake support programs are in /LIBDIR confguration files, specifying which skeleton commands to install, are in /CONFDIR icmake documentation is installed in /DOCDIR and /DOCDOCDIR icmake-10.03.00/README.stack0000777000175000017500000000000014204126313020062 2comp/README.stackframeustar frankfrankicmake-10.03.00/required0000644000175000017500000000053414204126313013711 0ustar frankfrankThis file lists non-standard software only. Thus, standard utilities like cp, mv, sed, etc, etc, are not explicitly mentioned. Neither is the gcc compiler explicitly mentioned, but a fairly recent one is assumed. Required software for building Icmake ------------------------------------- Recent version of yodl (for creating documentation) icmake-10.03.00/scripts/0000755000175000017500000000000014203741153013637 5ustar frankfrankicmake-10.03.00/scripts/icmstart.sh0000755000175000017500000000006514204126313016021 0ustar frankfrank#!/bin/bash exec icmake -e @LIBDIR@/icmstart.bim $* icmake-10.03.00/scripts/is/0000755000175000017500000000000014203741153014252 5ustar frankfrankicmake-10.03.00/scripts/is/replace0000644000175000017500000000244314204126313015607 0ustar frankfrankint replace(string target) { while (g_askReplace) { printf("`", target, "' exists.\n" "Replace [?akNqy] ? "); string answer = getch(); printf('\n'); if (answer == "a") { g_replace = 1; g_askReplace = 0; break; } if (answer == "k") { g_askReplace = 0; g_modIcmconf = 0; break; } if (answer == "y") return 1; if (answer == "q") exit(0); if (answer == "n" || answer == "\n") { if (target == "icmconf") g_modIcmconf = 0; return 0; } // ? or something else requested 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; } icmake-10.03.00/scripts/is/shift0000644000175000017500000000040014204126313015300 0ustar frankfranklist shift(list lst) // return a list without lst's first element { // (lst should not be empty) list ret; for (int idx = 1, end = listlen(lst); idx != end; ++idx) ret += (list)lst[idx]; return ret; } icmake-10.03.00/scripts/is/getsourcedest0000644000175000017500000000207114204126313017051 0ustar frankfranklist getSourceDest(string confLine) { list nop; // no action at nop list fields = strtok(confLine, " \t\n"); // break up the line in parts string source = fields[0]; // look at the first element // ignore empty lines and comment if (listlen(fields) == 0 || source[0] == "#") return nop; string flags = source; // remove P/L/D flags if (listfind(g_actions, flags) == -1) // no flags: source OK flags = ""; else { fields = shift(fields); // remove fields[0] source = fields[0]; // reassign source } g_confirmInstall = source == "?"; // check for a confirmation request if (g_confirmInstall) fields = shift(fields); // if so, then reassign source return skip(flags) ? // inspect the P/L/D and b flags: nop : fields; // [0]: source, [1]: dest } icmake-10.03.00/scripts/is/out0000644000175000017500000000075414204126313015006 0ustar frankfrankvoid checkDEFCOM() { if (g_modIcmconf == 0) return; if (g_defaultCommand != "") fprintf(g_icmconf, g_defaultCommand); if (strfind(g_defaultCommand, "library") != -1) syscall("sed -i '\n" "s?^%%\\(#define LIBRARY\\)?\\1?\n" "s?^\\(#define MAIN\\)?%%\\1?\n" "' " + g_icmconf); if (!g_version) syscall("sed -i '\n" "s?^\\(#define USE_VERSION\\)?%%\\1?\n" "' " + g_icmconf); } icmake-10.03.00/scripts/is/absdest0000644000175000017500000000212414204126313015615 0ustar frankfrank // destination entries can be copied from the // source entries (files or directories) // if they start with ~/ or / then that part is removed. // // g_destPath is prefixed to the destination and its absolute path is // determined: the resulting destination must start with destPath as // it must be below destpath. string absDest(string dest) { int offset = // offset of the actual dest-entry: strfind(dest, "~/") == 0 ? 2 : // relative to HOME strfind(dest, "/") == 0 ? 1 : // absolute 0; // as-is if (offset != 0) dest = substr(dest, offset, 999); // remove the prefix dest = readlink(g_destPath + dest); // convert to abs. path // the new 'dest' must // now begin with g_destPath: if (strfind(dest, g_destPath) != 0) quit("dest: `" + dest + "' doesn't start with `" + g_destPath + "'"); return dest; } icmake-10.03.00/scripts/is/installversion0000644000175000017500000000074314204126313017251 0ustar frankfrankvoid install_version() { if (!g_version) // with -b: don't install VERSION return; string str = g_destPath + "VERSION"; if (installOK("VERSION", str)) // install new VERSION or replace old { system(P_NOCHECK, "rm -f " + str); version_field("AUTHOR", ""); version_field("VERSION", "0.00.00"); str = "date '+%Y'"; str = `str`[0]; version_field("YEARS", resize(str, strlen(str) - 1)); } } icmake-10.03.00/scripts/is/findfile0000644000175000017500000000112314204126313015746 0ustar frankfrankstring findFile(string file) // find a file in -c, HOME or { // CONFDIR string ret; if (g_confPath != "") // locate file in -c path ret = findIn(g_confPath, file); if (!ret) // not found, locate in $HOME ret = findIn(g_home, file); if (!ret) // not found, locate in CONFDIR ret = findIn("/etc/icmake", file); if (!isFile(ret)) quit("Can't find configuration file `" + file + "'"); return ret; } icmake-10.03.00/scripts/is/quit0000644000175000017500000000011714204126313015152 0ustar frankfrankvoid quit(string str) { printf(g_program, ": ", str, '\n'); exit(1); } icmake-10.03.00/scripts/is/findin0000644000175000017500000000022614204126313015440 0ustar frankfrankstring findIn(string path, string entry) // find any filesystem entry { string ret = path + "/" + entry; return exists(ret) ? ret : ""; } icmake-10.03.00/scripts/is/md0000644000175000017500000000007414204126313014572 0ustar frankfrankvoid md(string dir) { syscall("mkdir -p " + dir); } icmake-10.03.00/scripts/is/syscall0000644000175000017500000000023514204126313015643 0ustar frankfrankvoid syscall(string command) // merely show the command with -d { if (g_debug) printf(command, '\n'); else system(command); } icmake-10.03.00/scripts/is/abspath0000644000175000017500000000043614204126313015616 0ustar frankfrank // return the absolute canonicalized path, string absPath(string arg) // either as-is or wrt the original CWD { // it ends in a slash if (arg[0] != "/") arg = g_cwd + arg; return readlink(arg) + "/"; } icmake-10.03.00/scripts/is/arguments0000644000175000017500000000503614204126313016202 0ustar frankfrankvoid 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 int cmdidx = 1; while (cmdidx < argc) { string arg = argv[cmdidx]; if (arg[0] != "-") // no (more) options break; if (arg[1] == "b") // -b: basic installation { g_basic = 1; g_version = 0; } else if (arg[1] == "c") // -c: re-assign g_confPath { arg = substr(arg, 2, 999); // get all beyond -c if (arg == "") // or get then next argument { if (cmdidx == argc) quit("-c lacks configuration file specification"); arg = argv[++cmdidx]; } g_confPath = absPath(arg); // reassign confpath } else if (arg[1] == "d") // -d: debug g_debug = 1; else if (arg[1] == "I") // -I: no skeletons g_skeletons = 0; else if (arg[1] == "r") // -r: replace existing file(s) { g_askReplace = 0; g_replace = 1; } else if (arg[1] == "s") // -s: re-assign g_skelPath { arg = substr(arg, 2, 999); // get all beyond -s if (arg == "") // or get then next argument { if (cmdidx == argc) quit("-s lacks skeleton dir specification"); arg = argv[++cmdidx]; } g_skelPath = arg; // reassign skelPath } else quit("Option `" + arg + "' not supported\n"); ++cmdidx; } g_skelPath = absPath(g_skelPath); g_destSpec = argv[cmdidx]; g_destPath = absPath(g_destSpec); g_icmconf = g_destPath + "icmconf"; if (++cmdidx < argc) { g_defaultCommandArg = argv[cmdidx]; if (listfind(g_defaultCommands, g_defaultCommandArg) == -1) { printf("Initial command `", g_defaultCommandArg, "' not supported\n"); exit(1); } if (g_defaultCommandArg == "library") g_version = 0; g_defaultCommand = "\n" "#define DEFCOM \"" + g_defaultCommandArg + "\"\n"; } md(g_destPath); // install the target dir } icmake-10.03.00/scripts/is/usage0000644000175000017500000000225014204126313015274 0ustar frankfrankvoid usage() { printf("Usage: ", g_program, " [Options] dir [program|library]\n" "Where:\n" " Options:\n" " -b: basic: the files usage.cc and version.cc are not " "installed\n" " -c confpath: Use the configuration files (icmstart.rc, " "AUTHOR,\n" " VERSION, YEARS found in `confpath' rather than\n" " if found in $HOME/.icmake or @CONFDIR@\n" " -d: debug: do not execute any commands, but show commands\n" " 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 /usr/share/icmake\n" " dir: the directory to install the files into\n" " program, library: command passed by default to the icmbuild " "script\n" "\n"); exit(0); } icmake-10.03.00/scripts/is/readlink0000644000175000017500000000032214204126313015757 0ustar frankfrank // return the canonicalized path, string readlink(string name) // which may not yet exist { return eval("readlink -mn " + name)[0]; } icmake-10.03.00/scripts/is/installline0000644000175000017500000000430714204126313016513 0ustar frankfrank // 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 // if name is a directory then the destination will be // 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 // 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, L, D, or b. // b and D may also be added to P or L // Sources at P-lines are installed when using 'icmstart xxx program' // Sources at L-lines are installed when using 'icmstart xxx library' // Sources at D lines, or sources without P,L,D prefixes are // unconditionally installed. // Sources at b-lines are ignored when the -b (basic) fla is specified // 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 sourceDest = getSourceDest(confline); if (!sourceDest) return; // find the absolute source location string realSource = absSource(sourceDest[0]); // get the destination or use the // source spec. as destination string dest = sourceDest[listlen(sourceDest) > 1]; //printf(sourceDest, // "\n\tsource = ", realSource, // "\n\tdest = ", dest, '\n'); string realDest = absDest(dest); // printf("\trealDest = ", realDest, '\n'); // if (listfind(g_installed, realDest) != -1) // already processed 'dest' // return; if (!g_replace && !g_askReplace && exists(realDest)) return; if (confirmInstall(sourceDest[0], dest)) install_entry(realSource, dest, realDest); } icmake-10.03.00/scripts/is/installok0000644000175000017500000000013314204126313016166 0ustar frankfrankint installOK(string dest, string target) { return !exists(target) || replace(dest); } icmake-10.03.00/scripts/is/checkdefcom0000644000175000017500000000173414204126313016431 0ustar frankfrankvoid checkDEFCOM() { if (g_modIcmconf == 0) // no icmconf modification requested return; // write a default command if if (g_defaultCommand != "") // if provided as last arg. fprintf(g_icmconf, g_defaultCommand); // for libraries: uncomment the // #define LIBRARY spec, and // comment out #define MAIN // the %% sequences are replaced by // by 'catim' if (strfind(g_defaultCommand, "library") != -1) syscall("sed -i '\n" "s?^%%\\(#define LIBRARY\\)?\\1?\n" "s?^\\(#define MAIN\\)?%%\\1?\n" "' " + g_icmconf); if (!g_version) // uncomment syscall("sed -i '\n" // #define USE_VERSION "s?^\\(#define USE_VERSION\\)?%%\\1?\n" "' " + g_icmconf); } icmake-10.03.00/scripts/is/confirminstall0000644000175000017500000000061314204126313017215 0ustar frankfrankint confirmInstall(string source, string dest) { if (!g_confirmInstall) // confirmation not required return 1; // unconditional installation if (source == dest) printf("Install `", dest, "' [yN] ? "); else printf("Install `", source, "' as `", dest, "' [yN] ? "); int ret = getch() == "y"; printf('\n'); return ret; } icmake-10.03.00/scripts/is/versionfield0000644000175000017500000000053014204126313016660 0ustar frankfrankvoid version_field(string file, string default) { if (g_skeletons) { string ret = findFile(file); if (ret != "") system("cat " + ret + " >> " + g_destPath + "VERSION"); else fprintf(g_destPath + "VERSION", "#define ", file, " \"", default, "\"\n"); } } icmake-10.03.00/scripts/is/installrc0000644000175000017500000000110614204126313016162 0ustar frankfrankvoid install_rc() { // retrieve the config file. Exit if // 'icmstart.rc' can't be found in // -c's path, in $HOME or in /etc/icmake string conffile = findFile("icmstart.rc"); // process the lines of the conf file while (list line = fgets(conffile, line)) install_line(line[0]); install_version(); // install VERSION if needed checkDEFCOM(); // unless specified: add DEFCOM } icmake-10.03.00/scripts/is/installentry0000644000175000017500000000036514204126313016725 0ustar frankfrankvoid install_entry(string realSource, string dest, string realDest) { if (!installOK(dest, realDest)) return; md(get_path(realDest)); syscall("cp -rd " + realSource + " " + realDest); // g_installed += (list)realDest; } icmake-10.03.00/scripts/is/abssource0000644000175000017500000000162214204126313016160 0ustar frankfrank // source entries must exist as files or directories // If they start with ~/ then they are under the HOME dir. // if they start with / then they're absolute // otherwise they are in the skeleton path(by default g_skelPath) // // plain source (e.g., CLASSES) -> g_skelPath + CLASSES // relative to home (e.g., ~/path/file) -> ${HOME}/path/file // absolute: /path1/path2 -> /path1/path2 // string absSource(string source) { if (strfind(source, "~/") == 0) // relative to home source = readlink(source); // readlink solves the ~/ else if (source[0] != '/') // not absolute, then rel. to skelPath source = g_skelPath + source; if (!isFileOrDir(source)) // and it must exist (either dir or file) quit("Can't find source `" + source + "'"); return source; // return the absolute path } icmake-10.03.00/scripts/is/skip0000644000175000017500000000155314204126313015143 0ustar frankfrank // ignore 'P' for library construction, // ignore 'L' for program construction // do not ignore the 'D' specificied entries int skip(string flags) { return (int) ( // returns 1 (true) if: g_basic && strchr(flags, "b") != -1 // basic requested, but || // no basic flag strchr(flags, "D") == -1 // not a default entry && // and also ( // library, but a P-entry g_defaultCommandArg == "library" && strchr(flags, "P") != -1 || // of program and a L-entry g_defaultCommandArg == "program" && strchr(flags, "L") != -1 ) ); } icmake-10.03.00/scripts/is/isfile0000644000175000017500000000011214204126313015436 0ustar frankfrankint isFile(string s) { return (int)stat(P_NOCHECK, s)[0] & S_IFREG; } icmake-10.03.00/scripts/is/isfileordir0000644000175000017500000000016014204126313016501 0ustar frankfrankint isFileOrDir(string entry) { return g_fileStat = (int)stat(P_NOCHECK, entry)[0] & (S_IFREG | S_IFDIR); } icmake-10.03.00/scripts/convert0000755000175000017500000000044114204126313015240 0ustar frankfrank#!/bin/bash # echo converting $1 to $2 . scripts/conversions mkdir -p `dirname $2` sed ' s,@BINDIR@,'${BINDIR}',g s,@SKELDIR@,'${SKELDIR}',g s,@MANDIR@,'${MANDIR}',g s,@LIBDIR@,'${LIBDIR}',g s,@CONFDIR@,'${CONFDIR}',g s,@DOCDIR@,'${DOCDIR}',g s,@DOCDOCDIR@,'${DOCDOCDIR}',g ' $1 > $2 icmake-10.03.00/scripts/icmstart.in.org0000755000175000017500000003370114204126313016606 0ustar frankfrank#!@BINDIR@/icmake -t. 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(""); string g_icmconf; 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_version = 1; int g_basic = 0; int g_modIcmconf = 1; void usage() { printf("Usage: ", g_program, " [Options] dir [program|library]\n" "Where:\n" " Options:\n" " -b: basic: the files usage.cc and version.cc are not " "installed\n" " -c confpath: Use the configuration files (icmstart.rc, " "AUTHOR,\n" " VERSION, YEARS found in `confpath' rather than\n" " if found in $HOME/.icmake or @CONFDIR@\n" " -d: debug: do not execute any commands, but show commands\n" " 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" " dir: the directory to install the files into\n" " program, library: command passed by default to the icmbuild " "script\n" "\n"); exit(0); } void die(string s) { printf(g_program, ": ", s, "\n"); exit(1); } int isFileOrDir(string s) { return (int)stat(P_NOCHECK, s)[0] & (S_IFREG | S_IFDIR); } int isFile(string s) { 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) printf(command, "\n"); else system(command); } void md(string dir) { // skip dir if it has already been handled for (int idx = 0; idx < listlen(g_mkdir); ++idx) { if (g_mkdir[idx] == dir) return; } syscall("mkdir -p " + dir); 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; return readlink(arg) + "/"; } string absSource(string source) { int abs = strchr(source, "~/") == 0; 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 int cmdidx = 1; while (cmdidx < argc) { string arg = argv[cmdidx]; if (arg[0] != "-") // no (more) options break; if (arg[1] == "b") // -b: basic installation { g_basic = 1; g_version = 0; } else if (arg[1] == "c") // -c: re-assign g_confPath { arg = substr(arg, 2, 999); // get all beyond -c if (arg == "") // or get then next argument { if (cmdidx == argc) die("-c lacks configuration file specification"); arg = argv[++cmdidx]; } g_confPath = absPath(arg); // reassign confpath } else if (arg[1] == "d") // -d: debug g_debug = 1; else if (arg[1] == "I") // -I: no skeletons g_skeletons = 0; else if (arg[1] == "r") // -r: replace existing file(s) { g_askReplace = 0; g_replace = 1; } else if (arg[1] == "s") // -s: re-assign g_skelPath { arg = substr(arg, 2, 999); // get all beyond -s if (arg == "") // or get then next argument { if (cmdidx == argc) die("-s lacks skeleton dir specification"); arg = argv[++cmdidx]; } g_skelPath = arg; // reassign skelPath } else die("Option `" + arg + "' not supported\n"); ++cmdidx; } g_skelPath = absPath(g_skelPath); g_destSpec = argv[cmdidx]; g_destPath = absPath(g_destSpec); g_icmconf = g_destPath + "icmconf"; if (++cmdidx < argc) { g_defaultCommandArg = argv[cmdidx]; if (listfind(g_defaultCommands, g_defaultCommandArg) == -1) { printf("Initial command `", g_defaultCommandArg, "' not supported\n"); exit(1); } 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) { printf("`", target, "' exists.\n" "Replace [?akNqy] ? "); string answer = getch(); if (answer == "a") { g_replace = 1; g_askReplace = 0; break; } if (answer == "k") { g_askReplace = 0; g_modIcmconf = 0; break; } if (answer == "y") return 1; if (answer == "q") exit(0); if (answer == "n" || answer == "\n") { if (target == "icmconf") g_modIcmconf = 0; return 0; } // ? or something else requested 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 dest, string target) { return (int)(!exists(target) || replace(dest)); } int install_file(string realSource, string dest, string realDest) { if (!install(dest, realDest)) return 0; 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; return exists(ret) ? ret : ""; } string findFile(string file) { string ret; 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); if (ret == "") // not found, locate in CONFDIR ret = find("/etc/icmake", file); return ret; } void install_conf(string file, string default) { if (g_skeletons) { string ret = findFile(file); if (ret != "") system("cat " + ret + " >> " + g_destPath + "VERSION"); else fprintf(g_destPath + "VERSION", "#define ", file, " \"", default, "\"\n"); } } void install_version() { if (!g_version) return; string str = g_destPath + "VERSION"; if (install("VERSION", str)) { system(P_NOCHECK, "rm -f " + str); install_conf("AUTHOR", ""); install_conf("VERSION", "0.00.00"); str = "date '+%Y'"; str = `str`[0]; install_conf("YEARS", resize(str, strlen(str) - 1)); } } void defaultCommand() { if (g_modIcmconf == 0) // no icmconf modification requested return; // write a default command if if (g_defaultCommand != "") // if 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) syscall("sed -i '\n" "s?^//\\(#define LIBRARY\\)?\\1?\n" "s?^\\(#define MAIN\\)?//\\1?\n" "' " + g_icmconf); if (!g_version) // uncomment syscall("sed -i '\n" // #define USE_VERSION "s?^\\(#define USE_VERSION\\)?//\\1?\n" "' " + g_icmconf); } int confirmInstall(string source, string dest) { if (!g_confirmInstall) return 1; if (source == dest) printf("Install `", dest, "' [yN] ? "); else printf("Install `", source, "' as `", dest, "' [yN] ? "); return getch() == "y"; } list shift(list source) // shift away the first element { list ret; for (int idx = 1; idx != listlen(source); ++idx) ret += (list)source[idx]; 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 // if name is a directory then the destination will be // 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 // 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, 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]; // ignore empty line or comment if (listlen(fields) == 0 || source[0] == "#") return; // remove any P/L/D flags string install = source; if (listfind(g_actions, install) == -1) install = ""; else { fields = shift(fields); source = fields[0]; } g_confirmInstall = source == "?"; // need confirmation ? if (g_confirmInstall) { fields = shift(fields); // rm the ?-mark source = fields[0]; } if (ignoreEntry(install)) return; string realSource = absSource(source); string dest = listlen(fields) > 1 ? fields[1] : source; string realDest = absDest(dest); if (listfind(g_installed, realDest) != -1) // already processed 'dest' return; if (!g_replace && !g_askReplace && exists(realDest)) return; if (!confirmInstall(source, dest)) return; install_file(realSource, dest, realDest); } void install_rc() { string conffile = findFile("icmstart.rc"); if (!isFile(conffile)) die("Can't find configuration file `icmstart.rc'"); while (list line = fgets(conffile, line)) install_line(line[0]); install_version(); defaultCommand(); } void main(int argc, list argv) { echo(OFF); if (argc == 1) usage(); arguments(argc, argv); install_rc(); // install .rc file elements printf("Done. "); if (g_modIcmconf) printf("Don't forget to inspect the #defines in " "'", g_destSpec, "/icmconf'\n\n"); else printf("'", g_destSpec, "/icmconf' not modified\n\n"); } icmake-10.03.00/scripts/ib/0000755000175000017500000000000014203741153014231 5ustar frankfrankicmake-10.03.00/scripts/ib/compileall0000644000175000017500000000265614204126313016302 0ustar frankfrank void c_compile(int prefix, string destDir, string srcDir, list cfiles) { showCd(srcDir); if (srcDir != "") srcDir += "/"; string compiler = g_compiler + " -c -o " + destDir + "/" + (string)prefix; for (int idx = listlen(cfiles); idx--; ) { string file = cfiles[idx]; system(compiler + change_ext(file, OBJ_EXT) + " " + srcDir + file); g_compiled = 1; } } void std_cpp(int ignoreMain, string destDir, int prefix, string srcDir, string library) { chdir(g_cwd); // make list of all files md(destDir); chdir(srcDir); list files = makelist(SOURCES); #ifdef MAIN if (ignoreMain) files -= (list)MAIN; #endif chdir(g_cwd); files = inspect(destDir, prefix, srcDir, files, library); if (listlen(files)) c_compile(prefix, destDir, srcDir, files); // compile files } void compileAll(string libPath) { g_compiled = 0; // use abs. path so the library can libPath = g_cwd + TMP_DIR "/" + libPath; // directly be located // compile all source files for (int idx = g_nClasses; idx--; ) std_cpp(0, TMP_DIR + "/o", idx + 1, g_classes[idx], libPath); // compile all files in g_cwd std_cpp(1, TMP_DIR + "/o", 0, ".", libPath); } icmake-10.03.00/scripts/ib/inspect0000644000175000017500000000464514204126313015626 0ustar frankfrank// when inspecting files in the srcList they are compaired with // their object files and possibly a library. // When no library is constructed, the name of the library that would // otherwise be constructed is specified. // // The following truth table covers the various possibilities: // // --------------------------------------------------------------------- // time scale source older remove // <---------------------> obj lib compile fm list remark // --------------------------------------------------------------------- // src obj + - - + // obj src - - + - // src lib - + - + // lib src - - + - // src {lib,obj} + + - + // lib src obj + - - + 1 // obj src lib - + + - 2 // {obj,lib} src - - + - // --------------------------------------------------------------------- // remarks: 1: src was compiled, but not yet added to the lib // (e.g., because the next compilation failed) // 2: the library was updated after the latest change to // src. In that case obj won't exist anymore: this // case doesn't exist, and can be ignored. // // conclusion: src is compiled if src older obj or src older lib. 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 for (int idx = listlen(srcList); idx--; ) { string file = srcList[idx]; string source = srcDir + file; string ofile = oprefix + change_ext(file, "o"); // make o-filename // printf("inspect: source: ", source, ", ofile: ", ofile, ", lib: ", // library, "\n"); #ifdef USE_ALL if (ofile older all) { if (listfind(srcList, file) == -1) srcList += (list)file; } else #endif if (source older ofile || source older library) srcList -= (list)file; } return srcList; } icmake-10.03.00/scripts/ib/setopt0000644000175000017500000000022114204126313015461 0ustar frankfrankstring setOpt(string install_im, string envvar) { list optvar = getenv(envvar); return optvar[0] == "1" ? optvar[1] : install_im; } icmake-10.03.00/scripts/ib/storegch0000644000175000017500000000066514204126313015775 0ustar frankfrankvoid moveGch(string from, string gchBase) { from += '/' + gchBase + IH + ".gch"; if (exists(from)) exec("mv " + from + ' ' + g_gchDir + '/'); } void storeGch() { // printf("STOREGCH\n"); echo(OFF); chdir(g_cwd); for (int idx = listlen(g_classes); idx--; ) { string class = g_classes[idx]; moveGch(class, class); } if (g_mainBase != "") moveGch(".", g_mainBase); } icmake-10.03.00/scripts/ib/link0000644000175000017500000000255614204126313015115 0ustar frankfrank // flag must start with a blank (" -l", " -L") string addLibs(string spec, string flag) { string ret; list cut = strtok(spec, " "); // cut up the specification for (int idx = 0, end = listlen(cut); idx != end; ++idx) ret += flag + cut[idx]; return ret; } #ifdef ADD_LIBRARIES string useLibs() { return addLibs(ADD_LIBRARIES, " -l") + addLibs(ADD_LIBRARY_PATHS, " -L"); } #endif // the binary is installed under TMP_DIR void link(string maino) { chdir(TMP_DIR); string compiler = g_compiler + " -o bin/binary " + maino; #ifdef LIBRARY compiler += " -l" LIBRARY " -L."; #else if (listlen(makelist("o/*" OBJ_EXT))) compiler += " o/*" OBJ_EXT; #endif #ifdef ADD_LIBRARIES compiler += useLibs(); // use extra libraries (if specified) #endif #ifdef LDFLAGS compiler += " " + setOpt(LDFLAGS, "LDFLAGS"); #else #ifdef LINKER_OPTIONS compiler += " " + LINKER_OPTIONS; #endif #endif #ifndef REFRESH // then check for the need to refresh if (g_compiled || maino younger "../bin/binary" #ifdef LIBRARY || "lib" LIBRARY ".a" younger "../bin/binary" #endif ) #endif { showCd(TMP_DIR); system(compiler); } chdir(""); } icmake-10.03.00/scripts/ib/cleanprecomp0000644000175000017500000000065214204126313016623 0ustar frankfrankvoid cleanPrecomp(string msg) { #ifdef PRECOMP printf(msg); echo(OFF); exec("rm -rf " + g_gchDir); for (int idx = listlen(g_classes); idx--; ) { string class = g_classes[idx]; exec("rm -f " + class + '/' + class + IH ".gch"); } #ifdef MAIN exec("rm -f " + g_mainBase + IH ".gch"); #endif #endif exit(0); } icmake-10.03.00/scripts/ib/buildlibraries0000644000175000017500000000113714204126313017146 0ustar frankfrankvoid build_libraries() { libraryPreamble(); #ifdef LIBRARY string libName = "lib" LIBRARY ".a"; #else string libName = "lib.a"; #endif compileAll(libName); // the static or pseudolibrary name // (not used at this point) #ifdef LIBRARY // a library must be built static_library(); // make the library #ifdef SHARED chdir(g_cwd); shared_library(); // maybe make the shared lib. #endif #endif chdir(g_cwd); } icmake-10.03.00/scripts/ib/setgcompiler0000644000175000017500000000103714204126313016646 0ustar frankfrankvoid setGcompiler() { // try a C++ compiler; if not found: try a C compiler; if not found // try COMPILER. // Same for matching options. #ifdef CXX g_compiler = setOpt(CXX, "CXX") + " " + setOpt(CXXFLAGS, "CXXFLAGS"); #else #ifdef CC g_compiler = setOpt(CC, "CC") + " " + setOpt(CFLAGS, "CFLAGS"); #else #ifdef COMPILER #ifdef COMPILER_OPTIONS g_compiler = COMPILER + " " + COMPILER_OPTIONS; #endif #endif // COMPILER #endif // CC #endif // CXX } icmake-10.03.00/scripts/ib/sharedlibrary0000644000175000017500000000122314204126313017001 0ustar frankfrankvoid shared_library() { string libso = "lib" LIBRARY ".so"; string libsoshared = libso + "." + g_version; g_compiler += " -fPIC "; // add the option for a shared lib compileAll(libsoshared); if (!g_compiled) return; string libsomajor = libso + "." + element(0, strtok(g_version, ".")); chdir(TMP_DIR); system(g_compiler + " -shared -Wl,--as-needed,-z,defs,-soname," + libsomajor + " -o " + libsoshared + " o/*.o " SHAREDREQ); system("ln -sf " + libsoshared + " " + libsomajor); system("ln -sf " + libsomajor + " " + libso); } icmake-10.03.00/scripts/ib/cleantmp0000644000175000017500000000041514204126313015753 0ustar frankfrankvoid cleanTmp() { printf("removing files in TMP_DIR except gch\n"); echo(OFF); chdir(TMP_DIR); list tmp = makelist(O_ALL, "*") - ["gch"]; for(int idx = 0, end = listlen(tmp); idx != end; ++idx) system("rm -r " + tmp[idx]); exit(0); } icmake-10.03.00/scripts/ib/checklexer0000644000175000017500000000150614204126313016267 0ustar frankfrankvoid checkLexer() // check updating 'lexer' { chdir(SCANNER_DIR); #ifdef PARSER_DIR int rerun = PARSER_DIR != "" && "../"PARSER_DIR"/"PARSOUT younger SCANOUT; if (!rerun) { list scanfiles = makelist(PARSSPEC) + makelist(SCANSPEC); #else int rerun = 0; { list scanfiles = makelist(SCANSPEC); #endif #ifdef SCANFILES scanfiles += makelist(SCANFILES); #endif for (int idx = listlen(scanfiles); idx--; ) { if (scanfiles[idx] younger SCANOUT) { showCd(SCANNER_DIR); rerun = 1; break; } } } if (rerun) system(SCANGEN " " SCANFLAGS " " SCANSPEC); chdir(".."); } icmake-10.03.00/scripts/ib/librarypreamble0000644000175000017500000000164614204126313017333 0ustar frankfrankvoid checkVersion() { string version = "version" + get_dext(SOURCES); if (exists(version) && ( "VERSION" younger version || "YEARS" younger version || "AUTHOR" younger version ) ) { echo(OFF); system("touch " + version); echo(USE_ECHO); } } void libraryPreamble() { #ifdef PARSER_DIR if (PARSER_DIR != "") checkGrammar(); #endif #ifdef SCANNER_DIR if (SCANNER_DIR != "") checkLexer(); #endif #ifdef PRECOMP list classes = makelist(O_SUBDIR, "*"); loadPrecompile(classes); #endif if (strlen(ICM_DEP)) // inspect gch and a files system("icmake -d " ICM_DEP); #ifdef PRECOMP precompileHeaders(classes); // store .gch in class dirs #endif checkVersion(); // VERSION younger version.cc ? } icmake-10.03.00/scripts/ib/clean0000644000175000017500000000023014204126313015225 0ustar frankfrankvoid clean() { #ifdef USE_ALL cleanUseAll(); #endif system("rm -rf " TMP_DIR); cleanPrecomp(""); // exits } icmake-10.03.00/scripts/ib/md0000644000175000017500000000012114204126313014542 0ustar frankfrankvoid md(string dir) { if (!exists(dir)) system("mkdir -p " + dir); } icmake-10.03.00/scripts/ib/showcd0000644000175000017500000000015414204126313015437 0ustar frankfrankvoid showCd(string dir) { if (USE_ECHO) printf("\n" "chdir ", dir, "\n"); } icmake-10.03.00/scripts/ib/stripshared0000644000175000017500000000043614204126313016503 0ustar frankfrankvoid strip_shared() { #ifdef LIBRARY string libsoshared = "lib" LIBRARY ".so." + g_version; chdir(TMP_DIR); if (exists(libsoshared)) system("strip --strip-unneeded " + libsoshared); else printf("Can't find " TMP_DIR "/" + libsoshared + "\n"); #endif } icmake-10.03.00/scripts/ib/precompileheaders0000644000175000017500000000260714204126313017650 0ustar frankfrankvoid precompile(string class) { string classIH = class + IH; if (!exists(classIH)) { printf << "[Warning] directory " << class << " has no `" << classIH << "' file: maybe remove `" << class << "' from CLASSES?\n"; return; } string classGch = classIH + ".gch"; // if a directory listed in CLASSES has no sources, // then it doesn't need a .gch file: to satisfy icm-dep // a fake .gch file is created if (listlen(makelist(SOURCES)) == 0) { #ifndef NO_PRECOMP_WARNING if (classGch older classIH) printf << "[Warning] no sources in " << class << ": header not precompiled\n"; #endif echo(0); system("touch " + classGch); echo(USE_ECHO); return; } // if the current gch file is older than the IH file then renew // the gch file if (classGch older classIH) system(g_compiler + " " PRECOMP " " + classIH); } void precompileHeaders(list classes) { for (int idx = listlen(g_classes); idx--; ) { string class = g_classes[idx]; chdir(class); precompile(class); chdir(g_cwd); } #ifdef MAIN // if a main source file exists precompile(g_mainBase); // then precompile main.ih #endif } icmake-10.03.00/scripts/ib/loadprecompile0000644000175000017500000000136514204126313017154 0ustar frankfrankvoid loadClass(string class) { string classIH = class + IH; string classGch = classIH + ".gch"; string storedGch = g_cwd + g_gchDir + '/' + classGch; // if the gch file doesn't exist but the gch file in gchDir does // then mv the gchDir file to the current directory if (!exists(classGch) && exists(storedGch)) { echo(OFF); system("mv " + storedGch + " ."); echo(USE_ECHO); } } void loadPrecompile(list classes) { for (int idx = listlen(g_classes); idx--; ) { string class = g_classes[idx]; chdir(class); loadClass(class); chdir(g_cwd); } #ifdef MAIN loadClass(g_mainBase); // load the main.ih.gch file #endif } icmake-10.03.00/scripts/ib/getcommand0000644000175000017500000000301614204126313016266 0ustar frankfrankvoid getCommand(list argv) { // find the option g_option = listfind(g_options, argv[1]); // command is argv[1] unless an option was // specified, then it's argv[2] // determine the command index: string cmd = argv[1 + (g_option != _notFound)]; g_command = listfind(g_commands, cmd); if (g_option != _h) { if (g_command == _notFound) { int opt = g_option; // remember the option g_option = _h; // force -h unless DEFCOM specifies the cmd #ifdef DEFCOM if (!cmd) // cmd is empty: inspect DEFCOM { g_command = listfind(g_commands, DEFCOM); if (g_command >= _library) // correct DEFCOM value g_option = opt; // reset the option } #endif } else if (g_command == _install) { // e.g., program, shared g_installType = listfind(g_installArgs, argv[2 + (g_option != _notFound)]); if (g_installType == _notFound) g_option = _h; else // e.g. /usr/local/bin g_installDest = argv[3 + (g_option != _notFound)]; } } if (g_option == _h) { exec("icmbuild -h"); exit(0); } } icmake-10.03.00/scripts/ib/staticlibrary0000644000175000017500000000033714204126313017027 0ustar frankfrankvoid static_library() { chdir(TMP_DIR + "/o"); if (g_compiled) { system("ar cr ../lib" LIBRARY + ".a *" OBJ_EXT); system("ranlib ../lib" LIBRARY + ".a"); system("rm *" OBJ_EXT); } } icmake-10.03.00/scripts/ib/checkgrammar0000644000175000017500000000111514204126313016572 0ustar frankfrankvoid checkGrammar() // check updating 'grammar' { chdir(PARSER_DIR); list gramfiles = makelist(PARSSPEC); #ifdef PARSFILES gramfiles += makelist(PARSFILES); #endif for (int idx = listlen(gramfiles); idx--; ) { 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(".."); } icmake-10.03.00/scripts/ib/install0000644000175000017500000000220514204126313015615 0ustar frankfrankvoid installFile(string source) { string path = get_path(g_installDest); // make sure the dest. path if (path != "") // exists md(path); if (exists(source)) system("install " + (g_option == _s ? "-s " : "") + source + ' ' + g_installDest); else printf('`', source, "' not found\n"); } void install() { printf("INSTALL ", g_installType, ' ', g_installDest, g_option == _s ? ", stripped\n" : "\n"); if (g_installType == _iProgram) installFile(TMP_DIR + "/bin/binary"); #ifdef LIBRARY else if (g_installType == _iStatic) installFile(TMP_DIR + "/lib" LIBRARY ".a"); #ifdef SHARED else if (g_installType == _iShared) { md(g_installDest); if (g_option == _s) system("strip --strip-unneeded " TMP_DIR "/lib" LIBRARY ".so." + g_version); system("cp -d " TMP_DIR "/lib" LIBRARY ".so.* " + g_installDest); } #endif // SHARED #endif // LIBRARY exit(0); } icmake-10.03.00/scripts/ib/setclasses0000644000175000017500000000324014204126313016320 0ustar frankfrankint readLine() // 1: line was read from CLASSES, { // 0: no line g_classLine = fgets("CLASSES", g_classLine); return listlen(g_classLine) && g_classLine[2] == "OK"; } int empty(list entries) { return !entries || entries[0][0] == '#' || strfind(entries[0], "//") == 0; } string nextClassesEntry() { list parts; while (readLine()) { string line = g_classLine[0]; int last = strlen(line) - 1; int bs = line[last] == '\\'; if (bs) line = resize(line, last); // remove the backslash list entries = strtok(line, " \t"); // entries on the line if (empty(entries)) // blank or comment { if (!parts) // nothing collected yet continue; break; // or return the 1st element } parts += (list)entries[0]; if (bs) continue; break; } return parts ? parts[0] : ""; } void setClasses() { #ifdef SCANNER_DIR // scanner/parser directories must be // first, to avoid reordering 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 while (1) { string class = nextClassesEntry(); if (strlen(class) == 0) break; // if (!hasSources(class)) // continue; g_classes = listunion(g_classes, class); } g_nClasses = listlen(g_classes); } icmake-10.03.00/scripts/ib/program0000644000175000017500000000076714204126313015631 0ustar frankfrankvoid program() { #ifdef MAIN string maino = change_ext(MAIN, OBJ_EXT); md(TMP_DIR "/bin"); int compileMain = 0; #ifdef USE_ALL compileMain = exists(USE_ALL); #endif if (compileMain || MAIN younger TMP_DIR + "/" + maino) { printf("\n" "RECOMPILE: " MAIN "\n"); system(g_compiler + " -c -o " + TMP_DIR + "/" + maino + " " MAIN); } link(maino); #endif } icmake-10.03.00/scripts/ib/cleanuseall0000644000175000017500000000021114204126313016432 0ustar frankfrankvoid cleanUseAll() { chdir(g_cwd); echo(OFF); exec("find ./ -name " + USE_ALL + " -exec rm '{}' \\;"); echo(USE_ECHO); } icmake-10.03.00/scripts/ib/main0000644000175000017500000000254614204126313015103 0ustar frankfrankvoid main(int argc, list argv, list envp) { echo(USE_ECHO); setGcompiler(); getCommand(argv); // determine command and option setClasses(); // assign g_classes and g_nClasses // note: also used by clean() #ifdef MAIN g_mainBase = get_base(MAIN); // also used by clean() #endif // run the requested command: if (g_command == _clean) // completely clean tmp and clean(); // locally defined precompiled headers if (g_command == _cleanTmp) // keep the .gch files if existing. cleanTmp(); if (g_command == _cleanGch) cleanPrecomp("removing all precompiled headers\n"); #ifdef PRECOMP md(g_gchDir); #endif if (g_command == _install) install(); // install a compiled product #ifdef CLS g_option = _c; #endif if (g_option == _c) // clear the screen before compilation system("tput clear"); // starts // compile all sources except MAIN build_libraries(); // if PRECOMP then precompiles headers if (g_command == _program) program(); #ifdef USE_ALL cleanUseAll(); #endif #ifdef PRECOMP storeGch(); #endif } icmake-10.03.00/scripts/icmbuild.in0000644000175000017500000000476514204126313015767 0ustar frankfrank#include "icmconf" #ifndef USE_ECHO #define USE_ECHO ON #endif #ifdef USE_VERSION #include "VERSION" #else #define VERSION "0.01.00" #endif #ifndef ICM_DEP #define ICM_DEP "-V go" #endif list g_classes; // all class-directories int g_nClasses; // number of class-directories list g_classLines; // list of all lines in CLASSES list g_classLine; // line of the CLASSES file string g_mainBase; // basename of MAIN if a program is built. // this becomes the name of the .gch file in the // base directory. It is not used with library // constructions. #define _c 0 // option values #define _s 1 #define _h 2 list g_options = ["-c", "-s", "-h"]; int g_option; // specified option #define _notFound -1 // command to execute see also function getCommand below. #define _clean 0 #define _cleanTmp 1 #define _cleanGch 2 #define _install 3 #define _library 4 #define _program 5 list g_commands = ["clean", "cleantmp", "cleangch", "install", "library", "program"]; int g_command; // specified command #define _iProgram 0 #define _iStatic 1 #define _iShared 2 list g_installArgs = ["program", "static", "shared" ]; int g_installType; string g_installDest; // path to install compiled products in int g_compiled; // set to 1 if at least one source was compiled // (used by REFRESH to relink the program) string g_version = VERSION; string g_compiler; string g_cwd = chdir(""); // initial working directory string g_gchDir = TMP_DIR + "/gch"; // storage of .gch files #include "ib/md" #include "ib/showcd" #include "ib/setopt" #include "ib/setgcompiler" #ifdef PARSER_DIR #include "ib/checkgrammar" #endif #ifdef SCANNER_DIR #include "ib/checklexer" #endif #include "ib/setclasses" #ifdef USE_ALL #include "ib/cleanuseall" #endif #include "ib/cleanprecomp" #include "ib/cleantmp" #include "ib/clean" // #include "ib/stripshared" #include "ib/install" #include "ib/inspect" #include "ib/compileall" #ifdef LIBRARY #include "ib/staticlibrary" #ifdef SHARED #include "ib/sharedlibrary" #endif #endif #ifdef PRECOMP #include "ib/loadprecompile" #include "ib/precompileheaders" #endif #include "ib/librarypreamble" #include "ib/buildlibraries" #include "ib/link" #include "ib/program" #include "ib/getcommand" #ifdef PRECOMP #include "ib/storegch" #endif #include "ib/main" icmake-10.03.00/scripts/catim0000755000175000017500000000141614204126313014660 0ustar frankfrank#!/bin/bash IFS=" " echo "// This file does not contain additional comment. // Comment is provided in the distribution files under ./scripts " while read -r line ; do echo "$line" | grep '^#include "'$1'/' > /dev/null # find the #includes if [ $? -ne 0 ] ; then # no include echo "$line" else # found #include line=`echo "$line" | sed 's|#include "'$1'/\([a-z]\+\).*|\1|'` cat $1/$line fi done | sed ' s|\s*//[^"].*|| s|\s*//\s*$||' | grep -v '^$' | sed 's|%%|//|g' # remove spaces followed by // until the end of the line # remove end of line comment, remove empty lines, but keep # string constants (may not contain \" escape characters) icmake-10.03.00/scripts/icmstart.in0000644000175000017500000000365614204126313016023 0ustar frankfrankstring 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 = [ "program", "library" ]; string g_destPath; string g_destSpec; string g_cwd = chdir(""); string g_icmconf; list g_mkdir; //list g_installed; // possible initial actions on rc-file lines list g_actions = ["b", "P", "L", "D", "PD", "Pb", "bP", "DP", "pL", "Lp", "LD", "DL"]; int g_confirmInstall = 0; int g_skeletons = 1; int g_replace = 0; int g_debug = 0; int g_askReplace = 1; int g_version = 1; int g_basic = 0; int g_modIcmconf = 1; int g_fileStat = 0; // assigned by isFileOrDir check for S_IFREG / S_IFDIR #include "is/usage" #include "is/quit" #include "is/isfileordir" #include "is/isfile" //void ignore(string dest) //{ // g_installed += (list)(g_destPath + dest); //} #include "is/syscall" #include "is/md" #include "is/readlink" #include "is/abspath" #include "is/abssource" #include "is/absdest" #include "is/arguments" #include "is/replace" #include "is/installok" #include "is/installentry" #include "is/findin" #include "is/findfile" #include "is/versionfield" #include "is/installversion" #include "is/checkdefcom" #include "is/confirminstall" #include "is/shift" #include "is/skip" #include "is/getsourcedest" #include "is/installline" #include "is/installrc" void main(int argc, list argv) { echo(OFF); if (argc == 1) usage(); arguments(argc, argv); // determine all options and commands // (stored in the g_ variables at the top) install_rc(); // install .rc file elements printf("Done. "); if (g_modIcmconf) printf("Don't forget to inspect the #defines in " "'", g_destSpec, "/icmconf'\n\n"); else printf("'", g_destSpec, "/icmconf' not modified\n\n"); } icmake-10.03.00/scripts/conversions0000644000175000017500000000241314204126313016126 0ustar frankfrankCONFIG=INSTALL.im . VERSION . tmp/ROOT ROOT=`echo ${ROOT}/ | sed 's,//,/,g' | sed 's,//,/,g'` EXTENSION=`grep '^#' $CONFIG | grep "#define[[:space:]]\+EXTENSION" | \ sed 's,.*EXTENSION[[:space:]]\+\"\([^"]*\)".*,'${ROOT}'\1,'` BINDIR=`grep "#define[[:space:]]\+BINDIR" $CONFIG | \ sed 's,.*BINDIR[[:space:]]\+\"\([^"]\+\)".*,'${ROOT}'\1,'` SKELDIR=`grep "#define[[:space:]]\+SKELDIR" $CONFIG | \ sed 's,.*SKELDIR[[:space:]]\+\"\([^"]\+\)".*,'${ROOT}'\1,'` MANDIR=`grep "#define[[:space:]]\+MANDIR" $CONFIG | \ sed 's,.*MANDIR[[:space:]]\+\"\([^"]\+\)".*,'${ROOT}'\1,'` LIBDIR=`grep "#define[[:space:]]\+LIBDIR" $CONFIG | \ sed 's,.*LIBDIR[[:space:]]\+\"\([^"]\+\)".*,'${ROOT}'\1,'` CONFDIR=`grep "#define[[:space:]]\+CONFDIR" $CONFIG | \ sed 's,.*CONFDIR[[:space:]]\+\"\([^"]\+\)".*,'${ROOT}'\1,'` DOCDIR=`grep "#define[[:space:]]\+DOCDIR" $CONFIG | \ sed 's,.*DOCDIR[[:space:]]\+\"\([^"]\+\)".*,'${ROOT}'\1,'` DOCDOCDIR=`grep "#define[[:space:]]\+DOCDOCDIR" $CONFIG | \ sed 's,.*DOCDOCDIR[[:space:]]\+\"\([^"]\+\)".*,'${ROOT}'\1,'` CPPFLAGS=`grep "#define[[:space:]]\+CPPFLAGS" $CONFIG | sed 's,^.[^"]*,,'` LDFLAGS=`grep "#define[[:space:]]\+LDFLAGS" $CONFIG | sed 's,^.[^"]*,,'` icmake-10.03.00/support/0000755000175000017500000000000014204242723013664 5ustar frankfrankicmake-10.03.00/support/tools/0000755000175000017500000000000014204245200015015 5ustar frankfrankicmake-10.03.00/support/tools/tools.ih0000644000175000017500000000033414204126313016502 0ustar frankfrank#include "tools.h" #include #include #include #include #include "../../tmp/INSTALL.im" #include "../../xerr/xerr.ih" using namespace std; using namespace FBB; icmake-10.03.00/support/tools/younger.cc0000644000175000017500000000150114204126313017014 0ustar frankfrank//#define XERR #include "tools.ih" // return true if the entry is younger than the referenceTime // non-existing entries return the begin of the epoch as last modification // time, so: // if both don’t exist 0 is returned; // if the reference doesn’t exist, 1 is returned; // if the entry doesn’t exist 0 is returned; // if they are equally old 0 is returned. // static bool Tools::younger(string const &entry, Stat const &rhs) { auto modifications = times(entry, rhs); xerr("lhs (" << \ modifications.first % 1'000'000 << \ ") > rhs (" << \ modifications.second % 1'000'000 << \ ") ? " << \ (modifications.first > modifications.second) ); return modifications.first > modifications.second; } icmake-10.03.00/support/tools/tools.h0000644000175000017500000000357214204171312016337 0ustar frankfrank#ifndef INCLUDED_TOOLS_ #define INCLUDED_TOOLS_ #include #include #include #include namespace FBB { class Stat; } class Tools { public: static bool exists(std::string const &path); // these use static bool remove(std::string const &path); // 'filesystem' static bool changeDir(std::string const &path); // static void mustChangeDir(std::string const &path); // throws an // exception on // failure static bool younger(std::string const &entry, FBB::Stat const &rhs); static bool older(std::string const &entry, FBB::Stat const &rhs); // convert main version number // to unsigned (>a -> >10) static unsigned versionNr(char const *version); // append Type's bytes to dest template // 1.f static void append(std::string &dest, Type value); template // 2.f static void append(std::string &dest, Type value); static std::ostream &usageTop(std::string const &progname, bool showUsage = true); private: // determine last modification seconds // of 'entry' and an existing Stat static std::pair times(std::string const &entry, FBB::Stat const &rhs); }; #include "append1.f" #include "append2.f" #include "versionnr.f" #endif icmake-10.03.00/support/tools/mustchangedir.cc0000644000175000017500000000026614204126313020170 0ustar frankfrank//#define XERR #include "tools.ih" // static void Tools::mustChangeDir(string const &path) { if (not changeDir(path)) throw Exception{} << "cannot chdir to " << path; } icmake-10.03.00/support/tools/versionnr.f0000644000175000017500000000043714204126313017220 0ustar frankfrank//#define XERR #include "tools.ih" // static inline unsigned Tools::versionNr(char const *version) { return stoul(version, 0, *version <= '9' ? 10 : 36); // *version > '9' -> letter -> // 26 letters + 10 digits -> base = 36 } icmake-10.03.00/support/tools/append1.f0000644000175000017500000000020514204126313016514 0ustar frankfrank// static template inline void Tools::append(std::string &dest, Type value) { append(dest, value); } icmake-10.03.00/support/tools/usagetop.cc0000644000175000017500000000055014204171312017155 0ustar frankfrank//#define XERR #include "tools.ih" // static ostream &Tools::usageTop(string const &progname, bool showUsage) { cout << '\n' << progname << " by " AUTHOR "\n" << progname << " V" VERSION "\n" "Copyright (c) GPL " YEARS ". NO WARRANTY.\n" "\n"; if (showUsage) cout << "Usage: " << progname; return cout; } icmake-10.03.00/support/tools/older.cc0000644000175000017500000000121614204126313016434 0ustar frankfrank//#define XERR #include "tools.ih" // return true if the entry is older than the referenceTime // non-existing entries return the begin of the epoch as last modification // time, so: // if both don’t exist 0 is returned; // if the reference doesn’t exist, 1 is returned; // if entry doesn’t exist 0 is returned; // if they are equally old 0 is returned. // static bool Tools::older(string const &entry, Stat const &rhs) { auto modifications = times(entry, rhs); xerr(modifications.first << " < " << modifications.second); return modifications.first < modifications.second; } icmake-10.03.00/support/tools/frame0000644000175000017500000000006014204126313016031 0ustar frankfrank//#define XERR #include "tools.ih" Tools:: { } icmake-10.03.00/support/tools/changedir.cc0000644000175000017500000000032614204126313017254 0ustar frankfrank//#define XERR #include "tools.ih" // static bool Tools::changeDir(string const &path) { error_code ec; filesystem::current_path(path, ec); return not ec; // ec: true, then couldn't chdir } icmake-10.03.00/support/tools/times.cc0000644000175000017500000000046314204126313016453 0ustar frankfrank//#define XERR #include "tools.ih" // static pair Tools::times(string const &entry, Stat const &rhs) { Stat lhs = Stat{ entry }; return { lhs ? lhs.lastModification().utcSeconds() : 0, rhs ? rhs.lastModification().utcSeconds() : 0 }; } icmake-10.03.00/support/tools/exists.cc0000644000175000017500000000022614204126313016646 0ustar frankfrank//#define XERR #include "tools.ih" // static bool Tools::exists(string const &path) { error_code ec; return filesystem::exists(path, ec); } icmake-10.03.00/support/tools/append2.f0000644000175000017500000000032114204126313016514 0ustar frankfrank// static template void Tools::append(std::string &dest, Type value) { char *cp = reinterpret_cast(&value); dest += std::string{ cp, cp + sizeof(UseType) }; } icmake-10.03.00/support/tools/remove.cc0000644000175000017500000000022614204126313016624 0ustar frankfrank//#define XERR #include "tools.ih" // static bool Tools::remove(string const &path) { error_code ec; return filesystem::remove(path, ec); } icmake-10.03.00/support/endian/0000755000175000017500000000000014204245200015113 5ustar frankfrankicmake-10.03.00/support/endian/endian.h0000644000175000017500000000541714204155203016534 0ustar frankfrank#ifndef INCLUDED_ENDIAN_ #define INCLUDED_ENDIAN_ #include #include #include class Endian { union LBE // little/big endian { short uShort; char chars[2]; }; static LBE const s_lbe; static bool const s_little; // true: little endian template static Type (*s_endian)(Type value); public: static bool littleEndian(); template static Type endian(Type value); template // append value to code's text static void endian(std::string *code, Type value); template static void endian(char *code, Type value); }; inline bool Endian::littleEndian() { return s_little; } template // returns BE binary value representations Type Endian::endian(Type value) // on BE machines { if (s_little or sizeof(Type) == 1) return value; union Xform { Type value; uint8_t bytes[sizeof(Type)]; }; Xform xform{ value }; for (size_t lhs = 0, rhs = sizeof(Type); lhs != rhs--; ++lhs) { std::swap(xform.bytes[lhs], xform.bytes[rhs]); } return xform.value; } // appends value's bytes to *code, using // BE's binary value representations template // on BE machines void Endian::endian(std::string *code, Type value) { if (sizeof(Type) == 1) { *code += static_cast(value); return; } union Xform { Type value; uint8_t bytes[sizeof(Type)]; }; Xform xform{ value }; if (s_little) { std::for_each(xform.bytes, xform.bytes + sizeof(Type), [&](uint8_t byte) { *code += byte; } ); } else { for (size_t nr = sizeof(Type); nr; ) // modified canonical for-loop: *code += xform.bytes[--nr]; // here nr is converted to idx } } // stores value's bytes to *code and // beyond, using BE's binary value template // representations on BE machines void Endian::endian(char *code, Type value) { if (sizeof(Type) == 1) { *code = static_cast(value); return; } union Xform { Type value; uint8_t bytes[sizeof(Type)]; }; Xform xform{ value }; if (s_little) std::copy(xform.bytes, xform.bytes + sizeof(Type), code); else std::reverse_copy(xform.bytes, xform.bytes + sizeof(Type), code); } #endif icmake-10.03.00/support/endian/data.cc0000644000175000017500000000021714204133257016343 0ustar frankfrank#include "endian.ih" Endian::LBE const Endian::s_lbe = { 0x102 }; bool const Endian::s_little = s_lbe.chars[0] == 2; // true: little endian icmake-10.03.00/support/endian/endian.ih0000644000175000017500000000011114204133257016674 0ustar frankfrank#include "endian.h" #include "../../xerr/xerr.ih" using namespace std; icmake-10.03.00/support/endian/demo.cc0000644000175000017500000000104514204171312016350 0ustar frankfrank//#include // //#include "endian.h" // //// Endian::LBE const Endian::s_lbe = { 0x102 }; //// bool const Endian::s_little = s_lbe.chars[0] == 2; // true: little endian //// bool const Endian::s_little = s_lbe.chars[0] != 2; // true: little endian // //using namespace std; // //int main() //{ // cout << hex; // cin >> hex; // // while (true) // { // cout << "? "; // int value; // cin >> value; // // cout << value << " -> " << Endian::endian(value) << '\n'; // } //} // // icmake-10.03.00/support/endian/frame0000644000175000017500000000006214204133257016136 0ustar frankfrank//#define XERR #include "endian.ih" Endian:: { } icmake-10.03.00/support/typedefs/0000755000175000017500000000000014203741153015507 5ustar frankfrankicmake-10.03.00/support/typedefs/typedefs.h0000644000175000017500000000052614204126313017502 0ustar frankfrank#ifndef INCLUDED_TYPEDEFS_ #define INCLUDED_TYPEDEFS_ #include #include typedef std::vector BoolVect; typedef std::vector BoolMatrix; typedef std::vector StringVect; typedef std::vector StringMatrix; typedef std::vector UnsignedVect; #endif icmake-10.03.00/support/icm_bootstrap0000755000175000017500000000022214204126313016447 0ustar frankfrank#!/bin/bash . ../bootstrap/flags . ../bootstrap/functions echo Creating tmp/libsupport.a subdirs try ar rs ../tmp/libsupport.a *.o rm *.o icmake-10.03.00/support/exprtype/0000755000175000017500000000000014204245522015544 5ustar frankfrankicmake-10.03.00/support/exprtype/exprtype.ih0000644000175000017500000000010114204126313017732 0ustar frankfrank#include "exprtype.h" #include using namespace std; icmake-10.03.00/support/exprtype/opinsert.cc0000644000175000017500000000152714204126313017717 0ustar frankfrank#include "exprtype.ih" ostream &operator<<(ostream &out, ExprType type) { if (type & e_null) return out << "void"; out << "[ "; if (type & e_int) out << "int "; else if (type & e_str) out << "string "; else if (type & e_list) out << "list "; if (type & e_bool) out << "bool "; if (type & e_const) out << "const "; else if (type & e_var) out << "var "; else if (type & e_reg) out << "reg "; else if (type & e_stack) out << "stack "; if (type & e_prefix) out << "prefix "; else if (type & e_postfix) out << "postfix "; else if (type & e_order) out << "order "; else if (type & e_printf) out << "printf "; else if (type & e_fprintf) out << "fprintf "; return out << ']'; } icmake-10.03.00/support/exprtype/exprtype.h0000644000175000017500000000252114204126313017571 0ustar frankfrank#ifndef INCLUDED_EXPRTYPE_ENUM_H_ #define INCLUDED_EXPRTYPE_ENUM_H_ enum ExprType { e_null = 0, e_void = 0, // rss + compiler: 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), // 8: bool-type expression // also: main() not yet defined e_intMask = e_int | e_bool, e_mask = (e_int | e_list | e_str | e_bool), // result type (set by icm-comp SemVal::setResult) e_const = (1 << 4), // 0x10 immediate value e_var = (1 << 5), // 0x20 variable (accepting assignment) e_reg = (1 << 6), // 0x40 (return values from functions) e_stack = (1 << 7), // 0x80 (tmp) value available on the stack e_prefix = (1 << 8), // pre-inc or pre-dec e_postfix = (1 << 9), // post-inc or post-dec e_order = (1 << 10), // parser/inc/args: older, younger e_printf = (1 << 11), // parser/semval: printf calls e_fprintf = (1 << 12), // used for 'printf <<' expreessions e_printMask = e_printf | e_fprintf, }; #endif icmake-10.03.00/support/builtinfunctions/0000755000175000017500000000000014204245200017254 5ustar frankfrankicmake-10.03.00/support/builtinfunctions/name.f0000644000175000017500000000017514204126313020351 0ustar frankfrank// static inline char const *BuiltinFunctions::name(uint8_t index) { return s_name[index] + (s_name[index][0] == ' '); } icmake-10.03.00/support/builtinfunctions/find.cc0000644000175000017500000000071114204126313020505 0ustar frankfrank//#define XERR #include "builtinfunctions.ih" BuiltinFunctions::Function BuiltinFunctions::find(string const &name) { // added space to allow 'backtick' function names string const &searchName = name == "`" ? " backtick"s : name; auto iter = find_if(s_name, s_name + BuiltinSize, [&](char const *funName) { return searchName == funName; } ); return as(iter - s_name); } icmake-10.03.00/support/builtinfunctions/builtinfunctions.ih0000644000175000017500000000016314204126313023200 0ustar frankfrank#include "builtinfunctions.h" #include #include #include "../as/as.h" using namespace std; icmake-10.03.00/support/builtinfunctions/data.cc0000644000175000017500000000250614204126313020502 0ustar frankfrank#include "builtinfunctions.ih" char const *BuiltinFunctions::s_name[] = { // 0 "arghead", "argtail", "ascii_str2int", "ascii_int2str", // 4 " backtick", // added space to allow 'backtick' function names "change_base", "change_ext", "change_path", // 8 "chdir", "cmdhead", "cmdtail", "echo", // c "list_element", "eval", "exec", "execute", // 10 "exists", "fgets", "fprintf", "get_base", // 14 "get_dext", "get_ext", "get_path", "getch", // 18 "getenv", "getpid", "gets", "listlen", // 1c "makelist", "printf", "putenv", "stat", // 20 "string_element", "strfind", "strformat", "strlen", // 24 "strlwr", "resize", "strtok", "strupr", // 28 "substr", "system", "trim", "trimleft", // 2c "trimright", "strchr", "listfind", "listunion", // 30 "listConst", }; size_t BuiltinFunctions::s_nFunctions = sizeof(s_name) / sizeof(char const *); icmake-10.03.00/support/builtinfunctions/icmconf0000777000175000017500000000000014204126313023361 2../../icmconf.dirustar frankfrankicmake-10.03.00/support/builtinfunctions/nfunctions.f0000644000175000017500000000012414204126313021611 0ustar frankfrank// static inline size_t BuiltinFunctions::nFunctions() { return s_nFunctions; } icmake-10.03.00/support/builtinfunctions/builtinfunctions.h0000644000175000017500000000422714204126313023034 0ustar frankfrank#ifndef INCLUDED_BUILTINFUNCTIONS_H_ #define INCLUDED_BUILTINFUNCTIONS_H_ #include #include #include // recompile all files when a new builtin function is added class BuiltinFunctions { static char const *s_name[]; static size_t s_nFunctions; public: enum Function { // 0 ARG_HEAD, ARG_TAIL, ASCII_INT, // returns int ASCII_STR, // returns str // 4 BACKTICK, C_BASE, C_EXT, C_PATH, // 8 CHDIR, CMD_HEAD, CMD_TAIL, ECHO, // C LIST_ELEMENT, EVAL, EXEC, EXECUTE, // ONLY USED BY THE COMPILER // 10 EXISTS, FGETS, FPRINTF, G_BASE, // 14 G_DEXT, G_EXT, G_PATH, GETCH, // 18 GETENV, GETPID, GETS, LISTLEN, // 1C MAKELIST, PRINTF, PUTENV, STAT, // 20 STR_EL, STRFIND, STRFORMAT, STRLEN, // 24 STRLWR, RESIZE, STRTOK, STRUPR, // 28 SUBSTR, SYSTEM, TRIM, TRIMLEFT, // 2C TRIMRIGHT, STRCHR, LISTFIND, LISTUNION, // 30 LISTCONST, BuiltinSize // SIZE }; static Function find(std::string const &name); // BuiltinSize: // not builtin static char const *name(uint8_t index); static size_t nFunctions(); }; #include "name.f" #include "nfunctions.f" #endif icmake-10.03.00/support/opcodes/0000755000175000017500000000000014204245200015311 5ustar frankfrankicmake-10.03.00/support/opcodes/data.cc0000644000175000017500000000305014204126313016532 0ustar frankfrank//#define XERR #include "opcodes.ih" char const *Opcodes::s_mnemonic[] = { "jmp", // 00 "jmp_false", // 01 "jmp_true", // 02 "push_1_jmp_end", // 03 "push_0", // 04 "push_imm", // 05 "push_strconst", // 06 "push_var", // 07 "push_reg", // 08 "pop_var", // 09 "umin", // 0a "atoi", // 0b "itoa", // 0c "atol", // 0d "mul", // 0e "div", // 0f "mod", // 10 "add", // 11 "sub", // 12 "eq", // 13 "neq", // 14 "sm", // 15 "gr", // 16 "younger", // 17 "older", // 18 "smeq", // 19 "greq", // 1a "call_rss", // 1b "asp", // 1c "exit", // 1d "copy_var", // 1e "inc", // 1f "dec", // 20 "call", // 21 "frame", // 22 "ret", // 23 "pop_reg", // 24 "band", // 25 "bor", // 26 "bnot", // 27 "bxor", // 28 "shl", // 29 "shr", // 2a "invalid", // 2b }; icmake-10.03.00/support/opcodes/opcodes.ih0000644000175000017500000000011414204126313017266 0ustar frankfrank#include "opcodes.h" #include "../../xerr/xerr.ih" using namespace std; icmake-10.03.00/support/opcodes/mnemonic.f0000644000175000017500000000014214204126313017265 0ustar frankfrank// static inline char const *Opcodes::mnemonic(uint8_t opCode) { return s_mnemonic[opCode]; } icmake-10.03.00/support/opcodes/valid.f0000644000175000017500000000012214204126313016555 0ustar frankfrank// static inline bool Opcodes::valid(uint8_t opCode) { return opCode < hlt; } icmake-10.03.00/support/opcodes/frame0000644000175000017500000000006414204126313016331 0ustar frankfrank//#define XERR #include "opcodes.ih" Opcodes:: { } icmake-10.03.00/support/opcodes/opcodes.h0000644000175000017500000000423614204126313017126 0ustar frankfrank#ifndef INCLUDED_OPCODES_ #define INCLUDED_OPCODES_ #include class Opcodes { static char const *s_mnemonic[]; public: enum Byte { // hex: jmp, // 00 jmp_false, // 01 jmp_true, // 02 push_1_jmp_end, // 03 push_0, // 04 push_imm, // 05 push_strconst, // 06 push_var, // 07 push_reg, // 08 pop_var, // 09 umin, // 0a atoi, // 0b itoa, // 0c atol, // 0d mul, // 0e div, // 0f mod, // 10 add, // 11 sub, // 12 eq, // 13 neq, // 14 sm, // 15 gr, // 16 younger, // 17 older, // 18 smeq, // 19 greq, // 1a call_rss, // 1b asp, // 1c exit, // 1d copy_var, // 1e inc, // 1f dec, // 20 call, // 21 frame, // 22 ret, // 23 pop_reg, // 24 band, // 25 bor, // 26 bnot, // 27 bxor, // 28 shl, // 29 shr, // 2a invalid, // 2b // value beyond the last opcode hlt = shr + 10, // 34 // value used by icm-exec with // makelist(...) }; static bool valid(uint8_t opCode); static char const *mnemonic(uint8_t opCode); }; #include "valid.f" #include "mnemonic.f" #endif icmake-10.03.00/support/as/0000755000175000017500000000000014204124361014264 5ustar frankfrankicmake-10.03.00/support/as/as.h0000644000175000017500000000023614204126313015040 0ustar frankfrank#ifndef INCLUDED_AS_ #define INCLUDED_AS_ template inline constexpr Out as(In &&in) { return static_cast(in); } #endif icmake-10.03.00/support/header/0000755000175000017500000000000014204245200015105 5ustar frankfrankicmake-10.03.00/support/header/header.h0000644000175000017500000000070114204171312016506 0ustar frankfrank#ifndef INCLUDED_HEADER_H_ #define INCLUDED_HEADER_H_ #include #include "../endian/endian.h" struct Header: private Endian { char version[4]; uint32_t strings; // offset of the string constant-area uint32_t variables; // offset of the variable area uint32_t filenames; // offset of the strings area uint32_t firstOpcode; // offset of the first instruction to execute void endian(); }; #endif icmake-10.03.00/support/header/endian.cc0000644000175000017500000000040514204171312016653 0ustar frankfrank#include "header.ih" void Header::endian() { if (littleEndian()) return; strings = Endian::endian(strings); variables = Endian::endian(variables); filenames = Endian::endian(filenames); firstOpcode = Endian::endian(firstOpcode); } icmake-10.03.00/support/header/header.ih0000644000175000017500000000002414204171312016655 0ustar frankfrank#include "header.h" icmake-10.03.00/support/icmconf0000644000175000017500000000116514204126760015232 0ustar frankfrank#define PRECOMP "-x c++-header" #define IH ".ih" //#define NO_PRECOMP_WARNING #define CLS #define LIBRARY "support" #define SOURCES "*.cc" #define OBJ_EXT ".o" #define TMP_DIR "tmp" #define USE_ALL "a" #define USE_ECHO ON #define CXX "g++" #define CXXFLAGS " --std=c++20 -Wall -O2" \ " -fdiagnostics-color=never " #define REFRESH #define LDFLAGS "-s" #define ADD_LIBRARIES "bobcat" #define ADD_LIBRARY_PATHS "" #define DEFCOM "library" icmake-10.03.00/support/bimheader/0000755000175000017500000000000014204245200015575 5ustar frankfrankicmake-10.03.00/support/bimheader/seek.cc0000644000175000017500000000044514204126313017041 0ustar frankfrank//#define XERR #include "bimheader.ih" void BimHeader::seekg(int32_t step, ios::seekdir dir) { d_in.seekg(step, dir); auto offset = d_in.tellg(); if (not d_in or not (codeOffset() <= offset and offset < codeEndOffset())) throw Exception{} << "jmp leaves the code area"; } icmake-10.03.00/support/bimheader/stringssection.f0000644000175000017500000000011114204126313021016 0ustar frankfrankinline void BimHeader::stringsSection() { readFrom(d_hdr.strings); } icmake-10.03.00/support/bimheader/endcode.f0000644000175000017500000000011114204126313017341 0ustar frankfrankinline bool BimHeader::endCode() { return atOffset(d_hdr.strings); } icmake-10.03.00/support/bimheader/codesection.f0000644000175000017500000000010714204126313020244 0ustar frankfrankinline void BimHeader::codeSection() { readFrom(sizeof(Header)); } icmake-10.03.00/support/bimheader/atoffset.cc0000644000175000017500000000022014204126313017714 0ustar frankfrank//#define XERR #include "bimheader.ih" bool BimHeader::atOffset(uint32_t offset) { return static_cast(d_in.tellg()) == offset; } icmake-10.03.00/support/bimheader/endstrings.f0000644000175000017500000000011614204126313020125 0ustar frankfrankinline bool BimHeader::endStrings() { return atOffset(d_hdr.variables); } icmake-10.03.00/support/bimheader/filenameoffset.f0000644000175000017500000000012214204126313020731 0ustar frankfrankinline uint32_t BimHeader::filenameOffset() const { return d_hdr.filenames; } icmake-10.03.00/support/bimheader/codeendoffset.f0000644000175000017500000000011714204126313020556 0ustar frankfrankinline uint32_t BimHeader::codeEndOffset() const { return d_hdr.strings; } icmake-10.03.00/support/bimheader/start.f0000644000175000017500000000011314204126313017077 0ustar frankfrankinline void BimHeader::start() { return readFrom(d_hdr.firstOpcode); } icmake-10.03.00/support/bimheader/startoffset.f0000644000175000017500000000012114204126313020305 0ustar frankfrankinline uint32_t BimHeader::startOffset() const { return d_hdr.firstOpcode; } icmake-10.03.00/support/bimheader/endvars.f0000644000175000017500000000011314204126313017404 0ustar frankfrankinline bool BimHeader::endVars() { return atOffset(d_hdr.filenames); } icmake-10.03.00/support/bimheader/offset.f0000644000175000017500000000010114204126313017225 0ustar frankfrankinline uint32_t BimHeader::offset() { return d_in.tellg(); } icmake-10.03.00/support/bimheader/string.cc0000644000175000017500000000030114204126313017407 0ustar frankfrank//#define XERR #include "bimheader.ih" string BimHeader::string() { std::string str; if (not getline(d_in, str, '\0')) throw Exception{} << "invalid string"; return str; } icmake-10.03.00/support/bimheader/bimname.cc0000644000175000017500000000041414204126313017516 0ustar frankfrank#define XERR #include "bimheader.ih" // static string BimHeader::bimName(char const *fname) { filesystem::path fpath{ fname }; if (not Tools::exists(fpath) and fpath.extension().empty()) fpath.replace_extension(".bim"); return fpath.string(); } icmake-10.03.00/support/bimheader/bimheader1.cc0000644000175000017500000000224014204137014020106 0ustar frankfrank#define XERR #include "bimheader.ih" BimHeader::BimHeader(char const *fname, char const *version, bool versionCheck) : d_bimName(bimName(fname)), d_in(Exception::factory(d_bimName)) { if (not d_in.read(reinterpret_cast(&d_hdr), sizeof(Header))) throw Exception{} << "cannot read header from " << d_bimName; d_hdr.endian(); // if necessary, convert to big endian if (versionCheck) { unsigned bimNr = Tools::versionNr(d_hdr.version); unsigned ourNr = Tools::versionNr(version); if (ourNr > bimNr) throw Exception{} << d_bimName << " was created with an " "older icmake version (" << bimNr << ")\n" "Recompile the original script"; if (ourNr < bimNr) throw Exception{} << d_bimName << " was created with a more " "recent icmake version (" << bimNr << ")\n" "Please upgrade icmake"; } checkOffsets(); // verify that the hdr offsets are // within the file } icmake-10.03.00/support/bimheader/bimheader.ih0000644000175000017500000000035014204126313020040 0ustar frankfrank#include "bimheader.h" #include #include #include #include #include "../../xerr/xerr.ih" #include "../tools/tools.h" using namespace std; using namespace FBB; #include "codeendoffset.f" icmake-10.03.00/support/bimheader/vartype.cc0000644000175000017500000000063114204126313017601 0ustar frankfrank//#define XERR #include "bimheader.ih" uint16_t BimHeader::varType(uint16_t idx) { auto offs = offset(); // current offset varsSection(); // go to the var-section d_in.seekg(idx, ios::cur); // skip to the intended var-byte auto ret = get(); // retrieve the type d_in.seekg(offs); // restore the org. offset return ret; } icmake-10.03.00/support/bimheader/codeoffset.f0000644000175000017500000000011514204126313020065 0ustar frankfrankinline uint32_t BimHeader::codeOffset() const { return sizeof(Header); } icmake-10.03.00/support/bimheader/get.f0000644000175000017500000000042714204137164016537 0ustar frankfranktemplate Type BimHeader::get() { Type ret; if (not d_in.read(reinterpret_cast(&ret), sizeof(Type))) throw FBB::Exception{} << (sizeof(Type) * 8) << "-bit value not available"; return endian(ret); } icmake-10.03.00/support/bimheader/varsoffset.f0000644000175000017500000000011614204126313020127 0ustar frankfrankinline uint32_t BimHeader::varsOffset() const { return d_hdr.variables; } icmake-10.03.00/support/bimheader/stringsoffset.f0000644000175000017500000000011714204126313020646 0ustar frankfrankinline uint32_t BimHeader::stringsOffset() const { return d_hdr.strings; } icmake-10.03.00/support/bimheader/string2.cc0000644000175000017500000000052714204126313017503 0ustar frankfrank//#define XERR #include "bimheader.ih" string BimHeader::string(size_t strOffset) { auto offs = offset(); stringsSection(); d_in.seekg(strOffset, ios::cur); std::string ret = string(); // get the intended string d_in.seekg(offs); // restore the offset return ret; // return the string } icmake-10.03.00/support/bimheader/checkoffsets.cc0000644000175000017500000000101514204126313020553 0ustar frankfrank//#define XERR #include "bimheader.ih" void BimHeader::checkOffsets() const { for ( auto [size, begin, end] = tuple{ filesystem::file_size(d_bimName), &d_hdr.strings, &d_hdr.firstOpcode + 1 }; begin != end; ++begin ) { if (*begin >= size) throw Exception{} << "invalid offsets in " << d_bimName; } } icmake-10.03.00/support/bimheader/readfrom.cc0000644000175000017500000000027714204126313017714 0ustar frankfrank#define XERR #include "bimheader.ih" void BimHeader::readFrom(uint32_t offset) { d_in.seekg(offset); if (not d_in) throw Exception{} << "can't reach offset 0x" << offset; } icmake-10.03.00/support/bimheader/read.f0000644000175000017500000000074514204137306016674 0ustar frankfranktemplate void BimHeader::read(Type *dest, size_t nValues) { if (not d_in.read(reinterpret_cast(dest), nValues * sizeof(Type))) throw FBB::Exception{} << nValues << " values of " << sizeof(Type) << " bytes not available"; if (not littleEndian()) { std::for_each(dest, dest + nValues, [](Type &dest) { dest = endian(dest); } ); } } icmake-10.03.00/support/bimheader/bimheader.h0000644000175000017500000000434614204137332017703 0ustar frankfrank#ifndef INCLUDED_BIMHEADER_ #define INCLUDED_BIMHEADER_ #include #include #include #include #include "../endian/endian.h" #include "../header/header.h" class BimHeader: private Endian { std::string d_bimName; std::ifstream d_in; Header d_hdr; public: BimHeader(char const *fname, char const *version, bool versionCheck); uint32_t stringsOffset() const; void stringsSection(); bool endStrings(); std::string string(); // get the string from the current // offset std::string string(size_t idx); // get string 'idx' from the string- // section (the initial stream offset // is reset when returning uint32_t varsOffset() const; void varsSection(); bool endVars(); uint16_t varType(uint16_t idx); // get var 'idx'th type, restoring // the initial stream offset when // returning uint32_t filenameOffset() const; uint32_t startOffset() const; void start(); uint32_t codeOffset() const; void codeSection(); bool endCode(); bool hasVariables() const; bool hasStrings() const; uint32_t offset(); void seekg(int32_t step, std::ios::seekdir dir = std::ios::beg); template void read(Type *dest, size_t nValues); template Type get(); private: uint32_t codeEndOffset() const; void readFrom(uint32_t offset); void checkOffsets() const; bool atOffset(uint32_t offset); static std::string bimName(char const *fname); }; #include "read.f" #include "get.f" #include "offset.f" #include "stringsoffset.f" #include "stringssection.f" #include "endstrings.f" #include "varsoffset.f" #include "varssection.f" #include "endvars.f" #include "startoffset.f" #include "start.f" #include "codeoffset.f" #include "codesection.f" #include "endcode.f" #include "hasvariables.f" #include "hasstrings.f" #include "filenameoffset.f" #endif icmake-10.03.00/support/bimheader/hasstrings.f0000644000175000017500000000013214204126313020130 0ustar frankfrankinline bool BimHeader::hasStrings() const { return d_hdr.variables > d_hdr.strings; } icmake-10.03.00/support/bimheader/hasvariables.f0000644000175000017500000000013614204126313020413 0ustar frankfrankinline bool BimHeader::hasVariables() const { return d_hdr.filenames > d_hdr.variables; } icmake-10.03.00/support/bimheader/frame0000644000175000017500000000007014204126313016612 0ustar frankfrank//#define XERR #include "bimheader.ih" BimHeader:: { } icmake-10.03.00/support/bimheader/varssection.f0000644000175000017500000000011714204126313020306 0ustar frankfrankinline void BimHeader::varsSection() { return readFrom(d_hdr.variables); } icmake-10.03.00/support/constants/0000755000175000017500000000000014203741153015700 5ustar frankfrankicmake-10.03.00/support/constants/constants.h0000644000175000017500000000134314204126313020062 0ustar frankfrank#ifndef INCLUDED_CONSTANTS_ #define INCLUDED_CONSTANTS_ enum Constants { OFF = 0, ON = 1, P_CHECK = 0, P_NOCHECK = 1, // in fact: not P_CHECK O_FILE = 1, // see scanner/lexer O_DIR = 2, O_SUBDIR = 4, O_ALL = 8, IS_FILE = 1, // see scanner/lexer: same values as O_FILE etc. IS_DIR = 2, IS_SUBDIR = 4, IS_ALL = 8, IS_IFDIR = 1, IS_IFCHR = 2, IS_IFREG = 4, IS_IREAD = 8, IS_IWRITE = 16, IS_IEXEC = 32, NORMAL_FILE = 0x00, READONLY_FILE = 0x01, HIDDEN_FILE = 0x02, SYSTEM_FILE = 0x04, VOLUME_ID = 0x08, SUBDIR = 0x10, ARCHIVED = 0x20 }; #endif icmake-10.03.00/support/CLASSES0000644000175000017500000000030414204171312014674 0ustar frankfrankheader bimheader opcodes builtinfunctions tools # only .h files: # ============== # constmember # as # typedefs # exprtype # header # constants # bimhdr # opcode # builtindata # findidx endian icmake-10.03.00/support/constmember/0000755000175000017500000000000014203741153016202 5ustar frankfrankicmake-10.03.00/support/constmember/constmember.h0000644000175000017500000000076614204126313020676 0ustar frankfrank#ifndef INCLUDED_CONSTMEMBER_ #define INCLUDED_CONSTMEMBER_ #include template class ConstMember { protected: template void nc(Params &&...params) { (static_cast(this)->*ptr)( std::forward(params)... ); } // use: &Derived::nc<&Derived::func> }; #endif icmake-10.03.00/un/0000755000175000017500000000000014204243503012567 5ustar frankfrankicmake-10.03.00/un/icm_bootstrap0000755000175000017500000000022414204126313015357 0ustar frankfrank#!/bin/bash . ../bootstrap/flags . ../bootstrap/functions echo Creating tmp${LIBDIR}/icmun subdirs maindir ${LIBDIR}/icmun -s rm -f */*.gch *.o icmake-10.03.00/un/usage.cc0000644000175000017500000000123614204126313014203 0ustar frankfrank#include "main.ih" namespace { char const info[] = R"( [options] bimfile Where: [options] - optional arguments (short options between parentheses): --help (-h) - provide this help --no-version-check (-n) - the bimfile's main version may differ from )"; char const info2[] = R"() --version (-v) - show version information and terminate bimfile - binary icmake '.bim' file (default extension: .bim) )"; } void usage(std::string const &progname) { Tools::usageTop(progname) << info << progname << "'s main version (" << stoul(VERSION) << info2; } icmake-10.03.00/un/demo.bim0000644000175000017500000000015614204126313014205 0ustar frankfrank9.03TbfH"ÿ¿ þ¿ ÿ¿À ÿ¿þ¿ ÿ¿#" ÿ¿ À# !1$helloworld demo.im icmake-10.03.00/un/enums/0000755000175000017500000000000013627725521013733 5ustar frankfrankicmake-10.03.00/un/frame.un0000644000175000017500000000002314204126313014217 0ustar frankfrank#include "main.ih" icmake-10.03.00/un/icmconf0000644000175000017500000000124614204171312014131 0ustar frankfrank#define PRECOMP "-x c++-header" #define CLS #define LIBRARY "modules" #define MAIN "main.cc" #define SOURCES "*.cc" #define OBJ_EXT ".o" #define TMP_DIR "tmp" //#define USE_ALL "a" #define USE_ECHO ON // #define USE_VERSION #define CXX "g++" #define CXXFLAGS " --std=c++20 -Wall -O2" \ " -fdiagnostics-color=never " #define IH ".ih" #define REFRESH #define LDFLAGS "-s" #define ADD_LIBRARIES "support bobcat" #define ADD_LIBRARY_PATHS "../../support/tmp" #define DEFCOM "program" icmake-10.03.00/un/changelog0000644000175000017500000000040114204126313014433 0ustar frankfrankicmun version 10.00.00 * C++ version of icmun * Added option -n: drops the requirement that icmun and the bim file to unassemble must have identical main version numbers. -- Frank B. Brokken Mon, 03 May 2021 16:16:46 +0200 icmake-10.03.00/un/main.cc0000644000175000017500000000151214204126313014020 0ustar frankfrank#define XERR #include "main.ih" namespace { Arg::LongOption longOpts[] = { Arg::LongOption{"help", 'h'}, Arg::LongOption{"no-version-check", 'n'}, Arg::LongOption{"version", 'v'}, }; auto longEnd = longOpts + size(longOpts); } int main(int argc, char **argv) try { Arg const &arg = Arg::initialize("hnv", longOpts, longEnd, argc, argv); arg.versionHelp(usage, VERSION, 1); // read the .bim-file header, and construct the UnAssembler BimHeader bimHdr{ arg[0], VERSION, not arg.option('n') }; UnAssembler unAssembler{ bimHdr }; unAssembler.run(arg.basename()); } catch (exception const &exc) { cout << '\n' << exc.what() << '\n'; return 1; } catch (int exitValue) { return Arg::instance().option("hv") ? 0 : exitValue; } catch (...) { return 1; } icmake-10.03.00/un/main.ih0000644000175000017500000000053614204126313014040 0ustar frankfrank#include #include #include #include #include "../support/bimheader/bimheader.h" #include "../support/tools/tools.h" #include "unassembler/unassembler.h" #include "../xerr/xerr.ih" using namespace std; using namespace FBB; void usage(string const &progname); void copyright(string const &progname); icmake-10.03.00/un/install0000755000175000017500000000007514204126313014164 0ustar frankfrank#!/bin/bash cp tmp/bin/binary /usr/lib/icmake/bin/icmun.wip icmake-10.03.00/un/demo.im0000644000175000017500000000036114204126313014041 0ustar frankfrankint ivar1; int ivar2; string gstr = "hello"; list lvar; void fun(string arg) { string a, b; b = a; a = gstr; a = arg; a = b; } void main(int argc, list argv) { string inner = "world"; printf(argv, '\n'); } icmake-10.03.00/un/frame/0000755000175000017500000000000014204243503013661 5ustar frankfrankicmake-10.03.00/un/frame/frame.ih0000644000175000017500000000017014204126313015272 0ustar frankfrank#include "frame.h" #include "../../support/bimheader/bimheader.h" #include "../../xerr/xerr.ih" using namespace std; icmake-10.03.00/un/frame/read.cc0000644000175000017500000000052114204126313015100 0ustar frankfrank//#define XERR #include "frame.ih" uint8_t Frame::read() { auto ret = d_hdr.get(); if (ret == 0) clear(); else { resize(ret); // resize to the required #local variables // read the types: d_hdr.read(&front(), size()); } return ret; } icmake-10.03.00/un/frame/frame.h0000644000175000017500000000320414204126313015122 0ustar frankfrank#ifndef INCLUDED_FRAME_ #define INCLUDED_FRAME_ // the stack grows from high SP values to low SP values. When a function // is called its arguments are pushed in reversed order, followed by the // function's return address. Then the current BP is pushed and BP is set to // point to that location. The local variables take up 1 index position per // variable. Arguments are reached as 'bp + index', where index value 2 refers // to the function's 1st argument; Local variables are reached as 'bp - index' // where index is negative (-1, -2, ...) and refers to the '-index'th local // variable number. // Here's the stack frame organization: // // high stack offsets // | // | arg#N BP + N+1 // | ... // | arg#2 BP + 3 // | arg#1 BP + 2 // | return // BP--> | old BP // | local#1 BP - 1 // | local#2 BP - 2 // | ... // | local#N BP - N // | // SP--> low stack offsets // // The Frame class stores the types of the local variables in a vector: // its 1st element defines the type of the 1st local variable: access it // as element [-index - 1] #include #include #include class BimHeader; class Frame: private std::vector { BimHeader &d_hdr; public: Frame(BimHeader &hdr); uint8_t read(); // read the frame following a `frame' // opcode uint8_t type(int16_t idx) const; using std::vector::size; }; #include "type.f" #endif icmake-10.03.00/un/frame/icmconf0000777000175000017500000000000014204126313017762 2../../icmconf.dirustar frankfrankicmake-10.03.00/un/frame/frame1.cc0000644000175000017500000000012614204126313015341 0ustar frankfrank//#define XERR #include "frame.ih" Frame::Frame(BimHeader &hdr) : d_hdr(hdr) { } icmake-10.03.00/un/frame/type.f0000644000175000017500000000012014204126313015001 0ustar frankfrankinline uint8_t Frame::type(int16_t idx) const { return (*this)[-idx - 1]; } icmake-10.03.00/un/frame/frame0000644000175000017500000000006014204126313014671 0ustar frankfrank//#define XERR #include "frame.ih" Frame:: { } icmake-10.03.00/un/unassembler/0000755000175000017500000000000014204243503015107 5ustar frankfrankicmake-10.03.00/un/unassembler/mul.cc0000644000175000017500000000014614204126313016213 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::mul() const { cout << s_0 << "mul"; } icmake-10.03.00/un/unassembler/smeq.cc0000644000175000017500000000015014204126313016356 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::smeq() const { cout << s_0 << "smeq"; } icmake-10.03.00/un/unassembler/vardump.cc0000644000175000017500000000060714204126313017076 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::varDump() const { if (not d_hdr.hasVariables()) return; cout << "Variable section dump:\n"; d_hdr.varsSection(); size_t idx = 0; while (not d_hdr.endVars()) cout << "\tvariable " << setw(4) << idx++ << ": " << s_typeName[d_hdr.get()] << '\n'; cout.put('\n'); } icmake-10.03.00/un/unassembler/younger.cc0000644000175000017500000000015614204126313017107 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::younger() const { cout << s_0 << "younger"; } icmake-10.03.00/un/unassembler/popvar.cc0000644000175000017500000000014614204126313016725 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::pop_var() const { handleVar("pop"); } icmake-10.03.00/un/unassembler/greq.cc0000644000175000017500000000015014204126313016347 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::greq() const { cout << s_0 << "greq"; } icmake-10.03.00/un/unassembler/asp.cc0000644000175000017500000000032514204126313016200 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::asp() const { auto add = d_hdr.get(); display2(add); cout << s_1 << "add sp, " << setw(2) << static_cast(add); } icmake-10.03.00/un/unassembler/dec.cc0000644000175000017500000000014214204126313016145 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::dec() const { handleVar("dec"); } icmake-10.03.00/un/unassembler/display2.cc0000644000175000017500000000023714204126313017146 0ustar frankfrank//#define XERR #include "unassembler.ih" // static void UnAssembler::display2(uint16_t value) { cout << setw(2) << static_cast(value) << ' '; } icmake-10.03.00/un/unassembler/data.cc0000644000175000017500000000556014204126313016334 0ustar frankfrank//#define XERR #include "unassembler.ih" char const UnAssembler::s_0[] = " "; char const UnAssembler::s_1[] = " "; char const UnAssembler::s_2[] = " "; unordered_map UnAssembler::s_typeName = { { e_str, "string" }, { e_int, "int" }, { e_list, "list" }, }; UnAssembler::MaybeConst UnAssembler::s_disassemble[] = { { .stable = &UnAssembler::jmp}, // 00 { .stable = &UnAssembler::jmp_false}, // 01 { .stable = &UnAssembler::jmp_true}, // 02 { .stable = &UnAssembler::push_1_jmp_end}, // 03 { .stable = &UnAssembler::push_0}, // 04 { .stable = &UnAssembler::push_imm}, // 05 { .stable = &UnAssembler::push_strconst}, // 06 { .stable = &UnAssembler::push_var}, // 07 { .stable = &UnAssembler::push_reg}, // 08 { .stable = &UnAssembler::pop_var}, // 09 { .stable = &UnAssembler::umin}, // 0a { .stable = &UnAssembler::atoi}, // 0b { .stable = &UnAssembler::itoa}, // 0c { .stable = &UnAssembler::atol}, // 0d { .stable = &UnAssembler::mul}, // 0e { .stable = &UnAssembler::div}, // 0f { .stable = &UnAssembler::mod}, // 10 { .stable = &UnAssembler::add}, // 11 { .stable = &UnAssembler::sub}, // 12 { .stable = &UnAssembler::eq}, // 13 { .stable = &UnAssembler::neq}, // 14 { .stable = &UnAssembler::sm}, // 15 { .stable = &UnAssembler::gr}, // 16 { .stable = &UnAssembler::younger}, // 17 { .stable = &UnAssembler::older}, // 18 { .stable = &UnAssembler::smeq}, // 19 { .stable = &UnAssembler::greq}, // 1a { .stable = &UnAssembler::call_rss}, // 1b { .stable = &UnAssembler::asp}, // 1c { .stable = &UnAssembler::exit}, // 1d { .stable = &UnAssembler::copy_var}, // 1e { .stable = &UnAssembler::inc}, // 1f { .stable = &UnAssembler::dec}, // 20 { .stable = &UnAssembler::call}, // 21 { .plain = &UnAssembler::frame}, // 22 { .stable = &UnAssembler::ret}, // 23 { .stable = &UnAssembler::pop_reg}, // 24 { .stable = &UnAssembler::band}, // 25 { .stable = &UnAssembler::bor}, // 26 { .stable = &UnAssembler::bnot}, // 27 { .stable = &UnAssembler::bxor}, // 28 { .stable = &UnAssembler::shl}, // 29 { .stable = &UnAssembler::shr}, // 2a // hlt // 2b }; icmake-10.03.00/un/unassembler/eq.cc0000644000175000017500000000014414204126313016021 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::eq() const { cout << s_0 << "eq"; } icmake-10.03.00/un/unassembler/exit.cc0000644000175000017500000000015014204126313016362 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::exit() const { cout << s_0 << "exit"; } icmake-10.03.00/un/unassembler/statistics.cc0000644000175000017500000000140514204126313017607 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::statistics() const { cout << "Binary file statistics:\n" "\tstrings at offset\t0x" << setw(4) << d_hdr.stringsOffset() << "\n" "\tvariables at offset\t0x" << setw(4) << d_hdr.varsOffset() << "\n" "\tfilename at offset\t0x" << setw(4) << d_hdr.filenameOffset() << "\n" "\tcode at offset\t0x" << setw(4) << d_hdr.codeOffset() << "\n" "\tfirst opcode at offset\t0x" << setw(4) << d_hdr.startOffset() << "\n" "\n"; } icmake-10.03.00/un/unassembler/pushreg.cc0000644000175000017500000000016014204126313017067 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::push_reg() const { cout << s_0 << "push reg"; } icmake-10.03.00/un/unassembler/bor.cc0000644000175000017500000000014514204126313016177 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::bor() const { cout << s_0 << "or"; } icmake-10.03.00/un/unassembler/run.cc0000644000175000017500000000051214204171312016216 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::run(string const &progname) { Tools::usageTop(progname, false) <(); display4(address); cout << s_2 << "call [" << setw(4) << address << ']'; } icmake-10.03.00/un/unassembler/ret.cc0000644000175000017500000000014614204126313016210 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::ret() const { cout << s_0 << "ret"; } icmake-10.03.00/un/unassembler/bxor.cc0000644000175000017500000000014714204126313016371 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::bxor() const { cout << s_0 << "xor"; } icmake-10.03.00/un/unassembler/push1jmpend.cc0000644000175000017500000000031414204126313017651 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::push_1_jmp_end() const { cout << s_0 << "push int 1, jmp [" << setw(4) << d_hdr.offset() + 1 << "]"; } icmake-10.03.00/un/unassembler/copyvar.cc0000644000175000017500000000015014204126313017074 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::copy_var() const { handleVar("copy"); } icmake-10.03.00/un/unassembler/varvalue.cc0000644000175000017500000000063114204126313017242 0ustar frankfrank#include "unassembler.ih" // static void UnAssembler::varValue(VarType type, int16_t idx) { char sign = '+'; switch (type) { case GLOBAL: cout << '[' << setw(4) << idx << ']'; return; case LOCAL: sign = '-'; idx = -idx; break; case ARG: break; } cout << "[bp" << sign << setw(4) << idx << ']'; } icmake-10.03.00/un/unassembler/popreg.cc0000644000175000017500000000015614204126313016713 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::pop_reg() const { cout << s_0 << "pop reg"; } icmake-10.03.00/un/unassembler/callrss.cc0000644000175000017500000000076114204126313017064 0ustar frankfrank#define XERR #include "unassembler.ih" void UnAssembler::call_rss() const { auto offset = d_hdr.offset(); uint16_t funNr = d_hdr.get(); display2(funNr); if (funNr >= BuiltinFunctions::nFunctions()) throw Exception{} << "at offset " << offset << ": request to call function " << funNr << " (not builtin)"; cout << s_1 << "callrss " << setw(2) << funNr << " (" << BuiltinFunctions::name(funNr) << ')'; } icmake-10.03.00/un/unassembler/frame.cc0000644000175000017500000000134614204126313016513 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::frame() { uint16_t nLocals = d_frame.read(); display2(nLocals); // display the # local variables cout << s_1 << "frame, "; display2(nLocals); cout << "local variable" << (nLocals == 1 ? ":\n" : "s:\n"); if (nLocals == 0) return; // initial line content: | [0014] | // 123456789012345 cout << " " // shift to the data column (15 spaces) " " << s_0; // then 3 for the opcode position, // followed by the # 0-argument spaces. for (int idx = 0; idx != nLocals; ++idx) display2(d_frame.type(-idx - 1)); } icmake-10.03.00/un/unassembler/atoi.cc0000644000175000017500000000015014204126313016345 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::atoi() const { cout << s_0 << "atoi"; } icmake-10.03.00/un/unassembler/vartype.cc0000644000175000017500000000055514204126313017114 0ustar frankfrank//#define XERR #include "unassembler.ih" // static UnAssembler::VarType UnAssembler::varType(uint16_t *index) { if (*index < 0x8000) return GLOBAL; // global var, index is its index VarType ret = *index < 0xc000 ? LOCAL : ARG; *index -= 0xc000; // *index is BP offset return ret; } icmake-10.03.00/un/unassembler/sub.cc0000644000175000017500000000014614204126313016207 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::sub() const { cout << s_0 << "sub"; } icmake-10.03.00/un/unassembler/jmptrue.cc0000644000175000017500000000047014204126313017104 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::jmp_true() const { auto jmpSize = d_hdr.get(); display4(jmpSize); // display as uint16_t cout << s_2 << "jmp true [" << setw(4) << as(d_hdr.offset() + jmpSize) << "]"; } icmake-10.03.00/un/unassembler/neq.cc0000644000175000017500000000014614204126313016201 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::neq() const { cout << s_0 << "neq"; } icmake-10.03.00/un/unassembler/pushimm.cc0000644000175000017500000000036414204126313017102 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::push_imm() const { auto value = d_hdr.get(); display4(value); // display as uint16_t cout << s_2 << "push int " << setw(4) << value; } icmake-10.03.00/un/unassembler/mod.cc0000644000175000017500000000014614204126313016175 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::mod() const { cout << s_0 << "mod"; } icmake-10.03.00/un/unassembler/unassembler1.cc0000644000175000017500000000017314204126313020017 0ustar frankfrank//#define XERR #include "unassembler.ih" UnAssembler::UnAssembler(BimHeader &hdr) : d_hdr(hdr), d_frame(d_hdr) {} icmake-10.03.00/un/unassembler/bnot.cc0000644000175000017500000000014714204126313016361 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::bnot() const { cout << s_0 << "not"; } icmake-10.03.00/un/unassembler/icmconf0000777000175000017500000000000014204126313021210 2../../icmconf.dirustar frankfrankicmake-10.03.00/un/unassembler/jmpfalse.cc0000644000175000017500000000051014204126313017212 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::jmp_false() const { auto jmpSize = d_hdr.get(); display4(jmpSize); // display as uint16_t cout << s_2 << "jmp false [" << setw(4) << as(d_hdr.offset() + jmpSize) << "]"; } icmake-10.03.00/un/unassembler/band.cc0000644000175000017500000000014714204126313016323 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::band() const { cout << s_0 << "and"; } icmake-10.03.00/un/unassembler/push0.cc0000644000175000017500000000016014204126313016451 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::push_0() const { cout <<" push int 0"; } icmake-10.03.00/un/unassembler/display.cc0000644000175000017500000000031614204126313017062 0ustar frankfrank//#define XERR #include "unassembler.ih" // static void UnAssembler::display(string const &str) { cout.put('"'); for (char ch: str) cout.put(isprint(ch) ? ch : '.'); cout.put('"'); } icmake-10.03.00/un/unassembler/display4.cc0000644000175000017500000000044114204126313017145 0ustar frankfrank//#define XERR #include "unassembler.ih" // static void UnAssembler::display4(uint16_t value) { // low byte high byte cout << setw(2) << (value & 0xff) << ' ' << setw(2) << (value >> 8) << ' '; } icmake-10.03.00/un/unassembler/handlevar.cc0000644000175000017500000000137114204126313017363 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::handleVar(char const *instruction) const { auto index = d_hdr.get(); display4(index); cout << s_2; VarType type = varType(&index); switch (type) { case GLOBAL: { auto type = d_hdr.varType(index); // get the global var. type cout << instruction << " global " << s_typeName[type] << ' '; } break; case LOCAL: cout << instruction << " local " << s_typeName[d_frame.type(index)] << ' '; break; case ARG: cout << instruction << " arg "; break; } varValue(type, index); // [var. specification] } icmake-10.03.00/un/unassembler/pushstrconst.cc0000644000175000017500000000045414204126313020177 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::push_strconst() const { auto offset = d_hdr.get(); display4(offset); // display the index cout << s_2 << "push string "; display(d_hdr.string(offset)); // get the string given its index } icmake-10.03.00/un/unassembler/stringdump.cc0000644000175000017500000000101214204126313017603 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::stringDump() const { if (not d_hdr.hasStrings()) return; cout << "String constants dump:\n"; d_hdr.stringsSection(); uint32_t begin = d_hdr.offset(); while (not d_hdr.endStrings()) { uint32_t current = d_hdr.offset(); cout << "\t[" << setw(4) << current << " (" << setw(4) << (current - begin) << ")] "; display(d_hdr.string()); cout.put('\n'); } cout.put('\n'); } icmake-10.03.00/un/unassembler/sm.cc0000644000175000017500000000014414204126313016033 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::sm() const { cout << s_0 << "sm"; } icmake-10.03.00/un/unassembler/pushvar.cc0000644000175000017500000000015014204126313017101 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::push_var() const { handleVar("push"); } icmake-10.03.00/un/unassembler/disassemble2.cc0000644000175000017500000000054314204126313017774 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::disassemble(uint16_t opCode) { // opcode mnemonic // 23 ret // 12345678 // A blank is appended to the opcode. Therafter there are 8 char columns // available until the mnemonic is displayed. (this->*s_disassemble[opCode].plain)(); cout.put('\n'); } icmake-10.03.00/un/unassembler/unassembler.ih0000644000175000017500000000066614204126313017760 0ustar frankfrank#include "unassembler.h" #include #include #include #include "../../support/as/as.h" #include "../../support/tools/tools.h" #include "../../support/exprtype/exprtype.h" #include "../../support/bimheader/bimheader.h" #include "../../support/builtinfunctions/builtinfunctions.h" #include "../../support/opcodes/opcodes.h" #include "../../xerr/xerr.ih" using namespace std; using namespace FBB; icmake-10.03.00/un/unassembler/atol.cc0000644000175000017500000000015014204126313016350 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::atol() const { cout << s_0 << "atol"; } icmake-10.03.00/un/unassembler/older.cc0000644000175000017500000000015214204126313016520 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::older() const { cout << s_0 << "older"; } icmake-10.03.00/un/unassembler/jmp.cc0000644000175000017500000000046314204126313016206 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::jmp() const { auto jmpSize = d_hdr.get(); display4(jmpSize); // display as uint16_t cout << s_2 << "jmp [" << setw(4) << as(d_hdr.offset() + jmpSize) << "]"; } icmake-10.03.00/un/unassembler/disassemble.cc0000644000175000017500000000125614204126313017714 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::disassemble() { cout << "Disassembled code:\n"; d_hdr.codeSection(); while (not d_hdr.endCode()) { uint32_t offset = d_hdr.offset(); uint16_t opCode = d_hdr.get(); // get the next opcode if (not Opcodes::valid(opCode)) throw Exception{} << "At offset 0x" << setw(4) << offset << ": opcode 0x" << setw(2) << opCode << " not defined"; cout << "\t[" << setw(4) << offset << "] " << setw(2) << opCode << ' '; disassemble(opCode); } cout.put('\n'); } icmake-10.03.00/un/unassembler/div.cc0000644000175000017500000000014614204126313016200 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::div() const { cout << s_0 << "div"; } icmake-10.03.00/un/unassembler/frame0000644000175000017500000000007414204126313016124 0ustar frankfrank//#define XERR #include "unassembler.ih" UnAssembler:: { } icmake-10.03.00/un/unassembler/add.cc0000644000175000017500000000014614204126313016146 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::add() const { cout << s_0 << "add"; } icmake-10.03.00/un/unassembler/itoa.cc0000644000175000017500000000015014204126313016345 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::itoa() const { cout << s_0 << "itoa"; } icmake-10.03.00/un/unassembler/unassembler.h0000644000175000017500000000676114204126313017611 0ustar frankfrank#ifndef INCLUDED_UNASSEMBLER_ #define INCLUDED_UNASSEMBLER_ #include #include #include "../frame/frame.h" class BimHeader; class UnAssembler { enum VarType { GLOBAL, LOCAL, ARG, }; BimHeader &d_hdr; mutable Frame d_frame; static char const s_0[]; // blanks after only an opcode static char const s_1[]; // blanks after an opcode + 1 byte arg. static char const s_2[]; // blanks after an opcode + 2 byte args. static std::unordered_map s_typeName; union MaybeConst { void (UnAssembler::*stable)() const; void (UnAssembler::*plain)(); }; static MaybeConst s_disassemble[]; static char const *s_funName[]; static unsigned const s_nFunctions; public: UnAssembler(BimHeader &hdr); void run(std::string const &progname); private: void statistics() const; void varDump() const; void stringDump() const; void disassemble(); // disassemble the binary instructions void disassemble(uint16_t opCode) ; static void display(std::string const &str); // stringDump strings static void display2(uint16_t value); static void display4(uint16_t value); void handleVar(char const *instruction) const; static VarType varType(uint16_t *index); static void varValue(VarType type, int16_t idx); void jmp() const; // 00 void jmp_false() const; // 01 void jmp_true() const; // 02 void push_1_jmp_end() const; // 03 void push_0() const; // 04 void push_imm() const; // 05 void push_strconst() const; // 06 void push_var() const; // 07 void push_reg() const; // 08 void pop_var() const; // 09 void umin() const; // 0a void atoi() const; // 0b void itoa() const; // 0c void atol() const; // 0d void mul() const; // 0e void div() const; // 0f void mod() const; // 10 void add() const; // 11 void sub() const; // 12 void eq() const; // 13 void neq() const; // 14 void sm() const; // 15 void gr() const; // 16 void younger() const; // 17 void older() const; // 18 void smeq() const; // 19 void greq() const; // 1a void call_rss() const; // 1b void asp() const; // 1c void exit() const; // 1d void copy_var() const; // 1e void inc() const; // 1f void dec() const; // 20 void call() const; // 21 void frame(); // 22 void ret() const; // 23 void pop_reg() const; // 24 void band() const; // 25 void bor() const; // 26 void bnot() const; // 27 void bxor() const; // 28 void shl() const; // 29 void shr() const; // 2a }; #endif icmake-10.03.00/un/unassembler/shr.cc0000644000175000017500000000014614204126313016212 0ustar frankfrank//#define XERR #include "unassembler.ih" void UnAssembler::shr() const { cout << s_0 << "shr"; } icmake-10.03.00/un/CLASSES0000644000175000017500000000002314204126313013601 0ustar frankfrankunassembler frame icmake-10.03.00/usr/0000755000175000017500000000000014203741153012761 5ustar frankfrankicmake-10.03.00/usr/share/0000755000175000017500000000000014203741153014063 5ustar frankfrankicmake-10.03.00/usr/share/icmake/0000755000175000017500000000000014204126761015317 5ustar frankfrankicmake-10.03.00/usr/share/icmake/usage.cc0000644000175000017500000000110214204126313016715 0ustar frankfrank#include "main.ih" namespace { char const info[] = R"_( [options] args Where: [options] - optional arguments (short options between parentheses): --help (-h) - provide this help --version (-v) - show version information and terminate args - explain additional arguments. )_"; } // anonymous namespace ends void usage(std::string const &progname) { cout << "\n" << progname << " by " << Icmake::author << "\n" << progname << " V" << Icmake::version << " " << Icmake::years << "\n" "\n" "Usage: " << progname << info << '\n'; } icmake-10.03.00/usr/share/icmake/parser/0000755000175000017500000000000014203741153016610 5ustar frankfrankicmake-10.03.00/usr/share/icmake/parser/grammar0000644000175000017500000000135714204126313020163 0ustar frankfrank//%default-actions quiet %filenames parser %scanner ../scanner/scanner.h //%baseclass-preinclude x.h or // Semantic values used by the parser. // Two often used types are predefined, extend or alter as seems fit. // When %union is not used, use: //%stype struct-name/class-name //%union //{ // // define union fields here. The fields shown are for demo-use only // int i; // unsigned u; // std::string *s; //}; // Typed nonterminals indicate the union-value that's returned: //%type // rule1 or TOKEN // rule2 // lowest precedence //%token //%nonassoc //%left //%right // highest precedence %% // Define the start-rule below (the name `startrule' may be altered) startrule: ; icmake-10.03.00/usr/share/icmake/scanner/0000755000175000017500000000000014203741153016745 5ustar frankfrankicmake-10.03.00/usr/share/icmake/scanner/scanner.ih0000644000175000017500000000040114204126313020707 0ustar frankfrank// Declare here // what's only used in the Scanner class // and let Scanner's sources include "scanner.ih" #include "scanner.h" //#include "../parser/parserbase.h" // end of scanner.ih icmake-10.03.00/usr/share/icmake/scanner/lexer0000644000175000017500000000023114204126313017777 0ustar frankfrank%filenames scanner //%interactive //%debug %% [ \t]+ // Often used: skip white space \n // same icmake-10.03.00/usr/share/icmake/icmconf0000644000175000017500000001422514204126761016664 0ustar frankfrank // Inspect the following #defines. Change them to taste. If you don't // need a particular option, change its value into an empty string // For more information about this file: 'man 7 icmconf' // MAINTENANCE RELATED DEFINES THAT ARE TAILORED TO THE CURRENT PROJECT: // ===================================================================== // Uncomment to clear the screen starting the compilation //#define CLS // Uncomment to construct a library. Optionally use another name (don't // use lib or an extension like .a) //#define LIBRARY "modules" // The source containing main(): #define MAIN "main.cc" // The pattern locating sources in a directory: #define SOURCES "*.cc" // The extension of object modules: #define OBJ_EXT ".o" // Uncomment to construct a shared library //#define SHARED // If the constructed shared library requires additional libraries then // specify these here. E.g., if a library /usr/lib/special/libspecial.so // is required then specify "-L/usr/lib/special -lspecial" // Predefined paths (e.g., /lib, /usr/lib) do not have to be specified //#define SHAREDREQ "" // Directory to contain temporary results #define TMP_DIR "tmp" // Uncomment to use the ALL facility and a class dependency setup in the // CLASSES file. When a directory contains a file ALL (optionally rename // this filename by providing an alternative name) then all its sources // and all sources of all classes depending on it are also compiled. // Class dependencies are indicated by the class name (as the first // word on a line) optionally followed by additional class names, which // are the classes directly depending on the line's first class name. //#define USE_ALL "a" // By default dependencies are determined by icm-dep (via icmake -d), // passing it the following options. If icm-dep should not be called, // activate ICM_DEP as an empty string. Alternatively specify your own // icm-dep options //#define ICM_DEP "-V go" // should commands be echoed (ON) or not (OFF) ? //#define USE_ECHO ON // Use the VERSION file //#define USE_VERSION // When DEFCOM "program" is specified './icmbuild' is shorthand for // './icmbuild [-s] program' // When DEFCOM "library" is specified './icmbuild' is shorthand for // './icmbuild [-s] library' // The icmstart script may add a DEFCOM specification to this file. //#define DEFCOM "program" //#define DEFCOM "library" // COMPILATION AND LINKING RELATED DEFINES // ======================================= // The compiler to use. Define CC if a C compiler is used. #define CXX "g++" //#define CC "gcc" // The compiler options to use. Define CFLAGS if a C compiler is 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++20 -Wall -O2" //#define CFLAGS " -Wall -O2" // The extension of internal header files. See PRECOMP below //#define IH ".ih" // Uncomment to generate precompiled headers. When activated internal // header files are precompiled when they are more recent than their // precompiled versions. PRECOMP requires IH //#define PRECOMP "-x c++-header" // Uncomment to suppress warnings about non-existing IH files in // class-directories. This option is only interpreted when PRECOMP has // also been defined //#define NO_PRECOMP_WARNING // Uncomment to relink the binary, even when no sources were changed //#define REFRESH // Options passed to the linker //#define LDFLAGS "" // LIBRARIES REQUIRED BY THE CONSTRUCTED PROGRAM OR LIBRARY: // ========================================================= // any additional libraries the program may need: //#define ADD_LIBRARIES "" // additional paths (other than the standard paths) to locate additional // libraries (specify absolute paths or relative to TMP_DIR): //#define ADD_LIBRARY_PATHS "" // IF NO SCANNER AND NO PARSER ARE USED ALL OF THE FOLLOWING DEFINES // CAN BE REMOVED // DEFINES RELATED TO USING A PARSER GENERATOR // =========================================== // The sub-directory containing the parser's specification file. // If the PARSER_DIR directive is specified, then all other directives // related to generating a parser must also be specified. //#define PARSER_DIR "" // What is the program generating a parser? //#define PARSGEN "bisonc++" // Flags to pass to PARSGEN: //#define PARSFLAGS "-V" // What is the top-level (or only) grammar specification file? //#define PARSSPEC "grammar" // Optionally use patterns to specify additional grammar specification // files. These files are (in)directly included by the file specified by // the PARSSPEC directive. Specify patterns relative to PARSER_DIR //#define PARSFILES "" // The source file generated by the parser generator //#define PARSOUT "parse.cc" // DEFINES RELATED TO USING A LEXICAL SCANNER GENERATOR // ==================================================== // The sub-directory containing the scanner's specification file. // If the SCANNER_DIR directive is specified, then all other directives // related to generating a lexical scanner must also be specified. //#define SCANNER_DIR "" // What is the program generating the lexical scanner? //#define SCANGEN "flexc++" // Flags to provide SCANGEN with: //#define SCANFLAGS "" // Name of the lexical scanner specification file //#define SCANSPEC "lexer" // Optionally use patterns to specify additional scanner specification // files. These files are (in)directly included by the file specified by // the SCANSPEC directive. Specify patterns relative to SCANNER_DIR //#define SCANFILES "" // The source file generated by the lexical scanner //#define SCANOUT "lex.cc" icmake-10.03.00/usr/share/icmake/main.cc0000644000175000017500000000013214204126313016537 0ustar frankfrank#include "main.ih" int main(int argc, char **argv) try { } catch (...) { return 1; } icmake-10.03.00/usr/share/icmake/version.cc0000644000175000017500000000051214204126313017302 0ustar frankfrank#include "main.ih" #include "icmconf" #ifdef USE_VERSION #include "VERSION" #endif #ifndef AUTHOR #define AUTHOR "" #endif #ifndef VERSION #define VERSION "0.01.00" #endif #ifndef YEARS #define YEARS "2020" #endif namespace Icmake { char version[] = VERSION; char years[] = YEARS; char author[] = AUTHOR; } icmake-10.03.00/usr/share/icmake/main.ih0000644000175000017500000000031314204126313016553 0ustar frankfrank#include #include namespace Icmake { extern char version[]; extern char years[]; extern char author[]; }; void usage(std::string const &progname); using namespace std; icmake-10.03.00/usr/share/icmake/frame0000644000175000017500000000002314204126313016320 0ustar frankfrank#include "main.ih" icmake-10.03.00/usr/share/icmake/CLASSES0000644000175000017500000000152514204126313016333 0ustar frankfrank# This file is used by icmbuild(1) and should contain the names of all # 1-level deep sub-directories containing sources to compile. Each directory # should be specified on a line of its own. Initial blanks are ok. # If a parser or scanner is used, (see icmconf's USE_PARSER and USE_SCANNER # defines) then those directories are automatically included (they # may be included here as well) # Lines starting with # or with // are ignored, as are empty lines. # Sources in the current directory (i.e., the directory containing CLASSES) # are also compiled, but should be avoided unless the MAIN directive is # specified in the icmconf file. # Class dependencies are handled by icm_dep, called from icmake using option # -d (enter icmake -d for short usage info, or see the section on icm_dep # in the icmake(1) and icmbuild(1)'s man-pages. icmake-10.03.00/VERSION0000644000175000017500000000012014204243043013205 0ustar frankfrankVERSION=10.03.00 YEARS=1992-2022 AUTHOR="Frank B. Brokken (f.b.brokken@rug.nl)" icmake-10.03.00/where-is-what0000644000175000017500000000273614204126313014563 0ustar frankfrankchangelog overview of changes at new releases INSTALL description of the installation process INSTALL.im definitions of pathnames used by icmake QUICKINSTALL short description of required steps to install icmake VERSION latest icmake version and year build build-script that can be used once icmake has been installed icm_bootstrap bootstrap script to prepare icmake installation icm_gitlab internal use only icm_install installation script icm_prepare script installing path-definitions: also called by icm_bootstrap doc/ documentation and man-pages (including Yodl manpage sources) comp/ sources of the icm-comp icmake compiler dep/ sources of the icm-dep dependency inspecting program exec/ sources of the icm-exec interpreter pp/ sources of the icm-pp preprocessor icmake/ sources of the icmake shell program un/ sources of the icmun unassembler support/ sources of functions shared by the icmake programs scripts/ scripts used to build icmake, source texts of icm* scripts legacy/ legacy files examples/ various examples of icmake scripts usr/ default skeletons in share/icmake etc/ icmake/ contains default icmstart.rc, VERSION, AUTHOR, YEARS iuo/ internal use only: files used by my when working towards the next release where-is-what this file icmake-10.03.00/xerr/0000755000175000017500000000000014203741153013130 5ustar frankfrankicmake-10.03.00/xerr/xerr.ih0000644000175000017500000000131314204126313014424 0ustar frankfrank// define X to activate the xerr/xerr2 macros: // xerr(insertion) // inserts the '<<' concatenated elements into std::cerr // preceded by the name of the source file, and ended by '\n' // xerr2(insertion, code) // performs the insertion if X is defined, and (unconditionally) // executes the statement(s) in `code'. `code' must be valid // C(++) code. // #ifdef XERR #include #define xerr(insertion) std::cerr << __FILE__": " << insertion << '\n' #define xerr2(insertion, b) \ { std::cerr << __FILE__": " << insertion << '\n'; b; } #else #define xerr(insertion) #define xerr2(insertion, b) b #endif