icmake-7.21.01/INSTALL 0000644 0001750 0001750 00000027402 11743327112 013136 0 ustar frank frank INSTALLING ICMAKE
=================
Version 7.12 (and beyond)
1. Unpack the archive:
======================
The installation files for Icmake comes as an archive, e.g.,
"icmake_7.12.tar.gz". These archives unpack to several directories and files.
Starting with distribution icmake_7.12.tar.gz, the archive unpacks to a
directory icmake-7.12 below the current directory. The version number in this
directory may change to newer release versions.
So, if you unpack icmake_7.12.tar.gz (or later versions) in the directory
/usr/local/src, a directory /usr/local/src/icmake/icmake-7.12 is created, as
well as other subdirectories below /usr/local/src/icmake/icmake-7.12
To unpack the archives, create an appropriate directory (e.g.,
`/usr/local/src/icmake' E.g,
tar xvzf icmake_7.12.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-7.12
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)
If you're compiling for a CYGWIN environment, the executables must have
the extension .exe: in that case uncomment the appropriate #define EXTENSION
line. I.e.:
For CYGWIN:
#define EXTENSION ".exe"
- Inspect (and optionally modify) the availability of the program
mentioned in ./def/programs (they should be available on any Unix(like)
systems).
- Next run the shell-script `bootstrap' as follows:
./icm_bootstrap /
This constructs the icmake distribution under the ./tmp directory, preparing
for an installation from the root directory. It puts all icmake related files
in
tmp/$BINDIR, tmp/$SKELDIR, tmp/$MANDIR, tmp/$LIBDIR, tmp/$CONFDIR,
tmp/$DOCDIR, tmp/$DOCDOCDIR
3. Install the files
====================
You probably must do this as `root':
./icm_install [strip] all
This will install all files under the root directory (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.,
./install [strip] progs - installs all executables
./install scriupts - installs the icmstart/icmbuild
scripts
./install man - installs the man-pages
./install skel - installs the skeletons
./install etc - installs the default icmstart.rc
related files
./install doc - installs the docs
./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 pp/loadsym.c. In this file the function 'loadsym()'
of the preprocessor icm-pp is found. The preloaded symbols of Icmake are
defined in this function. E.g., MSDOS is defined as 1 when an MSDOS platform
is used, linux is defined as 1 when Icmake is compiled for Linux, etc..
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
--------------------------------------------------------------
MSDOS MS-DOS platform (with MSC 7.00 compiler)
unix Unix, usually with GNU's gcc compiler
linux '386 or '486 running Linux (usually with gcc)
M_SYSV, M_UNIX '386 or '486 running SCO/Unix (usually with
Microsoft C)
_POSIX_SOURCE Unix with Posix complient compiler
__hpux HP-UX, with the native HP compiler
--------------------------------------------------------------
If you want to modify something here which hasn't been done before, please
email us about it, and we'll include it in the standard distribution.
The following section is not actively maintained anymore. It is kept for
reasons of backward compatibility.
Hand-compiling icmake
=====================
Alternatively, you can compile icmake yourself. If you prefer doing this, you
could act as follows:
(a) Note that even though grammar definition and lexical scanner definition
files (parser and lexer) are found at several subdirectories, the bison and
flex programs should *NOT* be used. The parser.c and lexer.c files are
already available, and you might run into name-resolution problems if you
try to create parser.c or lexer.c with the bison/flex found at your site.
The parser and lexer files were included for documentation purposes only,
don't feed them to bison or flex.
(b) With some files the (GNU-C) compiler generates warnings. These warnings
fall into two categories: 'default' entry proints in switches cause the
compiler to complain about undefined enumeration values inside the switch,
and these warnings can safely be ignored.
Then, with the lexer.c and parser.c files the compiler may complain about
variables which were defined but not used. Again: no harm done, and you can
safely ignore these warnings as well.
(c) Change-dir to the directory "rss". This directory contains sourcefiles for
the Runtime Support System. These functions are used in all the programs of
the Icmake family.
Compile all files, using the appropriate compiler flags which cause your
compiler to compile-only.
On segmented architectures (e.g. MS-DOS computers), choose the "small"
model.
E.g., the compiler flags for Gnu's gcc compiler are:
gcc -c -DHAVE_GLOB
NOTE:
=====
= This note is only relevant for the compilation of icmake under MS-DOS,
= and can be ignored in all other cases.
=
= Below the ICMAKE\RSS subdirectory the subdirectory ASM is found. In this
= directory the files REDIRECT.ASM and REDIRECT.OBJ are stored.
=
= The REDIRECT.OBJ file is included in the ICRSS.LIB library by the
= DOS-MSC icmake-script, and is not removed thereafter.
=
= The file REDIRECT.ASM is included for reference purposes only.
= REDIRECT.ASM could be assembled 'by hand' using the ML-assembler, using
= the following commands:
=
= set ml=-c -Cp -DMM='S'
= ml redirect.asm
=
= The file icmake\rss\asm\redirect.obj must be added to the icrss.lib
= library in icmake\rss. E.g., in the directory icmake\rss the following
= command could be given:
=
= lib icrss -+asm\redirect ;
NOTE:
=====
The flag -DHAVE_GLOB causes the function glob() to be included in the
code, which expands a filename with wildcards to a list of names. The flag
is not needed for MSDOS compilations. If you do NOT have this function,
OMIT the -DHAVE_GLOB specification. This is further discussed below.
While compiling, you may need other special definition flags to produce
workable code for other systems. Please check the section below to see
if you need any special flags.
Next, place the produced object files into one library. A suggested name is
"libicrss.a" for Unix systems, or "icrss.lib" for DOS systems. See the
documentation of your library manager ("ar" or "lib") for the required
command line.
Next, for Unix systems run:
ar rsv libicrss.a *.o
(d) The following directories were also created from the archive:
make,
pp,
comp,
exec,
un.
The directories hold respectively the files needed for the top-level
program "icmake", for the preprocessor "icm-pp", for the compiler
"icm-comp", for the executor "icm-exec" and for the unassembler "icmun".
These program names are on Unix-based systems without extension; supply
".exe" for DOS.
Change-dir to each of these directories in turn and compile and link all
.c files into the appropriate program. E.g., for a Unix system you might
type:
cd make
gcc -DHAVE_GLOB -o bin/icmake *.c ../rss/libicrss.a
cd ../pp
gcc -DHAVE_GLOB -o bin/icm-pp *.c ../rss/libicrss.a
cd ../comp
gcc -DHAVE_GLOB -o bin/icm-comp *.c ../rss/libicrss.a
cd ../exec
gcc -DHAVE_GLOB -o bin/icm-exec *.c ../rss/libicrss.a
cd ../un
gcc -DHAVE_GLOB -o bin/icmun *.c ../rss/libicrss.a
cd ..
Next continue with the installation at point 3 (sh install) above.
Special flags while compiling
-----------------------------
A large part of the source code of Icmake should compile on any
platform. The exceptions we have encountered so far are the following:
(a) On MSDOS platforms, the constant MSDOS must be defined. This symbol is
by default defined by the Microsoft compiler. For other compilers on DOS
systems, a flag "-DMSDOS" may be necessary when invoking the compilations.
Non-DOS systems should, obviously, *not* have a defined symbol MSDOS.
(b) Many systems which are based on GNU software, such as the Linux
operating system, have a function glob() to expand wildcards to filenames.
Icmake should be compiled with the symbol HAVE_GLOB (flag -DHAVE_GLOB on the
compiler command line) when this function is available.
When Icmake is compiled without this flag, wildcards are expanded using a
`poor mans solution' (PMS). See the file rss/dosfind.c for further details.
icmake-7.21.01/INSTALL.im 0000644 0001750 0001750 00000002306 12000542231 013522 0 ustar frank frank /*
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)
DOCDOCDIR more extensive documentation (icmake.ps, examples)
*/
// Define EXTENSION as ".exe" when compiling for CYGWIN
//#define EXTENSION ".exe"
#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"
icmake-7.21.01/LICENSE 0000644 0001750 0001750 00000104513 12267172275 013123 0 ustar frank frank 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-7.21.01/QUICKINSTALL 0000644 0001750 0001750 00000001200 12267170506 013724 0 ustar frank frank 0. After unpacking the icmake_X.YY.tar.gzicmake 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 CFLAGS environment variable. E.g.,
CFLAGS="-Wall -O2 -g"
3. Create the icmake installation files:
./icm_bootstrap /
4. To install, do as root:
./icm_install strip all /
5. Remove intermediate construction area:
rm -rf tmp
icmake-7.21.01/VERSION 0000644 0001750 0001750 00000000040 12267172216 013147 0 ustar frank frank VERSION=7.21.01
YEARS=1992-2014
icmake-7.21.01/changelog 0000644 0001750 0001750 00000036762 12267172167 014002 0 ustar frank frank 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.github.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, rather than
casting the char[2] to INT16.
* 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-7.21.01/comp/ 0000755 0001750 0001750 00000000000 12267171130 013035 5 ustar frank frank icmake-7.21.01/comp/yylexhid.c 0000644 0001750 0001750 00000003023 12000542231 015023 0 ustar frank frank /*
Y Y L E X H I D . C
Function called when yylex_file() is at eof.
If new hidden functions are defined, then the array hidden[] must be
enlarged to contain the name of the new function.
*/
#include "iccomp.h"
static int
hidden_idx = -1; /* hidden function idx */
static char
*cp = nullstring;
int yylex_hidden(char *buf, register int max_size)
{
register int
result = 0;
while (max_size) /* fill as much as possible */
{
if (!*cp) /* test available source */
{
if /* test if next idx will point */
( /* to another hidden function */
hidden_idx
==
sizeof(hidden) / sizeof(HIDDEN_FUNCTION_) - 1
)
break; /* if not: done, return 'result' */
hidden_idx++; /* next idx and next source */
if (!hidden[hidden_idx].this)
continue; /* if not called, no code */
cp = hidden[hidden_idx].source;
}
result++; /* count a char for the return */
max_size--; /* one char filled */
*buf++ = *cp++; /* and copy the char */
}
return (result); /* number of chars processed */
}
icmake-7.21.01/comp/threeargs.c 0000644 0001750 0001750 00000001665 12000542231 015162 0 ustar frank frank /*
T H R E E A R G S . C
*/
#include "iccomp.h"
ESTRUC_ *threeargs(type, larg, marg, rarg)
E_TYPE_
type;
ESTRUC_
*larg,
*marg,
*rarg;
{
register int
ok;
etoc(larg); /* arg to stack */
etoc(marg); /* arg to stack */
etoc(rarg); /* arg to stack */
switch ((FUNNR_)type)
{
case f_substr:
ok = test_type(larg, e_str) &&
test_type(marg, e_int) && test_type(rarg, e_int);
break;
default:
ok = 0;
}
if (ok)
{
catcode(rarg, marg); /* make one code vector */
catcode(rarg, larg); /* make one code vector */
callrss(rarg, type);
return (rarg);
}
semantic(type_conflict, funstring[type]);
return nullframe(larg);
}
icmake-7.21.01/comp/nullframe.c 0000644 0001750 0001750 00000000250 12000542231 015150 0 ustar frank frank /*
N U L L F R A M E . C
*/
#include "iccomp.h"
ESTRUC_ *nullframe(ESTRUC_ *e)
{
discard(e);
*e = *stackframe(0);
return e;
}
icmake-7.21.01/comp/unequal.c 0000644 0001750 0001750 00000001677 12000542231 014653 0 ustar frank frank /*
U N E Q U A L . C
*/
#include "iccomp.h"
ESTRUC_ *unequal (lval, rval)
ESTRUC_
*lval,
*rval;
{
btoi(lval); /* convert boolean to i */
btoi(rval);
if (conflict(lval, rval, op_neq)) /* test type conflict */
return(lval);
if ((lval->type & rval->type & (size_t)~ALLTYPES) == e_const)
{
if (test_type(lval, e_int))
lval->evalue = (lval->evalue != rval->evalue);
else
{
lval->evalue =
strcmp
(
stringtab[lval->evalue].string,
stringtab[rval->evalue].string
)
!= 0;
set_type(lval, e_int | e_const);
}
}
else
defcode(lval, rval, op_neq);
return (lval); /* return new expression */
}
icmake-7.21.01/comp/makefram.c 0000644 0001750 0001750 00000002466 12000542231 014761 0 ustar frank frank /*
M A K E F R A M . C
*/
#include "iccomp.h"
void make_frame()
{
register size_t
fun_idx,
idx;
ESTRUC_
e;
if (!(fun_idx = funtab.n_defined))
return;
fun_idx--;
/* set offset of 1st byte */
funtab.symbol[fun_idx].var.vu.i->count =
(size_t)ftell(s_bin);
/* room for type-bytes */
funtab.symbol[fun_idx].var.vu.i->ls.list.element =
xrealloc(NULL, n_params * sizeof(char));
/* store # of params */
funtab.symbol[fun_idx].var.vu.i->ls.list.size = n_params;
/* assign parameter types to str */
for (idx = 0; idx < n_params; idx++)
((char *)funtab.symbol[fun_idx].var.vu.i->ls.list.element)[idx] =
(char)(local.symbol[idx].var.type & ALLTYPES);
if (local.n_defined - n_params) /* any local variables ? */
{
e = *stackframe(0); /* initialize empty frame */
gencode(&e, op_frame); /* generate frame instruction */
outbin(e.code, e.codelen); /* write to s_bin */
free(e.code);
}
}
icmake-7.21.01/comp/incdec.c 0000644 0001750 0001750 00000001540 12000542231 014413 0 ustar frank frank /*
I N C D E C . C
*/
#include "iccomp.h"
ESTRUC_ *incdec (pp, opcode, e)
PREPOST_
pp;
OPCODE_
opcode;
ESTRUC_
*e;
{
register size_t
varnr;
if (test_operand(e, opcode))
{
semantic(illegal_type, opstring[opcode]);
return (e);
}
if (!test_type(e, e_var))
{
semantic(lvalue_needed, opstring[opcode]);
return (e);
}
varnr = e->evalue;
e->codelen = 0; /* INITIALIZED CODELEN HERE */
gencode(e, opcode, varnr); /* Generate INC/DEC opcode */
e->type = /* Indicate pre/post inc- decrement */
(pp == pre_op) ?
e_code | e_int | e_pre_inc_dec
:
e_code | e_int | e_post_inc_dec;
return (e);
}
icmake-7.21.01/comp/old.c 0000644 0001750 0001750 00000000700 12000542231 013741 0 ustar frank frank /*
O L D . C
*/
#include "iccomp.h"
ESTRUC_ *old (lval, rval)
ESTRUC_
*lval,
*rval;
{
if (test_binop(op_older, lval, rval))
return (lval); /* test for correct types */
etoc(lval); /* convert to code */
etoc(rval);
defcode(lval, rval, op_older);
return (lval); /* return new expression */
}
icmake-7.21.01/comp/fetob.c 0000644 0001750 0001750 00000000721 12000542231 014265 0 ustar frank frank /*
F E T O B . C
Force conversion of expression to boolean expression
*/
#include "iccomp.h"
void fetob(e)
ESTRUC_
*e;
{
if (test_type(e, e_bool))
return; /* done if boolean aloready */
etoc(e); /* convert to code unless bool */
gencode (e, op_jmp_true);
gencode (e, op_jmp, j_falselist);
set_type(e, e_code | e_bool);
}
icmake-7.21.01/comp/iccomp.h 0000644 0001750 0001750 00000034115 12000542231 014451 0 ustar frank frank /*
Symboltable structure:
After a functions is defined, the field
funtab.symbol[index_of_the_function].var.vu.i->count
contains the offset of the 1st byte of the function in the s_bin file.
Adding a hidden (macro) function:
=================================
../RSS/ICRSS.H:
1. add a f_... functionname before the f_hlt entry in the FUNNR enum.
PARSER:
1. define a parser constant, to be returned by the lexer
2. expand the proper nonterminal activated in the 'function'
nonterminal, to recognize the new parser constant
3. adapt the corresponding C function to recognize the new f_-entry.
This function should call 'callhidden()'
LEXER:
1. add the name of the function to the set of keywords, return the
newly defined parser constant, set the yylval.type field to the
newly defined f_-value.
DATA.C:
1. add the definition of the function to hidden[]
2. add the name of the function to funstring[]
ICCOMP.H (this file):
1. add an entry he_... to the HIDDEN_ENUM enum, before the final he_
entry
touch
CLEARHID.C and YYLEXHID.C
adapt
DOC/ICMAKE.1, copy this file to \sys\man, and update
\sys\man\icmake.1
remake
icm-comp.
*/
#include "../rss/icrssdef.h"
#include
#define bcopy(s,d,l) memcpy((d),(s),(l))
typedef enum /* order of elements must follow */
{ /* definition of hidden[] in */
he_older = 0, /* data.c */
he_younger = 1, /* reserved values 0 and 1 */
he_ /* must be last ! */
} HIDDEN_ENUM_;
typedef enum
{
pre_op,
post_op
} PREPOST_;
typedef enum
{
j_uncond, /* unconditional jump */
j_truelist, /* jump batchpatch for truelist */
j_falselist /* jump backbatch for falselist */
} JMP_COND_;
#define down_type(e,v) ((e)->type &= ~(v))
#define test_type(e,v) ((e)->type & (v))
#define set_type(e,v) ((e)->type = (v))
#define up_type(e,v) ((e)->type |= (v))
#define ALLTYPES (e_int | e_list | e_str | e_bool)
#define codestruc(estruc, x) (&(((ESTRUC_ *)((estruc)->code))[x]))
typedef struct
{
unsigned
index; /* index in stringsection */
char
*string; /* string itself */
} STRINGTAB_;
typedef struct /* symtab used with the compiler */
{
VAR_
var;
char
*name;
} SYMBOL_;
typedef struct
{
unsigned
n_allocated, /* available memory */
n_defined; /* defined variables */
SYMBOL_
*symbol;
} SYMTAB_;
typedef struct /* see also display code in */
{ /* callfun.c */
E_TYPE_
type; /* type of the expression */
size_t
truelen,
falselen,
codelen, /* length of the code */
evalue; /* index or value of the expression */
unsigned
*truelist,
*falselist;
INT8
*code;
} ESTRUC_;
typedef struct
{
char
*name, /* name of the hidden fun */
*source; /* source of the hidden function */
unsigned
type, /* returntype */
this, /* set to 1 if called */
nargs; /* # of arguments */
} HIDDEN_FUNCTION_;
#define YYSTYPE ESTRUC_
/*
Prototypes of often used functions and variabels defined in code
generated by FLEX and BISON.
*/
#ifndef YYSTYPE
#define YYSTYPE int
#endif
extern YYSTYPE
yylval; /* yyparse() semantic value */
extern FILE
*yyin, /* yylex() input file */
*yyout; /* yylex() output file */
extern int
initialization, /* for initialization expr. */
yy_init, /* yylex() initializer: 1 to init. */
yyleng, /* strlen(yytext) */
yynerrs; /* number of parse errors so far */
extern int
yylineno; /* yylex() line counter */
extern char
*yytext; /* yylex() read input chars */
extern int
parse_error,
(*yylex_input)(char *, int); /* pointer to yylex input to use */
int yyerror(char *); /* yyparse() error function */
int yylex(void); /* yylex() */
int yyparse(void); /* yyparse() */
typedef enum
{
err_openpar_expected,
err_closepar_expected,
err_openbrace_expected,
err_closebrace_expected,
err_semicol_expected,
err_assign_expected,
err_in_expression,
err_comma_expected,
err_statements_expected,
err_identifier_expected,
err_code_or_vars_expected,
err_comma_or_closepar_expected,
err_number_expected,
err_older_younger,
err_backtick_expected
} PARSE_ERR_;
extern char
release[],
*filenames,
*funstring[],
icm_comp[],
illegal_argcount[],
illegal_cast[],
illegal_type[],
init_expr_not_const[],
lvalue_needed[],
not_on_lists[],
not_on_strings[],
nullstring[],
only_on_ints[],
*opstring[],
*source_name,
*lexstring,
*stringbuf,
type_conflict[],
version[];
extern E_TYPE_
vartype;
extern E_TYPE_
optype[];
extern FILE
*s_bin;
extern OPCODE_
lastop;
extern STRINGTAB_
*stringtab;
extern SYMTAB_
funtab,
local,
global,
*entertab;
extern HIDDEN_FUNCTION_
hidden[he_];
extern size_t
break_ok,
dead_sp,
errcount,
hidden_called,
nestlevel,
n_params,
n_strings,
sem_err,
stringsize;
unsigned *dead;
extern ESTRUC_ global_init; /* code for initializing globals */
int conflict (ESTRUC_ *, ESTRUC_ *, /* conflicting binary types */
OPCODE_);
int test_binop (OPCODE_, ESTRUC_ *, /* test binop legality */
ESTRUC_ *);
int test_operand (ESTRUC_ *, OPCODE_); /* test legality of operand */
int yylex_file(char *, int); /* read yylex input from yyin */
int yylex_hidden(char *, int); /* read yylex input from buffer */
size_t fetchfun (void); /* fetch index of function */
size_t lookstring (char *); /* look for string in stringtab */
size_t looksym (SYMTAB_ *); /* look for symbol in symboltab */
size_t rm_jmp_zero (size_t, /* remove jmp 0 from || && lists */
unsigned *, size_t);
ESTRUC_ *addition (ESTRUC_ *, ESTRUC_ *); /* + code */
ESTRUC_ *and_boolean (ESTRUC_ *, ESTRUC_ *);/* && code */
ESTRUC_ *assign (ESTRUC_ *, ESTRUC_ *); /* = code (shell) */
ESTRUC_ *assignconst(ESTRUC_ *, ESTRUC_ *); /* initialization code */
ESTRUC_ *assignment (ESTRUC_ *, ESTRUC_ *, /* = code */
char *);
ESTRUC_ *band (ESTRUC_ *, ESTRUC_ *); /* & (binary) code */
ESTRUC_ *bnot (ESTRUC_ *); /* ~ code */
ESTRUC_ *bor (ESTRUC_ *, ESTRUC_ *); /* | (binary) code */
ESTRUC_ *break_stmnt (void); /* process break stmnt */
ESTRUC_ *callfun (size_t, ESTRUC_ *); /* call function */
ESTRUC_ *cast (E_TYPE_, ESTRUC_ *); /* perform cast */
ESTRUC_ *catcode (ESTRUC_ *, /* write info rval behind lval */
ESTRUC_ *);
ESTRUC_ *cat_expr (ESTRUC_ *, /* ,-separated expressions */
ESTRUC_ *);
ESTRUC_ *cat_stmnt (ESTRUC_ *, /* catenate/write stmnts */
ESTRUC_ *);
ESTRUC_ *divide (ESTRUC_ *, ESTRUC_ *); /* / code */
ESTRUC_ *equal (ESTRUC_ *, ESTRUC_ *); /* == code */
ESTRUC_ *exec_fprintf (E_TYPE_, ESTRUC_ *);/* exec() and fprintf() */
ESTRUC_ *execute (ESTRUC_ *); /* execute() (full arglist) */
ESTRUC_ *expr_stmnt (ESTRUC_ *); /* expr ; code */
ESTRUC_ *fetchvar (void); /* fetch variable */
ESTRUC_ *firstarg (ESTRUC_ *); /* (arg code */
ESTRUC_ *first_stmnt (ESTRUC_ *); /* catenate/write stmnts */
ESTRUC_ *for_stmnt (ESTRUC_ *, ESTRUC_ *, /* for statement */
ESTRUC_ *, ESTRUC_ *);
ESTRUC_ *greater (ESTRUC_ *, ESTRUC_ *); /* > code */
ESTRUC_ *gr_equal (ESTRUC_ *, ESTRUC_ *); /* >= code */
ESTRUC_ *icast (ESTRUC_ *); /* cast to int */
ESTRUC_ *if_stmnt (ESTRUC_ *, ESTRUC_ *, /* if code */
ESTRUC_ *);
ESTRUC_ *incdec (PREPOST_, OPCODE_, /* E.g., c++ */
ESTRUC_ *);
ESTRUC_ *indexOp (ESTRUC_ *, ESTRUC_ *); /* [] operator */
ESTRUC_ *insertarg (ESTRUC_ *, ESTRUC_ *);/* arg1, before arg2, ... */
ESTRUC_ *lcast (ESTRUC_ *); /* cast to list */
ESTRUC_ *makelist (ESTRUC_ *, E_TYPE_); /* makelist() */
ESTRUC_ *math_ass (ESTRUC_ *, ESTRUC_ *, /* shell for math-asgnmt */
ESTRUC_ *(*)(ESTRUC_ *, ESTRUC_ *),
char *);
ESTRUC_ *modulo (ESTRUC_ *, ESTRUC_ *); /* % code */
ESTRUC_ *multargs (ESTRUC_ *, ESTRUC_ *); /* (arg1, arg2, ... code */
ESTRUC_ *multiply (ESTRUC_ *, ESTRUC_ *); /* * code */
ESTRUC_ *negate (ESTRUC_ *); /* - (unary) code */
ESTRUC_ *not_boolean (ESTRUC_ *); /* ! code */
ESTRUC_ *nullframe(ESTRUC_ *e); /* discard(e) + *e = stackfr(0) */
ESTRUC_ *old (ESTRUC_ *, ESTRUC_ *); /* older code */
ESTRUC_ *onearg (E_TYPE_, ESTRUC_ *); /* fun(x) code */
ESTRUC_ *optint_special (E_TYPE_, /* fun([int,] ...) */
ESTRUC_ *, ESTRUC_ *);
ESTRUC_ *optint_string (E_TYPE_, /* chdir(), system() */
ESTRUC_ *, ESTRUC_ *);
ESTRUC_ *or_boolean (ESTRUC_ *, ESTRUC_ *);/* || code */
ESTRUC_ *return_stmnt (E_TYPE_, ESTRUC_ *);/* exit(), return(); */
ESTRUC_ *specials (E_TYPE_, ESTRUC_ *); /* fun(x, y, ...) code */
ESTRUC_ *scast (ESTRUC_ *); /* cast to str */
ESTRUC_ *shl (ESTRUC_ *, ESTRUC_ *); /* << (binary) code */
ESTRUC_ *shr (ESTRUC_ *, ESTRUC_ *); /* >> (binary) code */
ESTRUC_ *smaller (ESTRUC_ *, ESTRUC_ *); /* < code */
ESTRUC_ *sm_equal (ESTRUC_ *, ESTRUC_ *); /* <= code */
ESTRUC_ *stackframe (E_TYPE_); /* initialize a stack-element */
ESTRUC_ *subtract (ESTRUC_ *, ESTRUC_ *); /* - (binary) code */
ESTRUC_ *strupr_lwr (E_TYPE_, ESTRUC_ *); /* strupr<->strlwr */
ESTRUC_ *threeargs (E_TYPE_, ESTRUC_ *, /* fun(x, y, z) code */
ESTRUC_ *, ESTRUC_ *);
ESTRUC_ *twoargs (E_TYPE_, ESTRUC_ *, /* fun(x, y) code */
ESTRUC_ *);
ESTRUC_ *unequal (ESTRUC_ *, ESTRUC_ *); /* != code */
ESTRUC_ *while_stmnt (ESTRUC_ *, ESTRUC_ *);/* while code */
ESTRUC_ *young (ESTRUC_ *, ESTRUC_ *); /* younger code */
ESTRUC_ *xor (ESTRUC_ *, ESTRUC_ *); /* ^ (binary) code */
ESTRUC_ *zeroargs (E_TYPE_); /* fun() code */
void addpatch (unsigned *, size_t, /* add value to patch-list */
size_t);
void backend (void); /* finish s_bin construction */
void btoi (ESTRUC_ *); /* boolean to int */
void callrss (ESTRUC_ *, FUNNR_, /* call rss function */
...); /* and add asp, xxx instruction */
void callhidden(int, ESTRUC_ *); /* call hidden function */
void catargs (ESTRUC_ *); /* arguments to code */
void catstrings (ESTRUC_ *, /* catenate string consts */
ESTRUC_ *);
void change_file (char *); /* switch to other file */
void clearbin (ESTRUC_ *, /* clear and init 2 ESTRUC_s */
ESTRUC_ *);
void clear_hidden(void); /* clear hidden function-names */
void close_fun (ESTRUC_ *); /* close a function def. */
void copy_to_pop (ESTRUC_ *); /* op_copy_var to op_pop_var */
void defcode (ESTRUC_ *, ESTRUC_ *, /* generate default e_int|e_code */
OPCODE_);
void discard (ESTRUC_ *); /* free memory used by ESTRUC_ */
void etob (ESTRUC_ *); /* expr. prepare for boolean */
void etoc (ESTRUC_ *); /* convert E to code */
void enter (void); /* enter somthing in a symtab */
void entervar (void); /* enter variable in l/g-tab */
void fetob (ESTRUC_ *); /* forced e conversion to boolean */
void hidden_functions (void); /* patchup/generate hidden funs */
void last_stmnt (ESTRUC_ *); /* write last stmnt */
void make_frame (void); /* generate op_frame */
void gencode (ESTRUC_ *, OPCODE_, /* append new code */
...);
void open_fun (void); /* open a function */
void outbin (void *, size_t); /* write INT8s to s_bin */
void outcode (ESTRUC_ *, int, /* append code to e->code */
size_t);
void patchfalse (ESTRUC_ *); /* jmp_false target */
void patchtrue (ESTRUC_ *); /* jmp_true target */
void patchup (INT8 *, size_t, /* patchup t/f list */
unsigned *, size_t, int);
void patchup_true (ESTRUC_ *, int); /* batchpatch truelist */
void patchup_false (ESTRUC_ *, int);/* batchpatch truelist */
void pop_dead(void); /* restore dead-level */
void push_dead(void); /* new dead-level */
void semantic (char *, ...); /* give semantic error */
icmake-7.21.01/comp/execute.c 0000644 0001750 0001750 00000004435 12000542231 014636 0 ustar frank frank /*
E X E C U T E . C
*/
#include "iccomp.h"
/*
process: execute(mode, cmd, chead, ahead, ..., atail, ctail)
argnr: 1 2 3 4 count - 1, count
argidx: 0 1 2 3 4 count - 2, count - 1
...
count-3
at least required: 6 arguments
*/
ESTRUC_ *execute(arr)
ESTRUC_
*arr;
{
register size_t
count;
ESTRUC_
tmp,
*argp, /* pointer to args */
e;
count = arr->type; /* get argument count */
if (count < 6) /* to few arguments */
{
semantic(illegal_argcount, "execute");
return (arr); /* dummy args return */
}
argp = codestruc(arr, 0); /* point to first arg */
e = *(argp + 2); /* cmd head info at e */
callrss(&e, f_cmd_head); /* code for cmd_head at e */
callrss(argp + 3, f_arg_head); /* code for arg_head */
catcode(&e, argp + 3); /* code appended to e*/
callrss(&argp[count - 2], f_arg_tail); /* code for arg_tail */
catcode(&e, &argp[count - 2]); /* code appended to e*/
callrss(&argp[count - 1], f_cmd_tail); /* code for cmd_tail */
catcode(&e, &argp[count - 1]); /* code appended to e*/
/* keep variable # of args */
memmove(argp + 2, argp + 4, (count - 2) * sizeof(ESTRUC_));
arr->type -= 4; /* remove 4 arguments */
catcode(&e, specials(f_exec, arr)); /* catenate call-code */
free(stringbuf); /* make sure empty string */
stringbuf = xstrdup(nullstring); /* is pushed */
tmp = *stackframe(e_str | e_const); /* empty string argument */
etoc(&tmp);
catcode(&e, &tmp); /* empty string on the stack */
gencode(&e, op_call_rss, f_cmd_tail); /* used with cmd_tail..cmd_head */
gencode(&e, op_call_rss, f_arg_tail);
gencode(&e, op_call_rss, f_arg_head);
callrss(&e, f_cmd_head);
*arr = e;
return arr;
}
icmake-7.21.01/comp/multargs.c 0000644 0001750 0001750 00000001206 12000542231 015023 0 ustar frank frank /*
M U L T A R G S . C
*/
#include "iccomp.h"
ESTRUC_ *multargs(left, right)
ESTRUC_
*left,
*right;
{
register size_t
count;
count = ++left->type; /* get/increase # of args */
/* room for extra ESTRUC_ */
left->code = xrealloc(left->code, count * sizeof(ESTRUC_));
etoc(right); /* argument is code now */
/* right expression in array */
*codestruc(left, count - 1) = *right;
return (left); /* done */
}
icmake-7.21.01/comp/testbino.c 0000644 0001750 0001750 00000000653 12000542231 015021 0 ustar frank frank /*
T E S T B I N O . C
*/
#include "iccomp.h"
int test_binop(opcode, lval, rval)
OPCODE_
opcode;
ESTRUC_
*lval,
*rval;
{
register int
ret;
if
(
(ret =
(
test_operand(lval, opcode)
||
test_operand(rval, opcode)
)
)
)
clearbin(rval, lval);
return(ret);
}
icmake-7.21.01/comp/btoi.c 0000644 0001750 0001750 00000000763 12000542231 014131 0 ustar frank frank /*
B T O I . C
*/
#include "iccomp.h"
void btoi(e)
ESTRUC_
*e;
{
if (!test_type(e, e_bool)) /* no batchpatching needed */
return;
patchup_true(e, 1);
e->truelen = 0;
gencode(e, op_push_1_jmp_end); /* truelist target */
patchup_false(e, 1);
e->falselen = 0;
gencode(e, op_push_0); /* falselist target */
set_type(e, e_int | e_code); /* set int code type */
}
icmake-7.21.01/comp/optintsp.c 0000644 0001750 0001750 00000001304 12000542231 015044 0 ustar frank frank /*
O P T I N T S P . C
*/
#include "iccomp.h"
ESTRUC_ *optint_special(type, larg, rarg)
E_TYPE_
type;
ESTRUC_
*larg,
*rarg;
{
ESTRUC_
tmp;
etoc(larg); /* arg to stack */
if (!test_type(larg, e_int)) /* no first int arg */
{ /* prefix the first argument */
rarg = insertarg(larg, rarg);
/* make 0-argument */
tmp = *stackframe(e_int | e_const);
larg = &tmp; /* larg points to inserted arg */
}
return specials(type, insertarg(larg, rarg));
}
icmake-7.21.01/comp/forstmnt.c 0000644 0001750 0001750 00000000627 12000542231 015047 0 ustar frank frank /*
F O R S T M N T . C
*/
#include "iccomp.h"
ESTRUC_ *for_stmnt(init, cond, inc, stmnt)
ESTRUC_
*init,
*cond,
*inc,
*stmnt;
{
cat_stmnt(stmnt, inc); /* catenate inc to stmt */
while_stmnt(cond, stmnt); /* create while-stmnt */
return (catcode(init, cond)); /* return final code */
}
icmake-7.21.01/comp/execfpri.c 0000644 0001750 0001750 00000001760 12000542231 014777 0 ustar frank frank /*
E X E C F P R I . C
*/
#include "iccomp.h"
ESTRUC_ *exec_fprintf(type, args)
E_TYPE_
type;
ESTRUC_
*args;
{
register int
ok;
ESTRUC_
*e0;
if (args->type < 2) /* argcount must be at least 2 */
{
semantic(illegal_argcount, funstring[type]);
return (args);
}
e0 = codestruc(args, 0); /* pointer to first arg */
switch ((FUNNR_)type)
{
case f_fprintf: /* first arg must be string */
ok = test_type(e0, e_str);
break;
default: /* 1st arg must be int, */
ok = test_type(e0, e_int) && /* 2nd arg must be string */
test_type(codestruc(args, 1), e_str);
}
if (ok)
return (specials(type, args)); /* return specials call */
semantic(type_conflict, funstring[type]); /* type conflict error */
return (args);
}
icmake-7.21.01/comp/addition.c 0000644 0001750 0001750 00000001717 12000542231 014767 0 ustar frank frank /*
A D D I T I O N . C
*/
#include "iccomp.h"
ESTRUC_ *addition (ESTRUC_ *lval, ESTRUC_ *rval)
{
register E_TYPE_ type;
if (test_binop(op_add, lval, rval))
return (lval); /* test for correct types */
btoi(lval); /* convert pending booleans */
btoi(rval);
if (conflict(lval, rval, op_add)) /* test type conflict */
return(lval);
type = lval->type; /* keep type for later */
if ((type & rval->type & (size_t)~ALLTYPES) == e_const)
{
if (test_type(lval, e_int))
lval->evalue += rval->evalue;
else if (test_type(lval, e_str))
catstrings(lval, rval); /* create (cat) new string */
}
else
{
defcode(lval, rval, op_add);
set_type(lval, (type & ALLTYPES) | e_code);
}
return (lval); /* return new expression */
}
icmake-7.21.01/comp/parser.h 0000644 0001750 0001750 00000011211 12000542231 014463 0 ustar frank frank /* A Bison parser, made by GNU Bison 2.3. */
/* Skeleton interface for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
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 2, 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, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
under terms of your choice, so long as that work isn't itself a
parser generator using the skeleton or a modified version thereof
as a parser skeleton. Alternatively, if you modify or redistribute
the parser skeleton itself, you may (at your option) remove this
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
ARG_HEAD = 258,
ARG_TAIL = 259,
ASCII = 260,
BREAK = 261,
CHDIR = 262,
CMD_HEAD = 263,
CMD_TAIL = 264,
C_BASE = 265,
C_EXT = 266,
C_PATH = 267,
G_BASE = 268,
G_EXT = 269,
G_PATH = 270,
ELEMENT = 271,
ELSE = 272,
EXEC = 273,
EXECUTE = 274,
EXISTS = 275,
EXIT = 276,
FGETS = 277,
FIELDS = 278,
FOR = 279,
FPRINTF = 280,
GETENV = 281,
GETCH = 282,
GETPID = 283,
GETS = 284,
IDENTIFIER = 285,
IF = 286,
INT = 287,
LIST = 288,
MAKELIST = 289,
M_ECHO = 290,
NUMBER = 291,
PRINTF = 292,
PUTENV = 293,
RETURN = 294,
SIZEOFLIST = 295,
STAT = 296,
STRING = 297,
STRINGTYPE = 298,
STRLEN = 299,
STRLWR = 300,
STRUPR = 301,
STRFIND = 302,
SUBSTR = 303,
SYSTEM = 304,
VOID = 305,
WHILE = 306,
PLUS_IS = 307,
MOD_IS = 308,
MUL_IS = 309,
MINUS_IS = 310,
DIV_IS = 311,
SHR_IS = 312,
SHL_IS = 313,
XOR_IS = 314,
OR_IS = 315,
AND_IS = 316,
OR = 317,
AND = 318,
NOT_EQUAL = 319,
EQUAL = 320,
YOUNGER = 321,
OLDER = 322,
GREATER_EQUAL = 323,
SMALLER_EQUAL = 324,
SHR = 325,
SHL = 326,
DEC = 327,
INC = 328
};
#endif
/* Tokens. */
#define ARG_HEAD 258
#define ARG_TAIL 259
#define ASCII 260
#define BREAK 261
#define CHDIR 262
#define CMD_HEAD 263
#define CMD_TAIL 264
#define C_BASE 265
#define C_EXT 266
#define C_PATH 267
#define G_BASE 268
#define G_EXT 269
#define G_PATH 270
#define ELEMENT 271
#define ELSE 272
#define EXEC 273
#define EXECUTE 274
#define EXISTS 275
#define EXIT 276
#define FGETS 277
#define FIELDS 278
#define FOR 279
#define FPRINTF 280
#define GETENV 281
#define GETCH 282
#define GETPID 283
#define GETS 284
#define IDENTIFIER 285
#define IF 286
#define INT 287
#define LIST 288
#define MAKELIST 289
#define M_ECHO 290
#define NUMBER 291
#define PRINTF 292
#define PUTENV 293
#define RETURN 294
#define SIZEOFLIST 295
#define STAT 296
#define STRING 297
#define STRINGTYPE 298
#define STRLEN 299
#define STRLWR 300
#define STRUPR 301
#define STRFIND 302
#define SUBSTR 303
#define SYSTEM 304
#define VOID 305
#define WHILE 306
#define PLUS_IS 307
#define MOD_IS 308
#define MUL_IS 309
#define MINUS_IS 310
#define DIV_IS 311
#define SHR_IS 312
#define SHL_IS 313
#define XOR_IS 314
#define OR_IS 315
#define AND_IS 316
#define OR 317
#define AND 318
#define NOT_EQUAL 319
#define EQUAL 320
#define YOUNGER 321
#define OLDER 322
#define GREATER_EQUAL 323
#define SMALLER_EQUAL 324
#define SHR 325
#define SHL 326
#define DEC 327
#define INC 328
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef int YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif
extern YYSTYPE yylval;
icmake-7.21.01/comp/greater.c 0000644 0001750 0001750 00000001674 12000542231 014627 0 ustar frank frank /*
G R E A T E R . C
*/
#include "iccomp.h"
ESTRUC_ *greater (ESTRUC_ *lval, ESTRUC_ *rval)
{
btoi(lval); /* convert boolean to i */
btoi(rval);
if (conflict(lval, rval, op_gr)) /* test type conflict */
return(lval);
if ((lval->type & rval->type & (size_t)~ALLTYPES) == e_const)
{
if (test_type(lval, e_int))
lval->evalue = (lval->evalue > rval->evalue);
else
{
lval->evalue =
(
strcmp
(
stringtab[lval->evalue].string,
stringtab[rval->evalue].string
)
) > 0;
set_type(lval, e_int | e_const);
}
}
else
defcode(lval, rval, op_gr);
return (lval); /* return new expression */
}
icmake-7.21.01/comp/callfun.c 0000644 0001750 0001750 00000004364 12000542231 014621 0 ustar frank frank /*
C A L L F U N . C
*/
#include "iccomp.h"
ESTRUC_ *callfun(x, e)
size_t
x;
ESTRUC_
*e;
{
ESTRUC_
*a;
register size_t
idx,
n_pars;
size_t
err,
old_sem;
/*
fprintf(stderr,
"type: %d\n"
"truelen: %d\n"
"falselen: %d\n"
"codelen: %d\n"
"evalue: %d\n"
"truelist: %p\n"
"falselist: %p\n"
"code: %p\n",
e->type,
e->truelen,
e->falselen,
e->codelen,
e->evalue,
e->truelist,
e->falselist,
e->code);
*/
if (x == funtab.n_defined) /* function name not found ? */
return e; /* nothing to do here */
/* then check correct # of args */
n_pars = funtab.symbol[x].var.vu.i->ls.list.size;
if ((size_t)e->type != n_pars)
{
err = 1;
semantic("Function '%s()' requires %u arguments",
funtab.symbol[x].name, n_pars);
}
else
{ /* and check argument types */
for
(
err = 0,
a = (ESTRUC_ *)e->code,
idx = 0;
idx < n_pars;
idx++,
a++
)
{
if
(
!
(
((char *)
funtab.symbol[x].var.vu.i->ls.list.element)[idx]
& a->type & ALLTYPES
)
)
{
old_sem = sem_err;
err = 1;
semantic("Incorrect type of argument %u of function '%s()'",
idx + 1, funtab.symbol[x].name);
sem_err = old_sem;
}
}
sem_err |= err;
}
catargs(e); /* convert args to code */
/* call function and clean stack */
gencode(e, op_call, funtab.symbol[x].var.vu.i->count);
gencode(e, op_asp, n_pars);
set_type(e, funtab.symbol[x].var.type);
return e; /* return called function code */
}
icmake-7.21.01/comp/bnot.c 0000644 0001750 0001750 00000001074 12000542231 014132 0 ustar frank frank /*
B N O T . C
*/
#include "iccomp.h"
ESTRUC_ *bnot (ESTRUC_ *e) /* expression so far */
{
if (test_operand(e, op_bnot)) /* test types ok */
{
semantic(illegal_type, opstring[op_bnot]);
return (e);
}
if ((e->type & (size_t)~ALLTYPES) == e_const) /* immediate value */
e->evalue = ~e->evalue;
else
{
etoc(e); /* convert to code */
gencode(e, op_bnot); /* generate instruction */
}
return (e);
}
icmake-7.21.01/comp/cast.c 0000644 0001750 0001750 00000001322 12000542231 014116 0 ustar frank frank /*
C A S T . C
*/
#include "iccomp.h"
ESTRUC_ *cast(target, e)
E_TYPE_
target;
ESTRUC_
*e;
{
btoi(e); /* convert boolean to int */
switch (target)
{
case e_int: /* cast to ints */
icast(e);
break;
case e_str: /* cast to strings */
scast(e);
break;
case e_list: /* cast to lists */
lcast(e);
break;
default:
/*
default is entered in the switch to prevent a long compiler
warning
*/
break;
}
return (e);
}
icmake-7.21.01/comp/smequal.c 0000644 0001750 0001750 00000001731 12000542231 014637 0 ustar frank frank /*
S M E Q U A L . C
*/
#include "iccomp.h"
ESTRUC_ *sm_equal (lval, rval)
ESTRUC_
*lval,
*rval;
{
btoi(lval); /* convert boolean to i */
btoi(rval);
if (conflict(lval, rval, op_smeq)) /* test type conflict */
return(lval);
if ((lval->type & rval->type & (size_t)~ALLTYPES) == e_const)
{
if (test_type(lval, e_int))
lval->evalue = (lval->evalue <= rval->evalue);
else
{
lval->evalue =
(
strcmp
(
stringtab[lval->evalue].string,
stringtab[rval->evalue].string
)
) <= 0;
set_type(lval, e_int | e_const);
}
}
else
defcode(lval, rval, op_smeq);
return (lval); /* return new expression */
}
icmake-7.21.01/comp/multiply.c 0000644 0001750 0001750 00000001212 12000542231 015041 0 ustar frank frank /*
M U L T I P L Y . C
*/
#include "iccomp.h"
ESTRUC_ *multiply (ESTRUC_ *lval, ESTRUC_ *rval)
{
if (test_binop(op_mul, lval, rval))
return (lval); /* test for correct types */
btoi(lval); /* convert pending booleans */
btoi(rval);
if (conflict(lval, rval, op_mul)) /* test type conflict */
return(lval);
if ((lval->type & rval->type & (size_t)~ALLTYPES) == e_const)
lval->evalue *= rval->evalue;
else
defcode(lval, rval, op_mul);
return (lval); /* return new expression */
}
icmake-7.21.01/comp/fetchfun.c 0000644 0001750 0001750 00000000507 12000542231 014772 0 ustar frank frank /*
F E T C H F U N . C
*/
#include "iccomp.h"
size_t fetchfun()
{
register size_t idx;
/* test function defined */
if ((idx = looksym(&funtab)) == funtab.n_defined)
semantic ("Function '%s()' not defined", lexstring);
return idx;
}
icmake-7.21.01/comp/copytopo.c 0000644 0001750 0001750 00000000327 12000542231 015044 0 ustar frank frank /*
C O P Y T O P O . C
*/
#include "iccomp.h"
void copy_to_pop (e)
ESTRUC_
*e;
{
e->code[e->codelen - sizeof(INT16) - sizeof(INT8)] = op_pop_var;
lastop = op_pop_var;
}
icmake-7.21.01/comp/assign.c 0000644 0001750 0001750 00000000275 12000542231 014456 0 ustar frank frank /*
A S S I G N . C
*/
#include "iccomp.h"
ESTRUC_ *assign(lval, rval)
ESTRUC_
*lval,
*rval;
{
return (assignment(lval, rval, "="));
}
icmake-7.21.01/comp/parser.c 0000644 0001750 0001750 00000262414 12000542231 014473 0 ustar frank frank /* A Bison parser, made by GNU Bison 2.3. */
/* Skeleton implementation for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
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 2, 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, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
under terms of your choice, so long as that work isn't itself a
parser generator using the skeleton or a modified version thereof
as a parser skeleton. Alternatively, if you modify or redistribute
the parser skeleton itself, you may (at your option) remove this
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
/* C LALR(1) parser skeleton written by Richard Stallman, by
simplifying the original so-called "semantic" parser. */
/* All symbols defined below should begin with yy or YY, to avoid
infringing on user name space. This should be done even for local
variables, as they might otherwise be expanded by user macros.
There are some unavoidable exceptions within include files to
define necessary library symbols; they are noted "INFRINGES ON
USER NAME SPACE" below. */
/* Identify Bison output. */
#define YYBISON 1
/* Bison version. */
#define YYBISON_VERSION "2.3"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
/* Pure parsers. */
#define YYPURE 0
/* Using locations. */
#define YYLSP_NEEDED 0
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
ARG_HEAD = 258,
ARG_TAIL = 259,
ASCII = 260,
BREAK = 261,
CHDIR = 262,
CMD_HEAD = 263,
CMD_TAIL = 264,
C_BASE = 265,
C_EXT = 266,
C_PATH = 267,
G_BASE = 268,
G_EXT = 269,
G_PATH = 270,
ELEMENT = 271,
ELSE = 272,
EXEC = 273,
EXECUTE = 274,
EXISTS = 275,
EXIT = 276,
FGETS = 277,
FIELDS = 278,
FOR = 279,
FPRINTF = 280,
GETENV = 281,
GETCH = 282,
GETPID = 283,
GETS = 284,
IDENTIFIER = 285,
IF = 286,
INT = 287,
LIST = 288,
MAKELIST = 289,
M_ECHO = 290,
NUMBER = 291,
PRINTF = 292,
PUTENV = 293,
RETURN = 294,
SIZEOFLIST = 295,
STAT = 296,
STRING = 297,
STRINGTYPE = 298,
STRLEN = 299,
STRLWR = 300,
STRUPR = 301,
STRFIND = 302,
SUBSTR = 303,
SYSTEM = 304,
VOID = 305,
WHILE = 306,
PLUS_IS = 307,
MOD_IS = 308,
MUL_IS = 309,
MINUS_IS = 310,
DIV_IS = 311,
SHR_IS = 312,
SHL_IS = 313,
XOR_IS = 314,
OR_IS = 315,
AND_IS = 316,
OR = 317,
AND = 318,
NOT_EQUAL = 319,
EQUAL = 320,
YOUNGER = 321,
OLDER = 322,
GREATER_EQUAL = 323,
SMALLER_EQUAL = 324,
SHR = 325,
SHL = 326,
DEC = 327,
INC = 328
};
#endif
/* Tokens. */
#define ARG_HEAD 258
#define ARG_TAIL 259
#define ASCII 260
#define BREAK 261
#define CHDIR 262
#define CMD_HEAD 263
#define CMD_TAIL 264
#define C_BASE 265
#define C_EXT 266
#define C_PATH 267
#define G_BASE 268
#define G_EXT 269
#define G_PATH 270
#define ELEMENT 271
#define ELSE 272
#define EXEC 273
#define EXECUTE 274
#define EXISTS 275
#define EXIT 276
#define FGETS 277
#define FIELDS 278
#define FOR 279
#define FPRINTF 280
#define GETENV 281
#define GETCH 282
#define GETPID 283
#define GETS 284
#define IDENTIFIER 285
#define IF 286
#define INT 287
#define LIST 288
#define MAKELIST 289
#define M_ECHO 290
#define NUMBER 291
#define PRINTF 292
#define PUTENV 293
#define RETURN 294
#define SIZEOFLIST 295
#define STAT 296
#define STRING 297
#define STRINGTYPE 298
#define STRLEN 299
#define STRLWR 300
#define STRUPR 301
#define STRFIND 302
#define SUBSTR 303
#define SYSTEM 304
#define VOID 305
#define WHILE 306
#define PLUS_IS 307
#define MOD_IS 308
#define MUL_IS 309
#define MINUS_IS 310
#define DIV_IS 311
#define SHR_IS 312
#define SHL_IS 313
#define XOR_IS 314
#define OR_IS 315
#define AND_IS 316
#define OR 317
#define AND 318
#define NOT_EQUAL 319
#define EQUAL 320
#define YOUNGER 321
#define OLDER 322
#define GREATER_EQUAL 323
#define SMALLER_EQUAL 324
#define SHR 325
#define SHL 326
#define DEC 327
#define INC 328
/* Copy the first part of user declarations. */
#line 3 "parser"
#include "iccomp.h"
/* Enabling traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
/* Enabling verbose error messages. */
#ifdef YYERROR_VERBOSE
# undef YYERROR_VERBOSE
# define YYERROR_VERBOSE 1
#else
# define YYERROR_VERBOSE 0
#endif
/* Enabling the token table. */
#ifndef YYTOKEN_TABLE
# define YYTOKEN_TABLE 0
#endif
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef int YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif
/* Copy the second part of user declarations. */
/* Line 216 of yacc.c. */
#line 258 "parser.c"
#ifdef short
# undef short
#endif
#ifdef YYTYPE_UINT8
typedef YYTYPE_UINT8 yytype_uint8;
#else
typedef unsigned char yytype_uint8;
#endif
#ifdef YYTYPE_INT8
typedef YYTYPE_INT8 yytype_int8;
#elif (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
typedef signed char yytype_int8;
#else
typedef short int yytype_int8;
#endif
#ifdef YYTYPE_UINT16
typedef YYTYPE_UINT16 yytype_uint16;
#else
typedef unsigned short int yytype_uint16;
#endif
#ifdef YYTYPE_INT16
typedef YYTYPE_INT16 yytype_int16;
#else
typedef short int yytype_int16;
#endif
#ifndef YYSIZE_T
# ifdef __SIZE_TYPE__
# define YYSIZE_T __SIZE_TYPE__
# elif defined size_t
# define YYSIZE_T size_t
# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
# include /* INFRINGES ON USER NAME SPACE */
# define YYSIZE_T size_t
# else
# define YYSIZE_T unsigned int
# endif
#endif
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
#ifndef YY_
# if YYENABLE_NLS
# if ENABLE_NLS
# include /* INFRINGES ON USER NAME SPACE */
# define YY_(msgid) dgettext ("bison-runtime", msgid)
# endif
# endif
# ifndef YY_
# define YY_(msgid) msgid
# endif
#endif
/* Suppress unused-variable warnings by "using" E. */
#if ! defined lint || defined __GNUC__
# define YYUSE(e) ((void) (e))
#else
# define YYUSE(e) /* empty */
#endif
/* Identity function, used to suppress warnings about constant conditions. */
#ifndef lint
# define YYID(n) (n)
#else
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static int
YYID (int i)
#else
static int
YYID (i)
int i;
#endif
{
return i;
}
#endif
#if ! defined yyoverflow || YYERROR_VERBOSE
/* The parser invokes alloca or malloc; define the necessary symbols. */
# ifdef YYSTACK_USE_ALLOCA
# if YYSTACK_USE_ALLOCA
# ifdef __GNUC__
# define YYSTACK_ALLOC __builtin_alloca
# elif defined __BUILTIN_VA_ARG_INCR
# include /* INFRINGES ON USER NAME SPACE */
# elif defined _AIX
# define YYSTACK_ALLOC __alloca
# elif defined _MSC_VER
# include /* INFRINGES ON USER NAME SPACE */
# define alloca _alloca
# else
# define YYSTACK_ALLOC alloca
# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
# include /* INFRINGES ON USER NAME SPACE */
# ifndef _STDLIB_H
# define _STDLIB_H 1
# endif
# endif
# endif
# endif
# endif
# ifdef YYSTACK_ALLOC
/* Pacify GCC's `empty if-body' warning. */
# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
# ifndef YYSTACK_ALLOC_MAXIMUM
/* The OS might guarantee only one guard page at the bottom of the stack,
and a page size can be as small as 4096 bytes. So we cannot safely
invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
to allow for a few compiler-allocated temporary stack slots. */
# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
# endif
# else
# define YYSTACK_ALLOC YYMALLOC
# define YYSTACK_FREE YYFREE
# ifndef YYSTACK_ALLOC_MAXIMUM
# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
# endif
# if (defined __cplusplus && ! defined _STDLIB_H \
&& ! ((defined YYMALLOC || defined malloc) \
&& (defined YYFREE || defined free)))
# include /* INFRINGES ON USER NAME SPACE */
# ifndef _STDLIB_H
# define _STDLIB_H 1
# endif
# endif
# ifndef YYMALLOC
# define YYMALLOC malloc
# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
# ifndef YYFREE
# define YYFREE free
# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
void free (void *); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
# endif
#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
#if (! defined yyoverflow \
&& (! defined __cplusplus \
|| (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
/* A type that is properly aligned for any stack member. */
union yyalloc
{
yytype_int16 yyss;
YYSTYPE yyvs;
};
/* The size of the maximum gap between one aligned stack and the next. */
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
/* The size of an array large to enough to hold all stacks, each with
N elements. */
# define YYSTACK_BYTES(N) \
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
+ YYSTACK_GAP_MAXIMUM)
/* Copy COUNT objects from FROM to TO. The source and destination do
not overlap. */
# ifndef YYCOPY
# if defined __GNUC__ && 1 < __GNUC__
# define YYCOPY(To, From, Count) \
__builtin_memcpy (To, From, (Count) * sizeof (*(From)))
# else
# define YYCOPY(To, From, Count) \
do \
{ \
YYSIZE_T yyi; \
for (yyi = 0; yyi < (Count); yyi++) \
(To)[yyi] = (From)[yyi]; \
} \
while (YYID (0))
# endif
# endif
/* Relocate STACK from its old location to the new one. The
local variables YYSIZE and YYSTACKSIZE give the old and new number of
elements in the stack, and YYPTR gives the new location of the
stack. Advance YYPTR to a properly aligned location for the next
stack. */
# define YYSTACK_RELOCATE(Stack) \
do \
{ \
YYSIZE_T yynewbytes; \
YYCOPY (&yyptr->Stack, Stack, yysize); \
Stack = &yyptr->Stack; \
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
yyptr += yynewbytes / sizeof (*yyptr); \
} \
while (YYID (0))
#endif
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 11
/* YYLAST -- Last index in YYTABLE. */
#define YYLAST 785
/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 96
/* YYNNTS -- Number of nonterminals. */
#define YYNNTS 86
/* YYNRULES -- Number of rules. */
#define YYNRULES 206
/* YYNRULES -- Number of states. */
#define YYNSTATES 339
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
#define YYUNDEFTOK 2
#define YYMAXUTOK 328
#define YYTRANSLATE(YYX) \
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
static const yytype_uint8 yytranslate[] =
{
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 83, 2, 2, 2, 82, 67, 2,
94, 90, 80, 78, 91, 79, 2, 81, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 95,
70, 52, 71, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 87, 2, 93, 66, 2, 88, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 92, 65, 89, 84, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
45, 46, 47, 48, 49, 50, 51, 53, 54, 55,
56, 57, 58, 59, 60, 61, 62, 63, 64, 68,
69, 72, 73, 74, 75, 76, 77, 85, 86
};
#if YYDEBUG
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
YYRHS. */
static const yytype_uint16 yyprhs[] =
{
0, 0, 3, 6, 8, 12, 14, 15, 17, 19,
21, 23, 24, 27, 28, 31, 32, 35, 36, 39,
42, 44, 47, 49, 53, 56, 59, 62, 64, 66,
68, 69, 72, 76, 81, 85, 89, 93, 97, 101,
105, 109, 113, 117, 121, 125, 129, 133, 137, 141,
145, 149, 153, 157, 161, 165, 169, 173, 177, 181,
185, 189, 193, 197, 201, 204, 207, 210, 213, 216,
219, 222, 225, 230, 232, 234, 238, 240, 244, 246,
250, 252, 255, 267, 272, 275, 277, 280, 284, 290,
298, 303, 308, 312, 316, 320, 322, 324, 326, 332,
335, 339, 342, 352, 354, 356, 358, 361, 364, 366,
369, 373, 380, 388, 392, 393, 395, 397, 398, 401,
403, 405, 407, 409, 411, 413, 415, 417, 419, 421,
423, 425, 427, 429, 431, 433, 435, 437, 438, 441,
442, 445, 447, 449, 451, 452, 454, 456, 458, 460,
462, 464, 466, 468, 470, 472, 473, 475, 476, 480,
482, 485, 486, 487, 490, 492, 494, 495, 498, 500,
503, 505, 507, 510, 513, 515, 517, 519, 522, 525,
528, 531, 533, 535, 537, 539, 541, 543, 545, 547,
549, 551, 554, 558, 560, 564, 566, 568, 570, 572,
574, 576, 579, 587, 589, 591, 593
};
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
static const yytype_int16 yyrhs[] =
{
97, 0, -1, 97, 113, -1, 113, -1, 98, 108,
117, -1, 117, -1, -1, 6, -1, 32, -1, 33,
-1, 43, -1, -1, 103, 88, -1, -1, 105, 89,
-1, -1, 107, 90, -1, -1, 109, 91, -1, 91,
98, -1, 181, -1, 91, 117, -1, 181, -1, 92,
167, 104, -1, 157, 175, -1, 177, 124, -1, 17,
166, -1, 181, -1, 30, -1, 115, -1, -1, 118,
119, -1, 119, 52, 119, -1, 119, 87, 119, 93,
-1, 119, 55, 119, -1, 119, 57, 119, -1, 119,
54, 119, -1, 119, 53, 119, -1, 119, 56, 119,
-1, 119, 62, 119, -1, 119, 61, 119, -1, 119,
60, 119, -1, 119, 59, 119, -1, 119, 58, 119,
-1, 119, 63, 119, -1, 119, 64, 119, -1, 119,
69, 119, -1, 119, 68, 119, -1, 119, 70, 119,
-1, 119, 71, 119, -1, 119, 75, 119, -1, 119,
74, 119, -1, 119, 78, 119, -1, 119, 67, 119,
-1, 119, 65, 119, -1, 119, 66, 119, -1, 119,
77, 119, -1, 119, 76, 119, -1, 119, 79, 119,
-1, 119, 80, 119, -1, 119, 72, 119, -1, 119,
73, 119, -1, 119, 81, 119, -1, 119, 82, 119,
-1, 79, 119, -1, 86, 119, -1, 119, 86, -1,
85, 119, -1, 119, 85, -1, 78, 119, -1, 84,
119, -1, 83, 119, -1, 94, 101, 90, 119, -1,
169, -1, 36, -1, 94, 119, 106, -1, 125, -1,
88, 119, 102, -1, 117, -1, 121, 91, 120, -1,
120, -1, 24, 140, -1, 122, 146, 152, 164, 151,
164, 152, 106, 99, 166, 160, -1, 127, 129, 167,
104, -1, 126, 106, -1, 30, -1, 180, 146, -1,
145, 146, 117, -1, 170, 146, 117, 108, 117, -1,
171, 146, 117, 108, 117, 108, 117, -1, 154, 146,
117, 111, -1, 153, 146, 117, 110, -1, 37, 146,
98, -1, 25, 146, 98, -1, 128, 146, 150, -1,
137, -1, 30, -1, 30, -1, 146, 156, 90, 148,
155, -1, 115, 181, -1, 116, 133, 119, -1, 31,
140, -1, 131, 146, 117, 106, 166, 160, 161, 114,
160, -1, 52, -1, 39, -1, 21, -1, 172, 173,
-1, 136, 135, -1, 135, -1, 138, 139, -1, 138,
108, 117, -1, 138, 108, 142, 108, 117, 139, -1,
138, 108, 117, 108, 142, 108, 117, -1, 34, 146,
117, -1, -1, 161, -1, 95, -1, -1, 143, 144,
-1, 73, -1, 72, -1, 5, -1, 40, -1, 20,
-1, 35, -1, 9, -1, 8, -1, 3, -1, 4,
-1, 13, -1, 15, -1, 14, -1, 38, -1, 26,
-1, 44, -1, 46, -1, 45, -1, -1, 147, 94,
-1, -1, 149, 92, -1, 98, -1, 181, -1, 117,
-1, -1, 121, -1, 181, -1, 18, -1, 19, -1,
41, -1, 7, -1, 49, -1, 136, -1, 181, -1,
158, -1, -1, 172, -1, -1, 158, 108, 159, -1,
159, -1, 172, 115, -1, -1, -1, 134, 163, -1,
117, -1, 181, -1, -1, 165, 95, -1, 168, -1,
167, 166, -1, 181, -1, 112, -1, 95, 181, -1,
120, 164, -1, 179, -1, 132, -1, 123, -1, 162,
164, -1, 100, 164, -1, 1, 141, -1, 169, 42,
-1, 42, -1, 11, -1, 10, -1, 12, -1, 16,
-1, 22, -1, 23, -1, 47, -1, 48, -1, 176,
-1, 174, 164, -1, 174, 108, 130, -1, 130, -1,
1, 141, 181, -1, 173, -1, 124, -1, 32, -1,
43, -1, 33, -1, 50, -1, 51, 140, -1, 178,
146, 117, 106, 99, 166, 160, -1, 27, -1, 28,
-1, 29, -1, -1
};
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
0, 107, 107, 110, 115, 122, 129, 135, 142, 144,
146, 149, 149, 150, 150, 151, 151, 152, 152, 155,
161, 165, 171, 175, 184, 187, 192, 198, 202, 209,
216, 216, 226, 233, 241, 248, 255, 262, 269, 276,
283, 290, 297, 304, 311, 318, 325, 332, 339, 346,
353, 360, 367, 374, 381, 388, 395, 402, 409, 416,
423, 430, 437, 444, 451, 457, 463, 469, 475, 481,
487, 493, 499, 507, 512, 517, 524, 526, 535, 542,
549, 553, 558, 575, 585, 588, 595, 601, 608, 617,
628, 636, 644, 651, 658, 665, 669, 676, 683, 698,
701, 711, 716, 731, 740, 742, 746, 754, 760, 765,
780, 795, 817, 842, 851, 858, 865, 872, 872, 880,
882, 886, 888, 890, 892, 894, 896, 898, 900, 902,
904, 906, 908, 910, 912, 914, 916, 919, 919, 920,
920, 923, 925, 929, 931, 938, 940, 944, 946, 950,
952, 954, 958, 960, 964, 965, 969, 971, 977, 981,
985, 993, 999, 1007, 1015, 1017, 1020, 1020, 1023, 1030,
1036, 1040, 1042, 1048, 1051, 1053, 1055, 1057, 1060, 1063,
1068, 1074, 1083, 1085, 1087, 1089, 1091, 1093, 1095, 1099,
1103, 1112, 1120, 1128, 1130, 1139, 1144, 1148, 1150, 1152,
1156, 1163, 1168, 1184, 1186, 1188, 1192
};
#endif
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] =
{
"$end", "error", "$undefined", "ARG_HEAD", "ARG_TAIL", "ASCII", "BREAK",
"CHDIR", "CMD_HEAD", "CMD_TAIL", "C_BASE", "C_EXT", "C_PATH", "G_BASE",
"G_EXT", "G_PATH", "ELEMENT", "ELSE", "EXEC", "EXECUTE", "EXISTS",
"EXIT", "FGETS", "FIELDS", "FOR", "FPRINTF", "GETENV", "GETCH", "GETPID",
"GETS", "IDENTIFIER", "IF", "INT", "LIST", "MAKELIST", "M_ECHO",
"NUMBER", "PRINTF", "PUTENV", "RETURN", "SIZEOFLIST", "STAT", "STRING",
"STRINGTYPE", "STRLEN", "STRLWR", "STRUPR", "STRFIND", "SUBSTR",
"SYSTEM", "VOID", "WHILE", "'='", "PLUS_IS", "MOD_IS", "MUL_IS",
"MINUS_IS", "DIV_IS", "SHR_IS", "SHL_IS", "XOR_IS", "OR_IS", "AND_IS",
"OR", "AND", "'|'", "'^'", "'&'", "NOT_EQUAL", "EQUAL", "'<'", "'>'",
"YOUNGER", "OLDER", "GREATER_EQUAL", "SMALLER_EQUAL", "SHR", "SHL",
"'+'", "'-'", "'*'", "'/'", "'%'", "'!'", "'~'", "DEC", "INC", "'['",
"'`'", "'}'", "')'", "','", "'{'", "']'", "'('", "';'", "$accept",
"input", "args", "break_ok", "break_stat", "casttype", "backtick", "@1",
"closebrace", "@2", "closepar", "@3", "comma", "@4", "comma_arglist",
"comma_expr", "compound", "def_var_or_fun", "else_tail", "enterid",
"entervarid", "err_expression", "@5", "expression", "expr_code",
"expr_list", "for", "for_stat", "funcdef", "func_or_var", "function",
"funid", "funname", "funvars", "idexpr", "if", "if_stat", "initassign",
"leave_key", "local_list", "locals", "makelist", "makelist_expr",
"makelist_normal", "nesting", "ok", "older_younger", "@6", "old_young",
"one_arg_funs", "openpar", "@7", "openbrace", "@8", "opt_arglist",
"opt_expression", "opt_expr_list", "optint_special", "optint_string",
"opt_locals", "opt_parlist", "opt_vartype", "pars", "partype", "popdead",
"pushdead", "return_stat", "return_tail", "semicol", "@9", "statement",
"statements", "stm", "string", "two_arg_funs", "three_arg_funs",
"type_of_var", "vardefs", "varnames", "var_or_fun", "vartype",
"voidtype", "while", "while_stat", "zero_arg_funs", "zeroframe", 0
};
#endif
# ifdef YYPRINT
/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
token YYLEX-NUM. */
static const yytype_uint16 yytoknum[] =
{
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
305, 306, 61, 307, 308, 309, 310, 311, 312, 313,
314, 315, 316, 317, 318, 124, 94, 38, 319, 320,
60, 62, 321, 322, 323, 324, 325, 326, 43, 45,
42, 47, 37, 33, 126, 327, 328, 91, 96, 125,
41, 44, 123, 93, 40, 59
};
# endif
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const yytype_uint8 yyr1[] =
{
0, 96, 97, 97, 98, 98, 99, 100, 101, 101,
101, 103, 102, 105, 104, 107, 106, 109, 108, 110,
110, 111, 111, 112, 113, 113, 114, 114, 115, 116,
118, 117, 119, 119, 119, 119, 119, 119, 119, 119,
119, 119, 119, 119, 119, 119, 119, 119, 119, 119,
119, 119, 119, 119, 119, 119, 119, 119, 119, 119,
119, 119, 119, 119, 119, 119, 119, 119, 119, 119,
119, 119, 119, 119, 119, 119, 119, 119, 120, 121,
121, 122, 123, 124, 125, 125, 126, 126, 126, 126,
126, 126, 126, 126, 126, 126, 127, 128, 129, 130,
130, 131, 132, 133, 134, 134, 135, 136, 136, 137,
137, 137, 137, 138, 139, 140, 141, 143, 142, 144,
144, 145, 145, 145, 145, 145, 145, 145, 145, 145,
145, 145, 145, 145, 145, 145, 145, 147, 146, 149,
148, 150, 150, 151, 151, 152, 152, 153, 153, 154,
154, 154, 155, 155, 156, 156, 157, 157, 158, 158,
159, 160, 161, 162, 163, 163, 165, 164, 166, 167,
167, 168, 168, 168, 168, 168, 168, 168, 168, 168,
169, 169, 170, 170, 170, 170, 170, 170, 170, 171,
172, 173, 174, 174, 174, 175, 175, 176, 176, 176,
177, 178, 179, 180, 180, 180, 181
};
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
static const yytype_uint8 yyr2[] =
{
0, 2, 2, 1, 3, 1, 0, 1, 1, 1,
1, 0, 2, 0, 2, 0, 2, 0, 2, 2,
1, 2, 1, 3, 2, 2, 2, 1, 1, 1,
0, 2, 3, 4, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 2, 2, 2, 2, 2, 2,
2, 2, 4, 1, 1, 3, 1, 3, 1, 3,
1, 2, 11, 4, 2, 1, 2, 3, 5, 7,
4, 4, 3, 3, 3, 1, 1, 1, 5, 2,
3, 2, 9, 1, 1, 1, 2, 2, 1, 2,
3, 6, 7, 3, 0, 1, 1, 0, 2, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 0, 2, 0,
2, 1, 1, 1, 0, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 0, 1, 0, 3, 1,
2, 0, 0, 2, 1, 1, 0, 2, 1, 2,
1, 1, 2, 2, 1, 1, 1, 2, 2, 2,
2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 2, 3, 1, 3, 1, 1, 1, 1, 1,
1, 2, 7, 1, 1, 1, 0
};
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
STATE-NUM when YYTABLE doesn't specify something else to do. Zero
means the default is an error. */
static const yytype_uint8 yydefact[] =
{
157, 197, 199, 198, 200, 157, 3, 0, 156, 190,
0, 1, 2, 0, 28, 206, 0, 196, 137, 193,
195, 17, 24, 96, 25, 116, 206, 99, 103, 0,
206, 155, 0, 0, 0, 191, 0, 194, 127, 128,
121, 150, 126, 125, 183, 182, 184, 129, 131, 130,
185, 147, 148, 123, 186, 187, 137, 133, 203, 204,
205, 85, 137, 124, 74, 137, 132, 122, 149, 181,
134, 136, 135, 188, 189, 151, 0, 0, 0, 0,
0, 0, 0, 0, 100, 76, 15, 137, 95, 17,
137, 137, 137, 73, 137, 137, 137, 0, 170, 0,
17, 159, 0, 138, 28, 192, 18, 167, 30, 30,
30, 69, 64, 71, 70, 67, 65, 11, 8, 9,
10, 0, 15, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 68, 66, 0, 84, 0, 30,
30, 109, 30, 30, 30, 180, 30, 30, 86, 0,
7, 105, 162, 162, 104, 162, 206, 206, 166, 83,
0, 171, 78, 0, 166, 137, 176, 137, 175, 30,
166, 169, 168, 137, 174, 139, 0, 160, 17, 5,
113, 17, 77, 0, 0, 75, 32, 37, 36, 34,
38, 35, 43, 42, 41, 40, 39, 44, 45, 54,
55, 53, 47, 46, 48, 49, 60, 61, 51, 50,
57, 56, 52, 58, 59, 62, 63, 0, 16, 17,
94, 142, 17, 17, 0, 87, 206, 206, 17, 17,
179, 81, 115, 101, 201, 0, 172, 178, 14, 31,
173, 30, 30, 164, 163, 165, 177, 30, 206, 0,
158, 30, 12, 72, 33, 117, 30, 120, 119, 118,
30, 91, 20, 30, 90, 22, 30, 30, 23, 80,
145, 166, 146, 15, 15, 108, 152, 98, 0, 153,
140, 4, 17, 114, 17, 21, 88, 17, 30, 30,
0, 6, 107, 106, 30, 111, 30, 79, 143, 166,
161, 0, 112, 89, 30, 162, 161, 15, 206, 202,
6, 0, 161, 27, 0, 26, 102, 161, 82
};
/* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int16 yydefgoto[] =
{
-1, 5, 198, 321, 178, 121, 202, 203, 179, 180,
157, 158, 271, 34, 281, 284, 181, 6, 332, 15,
16, 182, 183, 84, 184, 290, 185, 186, 17, 85,
86, 18, 87, 30, 19, 187, 188, 29, 189, 295,
296, 88, 89, 161, 251, 26, 243, 244, 279, 90,
31, 32, 268, 269, 240, 319, 291, 91, 92, 297,
99, 7, 100, 101, 325, 252, 190, 264, 35, 36,
191, 97, 192, 93, 94, 95, 8, 20, 21, 22,
9, 10, 193, 194, 96, 98
};
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
STATE-NUM. */
#define YYPACT_NINF -299
static const yytype_int16 yypact[] =
{
-3, -299, -299, -299, -299, 22, -299, 2, -299, -299,
-9, -299, -299, -64, -60, -14, 1, -299, -299, -299,
-299, -52, -299, -299, -299, -299, -299, -299, -299, 655,
-299, -8, -28, 40, -24, -299, -22, -299, -299, -299,
-299, -299, -299, -299, -299, -299, -299, -299, -299, -299,
-299, -299, -299, -299, -299, -299, -299, -299, -299, -299,
-299, -23, -299, -299, -299, -299, -299, -299, -299, -299,
-299, -299, -299, -299, -299, -299, 655, 655, 655, 655,
655, 655, 655, 567, 698, -299, -299, -299, -299, -13,
-299, -299, -299, 33, -299, -299, -299, 379, -299, -7,
-6, -299, 40, -299, -299, -299, -299, -299, -299, -299,
-299, -59, -59, -59, -59, -59, -59, 698, -299, -299,
-299, -5, 698, 655, 655, 655, 655, 655, 655, 655,
655, 655, 655, 655, 655, 655, 655, 655, 655, 655,
655, 655, 655, 655, 655, 655, 655, 655, 655, 655,
655, 655, 655, 655, -299, -299, 655, -299, -2, 30,
-55, -299, -299, -299, -299, -299, -299, -299, -299, -64,
-299, -299, -299, -299, -299, -299, -299, -299, -299, -299,
42, -299, -299, 655, -299, -299, -299, -299, -299, -19,
-299, -299, -299, -299, -299, -299, -8, -299, 45, -299,
-299, 46, -299, -1, 655, -299, 698, 698, 698, 698,
698, 698, 698, 698, 698, 698, 698, 225, 284, 365,
118, 458, 547, 547, 139, 139, 139, 139, 139, 139,
47, 47, 70, 70, -59, -59, -59, 37, -299, 48,
-299, -299, 50, -299, -21, -299, -10, 51, -299, -299,
-299, -299, -299, -299, -299, 379, -299, -299, -299, 698,
-299, -19, -299, -299, -299, -299, -299, -299, -8, 53,
-299, -299, -299, -59, -299, -299, -299, -299, -299, -299,
-299, -299, -299, -299, -299, -299, -299, -299, -299, -299,
52, -299, -299, -299, -299, -299, -8, -299, 12, -299,
-299, -299, -299, -299, 56, -299, -299, -299, -299, 58,
474, -299, -299, -299, -299, -299, -299, -299, -299, -299,
-299, 474, -299, -299, 30, -299, -299, -299, 65, -299,
-299, 474, -299, -299, 474, -299, -299, -299, -299
};
/* YYPGOTO[NTERM-NUM]. */
static const yytype_int16 yypgoto[] =
{
-299, -299, -101, -193, -299, -299, -299, -299, -107, -299,
-118, -299, -20, -299, -299, -299, -299, 149, -299, 59,
-299, -103, -299, 192, -246, -299, -299, -299, 148, -299,
-299, -299, -299, -299, 127, -299, -299, -299, -299, -133,
-299, -299, -299, -138, -136, 0, -109, -299, -299, -299,
-46, -299, -299, -299, -299, -299, -154, -299, -299, -299,
-299, -299, -299, -25, -258, -153, -299, -299, -170, -299,
-298, 5, -299, -299, -299, -299, -29, -120, -299, -299,
-299, -299, -299, -299, -299, -15
};
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
positive, shift that token. If negative, reduce the rule which
number is the opposite. If zero, do what YYDEFACT says.
If YYTABLE_NINF, syntax error. */
#define YYTABLE_NINF -207
static const yytype_int16 yytable[] =
{
27, 33, 102, 13, 205, 199, 200, 199, 257, 201,
108, 37, 320, 13, 260, 289, 109, -117, -117, 110,
266, 23, 11, 326, 1, 2, 154, 155, 156, 1,
2, 25, 14, 335, -96, 3, 337, 253, -29, 254,
3, 159, 104, -166, 162, 163, 164, 4, 166, 167,
168, 277, 278, 28, 1, 2, 199, 242, 239, 245,
246, 247, 317, 248, 249, 3, 103, 106, 329, 160,
104, -97, 4, 107, 336, 165, -206, -114, 289, 338,
196, 280, 331, 195, -154, 204, 263, 272, 238, 123,
124, 125, 126, 127, 128, 129, 130, 131, 132, 133,
134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
144, 145, 146, 147, 148, 149, 150, 151, 152, 153,
-206, 309, 154, 155, 156, 149, 150, 151, 152, 153,
274, 258, 154, 155, 156, -93, -92, 334, -141, 261,
-110, 262, 283, 308, 241, 300, -19, 267, 288, 324,
151, 152, 153, -144, 12, 154, 155, 156, 24, 293,
105, 197, 256, 312, 294, 315, 302, 102, 301, 250,
327, 270, 328, 303, 265, 310, 311, 199, 313, 304,
305, 255, 0, 306, 307, 138, 139, 140, 141, 142,
143, 144, 145, 146, 147, 148, 149, 150, 151, 152,
153, 0, 0, 154, 155, 156, 318, 0, 0, 330,
0, 322, 0, 323, 0, 147, 148, 149, 150, 151,
152, 153, 275, 276, 154, 155, 156, 0, 286, 287,
0, 282, 285, 0, 0, 0, 0, 0, 0, 298,
0, 0, 0, 0, 0, 0, 292, 0, 0, 0,
0, 0, 0, 299, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 298, 111, 112,
113, 114, 115, 116, 117, 122, 0, 0, 0, 0,
0, 0, 314, 0, 0, 0, 0, 316, 0, 135,
136, 137, 138, 139, 140, 141, 142, 143, 144, 145,
146, 147, 148, 149, 150, 151, 152, 153, 0, 292,
154, 155, 156, 333, 0, 206, 207, 208, 209, 210,
211, 212, 213, 214, 215, 216, 217, 218, 219, 220,
221, 222, 223, 224, 225, 226, 227, 228, 229, 230,
231, 232, 233, 234, 235, 236, 0, 0, 237, 136,
137, 138, 139, 140, 141, 142, 143, 144, 145, 146,
147, 148, 149, 150, 151, 152, 153, 0, 0, 154,
155, 156, 0, 0, 0, 259, 0, 0, 0, 0,
169, 0, -30, -30, -30, 170, -30, -30, -30, -30,
-30, -30, -30, -30, -30, -30, 273, -30, -30, -30,
171, -30, -30, 172, -30, -30, -30, -30, -30, -30,
173, 0, 0, -30, -30, -30, -30, -30, 174, -30,
-30, -30, 0, -30, -30, -30, -30, -30, -30, 0,
175, 137, 138, 139, 140, 141, 142, 143, 144, 145,
146, 147, 148, 149, 150, 151, 152, 153, 0, 0,
154, 155, 156, 0, 0, 0, 0, -30, -30, 0,
0, 0, -30, -30, -30, -30, 0, -30, -13, 0,
0, 176, 0, -30, 177, 169, 0, -30, -30, -30,
170, -30, -30, -30, -30, -30, -30, -30, -30, -30,
-30, 0, -30, -30, -30, 171, -30, -30, 172, -30,
-30, -30, -30, -30, -30, 173, 0, 0, -30, -30,
-30, -30, -30, 174, -30, -30, -30, 0, -30, -30,
-30, -30, -30, -30, 0, 175, 139, 140, 141, 142,
143, 144, 145, 146, 147, 148, 149, 150, 151, 152,
153, 0, 0, 154, 155, 156, 0, 0, 0, 0,
0, 0, -30, -30, 0, 0, 0, -30, -30, -30,
-30, 0, -30, 0, 0, 0, 176, 0, -30, 177,
38, 39, 40, 0, 41, 42, 43, 44, 45, 46,
47, 48, 49, 50, 0, 51, 52, 53, 0, 54,
55, 0, 56, 57, 58, 59, 60, 61, 0, 118,
119, 62, 63, 64, 65, 66, 0, 67, 68, 69,
120, 70, 71, 72, 73, 74, 75, 141, 142, 143,
144, 145, 146, 147, 148, 149, 150, 151, 152, 153,
0, 0, 154, 155, 156, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 76, 77, 0, 0, 0,
78, 79, 80, 81, 0, 82, 0, 0, 38, 39,
40, 83, 41, 42, 43, 44, 45, 46, 47, 48,
49, 50, 0, 51, 52, 53, 0, 54, 55, 0,
56, 57, 58, 59, 60, 61, 0, 0, 0, 62,
63, 64, 65, 66, 0, 67, 68, 69, 0, 70,
71, 72, 73, 74, 75, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 76, 77, 0, 0, 0, 78, 79,
80, 81, 0, 82, 0, 0, 0, 0, 0, 83,
123, 124, 125, 126, 127, 128, 129, 130, 131, 132,
133, 134, 135, 136, 137, 138, 139, 140, 141, 142,
143, 144, 145, 146, 147, 148, 149, 150, 151, 152,
153, 0, 0, 154, 155, 156
};
static const yytype_int16 yycheck[] =
{
15, 21, 31, 1, 122, 108, 109, 110, 178, 110,
56, 26, 310, 1, 184, 261, 62, 72, 73, 65,
190, 30, 0, 321, 32, 33, 85, 86, 87, 32,
33, 95, 30, 331, 94, 43, 334, 173, 52, 175,
43, 87, 30, 95, 90, 91, 92, 50, 94, 95,
96, 72, 73, 52, 32, 33, 159, 160, 159, 162,
163, 164, 308, 166, 167, 43, 94, 91, 326, 89,
30, 94, 50, 95, 332, 42, 95, 90, 324, 337,
100, 91, 17, 90, 90, 90, 189, 88, 90, 52,
53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
90, 291, 85, 86, 87, 78, 79, 80, 81, 82,
93, 89, 85, 86, 87, 90, 90, 330, 90, 185,
90, 187, 91, 91, 159, 92, 90, 193, 255, 319,
80, 81, 82, 95, 5, 85, 86, 87, 10, 262,
33, 102, 177, 296, 267, 303, 275, 196, 271, 169,
324, 196, 325, 276, 189, 293, 294, 280, 298, 280,
283, 176, -1, 286, 287, 67, 68, 69, 70, 71,
72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
82, -1, -1, 85, 86, 87, 309, -1, -1, 327,
-1, 314, -1, 316, -1, 76, 77, 78, 79, 80,
81, 82, 242, 243, 85, 86, 87, -1, 248, 249,
-1, 246, 247, -1, -1, -1, -1, -1, -1, 268,
-1, -1, -1, -1, -1, -1, 261, -1, -1, -1,
-1, -1, -1, 268, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, 296, 76, 77,
78, 79, 80, 81, 82, 83, -1, -1, -1, -1,
-1, -1, 302, -1, -1, -1, -1, 307, -1, 64,
65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
75, 76, 77, 78, 79, 80, 81, 82, -1, 324,
85, 86, 87, 328, -1, 123, 124, 125, 126, 127,
128, 129, 130, 131, 132, 133, 134, 135, 136, 137,
138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
148, 149, 150, 151, 152, 153, -1, -1, 156, 65,
66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
76, 77, 78, 79, 80, 81, 82, -1, -1, 85,
86, 87, -1, -1, -1, 183, -1, -1, -1, -1,
1, -1, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 13, 14, 15, 16, 204, 18, 19, 20,
21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
31, -1, -1, 34, 35, 36, 37, 38, 39, 40,
41, 42, -1, 44, 45, 46, 47, 48, 49, -1,
51, 66, 67, 68, 69, 70, 71, 72, 73, 74,
75, 76, 77, 78, 79, 80, 81, 82, -1, -1,
85, 86, 87, -1, -1, -1, -1, 78, 79, -1,
-1, -1, 83, 84, 85, 86, -1, 88, 89, -1,
-1, 92, -1, 94, 95, 1, -1, 3, 4, 5,
6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, -1, 18, 19, 20, 21, 22, 23, 24, 25,
26, 27, 28, 29, 30, 31, -1, -1, 34, 35,
36, 37, 38, 39, 40, 41, 42, -1, 44, 45,
46, 47, 48, 49, -1, 51, 68, 69, 70, 71,
72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
82, -1, -1, 85, 86, 87, -1, -1, -1, -1,
-1, -1, 78, 79, -1, -1, -1, 83, 84, 85,
86, -1, 88, -1, -1, -1, 92, -1, 94, 95,
3, 4, 5, -1, 7, 8, 9, 10, 11, 12,
13, 14, 15, 16, -1, 18, 19, 20, -1, 22,
23, -1, 25, 26, 27, 28, 29, 30, -1, 32,
33, 34, 35, 36, 37, 38, -1, 40, 41, 42,
43, 44, 45, 46, 47, 48, 49, 70, 71, 72,
73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
-1, -1, 85, 86, 87, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, 78, 79, -1, -1, -1,
83, 84, 85, 86, -1, 88, -1, -1, 3, 4,
5, 94, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, -1, 18, 19, 20, -1, 22, 23, -1,
25, 26, 27, 28, 29, 30, -1, -1, -1, 34,
35, 36, 37, 38, -1, 40, 41, 42, -1, 44,
45, 46, 47, 48, 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, 78, 79, -1, -1, -1, 83, 84,
85, 86, -1, 88, -1, -1, -1, -1, -1, 94,
52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
82, -1, -1, 85, 86, 87
};
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
symbol of state STATE-NUM. */
static const yytype_uint8 yystos[] =
{
0, 32, 33, 43, 50, 97, 113, 157, 172, 176,
177, 0, 113, 1, 30, 115, 116, 124, 127, 130,
173, 174, 175, 30, 124, 95, 141, 181, 52, 133,
129, 146, 147, 108, 109, 164, 165, 181, 3, 4,
5, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 18, 19, 20, 22, 23, 25, 26, 27, 28,
29, 30, 34, 35, 36, 37, 38, 40, 41, 42,
44, 45, 46, 47, 48, 49, 78, 79, 83, 84,
85, 86, 88, 94, 119, 125, 126, 128, 137, 138,
145, 153, 154, 169, 170, 171, 180, 167, 181, 156,
158, 159, 172, 94, 30, 130, 91, 95, 146, 146,
146, 119, 119, 119, 119, 119, 119, 119, 32, 33,
43, 101, 119, 52, 53, 54, 55, 56, 57, 58,
59, 60, 61, 62, 63, 64, 65, 66, 67, 68,
69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
79, 80, 81, 82, 85, 86, 87, 106, 107, 146,
108, 139, 146, 146, 146, 42, 146, 146, 146, 1,
6, 21, 24, 31, 39, 51, 92, 95, 100, 104,
105, 112, 117, 118, 120, 122, 123, 131, 132, 134,
162, 166, 168, 178, 179, 90, 108, 115, 98, 117,
117, 98, 102, 103, 90, 106, 119, 119, 119, 119,
119, 119, 119, 119, 119, 119, 119, 119, 119, 119,
119, 119, 119, 119, 119, 119, 119, 119, 119, 119,
119, 119, 119, 119, 119, 119, 119, 119, 90, 98,
150, 181, 117, 142, 143, 117, 117, 117, 117, 117,
141, 140, 161, 140, 140, 167, 181, 164, 89, 119,
164, 146, 146, 117, 163, 181, 164, 146, 148, 149,
159, 108, 88, 119, 93, 108, 108, 72, 73, 144,
91, 110, 181, 91, 111, 181, 108, 108, 104, 120,
121, 152, 181, 117, 117, 135, 136, 155, 172, 181,
92, 117, 142, 117, 98, 117, 117, 117, 91, 164,
106, 106, 135, 173, 108, 139, 108, 120, 117, 151,
166, 99, 117, 117, 164, 160, 166, 152, 161, 160,
106, 17, 114, 181, 99, 166, 160, 166, 160
};
#define yyerrok (yyerrstatus = 0)
#define yyclearin (yychar = YYEMPTY)
#define YYEMPTY (-2)
#define YYEOF 0
#define YYACCEPT goto yyacceptlab
#define YYABORT goto yyabortlab
#define YYERROR goto yyerrorlab
/* Like YYERROR except do call yyerror. This remains here temporarily
to ease the transition to the new meaning of YYERROR, for GCC.
Once GCC version 2 has supplanted version 1, this can go. */
#define YYFAIL goto yyerrlab
#define YYRECOVERING() (!!yyerrstatus)
#define YYBACKUP(Token, Value) \
do \
if (yychar == YYEMPTY && yylen == 1) \
{ \
yychar = (Token); \
yylval = (Value); \
yytoken = YYTRANSLATE (yychar); \
YYPOPSTACK (1); \
goto yybackup; \
} \
else \
{ \
yyerror (YY_("syntax error: cannot back up")); \
YYERROR; \
} \
while (YYID (0))
#define YYTERROR 1
#define YYERRCODE 256
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
If N is 0, then set CURRENT to the empty location which ends
the previous symbol: RHS[0] (always defined). */
#define YYRHSLOC(Rhs, K) ((Rhs)[K])
#ifndef YYLLOC_DEFAULT
# define YYLLOC_DEFAULT(Current, Rhs, N) \
do \
if (YYID (N)) \
{ \
(Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
(Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
(Current).last_line = YYRHSLOC (Rhs, N).last_line; \
(Current).last_column = YYRHSLOC (Rhs, N).last_column; \
} \
else \
{ \
(Current).first_line = (Current).last_line = \
YYRHSLOC (Rhs, 0).last_line; \
(Current).first_column = (Current).last_column = \
YYRHSLOC (Rhs, 0).last_column; \
} \
while (YYID (0))
#endif
/* YY_LOCATION_PRINT -- Print the location on the stream.
This macro was not mandated originally: define only if we know
we won't break user code: when these are the locations we know. */
#ifndef YY_LOCATION_PRINT
# if YYLTYPE_IS_TRIVIAL
# define YY_LOCATION_PRINT(File, Loc) \
fprintf (File, "%d.%d-%d.%d", \
(Loc).first_line, (Loc).first_column, \
(Loc).last_line, (Loc).last_column)
# else
# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
# endif
#endif
/* YYLEX -- calling `yylex' with the right arguments. */
#ifdef YYLEX_PARAM
# define YYLEX yylex (YYLEX_PARAM)
#else
# define YYLEX yylex ()
#endif
/* Enable debugging if requested. */
#if YYDEBUG
# ifndef YYFPRINTF
# include /* INFRINGES ON USER NAME SPACE */
# define YYFPRINTF fprintf
# endif
# define YYDPRINTF(Args) \
do { \
if (yydebug) \
YYFPRINTF Args; \
} while (YYID (0))
# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
do { \
if (yydebug) \
{ \
YYFPRINTF (stderr, "%s ", Title); \
yy_symbol_print (stderr, \
Type, Value); \
YYFPRINTF (stderr, "\n"); \
} \
} while (YYID (0))
/*--------------------------------.
| Print this symbol on YYOUTPUT. |
`--------------------------------*/
/*ARGSUSED*/
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static void
yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
#else
static void
yy_symbol_value_print (yyoutput, yytype, yyvaluep)
FILE *yyoutput;
int yytype;
YYSTYPE const * const yyvaluep;
#endif
{
if (!yyvaluep)
return;
# ifdef YYPRINT
if (yytype < YYNTOKENS)
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
# else
YYUSE (yyoutput);
# endif
switch (yytype)
{
default:
break;
}
}
/*--------------------------------.
| Print this symbol on YYOUTPUT. |
`--------------------------------*/
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static void
yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
#else
static void
yy_symbol_print (yyoutput, yytype, yyvaluep)
FILE *yyoutput;
int yytype;
YYSTYPE const * const yyvaluep;
#endif
{
if (yytype < YYNTOKENS)
YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
else
YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
yy_symbol_value_print (yyoutput, yytype, yyvaluep);
YYFPRINTF (yyoutput, ")");
}
/*------------------------------------------------------------------.
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
| TOP (included). |
`------------------------------------------------------------------*/
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static void
yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
#else
static void
yy_stack_print (bottom, top)
yytype_int16 *bottom;
yytype_int16 *top;
#endif
{
YYFPRINTF (stderr, "Stack now");
for (; bottom <= top; ++bottom)
YYFPRINTF (stderr, " %d", *bottom);
YYFPRINTF (stderr, "\n");
}
# define YY_STACK_PRINT(Bottom, Top) \
do { \
if (yydebug) \
yy_stack_print ((Bottom), (Top)); \
} while (YYID (0))
/*------------------------------------------------.
| Report that the YYRULE is going to be reduced. |
`------------------------------------------------*/
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static void
yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
#else
static void
yy_reduce_print (yyvsp, yyrule)
YYSTYPE *yyvsp;
int yyrule;
#endif
{
int yynrhs = yyr2[yyrule];
int yyi;
unsigned long int yylno = yyrline[yyrule];
YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
yyrule - 1, yylno);
/* The symbols being reduced. */
for (yyi = 0; yyi < yynrhs; yyi++)
{
fprintf (stderr, " $%d = ", yyi + 1);
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
&(yyvsp[(yyi + 1) - (yynrhs)])
);
fprintf (stderr, "\n");
}
}
# define YY_REDUCE_PRINT(Rule) \
do { \
if (yydebug) \
yy_reduce_print (yyvsp, Rule); \
} while (YYID (0))
/* Nonzero means print parse trace. It is left uninitialized so that
multiple parsers can coexist. */
int yydebug;
#else /* !YYDEBUG */
# define YYDPRINTF(Args)
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
# define YY_STACK_PRINT(Bottom, Top)
# define YY_REDUCE_PRINT(Rule)
#endif /* !YYDEBUG */
/* YYINITDEPTH -- initial size of the parser's stacks. */
#ifndef YYINITDEPTH
# define YYINITDEPTH 200
#endif
/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
if the built-in stack extension method is used).
Do not make this value too large; the results are undefined if
YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
evaluated with infinite-precision integer arithmetic. */
#ifndef YYMAXDEPTH
# define YYMAXDEPTH 10000
#endif
#if YYERROR_VERBOSE
# ifndef yystrlen
# if defined __GLIBC__ && defined _STRING_H
# define yystrlen strlen
# else
/* Return the length of YYSTR. */
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static YYSIZE_T
yystrlen (const char *yystr)
#else
static YYSIZE_T
yystrlen (yystr)
const char *yystr;
#endif
{
YYSIZE_T yylen;
for (yylen = 0; yystr[yylen]; yylen++)
continue;
return yylen;
}
# endif
# endif
# ifndef yystpcpy
# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
# define yystpcpy stpcpy
# else
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
YYDEST. */
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static char *
yystpcpy (char *yydest, const char *yysrc)
#else
static char *
yystpcpy (yydest, yysrc)
char *yydest;
const char *yysrc;
#endif
{
char *yyd = yydest;
const char *yys = yysrc;
while ((*yyd++ = *yys++) != '\0')
continue;
return yyd - 1;
}
# endif
# endif
# ifndef yytnamerr
/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
quotes and backslashes, so that it's suitable for yyerror. The
heuristic is that double-quoting is unnecessary unless the string
contains an apostrophe, a comma, or backslash (other than
backslash-backslash). YYSTR is taken from yytname. If YYRES is
null, do not copy; instead, return the length of what the result
would have been. */
static YYSIZE_T
yytnamerr (char *yyres, const char *yystr)
{
if (*yystr == '"')
{
YYSIZE_T yyn = 0;
char const *yyp = yystr;
for (;;)
switch (*++yyp)
{
case '\'':
case ',':
goto do_not_strip_quotes;
case '\\':
if (*++yyp != '\\')
goto do_not_strip_quotes;
/* Fall through. */
default:
if (yyres)
yyres[yyn] = *yyp;
yyn++;
break;
case '"':
if (yyres)
yyres[yyn] = '\0';
return yyn;
}
do_not_strip_quotes: ;
}
if (! yyres)
return yystrlen (yystr);
return yystpcpy (yyres, yystr) - yyres;
}
# endif
/* Copy into YYRESULT an error message about the unexpected token
YYCHAR while in state YYSTATE. Return the number of bytes copied,
including the terminating null byte. If YYRESULT is null, do not
copy anything; just return the number of bytes that would be
copied. As a special case, return 0 if an ordinary "syntax error"
message will do. Return YYSIZE_MAXIMUM if overflow occurs during
size calculation. */
static YYSIZE_T
yysyntax_error (char *yyresult, int yystate, int yychar)
{
int yyn = yypact[yystate];
if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
return 0;
else
{
int yytype = YYTRANSLATE (yychar);
YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
YYSIZE_T yysize = yysize0;
YYSIZE_T yysize1;
int yysize_overflow = 0;
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
int yyx;
# if 0
/* This is so xgettext sees the translatable formats that are
constructed on the fly. */
YY_("syntax error, unexpected %s");
YY_("syntax error, unexpected %s, expecting %s");
YY_("syntax error, unexpected %s, expecting %s or %s");
YY_("syntax error, unexpected %s, expecting %s or %s or %s");
YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
# endif
char *yyfmt;
char const *yyf;
static char const yyunexpected[] = "syntax error, unexpected %s";
static char const yyexpecting[] = ", expecting %s";
static char const yyor[] = " or %s";
char yyformat[sizeof yyunexpected
+ sizeof yyexpecting - 1
+ ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
* (sizeof yyor - 1))];
char const *yyprefix = yyexpecting;
/* Start YYX at -YYN if negative to avoid negative indexes in
YYCHECK. */
int yyxbegin = yyn < 0 ? -yyn : 0;
/* Stay within bounds of both yycheck and yytname. */
int yychecklim = YYLAST - yyn + 1;
int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
int yycount = 1;
yyarg[0] = yytname[yytype];
yyfmt = yystpcpy (yyformat, yyunexpected);
for (yyx = yyxbegin; yyx < yyxend; ++yyx)
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
{
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
{
yycount = 1;
yysize = yysize0;
yyformat[sizeof yyunexpected - 1] = '\0';
break;
}
yyarg[yycount++] = yytname[yyx];
yysize1 = yysize + yytnamerr (0, yytname[yyx]);
yysize_overflow |= (yysize1 < yysize);
yysize = yysize1;
yyfmt = yystpcpy (yyfmt, yyprefix);
yyprefix = yyor;
}
yyf = YY_(yyformat);
yysize1 = yysize + yystrlen (yyf);
yysize_overflow |= (yysize1 < yysize);
yysize = yysize1;
if (yysize_overflow)
return YYSIZE_MAXIMUM;
if (yyresult)
{
/* Avoid sprintf, as that infringes on the user's name space.
Don't have undefined behavior even if the translation
produced a string with the wrong number of "%s"s. */
char *yyp = yyresult;
int yyi = 0;
while ((*yyp = *yyf) != '\0')
{
if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
{
yyp += yytnamerr (yyp, yyarg[yyi++]);
yyf += 2;
}
else
{
yyp++;
yyf++;
}
}
}
return yysize;
}
}
#endif /* YYERROR_VERBOSE */
/*-----------------------------------------------.
| Release the memory associated to this symbol. |
`-----------------------------------------------*/
/*ARGSUSED*/
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static void
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
#else
static void
yydestruct (yymsg, yytype, yyvaluep)
const char *yymsg;
int yytype;
YYSTYPE *yyvaluep;
#endif
{
YYUSE (yyvaluep);
if (!yymsg)
yymsg = "Deleting";
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
switch (yytype)
{
default:
break;
}
}
/* Prevent warnings from -Wmissing-prototypes. */
#ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus
int yyparse (void *YYPARSE_PARAM);
#else
int yyparse ();
#endif
#else /* ! YYPARSE_PARAM */
#if defined __STDC__ || defined __cplusplus
int yyparse (void);
#else
int yyparse ();
#endif
#endif /* ! YYPARSE_PARAM */
/* The look-ahead symbol. */
int yychar;
/* The semantic value of the look-ahead symbol. */
YYSTYPE yylval;
/* Number of syntax errors so far. */
int yynerrs;
/*----------.
| yyparse. |
`----------*/
#ifdef YYPARSE_PARAM
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
int
yyparse (void *YYPARSE_PARAM)
#else
int
yyparse (YYPARSE_PARAM)
void *YYPARSE_PARAM;
#endif
#else /* ! YYPARSE_PARAM */
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
int
yyparse (void)
#else
int
yyparse ()
#endif
#endif
{
int yystate;
int yyn;
int yyresult;
/* Number of tokens to shift before error messages enabled. */
int yyerrstatus;
/* Look-ahead token as an internal (translated) token number. */
int yytoken = 0;
#if YYERROR_VERBOSE
/* Buffer for error messages, and its allocated size. */
char yymsgbuf[128];
char *yymsg = yymsgbuf;
YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
#endif
/* Three stacks and their tools:
`yyss': related to states,
`yyvs': related to semantic values,
`yyls': related to locations.
Refer to the stacks thru separate pointers, to allow yyoverflow
to reallocate them elsewhere. */
/* The state stack. */
yytype_int16 yyssa[YYINITDEPTH];
yytype_int16 *yyss = yyssa;
yytype_int16 *yyssp;
/* The semantic value stack. */
YYSTYPE yyvsa[YYINITDEPTH];
YYSTYPE *yyvs = yyvsa;
YYSTYPE *yyvsp;
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
YYSIZE_T yystacksize = YYINITDEPTH;
/* The variables used to return semantic value and location from the
action routines. */
YYSTYPE yyval;
/* The number of symbols on the RHS of the reduced rule.
Keep to zero when no symbol should be popped. */
int yylen = 0;
YYDPRINTF ((stderr, "Starting parse\n"));
yystate = 0;
yyerrstatus = 0;
yynerrs = 0;
yychar = YYEMPTY; /* Cause a token to be read. */
/* Initialize stack pointers.
Waste one element of value and location stack
so that they stay on the same level as the state stack.
The wasted elements are never initialized. */
yyssp = yyss;
yyvsp = yyvs;
goto yysetstate;
/*------------------------------------------------------------.
| yynewstate -- Push a new state, which is found in yystate. |
`------------------------------------------------------------*/
yynewstate:
/* In all cases, when you get here, the value and location stacks
have just been pushed. So pushing a state here evens the stacks. */
yyssp++;
yysetstate:
*yyssp = yystate;
if (yyss + yystacksize - 1 <= yyssp)
{
/* Get the current used size of the three stacks, in elements. */
YYSIZE_T yysize = yyssp - yyss + 1;
#ifdef yyoverflow
{
/* Give user a chance to reallocate the stack. Use copies of
these so that the &'s don't force the real ones into
memory. */
YYSTYPE *yyvs1 = yyvs;
yytype_int16 *yyss1 = yyss;
/* Each stack pointer address is followed by the size of the
data in use in that stack, in bytes. This used to be a
conditional around just the two extra args, but that might
be undefined if yyoverflow is a macro. */
yyoverflow (YY_("memory exhausted"),
&yyss1, yysize * sizeof (*yyssp),
&yyvs1, yysize * sizeof (*yyvsp),
&yystacksize);
yyss = yyss1;
yyvs = yyvs1;
}
#else /* no yyoverflow */
# ifndef YYSTACK_RELOCATE
goto yyexhaustedlab;
# else
/* Extend the stack our own way. */
if (YYMAXDEPTH <= yystacksize)
goto yyexhaustedlab;
yystacksize *= 2;
if (YYMAXDEPTH < yystacksize)
yystacksize = YYMAXDEPTH;
{
yytype_int16 *yyss1 = yyss;
union yyalloc *yyptr =
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
if (! yyptr)
goto yyexhaustedlab;
YYSTACK_RELOCATE (yyss);
YYSTACK_RELOCATE (yyvs);
# undef YYSTACK_RELOCATE
if (yyss1 != yyssa)
YYSTACK_FREE (yyss1);
}
# endif
#endif /* no yyoverflow */
yyssp = yyss + yysize - 1;
yyvsp = yyvs + yysize - 1;
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
(unsigned long int) yystacksize));
if (yyss + yystacksize - 1 <= yyssp)
YYABORT;
}
YYDPRINTF ((stderr, "Entering state %d\n", yystate));
goto yybackup;
/*-----------.
| yybackup. |
`-----------*/
yybackup:
/* Do appropriate processing given the current state. Read a
look-ahead token if we need one and don't already have one. */
/* First try to decide what to do without reference to look-ahead token. */
yyn = yypact[yystate];
if (yyn == YYPACT_NINF)
goto yydefault;
/* Not known => get a look-ahead token if don't already have one. */
/* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
if (yychar == YYEMPTY)
{
YYDPRINTF ((stderr, "Reading a token: "));
yychar = YYLEX;
}
if (yychar <= YYEOF)
{
yychar = yytoken = YYEOF;
YYDPRINTF ((stderr, "Now at end of input.\n"));
}
else
{
yytoken = YYTRANSLATE (yychar);
YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
}
/* If the proper action on seeing token YYTOKEN is to reduce or to
detect an error, take that action. */
yyn += yytoken;
if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
goto yydefault;
yyn = yytable[yyn];
if (yyn <= 0)
{
if (yyn == 0 || yyn == YYTABLE_NINF)
goto yyerrlab;
yyn = -yyn;
goto yyreduce;
}
if (yyn == YYFINAL)
YYACCEPT;
/* Count tokens shifted since error; after three, turn off error
status. */
if (yyerrstatus)
yyerrstatus--;
/* Shift the look-ahead token. */
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
/* Discard the shifted token unless it is eof. */
if (yychar != YYEOF)
yychar = YYEMPTY;
yystate = yyn;
*++yyvsp = yylval;
goto yynewstate;
/*-----------------------------------------------------------.
| yydefault -- do the default action for the current state. |
`-----------------------------------------------------------*/
yydefault:
yyn = yydefact[yystate];
if (yyn == 0)
goto yyerrlab;
goto yyreduce;
/*-----------------------------.
| yyreduce -- Do a reduction. |
`-----------------------------*/
yyreduce:
/* yyn is the number of a rule to reduce with. */
yylen = yyr2[yyn];
/* If YYLEN is nonzero, implement the default value of the action:
`$$ = $1'.
Otherwise, the following line sets YYVAL to garbage.
This behavior is undocumented and Bison
users should not rely upon it. Assigning to YYVAL
unconditionally makes the parser a bit smaller, and it avoids a
GCC warning that YYVAL may be used uninitialized. */
yyval = yyvsp[1-yylen];
YY_REDUCE_PRINT (yyn);
switch (yyn)
{
case 4:
#line 118 "parser"
{
(yyval) = *multargs(&(yyvsp[(1) - (3)]), &(yyvsp[(3) - (3)]));
;}
break;
case 5:
#line 123 "parser"
{
(yyval) = *firstarg(&(yyvsp[(1) - (1)]));
;}
break;
case 6:
#line 129 "parser"
{
break_ok++;
;}
break;
case 7:
#line 136 "parser"
{
(yyval) = *break_stmnt();
;}
break;
case 11:
#line 149 "parser"
{parse_error = err_backtick_expected; ;}
break;
case 13:
#line 150 "parser"
{parse_error = err_closebrace_expected; ;}
break;
case 15:
#line 151 "parser"
{parse_error = err_closepar_expected; ;}
break;
case 17:
#line 152 "parser"
{parse_error = err_comma_expected; ;}
break;
case 19:
#line 157 "parser"
{
(yyval) = (yyvsp[(2) - (2)]);
;}
break;
case 21:
#line 167 "parser"
{
(yyval) = (yyvsp[(2) - (2)]);
;}
break;
case 23:
#line 178 "parser"
{
(yyval) = (yyvsp[(2) - (3)]);
;}
break;
case 26:
#line 194 "parser"
{
(yyval) = (yyvsp[(2) - (2)]);
;}
break;
case 28:
#line 203 "parser"
{
entervar();
;}
break;
case 29:
#line 210 "parser"
{
(yyval) = *fetchvar();
;}
break;
case 30:
#line 216 "parser"
{
parse_error = err_in_expression;
;}
break;
case 31:
#line 220 "parser"
{
(yyval) = (yyvsp[(2) - (2)]);
;}
break;
case 32:
#line 229 "parser"
{
(yyval) = *assign(&(yyvsp[(1) - (3)]), &(yyvsp[(3) - (3)]));
;}
break;
case 33:
#line 237 "parser"
{
(yyval) = *indexOp(&(yyvsp[(1) - (4)]), &(yyvsp[(3) - (4)]));
;}
break;
case 34:
#line 244 "parser"
{
(yyval) = *math_ass(&(yyvsp[(1) - (3)]), &(yyvsp[(3) - (3)]), multiply, "*=");
;}
break;
case 35:
#line 251 "parser"
{
(yyval) = *math_ass(&(yyvsp[(1) - (3)]), &(yyvsp[(3) - (3)]), divide, "/=");
;}
break;
case 36:
#line 258 "parser"
{
(yyval) = *math_ass(&(yyvsp[(1) - (3)]), &(yyvsp[(3) - (3)]), modulo, "%=");
;}
break;
case 37:
#line 265 "parser"
{
(yyval) = *math_ass(&(yyvsp[(1) - (3)]), &(yyvsp[(3) - (3)]), addition, "+=");
;}
break;
case 38:
#line 272 "parser"
{
(yyval) = *math_ass(&(yyvsp[(1) - (3)]), &(yyvsp[(3) - (3)]), subtract, "-=");
;}
break;
case 39:
#line 279 "parser"
{
(yyval) = *math_ass(&(yyvsp[(1) - (3)]), &(yyvsp[(3) - (3)]), band, "&=");
;}
break;
case 40:
#line 286 "parser"
{
(yyval) = *math_ass(&(yyvsp[(1) - (3)]), &(yyvsp[(3) - (3)]), bor, "|=");
;}
break;
case 41:
#line 293 "parser"
{
(yyval) = *math_ass(&(yyvsp[(1) - (3)]), &(yyvsp[(3) - (3)]), xor, "^=");
;}
break;
case 42:
#line 300 "parser"
{
(yyval) = *math_ass(&(yyvsp[(1) - (3)]), &(yyvsp[(3) - (3)]), shl, "<<=");
;}
break;
case 43:
#line 307 "parser"
{
(yyval) = *math_ass(&(yyvsp[(1) - (3)]), &(yyvsp[(3) - (3)]), shr, ">>=");
;}
break;
case 44:
#line 314 "parser"
{
(yyval) = *or_boolean(&(yyvsp[(1) - (3)]), &(yyvsp[(3) - (3)]));
;}
break;
case 45:
#line 321 "parser"
{
(yyval) = *and_boolean(&(yyvsp[(1) - (3)]), &(yyvsp[(3) - (3)]));
;}
break;
case 46:
#line 328 "parser"
{
(yyval) = *equal(&(yyvsp[(1) - (3)]), &(yyvsp[(3) - (3)]));
;}
break;
case 47:
#line 335 "parser"
{
(yyval) = *unequal(&(yyvsp[(1) - (3)]), &(yyvsp[(3) - (3)]));
;}
break;
case 48:
#line 342 "parser"
{
(yyval) = *smaller(&(yyvsp[(1) - (3)]), &(yyvsp[(3) - (3)]));
;}
break;
case 49:
#line 349 "parser"
{
(yyval) = *greater(&(yyvsp[(1) - (3)]), &(yyvsp[(3) - (3)]));
;}
break;
case 50:
#line 356 "parser"
{
(yyval) = *sm_equal(&(yyvsp[(1) - (3)]), &(yyvsp[(3) - (3)]));
;}
break;
case 51:
#line 363 "parser"
{
(yyval) = *gr_equal(&(yyvsp[(1) - (3)]), &(yyvsp[(3) - (3)]));
;}
break;
case 52:
#line 370 "parser"
{
(yyval) = *addition(&(yyvsp[(1) - (3)]), &(yyvsp[(3) - (3)]));
;}
break;
case 53:
#line 377 "parser"
{
(yyval) = *band(&(yyvsp[(1) - (3)]), &(yyvsp[(3) - (3)]));
;}
break;
case 54:
#line 384 "parser"
{
(yyval) = *bor(&(yyvsp[(1) - (3)]), &(yyvsp[(3) - (3)]));
;}
break;
case 55:
#line 391 "parser"
{
(yyval) = *xor(&(yyvsp[(1) - (3)]), &(yyvsp[(3) - (3)]));
;}
break;
case 56:
#line 398 "parser"
{
(yyval) = *shl(&(yyvsp[(1) - (3)]), &(yyvsp[(3) - (3)]));
;}
break;
case 57:
#line 405 "parser"
{
(yyval) = *shr(&(yyvsp[(1) - (3)]), &(yyvsp[(3) - (3)]));
;}
break;
case 58:
#line 412 "parser"
{
(yyval) = *subtract(&(yyvsp[(1) - (3)]), &(yyvsp[(3) - (3)]));
;}
break;
case 59:
#line 419 "parser"
{
(yyval) = *multiply(&(yyvsp[(1) - (3)]), &(yyvsp[(3) - (3)]));
;}
break;
case 60:
#line 426 "parser"
{
(yyval) = *young(&(yyvsp[(1) - (3)]), &(yyvsp[(3) - (3)]));
;}
break;
case 61:
#line 433 "parser"
{
(yyval) = *old(&(yyvsp[(1) - (3)]), &(yyvsp[(3) - (3)]));
;}
break;
case 62:
#line 440 "parser"
{
(yyval) = *divide(&(yyvsp[(1) - (3)]), &(yyvsp[(3) - (3)]));
;}
break;
case 63:
#line 447 "parser"
{
(yyval) = *modulo(&(yyvsp[(1) - (3)]), &(yyvsp[(3) - (3)]));
;}
break;
case 64:
#line 453 "parser"
{
(yyval) = *negate(&(yyvsp[(2) - (2)]));
;}
break;
case 65:
#line 459 "parser"
{
(yyval) = *incdec(pre_op, op_inc, &(yyvsp[(2) - (2)]));
;}
break;
case 66:
#line 465 "parser"
{
(yyval) = *incdec(post_op, op_inc, &(yyvsp[(1) - (2)]));
;}
break;
case 67:
#line 471 "parser"
{
(yyval) = *incdec(pre_op, op_dec, &(yyvsp[(2) - (2)]));
;}
break;
case 68:
#line 477 "parser"
{
(yyval) = *incdec(post_op, op_dec, &(yyvsp[(1) - (2)]));
;}
break;
case 69:
#line 483 "parser"
{
(yyval) = (yyvsp[(2) - (2)]);
;}
break;
case 70:
#line 489 "parser"
{
(yyval) = *bnot(&(yyvsp[(2) - (2)]));
;}
break;
case 71:
#line 495 "parser"
{
(yyval) = *not_boolean(&(yyvsp[(2) - (2)]));
;}
break;
case 72:
#line 503 "parser"
{
(yyval) = *cast((yyvsp[(2) - (4)]).type, &(yyvsp[(4) - (4)]));
;}
break;
case 73:
#line 508 "parser"
{
(yyval) = *stackframe(e_str | e_const);
;}
break;
case 74:
#line 513 "parser"
{
(yyval) = *stackframe(e_int | e_const);
;}
break;
case 75:
#line 520 "parser"
{
(yyval) = (yyvsp[(2) - (3)]);
;}
break;
case 77:
#line 529 "parser"
{
(yyval) = *onearg(f_backtick, &(yyvsp[(2) - (3)]));
;}
break;
case 78:
#line 536 "parser"
{
(yyval) = *expr_stmnt(&(yyvsp[(1) - (1)]));
;}
break;
case 79:
#line 545 "parser"
{
(yyval) = *catcode(&(yyvsp[(1) - (3)]), &(yyvsp[(3) - (3)]));
;}
break;
case 82:
#line 569 "parser"
{
(yyval) = *for_stmnt(&(yyvsp[(3) - (11)]), &(yyvsp[(5) - (11)]), &(yyvsp[(7) - (11)]), &(yyvsp[(10) - (11)]));
;}
break;
case 83:
#line 579 "parser"
{
close_fun(&(yyvsp[(3) - (4)]));
;}
break;
case 85:
#line 589 "parser"
{
(yyval) = *fetchvar();
;}
break;
case 86:
#line 597 "parser"
{
(yyval) = *zeroargs((yyvsp[(1) - (2)]).type);
;}
break;
case 87:
#line 604 "parser"
{
(yyval) = *onearg((yyvsp[(1) - (3)]).type, &(yyvsp[(3) - (3)]));
;}
break;
case 88:
#line 613 "parser"
{
(yyval) = *twoargs((yyvsp[(1) - (5)]).type, &(yyvsp[(3) - (5)]), &(yyvsp[(5) - (5)]));
;}
break;
case 89:
#line 624 "parser"
{
(yyval) = *threeargs((yyvsp[(1) - (7)]).type, &(yyvsp[(3) - (7)]), &(yyvsp[(5) - (7)]), &(yyvsp[(7) - (7)]));
;}
break;
case 90:
#line 632 "parser"
{
(yyval) = *optint_string((yyvsp[(1) - (4)]).type, &(yyvsp[(3) - (4)]), &(yyvsp[(4) - (4)]));
;}
break;
case 91:
#line 640 "parser"
{
(yyval) = *optint_special((yyvsp[(1) - (4)]).type, &(yyvsp[(3) - (4)]), &(yyvsp[(4) - (4)]));
;}
break;
case 92:
#line 647 "parser"
{
(yyval) = *specials(f_printf, &(yyvsp[(3) - (3)]));
;}
break;
case 93:
#line 654 "parser"
{
(yyval) = *exec_fprintf((yyvsp[(1) - (3)]).type, &(yyvsp[(3) - (3)]));
;}
break;
case 94:
#line 661 "parser"
{
(yyval) = *callfun((yyvsp[(1) - (3)]).evalue, &(yyvsp[(3) - (3)]));
;}
break;
case 96:
#line 670 "parser"
{
open_fun();
;}
break;
case 97:
#line 677 "parser"
{
(yyval).evalue = fetchfun();
;}
break;
case 98:
#line 688 "parser"
{
make_frame();
outbin((yyvsp[(5) - (5)]).code, (yyvsp[(5) - (5)]).codelen);
;}
break;
case 100:
#line 704 "parser"
{
initialization = 0;
(yyval) = *expr_stmnt(assign(&(yyvsp[(1) - (3)]), &(yyvsp[(3) - (3)]))); /* explicit initialization */
;}
break;
case 102:
#line 725 "parser"
{
(yyval) = *if_stmnt(&(yyvsp[(3) - (9)]), &(yyvsp[(5) - (9)]), &(yyvsp[(8) - (9)]));
;}
break;
case 103:
#line 732 "parser"
{
initialization = 1;
;}
break;
case 106:
#line 748 "parser"
{
(yyval) = (yyvsp[(2) - (2)]);
;}
break;
case 107:
#line 756 "parser"
{
(yyval) = *catcode(&(yyvsp[(1) - (2)]), &(yyvsp[(2) - (2)])); /* cat initialization code */
;}
break;
case 109:
#line 767 "parser"
{
(yyval) = *makelist
(
multargs
(
firstarg(&(yyvsp[(2) - (2)])), /* O_FILE is passed */
&(yyvsp[(1) - (2)]) /* expression is passed */
),
op_hlt /* not op_younger or op_older */
);
;}
break;
case 110:
#line 783 "parser"
{
(yyval) = *makelist
(
multargs
(
firstarg(&(yyvsp[(1) - (3)])), /* fileattribute is passed */
&(yyvsp[(3) - (3)]) /* expression is passed */
),
op_hlt /* not op_younger or op_older */
);
;}
break;
case 111:
#line 801 "parser"
{
(yyval) = *makelist
(
multargs
(
multargs
(
firstarg(&(yyvsp[(6) - (6)])), /* O_FILE is passed */
&(yyvsp[(1) - (6)]) /* 1st expression is passed */
),
&(yyvsp[(5) - (6)]) /* 2nd expression is passed */
),
(yyvsp[(3) - (6)]).type /* older/younger */
);
;}
break;
case 112:
#line 824 "parser"
{
(yyval) = *makelist
(
multargs
(
multargs
(
firstarg(&(yyvsp[(1) - (7)])), /* attribute is passed */
&(yyvsp[(3) - (7)]) /* 2nd expression is passed */
),
&(yyvsp[(7) - (7)]) /* 3rd expression is passed */
),
(yyvsp[(5) - (7)]).type /* older/younger */
);
;}
break;
case 113:
#line 845 "parser"
{
(yyval) = (yyvsp[(3) - (3)]);
;}
break;
case 114:
#line 851 "parser"
{
(yyval) = *stackframe(e_int | e_const);
(yyval).evalue = O_FILE;
;}
break;
case 115:
#line 859 "parser"
{
nestlevel++;
;}
break;
case 116:
#line 866 "parser"
{
yyerrok;
;}
break;
case 117:
#line 872 "parser"
{parse_error = err_older_younger; ;}
break;
case 118:
#line 874 "parser"
{
(yyval) = (yyvsp[(2) - (2)]);
;}
break;
case 137:
#line 919 "parser"
{parse_error = err_openpar_expected; ;}
break;
case 139:
#line 920 "parser"
{parse_error = err_openbrace_expected; ;}
break;
case 144:
#line 931 "parser"
{
(yyval) = *stackframe(e_int | e_const);
(yyval).evalue = 1;
;}
break;
case 157:
#line 971 "parser"
{
vartype = e_int;
;}
break;
case 160:
#line 987 "parser"
{
n_params++;
;}
break;
case 161:
#line 993 "parser"
{
pop_dead();
;}
break;
case 162:
#line 999 "parser"
{
push_dead(); /* set new dead-level */
;}
break;
case 163:
#line 1009 "parser"
{
(yyval) = *return_stmnt((yyvsp[(1) - (2)]).type, &(yyvsp[(2) - (2)]));
;}
break;
case 166:
#line 1020 "parser"
{parse_error = err_semicol_expected; ;}
break;
case 168:
#line 1024 "parser"
{
sem_err = 0;
;}
break;
case 169:
#line 1032 "parser"
{
(yyval) = *cat_stmnt(&(yyvsp[(1) - (2)]), &(yyvsp[(2) - (2)]));
;}
break;
case 172:
#line 1044 "parser"
{
(yyval) = (yyvsp[(1) - (2)]);
;}
break;
case 180:
#line 1070 "parser"
{
stringbuf = xstrcat(stringbuf, lexstring);/* catenate the new string */
;}
break;
case 181:
#line 1075 "parser"
{
free(stringbuf); /* free former string */
stringbuf = xstrdup(lexstring); /* duplicate initial string */
;}
break;
case 190:
#line 1104 "parser"
{
parse_error = err_identifier_expected;
vartype = (yyvsp[(1) - (1)]).type;
;}
break;
case 191:
#line 1114 "parser"
{
(yyval) = (yyvsp[(1) - (2)]); /* initialization code */
;}
break;
case 192:
#line 1123 "parser"
{
(yyval) = *catcode(&(yyvsp[(1) - (3)]), &(yyvsp[(3) - (3)])); /* catenate variable */
/* initialization code */
;}
break;
case 194:
#line 1133 "parser"
{
(yyval) = (yyvsp[(3) - (3)]);
;}
break;
case 195:
#line 1140 "parser"
{
global_init = *catcode(&global_init, &(yyvsp[(1) - (1)]));
;}
break;
case 200:
#line 1157 "parser"
{
vartype = 0;
;}
break;
case 202:
#line 1175 "parser"
{
(yyval) = *while_stmnt(&(yyvsp[(3) - (7)]), &(yyvsp[(6) - (7)]));
;}
break;
case 206:
#line 1192 "parser"
{
(yyval) = *stackframe(0);
;}
break;
/* Line 1267 of yacc.c. */
#line 2725 "parser.c"
default: break;
}
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
YYPOPSTACK (yylen);
yylen = 0;
YY_STACK_PRINT (yyss, yyssp);
*++yyvsp = yyval;
/* Now `shift' the result of the reduction. Determine what state
that goes to, based on the state we popped back to and the rule
number reduced by. */
yyn = yyr1[yyn];
yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
yystate = yytable[yystate];
else
yystate = yydefgoto[yyn - YYNTOKENS];
goto yynewstate;
/*------------------------------------.
| yyerrlab -- here on detecting error |
`------------------------------------*/
yyerrlab:
/* If not already recovering from an error, report this error. */
if (!yyerrstatus)
{
++yynerrs;
#if ! YYERROR_VERBOSE
yyerror (YY_("syntax error"));
#else
{
YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
{
YYSIZE_T yyalloc = 2 * yysize;
if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
yyalloc = YYSTACK_ALLOC_MAXIMUM;
if (yymsg != yymsgbuf)
YYSTACK_FREE (yymsg);
yymsg = (char *) YYSTACK_ALLOC (yyalloc);
if (yymsg)
yymsg_alloc = yyalloc;
else
{
yymsg = yymsgbuf;
yymsg_alloc = sizeof yymsgbuf;
}
}
if (0 < yysize && yysize <= yymsg_alloc)
{
(void) yysyntax_error (yymsg, yystate, yychar);
yyerror (yymsg);
}
else
{
yyerror (YY_("syntax error"));
if (yysize != 0)
goto yyexhaustedlab;
}
}
#endif
}
if (yyerrstatus == 3)
{
/* If just tried and failed to reuse look-ahead token after an
error, discard it. */
if (yychar <= YYEOF)
{
/* Return failure if at end of input. */
if (yychar == YYEOF)
YYABORT;
}
else
{
yydestruct ("Error: discarding",
yytoken, &yylval);
yychar = YYEMPTY;
}
}
/* Else will try to reuse look-ahead token after shifting the error
token. */
goto yyerrlab1;
/*---------------------------------------------------.
| yyerrorlab -- error raised explicitly by YYERROR. |
`---------------------------------------------------*/
yyerrorlab:
/* Pacify compilers like GCC when the user code never invokes
YYERROR and the label yyerrorlab therefore never appears in user
code. */
if (/*CONSTCOND*/ 0)
goto yyerrorlab;
/* Do not reclaim the symbols of the rule which action triggered
this YYERROR. */
YYPOPSTACK (yylen);
yylen = 0;
YY_STACK_PRINT (yyss, yyssp);
yystate = *yyssp;
goto yyerrlab1;
/*-------------------------------------------------------------.
| yyerrlab1 -- common code for both syntax error and YYERROR. |
`-------------------------------------------------------------*/
yyerrlab1:
yyerrstatus = 3; /* Each real token shifted decrements this. */
for (;;)
{
yyn = yypact[yystate];
if (yyn != YYPACT_NINF)
{
yyn += YYTERROR;
if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
{
yyn = yytable[yyn];
if (0 < yyn)
break;
}
}
/* Pop the current state because it cannot handle the error token. */
if (yyssp == yyss)
YYABORT;
yydestruct ("Error: popping",
yystos[yystate], yyvsp);
YYPOPSTACK (1);
yystate = *yyssp;
YY_STACK_PRINT (yyss, yyssp);
}
if (yyn == YYFINAL)
YYACCEPT;
*++yyvsp = yylval;
/* Shift the error token. */
YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
yystate = yyn;
goto yynewstate;
/*-------------------------------------.
| yyacceptlab -- YYACCEPT comes here. |
`-------------------------------------*/
yyacceptlab:
yyresult = 0;
goto yyreturn;
/*-----------------------------------.
| yyabortlab -- YYABORT comes here. |
`-----------------------------------*/
yyabortlab:
yyresult = 1;
goto yyreturn;
#ifndef yyoverflow
/*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here. |
`-------------------------------------------------*/
yyexhaustedlab:
yyerror (YY_("memory exhausted"));
yyresult = 2;
/* Fall through. */
#endif
yyreturn:
if (yychar != YYEOF && yychar != YYEMPTY)
yydestruct ("Cleanup: discarding lookahead",
yytoken, &yylval);
/* Do not reclaim the symbols of the rule which action triggered
this YYABORT or YYACCEPT. */
YYPOPSTACK (yylen);
YY_STACK_PRINT (yyss, yyssp);
while (yyssp != yyss)
{
yydestruct ("Cleanup: popping",
yystos[*yyssp], yyvsp);
YYPOPSTACK (1);
}
#ifndef yyoverflow
if (yyss != yyssa)
YYSTACK_FREE (yyss);
#endif
#if YYERROR_VERBOSE
if (yymsg != yymsgbuf)
YYSTACK_FREE (yymsg);
#endif
/* Make sure YYID is used. */
return YYID (yyresult);
}
#line 1196 "parser"
int yywrap(void)
{
return 1;
}
icmake-7.21.01/comp/yylexfil.c 0000644 0001750 0001750 00000001603 12000542231 015033 0 ustar frank frank /*
Y Y L E X F I L . C
Function reading input for yylex() in the standard (file) situation
*/
#include "iccomp.h"
int yylex_file(char *buf, int max_size)
{
int
result;
/* try to read from file */
if ( (result = read( fileno(yyin), buf, (size_t)max_size )) > 0 )
return (result); /* return # bytes read if any */
if (result == 0) /* if none, switch to other fun */
{
clear_hidden(); /* clear existing hidden names */
yylex_input = yylex_hidden; /* connect the buffer-reader */
return (yylex_input(buf, max_size));/* read the hidden source */
}
error("read() in flex scanner failed"); /* error when read() fails */
return (0); /* dummy to avoid warning */
}
icmake-7.21.01/comp/indexop.c 0000644 0001750 0001750 00000002516 12000542231 014640 0 ustar frank frank /*
I N D E X O P . C
*/
#include "iccomp.h"
ESTRUC_ *indexOp(ESTRUC_ *larg, ESTRUC_ *rarg)
{
register int ok;
E_TYPE_ type = f_element;
ESTRUC_ *tmp;
etoc(larg); /* arg to stack */
etoc(rarg); /* arg to stack */
/* This follows the code of `twoargs.c' to compute a list/string */
/* element */
/* first arg must be int */
if (!test_type(larg, e_int)) /* first expression is no int */
{
tmp = larg; /* then swap */
larg = rarg;
rarg = tmp;
}
if ( (ok = test_type(larg, e_int)) ) /* right arg must be int */
{ /* second arg == list: ok */
if (!(ok = test_type(rarg, e_list)))
{ /* second arg == string: ok */
ok = test_type(rarg, e_str);
type = f_str_el; /* string element requested */
}
}
if (ok)
{
catcode(rarg, larg); /* make one code vector */
callrss(rarg, type);
}
else
{
semantic(type_conflict, funstring[type]);
discard(larg);
}
return (rarg);
}
icmake-7.21.01/comp/bor.c 0000644 0001750 0001750 00000001173 12000542231 013752 0 ustar frank frank /*
B O R . C
*/
#include "iccomp.h"
ESTRUC_ *bor (ESTRUC_ *lval, ESTRUC_ *rval)
{
if (test_binop(op_bor, lval, rval))
return (lval); /* test for correct types */
btoi(lval); /* convert pending booleans */
btoi(rval);
if (conflict(lval, rval, op_bor)) /* test type conflict */
return(lval);
if ((lval->type & rval->type & (size_t)~ALLTYPES) == e_const)
lval->evalue |= rval->evalue;
else
defcode(lval, rval, op_bor);
return (lval); /* return new expression */
}
icmake-7.21.01/comp/conflict.c 0000644 0001750 0001750 00000000600 12000542231 014763 0 ustar frank frank /*
C O N F L I C T . C
*/
#include "iccomp.h"
int conflict(lval, rval, opcode)
ESTRUC_
*lval,
*rval;
OPCODE_
opcode;
{
register int
ret;
if ( (ret = !(lval->type & rval->type & optype[opcode])) )
{
semantic(type_conflict, opstring[opcode]);
clearbin(lval, rval);
}
return (ret);
}
icmake-7.21.01/comp/ifstmnt.c 0000644 0001750 0001750 00000003011 12000542231 014645 0 ustar frank frank /*
I F S T M N T . C
*/
#include "iccomp.h"
ESTRUC_ *if_stmnt(e, s, s2)
ESTRUC_
*e,
*s,
*s2;
{
register size_t
len;
unsigned
*list;
nestlevel--; /* reduce nesting level */
etob(e); /* make links for E */
if (test_type(e, e_const)) /* constant: either always/never */
{
discard(e);
if (e->evalue) /* S always executed */
{
discard(s2);
return (s);
}
else /* S2 always executed */
{
discard(s);
return (s2);
}
}
patchup_true(e, 1); /* patch to EOC */
if (!s2->type) /* no S2 */
{
catcode(e, s); /* E = E ~ S */
return (e);
}
gencode(s, op_jmp, j_falselist);
list = s->falselist; /* save the falselist */
len = s->falselen;
addpatch(list, len, e->codelen); /* increase the patch targets */
s->falselen = 0;
catcode(e, s); /* E = E ~ S */
patchup_false(e, 1); /* patch to EOC */
e->falselen = len; /* restore the falselist */
e->falselist = list;
catcode(e, s2); /* if .. else cat. */
return (e); /* if .. else return */
}
icmake-7.21.01/comp/firstarg.c 0000644 0001750 0001750 00000000777 12000542231 015022 0 ustar frank frank /*
F I R S T A R G . C
*/
#include "iccomp.h"
static ESTRUC_
arr;
ESTRUC_ *firstarg(e)
ESTRUC_
*e;
{
etoc(e); /* argument is code now */
/* code points to ESTRUC_ */
arr.code = xrealloc(NULL, sizeof(ESTRUC_));
*(ESTRUC_ *)arr.code = *e; /* arr->code contains e */
arr.type = 1; /* type field: # of active e's */
return (&arr);
}
icmake-7.21.01/comp/lexer 0000644 0001750 0001750 00000027721 12000542231 014075 0 ustar frank frank %{
/*
L E X E R
*/
#include "iccomp.h"
#include "parser.h"
#ifndef fileno
int fileno(FILE *stream);
#endif
#undef YY_INPUT
#define YY_INPUT(buf,result,max_size) result = yylex_input(buf, max_size);
#ifdef unput
/* If this stops working, have a look at lexer2.c to see what was */
/* changed in the flex-implementation */
static void yyunput (int c,char *buf_ptr );
void (*unusedUnput)(int c,char *buf_ptr) = &yyunput;
#endif
%}
%x str
%%
[^"] |
\\. {
lexstring = xstrcat(lexstring, yytext);
}
\" {
BEGIN 0;
if (!stresc(lexstring))
semantic("illegal escape sequence in string");
return(STRING);
}
[ \t] ;
\n yylineno++;
^#.* {
change_file(yytext + 1);
}
\" {
lexstring[0] = 0; BEGIN str;
}
'.' {
sprintf(lexstring, "%d%c", yytext[1], 0);
return(NUMBER);
}
arghead {
yylval.type = f_arg_head;
return(ARG_HEAD);
}
argtail {
yylval.type = f_arg_tail;
return(ARG_TAIL);
}
ascii { /* ascii_int may become ascii_str */
yylval.type = f_ascii_int;
return(ASCII);
}
break {
return(BREAK);
}
chdir {
yylval.type = f_chdir;
return(CHDIR);
}
cmdtail {
yylval.type = f_cmd_tail;
return(CMD_TAIL);
}
cmdhead {
yylval.type = f_cmd_head;
return(CMD_HEAD);
}
change_base {
yylval.type = f_c_base;
return(C_BASE);
}
change_ext {
yylval.type = f_c_ext;
return(C_EXT);
}
change_path {
yylval.type = f_c_path;
return(C_PATH);
}
fprintf {
yylval.type = f_fprintf;
return(FPRINTF);
}
get_base {
yylval.type = f_g_base;
return(G_BASE);
}
get_ext {
yylval.type = f_g_ext;
return(G_EXT);
}
get_path {
yylval.type = f_g_path;
return(G_PATH);
}
getch {
yylval.type = f_getch;
return(GETCH);
}
getpid {
yylval.type = f_getpid;
return(GETPID);
}
gets {
yylval.type = f_gets;
return(GETS);
}
echo {
yylval.type = f_echo;
return(M_ECHO);
}
element {
yylval.type = f_element;
return(ELEMENT);
}
else {
return(ELSE);
}
exec {
yylval.type = f_exec;
return(EXEC);
}
execute {
yylval.type = f_execute;
return(EXECUTE);
}
exists {
yylval.type = f_exists;
return(EXISTS);
}
exit {
yylval.type = op_exit;
return(EXIT);
}
fgets {
yylval.type = f_fgets;
return (FGETS);
}
for {
return(FOR);
}
getenv {
yylval.type = f_getenv;
return GETENV;
}
if {
return(IF);
}
void {
yylval.type = 0; /* 0 == void */
return (VOID);
}
int {
yylval.type = e_int;
return(INT);
}
list {
yylval.type = e_list;
return(LIST);
}
makelist {
yylval.type = f_makelist;
return(MAKELIST);
}
older {
yylval.type = op_older;
return(OLDER);
}
printf {
yylval.type = f_printf;
return(PRINTF);
}
putenv {
yylval.type = f_putenv;
return (PUTENV);
}
return {
yylval.type = op_ret;
return(RETURN);
}
sizeof |
sizeoflist {
yylval.type = f_sizeoflist;
return(SIZEOFLIST);
}
stat {
yylval.type = f_stat;
return (STAT);
}
string {
yylval.type = e_str;
return(STRINGTYPE);
}
strlen {
yylval.type = f_strlen;
return(STRLEN);
}
strlwr {
yylval.type = f_strlwr;
return(STRLWR);
}
strupr {
yylval.type = f_strupr;
return(STRUPR);
}
strtok {
yylval.type = f_fields;
return(FIELDS);
}
strfind {
yylval.type = f_strfind;
return STRFIND;
}
substr {
yylval.type = f_substr;
return SUBSTR;
}
system {
yylval.type = f_system;
return(SYSTEM);
}
while {
return(WHILE);
}
newer |
younger {
yylval.type = op_younger;
return(YOUNGER);
}
"++" {
return(INC);
}
"--" {
return(DEC);
}
"/=" {
return(DIV_IS);
}
"-=" {
return(MINUS_IS);
}
"*=" {
return(MUL_IS);
}
"%=" {
return(MOD_IS);
}
"+=" {
return(PLUS_IS);
}
"&=" {
return(AND_IS);
}
"|=" {
return(OR_IS);
}
"^=" {
return(XOR_IS);
}
"<<=" {
return(SHL_IS);
}
">>=" {
return(SHR_IS);
}
"||" {
return(OR);
}
"&&" {
return(AND);
}
"==" {
return(EQUAL);
}
"!=" {
return(NOT_EQUAL);
}
"<=" {
return(SMALLER_EQUAL);
}
">=" {
return(GREATER_EQUAL);
}
">>" {
return(SHR);
}
"<<" {
return(SHL);
}
0x[0-9]+ {
unsigned value;
sscanf(yytext + 2, "%x", &value);
sprintf(lexstring, "%d", (int)value);
return(NUMBER);
}
[0-9]+ {
lexstring = xstrdup(yytext);
return(NUMBER);
}
OFF |
P_CHECK { /* P_CHECK: value in icm.h */
lexstring = xstrdup("0");
return(NUMBER);
}
S_IFDIR |
O_FILE | /* O_FILE: value in icm.h */
ON {
lexstring = xstrdup("1");
return(NUMBER);
}
S_IFCHR |
P_NOCHECK |
O_DIR { /* O_DIR: value in icm.h */
lexstring = xstrdup("2");
return(NUMBER);
}
S_IFREG |
O_SUBDIR { /* O_SUBDIR: value in icm.h */
lexstring = xstrdup("4");
return(NUMBER);
}
S_IREAD |
O_ALL { /* O_ALL: value in icm.h */
lexstring = xstrdup("8");
return(NUMBER);
}
S_IWRITE {
lexstring = xstrdup("16");
return(NUMBER);
}
S_IEXEC {
lexstring = xstrdup("32");
return(NUMBER);
}
[_A-Za-z][A-Za-z0-9_]* {
lexstring = xstrdup(yytext);
return(IDENTIFIER);
}
. return yytext[0];
icmake-7.21.01/comp/build 0000755 0001750 0001750 00000023522 12000542231 014053 0 ustar frank frank #!/usr/bin/icmake -qt/tmp/comp
// script generated by the C++ icmake script version 2.33
/*
Configurable defines:
CLASSES: string of directory-names under which sources of classes
are found. E.g., CLASSES = "class1 class2"
All class-names must be stored in one string.
If classes are removed from the CLASSES definition or if the names in the
CLASSES definition are reordered, the compilation should start again from
scratch.
*/
string
CLASSES;
void setClasses()
{
// ADD ADDITIONAL DIRECTORIES CONTAINING SOURCES OF CLASSES HERE
// Use the construction `CLASSES += "classname1 classname2";' etc.
CLASSES += "";
}
#define BUILD_LIBRARY
#define BUILD_PROGRAM "../tmp/usr/lib/icmake/icm-comp"
#define COMPILER "gcc"
#define COPT "-Wall -O2 -DHAVE_GLOB -g"
#define ECHO_REQUEST 1
#define LIBS "icrss"
#define LIBPATH "../tmp"
// NO CONFIGURABLE PARTS BELOW THIS LINE
/*
V A R S . I M
*/
string // contain options for
cwd, // current WD
libs, // extra libs, e.g., "-lrss -licce"
libpath, // extra lib-paths, eg, "-L../rss"
copt, // Compiler options
lopt, // Linker options
libxxx, // full library-path
ofiles, // wildcards for o-files
sources, // sources to be used
current, // contains name of current dir.
programname; // the name of the program to create
int
nClasses; // number of classes/subdirectories
list
classes; // list of classes/directories
/*
parser.im
*/
/*
I N I T I A L . I M
*/
void initialize()
{
echo(ECHO_REQUEST);
sources = "*.c";
ofiles = "o/*.o"; // std set of o-files
copt = COPT;
cwd = chdir(".");
if ("parser" younger "parser.c")
system("bison -d -o parser.c parser");
if ("lexer" younger "lexer.c" || "parser" younger "lexer.c")
system("flex -D__STDC_VERSION__=199901L -o lexer.c lexer");
}
/*
O B J F I L E S . I M
*/
list objfiles(list files)
{
string
file,
objfile;
int
i;
for (i = 0; i < sizeof(files); i++)
{
file = element(i, files); // determine element of the list
objfile = "./o/" + change_ext(file, "o"); // make obj-filename
if (objfile younger file) // objfile is younger
{
files -= (list)file; // remove the file from the list
i--; // reduce i to test the next
}
}
return (files);
}
/*
A L T E R E D . I M
*/
list altered(list files, string target)
{
int
i;
string
file;
for (i = 0; i < sizeof(files); i++) // try all elements of the list
{
file = element(i, files); // use element i of the list
if (file older target) // a file is older than the target
{
files -= (list)file; // remove the file from the list
i--; // reduce i to inspect the next
} // file of the list
}
return (files); // return the new list
}
/*
F I L E L I S T . I M
*/
list file_list(string type, string library)
{
list
files;
files = makelist(type); // make all files of certain type
#ifdef BUILD_LIBRARY
files = altered(files, library); // keep all files newer than lib.
#endif
files = objfiles(files); // remove if younger .obj exist
return (files);
}
/*
L I N K . I M
*/
void link(string library)
{
printf("\n");
exec(COMPILER, "-o", programname,
"-l" + library, libs, "-L.", libpath, lopt, "-s");
printf("ok: ", programname, "\n");
}
/*
P R E F I X C L . I M
*/
void prefix_class(string class_id)
{
list
o_files;
string
o_file;
int
i;
chdir("o");
o_files = makelist("*.o");
for (i = 0; o_file = element(i, o_files); i++)
exec("mv", o_file, class_id + o_file);
chdir("..");
}
/*
R M C L A S S P . I M
*/
string rm_class_id(string class_id, string ofile)
{
string
ret;
int
index,
n;
n = strlen(ofile);
for (index = strlen(class_id); index < n; index++)
ret += element(index, ofile);
return ret;
}
void rm_class_prefix(string class_id)
{
list
o_files;
string
o_file;
int
i;
chdir("o");
o_files = makelist("*.o");
for (i = 0; o_file = element(i, o_files); i++)
exec("mv", o_file, rm_class_id(class_id, o_file));
chdir("..");
}
/*
C C O M P I L E . I M
*/
void c_compile(list cfiles)
{
string
nextfile;
int
i;
if (!exists("o"))
system("mkdir o");
if (sizeof(cfiles)) // files to compile ?
{
printf("\ncompiling: ", current, "\n\n");
// compile all files separately
for (i = 0; nextfile = element(i, cfiles); i++)
exec(COMPILER,
"-c -o o/" + change_ext(nextfile, "o"),
copt, nextfile);
printf("\n");
}
printf("ok: ", current, "\n");
}
/*
U P D A T E L I . I M
*/
void updatelib(string library)
{
list
arlist,
objlist;
string
to,
from;
objlist = makelist("o/*.o");
if (!sizeof(objlist))
return;
printf("\n");
exec("ar", "rvs", library, "o/*.o");
exec("rm", "o/*.o");
printf("\n");
}
/*
S T D C P P . I M
*/
void std_cpp(string library)
{
list
cfiles;
cfiles = file_list(sources, library); // make list of all cpp-files
c_compile(cfiles); // compile cpp-files
}
/*
C P P M A K E . C
CPP files are processed by stdmake.
Arguments of CPPMAKE:
cpp_make(
string mainfile, : name of the main .cpp file, or "" for library
maintenance
string library, : name of the local library to use/create
(without lib prefix or .a/.so suffix
(E.g., use `main' for `libmain.a')
)
Both mainfile and library MUST be in the current directory
*/
void cpp_make(string mainfile, string library)
{
int
index;
string class;
if (nClasses)
ofiles += " */o/*.o"; // set ofiles for no LIBRARY use
// make library name
libxxx = chdir(".") + "lib" + library + ".a";
// first process all classes
for (index = 0; index < nClasses; index++)
{
class = element(index, classes); // next class to process
chdir(class); // change to directory
current = "subdir " + class;
#ifdef QT
moc(class); // see if we should call moc
#endif
std_cpp(libxxx); // compile all files
chdir(cwd); // go back to parent dir
}
current = "auxiliary " + sources + " files";
std_cpp(libxxx); // compile all files in current dir
// prefix class-number for .o files
for (index = 0; index < nClasses; index++)
{
current = element(index, classes); // determine class name
chdir( current); // chdir to a class directory.
prefix_class((string)index);
updatelib(libxxx);
chdir(cwd); // go back to parent dir
}
current = ""; // no class anymore
updatelib(libxxx); // update lib in current dir
if (mainfile != "") // mainfile -> do link
{
link(library);
printf
(
"\nProgram construction completed.\n"
"\n"
);
}
}
/*
S E T L I B S . I M
*/
void setlibs()
{
int
n,
index;
list
cut;
cut = strtok(LIBS, " "); // cut op libraries
n = sizeof(cut);
for (index = 0; index < n; index++)
libs += " -l" + element(index, cut);
cut = strtok(LIBPATH, " "); // cut up the paths
n = sizeof(cut);
for (index = 0; index < n; index++)
libpath += " -L" + element(index, cut);
}
void main(int argc, list argv)
{
int extensive;
if (argc == 1)
{
printf("Usage:\n"
" build prog [-e]\n");
exit (1);
}
if (extensive = (element(argc - 1, argv) == "-e"))
--argc;
initialize();
if (extensive)
copt =
"-O0 -g3 -ansi -pedantic -fno-common -pipe -W -Wall -Wcast-align"
" -Wcast-qual -Wconversion -Wformat=2 -Winline -Wnested-externs"
" -Wpointer-arith -Wshadow -Wstrict-prototypes -Wundef"
" -Wno-unused-parameter -Waggregate-return -Wnested-externs"
" -DHAVE_GLOB";
setlibs();
programname = BUILD_PROGRAM;
system("mkdir -p " + get_path(programname));
cpp_make
(
"icm-comp.c", // program source
"icmcomp" // static program library
);
system("rm -rf o lib*.a");
exit (0);
}
icmake-7.21.01/comp/shr.c 0000644 0001750 0001750 00000001224 12000542231 013761 0 ustar frank frank /*
S H R . C
*/
#include "iccomp.h"
ESTRUC_ *shr (lval, rval)
ESTRUC_
*lval,
*rval;
{
if (test_binop(op_shr, lval, rval))
return (lval); /* test for correct types */
btoi(lval); /* convert pending booleans */
btoi(rval);
if (conflict(lval, rval, op_shr)) /* test type conflict */
return(lval);
if ((lval->type & rval->type & (size_t)~ALLTYPES) == e_const)
lval->evalue >>= rval->evalue;
else
defcode(lval, rval, op_shr);
return (lval); /* return new expression */
}
icmake-7.21.01/comp/zeroargs.c 0000644 0001750 0001750 00000000363 12000542231 015024 0 ustar frank frank /*
Z E R O A R G S . C
*/
#include "iccomp.h"
static ESTRUC_
e;
ESTRUC_ *zeroargs(E_TYPE_ type)
{
e = *stackframe(0); /* reinitialize e */
callrss(&e, type);
return &e;
}
icmake-7.21.01/comp/insertar.c 0000644 0001750 0001750 00000001417 12000542231 015020 0 ustar frank frank /*
I N S E R T A R . C
*/
#include "iccomp.h"
ESTRUC_ *insertarg(insert, mult)
ESTRUC_
*insert,
*mult;
{
register size_t
count;
count = ++mult->type; /* get/increase # of args */
/* room for extra ESTRUC_ */
mult->code = xrealloc(mult->code, count * sizeof(ESTRUC_));
memmove( /* shift up for new firstarg */
codestruc(mult, 1),
codestruc(mult, 0),
(count - 1) * sizeof(ESTRUC_));
etoc(insert); /* argument is code now */
*codestruc(mult, 0) = *insert; /* insert expression in array */
return (mult); /* done */
}
icmake-7.21.01/comp/rmjmpzer.c 0000644 0001750 0001750 00000000510 12000542231 015030 0 ustar frank frank /*
R M J M P Z E R . C
*/
#include "iccomp.h"
size_t rm_jmp_zero(register size_t codelen, unsigned *list,
register size_t listlen)
{
return
(
listlen && (list[listlen - 1] == codelen) ?
(sizeof(INT8) + sizeof(INT16))
:
0
);
}
icmake-7.21.01/comp/andboole.c 0000644 0001750 0001750 00000001314 12000542231 014750 0 ustar frank frank /*
A N D B O O L E . C
*/
#include "iccomp.h"
ESTRUC_ *and_boolean(lexp, rexp)
ESTRUC_
*lexp,
*rexp;
{
if (lexp->type & rexp->type & e_const) /* two constants: compute result */
{
lexp->evalue =
(test_type(lexp, e_str) || lexp->evalue)
&&
(test_type(rexp, e_str) || rexp->evalue);
set_type(lexp, e_const | e_int);
}
else /* at least one code-part */
{
fetob(lexp);
fetob(rexp);
patchup_true(lexp, 1);
lexp->truelen = 0;
lexp = catcode(lexp, rexp);
set_type(lexp, e_bool | e_code);
}
return (lexp);
}
icmake-7.21.01/comp/patchup.c 0000644 0001750 0001750 00000003060 12000542231 014631 0 ustar frank frank /*
P A T C H U P . C
*/
#include "iccomp.h"
void patchup(INT8 *code, size_t len, unsigned *list, size_t listlen,
int pos)
{ /* list, listlen: list of */
register size_t /* offsets to patchup */
idx,
beyond_jump;
char
*cp; /* codepointer */
union
{
char jumpsize[2];
INT16 int16;
} u;
if (!listlen) /* done if nothing to patchup */
return;
if (pos)
pos = len;
/* walk all elements to patchup */
for (idx = 0; idx < listlen; idx++)
{
beyond_jump = list[idx];
/*
beyond-jump is the offset immediately beyond the jump to
the end of the code. This is the position where the jump
starts after having read the jump instruction. Hence, the
jumpsize is determined by the distance 'pos - beyond-jump',
whereas this jumpsize must be inserted 2 bytes earlier
than beyond_jump, as part of the jump instruction.
*/
/* determine the size of the jmp */
u.int16 = pos - beyond_jump;
cp = (char *)code + beyond_jump - 2;/* point to codebytes to patch */
*cp = u.jumpsize[0]; /* copy byte 0 */
*(cp + 1) = u.jumpsize[1]; /* copy byte 1 */
}
free(list);
}
icmake-7.21.01/comp/notboole.c 0000644 0001750 0001750 00000001157 12000542231 015013 0 ustar frank frank /*
N O T B O O L E . C
*/
#include "iccomp.h"
ESTRUC_ *not_boolean(e)
ESTRUC_
*e;
{
size_t len;
unsigned *list;
if (test_type(e, e_const)) /* immediate value */
{
e->evalue = !(test_type(e, e_str) || e->evalue);
set_type(e, e_int | e_const);
}
else
{
fetob(e);
len = e->truelen; /* cross the links */
e->truelen = e->falselen;
e->falselen = len;
list = e->truelist;
e->truelist = e->falselist;
e->falselist = list;
}
return (e);
}
icmake-7.21.01/comp/backend.c 0000644 0001750 0001750 00000004440 12000542231 014557 0 ustar frank frank /*
B A C K E N D . C
version
offset of the string constant-area (INT32)
offset of the variable area (INT32)
offset of the strings area (INT32)
offset of the first instruction (INT32)
code (first byte is first instruction)
ascii-z string constant area
variables
filenames
*/
#include "iccomp.h"
static INT8
opexit = op_exit,
opcall = op_call;
void backend()
{
register size_t
idx;
BIN_HEADER_
hdr;
lexstring = xstrdup("main");
if ((idx = looksym(&funtab)) == funtab.n_defined)
{
semantic("function 'main()' not defined");
exit(1);
}
hdr.offset[3] = ftell(s_bin); /* offset of first instruction */
hidden_functions(); /* patchup generated hidden */
/* function calls */
fseek(s_bin, 0, SEEK_END); /* upwind to EOF again */
/* write global vars initializ. */
/* code */
outbin(global_init.code, global_init.codelen);
outbin(&opcall, sizeof(INT8)); /* call main() at its offset */
outbin(&funtab.symbol[idx].var.vu.i->count, sizeof(INT16));
outbin(&opexit, sizeof(INT8)); /* generate op_ret at the end */
strncpy(hdr.version, version, sizeof(hdr.version)); /* set the version */
hdr.offset[0] = ftell(s_bin); /* here the strings start */
/* generate the strings */
for (idx = 0; idx < n_strings; idx++)
fprintf(s_bin, "%s%c", stringtab[idx].string, 0);
hdr.offset[1] = ftell(s_bin); /* here the vars start */
for (idx = 0; idx < global.n_defined; idx++)
{
global.symbol[idx].var.type &= ~e_var; /* remove 'var' indicator */
fwrite(&global.symbol[idx].var, 1, sizeof(VAR_), s_bin);
}
hdr.offset[2] = ftell(s_bin); /* here the filenames start */
fputs(filenames, s_bin);
rewind(s_bin);
/* write the offset info */
fwrite(&hdr, sizeof(BIN_HEADER_), 1, s_bin);
}
icmake-7.21.01/comp/mathass.c 0000644 0001750 0001750 00000001161 12000542231 014625 0 ustar frank frank /*
M A T H A S S . C
*/
#include "iccomp.h"
ESTRUC_ *math_ass(ESTRUC_ *lval, ESTRUC_ *rval,
ESTRUC_ *(*fun)(ESTRUC_ *, ESTRUC_ *),
char *opstr)
{
register E_TYPE_
ltype;
register size_t
evalue;
ltype = lval->type;
evalue = lval->evalue;
fun(lval, rval); /* perform operation */
rval->type = ltype; /* restore ltype/value */
rval->evalue = evalue;
rval->codelen = 0;
rval->code = NULL;
return assignment(rval, lval, opstr); /* perform assignment */
}
icmake-7.21.01/comp/patchtru.c 0000644 0001750 0001750 00000000744 12000542231 015025 0 ustar frank frank /*
P A T C H T R U . C
*/
#include "iccomp.h"
void patchtrue(e)
ESTRUC_
*e;
{ /* expand the truelist */
e->truelist = xrealloc(e->truelist, (e->truelen + 1) * sizeof(size_t));
/* room for the jump-backpatch */
e->code = xrealloc(e->code, e->codelen += sizeof(INT16));
e->truelist[e->truelen++] = e->codelen; /* store jumpstart location */
}
icmake-7.21.01/comp/shl.c 0000644 0001750 0001750 00000001174 12000542231 013757 0 ustar frank frank /*
S H L . C
*/
#include "iccomp.h"
ESTRUC_ *shl (ESTRUC_ *lval, ESTRUC_ *rval)
{
if (test_binop(op_shl, lval, rval))
return (lval); /* test for correct types */
btoi(lval); /* convert pending booleans */
btoi(rval);
if (conflict(lval, rval, op_shl)) /* test type conflict */
return(lval);
if ((lval->type & rval->type & (size_t)~ALLTYPES) == e_const)
lval->evalue <<= rval->evalue;
else
defcode(lval, rval, op_shl);
return (lval); /* return new expression */
}
icmake-7.21.01/comp/onearg.c 0000644 0001750 0001750 00000002421 12000542231 014440 0 ustar frank frank /*
O N E A R G . C
*/
#include "iccomp.h"
ESTRUC_ *onearg(type, arg)
E_TYPE_
type;
ESTRUC_
*arg;
{
register int
ok;
etoc(arg); /* arg to stack */
switch ((FUNNR_)type)
{
case f_ascii_int:
if ( (ok = test_type(arg, e_str | e_int)) )
{
if (test_type(arg, e_int)) /* int received */
type = f_ascii_str; /* string returned */
}
break;
case f_sizeoflist:
ok = test_type(arg, e_list);
break;
case f_echo:
ok = test_type(arg, e_int);
break;
default:
/*
case f_backtick:
case f_getenv:
case f_putenv:
case f_exists:
case f_cmd_head:
case f_cmd_tail:
case f_arg_head:
case f_arg_tail:
case f_g_path:
case f_g_base:
case f_g_ext:
case f_strlen:
case f_strlwr:
case f_strupr:
*/
ok = test_type(arg, e_str);
}
if (ok)
callrss(arg, type);
else
semantic(type_conflict, funstring[type]);
return (arg);
}
icmake-7.21.01/comp/divide.c 0000644 0001750 0001750 00000001645 12000542231 014440 0 ustar frank frank /*
D I V I D E . C
*/
#include "iccomp.h"
ESTRUC_ *divide (lval, rval)
ESTRUC_
*lval,
*rval;
{
if (test_binop(op_div, lval, rval))
return (lval); /* test for correct types */
btoi(lval); /* convert pending booleans */
btoi(rval);
if (conflict(lval, rval, op_div)) /* test type conflict */
return(lval);
if (test_type(rval, e_const))
{
if (!rval->evalue) /* expression / 0: not allowed */
{
semantic("division by 0: undefined");
clearbin(lval, rval);
return (lval);
}
if (test_type(lval, e_const))
{
lval->evalue /= rval->evalue;
return (lval);
}
}
defcode(lval, rval, op_div);
return (lval); /* return new expression */
}
icmake-7.21.01/comp/icast.c 0000644 0001750 0001750 00000001524 12000542231 014273 0 ustar frank frank /*
I C A S T . C
*/
#include "iccomp.h"
ESTRUC_ *icast(e)
ESTRUC_
*e;
{
if (test_type(e, e_list)) /* (int)list not ok */
{
semantic(illegal_cast);
discard(e);
set_type(e, e_int | e_const);
}
else if (test_type(e, e_str)) /* (int)string ok */
{
if (test_type(e, e_const)) /* string const to a */
{
e->evalue = /* convert to string */
atoi(stringtab[e->evalue].string);
set_type(e, e_const | e_int);
}
else
{
etoc(e); /* convert to code */
gencode(e, op_atoi); /* runtime conversion needed */
set_type(e, e_int | e_code);
}
}
return (e);
}
icmake-7.21.01/comp/parser 0000644 0001750 0001750 00000051452 12000542231 014250 0 ustar frank frank /* C Declarations */
%{
#include "iccomp.h"
%}
/* Bison Declarations */
%token
ARG_HEAD
ARG_TAIL
ASCII
BREAK
CHDIR
CMD_HEAD
CMD_TAIL
C_BASE
C_EXT
C_PATH
G_BASE
G_EXT
G_PATH
ELEMENT
ELSE
EXEC
EXECUTE
EXISTS
EXIT
FGETS
FIELDS
FOR
FPRINTF
GETENV
GETCH
GETPID
GETS
IDENTIFIER
IF
INT
LIST
MAKELIST
M_ECHO
NUMBER
PRINTF
PUTENV
RETURN
SIZEOFLIST
STAT
STRING
STRINGTYPE
STRLEN
STRLWR
STRUPR
STRFIND
SUBSTR
SYSTEM
VOID
WHILE
%right
'='
AND_IS /* binary-assignment */
OR_IS
XOR_IS
SHL_IS
SHR_IS
DIV_IS /* arithmetic assignment */
MINUS_IS
MUL_IS
MOD_IS
PLUS_IS
%left OR
%left AND
%left '|'
%left '^'
%left '&'
%left EQUAL NOT_EQUAL
%left '<' '>' SMALLER_EQUAL GREATER_EQUAL OLDER YOUNGER
%left SHL SHR
%left '+' '-'
%left '*' '/' '%'
%right '!' INC DEC '~'
%left '['
%expect 1
/* Grammar Rules */
%%
input:
input
def_var_or_fun
|
def_var_or_fun
;
/* A */
args:
args
comma
err_expression
{
$$ = *multargs(&$1, &$3);
}
|
err_expression
{
$$ = *firstarg(&$1);
}
;
/* B */
break_ok:
{
break_ok++;
}
;
break_stat:
BREAK
{
$$ = *break_stmnt();
}
;
/* C */
casttype:
INT
|
LIST
|
STRINGTYPE
;
backtick: {parse_error = err_backtick_expected; } '`' ;
closebrace: {parse_error = err_closebrace_expected; } '}' ;
closepar: {parse_error = err_closepar_expected; } ')' ;
comma: {parse_error = err_comma_expected; } ',' ;
comma_arglist:
','
args
{
$$ = $2;
}
|
zeroframe
;
comma_expr:
','
err_expression
{
$$ = $2;
}
|
zeroframe
;
compound:
'{' /* } (for matching) */
statements
closebrace
{
$$ = $2;
}
;
/* D */
def_var_or_fun:
opt_vartype
var_or_fun
|
voidtype
funcdef
;
/* E */
else_tail:
ELSE
statement
{
$$ = $2;
}
|
zeroframe
;
enterid:
IDENTIFIER
{
entervar();
}
;
entervarid:
enterid
{
$$ = *fetchvar();
}
;
err_expression:
{
parse_error = err_in_expression;
}
expression
{
$$ = $2;
}
;
expression:
expression
'='
expression
{
$$ = *assign(&$1, &$3);
}
|
expression
'['
expression
']'
{
$$ = *indexOp(&$1, &$3);
}
|
expression
MUL_IS
expression
{
$$ = *math_ass(&$1, &$3, multiply, "*=");
}
|
expression
DIV_IS
expression
{
$$ = *math_ass(&$1, &$3, divide, "/=");
}
|
expression
MOD_IS
expression
{
$$ = *math_ass(&$1, &$3, modulo, "%=");
}
|
expression
PLUS_IS
expression
{
$$ = *math_ass(&$1, &$3, addition, "+=");
}
|
expression
MINUS_IS
expression
{
$$ = *math_ass(&$1, &$3, subtract, "-=");
}
|
expression
AND_IS
expression
{
$$ = *math_ass(&$1, &$3, band, "&=");
}
|
expression
OR_IS
expression
{
$$ = *math_ass(&$1, &$3, bor, "|=");
}
|
expression
XOR_IS
expression
{
$$ = *math_ass(&$1, &$3, xor, "^=");
}
|
expression
SHL_IS
expression
{
$$ = *math_ass(&$1, &$3, shl, "<<=");
}
|
expression
SHR_IS
expression
{
$$ = *math_ass(&$1, &$3, shr, ">>=");
}
|
expression
OR
expression
{
$$ = *or_boolean(&$1, &$3);
}
|
expression
AND
expression
{
$$ = *and_boolean(&$1, &$3);
}
|
expression
EQUAL
expression
{
$$ = *equal(&$1, &$3);
}
|
expression
NOT_EQUAL
expression
{
$$ = *unequal(&$1, &$3);
}
|
expression
'<'
expression
{
$$ = *smaller(&$1, &$3);
}
|
expression
'>'
expression
{
$$ = *greater(&$1, &$3);
}
|
expression
SMALLER_EQUAL
expression
{
$$ = *sm_equal(&$1, &$3);
}
|
expression
GREATER_EQUAL
expression
{
$$ = *gr_equal(&$1, &$3);
}
|
expression
'+'
expression
{
$$ = *addition(&$1, &$3);
}
|
expression
'&'
expression
{
$$ = *band(&$1, &$3);
}
|
expression
'|'
expression
{
$$ = *bor(&$1, &$3);
}
|
expression
'^'
expression
{
$$ = *xor(&$1, &$3);
}
|
expression
SHL
expression
{
$$ = *shl(&$1, &$3);
}
|
expression
SHR
expression
{
$$ = *shr(&$1, &$3);
}
|
expression
'-'
expression
{
$$ = *subtract(&$1, &$3);
}
|
expression
'*'
expression
{
$$ = *multiply(&$1, &$3);
}
|
expression
YOUNGER
expression
{
$$ = *young(&$1, &$3);
}
|
expression
OLDER
expression
{
$$ = *old(&$1, &$3);
}
|
expression
'/'
expression
{
$$ = *divide(&$1, &$3);
}
|
expression
'%'
expression
{
$$ = *modulo(&$1, &$3);
}
|
'-'
expression %prec '!'
{
$$ = *negate(&$2);
}
|
INC
expression
{
$$ = *incdec(pre_op, op_inc, &$2);
}
|
expression
INC
{
$$ = *incdec(post_op, op_inc, &$1);
}
|
DEC
expression
{
$$ = *incdec(pre_op, op_dec, &$2);
}
|
expression
DEC
{
$$ = *incdec(post_op, op_dec, &$1);
}
|
'+'
expression %prec '!'
{
$$ = $2;
}
|
'~'
expression %prec '!'
{
$$ = *bnot(&$2);
}
|
'!'
expression
{
$$ = *not_boolean(&$2);
}
|
'('
casttype
')'
expression %prec '!'
{
$$ = *cast($2.type, &$4);
}
|
string
{
$$ = *stackframe(e_str | e_const);
}
|
NUMBER
{
$$ = *stackframe(e_int | e_const);
}
|
'('
expression
closepar
{
$$ = $2;
}
|
func_or_var
|
'`'
expression
backtick
{
$$ = *onearg(f_backtick, &$2);
}
;
expr_code:
err_expression
{
$$ = *expr_stmnt(&$1);
}
;
expr_list:
expr_list
','
expr_code
{
$$ = *catcode(&$1, &$3);
}
|
expr_code
;
/* F */
for:
FOR
nesting
;
for_stat:
for
openpar
opt_expr_list
semicol
opt_expression
semicol
opt_expr_list
closepar
break_ok
statement
popdead
{
$$ = *for_stmnt(&$3, &$5, &$7, &$10);
}
;
funcdef:
funid
funvars /* returns init code */
statements
closebrace
{
close_fun(&$3);
}
;
func_or_var:
function
closepar
|
IDENTIFIER
{
$$ = *fetchvar();
}
;
function:
zero_arg_funs /* getch() or gets() */
openpar
{
$$ = *zeroargs($1.type);
}
|
one_arg_funs
openpar
err_expression
{
$$ = *onearg($1.type, &$3);
}
|
two_arg_funs
openpar
err_expression
comma
err_expression
{
$$ = *twoargs($1.type, &$3, &$5);
}
|
three_arg_funs
openpar
err_expression
comma
err_expression
comma
err_expression
{
$$ = *threeargs($1.type, &$3, &$5, &$7);
}
|
optint_string /* CHDIR, SYSTEM, STAT */
openpar
err_expression /* int inserted if string */
comma_expr /* may be string if first == int */
{
$$ = *optint_string($1.type, &$3, &$4);
}
|
optint_special /* EXEC, EXECUTE */
openpar /* alternatives: */
err_expression /* fun(int, string, ...) */
comma_arglist /* fun(string, ...) */
{
$$ = *optint_special($1.type, &$3, &$4);
}
|
PRINTF
openpar
args /* first may be anything */
{
$$ = *specials(f_printf, &$3);
}
|
FPRINTF
openpar
args /* argcount >= 2 required */
{
$$ = *exec_fprintf($1.type, &$3);
}
|
funname
openpar
opt_arglist
{
$$ = *callfun($1.evalue, &$3);
}
|
makelist
;
funid:
IDENTIFIER
{
open_fun();
}
;
funname:
IDENTIFIER
{
$$.evalue = fetchfun();
}
;
funvars:
openpar
opt_parlist
')'
openbrace
opt_locals
{
make_frame();
outbin($5.code, $5.codelen);
}
;
/* G */
/* H */
/* I */
idexpr:
enterid
zeroframe /* no explicit initialization */
|
entervarid
initassign
expression
{
initialization = 0;
$$ = *expr_stmnt(assign(&$1, &$3)); /* explicit initialization */
}
;
if:
IF
nesting
;
if_stat:
if
openpar
err_expression
closepar
statement
popdead
pushdead
else_tail
popdead
{
$$ = *if_stmnt(&$3, &$5, &$8);
}
;
initassign:
'='
{
initialization = 1;
}
/* J */
/* K */
/* L */
leave_key:
RETURN
|
EXIT
;
local_list:
type_of_var
vardefs /* + semicol, initialization code */
{
$$ = $2;
}
;
locals:
locals
local_list /* type + variables */
{
$$ = *catcode(&$1, &$2); /* cat initialization code */
}
|
local_list /* initialization code of 1st var */
;
/* M */
makelist:
/* makelist(expr) */
makelist_expr
makelist_normal /* returns O_FILE expression */
{
$$ = *makelist
(
multargs
(
firstarg(&$2), /* O_FILE is passed */
&$1 /* expression is passed */
),
op_hlt /* not op_younger or op_older */
);
}
|
/* makelist(expr, expr) */
makelist_expr
comma
err_expression
{
$$ = *makelist
(
multargs
(
firstarg(&$1), /* fileattribute is passed */
&$3 /* expression is passed */
),
op_hlt /* not op_younger or op_older */
);
}
|
makelist_expr /* makelist(expr, older, expr) */
comma
older_younger
comma
err_expression
makelist_normal
{
$$ = *makelist
(
multargs
(
multargs
(
firstarg(&$6), /* O_FILE is passed */
&$1 /* 1st expression is passed */
),
&$5 /* 2nd expression is passed */
),
$3.type /* older/younger */
);
}
|
makelist_expr /* makelist(expr, expr, older, expr) */
comma
err_expression
comma
older_younger
comma
err_expression
{
$$ = *makelist
(
multargs
(
multargs
(
firstarg(&$1), /* attribute is passed */
&$3 /* 2nd expression is passed */
),
&$7 /* 3rd expression is passed */
),
$5.type /* older/younger */
);
}
;
makelist_expr:
MAKELIST
openpar
err_expression
{
$$ = $3;
}
;
makelist_normal:
{
$$ = *stackframe(e_int | e_const);
$$.evalue = O_FILE;
}
;
/* N */
nesting:
pushdead
{
nestlevel++;
}
;
/* O */
ok:
';'
{
yyerrok;
}
;
older_younger:
{parse_error = err_older_younger; }
old_young
{
$$ = $2;
}
;
old_young:
OLDER
|
YOUNGER
;
one_arg_funs:
ASCII
|
SIZEOFLIST
|
EXISTS
|
M_ECHO
|
CMD_TAIL
|
CMD_HEAD
|
ARG_HEAD
|
ARG_TAIL
|
G_BASE
|
G_PATH
|
G_EXT
|
PUTENV
|
GETENV
|
STRLEN
|
STRUPR
|
STRLWR
;
openpar: {parse_error = err_openpar_expected; } '(' ;
openbrace: {parse_error = err_openbrace_expected; } '{' ;
/* } for matching */
opt_arglist:
args
|
zeroframe
;
opt_expression:
err_expression
|
{
$$ = *stackframe(e_int | e_const);
$$.evalue = 1;
}
;
opt_expr_list:
expr_list
|
zeroframe
;
optint_special:
EXEC /* optional int allowed */
|
EXECUTE
;
optint_string:
STAT
|
CHDIR
|
SYSTEM
;
opt_locals:
locals /* initialization code */
|
zeroframe /* empty init. code */
;
opt_parlist:
pars
|
;
opt_vartype:
type_of_var
|
{
vartype = e_int;
}
;
/* P */
pars:
pars
comma
partype
|
partype
;
partype:
type_of_var
enterid
{
n_params++;
}
;
popdead:
{
pop_dead();
}
;
pushdead:
{
push_dead(); /* set new dead-level */
}
;
/* Q */
/* R */
return_stat:
leave_key
return_tail
{
$$ = *return_stmnt($1.type, &$2);
}
;
return_tail:
err_expression
|
zeroframe
;
/* S */
semicol: {parse_error = err_semicol_expected; } ';' ;
statement:
stm
{
sem_err = 0;
}
;
statements:
statements
statement
{
$$ = *cat_stmnt(&$1, &$2);
}
|
zeroframe
;
stm:
compound
|
';'
zeroframe
{
$$ = $1;
}
|
expr_code
semicol
|
while_stat
|
if_stat
|
for_stat
|
return_stat
semicol
|
break_stat
semicol
|
error
ok
;
string:
string
STRING
{
stringbuf = xstrcat(stringbuf, lexstring);/* catenate the new string */
}
|
STRING
{
free(stringbuf); /* free former string */
stringbuf = xstrdup(lexstring); /* duplicate initial string */
}
;
/* T */
two_arg_funs:
C_EXT /* string, string */
|
C_BASE
|
C_PATH
|
ELEMENT /* int, list | int, string */
|
FGETS /* list fgets(string, int) */
|
FIELDS /* string, string */
|
STRFIND /* string, string */
;
three_arg_funs:
SUBSTR
;
type_of_var:
vartype
{
parse_error = err_identifier_expected;
vartype = $1.type;
}
;
/* U */
/* V */
vardefs:
varnames
semicol
{
$$ = $1; /* initialization code */
}
;
varnames:
varnames
comma
idexpr
{
$$ = *catcode(&$1, &$3); /* catenate variable */
/* initialization code */
}
|
idexpr
|
error
ok
zeroframe /* Empty stmnt */
{
$$ = $3;
}
;
var_or_fun:
vardefs
{
global_init = *catcode(&global_init, &$1);
}
|
funcdef
;
vartype:
INT
|
STRINGTYPE
|
LIST
;
voidtype:
VOID
{
vartype = 0;
}
;
/* W */
while:
WHILE
nesting
;
while_stat:
while
openpar
err_expression
closepar
break_ok
statement
popdead
{
$$ = *while_stmnt(&$3, &$6);
}
;
/* X */
/* Y */
/* Z */
zero_arg_funs:
GETCH
|
GETPID
|
GETS
;
zeroframe:
{
$$ = *stackframe(0);
}
;
%%
int yywrap(void)
{
return 1;
}
icmake-7.21.01/comp/icm-comp.c 0000644 0001750 0001750 00000003214 12000542231 014672 0 ustar frank frank /*
I C M - C O M P . C
*/
#include "iccomp.h"
extern int yydebug;
int main (int argc, char **argv) /* icm-comp source(txt) dest(bin) */
{
if (argc != 3)
{
copyright("Make Optimizing Compiler", version, release);
error("Usage: %s source dest\n"
"where:\n"
"\tsource: source file to compile\n"
"\t (normally output from ICM-PP)\n"
"\tdest: name of binary file to generate\n"
,
program_name(argv[0]));
}
if
(
!(yyin = fopen(argv[1], "rt")) /* open text file for parsing */
||
!(s_bin = fopen(argv[2], "w+b")) /* open binary file to write/read */
)
error("%s Can't read/write file(s)");
/* malloc the dead-stack */
dead = xrealloc(NULL, sizeof(unsigned));
dead[0] = 0; /* and initialize its element */
stringbuf = xstrdup(nullstring); /* malloc initial stringbuf */
lexstring = xstrdup(nullstring); /* initial lexstring */
/* go to first codebyte pos */
fseek(s_bin, sizeof(BIN_HEADER_), SEEK_SET);
#ifdef YYDEBUG
yydebug = YYDEBUG;
#endif
yyparse(); /* parse the source */
if (!yynerrs) /* backend if no errors */
backend();
else /* informative message */
printf("\n%u error(s) detected\n", (unsigned)errcount);
return(yynerrs != 0); /* returnvalue */
}
icmake-7.21.01/comp/grequal.c 0000644 0001750 0001750 00000001701 12000542231 014625 0 ustar frank frank /*
G R E Q U A L . C
*/
#include "iccomp.h"
ESTRUC_ *gr_equal (ESTRUC_ *lval, ESTRUC_ *rval)
{
btoi(lval); /* convert boolean to i */
btoi(rval);
if (conflict(lval, rval, op_greq)) /* test type conflict */
return(lval);
if ((lval->type & rval->type & (size_t)~ALLTYPES) == e_const)
{
if (test_type(lval, e_int))
lval->evalue = (lval->evalue >= rval->evalue);
else
{
lval->evalue =
(
strcmp
(
stringtab[lval->evalue].string,
stringtab[rval->evalue].string
)
) >= 0;
set_type(lval, e_int | e_const);
}
}
else
defcode(lval, rval, op_greq);
return (lval); /* return new expression */
}
icmake-7.21.01/comp/outcode.c 0000644 0001750 0001750 00000002016 12000542231 014627 0 ustar frank frank /*
O U T C O D E . C
*/
#include "iccomp.h"
void outcode(ESTRUC_ *ep, int value, register size_t size)
{
register size_t
codelen;
union
{
char buffer[2];
INT16 int16;
} u;
codelen = ep->code ? /* use local codelen in register */
ep->codelen
:
0; /* 0 if not yet any code */
if (size == sizeof(char)) /* assign char to write */
u.buffer[0] = (char)value;
else /* use char[2] as intermediate */
u.int16 = (INT16)value; /* to store INT16 value */
/* make room for new code */
ep->code = xrealloc(ep->code, (codelen + size) * sizeof(char));
/* append the new code */
memcpy(ep->code + codelen, u.buffer, size);
ep->codelen = codelen + size; /* update the codelen-counter */
}
icmake-7.21.01/comp/modulo.c 0000644 0001750 0001750 00000001620 12000542231 014464 0 ustar frank frank /*
M O D U L O . C
*/
#include "iccomp.h"
ESTRUC_ *modulo (lval, rval)
ESTRUC_
*lval,
*rval;
{
if (test_binop(op_mod, lval, rval))
return (lval); /* test for correct types */
btoi(lval); /* convert pending booleans */
btoi(rval);
if (conflict(lval, rval, op_mod)) /* test type conflict */
return(lval);
if (test_type(rval, e_const))
{
if (!rval->evalue) /* no "E / 0" */
{
semantic("modulo 0: undefined");
clearbin(lval, rval);
return (lval);
}
if (test_type(lval, e_const))
{
lval->evalue %= rval->evalue;
return (lval);
}
}
defcode(lval, rval, op_mod);
return (lval); /* return new expression */
}
icmake-7.21.01/comp/catargs.c 0000644 0001750 0001750 00000001274 12000542231 014616 0 ustar frank frank /*
C A T A R G S . C
*/
#include "iccomp.h"
void catargs (arr)
ESTRUC_
*arr;
{
register size_t
count;
ESTRUC_
*ep,
e;
if (!(count = arr->type))
return; /* no arguments */
ep = (ESTRUC_ *)arr->code; /* local pointer to ESTRUC_s */
e = ep[--count]; /* e: code of last argument */
while (count--)
catcode(&e, &ep[count]); /* catenate next argument(s) */
free(arr->code); /* memory of array is free again */
*arr = e; /* arguments changed to code */
}
icmake-7.21.01/comp/gencode.c 0000644 0001750 0001750 00000006626 12000542231 014604 0 ustar frank frank /*
G E N C O D E . C
*/
#include "iccomp.h"
void gencode(ESTRUC_ *e, OPCODE_ opcode, ...)
{
register size_t
idx,
last;
int
marker_value;
size_t
count;
va_list
marker;
if (dead[dead_sp])
return;
va_start(marker, opcode);
lastop = opcode; /* remember last opcode */
outcode(e, (int)opcode, sizeof(char));
switch (opcode)
{
case op_jmp: /* write target to jump to */
switch ((JMP_COND_)va_arg(marker, JMP_COND_))
{
case j_uncond: /* absolute jumplocation */
outcode(e, va_arg(marker, int), sizeof(INT16));
break;
case j_truelist:
patchtrue(e); /* new truelist item */
break;
case j_falselist:
patchfalse(e); /* new falselist item */
break;
}
break;
case op_jmp_false: /* write target to jump if false */
patchfalse(e);
break;
case op_jmp_true: /* write target to jump if true */
patchtrue(e);
break;
case op_push_strconst: /* write idx of the const */
outcode(e,
(int)stringtab[va_arg(marker, int)].index, sizeof(INT16));
break;
case op_frame:
count = last = local.n_defined - n_params;
outcode(e, (int)count, sizeof(char));
for (idx = 0; idx < last; idx++)
{
count = local.symbol[n_params + idx].var.type & ALLTYPES;
outcode(e, (int)count, sizeof(char));
}
break;
case op_copy_var: /* write # of the var. */
case op_push_imm: /* write value of the int */
case op_push_var: /* write # of the var. */
case op_dec: /* write # of the var. */
case op_inc: /* write # of the var. */
case op_call: /* write offset of function */
outcode(e, va_arg(marker, int), sizeof(INT16));
break;
case op_asp: /* write # of args to remove */
marker_value = va_arg(marker, int);
if (!marker_value) /* nothing to add to sp */
e->codelen--; /* opcode removed from code */
else
outcode(e, marker_value, sizeof(char));
break;
case op_call_rss: /* write # of function */
outcode(e, va_arg(marker, int), sizeof(char));
break;
case op_ret:
case op_exit:
++dead[dead_sp];
break;
default:
/*
The default switch entry is inserted to prvent a long compiler
warning about a not-handled enum value
following opcodes already out:
op_pop_reg
op_push_reg
op_push_1_jmp_end
op_push_0
op_umin
op_atoi
op_itoa
op_atol
op_mul
op_div
op_mod
op_add
op_sub
op_eq
op_neq
op_sm
op_gr
op_younger
op_older
op_smeq
op_greq
*/
break;
}
}
icmake-7.21.01/comp/negate.c 0000644 0001750 0001750 00000001075 12000542231 014434 0 ustar frank frank /*
N E G A T E . C
*/
#include "iccomp.h"
ESTRUC_ *negate(ESTRUC_ *e) /* expression so far */
{
if (test_operand(e, op_umin)) /* test types ok */
{
semantic(illegal_type, opstring[op_umin]);
return (e);
}
if (e->type & e_const) /* immediate value */
e->evalue = -(int)e->evalue;
else
{
etoc(e); /* convert to code */
gencode(e, op_umin); /* generate instruction */
}
return (e);
}
icmake-7.21.01/comp/enter.c 0000644 0001750 0001750 00000002045 12000542231 014304 0 ustar frank frank /*
E N T E R . C
*/
#include "iccomp.h"
void enter()
{
register size_t
n_defined;
register SYMBOL_
*sym;
n_defined = entertab->n_defined;
if (looksym(entertab) != n_defined) /* look for symbol in active tab. */
{ /* message if multiply defined */
semantic("%s multiply defined", lexstring);
return;
}
if (entertab->n_allocated == n_defined) /* full table ? */
entertab->symbol = /* room for 20 more symbols */
xrealloc(entertab->symbol,
(entertab->n_allocated += 20) * sizeof(SYMBOL_));
sym = entertab->symbol + n_defined;
sym->name = xstrdup(lexstring); /* set the name of the var */
sym->var.type = vartype; /* set the type of the var */
if (entertab == &global) /* clear new global entry */
memset (&sym->var.vu, 0, sizeof(VAR_UNION_));
entertab->n_defined++; /* next free */
}
icmake-7.21.01/comp/changefi.c 0000644 0001750 0001750 00000003013 12000542231 014727 0 ustar frank frank /*
C H A N G E F I . C
*/
#include "iccomp.h"
#define N_FILES 11
static struct
{
int
former_linenr;
char
*fname;
}
stack[N_FILES];
static size_t
filenames_len,
sp = N_FILES;
void change_file(s)
char
*s; /* name of source file to open */
{
register int
slen;
if (*s) /* any filename ? */
{
if (!sp--) /* no more entries ? */
error("Over 10 included files");
stack[sp].fname = xstrdup(s); /* save the name of the file */
stack[sp].former_linenr = yylineno; /* save the line number */
filenames = xrealloc(filenames, /* room for new filename */
filenames_len +
(slen = strlen(s)) +
2);
/* append name */
sprintf(filenames + filenames_len, "%s\n", s);
filenames_len += slen + 1; /* new length of string */
yylineno = 0; /* start at new file */
}
else
{
if (sp == N_FILES - 1)
error("[%s] Line %d: Include file stack empty", source_name,
yylineno);
free(stack[sp].fname);
yylineno = stack[sp].former_linenr - 1;
sp++; /* free stack element */
}
source_name = stack[sp].fname;
}
icmake-7.21.01/comp/data.c 0000644 0001750 0001750 00000021205 12000542231 014077 0 ustar frank frank
/*
D A T A . C
*/
#include "iccomp.h"
char
*filenames,
*funstring[] = /* only one_arg */
{
"arghead",
"argtail",
"ascii",
"ascii",
"change_base",
"chdir",
"change_ext",
"cmdhead",
"cmdtail",
"change_path",
"echo",
"element",
"exec",
"execute",
"exists",
"strtok",
"fgets",
"fprintf",
"get_base",
"getch",
"gets",
"get_ext",
"get_path",
"makelist",
"printf",
"putenv",
"sizeoflist",
"stat",
"element", /* f_str_el */
"strlwr",
"strupr",
"system",
},
icm_comp[] = "ICM-COMP:",
illegal_argcount[] = "%s(): too few arguments",
illegal_cast[] = "illegal cast",
illegal_type[] = "illegal type for %s",
init_expr_not_const[] = "initialization expression must be const",
lvalue_needed[] = "lvalue needed for %s",
nullstring[] = "",
*opstring[] =
{
NULL, /* op_jmp, */
NULL, /* op_jmp_false, */
NULL, /* op_jmp_true, */
NULL, /* op_push_1_jmp_end, */
NULL, /* op_push_0, */
NULL, /* op_push_imm, */
NULL, /* op_push_strconst, */
NULL, /* op_push_var, */
NULL, /* op_push_reg, */
NULL, /* op_pop_var, */
"(unary) -", /* op_umin, */
"(int)", /* op_atoi, */
"(string)", /* op_itoa, */
"(list)", /* op_atol, */
"*", /* op_mul, */
"/", /* op_div, */
"%%", /* op_mod, */
"+", /* op_add, */
"-", /* op_sub, */
"==", /* op_eq, */
"!=", /* op_neq, */
"<", /* op_sm, */
">", /* op_gr, */
"younger", /* op_younger, */
"older", /* op_older, */
"<=", /* op_smeq, */
">=", /* op_greq, */
NULL, /* op_call */
NULL, /* op_asp */
NULL, /* op_ret */
NULL, /* op_copy_var */
"++", /* op_inc */
"--", /* op_dec */
NULL, /* op_call */
NULL, /* op_frame */
NULL, /* op_ret */
NULL, /* op_pop_ */
"&", /* op_band */
"|", /* op_bor */
"~", /* op_bnot */
"^", /* op_xor */
"<<", /* op_shl */
">>", /* op_shr */
},
*source_name,
*lexstring, /* resizing STRING buffer */
*stringbuf, /* final STRING */
type_conflict[] = "conflicting operand types for %s";
E_TYPE_
vartype;
E_TYPE_
optype[] =
{
0, /* op_jmp, */
0, /* op_jmp_false, */
0, /* op_jmp_true, */
0, /* op_push_1_jmp_end, */
0, /* op_push_0, */
0, /* op_push_imm, */
0, /* op_push_strconst, */
0, /* op_push_var, */
0, /* op_push_reg, */
0, /* op_pop_var, */
e_int | e_list | e_bool, /* op_umin, */
e_str, /* op_atoi, */
e_int | e_bool, /* op_itoa, */
e_str, /* op_atol, */
e_int | e_bool, /* op_mul, */
e_int | e_bool, /* op_div, */
e_int | e_bool, /* op_mod, */
ALLTYPES, /* op_add, */
ALLTYPES, /* op_sub, */
ALLTYPES, /* op_eq, */
ALLTYPES, /* op_neq, */
e_int | e_bool | e_str, /* op_sm, */
e_int | e_bool | e_str, /* op_gr, */
e_str, /* op_younger, */
e_str, /* op_older, */
e_int | e_bool | e_str, /* op_smeq, */
e_int | e_bool | e_str, /* op_greq, */
0, /* op_call */
0, /* op_asp */
0, /* op_ret */
0, /* op_copy_var */
e_int, /* op_inc */
e_int, /* op_dec */
0, /* op_call */
0, /* op_frame */
0, /* op_ret */
0, /* op_pop_ */
e_int, /* op_band */
e_int, /* op_bor */
e_int, /* op_bnot */
e_int, /* op_xor */
e_int, /* op_shl */
e_int, /* op_shr */
};
FILE
*s_bin;
int
initialization = 0,
parse_error = err_code_or_vars_expected,
(*yylex_input)(char *, int) = /* pointer to yylex input to use */
yylex_file; /* start reading from file */
OPCODE_
lastop = op_hlt;
STRINGTAB_
*stringtab;
SYMTAB_
local,
funtab,
global,
*entertab = &global;
HIDDEN_FUNCTION_
hidden[he_] =
{
{
"h_older", /* name */
/* source of the hidden function */
"list h_older(int attrib, string mask, string file)"
"{"
" int"
" idx;"
" list"
" source,"
" dest;"
" string"
" s;"
""
" source = makelist(attrib, mask);"
" for (idx = sizeof(source); idx--; )"
" {"
" s = element(idx, source);"
" if (s older file)"
" dest += (list)s;"
" }"
" return (dest);"
"}",
e_reg | e_list, /* returntype */
0, /* must be 0, set to 1 if called */
3, /* number of arguments */
},
{
"h_younger",
"list h_younger(int attrib, string mask, string file)"
"{"
" int"
" idx;"
" list"
" source,"
" dest;"
" string"
" s;"
""
" source = makelist(attrib, mask);"
" for (idx = sizeof(source); idx--; )"
" {"
" s = element(idx, source);"
" if (s younger file)"
" dest += (list)s;"
" }"
" return (dest);"
"}",
e_reg | e_list,
0,
3,
},
};
size_t
break_ok,
dead_sp,
errcount,
hidden_called,
nestlevel,
n_params,
n_strings,
n_symbols,
sem_err,
stringsize;
unsigned *dead;
ESTRUC_ global_init; /* code for initializing globals */
icmake-7.21.01/comp/stackfra.c 0000644 0001750 0001750 00000000705 12000542231 014766 0 ustar frank frank /*
S T A C K F R A . C
*/
#include "iccomp.h"
static ESTRUC_
frame;
ESTRUC_ *stackframe(E_TYPE_ type)
{
frame.type = type;
switch ((int)type)
{
case e_int | e_const:
frame.evalue = atoi(lexstring);
break;
case e_str | e_const:
frame.evalue = lookstring(stringbuf);
break;
default:
frame.evalue = 0;
}
return &frame;
}
icmake-7.21.01/comp/clearbin.c 0000644 0001750 0001750 00000000407 12000542231 014746 0 ustar frank frank /*
C L E A R B I N . C
*/
#include "iccomp.h"
void clearbin (lval, rval)
ESTRUC_
*lval,
*rval;
{
discard(rval);
discard(lval);
memset(lval, 0, sizeof(ESTRUC_));
lval->type = e_int | e_const;
}
icmake-7.21.01/comp/clearhid.c 0000644 0001750 0001750 00000001560 12000542231 014743 0 ustar frank frank /*
C L E A R H I D . C
Clear hidden function names from the function- and
global symboltables
*/
#include "iccomp.h"
static void remove_name(register SYMTAB_ *tab)
{
register size_t
idx;
if ((idx = looksym(tab)) < tab->n_defined)
{
free(tab->symbol[idx].name); /* free the name-memory */
tab->symbol[idx].name = /* set a dummy name */
xstrdup(nullstring);
}
}
void clear_hidden()
{
register size_t
idx;
for (idx = 0; idx < sizeof(hidden) / sizeof(HIDDEN_FUNCTION_); idx++)
{
lexstring = xstrdup(hidden[idx].name); /* prepare the lookup-name */
remove_name(&funtab); /* remove the name from funtab */
remove_name(&global); /* remove also from global */
}
}
icmake-7.21.01/comp/makelist.c 0000644 0001750 0001750 00000002323 12000542231 014777 0 ustar frank frank /*
M A K E L I S T . C
Possibilities:
1- makelist(int, string)
2- makelist(int, string, older, string) -- younger ok too
The parser may have inserted the int-argument as int O_FILE
*/
#include "iccomp.h"
ESTRUC_ *makelist(ESTRUC_ *args, E_TYPE_ type)
{
if
( /* first arg not int */
!test_type(codestruc(args, 0), e_int)
|| /* or second not string */
!test_type(codestruc(args, 1), e_str)
|| /* or three arguments, but */
(
args->type == 3
&& /* last is not string */
!test_type(codestruc(args, 2), e_str)
)
)
{
semantic(type_conflict, funstring[f_makelist]);
return (args);
}
catargs(args); /* catenate all arguments */
if ((OPCODE_)type != op_hlt) /* hidden function called */
callhidden((OPCODE_)type == op_younger, args);
else
callrss(args, f_makelist);
return (args); /* return called function code */
}
icmake-7.21.01/comp/assignme.c 0000644 0001750 0001750 00000002043 12000542231 014773 0 ustar frank frank /*
A S S I G N M E . C
*/
#include "iccomp.h"
ESTRUC_ *assignment(lval, rval, opstr) /* opstr is '=', or "/=", etc. */
ESTRUC_
*lval,
*rval;
char
*opstr;
{
ESTRUC_
*tmp;
size_t
type,
value;
if (!test_type(lval, e_var))
{
semantic(lvalue_needed, opstr);
discard(rval);
return (lval);
}
etoc(rval); /* convert rval to code */
/* same types */
if (lval->type & rval->type & (e_int | e_str | e_list))
{
type = lval->type; /* save type/idx for return */
value = lval->evalue;
gencode(lval, op_copy_var, lval->evalue);
tmp = catcode(rval, lval); /* catenate assignment code */
tmp->evalue = value; /* set lvalue type and idx */
tmp->type = type;
return tmp;
}
semantic(type_conflict, opstr);
discard(rval);
return lval;
}
icmake-7.21.01/comp/equal.c 0000644 0001750 0001750 00000001665 12000542231 014305 0 ustar frank frank /*
E Q U A L . C
*/
#include "iccomp.h"
ESTRUC_ *equal (ESTRUC_ *lval, ESTRUC_ *rval)
{
btoi(lval); /* convert boolean to i */
btoi(rval);
if (conflict(lval, rval, op_eq)) /* test type conflict */
return(lval);
if ((lval->type & rval->type & (size_t)~ALLTYPES) == e_const)
{
if (test_type(lval, e_int))
lval->evalue = (lval->evalue == rval->evalue);
else
{
lval->evalue = !
(
strcmp
(
stringtab[lval->evalue].string,
stringtab[rval->evalue].string
)
);
set_type(lval, e_int | e_const);
}
}
else
defcode(lval, rval, op_eq);
return (lval); /* return new expression */
}
icmake-7.21.01/comp/discard.c 0000644 0001750 0001750 00000000402 12000542231 014573 0 ustar frank frank /*
D I S C A R D . C
*/
#include "iccomp.h"
void discard(e)
ESTRUC_
*e;
{
if (e->falselen)
free(e->falselist);
if (e->truelen)
free(e->truelist);
if (e->code)
free(e->code);
}
icmake-7.21.01/comp/catstmnt.c 0000644 0001750 0001750 00000000463 12000542231 015026 0 ustar frank frank /*
C A T S T M N T . C
*/
#include "iccomp.h"
ESTRUC_ *cat_stmnt(ESTRUC_ *lval, ESTRUC_ *rval)
{
patchup_false(lval, 1);
if (!nestlevel)
{
outbin(lval->code, lval->codelen);
discard(lval);
return rval;
}
return catcode(lval, rval);
}
icmake-7.21.01/comp/pushdead.c 0000644 0001750 0001750 00000000631 12000542231 014763 0 ustar frank frank /*
P U S H D E A D . C
*/
#include "iccomp.h"
static size_t
size = 1;
void push_dead() /* dead_sp: lastused, dead[0] = 0 */
{
if (++dead_sp >= size) /* too few elements ? then 5 more */
dead = xrealloc(dead, (size += 5) * sizeof(unsigned));
dead[dead_sp] = dead[dead_sp - 1]; /* copy former element */
}
icmake-7.21.01/comp/band.c 0000644 0001750 0001750 00000001201 12000542231 014064 0 ustar frank frank /*
B A N D . C
*/
#include "iccomp.h"
ESTRUC_ *band (ESTRUC_ *lval, ESTRUC_ *rval)
{
if (test_binop(op_band, lval, rval))
return (lval); /* test for correct types */
btoi(lval); /* convert pending booleans */
btoi(rval);
if (conflict(lval, rval, op_band)) /* test type conflict */
return(lval);
if ((lval->type & rval->type & (size_t)~ALLTYPES) == e_const)
lval->evalue &= rval->evalue;
else
defcode(lval, rval, op_band);
return (lval); /* return new expression */
}
icmake-7.21.01/comp/young.c 0000644 0001750 0001750 00000000707 12000542231 014333 0 ustar frank frank /*
Y O U N G . C
*/
#include "iccomp.h"
ESTRUC_ *young (lval, rval)
ESTRUC_
*lval,
*rval;
{
if (test_binop(op_younger, lval, rval))
return (lval); /* test for correct types */
etoc(lval); /* convert to code */
etoc(rval);
defcode(lval, rval, op_younger);
return (lval); /* return new expression */
}
icmake-7.21.01/comp/closefun.c 0000644 0001750 0001750 00000000641 12000542231 015005 0 ustar frank frank /*
C L O S E F U N . C
*/
#include "iccomp.h"
static INT8
opret = op_ret;
void close_fun(e)
ESTRUC_
*e;
{
entertab = &global;
last_stmnt(e);
if (!dead[dead_sp])
outbin(&opret, sizeof(INT8));
else
dead[dead_sp] = 0; /* leaving a function: code generation ok, */
/* e.g. to define global variables */
}
icmake-7.21.01/comp/addpatch.c 0000644 0001750 0001750 00000000354 12000542231 014740 0 ustar frank frank /*
A D D P A T C H . C
*/
#include "iccomp.h"
void addpatch (unsigned *list, size_t len, register size_t value)
{
register size_t idx;
for (idx = 0; idx < len; idx++)
list[idx] += value;
}
icmake-7.21.01/comp/twoargs.c 0000644 0001750 0001750 00000002771 12000542231 014663 0 ustar frank frank /*
T W O A R G S . C
*/
#include "iccomp.h"
ESTRUC_ *twoargs(type, larg, rarg)
E_TYPE_
type;
ESTRUC_
*larg,
*rarg;
{
register int
ok;
etoc(larg); /* arg to stack */
etoc(rarg); /* arg to stack */
switch ((FUNNR_)type)
{
case f_fgets:
ok = test_type(larg, e_str) && test_type(rarg, e_int);
break;
case f_element: /* f_element */
/* first arg must be int */
if ( (ok = test_type(larg, e_int)) )
{ /* second arg == list: ok */
if (!(ok = test_type(rarg, e_list)))
{ /* second arg == string: ok */
ok = test_type(rarg, e_str);
type = f_str_el; /* string element requested */
}
}
break;
default:
/*
case f_fields:
case f_c_ext:
case f_c_base:
case f_c_path:
case f_strfind:
*/
ok = larg->type & rarg->type & e_str;
}
if (ok)
{
catcode(rarg, larg); /* make one code vector */
callrss(rarg, type);
}
else
{
semantic(type_conflict, funstring[type]);
discard(larg);
}
return (rarg);
}
icmake-7.21.01/comp/popdead.c 0000644 0001750 0001750 00000000450 12000542231 014601 0 ustar frank frank /*
P O P D E A D . C
*/
#include "iccomp.h"
void pop_dead() /* dead_sp: lastused, dead[0] = 0 */
{
if (dead_sp) /* anything to pop ? */
--dead_sp; /* then reduce SP */
}
icmake-7.21.01/comp/specials.c 0000644 0001750 0001750 00000001233 12000542231 014770 0 ustar frank frank /*
S P E C I A L S . C
*/
#include "iccomp.h"
ESTRUC_ *specials(type, marg)
E_TYPE_
type;
ESTRUC_
*marg; /* array of arguments */
{
register size_t
count;
if ((FUNNR_)type == f_execute)
return(execute(marg)); /* full list of arguments */
count = marg->type; /* count # of arguments */
catargs(marg); /* catenate multiple args */
gencode(marg, op_push_imm, count); /* # of arguments of fun */
callrss(marg, type, count + 1); /* call function */
return (marg);
}
icmake-7.21.01/comp/openfun.c 0000644 0001750 0001750 00000002040 12000542231 014634 0 ustar frank frank /*
O P E N F U N . C
*/
#include "iccomp.h"
void open_fun()
{
register size_t
idx,
last;
entertab = &funtab; /* store a function */
enter(); /* enter its name */
/* set proper function type */
funtab.symbol[funtab.n_defined - 1].var.type |= e_reg;
funtab.symbol[funtab.n_defined - 1].var.vu.i =
xrealloc(NULL, sizeof(INTER_));
for /* free former local names */
(
idx = 0,
last = local.n_defined;
idx < last;
idx++
)
free(local.symbol[idx].name);
local.n_defined = 0; /* no symbols defined as yet */
entertab = &local; /* next table to enter: local */
n_params = 0; /* no parameters as yet */
dead_sp = 0; /* allow code generation */
dead[0] = 0;
}
icmake-7.21.01/comp/patchupt.c 0000644 0001750 0001750 00000000355 12000542231 015021 0 ustar frank frank /*
P A T C H U P T . C
*/
#include "iccomp.h"
void patchup_true(e, pos)
ESTRUC_
*e;
int
pos;
{
patchup(e->code, e->codelen, e->truelist, e->truelen, pos);
e->truelen = 0;
}
icmake-7.21.01/comp/lexer.c 0000644 0001750 0001750 00000224124 12267171127 014333 0 ustar frank frank #line 2 "lexer.c"
#line 4 "lexer.c"
#define YY_INT_ALIGNED short int
/* A lexical scanner generated by flex */
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
#define YY_FLEX_SUBMINOR_VERSION 35
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
/* First, we deal with platform-specific or compiler-specific issues. */
/* begin standard C headers. */
#include
#include
#include
#include
/* end standard C headers. */
/* flex integer type definitions */
#ifndef FLEXINT_H
#define FLEXINT_H
/* C99 systems have . Non-C99 systems may or may not. */
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
* if you want the limit (max/min) macros for int types.
*/
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS 1
#endif
#include
typedef int8_t flex_int8_t;
typedef uint8_t flex_uint8_t;
typedef int16_t flex_int16_t;
typedef uint16_t flex_uint16_t;
typedef int32_t flex_int32_t;
typedef uint32_t flex_uint32_t;
#else
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
typedef int flex_int32_t;
typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
/* Limits of integral types. */
#ifndef INT8_MIN
#define INT8_MIN (-128)
#endif
#ifndef INT16_MIN
#define INT16_MIN (-32767-1)
#endif
#ifndef INT32_MIN
#define INT32_MIN (-2147483647-1)
#endif
#ifndef INT8_MAX
#define INT8_MAX (127)
#endif
#ifndef INT16_MAX
#define INT16_MAX (32767)
#endif
#ifndef INT32_MAX
#define INT32_MAX (2147483647)
#endif
#ifndef UINT8_MAX
#define UINT8_MAX (255U)
#endif
#ifndef UINT16_MAX
#define UINT16_MAX (65535U)
#endif
#ifndef UINT32_MAX
#define UINT32_MAX (4294967295U)
#endif
#endif /* ! C99 */
#endif /* ! FLEXINT_H */
#ifdef __cplusplus
/* The "const" storage-class-modifier is valid. */
#define YY_USE_CONST
#else /* ! __cplusplus */
/* C99 requires __STDC__ to be defined as 1. */
#if defined (__STDC__)
#define YY_USE_CONST
#endif /* defined (__STDC__) */
#endif /* ! __cplusplus */
#ifdef YY_USE_CONST
#define yyconst const
#else
#define yyconst
#endif
/* Returned upon end-of-file. */
#define YY_NULL 0
/* Promotes a possibly negative, possibly signed char to an unsigned
* integer for use as an array index. If the signed char is negative,
* we want to instead treat it as an 8-bit unsigned char, hence the
* double cast.
*/
#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
/* Enter a start condition. This macro really ought to take a parameter,
* but we do it the disgusting crufty way forced on us by the ()-less
* definition of BEGIN.
*/
#define BEGIN (yy_start) = 1 + 2 *
/* Translate the current start state into a value that can be later handed
* to BEGIN to return to the state. The YYSTATE alias is for lex
* compatibility.
*/
#define YY_START (((yy_start) - 1) / 2)
#define YYSTATE YY_START
/* Action number for EOF rule of a given start state. */
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
/* Special action meaning "start processing a new file". */
#define YY_NEW_FILE yyrestart(yyin )
#define YY_END_OF_BUFFER_CHAR 0
/* Size of default input buffer. */
#ifndef YY_BUF_SIZE
#define YY_BUF_SIZE 16384
#endif
/* The state buf must be large enough to hold one state per character in the main buffer.
*/
#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
#ifndef YY_TYPEDEF_YY_BUFFER_STATE
#define YY_TYPEDEF_YY_BUFFER_STATE
typedef struct yy_buffer_state *YY_BUFFER_STATE;
#endif
extern int yyleng;
extern FILE *yyin, *yyout;
#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2
#define YY_LESS_LINENO(n)
/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
do \
{ \
/* Undo effects of setting up yytext. */ \
int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\
*yy_cp = (yy_hold_char); \
YY_RESTORE_YY_MORE_OFFSET \
(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
YY_DO_BEFORE_ACTION; /* set up yytext again */ \
} \
while ( 0 )
#define unput(c) yyunput( c, (yytext_ptr) )
#ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T
typedef size_t yy_size_t;
#endif
#ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
{
FILE *yy_input_file;
char *yy_ch_buf; /* input buffer */
char *yy_buf_pos; /* current position in input buffer */
/* Size of input buffer in bytes, not including room for EOB
* characters.
*/
yy_size_t yy_buf_size;
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
*/
int yy_n_chars;
/* Whether we "own" the buffer - i.e., we know we created it,
* and can realloc() it to grow it, and should free() it to
* delete it.
*/
int yy_is_our_buffer;
/* Whether this is an "interactive" input source; if so, and
* if we're using stdio for input, then we want to use getc()
* instead of fread(), to make sure we stop fetching input after
* each newline.
*/
int yy_is_interactive;
/* Whether we're considered to be at the beginning of a line.
* If so, '^' rules will be active on the next match, otherwise
* not.
*/
int yy_at_bol;
int yy_bs_lineno; /**< The line count. */
int yy_bs_column; /**< The column count. */
/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
int yy_fill_buffer;
int yy_buffer_status;
#define YY_BUFFER_NEW 0
#define YY_BUFFER_NORMAL 1
/* When an EOF's been seen but there's still some text to process
* then we mark the buffer as YY_EOF_PENDING, to indicate that we
* shouldn't try reading from the input source any more. We might
* still have a bunch of tokens to match, though, because of
* possible backing-up.
*
* When we actually see the EOF, we change the status to "new"
* (via yyrestart()), so that the user can continue scanning by
* just pointing yyin at a new input file.
*/
#define YY_BUFFER_EOF_PENDING 2
};
#endif /* !YY_STRUCT_YY_BUFFER_STATE */
/* Stack of input buffers. */
static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
/* We provide macros for accessing buffer states in case in the
* future we want to put the buffer states in a more general
* "scanner state".
*
* Returns the top of the stack, or NULL.
*/
#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
? (yy_buffer_stack)[(yy_buffer_stack_top)] \
: NULL)
/* Same as previous macro, but useful when we know that the buffer stack is not
* NULL or when we need an lvalue. For internal use only.
*/
#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
/* yy_hold_char holds the character lost when yytext is formed. */
static char yy_hold_char;
static int yy_n_chars; /* number of characters read into yy_ch_buf */
int yyleng;
/* Points to current character in buffer. */
static char *yy_c_buf_p = (char *) 0;
static int yy_init = 0; /* whether we need to initialize */
static int yy_start = 0; /* start state number */
/* Flag which is used to allow yywrap()'s to do buffer switches
* instead of setting up a fresh yyin. A bit of a hack ...
*/
static int yy_did_buffer_switch_on_eof;
void yyrestart (FILE *input_file );
void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
void yy_delete_buffer (YY_BUFFER_STATE b );
void yy_flush_buffer (YY_BUFFER_STATE b );
void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
void yypop_buffer_state (void );
static void yyensure_buffer_stack (void );
static void yy_load_buffer_state (void );
static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
void *yyalloc (yy_size_t );
void *yyrealloc (void *,yy_size_t );
void yyfree (void * );
#define yy_new_buffer yy_create_buffer
#define yy_set_interactive(is_interactive) \
{ \
if ( ! YY_CURRENT_BUFFER ){ \
yyensure_buffer_stack (); \
YY_CURRENT_BUFFER_LVALUE = \
yy_create_buffer(yyin,YY_BUF_SIZE ); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
}
#define yy_set_bol(at_bol) \
{ \
if ( ! YY_CURRENT_BUFFER ){\
yyensure_buffer_stack (); \
YY_CURRENT_BUFFER_LVALUE = \
yy_create_buffer(yyin,YY_BUF_SIZE ); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
}
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
typedef unsigned char YY_CHAR;
FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
typedef int yy_state_type;
extern int yylineno;
int yylineno = 1;
extern char *yytext;
#define yytext_ptr yytext
static yy_state_type yy_get_previous_state (void );
static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
static int yy_get_next_buffer (void );
static void yy_fatal_error (yyconst char msg[] );
/* Done after the current pattern has been matched and before the
* corresponding action - sets up yytext.
*/
#define YY_DO_BEFORE_ACTION \
(yytext_ptr) = yy_bp; \
yyleng = (size_t) (yy_cp - yy_bp); \
(yy_hold_char) = *yy_cp; \
*yy_cp = '\0'; \
(yy_c_buf_p) = yy_cp;
#define YY_NUM_RULES 97
#define YY_END_OF_BUFFER 98
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
{
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
static yyconst flex_int16_t yy_accept[332] =
{ 0,
0, 0, 0, 0, 98, 96, 4, 5, 96, 7,
96, 96, 96, 96, 96, 96, 96, 80, 80, 96,
96, 96, 95, 95, 95, 95, 96, 95, 95, 95,
95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
95, 95, 95, 95, 96, 6, 1, 3, 1, 74,
64, 72, 66, 0, 63, 59, 65, 60, 62, 61,
80, 0, 78, 75, 73, 76, 77, 95, 95, 85,
95, 95, 95, 68, 95, 95, 95, 95, 95, 95,
95, 95, 95, 95, 95, 95, 36, 95, 95, 95,
95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
95, 95, 67, 71, 6, 2, 8, 79, 69, 70,
81, 95, 95, 95, 95, 95, 95, 95, 95, 95,
95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
34, 95, 95, 38, 95, 95, 95, 95, 95, 95,
95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
95, 95, 95, 95, 95, 95, 95, 26, 95, 28,
29, 95, 32, 95, 95, 95, 95, 95, 95, 25,
39, 95, 95, 95, 95, 95, 95, 95, 47, 95,
95, 95, 95, 95, 95, 95, 37, 95, 95, 92,
88, 95, 95, 95, 95, 95, 95, 95, 95, 95,
95, 95, 95, 11, 12, 95, 13, 95, 95, 95,
95, 95, 33, 95, 95, 95, 95, 23, 95, 95,
95, 57, 41, 95, 95, 95, 95, 95, 95, 95,
95, 95, 95, 95, 95, 56, 95, 84, 95, 95,
95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
95, 95, 95, 95, 31, 95, 95, 95, 95, 35,
24, 95, 42, 43, 44, 45, 95, 48, 49, 50,
52, 51, 54, 55, 95, 95, 82, 95, 94, 86,
83, 89, 91, 95, 9, 10, 95, 15, 14, 27,
30, 19, 95, 21, 95, 95, 95, 53, 58, 90,
95, 93, 95, 95, 95, 20, 22, 40, 95, 87,
95, 95, 95, 95, 95, 17, 95, 46, 16, 18,
0
} ;
static yyconst flex_int32_t yy_ec[256] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 2, 4, 5, 6, 1, 7, 8, 9, 1,
1, 10, 11, 1, 12, 1, 13, 14, 15, 15,
15, 15, 15, 15, 15, 15, 15, 1, 1, 16,
17, 18, 1, 1, 19, 20, 21, 22, 23, 24,
25, 26, 27, 28, 29, 30, 28, 31, 32, 33,
28, 34, 35, 36, 37, 28, 38, 39, 28, 28,
1, 40, 1, 41, 42, 1, 43, 44, 45, 46,
47, 48, 49, 50, 51, 28, 52, 53, 54, 55,
56, 57, 28, 58, 59, 60, 61, 62, 63, 64,
65, 66, 1, 67, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1
} ;
static yyconst flex_int32_t yy_meta[68] =
{ 0,
1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 3, 3, 1, 1, 1, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 1,
1, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 1
} ;
static yyconst flex_int16_t yy_base[337] =
{ 0,
0, 362, 63, 64, 367, 369, 369, 369, 349, 369,
348, 62, 0, 347, 60, 61, 346, 60, 66, 66,
345, 67, 0, 63, 319, 318, 342, 30, 300, 22,
45, 43, 310, 38, 305, 312, 307, 300, 49, 305,
51, 295, 300, 293, 74, 0, 369, 369, 0, 369,
369, 369, 369, 339, 369, 369, 369, 369, 369, 369,
81, 99, 330, 369, 369, 369, 329, 0, 321, 0,
96, 96, 317, 369, 294, 297, 294, 76, 294, 289,
74, 50, 291, 279, 278, 275, 0, 274, 274, 280,
268, 284, 278, 268, 267, 260, 65, 281, 265, 272,
271, 260, 369, 369, 0, 369, 369, 111, 369, 369,
0, 290, 292, 291, 280, 290, 283, 105, 80, 263,
270, 257, 260, 82, 254, 255, 261, 262, 75, 246,
0, 254, 102, 0, 244, 256, 255, 254, 245, 252,
237, 250, 236, 97, 236, 234, 247, 239, 236, 260,
255, 258, 267, 263, 264, 245, 130, 260, 248, 234,
237, 228, 226, 228, 218, 228, 231, 0, 226, 0,
211, 211, 0, 211, 214, 109, 218, 212, 215, 0,
0, 212, 206, 205, 202, 206, 202, 203, 0, 207,
202, 91, 200, 198, 194, 206, 0, 205, 202, 0,
0, 227, 227, 227, 221, 223, 219, 217, 220, 223,
214, 197, 188, 0, 0, 191, 0, 194, 185, 180,
174, 174, 0, 172, 188, 166, 186, 0, 166, 181,
175, 0, 0, 177, 162, 168, 174, 166, 171, 164,
160, 165, 158, 157, 160, 0, 166, 0, 185, 182,
187, 188, 174, 173, 181, 183, 168, 157, 149, 159,
154, 146, 138, 150, 0, 148, 136, 134, 133, 0,
0, 133, 0, 0, 0, 138, 144, 0, 0, 0,
0, 0, 0, 0, 131, 154, 0, 166, 0, 0,
0, 0, 0, 163, 0, 0, 116, 0, 0, 0,
0, 0, 137, 0, 131, 118, 121, 0, 0, 0,
142, 0, 127, 105, 125, 0, 0, 0, 108, 0,
106, 102, 95, 86, 90, 0, 86, 0, 0, 0,
369, 173, 176, 103, 179, 182
} ;
static yyconst flex_int16_t yy_def[337] =
{ 0,
331, 1, 332, 332, 331, 331, 331, 331, 331, 331,
331, 331, 333, 331, 331, 331, 331, 331, 331, 331,
331, 331, 334, 334, 334, 334, 331, 334, 334, 334,
334, 334, 334, 334, 334, 334, 334, 334, 334, 334,
334, 334, 334, 334, 331, 335, 331, 331, 336, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 331, 334, 334, 334,
334, 334, 334, 331, 334, 334, 334, 334, 334, 334,
334, 334, 334, 334, 334, 334, 334, 334, 334, 334,
334, 334, 334, 334, 334, 334, 334, 334, 334, 334,
334, 334, 331, 331, 335, 331, 331, 331, 331, 331,
334, 334, 334, 334, 334, 334, 334, 334, 334, 334,
334, 334, 334, 334, 334, 334, 334, 334, 334, 334,
334, 334, 334, 334, 334, 334, 334, 334, 334, 334,
334, 334, 334, 334, 334, 334, 334, 334, 334, 334,
334, 334, 334, 334, 334, 334, 334, 334, 334, 334,
334, 334, 334, 334, 334, 334, 334, 334, 334, 334,
334, 334, 334, 334, 334, 334, 334, 334, 334, 334,
334, 334, 334, 334, 334, 334, 334, 334, 334, 334,
334, 334, 334, 334, 334, 334, 334, 334, 334, 334,
334, 334, 334, 334, 334, 334, 334, 334, 334, 334,
334, 334, 334, 334, 334, 334, 334, 334, 334, 334,
334, 334, 334, 334, 334, 334, 334, 334, 334, 334,
334, 334, 334, 334, 334, 334, 334, 334, 334, 334,
334, 334, 334, 334, 334, 334, 334, 334, 334, 334,
334, 334, 334, 334, 334, 334, 334, 334, 334, 334,
334, 334, 334, 334, 334, 334, 334, 334, 334, 334,
334, 334, 334, 334, 334, 334, 334, 334, 334, 334,
334, 334, 334, 334, 334, 334, 334, 334, 334, 334,
334, 334, 334, 334, 334, 334, 334, 334, 334, 334,
334, 334, 334, 334, 334, 334, 334, 334, 334, 334,
334, 334, 334, 334, 334, 334, 334, 334, 334, 334,
334, 334, 334, 334, 334, 334, 334, 334, 334, 334,
0, 331, 331, 331, 331, 331
} ;
static yyconst flex_int16_t yy_nxt[437] =
{ 0,
6, 7, 8, 9, 10, 6, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 23,
23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
23, 24, 25, 23, 26, 23, 23, 23, 23, 6,
27, 23, 28, 29, 30, 23, 31, 32, 33, 23,
34, 23, 35, 36, 37, 38, 39, 40, 41, 23,
23, 42, 43, 23, 44, 23, 45, 48, 48, 52,
56, 78, 58, 61, 61, 79, 57, 59, 53, 61,
61, 63, 64, 66, 67, 87, 69, 75, 76, 80,
103, 83, 88, 70, 61, 61, 128, 81, 84, 85,
129, 96, 49, 49, 71, 68, 93, 143, 82, 94,
97, 98, 108, 108, 112, 99, 116, 113, 122, 114,
126, 123, 144, 62, 108, 108, 117, 156, 157, 160,
115, 166, 127, 172, 173, 330, 329, 240, 158, 161,
104, 167, 159, 176, 190, 328, 177, 191, 178, 192,
207, 208, 225, 241, 327, 226, 193, 194, 179, 313,
180, 326, 314, 209, 325, 227, 324, 323, 322, 321,
320, 319, 315, 47, 47, 47, 54, 318, 54, 105,
317, 105, 106, 316, 106, 312, 311, 310, 309, 308,
307, 306, 305, 304, 303, 302, 301, 300, 299, 298,
297, 296, 295, 294, 293, 292, 291, 290, 289, 288,
287, 286, 285, 284, 283, 282, 281, 280, 279, 278,
277, 276, 275, 274, 273, 272, 271, 270, 269, 268,
267, 266, 265, 264, 263, 262, 261, 260, 259, 258,
257, 256, 255, 254, 253, 252, 251, 250, 249, 248,
247, 246, 245, 244, 243, 242, 239, 238, 237, 236,
235, 234, 233, 232, 231, 230, 229, 228, 224, 223,
222, 221, 220, 219, 218, 217, 216, 215, 214, 213,
212, 211, 210, 206, 205, 204, 203, 202, 201, 200,
199, 198, 197, 196, 195, 189, 188, 187, 186, 185,
184, 183, 182, 181, 175, 174, 171, 170, 169, 168,
165, 164, 163, 162, 155, 154, 153, 152, 151, 150,
149, 148, 147, 146, 145, 142, 141, 140, 139, 138,
137, 136, 135, 134, 133, 132, 131, 130, 125, 124,
121, 120, 119, 118, 111, 110, 109, 107, 102, 101,
100, 95, 92, 91, 90, 89, 86, 77, 74, 73,
72, 65, 60, 55, 51, 50, 331, 46, 5, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331
} ;
static yyconst flex_int16_t yy_chk[437] =
{ 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, 3, 4, 12,
15, 30, 16, 18, 18, 30, 15, 16, 12, 19,
19, 20, 20, 22, 22, 34, 24, 28, 28, 31,
45, 32, 34, 24, 61, 61, 82, 31, 32, 32,
82, 41, 3, 4, 24, 334, 39, 97, 31, 39,
41, 41, 62, 62, 71, 41, 72, 71, 78, 71,
81, 78, 97, 18, 108, 108, 72, 118, 118, 119,
71, 124, 81, 129, 129, 327, 325, 192, 118, 119,
45, 124, 118, 133, 144, 324, 133, 144, 133, 144,
157, 157, 176, 192, 323, 176, 144, 144, 133, 297,
133, 322, 297, 157, 321, 176, 319, 315, 314, 313,
311, 307, 297, 332, 332, 332, 333, 306, 333, 335,
305, 335, 336, 303, 336, 294, 288, 286, 285, 277,
276, 272, 269, 268, 267, 266, 264, 263, 262, 261,
260, 259, 258, 257, 256, 255, 254, 253, 252, 251,
250, 249, 247, 245, 244, 243, 242, 241, 240, 239,
238, 237, 236, 235, 234, 231, 230, 229, 227, 226,
225, 224, 222, 221, 220, 219, 218, 216, 213, 212,
211, 210, 209, 208, 207, 206, 205, 204, 203, 202,
199, 198, 196, 195, 194, 193, 191, 190, 188, 187,
186, 185, 184, 183, 182, 179, 178, 177, 175, 174,
172, 171, 169, 167, 166, 165, 164, 163, 162, 161,
160, 159, 158, 156, 155, 154, 153, 152, 151, 150,
149, 148, 147, 146, 145, 143, 142, 141, 140, 139,
138, 137, 136, 135, 132, 130, 128, 127, 126, 125,
123, 122, 121, 120, 117, 116, 115, 114, 113, 112,
102, 101, 100, 99, 98, 96, 95, 94, 93, 92,
91, 90, 89, 88, 86, 85, 84, 83, 80, 79,
77, 76, 75, 73, 69, 67, 63, 54, 44, 43,
42, 40, 38, 37, 36, 35, 33, 29, 27, 26,
25, 21, 17, 14, 11, 9, 5, 2, 331, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331
} ;
static yy_state_type yy_last_accepting_state;
static char *yy_last_accepting_cpos;
extern int yy_flex_debug;
int yy_flex_debug = 0;
/* The intent behind this definition is that it'll catch
* any uses of REJECT which flex missed.
*/
#define REJECT reject_used_but_not_detected
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
char *yytext;
#line 1 "lexer"
#line 2 "lexer"
/*
L E X E R
*/
#include "iccomp.h"
#include "parser.h"
#ifndef fileno
int fileno(FILE *stream);
#endif
#undef YY_INPUT
#define YY_INPUT(buf,result,max_size) result = yylex_input(buf, max_size);
#ifdef unput
/* If this stops working, have a look at lexer2.c to see what was */
/* changed in the flex-implementation */
static void yyunput (int c,char *buf_ptr );
void (*unusedUnput)(int c,char *buf_ptr) = &yyunput;
#endif
#line 682 "lexer.c"
#define INITIAL 0
#define str 1
#ifndef YY_NO_UNISTD_H
/* Special case for "unistd.h", since it is non-ANSI. We include it way
* down here because we want the user's section 1 to have been scanned first.
* The user has a chance to override it with an option.
*/
#include
#endif
#ifndef YY_EXTRA_TYPE
#define YY_EXTRA_TYPE void *
#endif
static int yy_init_globals (void );
/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */
int yylex_destroy (void );
int yyget_debug (void );
void yyset_debug (int debug_flag );
YY_EXTRA_TYPE yyget_extra (void );
void yyset_extra (YY_EXTRA_TYPE user_defined );
FILE *yyget_in (void );
void yyset_in (FILE * in_str );
FILE *yyget_out (void );
void yyset_out (FILE * out_str );
int yyget_leng (void );
char *yyget_text (void );
int yyget_lineno (void );
void yyset_lineno (int line_number );
/* Macros after this point can all be overridden by user definitions in
* section 1.
*/
#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
extern "C" int yywrap (void );
#else
extern int yywrap (void );
#endif
#endif
static void yyunput (int c,char *buf_ptr );
#ifndef yytext_ptr
static void yy_flex_strncpy (char *,yyconst char *,int );
#endif
#ifdef YY_NEED_STRLEN
static int yy_flex_strlen (yyconst char * );
#endif
#ifndef YY_NO_INPUT
#ifdef __cplusplus
static int yyinput (void );
#else
static int input (void );
#endif
#endif
/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
#define YY_READ_BUF_SIZE 8192
#endif
/* Copy whatever the last rule matched to the standard output. */
#ifndef ECHO
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
#define ECHO fwrite( yytext, yyleng, 1, yyout )
#endif
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
* is returned in "result".
*/
#ifndef YY_INPUT
#define YY_INPUT(buf,result,max_size) \
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
size_t n; \
for ( n = 0; n < max_size && \
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
if ( c == '\n' ) \
buf[n++] = (char) c; \
if ( c == EOF && ferror( yyin ) ) \
YY_FATAL_ERROR( "input in flex scanner failed" ); \
result = n; \
} \
else \
{ \
errno=0; \
while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
{ \
if( errno != EINTR) \
{ \
YY_FATAL_ERROR( "input in flex scanner failed" ); \
break; \
} \
errno=0; \
clearerr(yyin); \
} \
}\
\
#endif
/* No semi-colon after return; correct usage is to write "yyterminate();" -
* we don't want an extra ';' after the "return" because that will cause
* some compilers to complain about unreachable statements.
*/
#ifndef yyterminate
#define yyterminate() return YY_NULL
#endif
/* Number of entries by which start-condition stack grows. */
#ifndef YY_START_STACK_INCR
#define YY_START_STACK_INCR 25
#endif
/* Report a fatal error. */
#ifndef YY_FATAL_ERROR
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
#endif
/* end tables serialization structures and prototypes */
/* Default declaration of generated scanner - a define so the user can
* easily add parameters.
*/
#ifndef YY_DECL
#define YY_DECL_IS_OURS 1
extern int yylex (void);
#define YY_DECL int yylex (void)
#endif /* !YY_DECL */
/* Code executed at the beginning of each rule, after yytext and yyleng
* have been set up.
*/
#ifndef YY_USER_ACTION
#define YY_USER_ACTION
#endif
/* Code executed at the end of each rule. */
#ifndef YY_BREAK
#define YY_BREAK break;
#endif
#define YY_RULE_SETUP \
if ( yyleng > 0 ) \
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
(yytext[yyleng - 1] == '\n'); \
YY_USER_ACTION
/** The main scanner function which does all the work.
*/
YY_DECL
{
register yy_state_type yy_current_state;
register char *yy_cp, *yy_bp;
register int yy_act;
#line 28 "lexer"
#line 871 "lexer.c"
if ( !(yy_init) )
{
(yy_init) = 1;
#ifdef YY_USER_INIT
YY_USER_INIT;
#endif
if ( ! (yy_start) )
(yy_start) = 1; /* first start state */
if ( ! yyin )
yyin = stdin;
if ( ! yyout )
yyout = stdout;
if ( ! YY_CURRENT_BUFFER ) {
yyensure_buffer_stack ();
YY_CURRENT_BUFFER_LVALUE =
yy_create_buffer(yyin,YY_BUF_SIZE );
}
yy_load_buffer_state( );
}
while ( 1 ) /* loops until end-of-file is reached */
{
yy_cp = (yy_c_buf_p);
/* Support of yytext. */
*yy_cp = (yy_hold_char);
/* yy_bp points to the position in yy_ch_buf of the start of
* the current run.
*/
yy_bp = yy_cp;
yy_current_state = (yy_start);
yy_current_state += YY_AT_BOL();
yy_match:
do
{
register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
if ( yy_accept[yy_current_state] )
{
(yy_last_accepting_state) = yy_current_state;
(yy_last_accepting_cpos) = yy_cp;
}
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 332 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp;
}
while ( yy_base[yy_current_state] != 369 );
yy_find_action:
yy_act = yy_accept[yy_current_state];
if ( yy_act == 0 )
{ /* have to back up */
yy_cp = (yy_last_accepting_cpos);
yy_current_state = (yy_last_accepting_state);
yy_act = yy_accept[yy_current_state];
}
YY_DO_BEFORE_ACTION;
do_action: /* This label is used only to access EOF actions. */
switch ( yy_act )
{ /* beginning of action switch */
case 0: /* must back up */
/* undo the effects of YY_DO_BEFORE_ACTION */
*yy_cp = (yy_hold_char);
yy_cp = (yy_last_accepting_cpos);
yy_current_state = (yy_last_accepting_state);
goto yy_find_action;
case 1:
/* rule 1 can match eol */
#line 31 "lexer"
case 2:
/* rule 2 can match eol */
YY_RULE_SETUP
#line 31 "lexer"
{
lexstring = xstrcat(lexstring, yytext);
}
YY_BREAK
case 3:
YY_RULE_SETUP
#line 34 "lexer"
{
BEGIN 0;
if (!stresc(lexstring))
semantic("illegal escape sequence in string");
return(STRING);
}
YY_BREAK
case 4:
YY_RULE_SETUP
#line 40 "lexer"
;
YY_BREAK
case 5:
/* rule 5 can match eol */
YY_RULE_SETUP
#line 41 "lexer"
yylineno++;
YY_BREAK
case 6:
YY_RULE_SETUP
#line 42 "lexer"
{
change_file(yytext + 1);
}
YY_BREAK
case 7:
YY_RULE_SETUP
#line 45 "lexer"
{
lexstring[0] = 0; BEGIN str;
}
YY_BREAK
case 8:
YY_RULE_SETUP
#line 48 "lexer"
{
sprintf(lexstring, "%d%c", yytext[1], 0);
return(NUMBER);
}
YY_BREAK
case 9:
YY_RULE_SETUP
#line 53 "lexer"
{
yylval.type = f_arg_head;
return(ARG_HEAD);
}
YY_BREAK
case 10:
YY_RULE_SETUP
#line 57 "lexer"
{
yylval.type = f_arg_tail;
return(ARG_TAIL);
}
YY_BREAK
case 11:
YY_RULE_SETUP
#line 61 "lexer"
{ /* ascii_int may become ascii_str */
yylval.type = f_ascii_int;
return(ASCII);
}
YY_BREAK
case 12:
YY_RULE_SETUP
#line 65 "lexer"
{
return(BREAK);
}
YY_BREAK
case 13:
YY_RULE_SETUP
#line 68 "lexer"
{
yylval.type = f_chdir;
return(CHDIR);
}
YY_BREAK
case 14:
YY_RULE_SETUP
#line 72 "lexer"
{
yylval.type = f_cmd_tail;
return(CMD_TAIL);
}
YY_BREAK
case 15:
YY_RULE_SETUP
#line 76 "lexer"
{
yylval.type = f_cmd_head;
return(CMD_HEAD);
}
YY_BREAK
case 16:
YY_RULE_SETUP
#line 80 "lexer"
{
yylval.type = f_c_base;
return(C_BASE);
}
YY_BREAK
case 17:
YY_RULE_SETUP
#line 84 "lexer"
{
yylval.type = f_c_ext;
return(C_EXT);
}
YY_BREAK
case 18:
YY_RULE_SETUP
#line 88 "lexer"
{
yylval.type = f_c_path;
return(C_PATH);
}
YY_BREAK
case 19:
YY_RULE_SETUP
#line 92 "lexer"
{
yylval.type = f_fprintf;
return(FPRINTF);
}
YY_BREAK
case 20:
YY_RULE_SETUP
#line 96 "lexer"
{
yylval.type = f_g_base;
return(G_BASE);
}
YY_BREAK
case 21:
YY_RULE_SETUP
#line 100 "lexer"
{
yylval.type = f_g_ext;
return(G_EXT);
}
YY_BREAK
case 22:
YY_RULE_SETUP
#line 104 "lexer"
{
yylval.type = f_g_path;
return(G_PATH);
}
YY_BREAK
case 23:
YY_RULE_SETUP
#line 108 "lexer"
{
yylval.type = f_getch;
return(GETCH);
}
YY_BREAK
case 24:
YY_RULE_SETUP
#line 112 "lexer"
{
yylval.type = f_getpid;
return(GETPID);
}
YY_BREAK
case 25:
YY_RULE_SETUP
#line 116 "lexer"
{
yylval.type = f_gets;
return(GETS);
}
YY_BREAK
case 26:
YY_RULE_SETUP
#line 120 "lexer"
{
yylval.type = f_echo;
return(M_ECHO);
}
YY_BREAK
case 27:
YY_RULE_SETUP
#line 124 "lexer"
{
yylval.type = f_element;
return(ELEMENT);
}
YY_BREAK
case 28:
YY_RULE_SETUP
#line 128 "lexer"
{
return(ELSE);
}
YY_BREAK
case 29:
YY_RULE_SETUP
#line 131 "lexer"
{
yylval.type = f_exec;
return(EXEC);
}
YY_BREAK
case 30:
YY_RULE_SETUP
#line 135 "lexer"
{
yylval.type = f_execute;
return(EXECUTE);
}
YY_BREAK
case 31:
YY_RULE_SETUP
#line 139 "lexer"
{
yylval.type = f_exists;
return(EXISTS);
}
YY_BREAK
case 32:
YY_RULE_SETUP
#line 143 "lexer"
{
yylval.type = op_exit;
return(EXIT);
}
YY_BREAK
case 33:
YY_RULE_SETUP
#line 147 "lexer"
{
yylval.type = f_fgets;
return (FGETS);
}
YY_BREAK
case 34:
YY_RULE_SETUP
#line 151 "lexer"
{
return(FOR);
}
YY_BREAK
case 35:
YY_RULE_SETUP
#line 154 "lexer"
{
yylval.type = f_getenv;
return GETENV;
}
YY_BREAK
case 36:
YY_RULE_SETUP
#line 158 "lexer"
{
return(IF);
}
YY_BREAK
case 37:
YY_RULE_SETUP
#line 161 "lexer"
{
yylval.type = 0; /* 0 == void */
return (VOID);
}
YY_BREAK
case 38:
YY_RULE_SETUP
#line 165 "lexer"
{
yylval.type = e_int;
return(INT);
}
YY_BREAK
case 39:
YY_RULE_SETUP
#line 169 "lexer"
{
yylval.type = e_list;
return(LIST);
}
YY_BREAK
case 40:
YY_RULE_SETUP
#line 173 "lexer"
{
yylval.type = f_makelist;
return(MAKELIST);
}
YY_BREAK
case 41:
YY_RULE_SETUP
#line 177 "lexer"
{
yylval.type = op_older;
return(OLDER);
}
YY_BREAK
case 42:
YY_RULE_SETUP
#line 181 "lexer"
{
yylval.type = f_printf;
return(PRINTF);
}
YY_BREAK
case 43:
YY_RULE_SETUP
#line 185 "lexer"
{
yylval.type = f_putenv;
return (PUTENV);
}
YY_BREAK
case 44:
YY_RULE_SETUP
#line 189 "lexer"
{
yylval.type = op_ret;
return(RETURN);
}
YY_BREAK
case 45:
#line 194 "lexer"
case 46:
YY_RULE_SETUP
#line 194 "lexer"
{
yylval.type = f_sizeoflist;
return(SIZEOFLIST);
}
YY_BREAK
case 47:
YY_RULE_SETUP
#line 198 "lexer"
{
yylval.type = f_stat;
return (STAT);
}
YY_BREAK
case 48:
YY_RULE_SETUP
#line 202 "lexer"
{
yylval.type = e_str;
return(STRINGTYPE);
}
YY_BREAK
case 49:
YY_RULE_SETUP
#line 206 "lexer"
{
yylval.type = f_strlen;
return(STRLEN);
}
YY_BREAK
case 50:
YY_RULE_SETUP
#line 210 "lexer"
{
yylval.type = f_strlwr;
return(STRLWR);
}
YY_BREAK
case 51:
YY_RULE_SETUP
#line 214 "lexer"
{
yylval.type = f_strupr;
return(STRUPR);
}
YY_BREAK
case 52:
YY_RULE_SETUP
#line 218 "lexer"
{
yylval.type = f_fields;
return(FIELDS);
}
YY_BREAK
case 53:
YY_RULE_SETUP
#line 222 "lexer"
{
yylval.type = f_strfind;
return STRFIND;
}
YY_BREAK
case 54:
YY_RULE_SETUP
#line 226 "lexer"
{
yylval.type = f_substr;
return SUBSTR;
}
YY_BREAK
case 55:
YY_RULE_SETUP
#line 230 "lexer"
{
yylval.type = f_system;
return(SYSTEM);
}
YY_BREAK
case 56:
YY_RULE_SETUP
#line 234 "lexer"
{
return(WHILE);
}
YY_BREAK
case 57:
#line 238 "lexer"
case 58:
YY_RULE_SETUP
#line 238 "lexer"
{
yylval.type = op_younger;
return(YOUNGER);
}
YY_BREAK
case 59:
YY_RULE_SETUP
#line 242 "lexer"
{
return(INC);
}
YY_BREAK
case 60:
YY_RULE_SETUP
#line 245 "lexer"
{
return(DEC);
}
YY_BREAK
case 61:
YY_RULE_SETUP
#line 248 "lexer"
{
return(DIV_IS);
}
YY_BREAK
case 62:
YY_RULE_SETUP
#line 251 "lexer"
{
return(MINUS_IS);
}
YY_BREAK
case 63:
YY_RULE_SETUP
#line 254 "lexer"
{
return(MUL_IS);
}
YY_BREAK
case 64:
YY_RULE_SETUP
#line 257 "lexer"
{
return(MOD_IS);
}
YY_BREAK
case 65:
YY_RULE_SETUP
#line 260 "lexer"
{
return(PLUS_IS);
}
YY_BREAK
case 66:
YY_RULE_SETUP
#line 263 "lexer"
{
return(AND_IS);
}
YY_BREAK
case 67:
YY_RULE_SETUP
#line 266 "lexer"
{
return(OR_IS);
}
YY_BREAK
case 68:
YY_RULE_SETUP
#line 269 "lexer"
{
return(XOR_IS);
}
YY_BREAK
case 69:
YY_RULE_SETUP
#line 272 "lexer"
{
return(SHL_IS);
}
YY_BREAK
case 70:
YY_RULE_SETUP
#line 275 "lexer"
{
return(SHR_IS);
}
YY_BREAK
case 71:
YY_RULE_SETUP
#line 278 "lexer"
{
return(OR);
}
YY_BREAK
case 72:
YY_RULE_SETUP
#line 281 "lexer"
{
return(AND);
}
YY_BREAK
case 73:
YY_RULE_SETUP
#line 284 "lexer"
{
return(EQUAL);
}
YY_BREAK
case 74:
YY_RULE_SETUP
#line 287 "lexer"
{
return(NOT_EQUAL);
}
YY_BREAK
case 75:
YY_RULE_SETUP
#line 290 "lexer"
{
return(SMALLER_EQUAL);
}
YY_BREAK
case 76:
YY_RULE_SETUP
#line 293 "lexer"
{
return(GREATER_EQUAL);
}
YY_BREAK
case 77:
YY_RULE_SETUP
#line 296 "lexer"
{
return(SHR);
}
YY_BREAK
case 78:
YY_RULE_SETUP
#line 299 "lexer"
{
return(SHL);
}
YY_BREAK
case 79:
YY_RULE_SETUP
#line 302 "lexer"
{
unsigned value;
sscanf(yytext + 2, "%x", &value);
sprintf(lexstring, "%d", (int)value);
return(NUMBER);
}
YY_BREAK
case 80:
YY_RULE_SETUP
#line 308 "lexer"
{
lexstring = xstrdup(yytext);
return(NUMBER);
}
YY_BREAK
case 81:
#line 313 "lexer"
case 82:
YY_RULE_SETUP
#line 313 "lexer"
{ /* P_CHECK: value in icm.h */
lexstring = xstrdup("0");
return(NUMBER);
}
YY_BREAK
case 83:
#line 318 "lexer"
case 84:
#line 319 "lexer"
case 85:
YY_RULE_SETUP
#line 319 "lexer"
{
lexstring = xstrdup("1");
return(NUMBER);
}
YY_BREAK
case 86:
#line 324 "lexer"
case 87:
#line 325 "lexer"
case 88:
YY_RULE_SETUP
#line 325 "lexer"
{ /* O_DIR: value in icm.h */
lexstring = xstrdup("2");
return(NUMBER);
}
YY_BREAK
case 89:
#line 330 "lexer"
case 90:
YY_RULE_SETUP
#line 330 "lexer"
{ /* O_SUBDIR: value in icm.h */
lexstring = xstrdup("4");
return(NUMBER);
}
YY_BREAK
case 91:
#line 335 "lexer"
case 92:
YY_RULE_SETUP
#line 335 "lexer"
{ /* O_ALL: value in icm.h */
lexstring = xstrdup("8");
return(NUMBER);
}
YY_BREAK
case 93:
YY_RULE_SETUP
#line 339 "lexer"
{
lexstring = xstrdup("16");
return(NUMBER);
}
YY_BREAK
case 94:
YY_RULE_SETUP
#line 343 "lexer"
{
lexstring = xstrdup("32");
return(NUMBER);
}
YY_BREAK
case 95:
YY_RULE_SETUP
#line 347 "lexer"
{
lexstring = xstrdup(yytext);
return(IDENTIFIER);
}
YY_BREAK
case 96:
YY_RULE_SETUP
#line 351 "lexer"
return yytext[0];
YY_BREAK
case 97:
YY_RULE_SETUP
#line 352 "lexer"
ECHO;
YY_BREAK
#line 1638 "lexer.c"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(str):
yyterminate();
case YY_END_OF_BUFFER:
{
/* Amount of text matched not including the EOB char. */
int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
/* Undo the effects of YY_DO_BEFORE_ACTION. */
*yy_cp = (yy_hold_char);
YY_RESTORE_YY_MORE_OFFSET
if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
{
/* We're scanning a new file or input source. It's
* possible that this happened because the user
* just pointed yyin at a new source and called
* yylex(). If so, then we have to assure
* consistency between YY_CURRENT_BUFFER and our
* globals. Here is the right place to do so, because
* this is the first action (other than possibly a
* back-up) that will match for the new input source.
*/
(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
}
/* Note that here we test for yy_c_buf_p "<=" to the position
* of the first EOB in the buffer, since yy_c_buf_p will
* already have been incremented past the NUL character
* (since all states make transitions on EOB to the
* end-of-buffer state). Contrast this with the test
* in input().
*/
if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
{ /* This was really a NUL. */
yy_state_type yy_next_state;
(yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
yy_current_state = yy_get_previous_state( );
/* Okay, we're now positioned to make the NUL
* transition. We couldn't have
* yy_get_previous_state() go ahead and do it
* for us because it doesn't know how to deal
* with the possibility of jamming (and we don't
* want to build jamming into it because then it
* will run more slowly).
*/
yy_next_state = yy_try_NUL_trans( yy_current_state );
yy_bp = (yytext_ptr) + YY_MORE_ADJ;
if ( yy_next_state )
{
/* Consume the NUL. */
yy_cp = ++(yy_c_buf_p);
yy_current_state = yy_next_state;
goto yy_match;
}
else
{
yy_cp = (yy_c_buf_p);
goto yy_find_action;
}
}
else switch ( yy_get_next_buffer( ) )
{
case EOB_ACT_END_OF_FILE:
{
(yy_did_buffer_switch_on_eof) = 0;
if ( yywrap( ) )
{
/* Note: because we've taken care in
* yy_get_next_buffer() to have set up
* yytext, we can now set up
* yy_c_buf_p so that if some total
* hoser (like flex itself) wants to
* call the scanner after we return the
* YY_NULL, it'll still work - another
* YY_NULL will get returned.
*/
(yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
yy_act = YY_STATE_EOF(YY_START);
goto do_action;
}
else
{
if ( ! (yy_did_buffer_switch_on_eof) )
YY_NEW_FILE;
}
break;
}
case EOB_ACT_CONTINUE_SCAN:
(yy_c_buf_p) =
(yytext_ptr) + yy_amount_of_matched_text;
yy_current_state = yy_get_previous_state( );
yy_cp = (yy_c_buf_p);
yy_bp = (yytext_ptr) + YY_MORE_ADJ;
goto yy_match;
case EOB_ACT_LAST_MATCH:
(yy_c_buf_p) =
&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
yy_current_state = yy_get_previous_state( );
yy_cp = (yy_c_buf_p);
yy_bp = (yytext_ptr) + YY_MORE_ADJ;
goto yy_find_action;
}
break;
}
default:
YY_FATAL_ERROR(
"fatal flex scanner internal error--no action found" );
} /* end of action switch */
} /* end of scanning one token */
} /* end of yylex */
/* yy_get_next_buffer - try to read in a new buffer
*
* Returns a code representing an action:
* EOB_ACT_LAST_MATCH -
* EOB_ACT_CONTINUE_SCAN - continue scanning from current position
* EOB_ACT_END_OF_FILE - end of file
*/
static int yy_get_next_buffer (void)
{
register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
register char *source = (yytext_ptr);
register int number_to_move, i;
int ret_val;
if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
YY_FATAL_ERROR(
"fatal flex scanner internal error--end of buffer missed" );
if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
{ /* Don't try to fill the buffer, so this is an EOF. */
if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
{
/* We matched a single character, the EOB, so
* treat this as a final EOF.
*/
return EOB_ACT_END_OF_FILE;
}
else
{
/* We matched some text prior to the EOB, first
* process it.
*/
return EOB_ACT_LAST_MATCH;
}
}
/* Try to read more data. */
/* First move last chars to start of buffer. */
number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
for ( i = 0; i < number_to_move; ++i )
*(dest++) = *(source++);
if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
/* don't do the read, it's not guaranteed to return an EOF,
* just force an EOF
*/
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
else
{
int num_to_read =
YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
while ( num_to_read <= 0 )
{ /* Not enough room in the buffer - grow it. */
/* just a shorter name for the current buffer */
YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
int yy_c_buf_p_offset =
(int) ((yy_c_buf_p) - b->yy_ch_buf);
if ( b->yy_is_our_buffer )
{
int new_size = b->yy_buf_size * 2;
if ( new_size <= 0 )
b->yy_buf_size += b->yy_buf_size / 8;
else
b->yy_buf_size *= 2;
b->yy_ch_buf = (char *)
/* Include room in for 2 EOB chars. */
yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
}
else
/* Can't grow it, we don't own it. */
b->yy_ch_buf = 0;
if ( ! b->yy_ch_buf )
YY_FATAL_ERROR(
"fatal error - scanner input buffer overflow" );
(yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
number_to_move - 1;
}
if ( num_to_read > YY_READ_BUF_SIZE )
num_to_read = YY_READ_BUF_SIZE;
/* Read in more data. */
YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
(yy_n_chars), (size_t) num_to_read );
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
}
if ( (yy_n_chars) == 0 )
{
if ( number_to_move == YY_MORE_ADJ )
{
ret_val = EOB_ACT_END_OF_FILE;
yyrestart(yyin );
}
else
{
ret_val = EOB_ACT_LAST_MATCH;
YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
YY_BUFFER_EOF_PENDING;
}
}
else
ret_val = EOB_ACT_CONTINUE_SCAN;
if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
/* Extend the array by 50%, plus the number we really need. */
yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
}
(yy_n_chars) += number_to_move;
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
(yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
return ret_val;
}
/* yy_get_previous_state - get the state just before the EOB char was reached */
static yy_state_type yy_get_previous_state (void)
{
register yy_state_type yy_current_state;
register char *yy_cp;
yy_current_state = (yy_start);
yy_current_state += YY_AT_BOL();
for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
{
register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
if ( yy_accept[yy_current_state] )
{
(yy_last_accepting_state) = yy_current_state;
(yy_last_accepting_cpos) = yy_cp;
}
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 332 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
}
return yy_current_state;
}
/* yy_try_NUL_trans - try to make a transition on the NUL character
*
* synopsis
* next_state = yy_try_NUL_trans( current_state );
*/
static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
{
register int yy_is_jam;
register char *yy_cp = (yy_c_buf_p);
register YY_CHAR yy_c = 1;
if ( yy_accept[yy_current_state] )
{
(yy_last_accepting_state) = yy_current_state;
(yy_last_accepting_cpos) = yy_cp;
}
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 332 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
yy_is_jam = (yy_current_state == 331);
return yy_is_jam ? 0 : yy_current_state;
}
static void yyunput (int c, register char * yy_bp )
{
register char *yy_cp;
yy_cp = (yy_c_buf_p);
/* undo effects of setting up yytext */
*yy_cp = (yy_hold_char);
if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
{ /* need to shift things up to make room */
/* +2 for EOB chars. */
register int number_to_move = (yy_n_chars) + 2;
register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
register char *source =
&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
*--dest = *--source;
yy_cp += (int) (dest - source);
yy_bp += (int) (dest - source);
YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
YY_FATAL_ERROR( "flex scanner push-back overflow" );
}
*--yy_cp = (char) c;
(yytext_ptr) = yy_bp;
(yy_hold_char) = *yy_cp;
(yy_c_buf_p) = yy_cp;
}
#ifndef YY_NO_INPUT
#ifdef __cplusplus
static int yyinput (void)
#else
static int input (void)
#endif
{
int c;
*(yy_c_buf_p) = (yy_hold_char);
if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
{
/* yy_c_buf_p now points to the character we want to return.
* If this occurs *before* the EOB characters, then it's a
* valid NUL; if not, then we've hit the end of the buffer.
*/
if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
/* This was really a NUL. */
*(yy_c_buf_p) = '\0';
else
{ /* need more input */
int offset = (yy_c_buf_p) - (yytext_ptr);
++(yy_c_buf_p);
switch ( yy_get_next_buffer( ) )
{
case EOB_ACT_LAST_MATCH:
/* This happens because yy_g_n_b()
* sees that we've accumulated a
* token and flags that we need to
* try matching the token before
* proceeding. But for input(),
* there's no matching to consider.
* So convert the EOB_ACT_LAST_MATCH
* to EOB_ACT_END_OF_FILE.
*/
/* Reset buffer status. */
yyrestart(yyin );
/*FALLTHROUGH*/
case EOB_ACT_END_OF_FILE:
{
if ( yywrap( ) )
return EOF;
if ( ! (yy_did_buffer_switch_on_eof) )
YY_NEW_FILE;
#ifdef __cplusplus
return yyinput();
#else
return input();
#endif
}
case EOB_ACT_CONTINUE_SCAN:
(yy_c_buf_p) = (yytext_ptr) + offset;
break;
}
}
}
c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
*(yy_c_buf_p) = '\0'; /* preserve yytext */
(yy_hold_char) = *++(yy_c_buf_p);
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
return c;
}
#endif /* ifndef YY_NO_INPUT */
/** Immediately switch to a different input stream.
* @param input_file A readable stream.
*
* @note This function does not reset the start condition to @c INITIAL .
*/
void yyrestart (FILE * input_file )
{
if ( ! YY_CURRENT_BUFFER ){
yyensure_buffer_stack ();
YY_CURRENT_BUFFER_LVALUE =
yy_create_buffer(yyin,YY_BUF_SIZE );
}
yy_init_buffer(YY_CURRENT_BUFFER,input_file );
yy_load_buffer_state( );
}
/** Switch to a different input buffer.
* @param new_buffer The new input buffer.
*
*/
void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
{
/* TODO. We should be able to replace this entire function body
* with
* yypop_buffer_state();
* yypush_buffer_state(new_buffer);
*/
yyensure_buffer_stack ();
if ( YY_CURRENT_BUFFER == new_buffer )
return;
if ( YY_CURRENT_BUFFER )
{
/* Flush out information for old buffer. */
*(yy_c_buf_p) = (yy_hold_char);
YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
}
YY_CURRENT_BUFFER_LVALUE = new_buffer;
yy_load_buffer_state( );
/* We don't actually know whether we did this switch during
* EOF (yywrap()) processing, but the only time this flag
* is looked at is after yywrap() is called, so it's safe
* to go ahead and always set it.
*/
(yy_did_buffer_switch_on_eof) = 1;
}
static void yy_load_buffer_state (void)
{
(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
(yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
(yy_hold_char) = *(yy_c_buf_p);
}
/** Allocate and initialize an input buffer state.
* @param file A readable stream.
* @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
*
* @return the allocated buffer state.
*/
YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
{
YY_BUFFER_STATE b;
b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
b->yy_buf_size = size;
/* yy_ch_buf has to be 2 characters longer than the size given because
* we need to put in 2 end-of-buffer characters.
*/
b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
if ( ! b->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
b->yy_is_our_buffer = 1;
yy_init_buffer(b,file );
return b;
}
/** Destroy the buffer.
* @param b a buffer created with yy_create_buffer()
*
*/
void yy_delete_buffer (YY_BUFFER_STATE b )
{
if ( ! b )
return;
if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
if ( b->yy_is_our_buffer )
yyfree((void *) b->yy_ch_buf );
yyfree((void *) b );
}
#ifndef __cplusplus
extern int isatty (int );
#endif /* __cplusplus */
/* Initializes or reinitializes a buffer.
* This function is sometimes called more than once on the same buffer,
* such as during a yyrestart() or at EOF.
*/
static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
{
int oerrno = errno;
yy_flush_buffer(b );
b->yy_input_file = file;
b->yy_fill_buffer = 1;
/* If b is the current buffer, then yy_init_buffer was _probably_
* called from yyrestart() or through yy_get_next_buffer.
* In that case, we don't want to reset the lineno or column.
*/
if (b != YY_CURRENT_BUFFER){
b->yy_bs_lineno = 1;
b->yy_bs_column = 0;
}
b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
errno = oerrno;
}
/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
* @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
*
*/
void yy_flush_buffer (YY_BUFFER_STATE b )
{
if ( ! b )
return;
b->yy_n_chars = 0;
/* We always need two end-of-buffer characters. The first causes
* a transition to the end-of-buffer state. The second causes
* a jam in that state.
*/
b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
b->yy_buf_pos = &b->yy_ch_buf[0];
b->yy_at_bol = 1;
b->yy_buffer_status = YY_BUFFER_NEW;
if ( b == YY_CURRENT_BUFFER )
yy_load_buffer_state( );
}
/** Pushes the new state onto the stack. The new state becomes
* the current state. This function will allocate the stack
* if necessary.
* @param new_buffer The new state.
*
*/
void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
{
if (new_buffer == NULL)
return;
yyensure_buffer_stack();
/* This block is copied from yy_switch_to_buffer. */
if ( YY_CURRENT_BUFFER )
{
/* Flush out information for old buffer. */
*(yy_c_buf_p) = (yy_hold_char);
YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
}
/* Only push if top exists. Otherwise, replace top. */
if (YY_CURRENT_BUFFER)
(yy_buffer_stack_top)++;
YY_CURRENT_BUFFER_LVALUE = new_buffer;
/* copied from yy_switch_to_buffer. */
yy_load_buffer_state( );
(yy_did_buffer_switch_on_eof) = 1;
}
/** Removes and deletes the top of the stack, if present.
* The next element becomes the new top.
*
*/
void yypop_buffer_state (void)
{
if (!YY_CURRENT_BUFFER)
return;
yy_delete_buffer(YY_CURRENT_BUFFER );
YY_CURRENT_BUFFER_LVALUE = NULL;
if ((yy_buffer_stack_top) > 0)
--(yy_buffer_stack_top);
if (YY_CURRENT_BUFFER) {
yy_load_buffer_state( );
(yy_did_buffer_switch_on_eof) = 1;
}
}
/* Allocates the stack if it does not exist.
* Guarantees space for at least one push.
*/
static void yyensure_buffer_stack (void)
{
int num_to_alloc;
if (!(yy_buffer_stack)) {
/* First allocation is just for 2 elements, since we don't know if this
* scanner will even need a stack. We use 2 instead of 1 to avoid an
* immediate realloc on the next call.
*/
num_to_alloc = 1;
(yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
(num_to_alloc * sizeof(struct yy_buffer_state*)
);
if ( ! (yy_buffer_stack) )
YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
(yy_buffer_stack_max) = num_to_alloc;
(yy_buffer_stack_top) = 0;
return;
}
if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
/* Increase the buffer to prepare for a possible push. */
int grow_size = 8 /* arbitrary grow size */;
num_to_alloc = (yy_buffer_stack_max) + grow_size;
(yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
((yy_buffer_stack),
num_to_alloc * sizeof(struct yy_buffer_state*)
);
if ( ! (yy_buffer_stack) )
YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
/* zero only the new slots.*/
memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
(yy_buffer_stack_max) = num_to_alloc;
}
}
/** Setup the input buffer state to scan directly from a user-specified character buffer.
* @param base the character buffer
* @param size the size in bytes of the character buffer
*
* @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
{
YY_BUFFER_STATE b;
if ( size < 2 ||
base[size-2] != YY_END_OF_BUFFER_CHAR ||
base[size-1] != YY_END_OF_BUFFER_CHAR )
/* They forgot to leave room for the EOB's. */
return 0;
b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
b->yy_buf_pos = b->yy_ch_buf = base;
b->yy_is_our_buffer = 0;
b->yy_input_file = 0;
b->yy_n_chars = b->yy_buf_size;
b->yy_is_interactive = 0;
b->yy_at_bol = 1;
b->yy_fill_buffer = 0;
b->yy_buffer_status = YY_BUFFER_NEW;
yy_switch_to_buffer(b );
return b;
}
/** Setup the input buffer state to scan a string. The next call to yylex() will
* scan from a @e copy of @a str.
* @param yystr a NUL-terminated string to scan
*
* @return the newly allocated buffer state object.
* @note If you want to scan bytes that may contain NUL values, then use
* yy_scan_bytes() instead.
*/
YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
{
return yy_scan_bytes(yystr,strlen(yystr) );
}
/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
* scan from a @e copy of @a bytes.
* @param bytes the byte buffer to scan
* @param len the number of bytes in the buffer pointed to by @a bytes.
*
* @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
{
YY_BUFFER_STATE b;
char *buf;
yy_size_t n;
int i;
/* Get memory for full buffer, including space for trailing EOB's. */
n = _yybytes_len + 2;
buf = (char *) yyalloc(n );
if ( ! buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
for ( i = 0; i < _yybytes_len; ++i )
buf[i] = yybytes[i];
buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
b = yy_scan_buffer(buf,n );
if ( ! b )
YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
/* It's okay to grow etc. this buffer, and we should throw it
* away when we're done.
*/
b->yy_is_our_buffer = 1;
return b;
}
#ifndef YY_EXIT_FAILURE
#define YY_EXIT_FAILURE 2
#endif
static void yy_fatal_error (yyconst char* msg )
{
(void) fprintf( stderr, "%s\n", msg );
exit( YY_EXIT_FAILURE );
}
/* Redefine yyless() so it works in section 3 code. */
#undef yyless
#define yyless(n) \
do \
{ \
/* Undo effects of setting up yytext. */ \
int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\
yytext[yyleng] = (yy_hold_char); \
(yy_c_buf_p) = yytext + yyless_macro_arg; \
(yy_hold_char) = *(yy_c_buf_p); \
*(yy_c_buf_p) = '\0'; \
yyleng = yyless_macro_arg; \
} \
while ( 0 )
/* Accessor methods (get/set functions) to struct members. */
/** Get the current line number.
*
*/
int yyget_lineno (void)
{
return yylineno;
}
/** Get the input stream.
*
*/
FILE *yyget_in (void)
{
return yyin;
}
/** Get the output stream.
*
*/
FILE *yyget_out (void)
{
return yyout;
}
/** Get the length of the current token.
*
*/
int yyget_leng (void)
{
return yyleng;
}
/** Get the current token.
*
*/
char *yyget_text (void)
{
return yytext;
}
/** Set the current line number.
* @param line_number
*
*/
void yyset_lineno (int line_number )
{
yylineno = line_number;
}
/** Set the input stream. This does not discard the current
* input buffer.
* @param in_str A readable stream.
*
* @see yy_switch_to_buffer
*/
void yyset_in (FILE * in_str )
{
yyin = in_str ;
}
void yyset_out (FILE * out_str )
{
yyout = out_str ;
}
int yyget_debug (void)
{
return yy_flex_debug;
}
void yyset_debug (int bdebug )
{
yy_flex_debug = bdebug ;
}
static int yy_init_globals (void)
{
/* Initialization is the same as for the non-reentrant scanner.
* This function is called from yylex_destroy(), so don't allocate here.
*/
(yy_buffer_stack) = 0;
(yy_buffer_stack_top) = 0;
(yy_buffer_stack_max) = 0;
(yy_c_buf_p) = (char *) 0;
(yy_init) = 0;
(yy_start) = 0;
/* Defined in main.c */
#ifdef YY_STDINIT
yyin = stdin;
yyout = stdout;
#else
yyin = (FILE *) 0;
yyout = (FILE *) 0;
#endif
/* For future reference: Set errno on error, since we are called by
* yylex_init()
*/
return 0;
}
/* yylex_destroy is for both reentrant and non-reentrant scanners. */
int yylex_destroy (void)
{
/* Pop the buffer stack, destroying each element. */
while(YY_CURRENT_BUFFER){
yy_delete_buffer(YY_CURRENT_BUFFER );
YY_CURRENT_BUFFER_LVALUE = NULL;
yypop_buffer_state();
}
/* Destroy the stack itself. */
yyfree((yy_buffer_stack) );
(yy_buffer_stack) = NULL;
/* Reset the globals. This is important in a non-reentrant scanner so the next time
* yylex() is called, initialization will occur. */
yy_init_globals( );
return 0;
}
/*
* Internal utility routines.
*/
#ifndef yytext_ptr
static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
{
register int i;
for ( i = 0; i < n; ++i )
s1[i] = s2[i];
}
#endif
#ifdef YY_NEED_STRLEN
static int yy_flex_strlen (yyconst char * s )
{
register int n;
for ( n = 0; s[n]; ++n )
;
return n;
}
#endif
void *yyalloc (yy_size_t size )
{
return (void *) malloc( size );
}
void *yyrealloc (void * ptr, yy_size_t size )
{
/* The cast to (char *) in the following accommodates both
* implementations that use char* generic pointers, and those
* that use void* generic pointers. It works with the latter
* because both ANSI C and C++ allow castless assignment from
* any pointer type to void*, and deal with argument conversions
* as though doing an assignment.
*/
return (void *) realloc( (char *) ptr, size );
}
void yyfree (void * ptr )
{
free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
}
#define YYTABLES_NAME "yytables"
#line 352 "lexer"
icmake-7.21.01/comp/etoc.c 0000644 0001750 0001750 00000002715 12000542231 014125 0 ustar frank frank /*
E T O C . C
Convert expression to pure code
*/
#include "iccomp.h"
void etoc(ESTRUC_ *e)
{
ESTRUC_ pre;
switch
(
test_type
(
e,
e_const | e_var | e_bool | e_reg |
e_pre_inc_dec | e_post_inc_dec
)
)
{
case e_const:
gencode(e,
test_type(e, e_int) ?
op_push_imm
:
op_push_strconst,
e->evalue);
break;
case e_var:
if (!e->codelen)
gencode(e, op_push_var, e->evalue);
break;
case e_bool:
patchup_true(e, 1);
gencode(e, op_push_1_jmp_end);
patchup_false(e, 1);
gencode(e, op_push_0);
set_type(e, e_int);
break;
case e_reg:
gencode(e, op_push_reg);
break;
case e_post_inc_dec:
pre = *stackframe(0);
gencode(&pre, op_push_var, e->evalue);
*e = *catcode(&pre, e); /* prefix push before var++, var-- */
break;
case e_pre_inc_dec: /* append push after ++var, --var */
gencode(e, op_push_var, e->evalue);
break;
}
down_type(e, e_const | e_var | e_bool | e_reg |
e_pre_inc_dec | e_post_inc_dec);
up_type(e, e_code);
}
icmake-7.21.01/comp/laststmn.c 0000644 0001750 0001750 00000000334 12000542231 015033 0 ustar frank frank /*
L A S T S T M N . C
*/
#include "iccomp.h"
void last_stmnt(lval)
ESTRUC_
*lval;
{
patchup_false(lval, 1);
outbin(lval->code, lval->codelen);
discard(lval);
}
icmake-7.21.01/comp/xor.c 0000644 0001750 0001750 00000001223 12000542231 013774 0 ustar frank frank /*
X O R . C
*/
#include "iccomp.h"
ESTRUC_ *xor (lval, rval)
ESTRUC_
*lval,
*rval;
{
if (test_binop(op_xor, lval, rval))
return (lval); /* test for correct types */
btoi(lval); /* convert pending booleans */
btoi(rval);
if (conflict(lval, rval, op_xor)) /* test type conflict */
return(lval);
if ((lval->type & rval->type & (size_t)~ALLTYPES) == e_const)
lval->evalue ^= rval->evalue;
else
defcode(lval, rval, op_xor);
return (lval); /* return new expression */
}
icmake-7.21.01/comp/hiddenfu.c 0000644 0001750 0001750 00000007006 12000542231 014757 0 ustar frank frank /*
H I D D E N F U . C
*/
#include "iccomp.h"
static int next_call(void)
{
register int
opcode;
switch (opcode = getopcode(s_bin))
{
case op_push_imm:
case op_jmp:
case op_jmp_false:
case op_jmp_true:
case op_push_strconst:
case op_push_var:
case op_pop_var:
case op_copy_var:
case op_inc:
case op_dec:
fseek(s_bin, sizeof(INT16), SEEK_CUR);
return (0); /* close, but no cigar */
case op_push_1_jmp_end:
case op_call_rss:
case op_asp:
fseek(s_bin, sizeof(char), SEEK_CUR);
return (0); /* close, but no cigar */
case op_push_0:
case op_push_reg:
case op_umin:
case op_atoi:
case op_itoa:
case op_atol:
case op_mul:
case op_div:
case op_mod:
case op_add:
case op_sub:
case op_eq:
case op_neq:
case op_sm:
case op_gr:
case op_younger:
case op_older:
case op_smeq:
case op_greq:
case op_exit:
case op_ret:
case op_band:
case op_bor:
case op_bnot:
case op_xor:
case op_shl:
case op_shr:
case op_pop_reg:
/* no argument with opcodes */
return (0); /* close, but no cigar */
case op_call:
return (1); /* cigar! check this argument */
case op_frame: /* next byte: # bytes to skip */
fseek(s_bin, (int)getopcode(s_bin), SEEK_CUR);
return (0); /* close, but no cigar */
default:
printf("\n"
"at offset 0x%lx: @#$%%!!\n"
"*INTERNAL ICM-COMP COMPILER ERROR*\n"
"In function hidden_functions(): unrecognized opcode while\n"
"patching up (hidden-)function calls.\n"
"Found opcode: 0x%x.\n"
"Please inform the ICCE ICMAKE (Z-side) support group\n"
"\n"
"THE BIM-FILE IS INVALID AND SHOULD *NOT* BE USED\n"
, ftell(s_bin)
, opcode
);
}
return (0);
}
void hidden_functions()
{
long
eof;
register int
fun;
if (!hidden_called)
return; /* no hidden calls: nothing to do */
eof = ftell(s_bin); /* remember the eof position */
/* go to begin of code */
fseek(s_bin, sizeof(BIN_HEADER_), SEEK_SET);
while (ftell(s_bin) < eof) /* continue until code processed */
{
if (next_call()) /* find function call */
{
fun = -getint16(s_bin); /* get the address (toggled sign) */
if (fun >= 0) /* hidden function */
{ /* reset to patchup */
fseek(s_bin, -(long)sizeof(INT16), SEEK_CUR);
lexstring = xstrdup(hidden[fun].name);
/* update the function's address */
outbin(&(funtab.symbol[fetchfun()].var.vu.i->count),
sizeof(INT16));
fseek(s_bin, 0, SEEK_CUR); /* ready to read again */
}
}
}
}
icmake-7.21.01/comp/smaller.c 0000644 0001750 0001750 00000001724 12000542231 014631 0 ustar frank frank /*
S M A L L E R . C
*/
#include "iccomp.h"
ESTRUC_ *smaller (lval, rval)
ESTRUC_
*lval,
*rval;
{
btoi(lval); /* convert boolean to i */
btoi(rval);
if (conflict(lval, rval, op_sm)) /* test type conflict */
return(lval);
if ((lval->type & rval->type & (size_t)~ALLTYPES) == e_const)
{
if (test_type(lval, e_int))
lval->evalue = (lval->evalue < rval->evalue);
else
{
lval->evalue =
(
strcmp
(
stringtab[lval->evalue].string,
stringtab[rval->evalue].string
)
) < 0;
set_type(lval, e_int | e_const);
}
}
else
defcode(lval, rval, op_sm);
return (lval); /* return new expression */
}
icmake-7.21.01/comp/outbin.c 0000644 0001750 0001750 00000000456 12000542231 014473 0 ustar frank frank /*
O U T B I N . C
*/
#include "iccomp.h"
void outbin(source, size)
void
*source;
size_t
size;
{
if
(
size
&&
!fwrite(source, size * sizeof(INT8), 1, s_bin)
)
error("Error in writing binary file");
}
icmake-7.21.01/comp/catstrin.c 0000644 0001750 0001750 00000001360 12000542231 015015 0 ustar frank frank /*
C A T S T R I N . C
*/
#include "iccomp.h"
void catstrings(lval, rval)
ESTRUC_
*lval,
*rval;
{
char
*cp;
register size_t
l_len,
r_len;
l_len = strlen( stringtab[ lval->evalue ].string );
r_len = strlen( stringtab[ rval->evalue ].string );
cp = xrealloc(NULL, l_len + r_len + 1); /* room for catenated string */
lval->evalue =
lookstring
(
strcat /* catenate two strings */
(
strcpy(cp, stringtab[lval->evalue].string),
stringtab[rval->evalue].string
)
);
free(cp); /* free intermediate memory */
}
icmake-7.21.01/comp/fetchvar.c 0000644 0001750 0001750 00000003346 12000542231 014776 0 ustar frank frank /*
F E T C H V A R . C
Frame organization:
Low address
Local x <- Var 0xbffc = 0xbfff - x
Local ... <- Var 0xbffd = 0xbfff - ...
Local 1 <- Var 0xbffe = 0xbfff - 1
Local 0 <- Var 0xbfff = 0xbfff - 0
Old BP <- Var 0xc000
RA <- Var 0xc001
parameters: Par 0 <- Var 0xc002 = 0xc002 + 0
Par 1 <- Var 0xc003 = 0xc002 + 1
...
High Address
*/
#include "iccomp.h"
static ESTRUC_ ret;
ESTRUC_ *fetchvar()
{
register size_t
idx;
E_TYPE_
type = 0;
ret = *stackframe(0);
if (initialization)
{
semantic(init_expr_not_const);
return &ret;
}
/* not a local variable ? */
if ((idx = looksym(&local)) == local.n_defined)
{ /* not a global variable ? */
if ((idx = looksym(&global)) == global.n_defined)
{
idx = 0xffff;
semantic("%s undefined", lexstring);
}
else
type = global.symbol[idx].var.type;
}
else
{
type = local.symbol[idx].var.type;
if (idx < n_params) /* Parameters: */
idx += 0xc002;
else /* Locals: */
idx = 0xbfff - (idx - n_params);
}
if (idx != 0xffff)
{
ret.evalue = idx; /* set idx and type */
ret.type = type;
}
return &ret; /* return the frame */
}
icmake-7.21.01/comp/optintst.c 0000644 0001750 0001750 00000002410 12000542231 015047 0 ustar frank frank /*
O P T I N T S T . C
*/
#include "iccomp.h"
ESTRUC_ *optint_string(type, larg, rarg)
E_TYPE_
type;
ESTRUC_
*larg,
*rarg;
{
etoc(larg); /* argument to stack */
if
(
test_type(larg, e_str) /* left is string */
&&
!rarg->type /* right is zeroframe */
) /* -> P_CHECK implied */
{
rarg->type = e_int | e_const; /* indicate constant */
rarg->evalue = P_CHECK; /* indicate P_CHECK */
etoc(rarg); /* right arg now code */
catcode(larg, rarg); /* catenate code */
}
else if
(
test_type(larg, e_int) /* left is int: explicit check */
&&
test_type(rarg, e_str) /* right must be string */
)
{
etoc(rarg); /* right arg to code */
catcode(rarg, larg);
larg = rarg;
}
else
{
semantic(type_conflict, funstring[type]);
discard (rarg);
return (larg);
}
callrss(larg, type); /* call the function */
return (larg);
}
icmake-7.21.01/comp/lookstri.c 0000644 0001750 0001750 00000001606 12000542231 015037 0 ustar frank frank /*
L O O K S T R I . C
Lookup (and maybe enter) a string
*/
#include "iccomp.h"
static size_t
n_allocated;
size_t lookstring(s)
char *s;
{
register size_t
idx;
for (idx = 0; idx < n_strings; idx++)
if (!strcmp(stringtab[idx].string, s)) /* string found ? */
return (idx); /* return string idx */
if (n_allocated == n_strings) /* full table */
stringtab = xrealloc(stringtab,
(n_allocated += 20) * sizeof(STRINGTAB_));
/* set the string in memory */
stringtab[n_strings].string = xstrdup(s);
stringtab[n_strings].index = stringsize;
stringsize += strlen(s) + 1;
n_strings++; /* next free */
return (idx); /* return string idx */
}
icmake-7.21.01/comp/orboolea.c 0000644 0001750 0001750 00000001525 12000542231 014773 0 ustar frank frank /*
O R B O O L E A . C
*/
#include "iccomp.h"
ESTRUC_ *or_boolean(lexp, rexp)
ESTRUC_
*lexp,
*rexp;
{
if (lexp->type & rexp->type & e_const) /* two constants: compute result */
{
lexp->evalue =
(test_type(lexp, e_str) || lexp->evalue)
||
(test_type(rexp, e_str) || rexp->evalue);
set_type(lexp, e_const | e_int);
}
else /* at least one code-part */
{
fetob(lexp); /* boolean code */
fetob(rexp);
lexp->codelen -= rm_jmp_zero(lexp->codelen, lexp->falselist,
lexp->falselen);
patchup_false(lexp, 1);
lexp = catcode(lexp, rexp);
set_type(lexp, e_bool | e_code);
}
return (lexp);
}
icmake-7.21.01/comp/lcast.c 0000644 0001750 0001750 00000001001 12000542231 014264 0 ustar frank frank /*
L C A S T . C
*/
#include "iccomp.h"
ESTRUC_ *lcast(e)
ESTRUC_
*e;
{
if (test_type(e, e_int)) /* (int)list not ok */
{
semantic(illegal_cast);
discard(e);
set_type(e, e_list | e_var);
}
else if (test_type(e, e_str)) /* (string)int ok */
{
etoc(e); /* convert to code */
gencode(e, op_atol);
set_type(e, e_code | e_list);
}
return (e);
}
icmake-7.21.01/comp/looksym.c 0000644 0001750 0001750 00000000632 12000542231 014664 0 ustar frank frank /*
L O O K S Y M . C
*/
#include "iccomp.h"
size_t looksym(tab)
SYMTAB_
*tab;
{
register size_t
idx;
for (idx = 0; idx < tab->n_defined; idx++)
if (!strcmp(tab->symbol[idx].name, lexstring))/* string found ? */
break; /* done */
return (idx); /* return string idx */
}
icmake-7.21.01/comp/semantic.c 0000644 0001750 0001750 00000000602 12000542231 014767 0 ustar frank frank /*
S E M A N T I C . C
*/
#include "iccomp.h"
#ifdef __STDC__
void semantic (char *s, ...)
#endif
{
va_list
marker;
va_start(marker, s);
if (!sem_err)
{
errcount++;
printf ("[%s] Line %d: ", source_name, yylineno);
vprintf(s, marker);
putchar('\n');
sem_err++;
}
yynerrs++;
}
icmake-7.21.01/comp/yyerror.c 0000644 0001750 0001750 00000002716 12000542231 014707 0 ustar frank frank
#include "iccomp.h"
static char *err_msg[] =
{
"(", /* err_openpar_expected, */
")", /* err_closepar_expected, */
"{", /* err_openbrace_expected, */
"}", /* err_closebrace_expected, */
";", /* err_semicol_expected, */
"=", /* err_assign_expected, */
"error in expression", /* err_in_expression, */
",", /* err_comma_expected, */
"statement(s)", /* err_statements_expected, */
"identifier", /* err_identifier_expected, */
"code or vars", /* err_code_or_vars_expected, */
",' or ')'", /* err_comma_or_closepar_expected, */
"number", /* err_number_expected, */
"older', 'younger' or 'newer'", /* err_older_younger, */
"` (backtick)", /* err_backtick_expected, */
};
int yyerror (s)
char *s;
{
errcount++;
printf ("[%s] Line %d", source_name, yylineno);
if (!yytext[0])
puts (": Unexpected end of file.");
else
printf(" at '%s': '%s'%s\n", yytext, err_msg[parse_error],
parse_error == err_in_expression ?
nullstring
:
" expected"
);
return (0);
}
icmake-7.21.01/comp/breakstm.c 0000644 0001750 0001750 00000000633 12000542231 015000 0 ustar frank frank /*
B R E A K S T M . C
*/
#include "iccomp.h"
static ESTRUC_ e;
ESTRUC_ *break_stmnt()
{
e = *stackframe(0);
if (!break_ok)
semantic("'break' only in 'while' or 'for' statements");
else
{
gencode(&e, op_jmp, j_truelist);
e.type = e_bool | e_code;
++dead[dead_sp]; /* next code is dead */
}
return (&e);
}
icmake-7.21.01/comp/exprstmn.c 0000644 0001750 0001750 00000000644 12000542231 015052 0 ustar frank frank /*
E X P R S T M N . C
*/
#include "iccomp.h"
ESTRUC_ *expr_stmnt(e)
ESTRUC_
*e;
{
btoi(e); /* convert boolean to i */
if (lastop == op_copy_var)
copy_to_pop(e);
else if
(
test_type(e, e_code)
&&
!test_type(e, e_pre_inc_dec | e_post_inc_dec)
)
gencode(e, op_asp, 1);
return (e);
}
icmake-7.21.01/comp/callrss.c 0000644 0001750 0001750 00000006325 12000542231 014637 0 ustar frank frank /*
C A L L R S S . C
*/
#include "iccomp.h"
void callrss(ESTRUC_ *e, FUNNR_ funnr, ...)
{
register E_TYPE_
type = e_reg | e_int; /* default return type: intreg */
register size_t
args = 1; /* most f()s having 1 argument */
va_list
marker;
va_start(marker, funnr);
gencode (e, op_call_rss, funnr); /* call the function */
switch (funnr)
{
/* 0 args, returning string */
case f_getch:
case f_gets:
args--;
type = e_str | e_reg;
break;
/* 0 args, returning int */
case f_getpid:
args--;
type = e_int | e_reg;
break;
/* 1 arg, returning string */
case f_strupr:
case f_strlwr:
case f_ascii_str:
case f_g_base:
case f_g_ext:
case f_g_path:
type = e_str | e_reg;
break;
case f_getenv: /* 1 arg, returning list */
case f_backtick:
type = e_list | e_reg;
break;
/* 2 arguments, returning int */
case f_strfind:
case f_system:
args++;
break;
/* 2 args, returning string */
case f_chdir:
case f_c_base:
case f_c_ext:
case f_c_path:
case f_str_el:
case f_element:
args++; /* two arguments */
type = e_str | e_reg; /* returning string */
break;
/* 3 args, returning string */
case f_substr:
args = 3; /* three arguments */
type = e_str | e_reg; /* returning string */
break;
/* 2 args, returning list */
case f_stat:
case f_fgets: /* list fgets(string, int) */
case f_fields: /* list fields(string, string) */
case f_makelist: /* list makelist(int, string) */
args++;
type = e_list | e_reg;
break;
/* # args passed as argument */
case f_execute:
case f_exec:
case f_fprintf:
case f_printf:
args = va_arg(marker, size_t);
break;
default:
/*
default is entered in the switch to prevent a long compiler
warning
default: functions having one arg returning an int
case f_ascii_int:
case f_putenv:
case f_arg_head:
case f_arg_tail:
case f_cmd_head:
case f_cmd_tail:
case f_echo:
case f_exists:
case f_sizeoflist:
case f_strlen:
*/
break;
}
if (args)
gencode (e, op_asp, args); /* add stack pointer */
set_type(e, type); /* type of resulting expression */
}
icmake-7.21.01/comp/callhidd.c 0000644 0001750 0001750 00000001165 12000542231 014735 0 ustar frank frank /*
C A L L H I D D E N . C
Hidden functions are called by their negative function offset
to be patched up at code-generation time
*/
#include "iccomp.h"
void callhidden(register int fun, ESTRUC_ *rarg)
{
hidden_called = 1; /* hidden function calls */
hidden[fun].this = 1; /* this hidden function is called */
gencode(rarg, op_call, -fun); /* dummy, to be address of hidden */
gencode(rarg, op_asp, hidden[fun].nargs); /* clear pushed arguments */
set_type(rarg, hidden[fun].type); /* set the returntype */
}
icmake-7.21.01/comp/scast.c 0000644 0001750 0001750 00000001472 12000542231 014307 0 ustar frank frank /*
S C A S T . C
*/
#include "iccomp.h"
ESTRUC_ *scast(e)
ESTRUC_
*e;
{
char buffer[10];
if (test_type(e, e_list)) /* (string)list not ok */
{
semantic(illegal_cast);
discard(e);
set_type(e, e_str | e_const);
}
else if (test_type(e, e_int)) /* (string)int ok */
{
if (test_type(e, e_const))
{
sprintf(buffer, "%u",
(unsigned)e->evalue); /* convert to string */
e->evalue = lookstring(buffer);
set_type(e, e_const | e_str);
}
else
{
etoc(e); /* convert to code */
gencode(e, op_itoa);
set_type(e, e_code | e_str);
}
}
return e;
}
icmake-7.21.01/comp/etob.c 0000644 0001750 0001750 00000001701 12000542231 014116 0 ustar frank frank /*
E T O B . C
Convert expression to boolean expression
Links are not generated by etob(), but they
may exist.
*/
#include "iccomp.h"
void etob(e)
ESTRUC_
*e;
{
switch (e->type & (e_int | e_str | e_list | e_bool))
{
case e_int:
if (test_type(e, e_const))
{
e->evalue = e->evalue != 0;
set_type(e, e_int | e_const);
return;
}
break;
case e_str:
if (test_type(e, e_const))
{
e->evalue = 1;
set_type(e, e_int | e_const);
return;
}
break;
case e_bool:
return;
}
etoc(e); /* convert to code */
gencode (e, op_jmp_true);
gencode (e, op_jmp, j_falselist);
set_type(e, e_code | e_bool);
}
icmake-7.21.01/comp/defcode.c 0000644 0001750 0001750 00000000625 12000542231 014562 0 ustar frank frank /*
D E F C O D E . C
*/
#include "iccomp.h"
void defcode (lval, rval, opcode)
ESTRUC_
*lval,
*rval;
OPCODE_
opcode;
{
etoc(lval); /* convert to code */
etoc(rval);
catcode(lval, rval);
gencode(lval, opcode); /* append instruction */
set_type(lval, e_int | e_code); /* set appropriate type */
}
icmake-7.21.01/comp/catcode.c 0000644 0001750 0001750 00000003475 12000542231 014601 0 ustar frank frank /*
C A T C O D E . C
*/
#include "iccomp.h"
static void patchadd(register size_t value, unsigned **dest,
size_t *dlen, unsigned *source, size_t slen)
{
register size_t
idx;
if (!*dlen)
*dest = NULL; /* no memory for dest as yet */
for (idx = 0; idx < slen; idx++) /* all elements of source list: */
source[idx] += value; /* icrement addresses of targets */
/* expand the dest area */
*dest = xrealloc(*dest, (*dlen + slen) * sizeof(unsigned));
/* append source list */
memcpy(*dest + *dlen, source, slen * sizeof(unsigned));
*dlen += slen; /* increment # element */
}
ESTRUC_ *catcode(ESTRUC_ *lval, ESTRUC_ *rval)
{
register size_t
l,
r;
r = rval->codelen; /* sizeof rval code */
l = lval->codelen; /* sizeof lval code */
lval->code = xrealloc(lval->code, /* room for new code */
(l + r) * sizeof(INT8));
/* catenate the code */
memcpy(lval->code + l, rval->code, r * sizeof(INT8));
lval->codelen += r; /* new size */
patchadd(l, &lval->truelist, &lval->truelen,
rval->truelist, rval->truelen);
patchadd(l, &lval->falselist, &lval->falselen,
rval->falselist, rval->falselen);
lval->type |= rval->type; /* type of combined code */
/* (is ok with same types) */
discard(rval); /* free memory used by ESTRUC_ */
return (lval); /* return new frame */
}
icmake-7.21.01/comp/patchupf.c 0000644 0001750 0001750 00000000361 12000542231 015000 0 ustar frank frank /*
P A T C H U P F . C
*/
#include "iccomp.h"
void patchup_false(e, pos)
ESTRUC_
*e;
int
pos;
{
patchup(e->code, e->codelen, e->falselist, e->falselen, pos);
e->falselen = 0;
}
icmake-7.21.01/comp/patchfal.c 0000644 0001750 0001750 00000000737 12000542231 014757 0 ustar frank frank /*
P A T C H F A L . C
*/
#include "iccomp.h"
void patchfalse(e)
ESTRUC_
*e;
{
e->falselist = xrealloc(e->falselist, /* expand the falselist */
(e->falselen + 1) * sizeof(size_t));
/* room for the jump-backpatch */
e->code = xrealloc(e->code, e->codelen += sizeof(INT16));
e->falselist[e->falselen++] = e->codelen; /* store jumpstart location */
}
icmake-7.21.01/comp/entervar.c 0000644 0001750 0001750 00000000266 12000542231 015020 0 ustar frank frank /*
E N T E R V A R . C
*/
#include "iccomp.h"
void entervar()
{
enter();
entertab->symbol[entertab->n_defined - 1].var.type |= e_var;
}
icmake-7.21.01/comp/whilestm.c 0000644 0001750 0001750 00000002373 12000542231 015027 0 ustar frank frank /*
W H I L E S T A . C
*/
#include "iccomp.h"
ESTRUC_ *while_stmnt(e, s)
ESTRUC_
*e,
*s;
{
register size_t len;
unsigned *list;
nestlevel--; /* reduce nesting level */
break_ok--; /* reduce break ok */
etob(e); /* make links for E */
if (test_type(e, e_const)) /* constant: never xeq */
{
if (e->evalue)
e->evalue = 0; /* no value = no code for catcode */
/* MAYBE CODELEN = 0 ?? */
else
{
clearbin(e, s);
return (e);
}
}
patchup_true(e, 1); /* patch to EOC */
list = e->falselist;
len = e->falselen;
e->falselen = 0; /* no more false links avail. */
catcode(e, s); /* append s to e */
gencode(e, op_jmp, j_falselist); /* jmp to begin of code */
patchup_false(e, 0); /* patch to BOC */
e->falselist = list;
e->falselen = len;
patchup_true(e, 1); /* patchup break targets to EOC */
return (e);
}
icmake-7.21.01/comp/testoper.c 0000644 0001750 0001750 00000000471 12000542231 015035 0 ustar frank frank /*
T E S T O P E R . C
*/
#include "iccomp.h"
int test_operand(e, opcode)
ESTRUC_
*e;
OPCODE_
opcode;
{
register int
ret;
if ( (ret = !test_type(e, optype[opcode])) )
semantic(illegal_type, opstring[opcode]);
return (ret);
}
icmake-7.21.01/comp/returnst.c 0000644 0001750 0001750 00000002356 12000542231 015062 0 ustar frank frank /*
R E T U R N S T . C
*/
#include "iccomp.h"
ESTRUC_ *return_stmnt(op, e)
E_TYPE_
op;
ESTRUC_
*e;
{
SYMBOL_
*last;
if (!test_type(e, e_code))
etoc(e);
last = &funtab.symbol[funtab.n_defined - 1];
if ((OPCODE_)op == op_ret) /* return opcode received */
{
if
(
!
(
( /* void if the union of */
last->var.type /* the type of the function */
| /* and the */
e->type /* type of the expression */
)
& /* intersected with */
ALLTYPES /* all types */
) /* is empty. */
)
{
gencode(e, op); /* generate the 'ret' opcode */
return (e); /* done */
}
if (!(test_type(e, last->var.type & ALLTYPES)))
semantic("Incorrect returntype for function '%s()'", last->name);
}
gencode(e, op_pop_reg);
gencode(e, op);
return (e);
}
icmake-7.21.01/comp/subtract.c 0000644 0001750 0001750 00000001513 12000542231 015015 0 ustar frank frank /*
S U B T R A C T . C
*/
#include "iccomp.h"
ESTRUC_ *subtract (lval, rval)
ESTRUC_
*lval,
*rval;
{
register E_TYPE_
type;
if (test_binop(op_sub, lval, rval))
return (lval); /* test for correct types */
btoi(lval); /* convert pending booleans */
btoi(rval);
if (conflict(lval, rval, op_sub)) /* test type conflict */
return(lval);
type = lval->type; /* remember the type */
if ((lval->type & rval->type & (size_t)~ALLTYPES) == e_const)
lval->evalue -= rval->evalue;
else
{
defcode(lval, rval, op_sub);
set_type(lval, type & (ALLTYPES | e_code));
}
return (lval); /* return new expression */
}
icmake-7.21.01/contributions/ 0000755 0001750 0001750 00000000000 12116601427 015001 5 ustar frank frank icmake-7.21.01/contributions/solaris 0000600 0001750 0001750 00000003676 12116601427 016404 0 ustar frank frank Date: 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-7.21.01/def/ 0000755 0001750 0001750 00000000000 11743327112 012636 5 ustar frank frank icmake-7.21.01/def/programs 0000644 0001750 0001750 00000003336 11743327112 014420 0 ustar frank frank /* P R O G R A M S . I M
The following #defines define the names of programs (and their
flags, if applicable) used by the 'unix' script. Make sure you
accept the names of the programs, and that these programs are
available on your system.
By changing the defines, you change the names of the programs
being activated.
*/
// The following two macros are the library manager. That program
// is started in the unix-script as "AR ARFLAGS library-name object-files".
#define AR "ar"
// The flags of AR:
#define ARFLAGS "rsv"
// The C compiler:
#define CC "gcc"
// The flags of the C compiler:
// -c enforces compilation-only;
// -O is used to turn the generation of debugging code
// off. Alternatively, -g could be selected to turn
// debugging on.
// The define -DHAVE_GLOB should be used only if your library
// supports the glob() function. See also the icmake.doc file
// for further details. The function is normally part of the
// gcc library.
#define CFLAGS "-c -Wall -O2 -DHAVE_GLOB"
// The icmake.1 compressor. This results in plain compression of icmake.1
// into icmake.1.Z
#define GZIP "gzip"
// The program to install the final icm* executables
// ('cp' does nicely, 'install' should be ok too)
#define CP "cp"
// The program making the 'bin' subdirectory
#define MKDIR "mkdir"
// The program used to remove unneccesary files:
#define RM "rm"
// The strip program, to shrink the final executables somewhat:
#define STRIP "strip"
/* That's it ! */
icmake-7.21.01/doc/ 0000755 0001750 0001750 00000000000 12175751644 012660 5 ustar frank frank icmake-7.21.01/doc/icmake.1 0000644 0001750 0001750 00000102505 12267172275 014175 0 ustar frank frank .TH "icmake" "1" "1992\-2014" "icmake\&.7\&.21\&.01\&.tar\&.gz" "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 [options] \fIsource[\&.im] [dest[\&.bim]]\fP [\-\- [args]]
.PP
\fBicmun\fP \fIbimfile\fP
.PP
.SH "DESCRIPTION"
.PP
\fBIcmake\fP(1) can be used as an alternative to \fBmake\fP(1)\&. In its standard
operation more, it calls the following programs:
.IP o
\fIicm\-pp\fP to preprocess the icmake file
.IP o
\fIicm\-comp\fP to byte\-code compile the \fBicmake\fP \fBs\fP
.IP o
\fIicm\-exec\fP to interpret the byte\-code file
.PP
\fBIcmake\fP allows the programmer to use a program language (closely resembling
the well\-known \fBC\fP\-programming language) to define the actions involved in
(complex) program maintenance\&. For this, \fBicmake\fP offers various special
operators as well as a set of support functions that have proven to be useful
in program maintenance\&.
.PP
The program \fBicmun\fP(1) may be used to disassemble the compiled
byte\-code file\&.
.PP
Traditional make\-utilities recompile sources once header files are
modified\&. In the context of \fBC++\fP program development this is often a bad
idea, as adding a new member to a class does not normally require you to
recompile the class\(cq\&s sources\&. To handle class dependencies in a more sensible
way, \fBicmake\fP(1)\(cq\&s \fICLASSES\fP file may define dependencies among
classes\&. By default, class\-dependencies are not interpreted\&. See the
\fBicmconf\fP(7) man\-page for details\&.
.PP
.SH "ADDITONS SINCE VERSION 7\&.00"
.PP
.IP o
Integral constants may be specified using hexadecimal notation (e\&.g\&.,
\fI0x12ab\fP);
.IP o
The \fIIM\fP environment variable may contain multiple directories,
separated from each other by colons (\fI:\fP)\&.
.IP o
\fI#define\fP\-directives may refer to other macro definitions using the
\fI${identifier}\fP format\&.
.IP o
\fI#ifdef\fP, \fI#ifndef\fP, \fI#else\fP and \fI#endif\fP directives can be
nested\&.
.IP o
The `backtick\(cq\& operator is defined, executing a program in a shell
and collecting its standard output in a list (see below)\&.
.IP o
The index operator (\fI[]\fP) is defined as an alternative to the
pre\-defined function \fIelement()\fP, and can be used on lists and
strings\&.
.IP o
The function \fIstring getenv(string envvar)\fP is predefined\&. If
existing scripts already define a \fIgetenv()\fP function of their own,
it it suggested to remove this function and use the new \fIgetenv()\fP
function instead\&. Alternatively, rename the script\-defined function
\fIgetenv()\fP and calls of this function to, e\&.g\&. \fImy_getenv()\fP\&.
.IP o
The function \fIint strstr(string haystack, string needle)\fP is
renamed to \fIint strfind(string haystack, string needle)\fP\&.
.IP
\fBNOTE: this modification in version 7\&.00 could very well
affect your earlier (6\&.xx) icmake scripts\&. Changing `strstr\(cq\&
into `strfind\(cq\& should bring your older scripts up\-to\-date again\&.\fP
.PP
.SH "OPTIONS"
.PP
\fBIcmake\fP:
.PP
\fIsource\fP: \fBicmake\fP script source file (default extension: \fI\&.im\fP)\&.
.PP
\fIdest\fP: binary \fBicmake\fP script file (default: \fI`source\(cq\&\&.bim\fP)\&.
.PP
\fI\-\-\fP: \fBicmake\fP/\fBicmake\fP\-script arguments separator
.PP
\fIargs\fP: arguments following \fI\-\-\fP are entered into the \fBicmake\fP scipt
\fImain()\fP function\(cq\&s \fIargv\fP\-list (see below at section
\fBUSER DEFINED FUNCTIONS\fP)\&.
.PP
.IP o
\fB\-a\fP
.br
information about \fBicmake\fP
.IP o
\fB\-b\fP
.br
blunt execution of the destinationfile
.IP o
\fB\-c\fP
.br
the destination file is only compiled
.IP o
\fB\-i\fP file
.br
\fIfile\fP: name of source\&. \fBIcmake\fP argument processing stops\&.
.IP o
\fB\-o\fP file
.br
all \fBicmake\fP output is written to \fIfile\fP (Not
implemented on unix platforms)
.IP o
\fB\-p\fP
.br
only the preprocessor is activated
.IP o
\fB\-q\fP
.br
quiet mode: copyright banner not displayed
.IP o
\fB\-t\fP file
.br
\fIfile\fP is used as a temporary bim\-file, to be
removed on exit\&. \fBIcmake\fP argument processing stops\&.
.PP
\fBIcmun\fP:
.PP
\fIbimfile\fP: binary \fBicmake\fP script file\&.
.PP
.SH "PREPROCESSOR DIRECTIVES"
.PP
The following preprocessor directives are available:
.IP o
comment:
.br
standard \fBC\fP comment (all between \fI/*\fP and \fI*/\fP) as well as
comment\-to\-end\-of\-line (all line contents following \fI//\fP) are
ignored\&.
.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 \-qi
.fi
then \fIicm\fP may be given as a command, thus executing
.nf
/usr/bin/icmake \-qi icm \&.\&.\&.
.fi
Alternatively,
.nf
#! /usr/bin/icmake \-qt /tmp/icm
.fi
may be used, resulting in the execution of
.nf
#! /usr/bin/icmake \-qt /tmp/icm icm \&.\&.\&.
.fi
In this case the binary makefile is not kept, but a temporary file
\fI/tmp/icm\&.PID\fP is used and removed on exit\&. The PID extension being
the process\-id of the \fBicmake\fP program executing \fIicm\fP\&.
.IP o
\fI#include \(dq\&filename\(dq\&\fP
.br
The file \fIfilename\fP is included at the location of the directive
.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 directories pointed to by
the \fIIM\fP environment variable\&.
.IP o
\fI#define identifier definition\fP
.br
The text \fIidentifier\fP will be replaced by \fIdefinition\fP\&. The
definition may contain references to already defined identifiers,
using the \fI${identifier}\fP format\&. If the \fI${identifier}\fP hasn\(cq\&t
been defined (yet), the text \fI${identifier}\fP is literally kept\&. At
each \fI#define\fP at most 100 text\-replacements are performed,
preventing infinite recursion\&.
.IP o
\fI#ifdef identifier\fP
.br
If the \fIidentifier\fP macro was defined the next block of code (until
a matching \fI#else\fP or \fI#endif\fP directive was detected) is
byte\-compiled\&. Otherwise, the block of code is ignored\&.
.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 o
\fI#else\fP
.br
Terminates a \fI#ifdef\fP and \fI#ifndef\fP directive, reversing the
acceptance decision about the following code\&.
.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\&.
.IP o
\fI#undef identifier\fP
.br
Remove \fIidentifier\fP from the set of defined symbols\&. This will not
affect the specification of any previously defined symbols in which
\fIidentifier\fP was used\&.
.PP
.SH "DATA TYPES"
.PP
The following data types are available:
.IP o
\fIint\fP
.br
Integral values, ranging from \fI\-0x8000\fP until \fI0x7fff\fP\&. \fIint\fP
constants may be specified as decimal numbers, hexadecimal numbers or
as \fIASCII\fP character constants (e\&.g\&., \fI\(cq\&x\(cq\&\fP)\&.
.IP o
\fIstring\fP
.br
Text variables\&. Text constants are delimited by double quotes\&. Multiple
text constants may be concatenated, but a text constant may not extend
over multiple lines\&. To indicate an end\-of\-line in a text constant use
the \fI\en\fP escape sequence\&. The escape sequences \fI\ea \eb \ef \en \er\fP
and \fI\et\fP are available\&. Otherwise, \fI\ex\fP is interpreted as a
literal \fIx\fP\&. So, use \fI\e\e\fP to indicate \fI\e\fP within a text
constant\&.
.IP o
\fIlist\fP
.br
A data structure containing a series of individually accessible
\fIstring\fP values\&. When a list contains elements, its first element is
indicated by index 0\&.
.IP o
\fIvoid\fP
.br
Used with function definitions to indicate that the function does not
return a value\&.
.PP
Variables may be defined both at the global level as well as locally to
functions\&. Variables are strongly typed\&. A variable cannot have the type
\fIvoid\fP\&.
.PP
Variables may be initialized when they are defined\&. The initialization can
use return values of functions, but cannot use variables\&. Consider
initializations as being constructed from constant values\&.
.PP
.SH "PREDEFINED SYMBOLS"
.PP
The following symbols are predefined by \fBicmake\fP\&. All are constant \fIint\fP
values:
.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 symbols are available depending on the architecture:
.TS
tab(~);
--
ll
--
ll
ll
ll
ll
ll
ll
--
c.
symbol~1 when defined on the platform, otherwise 0
MSDOS~MS\-DOS platform (with MSC 7\&.00 compiler)
unix~Unix, usually with GNU\(cq\&s gcc compiler
linux~x86 running Linux (usually with gcc)
M_SYSV, M_UNIX~x86 running SCO/Unix (usually with) Microsoft C
_POSIX~_SOURCE Unix with Posix complient compiler
__hpux~HP\-UX, with the native HP compiler
.TE
.SH "OPERATORS"
.PP
All \fBC\fP operators, except for the ternary operator, are supported,
operating like their \fBC\fP counterparts on \fIint\fP variables and/or values\&.
.PP
Additionally, for \fIstring\fP type variables and/or values the following
operators are available:
.IP o
\fIa + b\fP: returns a new \fIstring\fP value containing the concatenation of
\fIstring\fP values \fIa\fP and \fIb\fP\&. Note that \fIstring\fP constants may be
concatetated without using the \fI+\fP operator, e\&.g\&.,
.nf
\(dq\&hello \(dq\& \(dq\&world\(dq\&
\(dq\&hello \(dq\& + \(dq\&world\(dq\&
.fi
.IP o
\fIa += b\fP: \fIa\fP must be a \fIstring\fP variable, to which the \fIstring\fP
variable or value \fIb\fP is appended\&.
.IP o
string comparisons: operators \fI== != <= >= < > !=\fP and \fI==\fP may
be applied to \fIstring\fP values or variables, returning 1 if the comparison
succeeds, otherwise 0\&. Comparison is case sensitively, and follows the
\fIASCII\fP character set\&.
.IP o
\fI!a\fP: the boolean \fI!\fP operator returns 1 if the \fIstring a\fP is
empty, otherwise 0 is returned\&.
.IP o
\fIa younger b, a newer b\fP: returns 1 if file \fIa\fP is more recent than
file \fIb\fP\&. E\&.g\&., \fI\(dq\&source\&.cc\(dq\& newer \(dq\&source\&.o\(dq\&\fP\&. If \fIb\fP doesn\(cq\&t exist, 1
is returned; if \fIa\fP doesn\(cq\&t exist 0 is returned; if neither \fIa\fP nor \fIb\fP
exists, 0 is returned; if they are of the same age, 0 is returned\&. Explicit
tests for the existence of a file can be performed using the \fIexists()\fP
predefined function (see below, section \fBPREDEFINED FUNCTIONS\fP)\&.
.IP o
\fIa older b\fP: turns 1 if file \fIa\fP is older than file \fIb\fP\&. E\&.g\&.,
\fI\(dq\&libprog\&.a\(dq\& older \(dq\&source\&.o\(dq\&\fP\&. If \fIa\fP doesn\(cq\&t exist, 1 is returned; if
\fIb\fP doesn\(cq\&t exist 0 is returned; if neither \fIa\fP nor \fIb\fP exists, 0 is
returned; if they are of the same age, 0 is returned\&.
.IP o
\fI[]\fP: the index operator is defined as an alternative to the built\-in
function \fIelement\fP\&. It can only be applied (as holds true for \fIelement()\fP
as well) as so\-called \fIrvalue\fP\&. Therefore, constructions like:
.nf
// assume str1 and str2 are strings
str1 = str2[3]
.fi
will be accepted, but the following construction will not be accepted:
.nf
str2[3] = str; // won\(cq\&t compile
.fi
.PP
For \fIlist\fP type variables and/or values the following
operators are available:
.IP o
\fIa + b\fP: returns a new \fIlist\fP value containing the concatenation of
\fIlist\fP values \fIa\fP and \fIb\fP\&. This is \fInot\fP a set operation: if an
element appears both in \fIa\fP and in \fIb\fP, they will appear twice in the
resulting list\&.
.IP o
\fIa \- b\fP: returns a new \fIlist\fP value containing the elements in \fIa\fP
that are not present in \fIb\fP\&. This \fIis\fP a set operation\&.
.IP o
\fIa += b\fP: elements in \fIb\fP are added to the elements in \fIa\fP, which
must be a \fIlist\fP variable\&. This is \fInot\fP a set operation\&.
.IP o
\fIa \-= b\fP: elements in \fIb\fP are removed from the elements in \fIa\fP,
which must be a \fIlist\fP variable\&. This \fIis\fP a set operation\&.
.IP o
list equality comparisons: operators \fI!=\fP and \fI==\fP may be applied
to \fIlist\fP values or variables\&. Operator \fI==\fP returns 1 if both lists have
element\-by\-element identical elements, 0 otherwise\&. Operator \fI!=\fP reverses
the result of \fI==\fP\&.
.IP o
\fI!a\fP: the boolean \fI!\fP operator returns 1 if the \fIlist a\fP is
empty, otherwise 0 is returned\&.
.IP o
\fI[]\fP: the index operator is defined as an alternative to the built\-in
function \fIelement\fP\&. It can only be applied (as holds true for \fIelement()\fP
as well) as so\-called \fIrvalue\fP\&. Therefore, constructions like:
.nf
// assume lst is a list, str is a string
str = lst[3]
.fi
will be accepted, but the following construction will not be accepted:
.nf
lst[3] = str; // won\(cq\&t compile
.fi
.PP
Typecasts may be performed using the standard \fBC\fP cast\-operator to cast:
.IP o
Strings to ints and vice versa (\fI(int)\(dq\&123\(dq\&, (string)55\fP)
.IP o
Strings may be cast to lists (\fIlist lst = (list)\(dq\&hello\(dq\&\fP)
.PP
.SH "FLOW CONTROL"
.PP
\fBIcmake\fP offers the following subset of \fBC\fP\(cq\&s statement types\&. They can be
used as in the \fBC\fP programming language\&.
.IP o
\fIexpression ;\fP
.br
The plain expression statement;
.IP o
The compound statement
.br
Different from \fBC\fP \fBicmake\fP does not support variable definitions
inside a compound statement\&. All variables used locally
by a function must be defined as either function parameters or
as variables that are defined immediately at the beginning of a
function\(cq\&s body\&.
.IP o
\fIif (condition) statement\fP
.IP o
\fIif (condition) statement else statement\fP
.IP o
\fIfor (init; condition; increment) statement\fP
.br
The variable(s) used in the initialization section must already have
been defined\&. The \fIinit\fP, \fIcondition\fP and \fIincrement\fP sections
may be left empty\&. The empty condition section is interpreted as
`always \fItrue\fP\(cq\&\&.
.IP o
\fIwhile (condition) statement\fP
.br
The \fIdo \&.\&.\&. while()\fP statement is not implemented for \fBicmake\fP\&.
.IP o
\fIreturn\fP (for \fIvoid\fP functions) and \fIreturn expression\fP for other
functions\&.
.IP o
\fIbreak\fP
.br
To leave \fIfor\fP and \fIwhile\fP statements, overruling the statement\(cq\&s
condition\&. \fBC\fP\(cq\&s \fIcontinue\fP is not available\&.
.IP o
\fIexit(expression)\fP
.br
To terminate the \fBicmake\fP\-script\&. The \fIexpression\fP must evaluate to an
\fIint\fP value, which becomes the script\(cq\&s exit value\&.
.PP
.SH "PREDEFINED FUNCTIONS"
.PP
\fBIcmake\fP offers the following predefined functions, which can be used
immediately by \fBicmake\fP scripts\&. The function overview is ordered alphabetically
by function name, but where appropriate short summary labels are
provided:
.PP
Helper functions of \fIexec()\fP (see also below at \fIexec()\fP):
.IP o
\fIvoid arghead(string h)\fP
.br
Defines the `argument head\(cq\&, to be used with \fIexec()\fP\&. By default,
the `argument head\(cq\& is an empty string\&.
.IP o
\fIvoid argtail (string t)\fP
.br
Defines the `argument tail\(cq\&, to be used with \fIexec()\fP\&. By default,
the `argument tail\(cq\& is an empty string\&.
.PP
String\-to\-ascii converters:
.IP o
\fIint ascii(string s)\fP
.br
Returns the first character of \fIs\fP as an int; e\&.g\&.,
\fIascii(\(dq\&A\(dq\&)\fP returns 65;
.IP o
\fIstring ascii(int i)\fP
.br
Returns \fIi\fP as a string, e\&.g\&., \fIascii(65)\fP returns the string
\fI\(dq\&A\(dq\&\fP;
.PP
System calls:
.IP o
The `backtick` operator (\fI`\fP)
.br
A string placed between two backticks is executed by the \fIpopen\fP(3)
function\&. The standard output gererated by the command that is stored
in the string argument is returned as a list\&. An empty list indicates
that the command could not be executed\&. A command that could be
executed but did not produce any output returns a list containing one
empty element\&. The command\(cq\&s standard error stream output is not
automatically collected\&. Standard shell redirection could be used to
collect the standard error stream\(cq\&s output as well\&. Example:
.nf
string s = \(dq\&ls\(dq\&;
printf(`s`); // prints the elements in the current
// directory
.fi
.PP
Filename modifiers:
.IP o
\fIstring change_base(string file, string newbase)\fP
.br
Changes the basename of \fIfile\fP, returns the changed name\&. E\&.g,
\fIchange_base(\(dq\&/path/demo\&.im\(dq\&, \(dq\&out\(dq\&)\fP returns \fI\(dq\&/path/out\&.im\(dq\&\fP;
.IP o
\fIstring change_ext(string file, string newext)\fP
.br
Changes the extension of \fIfile\fP, returns the changed name\&. E\&.g,
\fIchange_ext(\(dq\&source\&.cc\(dq\&, \(dq\&o\(dq\&)\fP returns \fI\(dq\&source\&.o\(dq\&\fP;
.IP o
\fIstring change_path(string file, string newpath)\fP
.br
Changes the path specification of \fIfile\fP, returns the changed name\&.
E\&.g, \fIchange_path(\(dq\&tmp/binary\(dq\&, \(dq\&/usr/bin\(dq\&)\fP returns
\fI\(dq\&/usr/bin/binary\(dq\&\fP\&. Note that the \fI/\fP\-separator is inserted if
required\&.
.PP
System calls:
.IP o
\fIstring chdir(string newdir)\fP
.br
Changes the script\(cq\&s working directory, returns the previous dir as an
absolute path\&.
.br
Use \fIchdir(\(dq\&\&.\(dq\&)\fP to get current working directory,
\fIchdir(\(dq\&\(dq\&)\fP may be used to obtain the startup working directory (this
functionality was broken in releases before than 7\&.00, but is now
operational)\&. The function terminates the \fBicmake\fP\-script if the
specified \fInewdir\fP does not exist\&.
.IP o
\fIstring chdir(int checking, string newdir)\fP
.br
Same functionality as the previous function, but by specifying
\fIchecking\fP as \fIP_NOCHECK\fP the function won\(cq\&t terminate the
script\&. Rather, it will return the script\(cq\&s current working
directory\&.
.PP
Helper functions of \fIexec()\fP (see also below at \fIexec()\fP):
.IP o
\fIcmdhead(string h)\fP
.br
Defines a `command head\(cq\&, to be used with \fIexec()\fP\&. By default,
the `command head\(cq\& is an empty string\&.
.IP o
\fIcmdtail(string t)\fP
.br
Defines a `command tail\(cq\&, to be used with \fIexec()\fP\&. By default,
the `command tail\(cq\& is an empty string\&.
.PP
\fBIcmake\fP execution modifier:
.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 \fION\fP is active\&.
.PP
Functions returning elements of aggregates:
.IP o
\fIstring element(int index, list lst)\fP
.br
Returns string \fIindex\fP (0\-based) from \fIlst\fP\&. An empty string is
returned if an unavailable index value is provided\&. See also the
\fI[]\fP operator in the section \fBOPERATORS\fP\&.
.IP o
\fIstring element(int index, string str)\fP
.br
Returns character \fIindex\fP (0\-based) from \fIstr\fP\&. An empty string is
returned if an unavailable index value is provided\&. See also the
\fI[]\fP operator in the section \fBOPERATORS\fP\&.
.PP
System calls:
.IP o
\fIexec(string cmd, \&.\&.\&.)\fP
.br
Executes command with arguments\&. Each argument will be prefixed by
\fIarghead()\fP\(cq\&s argument and postfixed by \fIargtail()\fP\(cq\&s
argument\&. Note that no blanks are inserted between \fIarghead()\fP\(cq\&s
contents, the argument proper, and \fIargtail()\fP\(cq\&s argument\&. All thus
modified arguments are concatenated, this time separated by single
blanks, and then \fIcmdhead()\fP\(cq\&s contents are inserted between the
command and the first argument (on either side delimited by single
blanks) and \fIcmdtail()\fP\(cq\&s contents are appended to the arguments
(again, separated by a single blank)\&. \fIPATH\fP is searched to locate
\fIcmd\fP\&. 0 is returned\&.
.IP o
\fIexec(int checkcmd, string cmd, \&.\&.\&.)\fP
.br
Same functionality as the previous function, but by specifying
\fIchecking\fP as \fIP_NOCHECK\fP the function won\(cq\&t terminate the
script\&. Rather, it will return the called command\(cq\&s exit status, or
\fI0x7f00\fP if the command wasn\(cq\&t found\&.
.IP o
\fIexecute(string cmd, string cmdhd,
string arghd, \&.\&.\&., string argtl, string cmdtl)\fP
.br
Same as \fIexec()\fP, but command head/tail and argument
head/tail must be specified\&.
The actually executed command starts with \fIcmd\fP, followed by
\fIcmdhd\fP\&. Next is a series of arguments follows, each
enclosed by \fIarghd\fP and \fIargtl\fP\&. The command terminates
with \fIcmdtl\fP\&. 0 is returned
.IP o
\fIexecute(int checking, string cmd, string cmdhd,
string arghd, \&.\&.\&., string argtl, string cmdtl)\fP
.br
Same functionality as the previous function, but by specifying
\fIchecking\fP as \fIP_NOCHECK\fP the function won\(cq\&t terminate the
script\&. Rather, it will return the called command\(cq\&s exit status, or
\fI0x7f00\fP if the command wasn\(cq\&t found\&.
)
.PP
System interface:
.IP o
\fIint exists(string file)\fP
.br
Returns a non\-zero value if \fIfile\fP exists, otherwise 0 is returned\&.
.PP
Input interface:
.IP o
\fIlist fgets(string file, int offset)\fP
.br
The next line found at offet \fIoffset\fP is read from \fIfile\fP\&.
It returns a list \fIretlist\fP containing two elements:
.br
\fIelement(0, retlist)\fP is the string that was read
(including the \fI\en\fP, if found)
.br
\fIelement(1, retlist)\fP is the next offset to read\&.
.br
.IP
An empty return list signifies \fIEOF\fP\&. Since an empty list\(cq\&s `first\(cq\&
eement is an empty string, which is converted to the value 0, a file
may be read and processed as follows:
.nf
list line;
while (1)
{
line = fgets(\(dq\&filename\(dq\&, (int)line[1]);
if (!line)
break;
process(line[0]);
}
.fi
.PP
Output interface:
.IP o
\fIint fprintf(string filename, \&.\&.\&.)\fP
.br
Appends all (comma separated) arguments to the file
\fIfilename\fP\&. Returns the number of printed arguments\&.
.PP
Filename modifier:
.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\&. Eg\&., 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\&.
.PP
System interface:
.IP o
\fIlist getenv(string envvar)\fP
.br
Returns the value of environment variable \fIenvvar\fP in a list
containing two elements:
.br
the first element indicates whether the environment variable was
defined (value \fI\(dq\&1\(dq\&\fP) or not (value \fI\(dq\&0\(dq\&\fP);
.br
the second element indicates the value of the environment variable\&.
.IP
Enivironment variables are of the form \fIvariable=value\fP, and if
defined the list\(cq\&s second element contains \fIvalue\fP\&. If the value is
empty, the variable is defined, but has no text associated with it\&.
.PP
Filename modifier:
.IP o
\fIstring get_ext(string file)\fP
.br
Returns the extension of \fIfile\fP, except for the separating dot\&. The
extension is all information starting at the final dot
in the filename\&. If no final dot is found, the extension is an empty
string\&.
.PP
Input interface:
.IP o
\fIstring getch()\fP
.br
Returns the next pressed key as a string (no `Enter\(cq\& required for
ms\-dos and unix (incl\&. linux) systems)\&.
.PP
Filename modifier:
.IP o
\fIstring get_path(string file)\fP
.br
Returns the path\-prefix of \fIfile\fP\&. The path prefix is all information
up to (and including) the final directory separator (which is,
depending on the operating system, a forward\- or backslash)\&.
.IP
If no path is found, an empty strring is returned\&.
.PP
System interface:
.IP o
\fIint getpid()\fP
.br
Returns the process\-id (UNIX) or PSP\-paragraph (DOS) of the icmake byte
code interpreter \fBicm\-exec\fP\&.
.PP
Input interface:
.IP o
\fIstring gets()\fP
.br
Returns the next line read from the keyboard as a \fIstring\fP\&. The line
entered on the keyboard must be terminated by an `Enter\(cq\& key, which is
not stored in the returned string\&.
.PP
Functions creating lists of files:
.IP o
\fIlist makelist(string mask)\fP
.br
Returns a list of all files matching \fImask\fP\&. E\&.g\&.,
\fImakelist(\(dq\&*\&.c\(dq\&)\fP returns a list containing all files ending in
\fI\&.c\fP\&.
.IP o
\fIlist makelist(type, string mask)\fP
.br
Same as the previous function, but the type of the directory elements
may be specified as its first argument:
.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 files~
O_SUBDIR~obtain all subdirectories~
.TE
Note that the pattern \fI*\fP will not match hidden entries under Unix\-type
operating systems\&. Use \fI\&.*\fP for that\&.
.IP o
\fIlist makelist(string mask, newer, string comparefile)\fP
.br
Returns list of all files matching mask which are newer
than a provided comparefile\&. Operator \fIyounger\fP may be used instead
of \fInewer\fP\&. Note that \fInewer\fP and \fIyounger\fP are operators, not
strings\&.
.IP o
\fIlist makelist([int = O_FILE,] string mask, newer,
string comparefile)\fP
.br
Same as the previous function, but \fItype\fP may be specified as in
\fIlist makelist(type, string mask)\fP\&.
.IP o
\fImakelist(string mask, older, string comparefile)\fP
.br
See above; returns a list of files that are older than the
comparefile\&.
.IP o
\fImakelist(type, string mask, older, string comparefile)\fP
.br
Same as the previous function, but \fItype\fP may be specified as in
\fIlist makelist(type, string mask)\fP\&.
.PP
Output interface:
.IP o
\fIint printf(\&.\&.\&.)\fP
.br
Shows all (comma separated) arguments to screen (i\&.e\&., the standard
output stream)\&. Returns the number of printed arguments\&.
.PP
System interface:
.IP o
\fIint putenv(string envvar)\fP
.br
Adds \fIenvvar\fP to the current (\fBicmake\fP) environment
Use the format: \(dq\&VAR=value\(dq\&\&. Returns 0\&.
.PP
List information:
.IP o
\fIint sizeof(list l)\fP
.br
Returns the number of elements in \fIlist\fP
.PP
System information:
.IP o
\fIlist stat(string entry)\fP
.br
Returns \fBstat\fP(2) information of directory entry \fIentry\fP as
a list\&. The returned list has two elements: element 0 is the
\fIattribute value\fP, element 1 contains the size of the file\&.
.IP
Attributes are returned as bit\-flags, composed from the
following predefined constants:
.nf
S_IFCHR S_IFDIR S_IFREG
S_IREAD S_IWRITE S_IEXEC
.fi
See the \fBstat\fP(2) manual page for the meanings of these constants\&.
.IP o
\fIlist stat(checking, string entry)\fP
.br
Same as the previous function, but by specifying \fIchecking\fP as
\fIP_NOCHECK\fP the function won\(cq\&t terminate the script\&. Rather, it will
rturn \fBstat\fP(2)\(cq\&s return value\&.
.PP
String support:
.IP o
\fIint strlen(string s)\fP
.br
Returns the number of characters in \fIs\fP (not counting the final 0)\&.
.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 contained in \fIhaystack\fP\&.
.br
\fBThis function was called strstr() in versions before 7\&.00\fP\&.
.IP o
\fIstring strlwr(string s)\fP
.br
Returns a lower\-case duplicate of \fIs\fP\&.
.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\&. E\&.g\&.,
\fIstrtok(\(dq\&hello icmake\(cq\&s+world\(dq\&, \(dq\& +\(dq\&)\fP returns the list containing
the three strings \fI\(dq\&hello\(dq\&\fP, \fI\(dq\&icmake\(cq\&s\(dq\&\fP, and \fI\(dq\&world\(dq\&\fP\&.
.IP o
\fIstring strupr(string s)\fP
.br
Returns an upper\-case duplicate of \fIs\fP\&.
.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
size or if \fIcount <= 0\fP, then an empty string is returned\&. If
\fIoffset\fP is less than 0 then 0 is used\&.
.PP
System calls:
.IP o
\fIint system(string command)\fP
.br
Executes \fIcommand\fP\&. The return value indicates the executed
command\(cq\&s exit value\&. The string \fIcommand\fP may contain redirection
and/or piping characters\&.
.IP o
\fIint system(int checking, string command)\fP
.br
Same functionality as the previous function, but by specifying
\fIchecking\fP as \fIP_NOCHECK\fP the function won\(cq\&t terminate the
script\&. Rather, it will return the called command\(cq\&s exit status, or
\fI0x7f00\fP if the command wasn\(cq\&t found\&.
)
.PP
.SH "USER DEFINED FUNCTIONS"
.PP
\fBIcmake\fP scripts may define functions, and a function \fImain()\fP \fImust\fP be
defined\&. Functions must have the following elements:
.IP o
The function\(cq\&s return type\&. One of the available types must be
used explicitly, e\&.g\&., \fIvoid\fP\&. There is no default type\&.
.IP o
The function\(cq\&s name, e\&.g\&., \fIcompile\fP\&.
.IP o
A parameter list, defining zero or more comma\-separated
parameters\&. The parameters themselves consist of a type name followed by the
parameter\(cq\&s identifier\&. E\&.g\&., \fI(string outfile, string source)\fP\&.
.IP o
A \fIbody\fP surrounded by a pair of curly braces (\fI{\fP and \fI}\fP)\&.
.IP
Function bodies may contain (optionally initialized) variable
definitions\&. Variable definitions start with a type name, followed by one or
more comma separated (optionally initialized) variable identifiers\&. If a
variable is not explicitly initialized it is initialized by default\&. An
\fIint\fP variable is initialized to 0, a \fIstring\fP is initialized to empty
text (\fI\(dq\&\(dq\&\fP) and a \fIlist\fP is initialized to a list of zero elements\&.
.IP
Following variable definitions, bodies may contain zero or more statements
(see below at section \fBFLOW CONTROL\fP for the various flow\-control
statements)\&. Note that all local variables must be defined at the very
beginning of function bodies\&.
.PP
User defined functions must be defined before they can be used, although they
may be called recursively\&. Therefore, indirect recursion is not supported by
\fBicmake\fP\&.
.PP
The user\-defined function \fImain()\fP has three optional arguments, which may
be omitted from the last one (\fIenvp\fP) to the first (\fIargc\fP), as in
\fBC\fP\&. Its full prototype is (note: \fBvoid\fP return type):
.nf
void main(int argc, list argv, list envp)
.fi
In \fImain()\fP,
.IP o
\fIargc\fP represents the number of elements in \fIargv\fP;
.IP o
\fIargv\fP contains the arguments, with element 0 the compiled \fBicmake\fP script
(the `\fI\&.bim\fP\(cq\& file);
.IP o
\fIenvp\fP containts the `environment\(cq\& variables\&. The function \fIsizeof()\fP
(see below) may be used to determine its elements\&. Elements in \fIenvp\fP have
the form \fIvariable=value\fP\&. Alternatively, the function \fIgetenv()\fP (see
below) can be used to retrieve a specific environment variable immediately\&.
Example:
.nf
void main(int argc, list argv)
{
list toCompile;
int idx;
if (argc == 1)
usage(element(0, argv));
if (toCompile = altered(\(dq\&*\&.cc\(dq\&))
{
for (idx = sizeof(toCompile); idx\-\-; )
compile(element(idx, toCompile));
if (getenv(\(dq\&dryrun\(dq\&)[0] == \(dq\&0\(dq\&)
linking(element(2, argv));
}
exit (0);
}
.fi
.PP
.SH "FILES"
.PP
The mentioned paths are sugestive only and may be installation dependent:
.IP o
\fB/usr/bin/icmake\fP: the main \fBicmake\fP program;
.IP o
\fB/usr/bin/icmun\fP: the \fBicmake\fP unassembler;
.IP o
\fB/usr/lib/icm\-pp\fP: the preprocessor called by \fBicmake\fP;
.IP o
\fB/usr/lib/icm\-comp\fP: the compiler called by \fBicmake\fP;
.IP o
\fB/usr/lib/icm\-exec\fP: the byte\-code interpreter called by \fBicmake\fP;
.PP
.SH "EXAMPLES"
.PP
The distribution (usually in \fI/usr/share/doc/icmake\fP) contains a
directory \fIexamples\fP containing various examples of \fBicmake\fP script\&. Note in
particular the \fIexamples/icmbuild\fP subdirectory containing a general script
for \fBC++\fP and \fBC\fP program maintenance\&.
.PP
.SH "SEE ALSO"
\fBicmbuild\fP(1), \fBicmconf\fP(7),
\fBicmstart\fP(1), \fBicmstart\&.rc\fP(7), \fBmake\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-7.21.01/doc/manpage/ 0000755 0001750 0001750 00000000000 12267172275 014267 5 ustar frank frank icmake-7.21.01/doc/manpage/icmbuild.yo 0000644 0001750 0001750 00000012012 11743327112 016412 0 ustar frank frank includefile(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(icm)(0)(bf(icmbuild))
DEFINEMACRO(Icm)(0)(bf(Icmbuild))
DELETEMACRO(tt)
DEFINEMACRO(tt)(1)(em(ARG1))
COMMENT( man-request, section, date, distribution file, general name)
manpage(icmbuild)(1)(_CurYrs_)(icmake._CurVers_.tar.gz)
(A generic program maintenance script)
COMMENT( man-request, larger title )
manpagename(icmbuild)(A generic, easy configurable, program maintenance script)
COMMENT( all other: add after () )
manpagesynopsis()
icm() tt(mode)
manpagedescription()
The icm() script is a generic script that can be used to do program
maintenance using bf(icmake)(1).
The script expects two files to be available in the directory where program
maintenance is required, and the icm() script should be available in your
path or it should be started as, e.g., tt(./icmbuild)
Icm() assumes that your sources exist in and below a directory in which the
files tt(icmconf) and tt(CLASSES) live. The file tt(CLASSES) contains the
names of all subdirectories in which class-specific sources are kept. The file
tt(icmconf) in bf(icmake)(1)'s distribution offers an example of the
configuration parameters that are used for program maintenance. In this latter
file it is assumed that bf(C++) sources are maintained, but the icm() script
is not restricted to do maintenance for bf(C++) programs.
Icm() compiles all sources in each of the subdirectories named in the file
tt(CLASSES), and then compiles all sources in the current working directory
(except for the source containing tt(main())).
The compiled sources result in object modules which are then kept in a
library, against which the main-object module is linked. It is also possible
to specify additional libraries against which the program must be linked.
Once a library is constructed it is kept up to date by the script. Changing a
source will result in replacing its former module by its new module in the
library.
manpagesection(KICK-STARTING ICMBUILD)
Normally, icm() is installed and used as follows:
itemization(
it() Install icm() in your path;
it() copy tt(icmconf) and tt(CLASSES) to your project's base directory
(i.e., the directory in which and where below the project's sources are
found);
it() Modify the tt(#defines) in the file tt(icmconf) to taste;
it() List the subdirectories containing sources in the file tt(CLASSES)
Note that the order of the classes mentioned in classes em(is) relevant
here. It's no problem to add new class (subdirectory) names, but
reordering should be prevented. If reordering is required, recompile
the library, as the final object files contain class order-numbers.
These class-order numbers prevent file-name collisions and thus prevent
replacing file tt(x.o) from class tt(A) by file tt(x.o) from class
tt(B);
it() Now simply run
verb(
icmbuild
)
from the project's base directory and let the help-info tell you
what your options are. See the next section for the modes of operation.
)
manpageoptions()
Icm() may be called with the following operational modes:
itemization(
itt(clean)nl()
clean up remnants of previous activities
itt(help)nl()
provide help and exit (default when called without arguments)
itt(library)nl()
build the library (static and optionally the dynamic library)
itt(program)nl()
build the binary program
itt(program strip)nl()
build the stripped binary program
itt(install )
install the software in the locations defined in the tt(icmconf)
file, optionally below the directory tt()
)
The bf(icmconf) file may be given a line defining tt(DEFCOM) containing
the default operational mode to use when none is specified. E.g.,
verb(
#define DEFCOM "program"
)
constructs the program when the command `tt(icmbuild)' is
entered. tt(DEFCOM) may also contain combined options, like
verb(
#define DEFCOM "program strip"
)
Note that tt(DEFCOM) is ignored when an explicit operational mode is
provided to the icm() script.
manpagefiles()
The mentioned paths are sugestive only and may be installation dependent:
itemization(
it() bf(/usr/share/icmake/icmconf)
Example of a icm() configuration file;
it() bf(/usr/share/icmake/CLASSES)
Example of a icm() tt(CLASSES) file.
)
manpagesection(EXAMPLES)
Here is an example of the configuration file tt(icmconf) for a concrete
program, using the library tt(libbobcat1) as an additional library:
verbinclude(../../usr/share/icmake/icmconf)
manpageseealso()
bf(icmake)(1), bf(icmconf)(7), bf(icmstart)(1), bf(icmstart.rc)(7)
manpagebugs()
None reported
includefile(trailer.inc)
icmake-7.21.01/doc/manpage/release.yo 0000644 0001750 0001750 00000000065 12267172275 016261 0 ustar frank frank SUBST(_CurVers_)(7.21.01)
SUBST(_CurYrs_)(1992-2014)
icmake-7.21.01/doc/manpage/build 0000755 0001750 0001750 00000002022 11743327112 015276 0 ustar frank frank #!/usr/bin/icmake -qt /tmp/icmake-man
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 main(int argc, list argv)
{
string version;
string versionFile;
list line;
list cut;
string key;
string value;
versionFile = "../../VERSION";
rmrelease();
while (sizeof(line = fgets(versionFile, (int)line[1])))
{
cut = strtok(line[0], "= \t\n");
key = cut[0];
value = cut[1];
if (key == "VERSION")
fprintf("release.yo", "SUBST(_CurVers_)(", value, ")\n");
else if (key == "YEARS")
fprintf("release.yo", "SUBST(_CurYrs_)(", value, ")\n");
}
yodl("../icmake.1", "icmake.yo");
yodl("../icmstart.1", "icmstart.yo");
yodl("../icmbuild.1", "icmbuild.yo");
yodl("../icmstart.rc.7", "icmstart.rc.yo");
yodl("../icmconf.7", "icmconf.yo");
rmrelease();
}
icmake-7.21.01/doc/manpage/trailer.inc 0000644 0001750 0001750 00000000300 11743327112 016403 0 ustar frank frank manpagesection(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-7.21.01/doc/manpage/icmstart.rc.yo 0000644 0001750 0001750 00000011151 11743327112 017056 0 ustar frank frank includefile(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_.tar.gz)
(icmstart resource file)
COMMENT( man-request, larger title )
manpagename(icmstart.rc)(The icmstart(1) resource file)
manpagedescription()
The bf(icmstart.rc) file defines the initial files of a program that are
installed by bf(icmstart)(1).
By default bf(icmstart.rc) is found in tt(/etc/icmake/icmstart.rc), but if a
file tt($HOME/.icmake/icmstart.rc) is found then the latter file is used by
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
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() Optionally: a P (don't install with tt(icmstart xxx library)) or an L
(don't install with tt(icmstart xxx program)), followed by a blank; see also
bf(icmstart)(1).
it() Optionall: a tt(?) (followed by a blank) following the optional P or
L in which case the installation of the element must be confirmed by the user.
it() Source path names. Relative path names are interpreted relative to
the current working directory. Environment variables are not expanded, the
initial tilde character is interpreset as the user's home directory.
it() Source path names followed by a destination (relative to the
directory initialized by bf(icmstart)(1)).
)
A source path may be either a file or a directory. If a directory is
specified then all files in and below that directory will be installed.
When specifying a destination a path may be specified as well. However, the
destination path is always interpreted relative to the installation directory
specified when calling bf(icmstart)(1).
If a destination is omitted, the source is installed as specified below
bf(icmstart)(1)'s destination directory.
manpagesection(EXAMPLES)
The following entries can be used in an tt(icmstart.rc) file:
itemization(
it() tt(source)nl()
`Source' must be in the skeleton directory visited by bf(icmstart(1))
and is installed as tt(source) in the destination directory specified when
calling bf(icmstart)(1).
it() tt(source dest)nl()
`Source' must be in the skeleton directory visited by bf(icmstart(1))
and is installed as tt(dest) in the destination directory specified when
calling bf(icmstart)(1).
it() tt(~/path)nl()
`~/path' is installed as tt(~/path) in the destination directory
specified when calling bf(icmstart)(1). The tt(~)-character is expanded to the
user's home directory.
it() tt(~/path dest)nl()
`~/path' is installed as tt(dest) in the destination directory
specified when calling bf(icmstart)(1). The tt(~)-characteris expanded to the
user's home directory.
it() tt(/path)nl()
`/path' is installed as tt(./path) in the destination directory
specified when calling bf(icmstart)(1).
it() tt(/path dest)nl()
`/path' is installed as tt(dest) in the destination directory
it() tt(? source)nl()
The user must confirm the installation of tt(source).
it() tt(? source dest)nl()
The user must confirm the installation of tt(source) as tt(dest) in
the destination directory specified when calling bf(icmstart)(1).
it() tt(# text)nl()
Interpreted as comment and ignored. The tt(#)-character must be the
first character on the line.
it() an empty line+nl()
Empty lines are skipped.
)
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-7.21.01/doc/manpage/icmconf.yo 0000644 0001750 0001750 00000041134 12116630227 016246 0 ustar frank frank includefile(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_.tar.gz)
(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 bf(icmconf) configuration file is used to specify and tailor the
characteristics of program maintenance performed by the bf(icmbuild)(1) icmake
script. It can be used to activate and specify various directives that
determine how the program or library maintenance will proceed.
The directives are biased towards the construction of a bf(C++) program, but
program maintenance for other languages (e.g., bf(C)) can easily be realized
as well.
manpagesection(CLASS DEPENDENCIES)
Traditional make-utilities recompile sources once header files are
modified. In the context of bf(C++) program development this is often a bad
idea, as adding a new member to a class does not normally require you to
recompile the class's sources. To handle class dependencies in a more sensible
way, bf(icmake)(1)'s tt(CLASSES) file may define dependencies among classes.
If a class Y depends on class X as in:
verb(
class Y: public X
{
...
};
)
or as in:
verb(
class Y
{
X d_y;
...
};
)
then the sources of class Y should be recompiled if X's data organization
has changed. In cases like these Y depends on X.
Such class dependencies can be specified in the CLASSES file using the
form:
verb(
y x
)
where x and y are the directories holding the respective class sources. Then,
when altering X's data organization, do 'touch x/a', followed by 'icmbuild
program': x's sources as well as the sources in directories (in)directly
depending on x (e.g., y) are then automatically recompiled by icmbuild.
Multiple dependencies can also be specified. If the class
organization looks like this:
verb(
class Z: public Y
{
X d_x;
};
)
then Z depends on both Y and X. In the CLASSES file this may be indicated
by the line
verb(
z x y
)
Indirect dependencies are automatically followed. After changing X's data
organization where CLASSES contains the lines
verb(
x
y x
z y
)
then 'icmbuild program' results in recompiling all of the sources in
classes x, y and z.
By default, class-dependencies are not interpreted. To activate them the line
verb(
//#define USE_ALL "a"
)
in the tt(icmconf) file must be uncommented:
verb(
#define USE_ALL "a"
)
Empty lines and lines whose first non-blank character is a hash-mark (tt(#))
or whose first non-blank characters are two consecutive forward slashes (//)
are ignored. Long lines can be split over multiple lines by using a final
backslash character at lines which continue at the next line. E.g.,
verb(
name1 depends on \
multiple other \
classes
)
manpagesection(ICMCONF PARAMETERS)
itemization(
itb(#define ADD_LIBRARIES "")
When a program must be linked against additional libraries (other than
the name of the program's library itself, if specified at tt(LIBRARY))
then those libraries should be specified, blank space separated,
here. E.g., when a program is linked against tt(libbobcat) then the
specification is:
verb(
#define ADD_LIBRARIES "bobcat"
)
itb(#define ADD_LIBRARY_PATHS "")
When the 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.
itb(#define CLS)
The em(clear screen) directive. If defined tt(tput clear) is called to
clear the terminal screen before starting the compilation. By default
it is not defined.
itb(#define CXX "g++")
The C++ compiler to use. For a bf(C) compiler use, e.g., tt(#define CC
"gcc"). Its setting is overruled by an identically named environment
variable.
itb(#define CXXFLAGS "--std=c++0x -Wall -g -O2")
The compiler options to use. The default options are shown. When the
bf(C) compiler is used, use tt(#define CFLAGS) rather than
tt(CXXFLAGS). Its setting is overruled by an identically named
environment variable.
itb(#define DEFCOM "...")
A tt(DEFCOM) directive may be added to the tt(icmconf) file by
tt(icmstart). It may be defined as:
verb(
#define DEFCOM "program"
)
in which case tt(icmbuild) will do program maintenance. Alternatively
it may be defined as:
verb(
#define DEFCOM "program strip"
)
in which case tt(icmbuild) will do program maintenance, creating a
stripped binary program. It may also be defined as
verb(
#define DEFCOM "library"
)
in which case tt(icmbuild) will de library maintenance.
If this directive was not added by bf(icmstart)(1) it can always be
added to tt(icmconf) by hand.
itb(#define LDFLAGS "")
The 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 default this directive is not defined. If defined a local library is
constructed. When a binary program is built it will be linked against
this library rather than to the individual object modules.
If a library construction is intended (see also the tt(DEFCOM)
directive), then the tt(LIBRARY) directive defines the base name
(without the tt(lib) prefix and without the tt(.a) extension) of the
library to be constructed.
After a library construction tt(install static dir) installs the static
library at tt(dir), which tt(install shared dir) installs the shared
library (see below at tt(#define SHARED)) at tt(dir).
itb(#define MAIN "main.cc")
The source file defining the tt(int main) function. This specification
may be left as-is or may completely be removed if bf(icmbuild)(1) is
used for library maintenance rather than program maintenance.
itb(#define OBJ_EXT ".o")
The extension of object modules created by the compiler.
itb(#define PARSER_DIR "")
The subdirectory containing the parser's specification file. Leave
empty if no parser class is used and if no parser is generated.
The following directives, beginning with tt(PARS), are only
interpreted when tt(PARSER_DIR) is defined as a non-empty string.
itb(#define PARSFILES "")
If the parser specification file named at tt(PARSSPEC) itself includes
additional specification files, then patterns matching these
additional grammar specification files should be specified here. The
pattern is interpreted in the directory specified at tt(PARSER_DIR)
and could contain a subdirectory name (e.g. tt(specs/*)). When files
matching the pattern are modified then a new parser will be
created. By default no additional specification files are used.
itb(#define PARSFLAGS "-V")
The flags to use when calling the program specified at tt(PARSGEN).
itb(#define PARSGEN "bisonc++")
The name of the program generating the parser.
itb(#define PARSOUT "parse.cc")
The name of the file generated by the parser generator (which is used
by tt(icmbuild) to compare the timestamps of the parser specification
file(s) against).
itb(#define PARSSPEC "grammar")
The name of the parser specification file. This file is
expected in the directory specified at tt(PARSER_DIR).
itb(#define REFRESH)
Define tt(REFRESH) to relink the binary program at every tt(icmbuild
program) call. By default tt(REFRESH) is em(not) defined.
itb(#define SCANNER_DIR "")
The subdirectory containing the scanner's specification file. Leave
empty if no scanner class is used and if no lexical scanner is
generated. The following directives, beginning with tt(SCAN), are only
interpreted when tt(SCANNER_DIR) is defined as a non-empty string.
itb(#define SCANFILES "")
If the lexical scanner specification file named at tt(SCANSPEC) itself
includes additional specification files, then patterns matching these
additional lexer specification files should be specified here. The
pattern is interpreted in the directory specified at tt(SCANNER_DIR)
and could contain a subdirectory name (e.g. tt(specs/*)). When files
matching the pattern are modified then a new lexical scanner will be
created. By default no additional specification files are used.
itb(#define SCANFLAGS "")
The flags to use when calling the program specified at tt(SCANGEN).
itb(#define SCANGEN "flexc++")
The name of the program generating the lexical scanner.
itb(#define SCANOUT "lex.cc")
The name of the file generated by the lexical scanner (which is used by
tt(icmbuild) to compare the timestamps of the scanner specification
file(s) against).
itb(#define SCANSPEC "lexer")
The name of the lexical scanner specification file. This file is
expected in the directory specified at tt(SCANNER_DIR).
itb(#define SHARED)
This directive is only interpreted if tt(LIBRARY) was also specified.
If defined a static library (extension tt(.a)) as well as a shared
library (extension tt(.so*)) is built. If not specified, but
tt(LIBRARY) was specified, only the static library is built. By
default tt(SHARED) is not defined.
The shared library receives as its major version number tt(VERSION)'s
major version number, and receives tt(VERSION) as its full version
number. E.g., if tt(VERSION) is defined as tt(1.02.03) and tt(LIBRARY)
is defined as tt(demo) then the shared library tt(libdemo.so.1.02.03)
is constructed, with tt(libdemo.so.1) soft-linking to it, with
tt(libdemo.so) in turn 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 shared library.
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("-L/usr/lib/special -lspecial"). The tt(/lib) and
tt(/usr/lib) paths are usually predefined and need not be
specified. This directive is only interpreted if tt(SHARED) and
tt(LIBRARY) were also defined.
itb(#define SOURCES "*.cc")
The pattern to locate sources in a directory. The default value is
shown.
itb(#define TMP_DIR "tmp")
The directory in which intermediate results are stored. Relative to the
current working directory unless an absolute path is specified.
itb(#define USE_ALL "a")
After defining this directive (by default it is em(not) defined) a
class dependency setup defined in the CLASSES file is interpreted. In
this case, when a directory contains a file named at the tt(USE_ALL)
directive, then all sources of that class as well as all sources of
all classes depending on it are (re)compiled. The program's root
directory is assumed to depend on all other directories.
Class dependencies in CLASSES consist of the class name (as the first
word on a line) optionally followed by additional class names, which
are the classes on which the line's first class name depends.
Assuming that a program uses five classes tt(One, Two, Three, Four) and
tt(Five) and that class tt(Three) depends on class tt(Two), which in
turn depends on class tt(One), while class tt(Five) depends on
tt(Three) and tt(Four), then the file tt(CLASSES) may reflect these
dependencies as follows:
verb(
one
two one
three two
four
five three four )
Now touching (creating) the file tt(two/a) (using e.g., the command
tt(touch two/a)) causes all sources of the classes tt(Two, Three) and tt(Five)
as well as all the sources in the program's root directory to be recompiled:
tt(Two) is recompiled because of the existence of tt(two/a), tt(Three) is
recompiled because it depends on tt(Two), tt(Five) is recompiled because it
depends on tt(Three), the sources in the program's root directory are
recompiled because at least one directory is recompiled.
This facility was added to the tt(icmbuild) script because bf(C++) header
files are often modified em(without) the need to recompile all their depending
sources. No recompilation is necessary when a new class member function is
declared. Recompilation, however, em(is) necessary when the class's internal
organization changes, e.g., when the organization of its data members is
modified. Simply touching a file tt("a") is sufficient to perform
the necessary recompilations.
Following the recompilations the tt(USE_ALL) file(s) are removed.
When the tt(USE_ALL) directive was defined the command tt(icmbuild
clean) also removes any leftover tt(USE_ALL) files from the program's direct
subdirectories.
itb(#define USE_ECHO ON)
When specified as tt(ON) (rather than tt(OFF)) commands executed by
tt(icmbuild) are echoed.
itb(#define USE_VERSION)
If defined (which is the default) the file tt(VERSION) is read by
tt(icmconf) to determine the program/library's version, and the
project's release years.
)
manpagesection(OBSOLETE DIRECTIVES)
itemization(
itb(BINARY "")
This tt(#define) may safely be removed from older tt(icmconf) files as
it is no longer used by tt(icmbuild). When a binary program is
constructed it is created as tt(TMP_DIR "/bin/binary"), while
tt(install program path) installs the binary program at tt(path).
itb(BIN_INSTALL)
This tt(#define) may safely be removed from older tt(icmconf) files as
it is no longer used by tt(icmbuild). See tt(#define BINARY) for
details about how to install a binary program
itb(#define COMPILER "")
This tt(#define) should be replaced by tt(CXX) or tt(CC).
itb(#define COMPILER_OPTIONS "")
This tt(#define) should be replaced by tt(CXXFLAGS) or tt(CFLAGS).
itb(LIB_INSTALL)
This tt(#define) may safely be removed from older tt(icmconf) files as
it is no longer used by tt(icmbuild). See tt(#define LIBRARY) for
details about how to install libraries.
itb(#define LINKER_OPTIONS "")
This tt(#define) should be replaced by tt(LDFLAGS).
)
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 file.
itb(/etc/icmake)
Directory containing the default system-wide bf(icmake)(1)
configuration files (like tt(VERSION) and tt(icmstart.rc))
itb($HOME/.icmake)
Optional 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()
The interpretation of the class dependencies (see section bf(COMPILING AND
LINKING) has altered when tt(icmake) was updated to version 7.16.00.
includefile(trailer.inc)
icmake-7.21.01/doc/manpage/icmake.yo 0000644 0001750 0001750 00000105165 11743327112 016067 0 ustar frank frank includefile(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(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_.tar.gz)
(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() [options] tt(source[.im] [dest[.bim]]) [-- [args]]
bf(icmun) tt(bimfile)
manpagedescription()
Icm()(1) can be used as an alternative to bf(make)(1). In its standard
operation more, it calls the following programs:
itemization(
itt(icm-pp) to preprocess the icmake file
itt(icm-comp) to byte-code compile the icm() file(s)
it()tt(icm-exec) to interpret the byte-code file
)
Icm() allows the programmer to use a program language (closely resembling
the well-known bf(C)-programming language) to define the actions involved in
(complex) program maintenance. For this, icm() offers various special
operators as well as a set of support functions that have proven to be useful
in program maintenance.
The program bf(icmun)(1) may be used to disassemble the compiled
byte-code file.
Traditional make-utilities recompile sources once header files are
modified. In the context of bf(C++) program development this is often a bad
idea, as adding a new member to a class does not normally require you to
recompile the class's sources. To handle class dependencies in a more sensible
way, bf(icmake)(1)'s tt(CLASSES) file may define dependencies among
classes. By default, class-dependencies are not interpreted. See the
bf(icmconf)(7) man-page for details.
manpagesection(ADDITONS SINCE VERSION 7.00)
itemization(
it() Integral constants may be specified using hexadecimal notation (e.g.,
tt(0x12ab));
it() The tt(IM) environment variable may contain multiple directories,
separated from each other by colons (tt(:)).
itt(#define)-directives may refer to other macro definitions using the
tt(${identifier}) format.
itt(#ifdef), tt(#ifndef), tt(#else) and tt(#endif) directives can be
nested.
it() The `backtick' operator is defined, executing a program in a shell
and collecting its standard output in a list (see below).
it() The index operator (tt([])) is defined as an alternative to the
pre-defined function tt(element()), and can be used on lists and
strings.
it() The function tt(string getenv(string envvar)) is predefined. If
existing scripts already define a tt(getenv()) function of their own,
it it suggested to remove this function and use the new tt(getenv())
function instead. Alternatively, rename the script-defined function
tt(getenv()) and calls of this function to, e.g. tt(my_getenv()).
it() The function tt(int strstr(string haystack, string needle)) is
renamed to tt(int strfind(string haystack, string needle)).
bf(NOTE: this modification in version 7.00 could very well
affect your earlier (6.xx) icmake scripts. Changing `strstr'
into `strfind' should bring your older scripts up-to-date again.)
)
manpageoptions()
Icm():
tt(source): icm() script source file (default extension: tt(.im)).
tt(dest): binary icm() script file (default: tt(`source'.bim)).
tt(--): icm()/icm()-script arguments separator
tt(args): arguments following tt(--) are entered into the icm() scipt
tt(main()) function's tt(argv)-list (see below at section
bf(USER DEFINED FUNCTIONS)).
itemization(
sop(a)()(information about icm())
sop(b)()(blunt execution of the destinationfile)
sop(c)()(the destination file is only compiled)
sop(i)(file)(tt(file): name of source. Icm() argument processing stops.)
sop(o)(file)(all icm() output is written to tt(file) (Not
implemented on unix platforms))
sop(p)()(only the preprocessor is activated)
sop(q)()(quiet mode: copyright banner not displayed)
sop(t)(file)(tt(file) is used as a temporary bim-file, to be
removed on exit. Icm() argument processing stops.)
)
bf(Icmun):
tt(bimfile): binary icm() script file.
manpagesection(PREPROCESSOR DIRECTIVES)
The following preprocessor directives are available:
itemization(
it() comment:nl()
standard bf(C) comment (all between tt(/*) and tt(*/)) as well as
comment-to-end-of-line (all line contents following tt(//)) are
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 -qi
)
then tt(icm) may be given as a command, thus executing
verb(
/usr/bin/icmake -qi icm ...
)
Alternatively,
verb(
#! /usr/bin/icmake -qt /tmp/icm
)
may be used, resulting in the execution of
verb(
#! /usr/bin/icmake -qt /tmp/icm icm ...
)
In this case the binary makefile is not kept, but a temporary file
tt(/tmp/icm.PID) is used and removed on exit. The PID extension being
the process-id of the icm() program executing tt(icm).
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 directories pointed to by
the tt(IM) environment variable.
itt(#define identifier definition)nl()
The text tt(identifier) will be replaced by tt(definition). The
definition may contain references to already defined identifiers,
using the tt(${identifier}) format. If the tt(${identifier}) hasn't
been defined (yet), the text tt(${identifier}) is literally kept. At
each tt(#define) at most 100 text-replacements are performed,
preventing infinite recursion.
itt(#ifdef identifier)nl()
If the tt(identifier) macro was defined the next block of code (until
a matching tt(#else) or tt(#endif) directive was detected) is
byte-compiled. Otherwise, the block of code is ignored.
itt(#ifndef identifier)nl()
If the tt(identifier) macro was em(not) defined the next block of code
(until a matching tt(#else) or tt(#endif) directive was detected) is
byte-compiled. Otherwise, the block of code is ignored.
itt(#else)nl()
Terminates a tt(#ifdef) and tt(#ifndef) directive, reversing the
acceptance decision about the following code.
itt(#endif)nl()
Terminates the preprocessor block starting at the matching
tt(#ifdef), tt(#ifndef) or tt(#else) directive.
itt(#undef identifier) nl()
Remove tt(identifier) from the set of defined symbols. This will not
affect the specification of any previously defined symbols in which
tt(identifier) was used.
)
manpagesection(DATA TYPES)
The following data types are available:
itemization(
itt(int)nl()
Integral values, ranging from tt(-0x8000) until tt(0x7fff). tt(int)
constants may be specified as decimal numbers, hexadecimal numbers or
as tt(ASCII) character constants (e.g., tt('x')).
itt(string)nl()
Text variables. Text constants are delimited by double quotes. Multiple
text constants may be concatenated, but a text constant may not extend
over multiple lines. To indicate an end-of-line in a text constant use
the tt(\n) escape sequence. The escape sequences tt(\a \b \f \n \r)
and tt(\t) are available. Otherwise, tt(\x) is interpreted as a
literal tt(x). So, use tt(\\) to indicate tt(\) within a text
constant.
itt(list)nl()
A data structure containing a series of individually accessible
tt(string) values. When a list contains elements, its first element is
indicated by index 0.
itt(void)nl()
Used with function definitions to indicate that the function does not
return a value.
)
Variables may be defined both at the global level as well as locally to
functions. Variables are strongly typed. A variable cannot have the type
tt(void).
Variables may be initialized when they are defined. The initialization can
use return values of functions, but cannot use variables. Consider
initializations as being constructed from constant values.
manpagesection(PREDEFINED SYMBOLS)
The following symbols are predefined by icm(). All are constant tt(int)
values:
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 symbols are available depending on the architecture:
table(2)(ll)(
rowline()
row(cell(symbol)cell(1 when defined on the platform, otherwise 0))
rowline()
row(cell(MSDOS) cell(MS-DOS platform (with MSC 7.00 compiler)))
row(cell(unix) cell(Unix, usually with GNU's gcc compiler))
row(cell(linux) cell(x86 running Linux (usually with gcc)))
row(cell(M_SYSV, M_UNIX)
cell(x86 running SCO/Unix (usually with) Microsoft C))
row(cell(_POSIX)cell(_SOURCE Unix with Posix complient compiler))
row(cell(__hpux)cell(HP-UX, with the native HP compiler))
rowline()
)
manpagesection(OPERATORS)
All bf(C) operators, except for the ternary operator, are supported,
operating like their bf(C) counterparts on tt(int) variables and/or values.
Additionally, for tt(string) type variables and/or values the following
operators are available:
itemization(
itt(a + b): returns a new tt(string) value containing the concatenation of
tt(string) values tt(a) and tt(b). Note that tt(string) constants may be
concatetated without using the tt(+) operator, e.g.,
verb(
"hello " "world"
"hello " + "world"
)
itt(a += b): tt(a) must be a tt(string) variable, to which the tt(string)
variable or value tt(b) is appended.
it() string comparisons: operators tt(== != <= >= < > !=) and tt(==) may
be applied to tt(string) values or variables, returning 1 if the comparison
succeeds, otherwise 0. Comparison is case sensitively, and follows the
tt(ASCII) character set.
itt(!a): the boolean tt(!) operator returns 1 if the tt(string a) is
empty, otherwise 0 is returned.
itt(a younger b, a newer b): returns 1 if file tt(a) is more recent than
file tt(b). E.g., tt("source.cc" newer "source.o"). If tt(b) doesn't exist, 1
is returned; if tt(a) doesn't exist 0 is returned; if neither tt(a) nor tt(b)
exists, 0 is returned; if they are of the same age, 0 is returned. Explicit
tests for the existence of a file can be performed using the tt(exists())
predefined function (see below, section bf(PREDEFINED FUNCTIONS)).
itt(a older b): turns 1 if file tt(a) is older than file tt(b). E.g.,
tt("libprog.a" older "source.o"). If tt(a) doesn't exist, 1 is returned; if
tt(b) doesn't exist 0 is returned; if neither tt(a) nor tt(b) exists, 0 is
returned; if they are of the same age, 0 is returned.
itt([]): the index operator is defined as an alternative to the built-in
function tt(element). It can only be applied (as holds true for tt(element())
as well) as so-called em(rvalue). Therefore, constructions like:
verb(
// assume str1 and str2 are strings
str1 = str2[3]
)
will be accepted, but the following construction will not be accepted:
verb(
str2[3] = str; // won't compile
)
)
For tt(list) type variables and/or values the following
operators are available:
itemization(
itt(a + b): returns a new tt(list) value containing the concatenation of
tt(list) values tt(a) and tt(b). This is em(not) a set operation: if an
element appears both in tt(a) and in tt(b), they will appear twice in the
resulting list.
itt(a - b): returns a new tt(list) value containing the elements in tt(a)
that are not present in tt(b). This em(is) a set operation.
itt(a += b): elements in tt(b) are added to the elements in tt(a), which
must be a tt(list) variable. This is em(not) a set operation.
itt(a -= b): elements in tt(b) are removed from the elements in tt(a),
which must be a tt(list) variable. This em(is) a set operation.
it() list equality comparisons: operators tt(!=) and tt(==) may be applied
to tt(list) values or variables. Operator tt(==) returns 1 if both lists have
element-by-element identical elements, 0 otherwise. Operator tt(!=) reverses
the result of tt(==).
itt(!a): the boolean tt(!) operator returns 1 if the tt(list a) is
empty, otherwise 0 is returned.
itt([]): the index operator is defined as an alternative to the built-in
function tt(element). It can only be applied (as holds true for tt(element())
as well) as so-called em(rvalue). Therefore, constructions like:
verb(
// assume lst is a list, str is a string
str = lst[3]
)
will be accepted, but the following construction will not be accepted:
verb(
lst[3] = str; // won't compile
)
)
Typecasts may be performed using the standard bf(C) cast-operator to cast:
itemization(
it() Strings to ints and vice versa (tt((int)"123", (string)55))
it() Strings may be cast to lists (tt(list lst = (list)"hello"))
)
manpagesection(FLOW CONTROL)
Icm() offers the following subset of bf(C)'s statement types. They can be
used as in the bf(C) programming language.
itemization(
itt(expression ;)nl()
The plain expression statement;
it() The compound statement nl()
Different from bf(C) icm() does not support variable definitions
inside a compound statement. All variables used locally
by a function must be defined as either function parameters or
as variables that are defined immediately at the beginning of a
function's body.
itt(if (condition) statement)
itt(if (condition) statement else statement)
itt(for (init; condition; increment) statement)nl()
The variable(s) used in the initialization section must already have
been defined. The tt(init), tt(condition) and tt(increment) sections
may be left empty. The empty condition section is interpreted as
`always tt(true)'.
itt(while (condition) statement)nl()
The tt(do ... while()) statement is not implemented for icm().
itt(return) (for tt(void) functions) and tt(return expression) for other
functions.
itt(break)nl()
To leave tt(for) and tt(while) statements, overruling the statement's
condition. bf(C)'s tt(continue) is not available.
itt(exit(expression))nl()
To terminate the icm()-script. The tt(expression) must evaluate to an
tt(int) value, which becomes the script's exit value.
)
manpagesection(PREDEFINED FUNCTIONS)
Icm() offers the following predefined functions, which can be used
immediately by icm() scripts. The function overview is ordered alphabetically
by function name, but where appropriate short summary labels are
provided:
Helper functions of tt(exec()) (see also below at tt(exec())):
itemization(
itt(void arghead(string h))nl()
Defines the `argument head', to be used with tt(exec()). By default,
the `argument head' is an empty string.
itt(void argtail (string t))nl()
Defines the `argument tail', to be used with tt(exec()). By default,
the `argument tail' is an empty string.
)
String-to-ascii converters:
itemization(
itt(int ascii(string s))nl()
Returns the first character of tt(s) as an int; e.g.,
tt(ascii("A")) returns 65;
itt(string ascii(int i))nl()
Returns tt(i) as a string, e.g., tt(ascii(65)) returns the string
tt("A");
)
System calls:
itemization(
it() The `backtick` operator (tt(`))nl()
A string placed between two backticks is executed by the tt(popen)(3)
function. The standard output gererated by the command that is stored
in the string argument is returned as a list. An empty list indicates
that the command could not be executed. A command that could be
executed but did not produce any output returns a list containing one
empty element. The command's standard error stream output is not
automatically collected. Standard shell redirection could be used to
collect the standard error stream's output as well. Example:
verb(
string s = "ls";
printf(`s`); // prints the elements in the current
// directory
)
)
Filename modifiers:
itemization(
itt(string change_base(string file, string newbase))nl()
Changes the basename of tt(file), returns the changed name. E.g,
tt(change_base("/path/demo.im", "out")) returns tt("/path/out.im");
itt(string change_ext(string file, string newext))nl()
Changes the extension of tt(file), returns the changed name. E.g,
tt(change_ext("source.cc", "o")) returns tt("source.o");
itt(string change_path(string file, string newpath))nl()
Changes the path specification of tt(file), returns the changed name.
E.g, tt(change_path("tmp/binary", "/usr/bin")) returns
tt("/usr/bin/binary"). Note that the tt(/)-separator is inserted if
required.
)
System calls:
itemization(
itt(string chdir(string newdir))nl()
Changes the script's working directory, returns the previous dir as an
absolute path.nl()
Use tt(chdir(".")) to get current working directory,
tt(chdir("")) may be used to obtain the startup working directory (this
functionality was broken in releases before than 7.00, but is now
operational). The function terminates the icm()-script if the
specified tt(newdir) does not exist.
itt(string chdir(int checking, string newdir))nl()
Same functionality as the previous function, but by specifying
tt(checking) as tt(P_NOCHECK) the function won't terminate the
script. Rather, it will return the script's current working
directory.
)
Helper functions of tt(exec()) (see also below at tt(exec())):
itemization(
itt(cmdhead(string h))nl()
Defines a `command head', to be used with tt(exec()). By default,
the `command head' is an empty string.
itt(cmdtail(string t))nl()
Defines a `command tail', to be used with tt(exec()). By default,
the `command tail' is an empty string.
)
Icm() execution modifier:
itemization(
itt(echo(int opt))nl()
Controls echoing of called programs (and their arguments), specify
tt(OFF) if echoing is not requested. By default tt(ON) is active.
)
Functions returning elements of aggregates:
itemization(
itt(string element(int index, list lst))nl()
Returns string tt(index) (0-based) from tt(lst). An empty string is
returned if an unavailable index value is provided. See also the
tt([]) operator in the section bf(OPERATORS).
itt(string element(int index, string str))nl()
Returns character tt(index) (0-based) from tt(str). An empty string is
returned if an unavailable index value is provided. See also the
tt([]) operator in the section bf(OPERATORS).
)
System calls:
itt(exec(string cmd, ...))nl()
Executes command with arguments. Each argument will be prefixed by
tt(arghead())'s argument and postfixed by tt(argtail())'s
argument. Note that no blanks are inserted between tt(arghead())'s
contents, the argument proper, and tt(argtail())'s argument. All thus
modified arguments are concatenated, this time separated by single
blanks, and then tt(cmdhead())'s contents are inserted between the
command and the first argument (on either side delimited by single
blanks) and tt(cmdtail())'s contents are appended to the arguments
(again, separated by a single blank). tt(PATH) is searched to locate
tt(cmd). 0 is returned.
itt(exec(int checkcmd, string cmd, ...))nl()
Same functionality as the previous function, but by specifying
tt(checking) as tt(P_NOCHECK) the function won't terminate the
script. Rather, it will return the called command's exit status, or
tt(0x7f00) if the command wasn't found.
itt(execute(string cmd, string cmdhd,
string arghd, ..., string argtl, string cmdtl))nl()
Same as tt(exec()), but command head/tail and argument
head/tail must be specified.
The actually executed command starts with tt(cmd), followed by
tt(cmdhd). Next is a series of arguments follows, each
enclosed by tt(arghd) and tt(argtl). The command terminates
with tt(cmdtl). 0 is returned
itt(execute(int checking, string cmd, string cmdhd,
string arghd, ..., string argtl, string cmdtl))nl()
Same functionality as the previous function, but by specifying
tt(checking) as tt(P_NOCHECK) the function won't terminate the
script. Rather, it will return the called command's exit status, or
tt(0x7f00) if the command wasn't found.
)
System interface:
itemization(
itt(int exists(string file))nl()
Returns a non-zero value if tt(file) exists, otherwise 0 is returned.
)
Input interface:
itemization(
itt(list fgets(string file, int offset))nl()
The next line found at offet tt(offset) is read from tt(file).
It returns a list tt(retlist) containing two elements:nl()
tt(element(0, retlist)) is the string that was read
(including the tt(\n), if found)nl()
tt(element(1, retlist)) is the next offset to read.nl()
An empty return list signifies tt(EOF). Since an empty list's `first'
eement is an empty string, which is converted to the value 0, a file
may be read and processed as follows:
verb(
list line;
while (1)
{
line = fgets("filename", (int)line[1]);
if (!line)
break;
process(line[0]);
}
)
)
Output interface:
itemization(
itt(int fprintf(string filename, ...))nl()
Appends all (comma separated) arguments to the file
tt(filename). Returns the number of printed arguments.
)
Filename modifier:
itemization(
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. Eg., 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).
)
System interface:
itemization(
itt(list getenv(string envvar))nl()
Returns the value of environment variable tt(envvar) in a list
containing two elements:nl()
the first element indicates whether the environment variable was
defined (value tt("1")) or not (value tt("0"));nl()
the second element indicates the value of the environment variable.
Enivironment variables are of the form tt(variable=value), and if
defined the list's second element contains tt(value). If the value is
empty, the variable is defined, but has no text associated with it.
)
Filename modifier:
itemization(
itt(string get_ext(string file))nl()
Returns the extension of tt(file), except for the separating dot. The
extension is all information starting at the final dot
in the filename. If no final dot is found, the extension is an empty
string.
)
Input interface:
itemization(
itt(string getch())nl()
Returns the next pressed key as a string (no `Enter' required for
ms-dos and unix (incl. linux) systems).
)
Filename modifier:
itemization(
itt(string get_path(string file))nl()
Returns the path-prefix of tt(file). The path prefix is all information
up to (and including) the final directory separator (which is,
depending on the operating system, a forward- or backslash).
If no path is found, an empty strring is returned.
)
System interface:
itemization(
itt(int getpid())nl()
Returns the process-id (UNIX) or PSP-paragraph (DOS) of the icmake byte
code interpreter bf(icm-exec).
)
Input interface:
itemization(
itt(string gets())nl()
Returns the next line read from the keyboard as a tt(string). The line
entered on the keyboard must be terminated by an `Enter' key, which is
not stored in the returned string.
)
Functions creating lists of files:
itemization(
itt(list makelist(string mask))nl()
Returns a list of all files matching tt(mask). E.g.,
tt(makelist("*.c")) returns a list containing all files ending in
tt(.c).
itt(list makelist(type, string mask))nl()
Same as the previous function, but the type of the directory elements
may be specified as its first argument:
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 files))
row(cell(O_SUBDIR)cell(obtain all subdirectories))
rowline()
)
Note that the pattern tt(*) will not match hidden entries under Unix-type
operating systems. Use tt(.*) for that.
itt(list makelist(string mask, newer, string comparefile))nl()
Returns list of all files matching mask which are newer
than a provided comparefile. Operator tt(younger) may be used instead
of tt(newer). Note that tt(newer) and tt(younger) are operators, not
strings.
itt(list makelist([int = O_FILE,] string mask, newer,
string comparefile))nl()
Same as the previous function, but tt(type) may be specified as in
tt(list makelist(type, string mask)).
itt(makelist(string mask, older, string comparefile))nl()
See above; returns a list of files that are older than the
comparefile.
itt(makelist(type, string mask, older, string comparefile))nl()
Same as the previous function, but tt(type) may be specified as in
tt(list makelist(type, string mask)).
)
Output interface:
itemization(
itt(int printf(...))nl()
Shows all (comma separated) arguments to screen (i.e., the standard
output stream). Returns the number of printed arguments.
)
System interface:
itemization(
itt(int putenv(string envvar))nl()
Adds tt(envvar) to the current (bf(icmake)) environment
Use the format: "VAR=value". Returns 0.
)
List information:
itemization(
itt(int sizeof(list l))nl()
Returns the number of elements in tt(list)
)
System information:
itemization(
itt(list stat(string entry))nl()
Returns bf(stat)(2) information of directory entry tt(entry) as
a list. The returned list has two elements: element 0 is the
em(attribute value), element 1 contains the size of the file.
Attributes are returned as bit-flags, composed from the
following predefined constants:
verb(
S_IFCHR S_IFDIR S_IFREG
S_IREAD S_IWRITE S_IEXEC
)
See the bf(stat)(2) manual page for the meanings of these constants.
itt(list stat(checking, string entry))nl()
Same as the previous function, but by specifying tt(checking) as
tt(P_NOCHECK) the function won't terminate the script. Rather, it will
rturn bf(stat)(2)'s return value.
)
String support:
itemization(
itt(int strlen(string s))nl()
Returns the number of characters in tt(s) (not counting the final 0).
itt(int strfind(string haystack, string needle))nl()
returns index in tt(haystack) where tt(needle) is found, or -1 if
tt(needle) is not contained in tt(haystack).nl()
bf(This function was called strstr() in versions before 7.00).
itt(string strlwr(string s))nl()
Returns a lower-case duplicate of tt(s).
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). E.g.,
tt(strtok("hello icmake's+world", " +")) returns the list containing
the three strings tt("hello"), tt("icmake's"), and tt("world").
itt(string strupr(string s))nl()
Returns an upper-case duplicate of tt(s).
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
size or if tt(count <= 0), then an empty string is returned. If
tt(offset) is less than 0 then 0 is used.
)
System calls:
itemization(
itt(int system(string command))nl()
Executes tt(command). The return value indicates the executed
command's exit value. The string tt(command)) may contain redirection
and/or piping characters.
itt(int system(int checking, string command))nl()
Same functionality as the previous function, but by specifying
tt(checking) as tt(P_NOCHECK) the function won't terminate the
script. Rather, it will return the called command's exit status, or
tt(0x7f00) if the command wasn't found.
)
manpagesection(USER DEFINED FUNCTIONS)
Icm() scripts may define functions, and a function tt(main()) em(must) be
defined. Functions must have the following elements:
itemization(
it() The function's return type. One of the available types must be
used explicitly, e.g., tt(void). There is no default type.
it() The function's name, e.g., tt(compile).
it() A parameter list, defining zero or more comma-separated
parameters. The parameters themselves consist of a type name followed by the
parameter's identifier. E.g., tt((string outfile, string source)).
it() A em(body) surrounded by a pair of curly braces (tt({) and tt(})).
Function bodies may contain (optionally initialized) variable
definitions. Variable definitions start with a type name, followed by one or
more comma separated (optionally initialized) variable identifiers. If a
variable is not explicitly initialized it is initialized by default. An
tt(int) variable is initialized to 0, a tt(string) is initialized to empty
text (tt("")) and a tt(list) is initialized to a list of zero elements.
Following variable definitions, bodies may contain zero or more statements
(see below at section bf(FLOW CONTROL) for the various flow-control
statements). Note that all local variables must be defined at the very
beginning of function bodies.
)
User defined functions must be defined before they can be used, although they
may be called recursively. Therefore, indirect recursion is not supported by
icm().
The user-defined function tt(main()) has three optional arguments, which may
be omitted from the last one (tt(envp)) to the first (tt(argc)), as in
bf(C). Its full prototype is (note: bf(void) return type):
verb(
void main(int argc, list argv, list envp)
)
In tt(main()),
itemization(
itt(argc) represents the number of elements in tt(argv);
itt(argv) contains the arguments, with element 0 the compiled icm() script
(the `tt(.bim)' file);
itt(envp) containts the `environment' variables. The function tt(sizeof())
(see below) may be used to determine its elements. Elements in tt(envp) have
the form tt(variable=value). Alternatively, the function tt(getenv()) (see
below) can be used to retrieve a specific environment variable immediately.
)
Example:
verb(
void main(int argc, list argv)
{
list toCompile;
int idx;
if (argc == 1)
usage(element(0, argv));
if (toCompile = altered("*.cc"))
{
for (idx = sizeof(toCompile); idx--; )
compile(element(idx, toCompile));
if (getenv("dryrun")[0] == "0")
linking(element(2, argv));
}
exit (0);
}
)
manpagefiles()
The mentioned paths are sugestive only and may be installation dependent:
itemization(
it() bf(/usr/bin/icmake): the main icm() program;
it() bf(/usr/bin/icmun): the icm() unassembler;
it() bf(/usr/lib/icm-pp): the preprocessor called by icm();
it() bf(/usr/lib/icm-comp): the compiler called by icm();
it() bf(/usr/lib/icm-exec): the byte-code interpreter called by icm();
)
manpagesection(EXAMPLES)
The distribution (usually in tt(/usr/share/doc/icmake)) contains a
directory tt(examples) containing various examples of icm() script. Note in
particular the tt(examples/icmbuild) subdirectory containing a general script
for bf(C++) and bf(C) program maintenance.
manpageseealso()
bf(icmbuild)(1), bf(icmconf)(7),
bf(icmstart)(1), bf(icmstart.rc)(7), bf(make)(1)
manpagebugs()
None reported
includefile(trailer.inc)
icmake-7.21.01/doc/manpage/icmstart.yo 0000644 0001750 0001750 00000014021 11743327112 016452 0 ustar frank frank includefile(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_.tar.gz)
(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()
The bf(icmstart) script is a generic script that can be used to start program
maintenance using bf(icmake)(1) and bf(icmbuild)(1). bf(Icmstart) creates
an initial directory 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.
Skeleton files for the main directory and subdirectories, by default listed in
the file tt(/etc/icmake/icmstart.rc), may be installed as well
(cf. bf(icmstart.rc)(7)).
After changing to the directory created by bf(icmstart) the bf(icmbuild)(1)
script may be used for program maintenance.
manpageoptions()
tt(Icmstart) may be called with the following options, which (if specified)
must be the first arguments of tt(icmstart):
itemization(
itt(-c confpath)nl() Use the configuration files (tt(icmstart.rc, AUTHOR,
YEARS) and tt(VERSION)) if found in `confpath' rather than 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)
Unconditionally replace existing files. If tt(-r) is not
provided bf(icmstart) will ask 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 will be 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(#))) which is ignored, and should otherwise contain
specifications of resource file(s) to install.
The default resource file is tt(/etc/icmake/icmstart.rc), contains
verb(
CLASSES
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). See
bf(icmstart.rc)(7) for details about the format of the tt(icmstart.rc) file.
manpagesection(CONFIGURATION FILES)
The configuration files tt(icmstart.rc, AUTHOR, YEARS) and tt(VERSION) are
recognized and 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 not required for the proper operation of tt(icmstart).
When absent tt(icmstart) performs the following default actions:
itemization(
it() If the file tt(AUTHOR) does not exist tt(icmstart) uses tt(#define
AUTHOR "").
When the file tt(AUTHOR) is defined in a configuration path it should have
one line, defining the author of the program. E.g.,
verb(
#define AUTHOR "Frank B. Brokken "
)
it() If the file tt(VERSION) does not exist tt(icmstart) uses tt(#define
VERSION "0.00.00").
When the file tt(VERSION) is defined in a configuration path it should
have one line, defining the program's initial version. E.g.,
verb(
#define VERSION "1.00.00"
)
it() If the file tt(YEAR) does not exist tt(icmstart) uses tt(#define
YEARS "yyyy") where tt(yyyy) is the current year.
When the file tt(YEAR) is defined in a configuration path it should have
one line, defining the program's initial release year. E.g.,
verb(
#define YEARS "2012"
)
Plural is used here since a release year usually becomes a range of years
after some time, as with Icmake's years specification:
verb(
#define YEARS "1992-2012"
)
)
it() If the file tt(icmstart.rc) does not exist (or is empty) tt(icmstart)
will not install any of the files normally found in tt(icmstart.rc), but the
initial project directory, tt(icmconf) and tt(VERSION) are installed.
)
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(/usr/share/icmake/icmstart.rc)
Default skeleton resource file.
)
manpageseealso()
bf(icmake)(1), bf(icmbuild)(1), bf(icmconf)(7), bf(icmstart.rc)(7).
manpagebugs()
None reported
includefile(trailer.inc)
icmake-7.21.01/doc/README.icmbuild 0000644 0001750 0001750 00000004771 11743327112 015325 0 ustar frank frank The `icmbuild' script is a generic script that can be used to do program
maintenance using icmake.
The script expects two files to be available in the directory where program
maintenance is required, and the icmbuild script should be available in your
path or it should be started as, e.g., ./icmbuild
The script assumes that your sources (currently C++ sources, but see the file
`icmconfig') exist in the directory in which icmconfig and the file CLASSES
live, and that the file CLASSES contains the names of all subdirectories in
which class-specific sources are kept.
The script compiles all sources in each of these subdirectories, and then all
sources in the current working directory (except for the source containing
main())
The compiled sources result in object modules which are then stored in a
library, against which the main-source is linked.
Additional libraries can be added to this linking process as well.
Once a library is constructed it is kept up to date by the script. Changing a
source will result in replacing its former module by its new module in the
library.
To use icmbuild the following is suggested:
1. Install icmbuild in your path
2. copy icmconf and CLASSES to your project's base directory (i.e., the
directory in which and where below the project's sources are found)
3. Modify the #defines in the file icmconf to taste
4. Mention the subdirectories containing sources in the file CLASSES
Note that the order of the classes mentioned in classes *is* relevant.
It's no problem when classes are added, but reordering should be
prevented. If reordering is required, recompile the library as the
final object files contain class order-numbers.
These class-order numbers prevent file-name collisions and thus
prevent replacing file x.o from class A by file x.o from class B.
5. now simply run
icmbuild
from the project's base directory and let the help-info tell you
what your options are. You should see something like:
Usage: icmbuild mode
Where `mode' is one of:
clean - clean up remnants of previous activities
library - build the static library tmp/libmodules.a
program - build tmp/binary
program strip - build stripped tmp/binary
install - to install the software in the locations
defined in the icmconf file, optionally
below
icmake-7.21.01/doc/icmake.doc 0000644 0001750 0001750 00000017273 11743327112 014577 0 ustar frank frank =============================================================================
ICMAKE
the Intelligent C-like MAKEr, or
the ICce MAKE utility
Copyright (c) Frank B. Brokken and Karel Kubat
frank@icce.rug.nl, karel@icce.rug.nl
ICCE, State University of Groningen, Netherlands
This document is part of distribution 6.20 of ICMAKE
=============================================================================
Introduction
------------
Icmake is a hybrid between a 'make' utility and a 'shell script'
language. Originally, it was concocted to provide a useful tool for
automatic program maintenance and system administrative tasks on MS-DOS
platforms. As we learned to appreciate its flexibility, Icmake was
eventually ported to Unix platforms (SCO and Linux). By now Icmake also runs
on a HP-Unix platform.
To give an impression of "what Icmake does", take a look at the
following makefile. It is used for automatic program maintenance, where it
is assumed that in some directory all files with the extension ".c" (C
source files) constitute a program "myprog". The automatic maintenance makes
sure that, once Icmake is invoked, C source files which are more recent
(newer) than a library file "libmyprog.a" are recompiled and placed in the
library. A new program is then made and installed in a directory
"/home/user/bin".
void main ()
{
list
cfiles; // list of .c files
int
i; // counter variable
string
sourcefile; // string with name of
// 1 source file
cfiles = makelist ("*.c", younger, // cfiles is now a list of
"libmyprog.a"); // all files to recompile
if (cfiles) // if there are any files..
for (i = 0; i < sizeof (cfiles), // recompile them
i++)
{
sourcefile = element (i, cfiles); // get the name from the list
exec ("gcc", "-c -Wall", sourcefile); // recompile
}
if (makelist ("*.o")) // any "*.o" files here?
{
exec ("ar", "rvs", "libmyprog.a", "*.o"); // add to library
exec ("rm", "*.o"); // remove them
exec ("gcc", "-o myprog", "libmyprog.a"); // re-link program
exec ("mv", "myprog", "/home/user/bin"); // and install in bin dir
}
}
The source files for Icmake look remarkably like C sourcefiles. The
resemblance is so close that this cannot be pure chance! Yes, we have
implemented Icmake to be a language with a syntax which largely overlaps C.
Since we know how to program in C, we decided that we didn't want to learn
some new macro language. The Icmake language is a "subset" of C in the
sence that not all operators or functions of C are implemented (but a good
deal are, e.g., gets(), getch(), printf(), etc.). The Icmake language has
its own extensions to make it a handy language for the purpose of
maintenance: e.g., the operator "younger" compares two files in respect to
their date of last modification, a type "list" is defined to hold several
strings.
The usage of Icmake is not restricted to program maintenance. The
setup, which allows for functions, arguments, local or global variables, the
calling of external programs, etc. makes Icmake also extremely suitable as
a shell script language. E.g., it is easy to accomplish to let Icmake
figure out which files need to be backupped since the last backup date and
to start a process to do so, to send mail about it etc.
This guide provides a short description how Icmake can be ported to
new platforms. The documentation for the usage of Icmake, including a
description of the grammar and of all built-in functions, comes with the
distribution files.
Installing Icmake
-----------------
The icmake-X.YY.tgz contains all source files and installation information
if you want to install icmake from scratch. You *need* this file if you
want to install icmake on systems not running Linux or Ms-DOS.
The icmake-X.YY.bin.tgz contains linux and ms-dos executables. If you only
want to use the icmake programs, you can get this file, unpack it and start
using icmake.
See the file INSTALL for details. INSTALL is in icmake-X.YY.tgz,
containing all other files necessary for installing icmake.
To unpack the archives use (GNU-tar 1.11.2):
tar xzvf icmake-X.YY.tgz
and/or:
tar xzvf icmake-X.YY.bin.tgz
which unpacks into an 'icmake' subdirectory below the current subdirectory.
Also, separate gzip and tar steps could be used, as in:
gzip -c -d icmake-X.YY.tgz | tar xvf -
and/or:
gzip -c -d icmake-X.YY.bin.tgz | tar xvf -
The Documentation
-----------------
Icmake is documented in a Postscript file, "icmake.ps", located in
the directory "doc". This file is generated from a .dvi file using dvips,
and can be processed with GhostScript. Note that the file is generated for
a printer resolution of 300 dpi, which suits a LaserJet family printer. If
your site lacks the means to print this file, you can mail us at the address
below to obtain a printed copy of the documentation. (However, we will
charge you a small amount to cover our costs).
The directory "doc" furthermore contains the file "icmake.1". This
is a crude "man" page for Unix systems. You can install it by copying it to
a directory which contains formatted manual pages. To use this feature,
your "man" command must be able to show an already-formatted manual entry.
E.g., on Linux systems you can copy this file to "/usr/man/cat1". Typing
"man icmake" will then show the information. Some man systems also support
compressed manual pages. On these systems you may achieve a lower disk
usage by compressing the file "icmake.1" to "icmake.1.Z", using the Unix
program "compress".
A few makefiles are provided as examples in the directory
"examples". You may wish to look at these to see how makefiles can be
organized.
Some Legal Stuff
----------------
You don't have to pay us for Icmake. This means that no fee is
charged for it by us. As with everything that's free, there's no pay but
also *absolutely no warranty*. Furthermore, you are allowed (and
encouraged) to distribute Icmake, provided that you include this information
with each distribution. It is strongly suggested that you do *not* charge
money for the distribution of Icmake (possibly not even the $5 for
shipping).
The source files and the documentation for Icmake are copyrighted by
us. The reason for this is (a) that we'd like to have always the last
version of Icmake, and (b) that we'd like to have the last word in all
modifications. If you have requests (or even better, "working code" to
include in Icmake) please mail us and we'll gladly oblige when we find the
time.
Requests, Bug Reports, etc.
---------------------------
We'd very much appreciate it if you'd let us know if you encounter any
bugs. Also, if you have requests or comments about the programs or the
documentation, mail us. We can be reached at:
Frank Brokken Karel Kubat
e-mail: F.B.Brokken@icce.rug.nl K.Kubat@icce.rug.nl
phone: (+31) 50 63 36 88 (+31) 50 63 36 47
address: Westerhaven 16 Westerhaven 16
Groningen Groningen
Netherlands Netherlands
-----------------------------------------------------------------------------
(end of icmake.doc)
icmake-7.21.01/doc/icmake.ps 0000644 0001750 0001750 00000753243 11743327112 014460 0 ustar frank frank %!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(change_ext)d
(\("main.c",)h("obj"\);)154 703 y(//)i(name)e(now)i(is)f("main.obj")154
743 y(name)g(=)h(change_ext)d(\(name,)i(""\);)154 782
y(//)h(name)e(now)i(is)f("main")154 821 y(name)g(=)h(change_ext)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(P_CHECK)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(\(O_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-7.21.01/doc/icmconf.7 0000644 0001750 0001750 00000042452 11743327112 014362 0 ustar frank frank .TH "icmconf" "7" "1992\-2012" "icmake\&.7\&.18\&.00\&.tar\&.gz" "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 \fBicmconf\fP configuration file is used to specify and tailor the
characteristics of program maintenance performed by the \fBicmbuild\fP(1) icmake
script\&. It can be used to activate and specify various directives that
determine how the program or library maintenance will proceed\&.
.PP
The directives are biased towards the construction of a \fBC++\fP program, but
program maintenance for other languages (e\&.g\&., \fBC\fP) can easily be realized
as well\&.
.PP
.SH "CLASS DEPENDENCIES"
.PP
Traditional make\-utilities recompile sources once header files are
modified\&. In the context of \fBC++\fP program development this is often a bad
idea, as adding a new member to a class does not normally require you to
recompile the class\(cq\&s sources\&. To handle class dependencies in a more sensible
way, \fBicmake\fP(1)\(cq\&s \fICLASSES\fP file may define dependencies among classes\&.
.PP
If a class Y depends on class X as in:
.nf
class Y: public X
{
\&.\&.\&.
};
.fi
or as in:
.nf
class Y
{
X d_y;
\&.\&.\&.
};
.fi
then the sources of class Y should be recompiled if X\(cq\&s data organization
has changed\&. In cases like these Y depends on X\&.
.PP
Such class dependencies can be specified in the CLASSES file using the
form:
.nf
y x
.fi
where x and y are the directories holding the respective class sources\&. Then,
when altering X\(cq\&s data organization, do \(cq\&touch x/a\(cq\&, followed by \(cq\&icmbuild
program\(cq\&: x\(cq\&s sources as well as the sources in directories (in)directly
depending on x (e\&.g\&., y) are then automatically recompiled by icmbuild\&.
.PP
Multiple dependencies can also be specified\&. If the class
organization looks like this:
.nf
class Z: public Y
{
X d_x;
};
.fi
then Z depends on both Y and X\&. In the CLASSES file this may be indicated
by the line
.nf
z x y
.fi
Indirect dependencies are automatically followed\&. After changing X\(cq\&s data
organization where CLASSES contains the lines
.nf
x
y x
z y
.fi
then \(cq\&icmbuild program\(cq\& will result in the recompilation of all of the
sources in classes x, y and z\&.
.PP
By default, class\-dependencies are not interpreted\&. To activate them the line
.nf
//#define USE_ALL \(dq\&a\(dq\&
.fi
in the \fIicmconf\fP file must be uncommented:
.nf
#define USE_ALL \(dq\&a\(dq\&
.fi
.PP
.SH "PROGRAM AND SOURCE CONFIGURATION"
.PP
.IP o
\fB#define MAIN \(dq\&main\&.cc\(dq\&\fP
.br
The specification of the file defining the \fIint main\fP function\&. This
specification may be left as\-is if \fBicmbuild\fP(1) is used for library
maintenance rather than program maintenance\&.
.IP
.IP o
\fB#define BINARY \(dq\&binary\(dq\&\fP
.br
The name of the binary program\&. Can be left as\-is if the intent is to
construct a library rather than a program\&. Don\(cq\&t specify a path
here\&. The installation path can be specified at the \fIBIN_INSTALL\fP
directive (see below)
.IP
.IP o
\fB#define REFRESH\fP
.br
By defining \fIREFRESH\fP the binary program is always relinked, even
when no sources were modified\&. This can be useful if, e\&.g\&., a separate
library was rebuilt against which the program must be linked\&. By
default \fIREFRESH\fP is \fInot\fP defined\&.
.IP
.IP o
\fB#define BIN_INSTALL \(dq\&/usr/local/bin\(dq\&\fP
.br
This directive specifies the location where \fIicmbuild install\fP will
install the binary program\&.
.PP
.SH "LIBRARY CONSTRUCTION"
.PP
.IP o
\fB#define LIBRARY \(dq\&modules\(dq\&\fP
.br
By default this directive is not defined\&. If defined a local library is
defined\&. When a binary program is built it will be linked against the
library rather than the individual object modules\&. If library
construction is required (see below at the \fIDEFCOM\fP directive), then
the \fILIBRARY\fP directive defines the name of the library that is
built\&. Change the library\(cq\&s name at your own digression\&. Don\(cq\&t use
\fIlib\fP or an extension like \fI\&.a\fP\&.
.IP
.IP o
\fB#define SHARED\fP
.br
This directive is only interpreted if \fILIBRARY\fP was also specified\&.
If \fISHARED\fP is defined a static library (extension \fI\&.a\fP) as well
as a shared library (extension \fI\&.so\fP) is built\&. If not specified
only the static library is built\&. By default \fISHARED\fP is not
defined\&.
.IP
.IP o
\fB#define SHAREDREQ \(dq\&\(dq\&\fP
.br
When creating a shared library:
Specify the names of any libraries and library paths that are required
by the shared library between the double quotes\&. E\&.g\&., if a library is
found in \fI/usr/lib/special\fP use \fI\(dq\&\-L/usr/lib/special \-lspecial\(dq\&\fP
assuming that the name of the required library is \fIlibspecial\&.so\fP\&.
The \fI/lib\fP and \fI/usr/lib\fP paths are usually predefined and need
not be specified\&. This directive is only interpreted if \fISHARED\fP and
\fILIBRARY\fP were also defined\&.
.IP
.IP o
\fB#define LIB_INSTALL \(dq\&/usr/local/lib\(dq\&\fP
.br
This directive specifies the location where \fIicmbuild install\fP will
install the library (libraries)\&. By default it is not specified\&. It
should only be specified if \fILIBRARY\fP was also specified\&.
.PP
.SH "COMPILING AND LINKING"
.PP
.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 the compilation\&. By default
it is not defined\&.
.IP
.IP o
\fB#define USE_ALL \(dq\&a\(dq\&\fP
.br
When this directive is specified (by default it is \fInot\fP specified) a
class dependency setup defined in the CLASSES file is interpreted\&. In
this case, when a directory contains a file named at the \fIUSE_ALL\fP
directive, then all sources of that class as well as all sources of
all classes depending on it are (re)compiled\&. The program\(cq\&s root
directory is assumed to depend on all other directories\&.
.IP
Class dependencies in CLASSES consist of the class name (as the first
word on a line) optionally followed by additional class names, which
are the classes on which the line\(cq\&s first class name depends\&.
.IP
Assuming that a program uses five classes \fIOne, Two, Three, Four\fP and
\fIFive\fP and that class \fIThree\fP depends on class \fITwo\fP, which in
turn depends on class \fIOne\fP, while class \fIFive\fP depends on
\fIThree\fP and \fIFour\fP, then the file \fICLASSES\fP may reflect these
dependencies as follows:
.nf
one
two one
three two
four
five three four
.fi
Now touching (creating) the file \fItwo/a\fP (using e\&.g\&., the command
\fItouch two/a\fP) causes all sources of the classes \fITwo, Three\fP and \fIFive\fP
as well as all the sources in the program\(cq\&s root directory to be recompiled:
\fITwo\fP is recompiled because of the existence of \fItwo/a\fP, \fIThree\fP is
recompiled because it depends on \fITwo\fP, \fIFive\fP is recompiled because it
depends on \fIThree\fP, the sources in the program\(cq\&s root directory are
recompiled because at least one directory is recompiled\&.
.IP
This facility was added to the \fIicmbuild\fP script because \fBC++\fP header
files are often modified \fIwithout\fP the need to recompile all their depending
sources\&. No recompilation is necessary when a new class member function is
declared\&. Recompilation, however, \fIis\fP necessary when the class\(cq\&s internal
organization changes, e\&.g\&., when the organization of its data members is
modified\&. Simply touching a file \fI\(dq\&a\(dq\&\fP is sufficient to perform
the necessary recompilations\&.
.IP
Following the recompilations the \fIa\fP \fBs\fP are removed\&.
.IP
Note also that when the \fIUSE_ALL\fP directive is used the command \fIicmbuild
clean\fP also removes any leftover \fIUSE_ALL\fP files from the program\(cq\&s direct
subdirectories\&.
.IP
.IP o
\fB#define COMPILER \(dq\&g++ \-\-std=c++0x \-Wall\(dq\&\fP
.br
This directive defines the compiler to use\&. The default is shown\&. The
default illustrates that the compiler definition may also be provided with
compiler options\&. when specified, these options are always used and cannot be
suppressed by \fICOMPILER_OPTIONS\fP (see below)\&.
.IP
.IP o
\fB#define COMPILER_OPTIONS \(dq\&\-g \-O2\(dq\&\fP
.br
This directive defines the compiler options to use\&. The default options
are shown\&. To enable GNU extensions in addition to the compiler\(cq\&s C++0x
extensions, add the option \fI\-\-std=gnu++0x\fP\&.
.IP
.IP o
\fB#define COPT \(dq\&CXXFLAGS\(dq\&\fP
.br
When defined (by default \fICOPT\fP is not defined but embedded in
comment) \fICOPT\fP defines the name of an environment variable that may be
defined holding compiler options\&. When this environment variable is defined
the \fICOMPILER_OPTIONS\fP specification is ignored and the value of the
specified environment variable will be used instead\&.
.IP
.IP o
\fB#define SOURCES \(dq\&*\&.cc\(dq\&\fP
.br
This directive defines the pattern to locate sources in a
directory\&. Its default value is shown\&.
.IP
.IP o
\fB#define LINKER_OPTIONS \(dq\&\(dq\&\fP
.br
This directive defines the options the compiler should pass to the
linker\&. By default no special options are used
.IP
.IP o
\fB#define LOPT \(dq\&LDFLAGS\(dq\&\fP
.br
When defined (by default \fILOPT\fP is not defined but embedded in
comment) \fILOPT\fP defines the name of an environment variable that may be
defined holding linker options\&. When this environment variable is defined
the \fILINKER_OPTIONS\fP specification is ignored and the value of the
specified environment variable will be used instead\&.
.IP
.IP o
\fB#define ADD_LIBRARIES \(dq\&\(dq\&\fP
.br
When a program (see \fIBINARY\fP above) must be linked against additional
libraries (other than the name of the program\(cq\&s library itself, if specified
at \fILIBRARY\fP) then those libraries should be specified, blank space
separated, here\&. E\&.g\&., when a program is linked against \fIlibbobcat\fP then the
specification is:
.nf
#define ADD_LIBRARIES \(dq\&bobcat\(dq\&
.fi
.IP
.IP o
\fB#define ADD_LIBRARY_PATHS \(dq\&\(dq\&\fP
.br
When the 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\&. Only the paths should be specified, not the \fI\-L\fP
flags\&.
.PP
.SH "LEXICAL SCANNERS"
.PP
When a program uses a lexical scanner, generated by a scanner generator like
\fBflex\fP(1), the \fIicmbuild\fP script can be used to update the scanner source
whenever the scanner specification file is modified\&. Here are the directives
that are related to the use of a lexical scanner generator:
.PP
.IP o
\fB#define SCANNER_DIR \(dq\&\(dq\&\fP
.br
If a lexical scanner must be constructed, then the subdirectory
containing the scanner\(cq\&s specification file is specified with this
directive\&. If empty (the default) no scanner construction is monitored
by \fIicmbuild\fP and all remaining scanner\-related directives are
ignored\&.
.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 SCANFLAGS \(dq\&\(dq\&\fP
.br
The flags to use when calling the program specified at \fISCANGEN\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 at \fISCANNER_DIR\fP\&.
.IP
.IP o
\fB#define SCANFILES \(dq\&\(dq\&\fP
.br
If the lexical scanner specification file named at \fISCANSPEC\fP itself
includes additional specification files, then patterns matching these
additional lexer specification files should be specified here\&. The
pattern is interpreted in the directory specified at \fISCANNER_DIR\fP
and could contain a subdirectory name (e\&.g\&. \fIspecs/*\fP)\&. When files
matching the pattern are modified then a new lexical scanner will be
created\&. By default no additional specification files are used\&.
.IP
.IP o
\fB#define SCANOUT \(dq\&lex\&.cc\(dq\&\fP
.br
The name of the file generated by the lexical scanner (which is used by
\fIicmbuild\fP to compare the timestamps of the scanner specification
\fBs\fP against)\&.
.PP
.SH "GRAMMAR PARSERS"
.PP
When a program uses a grammar parser, generated by a parser generator like
\fBbisonc++\fP(1), the \fIicmbuild\fP script can be used to update the parser\(cq\&s
sources whenever a parser specification file is modified\&. Here are the
directives that are related to the use of a parser generator:
.PP
.IP o
\fB#define PARSER_DIR \(dq\&\(dq\&\fP
.br
If a parser must be constructed, then the subdirectory
containing the parser\(cq\&s specification file is specified with this
directive\&. If empty (the default) no parser construction is monitored
by \fIicmbuild\fP and all remaining parser\-related directives are
ignored\&.
.IP
.IP o
\fB#define PARSGEN \(dq\&bisonc++\(dq\&\fP
.br
The name of the program generating the parser\&.
.IP
.IP o
\fB#define PARSFLAGS \(dq\&\-V\(dq\&\fP
.br
The flags to use when calling the program specified at \fIPARSGEN\fP\&.
.IP
.IP o
\fB#define PARSSPEC \(dq\&grammar\(dq\&\fP
.br
The name of the parser specification file\&. This file is
expected in the directory specified at \fIPARSER_DIR\fP\&.
.IP
.IP o
\fB#define PARSFILES \(dq\&\(dq\&\fP
.br
If the parser specification file named at \fIPARSSPEC\fP itself includes
additional specification files, then patterns matching these
additional grammar specification files should be specified here\&. The
pattern is interpreted in the directory specified at \fIPARSER_DIR\fP
and could contain a subdirectory name (e\&.g\&. \fIspecs/*\fP)\&. When files
matching the pattern are modified then a new parser will be
created\&. By default no additional specification files are used\&.
.IP
.IP o
\fB#define PARSOUT \(dq\&parse\&.cc\(dq\&\fP
.br
The name of the file generated by the parser generator (which is used
by \fIicmbuild\fP to compare the timestamps of the parser specification
\fBs\fP against)\&.
.PP
.SH "ADDITIONAL DIRECTIVES"
.PP
.IP o
\fB#define USE_VERSION\fP
.br
When this directive is specified (which is the default)
the file \fIVERSION\fP will be read by \fIicmconf\fP to determine the
version of the program, the program release years and the program\(cq\&s
author name\&. The default \fIVERSION\fP file generated by \fIicmstart\fP
defines \fIAUTHOR, VERSION\fP and \fIYEARS\fP\&.
.IP
.IP o
\fB#define DEFCOM \(dq\&\&.\&.\&.\(dq\&\fP
.br
A \fIDEFCOM\fP directive may be added to the \fIicmconf\fP file by
\fIicmstart\fP\&. If added, it may contain:
.nf
#define DEFCOM \(dq\&program\(dq\&
.fi
in which case \fIicmbuild\fP will do program maintenance\&. Alternatively
it may contain:
.nf
#define DEFCOM \(dq\&program strip\(dq\&
.fi
in which case \fIicmbuild\fP will do program maintenance, creating a
stripped binary program\&. It may also contain
.nf
#define DEFCOM \(dq\&library\(dq\&
.fi
in which case \fIicmbuild\fP will de library maintenance\&.
.IP
If this directive was not added by \fBicmstart\fP(1) it can always be
added to \fIicmconf\fP by hand\&.
.PP
The following directives usually require no tweaking:
.IP o
\fB#define USE_ECHO ON\fP
.br
When specified as \fION\fP (rather than \fIOFF\fP) commands executed by
\fIicmbuild\fP are echoed\&.
.IP
.IP o
\fB#define TMP_DIR \(dq\&tmp\(dq\&\fP
.br
The directory in which intermediate results are stored\&. Relative to the
current working directory unless an absolute path is specified\&.
.IP
.IP o
\fB#define OBJ_EXT \(dq\&\&.o\(dq\&\fP
.br
The extension of object modules created by the compiler\&.
.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 file\&.
.IP o
\fB/etc/icmake\fP
.br
Directory containing the default system\-wide \fBicmake\fP(1)
configuration files (like \fIVERSION\fP and \fIicmstart\&.rc\fP)
.IP o
\fB$HOME/\&.icmake\fP
.br
Optional 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"
The interpretation of the class dependencies (see section \fBCOMPILING AND
LINKING\fP has altered when \fIicmake\fP was updated to version 7\&.16\&.00\&.
.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-7.21.01/doc/icmstart.rc.7 0000644 0001750 0001750 00000010636 12267172275 015206 0 ustar frank frank .TH "icmstart\&.rc" "7" "1992\-2014" "icmake\&.7\&.21\&.01\&.tar\&.gz" "icmstart resource file"
.PP
.SH "NAME"
icmstart\&.rc \- The icmstart(1) resource file
.PP
.SH "DESCRIPTION"
.PP
The \fBicmstart\&.rc\fP file defines the initial files of a program that are
installed by \fBicmstart\fP(1)\&.
.PP
By default \fBicmstart\&.rc\fP is found in \fI/etc/icmake/icmstart\&.rc\fP, but if a
file \fI$HOME/\&.icmake/icmstart\&.rc\fP is found then the latter file is used by
\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
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 o
lines beginning with a hash\-character (\fI#\fP), also ignored;
.IP o
Optionally: a P (don\(cq\&t install with \fIicmstart xxx library\fP) or an L
(don\(cq\&t install with \fIicmstart xxx program\fP), followed by a blank; see also
\fBicmstart\fP(1)\&.
.IP o
Optionall: a \fI?\fP (followed by a blank) following the optional P or
L in which case the installation of the element must be confirmed by the user\&.
.IP o
Source path names\&. Relative path names are interpreted relative to
the current working directory\&. Environment variables are not expanded, the
initial tilde character is interpreset as the user\(cq\&s home directory\&.
.IP o
Source path names followed by a destination (relative to the
directory initialized by \fBicmstart\fP(1))\&.
A source path may be either a file or a directory\&. If a directory is
specified then all files in and below that directory will be installed\&.
.PP
When specifying a destination a path may be specified as well\&. However, the
destination path is always interpreted relative to the installation directory
specified when calling \fBicmstart\fP(1)\&.
.PP
If a destination is omitted, the source is installed as specified below
\fBicmstart\fP(1)\(cq\&s destination directory\&.
.PP
.SH "EXAMPLES"
.PP
The following entries can be used in an \fIicmstart\&.rc\fP file:
.IP o
\fIsource\fP
.br
`Source\(cq\& must be in the skeleton directory visited by \fBicmstart(1)\fP
and is installed as \fIsource\fP in the destination directory specified when
calling \fBicmstart\fP(1)\&.
.IP o
\fIsource dest\fP
.br
`Source\(cq\& must be in the skeleton directory visited by \fBicmstart(1)\fP
and is installed as \fIdest\fP in the destination directory specified when
calling \fBicmstart\fP(1)\&.
.IP o
\fI~/path\fP
.br
`~/path\(cq\& is installed as \fI~/path\fP in the destination directory
specified when calling \fBicmstart\fP(1)\&. The \fI~\fP\-character is expanded to the
user\(cq\&s home directory\&.
.IP o
\fI~/path dest\fP
.br
`~/path\(cq\& is installed as \fIdest\fP in the destination directory
specified when calling \fBicmstart\fP(1)\&. The \fI~\fP\-characteris expanded to the
user\(cq\&s home directory\&.
.IP o
\fI/path\fP
.br
`/path\(cq\& is installed as \fI\&./path\fP in the destination directory
specified when calling \fBicmstart\fP(1)\&.
.IP o
\fI/path dest\fP
.br
`/path\(cq\& is installed as \fIdest\fP in the destination directory
.IP o
\fI? source\fP
.br
The user must confirm the installation of \fIsource\fP\&.
.IP o
\fI? source dest\fP
.br
The user must confirm the installation of \fIsource\fP as \fIdest\fP in
the destination directory specified when calling \fBicmstart\fP(1)\&.
.IP o
\fI# text\fP
.br
Interpreted as comment and ignored\&. The \fI#\fP\-character must be the
first character on the line\&.
.IP o
an empty line
.br
Empty lines are skipped\&.
.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-7.21.01/doc/icmstart.1 0000644 0001750 0001750 00000013623 12267172275 014574 0 ustar frank frank .TH "icmstart" "1" "1992\-2014" "icmake\&.7\&.21\&.01\&.tar\&.gz" "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
The \fBicmstart\fP script is a generic script that can be used to start program
maintenance using \fBicmake\fP(1) and \fBicmbuild\fP(1)\&. \fBIcmstart\fP creates
an initial directory \fItop\-dir\fP 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\&.
.PP
Skeleton files for the main directory and subdirectories, by default listed in
the file \fI/etc/icmake/icmstart\&.rc\fP, may be installed as well
(cf\&. \fBicmstart\&.rc\fP(7))\&.
.PP
After changing to the directory created by \fBicmstart\fP the \fBicmbuild\fP(1)
script may be used for program maintenance\&.
.PP
.SH "OPTIONS"
.PP
\fIIcmstart\fP may be called with the following options, which (if specified)
must be the first arguments of \fIicmstart\fP:
.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 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 o
\fI\-d\fP
.br
Do not execute any commands, but show the commands that would have been
executed on the standard output\&.
.IP o
\fI\-I\fP
.br
Do not install files\&.
.IP o
\fI\-r\fP
Unconditionally replace existing files\&. If \fI\-r\fP is not
provided \fBicmstart\fP will ask 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 will be replaced\&.
.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)) which is ignored, and should otherwise contain
specifications of resource \fBs\fP to install\&.
.PP
The default resource file is \fI/etc/icmake/icmstart\&.rc\fP, contains
.nf
CLASSES
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\&. See
\fBicmstart\&.rc\fP(7) for details about the format of the \fIicmstart\&.rc\fP file\&.
.PP
.SH "CONFIGURATION FILES"
.PP
The configuration files \fIicmstart\&.rc, AUTHOR, YEARS\fP and \fIVERSION\fP are
recognized and 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 not required for the proper operation of \fIicmstart\fP\&.
When absent \fIicmstart\fP performs the following default actions:
.PP
.IP o
If the file \fIAUTHOR\fP does not exist \fIicmstart\fP uses \fI#define
AUTHOR \(dq\&\(dq\&\fP\&.
.IP
When the file \fIAUTHOR\fP is defined in a configuration path it should have
one line, defining the author of the program\&. E\&.g\&.,
.nf
#define AUTHOR \(dq\&Frank B\&. Brokken \(dq\&
.fi
.IP
.IP o
If the file \fIVERSION\fP does not exist \fIicmstart\fP uses \fI#define
VERSION \(dq\&0\&.00\&.00\(dq\&\fP\&.
.IP
When the file \fIVERSION\fP is defined in a configuration path it should
have one line, defining the program\(cq\&s initial version\&. E\&.g\&.,
.nf
#define VERSION \(dq\&1\&.00\&.00\(dq\&
.fi
.IP
.IP o
If the file \fIYEAR\fP does not exist \fIicmstart\fP uses \fI#define
YEARS \(dq\&yyyy\(dq\&\fP where \fIyyyy\fP is the current year\&.
.IP
When the file \fIYEAR\fP is defined in a configuration path it should have
one line, defining the program\(cq\&s initial release year\&. E\&.g\&.,
.nf
#define YEARS \(dq\&2012\(dq\&
.fi
Plural is used here since a release year usually becomes a range of years
after some time, as with Icmake\(cq\&s years specification:
.nf
#define YEARS \(dq\&1992\-2012\(dq\&
.fi
.PP
.IP o
If the file \fIicmstart\&.rc\fP does not exist (or is empty) \fIicmstart\fP
will not install any of the files normally found in \fIicmstart\&.rc\fP, but the
initial project directory, \fIicmconf\fP and \fIVERSION\fP are installed\&.
)
.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/usr/share/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"
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-7.21.01/doc/icmbuild.1 0000644 0001750 0001750 00000022256 12267172275 014540 0 ustar frank frank .TH "icmbuild" "1" "1992\-2014" "icmake\&.7\&.21\&.01\&.tar\&.gz" "A generic program maintenance script"
.PP
.SH "NAME"
icmbuild \- A generic, easy configurable, program maintenance script
.PP
.SH "SYNOPSIS"
\fBicmbuild\fP \fImode\fP
.PP
.SH "DESCRIPTION"
.PP
The \fBicmbuild\fP script is a generic script that can be used to do program
maintenance using \fBicmake\fP(1)\&.
.PP
The script expects two files to be available in the directory where program
maintenance is required, and the \fBicmbuild\fP script should be available in your
path or it should be started as, e\&.g\&., \fI\&./icmbuild\fP
.PP
\fBIcmbuild\fP assumes that your sources exist in and below a directory in which the
files \fIicmconf\fP and \fICLASSES\fP live\&. The file \fICLASSES\fP contains the
names of all subdirectories in which class\-specific sources are kept\&. The file
\fIicmconf\fP in \fBicmake\fP(1)\(cq\&s distribution offers an example of the
configuration parameters that are used for program maintenance\&. In this latter
file it is assumed that \fBC++\fP sources are maintained, but the \fBicmbuild\fP script
is not restricted to do maintenance for \fBC++\fP programs\&.
.PP
\fBIcmbuild\fP compiles all sources in each of the subdirectories named in the file
\fICLASSES\fP, and then compiles all sources in the current working directory
(except for the source containing \fImain()\fP)\&.
.PP
The compiled sources result in object modules which are then kept in a
library, against which the main\-object module is linked\&. It is also possible
to specify additional libraries against which the program must be linked\&.
.PP
Once a library is constructed it is kept up to date by the script\&. Changing a
source will result in replacing its former module by its new module in the
library\&.
.PP
.SH "KICK\-STARTING ICMBUILD"
.PP
Normally, \fBicmbuild\fP is installed and used as follows:
.IP o
Install \fBicmbuild\fP in your path;
.IP o
copy \fIicmconf\fP and \fICLASSES\fP to your project\(cq\&s base directory
(i\&.e\&., the directory in which and where below the project\(cq\&s sources are
found);
.IP o
Modify the \fI#defines\fP in the file \fIicmconf\fP to taste;
.IP o
List the subdirectories containing sources in the file \fICLASSES\fP
.IP
Note that the order of the classes mentioned in classes \fIis\fP relevant
here\&. It\(cq\&s no problem to add new class (subdirectory) names, but
reordering should be prevented\&. If reordering is required, recompile
the library, as the final object files contain class order\-numbers\&.
These class\-order numbers prevent file\-name collisions and thus prevent
replacing file \fIx\&.o\fP from class \fIA\fP by file \fIx\&.o\fP from class
\fIB\fP;
.IP o
Now simply run
.nf
icmbuild
.fi
from the project\(cq\&s base directory and let the help\-info tell you
what your options are\&. See the next section for the modes of operation\&.
.PP
.SH "OPTIONS"
.PP
\fBIcmbuild\fP may be called with the following operational modes:
.IP o
\fIclean\fP
.br
clean up remnants of previous activities
.IP o
\fIhelp\fP
.br
provide help and exit (default when called without arguments)
.IP o
\fIlibrary\fP
.br
build the library (static and optionally the dynamic library)
.IP o
\fIprogram\fP
.br
build the binary program
.IP o
\fIprogram strip\fP
.br
build the stripped binary program
.IP o
\fIinstall \fP
install the software in the locations defined in the \fIicmconf\fP
file, optionally below the directory \fI\fP
The \fBicmconf\fP file may be given a line defining \fIDEFCOM\fP containing
the default operational mode to use when none is specified\&. E\&.g\&.,
.nf
#define DEFCOM \(dq\&program\(dq\&
.fi
constructs the program when the command `\fIicmbuild\fP\(cq\& is
entered\&. \fIDEFCOM\fP may also contain combined options, like
.nf
#define DEFCOM \(dq\&program strip\(dq\&
.fi
Note that \fIDEFCOM\fP is ignored when an explicit operational mode is
provided to the \fBicmbuild\fP script\&.
.PP
.SH "FILES"
.PP
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\&.
.PP
.SH "EXAMPLES"
.PP
Here is an example of the configuration file \fIicmconf\fP for a concrete
program, using the library \fIlibbobcat1\fP as an additional library:
.PP
.nf
// Inspect the following #defines\&. Change them to taste\&. If you don\(cq\&t
// need a particular option, change its value into an empty string
// For more information about this file: \(cq\&man 7 icmconf\(cq\&
// define any additional libraries the program may need:
#define ADD_LIBRARIES \(dq\&\(dq\&
// define any additional paths (other than the standard paths) the
// additional libraries are located in:
#define ADD_LIBRARY_PATHS \(dq\&\(dq\&
// Uncomment to clear the screen just before starting the compilation
// process
//#define CLS
// The compiler to use\&. Define CC instead if a C compiler should be used\&.
#define CXX \(dq\&g++\(dq\&
//#define CC \(dq\&gcc\(dq\&
// The compiler options to use\&. Define CFLAGS instead if a C compiler is
// used\&.
#define CXXFLAGS \(dq\& \-\-std=c++0x \-Wall \-g \-O2\(dq\&
//#define CFLAGS \(dq\& \-Wall \-g \-O2\(dq\&
// Options passed to the linker:
#define LDFLAGS \(dq\&\(dq\&
// Uncomment to construct a library\&. Optionally use another name (don\(cq\&t
// use lib or an extension like \&.a)
//#define LIBRARY \(dq\&modules\(dq\&
// The source containing main():
#define MAIN \(dq\&main\&.cc\(dq\&
// The extension of object modules:
#define OBJ_EXT \(dq\&\&.o\(dq\&
// If a parser must be generated define the subdirectory containing the
// parser\(cq\&s specification file
#define PARSER_DIR \(dq\&\(dq\&
// Specify additional grammar specification files using patterns
// these files are (in)directly included by PARSSPEC\&. Specify patterns
// relative to PARSER_DIR
//#define PARSFILES \(dq\&\(dq\&
// Flags to provide PARSGEN with:
#define PARSFLAGS \(dq\&\-V\(dq\&
// What is the program generating a parser?
#define PARSGEN \(dq\&bisonc++\(dq\&
// Name of the file generated by the parser generator containing the
// parser function
#define PARSOUT \(dq\&parse\&.cc\(dq\&
// What is the grammar specification file?
#define PARSSPEC \(dq\&grammar\(dq\&
// Uncomment to relink the binary, even when no sources were changed
//#define REFRESH
// If a lexical scanner must be generated: the subdirectory containing
// the scanner\(cq\&s specification file\&.
#define SCANNER_DIR \(dq\&\(dq\&
// Specify additional lexer specification files using patterns
// these files are (in)directly included by SCANSPEC
//#define SCANFILES \(dq\&\(dq\&
// Flags to provide SCANGEN with:
#define SCANFLAGS \(dq\&\(dq\&
// What is the program generating the lexical scanner?
#define SCANGEN \(dq\&flexc++\(dq\&
// Name of the file generated by the lexical scanner
#define SCANOUT \(dq\&lex\&.cc\(dq\&
// Name of the lexical scanner specification file
#define SCANSPEC \(dq\&lexer\(dq\&
// Uncomment to construct a shared library
//#define SHARED
// When creating a shared library:
// Specify the names of any libraries and library paths that are required
// by the shared library\&. E\&.g\&., if a library is found in /usr/lib/special
// use \(dq\&\-L/usr/lib/special \-lspecial\(dq\& if the name of the library is
// libspecial\&.so
// The /lib and /usr/lib paths are usually predefined and need not be
// specified
#define SHAREDREQ \(dq\&\(dq\&
// The pattern locating sources in a directory:
#define SOURCES \(dq\&*\&.cc\(dq\&
// Directory below this directory to contain temporary results
#define TMP_DIR \(dq\&tmp\(dq\&
// 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\(cq\&s first class name\&.
//#define USE_ALL \(dq\&a\(dq\&
// should commands be echoed (ON) or not (OFF) ?
#define USE_ECHO ON
// Use the VERSION file
#define USE_VERSION
// #define DEFCOM \(dq\&program\(dq\& (or \(dq\&library\(dq\&) may be added (by, e\&.g\&.,
// icmstart)
.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-7.21.01/etc/ 0000755 0001750 0001750 00000000000 11743327112 012653 5 ustar frank frank icmake-7.21.01/etc/icmake/ 0000755 0001750 0001750 00000000000 11743337075 014115 5 ustar frank frank icmake-7.21.01/etc/icmake/icmstart.rc 0000644 0001750 0001750 00000001104 11743327112 016254 0 ustar frank frank # This file contains lines mentioning frame files to install by icmstart
# 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
# requested.
# Lines starting with L are not installed when 'icmstart xxx program' is
# requested.
# User-confirmation to install is required for entries on lines having a ?
# following the optional P or L.
CLASSES
P main.cc
P main.ih
P usage.cc
P version.cc
P ? scanner
P ? parser
icmake-7.21.01/etc/icmake/icmake.rc 0000644 0001750 0001750 00000001424 11743335331 015666 0 ustar frank frank # This is the icmake configuration file. It is available since icmake 8.0.0
# This file defines the locations of various files used by icmake itself.
# Change these entries and icmake will look at the new locations
#
# The location of this file itself is (in order of searching):
# -c configPath -- a program command-line parameter
# ~/.icmake.rc -- a configuration file in the user's home dir
# /etc/icmake/icmake.cf
# the full path to the icm-comp icmake compiler:
icm-comp: /usr/lib/icmake/icm-comp
# the full path to the icm-exec icmake executer:
icm-exec: /usr/lib/icmake/icm-exec
# the full path to the icm-pp icmake pre-processor:
icm-pp: /usr/lib/icmake/icm-pp
# the skeleton directory:
skeletons: /usr/share/icmake
icmake-7.21.01/examples/ 0000755 0001750 0001750 00000000000 11743327112 013716 5 ustar frank frank icmake-7.21.01/examples/keep 0000755 0001750 0001750 00000005421 11743327112 014572 0 ustar frank frank #!/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-7.21.01/examples/defines.im 0000644 0001750 0001750 00000000515 11743327112 015663 0 ustar frank frank main ()
{
printf
(
"MSDOS: ", MSDOS, "\n"
"UNIX: ", UNIX, "\n"
"unix: ", unix, "\n"
"LINUX: ", LINUX, "\n"
"linux: ", linux, "\n"
"M_UNIX: ", M_UNIX, "\n"
"M_SYSV: ", M_SYSV, "\n"
"_POSIX_SOURCE: ", _POSIX_SOURCE, "\n"
"__hpux: ", __hpux, "\n"
);
} icmake-7.21.01/examples/r 0000755 0001750 0001750 00000006340 11743327112 014110 0 ustar frank frank #!/usr/bin/icmake -qt /tmp/r
/*
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 (substr (s, "?") > -1 || // if ? or * occurs:
substr (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 = sizeof (cmd) <= 1; // expansion must occur when
// arguments are in cmd
ret = element (0, cmd); // add program name itself
for (i = 1; i < sizeof (cmd); i++) // for all other elements:
if (aux = makelist (element (i, cmd))) // expand element, and add
{
expanded = 1; // argument expanded
for (j = 0; j < sizeof (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 < sizeof (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-7.21.01/examples/am 0000755 0001750 0001750 00000015054 11743327112 014246 0 ustar frank frank #! /usr/bin/icmake -qt /tmp/am
/*
AM
This script is used to implement a non-destructive rm
*/
#define YEAR "1994--1995"
#define VERSION "1.14"
#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 = sizeof(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-7.21.01/examples/idir 0000755 0001750 0001750 00000003435 11743327112 014600 0 ustar frank frank #!/usr/local/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 < sizeof (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 < sizeof (argv); i++)
show (element (i, argv));
exit (0);
}
icmake-7.21.01/examples/backup 0000755 0001750 0001750 00000000313 11743327112 015106 0 ustar frank frank #!/bin/sh
ORGPROG=/usr/local/etc/backup/backup
if [ "$1" = "" ]
then
$ORGPROG
else
insmod /sbin/ftape.o
$ORGPROG $*
mt -f /dev/ftape rewind
sleep 20
rmmod ftape
fi
exit 0
icmake-7.21.01/examples/ds 0000755 0001750 0001750 00000007662 11743327112 014265 0 ustar frank frank #! /usr/bin/icmake -qt /tmp/ds
/*
D S
*/
#define VERSION "1.05"
#define YEAR "1994--1995"
int
debug;
string
progname,
xdev;
void kill(string s)
{
printf(s, "\n\n");
exit(1);
}
string backslash_wild(string spec)
{
string
s,
ret;
int
index;
for (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)
{
int
index;
string
optchar;
// process all option characters
for (index = 1; optchar = element(index, arg); 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)
{
int
index;
list
new;
string
arg;
for (index = 0; index < argc; index++) // walk all cmd line arguments
{
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"
"ICCE DS (Disk Search). Version " VERSION "\n"
"Copyright (c) ICCE " 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 (1);
}
void process(int argc, list argv)
{
string
cmd,
filespec,
startdir;
if (argc == 2) // a file given as argument
startdir = "/"; // start at the root
else
startdir = element(1, argv); // otherwise start at specified dir
// protect wildcards in the
// filespecification with \-char
filespec = backslash_wild(element(argc - 1, argv));
cmd = "find " + startdir + " " + xdev + " -name " + filespec +
" 2>/dev/null";
if (!debug)
system(P_NOCHECK, cmd);
else
printf(cmd, "\n");
}
int main(int argc, list argv)
{
preamble(argv); // preamble: determine progname etc.
argv = options(argc, argv); // process options
argc = sizeof(argv);
if (argc == 1) // no arguments ?
usage(); // give help
process(argc, argv); // else process arguments
return (0);
}
icmake-7.21.01/examples/tolower 0000755 0001750 0001750 00000004223 11743327112 015340 0 ustar frank frank #!/usr/local/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 < sizeof (argv); i++)
process (element (i, argv));
exit (0);
}
icmake-7.21.01/examples/nesteddirectives 0000755 0001750 0001750 00000001106 11743327112 017206 0 ustar frank frank #!/usr/bin/icmake -qt /tmp/nesteddirectives
/*
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-7.21.01/examples/ftpxfer 0000755 0001750 0001750 00000014231 11743327112 015323 0 ustar frank frank #!/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?
string getenv (string varname) // purpose: returns setting
{ // of environment variable
int // 'varname'
i;
for (i = 0; i < sizeof (envp); i += 2) // loop thru envp...
if (element (i, envp) == varname) // found varname?
return (element (i + 1, envp)); // yes -- return setting
return (""); // no -- return empty string
}
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
user, // user name on foreign host
password, // password
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 ("."));
if (! (user = getenv ("FTPUSER")) ) // get username from envp
{ // or prompt for it
printf ("User name: ");
user = gets ();
}
if (! (password = getenv ("FTPASS")) ) // get passwd from envp
{ // 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-7.21.01/examples/7.00/ 0000755 0001750 0001750 00000000000 11743327112 014302 5 ustar frank frank icmake-7.21.01/examples/7.00/strlwr.im 0000644 0001750 0001750 00000000375 11743327112 016173 0 ustar frank frank void 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-7.21.01/examples/7.00/getenv.im 0000644 0001750 0001750 00000000215 11743327112 016117 0 ustar frank frank void main(int argc, list argv)
{
list term = getenv("TERM");
printf(element(0, term), ": ", element(1, term), "\n");
exit(0);
}
icmake-7.21.01/examples/7.00/substr.im 0000644 0001750 0001750 00000000701 11743327112 016151 0 ustar frank frank void 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-7.21.01/examples/7.00/backtick.im 0000644 0001750 0001750 00000000132 11743327112 016400 0 ustar frank frank void main(int argc, list argv)
{
string cmd = "ls";
printf(`cmd`);
exit(0);
}
icmake-7.21.01/examples/7.00/define.im 0000644 0001750 0001750 00000000222 11743327112 016057 0 ustar frank frank #define SUBST "substituted"
#define LINE "This is " ${SUBST} " as one line\n"
void main(int argc, list argv)
{
printf(LINE);
exit(0);
}
icmake-7.21.01/examples/7.00/ifdef.im 0000644 0001750 0001750 00000000473 11743327112 015712 0 ustar frank frank //#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-7.21.01/examples/7.00/index.im 0000644 0001750 0001750 00000000266 11743327112 015744 0 ustar frank frank void main(int argc, list argv)
{
list lst = strtok("aap noot mies", " ");
int idx;
for (idx = sizeof(lst); idx--; )
printf(lst[idx][idx], "\n");
exit(0);
}
icmake-7.21.01/examples/7.00/strfind.im 0000644 0001750 0001750 00000000504 11743327112 016301 0 ustar frank frank void 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-7.21.01/examples/bup 0000755 0001750 0001750 00000004015 11743327112 014432 0 ustar frank frank #!/usr/local/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 < sizeof (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 >= sizeof (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-7.21.01/examples/initialization 0000755 0001750 0001750 00000000310 11743327112 016665 0 ustar frank frank #!/usr/bin/icmake -qt /tmp/initialization
int main()
{
int one; // = 5;
string a, b;
a = "initialization";
b = "initialization";
if (a older b)
printf(one, "\n");
}
icmake-7.21.01/examples/defines 0000755 0001750 0001750 00000000435 11743327112 015263 0 ustar frank frank #!/usr/bin/icmake -qt /tmp/defines
#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-7.21.01/examples/killprog 0000755 0001750 0001750 00000002523 11743327112 015471 0 ustar frank frank #!/usr/local/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, (int) element (1, 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-7.21.01/exec/ 0000755 0001750 0001750 00000000000 12267172022 013024 5 ustar frank frank icmake-7.21.01/exec/bootstrap 0000644 0001750 0001750 00000000452 12000542231 014751 0 ustar frank frank echo Creating icm-exec
gcc -O2 -g -Wall -DHAVE_GLOB -c *.c
mkdir -p tmp/bin
NR=0
for x in auks var virtual int list string stack opcodefun builtin
do
cd $x
gcc -O2 -g -Wall -DHAVE_GLOB -c *.c || exit 1
cd ..
done
gcc -o tmp/bin/icm-exec$1 *.o */*.o ../rss/libicrss.a
rm *.o */*.o
icmake-7.21.01/exec/auks/ 0000755 0001750 0001750 00000000000 12267172022 013767 5 ustar frank frank icmake-7.21.01/exec/auks/cleanup.c 0000644 0001750 0001750 00000001113 12000542231 015542 0 ustar frank frank /*
\funcref{cleanup}{void cleanup ()}
{}
{}
{}
{main()}
{cleanup.c}
{
This function is attached to the `at-exit' list by {\em main()}. The
functions are the following:
\begin{itemize}
\item The current working directory is set to {\em orgdir} (MSDOS
only).
\end{itemize}
}
*/
#include "../icm-exec.h"
extern int
error_occurred;
void cleanup ()
{
if (bimname)
{
fclose(infile);
unlink(bimname);
}
#ifdef MSDOS
fclose (stdout);
chdir (orgdir);
#endif
}
icmake-7.21.01/exec/auks/abnormal.c 0000644 0001750 0001750 00000001112 12000542231 015705 0 ustar frank frank /*
\funcref{abnormal}{void abnormal ()}
{
{int}{sig}{signal number}
{int}{subcode}{subcode of signal}
}
{}
{}
{cleanup()}
{abnormal.c}
{
This function issues an error with the string {\em ''Abnormal
termination.''} as message. The {\em error()} function thereupon raises
the {\em error\_occurred} flag.
This function is attached to abnormal termination by the {\em signal()}
function.
}
*/
#include "../icm-exec.h"
void abnormal (int sig, int subcode)
{
error ("Abnormal termination.");
}
icmake-7.21.01/exec/auks/data.c 0000644 0001750 0001750 00000000343 12000542231 015030 0 ustar frank frank #include "../icm-exec.h"
BIN_HEADER_ *headerp;
FILE *infile;
UNS16 nvar;
VAR_ *var;
char orgdir[_MAX_PATH];
char *bimname;
int retval;
size_t curoffs;
icmake-7.21.01/exec/auks/environ2list.c 0000644 0001750 0001750 00000001076 12000542231 016561 0 ustar frank frank #include "../icm-exec.h"
extern char **environ;
void environ2list(LISTVAR_ *ret)
{
char **env = environ;
while (*env)
{
char *cp;
/* separate on the last = or blank */
if ((cp = strrchr(*env, '=')) || (cp = strrchr(*env, ' ')))
{
int c = *cp;
*cp = 0;
listAdd_cP(ret, *env); /* add until = */
*cp = c;
/* add beyond */
listAdd_cP(ret, *(cp + 1) ? cp + 1 : "");
}
env++;
}
}
icmake-7.21.01/exec/build 0000755 0001750 0001750 00000023607 12000542231 014045 0 ustar frank frank #!/usr/bin/icmake -qt/tmp/exec
// script generated by the C++ icmake script version 2.33
/*
Configurable defines:
CLASSES: string of directory-names under which sources of classes
are found. E.g., CLASSES = "class1 class2"
All class-names must be stored in one string.
If classes are removed from the CLASSES definition or if the names in the
CLASSES definition are reordered, the compilation should start again from
scratch.
*/
string
CLASSES;
void setClasses()
{
// ADD ADDITIONAL DIRECTORIES CONTAINING SOURCES OF CLASSES HERE
// Use the construction `CLASSES += "classname1 classname2";' etc.
CLASSES += "auks var virtual int list string stack opcodefun builtin ";
}
#define BUILD_LIBRARY
#define BUILD_PROGRAM "../tmp/usr/lib/icmake/icm-exec"
#define COMPILER "gcc"
#define COPT "-Wall -O2 -DHAVE_GLOB -g"
#define ECHO_REQUEST 1
#define LIBS "icrss"
#define LIBPATH "../tmp"
// NO CONFIGURABLE PARTS BELOW THIS LINE
/*
V A R S . I M
*/
string // contain options for
cwd, // current WD
libs, // extra libs, e.g., "-lrss -licce"
libpath, // extra lib-paths, eg, "-L../rss"
copt, // Compiler options
lopt, // Linker options
libxxx, // full library-path
ofiles, // wildcards for o-files
sources, // sources to be used
current, // contains name of current dir.
programname; // the name of the program to create
int
nClasses, // number of classes/subdirectories
program; // 1: program is built
list
classes; // list of classes/directories
/*
parser.im
*/
/*
I N I T I A L . I M
*/
void initialize()
{
echo(ECHO_REQUEST);
sources = "*.c";
ofiles = "o/*.o"; // std set of o-files
copt = COPT;
cwd = chdir(".");
setClasses(); // remaining classes
classes = strtok(CLASSES, " "); // list of classes
nClasses = sizeof(classes);
}
/*
O B J F I L E S . I M
*/
list objfiles(list files)
{
string
file,
objfile;
int
i;
for (i = 0; i < sizeof(files); i++)
{
file = element(i, files); // determine element of the list
objfile = "./o/" + change_ext(file, "o"); // make obj-filename
if (objfile younger file) // objfile is younger
{
files -= (list)file; // remove the file from the list
i--; // reduce i to test the next
}
}
return (files);
}
/*
A L T E R E D . I M
*/
list altered(list files, string target)
{
int
i;
string
file;
for (i = 0; i < sizeof(files); i++) // try all elements of the list
{
file = element(i, files); // use element i of the list
if (file older target) // a file is older than the target
{
files -= (list)file; // remove the file from the list
i--; // reduce i to inspect the next
} // file of the list
}
return (files); // return the new list
}
/*
F I L E L I S T . I M
*/
list file_list(string type, string library)
{
list
files;
files = makelist(type); // make all files of certain type
#ifdef BUILD_LIBRARY
files = altered(files, library); // keep all files newer than lib.
#endif
files = objfiles(files); // remove if younger .obj exist
return (files);
}
/*
L I N K . I M
*/
void link(string library)
{
printf("\n");
exec(COMPILER, "-o", programname,
"-l" + library, libs, "-L.", libpath, lopt, "-s");
printf("ok: ", programname, "\n");
}
/*
P R E F I X C L . I M
*/
void prefix_class(string class_id)
{
list
o_files;
string
o_file;
int
i;
chdir("o");
o_files = makelist("*.o");
for (i = 0; o_file = element(i, o_files); i++)
exec("mv", o_file, class_id + o_file);
chdir("..");
}
/*
R M C L A S S P . I M
*/
string rm_class_id(string class_id, string ofile)
{
string
ret;
int
index,
n;
n = strlen(ofile);
for (index = strlen(class_id); index < n; index++)
ret += element(index, ofile);
return ret;
}
void rm_class_prefix(string class_id)
{
list
o_files;
string
o_file;
int
i;
chdir("o");
o_files = makelist("*.o");
for (i = 0; o_file = element(i, o_files); i++)
exec("mv", o_file, rm_class_id(class_id, o_file));
chdir("..");
}
/*
C C O M P I L E . I M
*/
void c_compile(list cfiles)
{
string
nextfile;
int
i;
if (!exists("o"))
system("mkdir o");
if (sizeof(cfiles)) // files to compile ?
{
printf("\ncompiling: ", current, "\n\n");
// compile all files separately
for (i = 0; nextfile = element(i, cfiles); i++)
exec(COMPILER,
"-c -o o/" + change_ext(nextfile, "o"),
copt, nextfile);
printf("\n");
}
printf("ok: ", current, "\n");
}
/*
U P D A T E L I . I M
*/
void updatelib(string library)
{
list
arlist,
objlist;
string
to,
from;
objlist = makelist("o/*.o");
if (!sizeof(objlist))
return;
printf("\n");
exec("ar", "rvs", library, "o/*.o");
exec("rm", "o/*.o");
printf("\n");
}
/*
S T D C P P . I M
*/
void std_cpp(string library)
{
list
cfiles;
cfiles = file_list(sources, library); // make list of all cpp-files
c_compile(cfiles); // compile cpp-files
}
/*
C P P M A K E . C
CPP files are processed by stdmake.
Arguments of CPPMAKE:
cpp_make(
string mainfile, : name of the main .cpp file, or "" for library
maintenance
string library, : name of the local library to use/create
(without lib prefix or .a/.so suffix
(E.g., use `main' for `libmain.a')
)
Both mainfile and library MUST be in the current directory
*/
void cpp_make(string mainfile, string library)
{
int
index;
string class;
if (nClasses)
ofiles += " */o/*.o"; // set ofiles for no LIBRARY use
// make library name
libxxx = chdir(".") + "lib" + library + ".a";
// first process all classes
for (index = 0; index < nClasses; index++)
{
class = element(index, classes); // next class to process
chdir(class); // change to directory
current = "subdir " + class;
#ifdef QT
moc(class); // see if we should call moc
#endif
std_cpp(libxxx); // compile all files
chdir(cwd); // go back to parent dir
}
current = "auxiliary " + sources + " files";
std_cpp(libxxx); // compile all files in current dir
// prefix class-number for .o files
for (index = 0; index < nClasses; index++)
{
current = element(index, classes); // determine class name
chdir( current); // chdir to a class directory.
prefix_class((string)index);
updatelib(libxxx);
chdir(cwd); // go back to parent dir
}
current = ""; // no class anymore
updatelib(libxxx); // update lib in current dir
if (mainfile != "") // mainfile -> do link
{
link(library);
printf
(
"\nProgram construction completed.\n"
"\n"
);
}
}
/*
S E T L I B S . I M
*/
void setlibs()
{
int
n,
index;
list
cut;
cut = strtok(LIBS, " "); // cut op libraries
n = sizeof(cut);
for (index = 0; index < n; index++)
libs += " -l" + element(index, cut);
cut = strtok(LIBPATH, " "); // cut up the paths
n = sizeof(cut);
for (index = 0; index < n; index++)
libpath += " -L" + element(index, cut);
}
void main(int argc, list argv)
{
int extensive;
if (argc == 1)
{
printf("Usage:\n"
" build prog [-e]\n");
exit (1);
}
if (extensive = (element(argc - 1, argv) == "-e"))
--argc;
initialize();
if (extensive)
copt =
"-O0 -g3 -ansi -pedantic -fno-common -pipe -W -Wall -Wcast-align"
" -Wcast-qual -Wconversion -Wformat=2 -Winline -Wnested-externs"
" -Wpointer-arith -Wshadow -Wstrict-prototypes -Wundef"
" -Wno-unused-parameter -Waggregate-return -Wnested-externs"
" -DHAVE_GLOB";
setlibs();
programname = BUILD_PROGRAM;
system("mkdir -p " + get_path(programname));
cpp_make
(
"icm-exec.c", // program source
"icmexec" // static program library
);
system("rm -rf o */o lib*.a");
exit (0);
}
icmake-7.21.01/exec/list/ 0000755 0001750 0001750 00000000000 12267172022 013777 5 ustar frank frank icmake-7.21.01/exec/list/constructorcp.c 0000644 0001750 0001750 00000000273 12000542231 017041 0 ustar frank frank #include "list.ih"
LISTVAR_ *listConstructor_cP(char const *arg)
{
static LISTVAR_ ret = {e_list, {0}};
ret.vu.i = newlist();
listAdd_cP(&ret, arg);
return &ret;
}
icmake-7.21.01/exec/list/cleanup.c 0000644 0001750 0001750 00000002211 12000542231 015552 0 ustar frank frank #include "list.ih"
void listcleanup(LISTVAR_ *list, size_t toRemove)
{
if (size(list) == toRemove) /* remove all ? */
{
listDestructor(list); /* then wipe out the list */
*list = *listConstructor(); /* and return a new, empty one */
return;
}
{
/* walk along all elements */
char **empty = element(list);
char **end = empty + size(list);
for ( ; empty != end; ++empty)
{
char **used;
if (*empty) /* next element if non-empty */
continue;
used = empty + 1; /* beyond the empty one: find used */
for (; used != end && *used == 0; ++used)
; /* find the next one in use */
if (used == end) /* at the end */
break;
*empty = *used; /* swap `used' and `empty' */
*used = 0;
}
}
size(list) -= toRemove; /* reduce the list's size */
}
icmake-7.21.01/exec/list/addtxt.c 0000644 0001750 0001750 00000000301 12000542231 015411 0 ustar frank frank #include "list.ih"
void addtxt(LISTVAR_ *list, char *txt)
{
LIST_ *p = &list(list);
p->element = xrealloc(p->element, p->size * sizeof(char **));
p->element[p->size - 1] = txt;
}
icmake-7.21.01/exec/list/logical.c 0000644 0001750 0001750 00000000123 12000542231 015535 0 ustar frank frank #include "list.ih"
int listLogical(LISTVAR_ const *lhs)
{
return size(lhs);
}
icmake-7.21.01/exec/list/assign.c 0000644 0001750 0001750 00000000265 12000542231 015416 0 ustar frank frank #include "list.ih"
void listAssign(LISTVAR_ *lhs, LISTVAR_ const *rhs)
{
if (lhs != rhs)
{
destructor(lhs);
*lhs = *rhs;
varIncCount(lhs);
}
}
icmake-7.21.01/exec/list/size.c 0000644 0001750 0001750 00000000125 12000542231 015077 0 ustar frank frank #include "list.ih"
size_t listSize(LISTVAR_ const *list)
{
return size(list);
}
icmake-7.21.01/exec/list/addswallowcp.c 0000644 0001750 0001750 00000000165 12000542231 016615 0 ustar frank frank #include "list.ih"
void listAdd_swallow_cP(LISTVAR_ *list, char *txt)
{
incsize(list);
addtxt(list, txt);
}
icmake-7.21.01/exec/list/at.c 0000644 0001750 0001750 00000000154 12000542231 014533 0 ustar frank frank #include "list.ih"
char const *listAt(LISTVAR_ const *list, size_t idx)
{
return element(list)[idx];
}
icmake-7.21.01/exec/list/listcleanup.cc 0000644 0001750 0001750 00000002240 12000542231 016613 0 ustar frank frank #include
#include
using namespace std;
int main(size_t argc, char **argv)
{
istringstream in(argv[1]);
size_t idx;
size_t toRemove = 0;
while (in >> idx)
{
++toRemove;
argv[idx] = 0;
in.seekg(1, ios::cur);
}
for
(
char **empty = argv, **end = empty + argc;
empty != end; /* walk along all elements */
++empty
)
{
if (*empty) /* next element if non-empty */
{
cout << "In use: " << *empty << endl;
continue;
}
char **used = empty + 1; /* beyond the empty one: find used */
for (; used != end && *used == 0; ++used)
; /* find the next one in use */
if (used == end) /* at the end */
break;
*empty = *used; /* swap `used' and `empty' */
*used = 0;
}
argc -= toRemove;
for (size_t idx = 0; idx < argc; ++idx)
cout << idx << ": " << *argv++ << endl;
return 0;
}
icmake-7.21.01/exec/list/constructorscpp.c 0000644 0001750 0001750 00000000345 12000542231 017404 0 ustar frank frank #include "list.ih"
LISTVAR_ *listConstructor_s_cPP(size_t argc, char **argv)
{
static LISTVAR_ ret = {e_list, {0}};
ret.vu.i = newlist();
for (; argc--; )
listAdd_cP(&ret, *++argv);
return &ret;
}
icmake-7.21.01/exec/list/destructor.c 0000644 0001750 0001750 00000000332 12000542231 016323 0 ustar frank frank #include "list.ih"
void listDestructor(LISTVAR_ *var)
{
size_t idx;
if (varDecCount(var) >= 1)
return;
for (idx = size(var); idx--; )
free(element(var)[idx]);
free(element(var));
}
icmake-7.21.01/exec/list/compare.c 0000644 0001750 0001750 00000001460 12000542231 015556 0 ustar frank frank #include "list.ih"
void listCompare(LISTVAR_ *lhs, LISTVAR_ const *rhs)
{
int ret = 0;
size_t idx;
size_t l_size = size(lhs);
if (l_size != size(rhs))
{
listDestructor(lhs);
*lhs = *intConstructor_i((int)(l_size - size(rhs)));
return;
}
for (idx = 0; idx < l_size; ++idx)
{
ret = strcmp(element(lhs)[idx], element(rhs)[idx]);
if (ret)
break;
}
/* Can't use the return value as-is, since */
/* the non-16 bit return value may have its */
/* lower 16 bits set to zero (as happened */
/* on the powerpc */
*lhs = *intConstructor_i(ret < 0 ? -1 : ret > 0 ? 1 : 0);
}
icmake-7.21.01/exec/list/incsize.c 0000644 0001750 0001750 00000000107 12000542231 015571 0 ustar frank frank #include "list.ih"
void incsize(LISTVAR_ *list)
{
++size(list);
}
icmake-7.21.01/exec/list/list.ih 0000644 0001750 0001750 00000000752 12000542231 015264 0 ustar frank frank #include "list.h"
#include
#include
#include "../var/var.h"
#include "../virtual/virtual.h"
#include "../int/int.h"
INTER_ *newlist(void);
void incsize(LISTVAR_ *list);
void addtxt(LISTVAR_ *list, char *txt);
size_t listremove(LISTVAR_ *list, char const *txt);
void listcleanup(LISTVAR_ *list, size_t toRemove);
#define list(plist) ((plist)->vu.i->ls.list)
#define size(plist) (list(plist).size)
#define element(plist) (list(plist).element)
icmake-7.21.01/exec/list/remove.c 0000644 0001750 0001750 00000000551 12000542231 015425 0 ustar frank frank #include "list.ih"
size_t listremove(LISTVAR_ *list, char const *txt)
{
size_t idx = size(list);
size_t nRemoved = 0;
while (idx--)
{
char **target = &element(list)[idx];
if (strcmp(txt, *target) == 0)
{
free(*target);
*target = 0;
++nRemoved;
}
}
return nRemoved;
}
icmake-7.21.01/exec/list/addcp.c 0000644 0001750 0001750 00000000174 12000542231 015204 0 ustar frank frank #include "list.ih"
void listAdd_cP(LISTVAR_ *list, char const *txt)
{
incsize(list);
addtxt(list, xstrdup(txt));
}
icmake-7.21.01/exec/list/list.h 0000644 0001750 0001750 00000001574 12000542231 015116 0 ustar frank frank #ifndef _INCLUDED_LIST_H_
#define _INCLUDED_LIST_H_
#include "../../rss/icrss.h"
typedef VAR_ LISTVAR_;
LISTVAR_ *listConstructor(void);
LISTVAR_ *listConstructor_s_cPP(size_t argc, char **argv);
LISTVAR_ *listConstructor_cP(char const *argv);
LISTVAR_ *listCopyCons(LISTVAR_ const *var);
void listDestructor(LISTVAR_ *var);
void listAssign(LISTVAR_ *lhs, LISTVAR_ const *rhs);
void listAdd_cP(LISTVAR_ *list, char const *txt);
void listAdd_swallow_cP(LISTVAR_ *list, char *txt);
void listAdd_L(LISTVAR_ *lhs, LISTVAR_ const *rhs);
void listSub(LISTVAR_ *lhs, LISTVAR_ const *rhs);
int listLogical(LISTVAR_ const *lhs);
int listContains(LISTVAR_ *lhs, char const *str);
size_t listSize(LISTVAR_ const *list);
char const *listAt(LISTVAR_ const *list, size_t idx);
void listSort(LISTVAR_ *list);
#endif
icmake-7.21.01/exec/list/contains.c 0000644 0001750 0001750 00000000337 12000542231 015750 0 ustar frank frank #include "list.ih"
int listContains(LISTVAR_ *lhs, char const *str)
{
size_t idx;
for (idx = size(lhs); idx--; )
{
if (strcmp(str, element(lhs)[idx]) == 0)
return 1;
}
return 0;
}
icmake-7.21.01/exec/list/copycons.c 0000644 0001750 0001750 00000000267 12000542231 015771 0 ustar frank frank #include "list.ih"
LISTVAR_ *listCopyCons(LISTVAR_ const *other)
{
static LISTVAR_ dest;
dest = *other;
dest.type = e_list;
varIncCount(&dest);
return &dest;
}
icmake-7.21.01/exec/list/sub.c 0000644 0001750 0001750 00000001076 12000542231 014724 0 ustar frank frank #include "list.ih"
void listSub(LISTVAR_ *dest, LISTVAR_ const *rhs)
{
size_t idx;
size_t nRhs = size(rhs);
size_t nRemoved = 0;
if (nRhs) /* something to add */
{
LISTVAR_ copy = *listCopyCons(dest);
for (idx = 0; idx < nRhs; ++idx)
{
char const *cp = element(rhs)[idx];
nRemoved += listremove(©, cp);
}
if (nRemoved)
{
listcleanup(©, nRemoved);
listAssign(dest, ©);
}
listDestructor(©);
}
}
icmake-7.21.01/exec/list/newlist.c 0000644 0001750 0001750 00000000241 12000542231 015611 0 ustar frank frank #include "list.ih"
INTER_ *newlist()
{
INTER_ *ret = malloc(sizeof(INTER_));
ret->count = 1;
memset(&ret->ls, 0, sizeof(LIST_));
return ret;
}
icmake-7.21.01/exec/list/constructor.c 0000644 0001750 0001750 00000000212 12000542231 016507 0 ustar frank frank #include "list.ih"
LISTVAR_ *listConstructor()
{
static LISTVAR_ ret = {e_list, {0}};
ret.vu.i = newlist();
return &ret;
}
icmake-7.21.01/exec/list/sort.c 0000644 0001750 0001750 00000001070 12000542231 015114 0 ustar frank frank /*
\funcref{sortlist}{VAR\_ sortlist (\params)}
{
{VAR\_} {v} {variable holding list to sort}
}
{variable holding sorted list}
{}
{}
{sortlist.c}
{
This function sorts the list of variable {\em v}. The same variable,
after sorting, is returned.
}
*/
#include "list.ih"
static int compelement (void const *s1, void const *s2)
{
return (strcmp (*(char const * const *)s1, *(char const * const *)s2));
}
void listSort(LISTVAR_ *list)
{
qsort (element(list), size(list), sizeof(char *), compelement);
}
icmake-7.21.01/exec/list/addl.c 0000644 0001750 0001750 00000001030 12000542231 015025 0 ustar frank frank #include "list.ih"
void listAdd_L(LISTVAR_ *dest, LISTVAR_ const *rhs)
{
size_t idx;
size_t nRhs = size(rhs);
if (nRhs) /* something to add */
{
LISTVAR_ copy = *listCopyCons(dest);
for (idx = 0; idx < nRhs; ++idx)
{
char const *cp = element(rhs)[idx];
if (!listContains(©, cp))
listAdd_cP(©, cp);
}
if (size(©) != size(dest))
assign(dest, ©);
listDestructor(©);
}
}
icmake-7.21.01/exec/var/ 0000755 0001750 0001750 00000000000 12267172022 013614 5 ustar frank frank icmake-7.21.01/exec/var/var.h 0000644 0001750 0001750 00000000571 12000542231 014544 0 ustar frank frank #ifndef _INCLUDED_VAR_H_
#define _INCLUDED_VAR_H_
#include "../../rss/icrss.h"
#define typeValue(varp) ((varp)->type & (e_list | e_str | e_int))
#define typeIdx(varp) ((varp)->type & e_list ? 2 : (varp)->type & e_str ? 1 : 0)
UNS16 varCount(VAR_ *var);
void varIncCount(VAR_ *var);
UNS16 varDecCount(VAR_ *var); /* returns count following the reduction */
#endif
icmake-7.21.01/exec/var/deccount.c 0000644 0001750 0001750 00000000123 12000542231 015544 0 ustar frank frank #include "var.ih"
UNS16 varDecCount(VAR_ *var)
{
return --var->vu.i->count;
}
icmake-7.21.01/exec/var/var.ih 0000644 0001750 0001750 00000000021 12000542231 014703 0 ustar frank frank #include "var.h"
icmake-7.21.01/exec/var/inccount.c 0000644 0001750 0001750 00000000113 12000542231 015561 0 ustar frank frank #include "var.ih"
void varIncCount(VAR_ *var)
{
++var->vu.i->count;
}
icmake-7.21.01/exec/var/count.c 0000644 0001750 0001750 00000000116 12000542231 015072 0 ustar frank frank #include "var.ih"
UNS16 varCount(VAR_ *var)
{
return var->vu.i->count;
}
icmake-7.21.01/exec/icm-exec.h 0000644 0001750 0001750 00000001330 12000542231 014650 0 ustar frank frank #include "../rss/icrssdef.h"
#ifdef MSDOS
# include
# include
# include
# include
# include
# include
#else
# include
#endif
#include
#include
#include
#include "../rss/icrss.h"
#include "global.h"
#include "int/int.h"
#include "list/list.h"
#include "string/string.h"
#include "stack/stack.h"
#include "virtual/virtual.h"
#include "opcodefun/opcodefun.h"
extern UNS16 nvar;
extern char release[];
extern char version[];
extern char *bimname;
extern char *bimname;
void abnormal(int sig, int subcode);
void cleanup(void);
void environ2list(LISTVAR_ *list);
icmake-7.21.01/exec/global.h 0000644 0001750 0001750 00000000403 12000542231 014416 0 ustar frank frank #ifndef _INCLUDED_GLOBAL_H_
#define _INCLUDED_GLOBAL_H_
#include "../rss/icrss.h"
extern size_t curoffs;
extern char orgdir[];
extern FILE *infile;
extern VAR_ *var;
extern int retval;
extern BIN_HEADER_ *headerp;
#endif
icmake-7.21.01/exec/int/ 0000755 0001750 0001750 00000000000 12267172022 013616 5 ustar frank frank icmake-7.21.01/exec/int/constructori.c 0000644 0001750 0001750 00000000217 12000542231 016504 0 ustar frank frank #include "int.h"
INTVAR_ *intConstructor_i(int value)
{
static INTVAR_ ret = {e_int, {0}};
ret.vu.intval = value;
return &ret;
}
icmake-7.21.01/exec/int/logical.c 0000644 0001750 0001750 00000000124 12000542231 015355 0 ustar frank frank #include "int.h"
int intLogical(INTVAR_ const *lhs)
{
return lhs->vu.intval;
}
icmake-7.21.01/exec/int/assign.c 0000644 0001750 0001750 00000000151 12000542231 015227 0 ustar frank frank #include "int.ih"
void intAssign(VAR_ *lhs, VAR_ const *rhs)
{
destructor(lhs);
*lhs = *rhs;
}
icmake-7.21.01/exec/int/setvalue.c 0000644 0001750 0001750 00000000134 12000542231 015574 0 ustar frank frank #include "int.h"
void intSetValue(INTVAR_ *lhs, int value)
{
lhs->vu.intval = value;
}
icmake-7.21.01/exec/int/destructor.c 0000644 0001750 0001750 00000000064 12000542231 016144 0 ustar frank frank #include "int.h"
void intDestructor(VAR_ *var)
{}
icmake-7.21.01/exec/int/int.h 0000644 0001750 0001750 00000001160 12000542231 014543 0 ustar frank frank #ifndef _INCLUDED_INT_H_
#define _INCLUDED_INT_H_
#include "../../rss/icrss.h"
typedef VAR_ INTVAR_;
INTVAR_ *intConstructor(void);
INTVAR_ *intConstructor_i(int value);
INTVAR_ *intCopyCons(INTVAR_ const *other);
void intDestructor(VAR_ *lhs);
void intAssign(VAR_ *lhs, VAR_ const *rhs);
void intAdd(VAR_ *lhs, VAR_ const *rhs);
void intSub(VAR_ *lhs, VAR_ const *rhs); /* same as intCompare */
int intLogical(INTVAR_ const *lhs);
void intSetValue(INTVAR_ *lhs, int value);
int intValue(INTVAR_ const *lhs); /* return the stored int */
#endif
icmake-7.21.01/exec/int/add.c 0000644 0001750 0001750 00000000165 12000542231 014500 0 ustar frank frank #include "int.ih"
void intAdd(VAR_ *lhs, VAR_ const *rhs)
{
intSetValue(lhs, intValue(lhs) + intValue(rhs));
}
icmake-7.21.01/exec/int/value.c 0000644 0001750 0001750 00000000122 12000542231 015055 0 ustar frank frank #include "int.h"
int intValue(INTVAR_ const *lhs)
{
return lhs->vu.intval;
}
icmake-7.21.01/exec/int/int.ih 0000644 0001750 0001750 00000000063 12000542231 014715 0 ustar frank frank #include "int.h"
#include "../virtual/virtual.h"
icmake-7.21.01/exec/int/copycons.c 0000644 0001750 0001750 00000000243 12000542231 015602 0 ustar frank frank #include "int.h"
INTVAR_ *intCopyCons(INTVAR_ const *other)
{
static INTVAR_ ret = {e_int, {0}};
intSetValue(&ret, intValue(other));
return &ret;
}
icmake-7.21.01/exec/int/sub.c 0000644 0001750 0001750 00000000165 12000542231 014541 0 ustar frank frank #include "int.ih"
void intSub(VAR_ *lhs, VAR_ const *rhs)
{
intSetValue(lhs, intValue(lhs) - intValue(rhs));
}
icmake-7.21.01/exec/int/constructor.c 0000644 0001750 0001750 00000000150 12000542231 016327 0 ustar frank frank #include "int.h"
INTVAR_ *intConstructor()
{
static INTVAR_ ret = {e_int, {0}};
return &ret;
}
icmake-7.21.01/exec/virtual/ 0000755 0001750 0001750 00000000000 12267172022 014512 5 ustar frank frank icmake-7.21.01/exec/virtual/logical.c 0000644 0001750 0001750 00000000146 12000542231 016255 0 ustar frank frank #include "virtual.ih"
int logical(VAR_ const *lhs)
{
return p_logical[typeIdx(lhs)](lhs);
}
icmake-7.21.01/exec/virtual/assign.c 0000644 0001750 0001750 00000000152 12000542231 016124 0 ustar frank frank #include "virtual.ih"
void assign(VAR_ *lhs, VAR_ const *rhs)
{
p_assign[typeIdx(rhs)](lhs, rhs);
}
icmake-7.21.01/exec/virtual/destructor.c 0000644 0001750 0001750 00000000134 12000542231 017036 0 ustar frank frank #include "virtual.ih"
void destructor(VAR_ *lhs)
{
p_destructor[typeIdx(lhs)](lhs);
}
icmake-7.21.01/exec/virtual/virtual.ih 0000644 0001750 0001750 00000002552 12000542231 016512 0 ustar frank frank #include "virtual.h"
#include "../var/var.h"
#include
VAR_ *intConstructor(void);
VAR_ *stringConstructor(void);
VAR_ *listConstructor(void);
void intAssign(VAR_ *lhs, VAR_ const *rhs);
void stringAssign(VAR_ *lhs, VAR_ const *rhs);
void listAssign(VAR_ *lhs, VAR_ const *rhs);
void intAdd(VAR_ *lhs, VAR_ const *rhs);
void stringAdd(VAR_ *lhs, VAR_ const *rhs);
void listAdd_L(VAR_ *lhs, VAR_ const *rhs);
void intSub(VAR_ *lhs, VAR_ const *rhs);
void stringSub(VAR_ *lhs, VAR_ const *rhs);
void listSub(VAR_ *lhs, VAR_ const *rhs);
/* intCompare(void) is intSub() */
void stringCompare(VAR_ *lhs, VAR_ const *rhs);
void listCompare(VAR_ *lhs, VAR_ const *rhs);
void intDestructor(VAR_ *var);
void stringDestructor(VAR_ *var);
void listDestructor(VAR_ *var);
int intLogical(VAR_ const *var);
int stringLogical(VAR_ const *var);
int listLogical(VAR_ const *var);
VAR_ *intCopyCons(VAR_ const *var);
VAR_ *stringCopyCons(VAR_ const *var);
VAR_ *listCopyCons(VAR_ const *var);
extern void (*p_assign[])(VAR_ *lhs, VAR_ const *rhs);
extern void (*p_add[])(VAR_ *lhs, VAR_ const *rhs);
extern void (*p_sub[])(VAR_ *lhs, VAR_ const *rhs);
extern void (*p_compare[])(VAR_ *lhs, VAR_ const *rhs);
extern VAR_ *(*p_constructor[])(void);
extern VAR_ *(*p_copycons[])(VAR_ const *lhs);
extern void (*p_destructor[])(VAR_ *var);
extern int (*p_logical[])(VAR_ const *var);
icmake-7.21.01/exec/virtual/compare.c 0000644 0001750 0001750 00000000154 12000542231 016270 0 ustar frank frank #include "virtual.ih"
void compare(VAR_ *lhs, VAR_ const *rhs)
{
p_compare[typeIdx(rhs)](lhs, rhs);
}
icmake-7.21.01/exec/virtual/add.c 0000644 0001750 0001750 00000000147 12000542231 015374 0 ustar frank frank #include "virtual.ih"
void add(VAR_ *lhs, VAR_ const *rhs)
{
p_add[typeIdx(rhs)](lhs, rhs);
}
icmake-7.21.01/exec/virtual/data.c 0000644 0001750 0001750 00000001476 12000542231 015563 0 ustar frank frank #include "virtual.ih"
VAR_ *(*p_constructor[3])(void) =
{
intConstructor,
stringConstructor,
listConstructor,
};
VAR_ *(*p_copycons[3])(VAR_ const *) =
{
intCopyCons,
stringCopyCons,
listCopyCons,
};
void (*p_destructor[3])(VAR_ *var) =
{
intDestructor,
stringDestructor,
listDestructor,
};
void (*p_assign[3])(VAR_ *lhs, VAR_ const *rhs) =
{
intAssign,
stringAssign,
listAssign,
};
int (*p_logical[3])(VAR_ const *var) =
{
intLogical,
stringLogical,
listLogical,
};
void (*p_add[3])(VAR_ *lhs, VAR_ const *rhs) =
{
intAdd,
stringAdd,
listAdd_L,
};
void (*p_sub[3])(VAR_ *lhs, VAR_ const *rhs) =
{
intSub,
NULL,
listSub,
};
void (*p_compare[3])(VAR_ *lhs, VAR_ const *rhs) =
{
intSub,
stringCompare,
listCompare,
};
icmake-7.21.01/exec/virtual/virtual.h 0000644 0001750 0001750 00000001122 12000542231 016331 0 ustar frank frank #ifndef _INCLUDED_VIRTUAL_H_
#define _INCLUDED_VIRTUAL_H_
#include "../../rss/icrss.h"
VAR_ *constructor(E_TYPE_ type); /* default cons. sets count */
VAR_ *copyCons(VAR_ const *var); /* increments count */
void destructor(VAR_ *var); /* decrements count */
void assign(VAR_ *lhs, VAR_ const *rhs); /* increments count */
int logical(VAR_ const *var); /* convert var to logical value */
void add(VAR_ *lhs, VAR_ const *rhs);
void subtract(VAR_ *lhs, VAR_ const *rhs);
void compare(VAR_ *lhs, VAR_ const *rhs);
#endif
icmake-7.21.01/exec/virtual/copycons.c 0000644 0001750 0001750 00000000154 12000542231 016477 0 ustar frank frank #include "virtual.ih"
VAR_ *copyCons(VAR_ const *other)
{
return p_copycons[typeIdx(other)](other);
}
icmake-7.21.01/exec/virtual/constructor.c 0000644 0001750 0001750 00000000202 12000542231 017221 0 ustar frank frank #include "virtual.ih"
VAR_ *constructor(E_TYPE_ type)
{
return p_constructor[type & e_list ? 2 : type & e_str ? 1 : 0]();
}
icmake-7.21.01/exec/virtual/subtract.c 0000644 0001750 0001750 00000000151 12000542231 016466 0 ustar frank frank #include "virtual.ih"
void subtract(VAR_ *lhs, VAR_ const *rhs)
{
p_sub[typeIdx(rhs)](lhs, rhs);
}
icmake-7.21.01/exec/opcodefun/ 0000755 0001750 0001750 00000000000 12267172022 015006 5 ustar frank frank icmake-7.21.01/exec/opcodefun/popre.c 0000644 0001750 0001750 00000000571 12000542231 016266 0 ustar frank frank /*
\funcref{fun\_pop\_reg}{void fun\_pop\_reg ()}
{}
{}
{discard(), pop()}
{fun\_push\_reg()}
{funpopre.c}
{
The last pushed value is popped into the return register. This action
is usually taken when a function is about to return a value.
}
*/
#include "opcodefun.ih"
void fun_pop_reg ()
{
assign(®, top());
pop();
}
icmake-7.21.01/exec/opcodefun/process.c 0000644 0001750 0001750 00000002004 12175751705 016635 0 ustar frank frank /*
\funcref{process}{void process ()}
{}
{}
{getopcode()}
{}
{process.c}
{
Function {\em process()} is the main loop of the execution of the
binary makefile. It is called from {\em main()} when the variables are
read and when the offsets of the variable section and of the strings
section are known.
An opcode is retrieved from the binary makefile and appropriate action
is taken until an {\em op\_ret} opcode is encountered.
}
*/
#include "opcodefun.ih"
void process ()
{
register OPCODE_ op;
arghead = xstrdup("");
argtail = xstrdup("");
cmdhead = xstrdup("");
cmdtail = xstrdup("");
do
{
curoffs = (size_t)ftell(infile);
op = getopcode(infile);
if (op >= op_hlt || op == (OPCODE_)-1)
{
fprintf(stderr, "bad opcode at %s ", hexstring(curoffs, 4));
error("(opcode %s)", hexstring(op, 2));
}
procfun[op]();
}
while (op != op_exit);
}
icmake-7.21.01/exec/opcodefun/popva.c 0000644 0001750 0001750 00000001736 12000542231 016272 0 ustar frank frank /*
\funcref{fun\_pop\_var}{void fun\_pop\_var ()}
{}
{}
{getint16(), pop()}
{fun\_copy\_var()}
{funpopva.c}
{
This function is called when an {\em op\_pop\_var} is encountered in
the binary makefile. Following the opcode a variable index is expected.
The logic of the function is as follows:
\begin{itemize}
\item The original contents of the variable are released if
necessary by calling {\em discard()}.
\item The last used stack element is copied into the variable.
\item The stack pointer is decremented to reflect the shrinking of
the stack.
\end{itemize}
Note that the memory associated with the stack variable remains
unchanged.
}
*/
#include "opcodefun.ih"
void fun_pop_var()
{
assign(getdest(), top()); /* increments the reference count */
pop(); /* and resets it to its former value */
}
icmake-7.21.01/exec/opcodefun/itoa.c 0000644 0001750 0001750 00000001301 12000542231 016065 0 ustar frank frank /*
\funcref{fun\_itoa}{void fun\_itoa ()}
{}
{}
{newvar(), xstrdup()}
{fun\_atoi(), etc.}
{funitoa.c}
{
This funtion converts the integer variable which was last pushed to a
string variable. The {\em type} field of the last used stack position
(this is {\em stack[sp]}) is set to {\em e\_str} and the {\em
vu.str} field is assigned to hold the string representation of the
{\em vu.intval} field.
}
*/
#include "opcodefun.ih"
void fun_itoa()
{
char buffer[100];
sprintf(buffer, "%d", intValue(top()));
{
VAR_ str = *stringConstructor_cP(buffer);
assign(top(), &str);
stringDestructor(&str);
}
}
icmake-7.21.01/exec/opcodefun/smeq.c 0000644 0001750 0001750 00000000765 12000542231 016113 0 ustar frank frank /*
\funcref{fun\_smeq}{void fun\_smeq ()}
{}
{}
{push(), compare(), pop()}
{}
{funsmeq.c}
{
Function {\em fun\_smeq()} is called when opcode {\em op\_smeq} is read.
This function pops two variables, calls {\em compare()} to compare the
values, and pushes the result of the comparison. The two compared
variables are discarded.
}
*/
#include "opcodefun.ih"
void fun_smeq ()
{
fun_neq();
intSetValue(top(), intValue(top()) <= 0);
}
icmake-7.21.01/exec/opcodefun/push1.c 0000644 0001750 0001750 00000001245 12000542231 016200 0 ustar frank frank /*
\funcref{fun\_push\_1\_jmp\_end}{void fun\_push\_1\_jmp\_end ()}
{}
{}
{push()}
{fun\_push\_0()}
{funpush1.c}
{
This function serves the evaluation of logical expressions. It is
executed when an {\em op\_push\_1\_jmp\_end} opcode is found in the
binary
makefile. A variable of type {\em e\_int} is pushed, while its {\em
vu.intval} field is set 1. After this, the next opcode (which is
by definition {\em op\_push\_0}) is skipped.
}
*/
#include "opcodefun.ih"
void fun_push_1_jmp_end ()
{
INTVAR_ tmp = *intConstructor_i(1);
push(&tmp);
intDestructor(&tmp);
getopcode(infile);
}
icmake-7.21.01/exec/opcodefun/bnot.c 0000644 0001750 0001750 00000000505 12000542231 016100 0 ustar frank frank /*
\funcref{fun\_bnot}{void fun\_bnot ()}
{}
{}
{}
{}
{funbnot.c}
{
Function {\em fun\_bnot()} bitwise-not's the last pushed
variable. This variable is assumed to be of type {\em e\_int}.
}
*/
#include "opcodefun.ih"
void fun_bnot ()
{
intSetValue(top(), ~intValue(top()));
}
icmake-7.21.01/exec/opcodefun/dec.c 0000644 0001750 0001750 00000000661 12000542231 015674 0 ustar frank frank /*
\funcref{fun\_dec}{void fun\_dec ()}
{}
{}
{}
{fun\_inc()}
{fundec.c}
{
This function decrements the {\em vu.intval} field of a variable. The
The number of the variable (a 16-bits unsigned number) is assumed to
follow the {\em op\_dec} opcode.
}
*/
#include "opcodefun.ih"
void fun_dec ()
{
register VAR_ *dest = getdest();
intSetValue(dest, intValue(dest) - 1);
}
icmake-7.21.01/exec/opcodefun/exit.c 0000644 0001750 0001750 00000000470 12000542231 016110 0 ustar frank frank /*
\funcref{fun\_exit}{void fun\_exit ()}
{}
{}
{pop()}
{}
{funexit.c}
{
This function places the {\em int} value of the return register {\em
reg} into the global variable {\em retval}.
}
*/
#include "opcodefun.ih"
void fun_exit()
{
retval = intValue(®);
}
icmake-7.21.01/exec/opcodefun/bor.c 0000644 0001750 0001750 00000000704 12000542231 015721 0 ustar frank frank /*
\funcref{fun\_bor}{void fun\_bor ()}
{}
{}
{pop(), push()}
{}
{funbor.c}
{
This function pops two variables and pushes the bitwise or-ed result
of the {\em vu.intval} fields of these variables. The resulting
pushed variable is of type {\em e\_int}. } */
#include "opcodefun.ih"
void fun_bor ()
{
int rvalue = intValue(top());
pop();
intSetValue(top(), intValue(top()) | rvalue);
}
icmake-7.21.01/exec/opcodefun/callr.c 0000644 0001750 0001750 00000001714 12000542231 016236 0 ustar frank frank /*
\funcref{fun\_call\_rss}{void fun\_call\_rss ()}
{}
{}
{error(), getopcode()}
{}
{funcallr.c}
{
This function is executed when an {\em op\_call\_rss} opcode is
encountered in the binary makefile. Following this opcode a function
index is expected (an {\em char} value), indicating the function number
to call (see the enumeration type {\em FUNNR\_} in the file {\em
icrss.h}).
If the index indicates a non-existing function, i.e., when the index
exceeds or equals {\em f\_hlt}, an error occurs. Else, the indicated
built in function is called (see the {\em builtinfun} array of function
pointers, files {\em opcodefun.ih} and {\em data.c}).
}
*/
#include "opcodefun.ih"
void fun_call_rss ()
{
size_t funnr = (size_t)getopcode (infile);
if (funnr >= f_hlt)
error ("unexisting rss function call at %s", hexstring(curoffs, 4));
builtin(funnr);
}
icmake-7.21.01/exec/opcodefun/greq.c 0000644 0001750 0001750 00000000765 12000542231 016104 0 ustar frank frank /*
\funcref{fun\_greq}{void fun\_greq ()}
{}
{}
{push(), compare(), pop()}
{}
{fungreq.c}
{
Function {\em fun\_greq()} is called when opcode {\em op\_greq} is read.
This function pops two variables, calls {\em compare()} to compare the
values, and pushes the result of the comparison. The two compared
variables are discarded.
}
*/
#include "opcodefun.ih"
void fun_greq ()
{
fun_neq();
intSetValue(top(), intValue(top()) >= 0);
}
icmake-7.21.01/exec/opcodefun/atol.c 0000644 0001750 0001750 00000001162 12000542231 016075 0 ustar frank frank /*
\funcref{fun\_atol}{void fun\_atol ()}
{}
{}
{addtolist(), discard(), newvar()}
{fun\_atoi(), etc.}
{funatol.c}
{
This function converts the last pushed variable, which is assumed to
hold a string, to a list of one element. The string variable is
discarded after use. The formed list, containing one element, is copied
onto the stack to the former position of the string variable.
}
*/
#include "opcodefun.ih"
#include "../var/var.h"
void fun_atol()
{
VAR_ tmp = *listConstructor_cP(stringStr(top()));
assign(top(), &tmp);
listDestructor(&tmp);
}
icmake-7.21.01/exec/opcodefun/asp.c 0000644 0001750 0001750 00000001172 12000542231 015722 0 ustar frank frank /*
\funcref{fun\_asp} {void fun\_asp ()}
{}
{}
{getopcode(), pop(), discard()}
{}
{funasp.c}
{
This function is executed when an {\em op\_asp} opcode
is read from the binary makefile. Following the opcode, an {\em
UNS8} argument is expected which specifies the number of stack
positions to discard.
Function {\em fun\_asp()} repetitively calls {\em pop()} and {\em
discard()} to throw away the stack variables.
}
*/
#include "opcodefun.ih"
void fun_asp ()
{
register size_t idx = (size_t)getopcode(infile);
for ( ; idx--; )
pop();
}
icmake-7.21.01/exec/opcodefun/div.c 0000644 0001750 0001750 00000001374 12000542231 015725 0 ustar frank frank /*
\funcref{fun\_div}{void fun\_div ()}
{}
{}
{pop(), push(), error()}
{}
{fundiv.c}
{
This function pops two variables and pushes the quotient of the {\em
vu.intval} fields of these variables. The resulting pushed variable is
of type {\em e\_int}.
It is assumed that the left argument of the division was pushed first;
therefore, the right argument is popped first. A division by zero leads
to an error.
}
*/
#include "opcodefun.ih"
void fun_div()
{
int value = intValue(top());
if (!value)
error ("division by zero at %s", hexstring(curoffs, 4));
pop();
value = intValue(top()) / value;
intSetValue(top(), value); /* update the top()'s value */
}
icmake-7.21.01/exec/opcodefun/push0.c 0000644 0001750 0001750 00000001012 12000542231 016167 0 ustar frank frank /*
\funcref{fun\_push\_0}{void fun\_push\_0 ()}
{}
{}
{push()}
{fun\_push\_1()}
{funpush0.c}
{
This function serves the evaluation of logical expressions. It is
executed when an {\em op\_push\_0} opcode is found in the binary
makefile. A variable of type {\em e\_int} is pushed, while its {\em
vu.intval} field is set to zero.
}
*/
#include "opcodefun.ih"
void fun_push_0 ()
{
INTVAR_ tmp = *intConstructor_i(0);
push(&tmp);
intDestructor(&tmp);
}
icmake-7.21.01/exec/opcodefun/shr.c 0000644 0001750 0001750 00000001146 12000542231 015734 0 ustar frank frank /*
\funcref{fun\_shr}{void fun\_shr ()}
{}
{}
{pop(), push(), error()}
{}
{funshr.c}
{
This function pops two variables and pushes the shift-right result of
the {\em vu.intval} fields of these variables. The resulting pushed
variable is of type {\em e\_int}.
It is assumed that the left argument of the expression was pushed
first; therefore, the right argument is popped first.
}
*/
#include "opcodefun.ih"
void fun_shr ()
{
int rvalue = intValue(top());
pop();
intSetValue(top(), intValue(top()) >> rvalue);
}
icmake-7.21.01/exec/opcodefun/older.c 0000644 0001750 0001750 00000001445 12000542231 016247 0 ustar frank frank /*
\funcref{fun\_older}{void fun\_older ()}
{}
{}
{pop(), older(), discard()}
{fun\_younger()}
{funolder.c}
{
This function is executed when an {\em op\_older} opcode is found in
the binary makefile. Two variables are popped and their {\em vu.str}
fields are used as file names to compare two files. The result of the
comparison is pushed as an {\em e\_int} variable.
Note that the right operand of the {\em older} operator is popped
first since the left operand is expected to be pushed first.
}
*/
#include "opcodefun.ih"
void fun_older ()
{
int ret;
VAR_ rval = *copyCons(top());
pop();
ret = older(stringStr(top()), stringStr(&rval));
stringDestructor(top());
*top() = *intConstructor_i(ret);
}
icmake-7.21.01/exec/opcodefun/opcodefun.h 0000644 0001750 0001750 00000000136 12000542231 017125 0 ustar frank frank #ifndef _INCLUDED_OPCODEFUN_H_
#define _INCLUDED_OPCODEFUN_H_
void process(void);
#endif
icmake-7.21.01/exec/opcodefun/shl.c 0000644 0001750 0001750 00000001147 12000542231 015727 0 ustar frank frank /*
\funcref{fun\_shl}{void fun\_shl ()}
{}
{}
{pop(), push(), error()}
{}
{funshl.c}
{
This function pops two variables and pushes the shift-left result of
the {\em vu.intval} fields of these variables. The resulting pushed
variable is of type {\em e\_int}.
It is assumed that the left argument of the expression was pushed
first; therefore, the right argument is popped first.
}
*/
#include "opcodefun.ih"
void fun_shl ()
{
int rvalue = intValue(top());
pop();
intSetValue(top(), intValue(top()) << rvalue);
}
icmake-7.21.01/exec/opcodefun/ret.c 0000644 0001750 0001750 00000001210 12000542231 015722 0 ustar frank frank /*
\funcref{fun\_ret}{void fun\_ret ()}
{}
{}
{pop(), discard()}
{fun\_call()}
{funret.c}
{
This code terminates a called function. The assembler opcodes {\em mov
sp, bp ; pop bp} are simulated by popping and discarding until {\em sp}
equals {\em bp} and subsequently popping {\em bp}.
After this, the return address is popped and the file pointer
associated with the input file is set to this address.
}
*/
#include "opcodefun.ih"
void fun_ret ()
{
popBP();
{
INT32 ra = (INT32)intValue(top());
pop();
fseek (infile, ra, SEEK_SET);
}
}
icmake-7.21.01/exec/opcodefun/frame.c 0000644 0001750 0001750 00000002100 12000542231 016221 0 ustar frank frank /*
\funcref{fun\_frame}{void fun\_frame ()}
{}
{}
{push(), newvar(), getopcode()}
{fun\_ret()}
{funframe.c}
{
This function is executed when an {\em op\_frame} opcode is
encountered. Following this opcode, the number of local variables is
expected. When room for local variables should be made, a series of
variable types is expected.
The function imitates the assembler opcodes {\em push bp; mov bp, sp}
by pushing an {\em e\_int} variable with the value of {\em bp} as {\em
vu.intval} field. If local variables should be created, then {\em
newvar()} is called to create a variable (the variable type is read
from the binary makefile) and {\em push()} is called to make room for
the variable.
}
*/
#include "opcodefun.ih"
void fun_frame()
{
size_t nlocals = getopcode(infile);
size_t idx;
for (idx = 0; idx < nlocals; ++idx)
{
VAR_ varFrame = *constructor((E_TYPE_)getopcode(infile));
push(&varFrame);
destructor(&varFrame);
}
}
icmake-7.21.01/exec/opcodefun/younger.c 0000644 0001750 0001750 00000001463 12000542231 016632 0 ustar frank frank /*
\funcref{fun\_younger}{void fun\_younger ()}
{}
{}
{pop(), younger(), discard()}
{fun\_younger()}
{funyoung.c}
{
This function is executed when an {\em op\_younger} opcode is found in
the binary makefile. Two variables are popped and their {\em vu.str}
fields are used as file names to compare two files. The result of the
comparison is pushed as an {\em e\_int} variable.
Note that the right operand of the {\em younger} operator is popped
first since the left operand is expected to be pushed first.
}
*/
#include "opcodefun.ih"
void fun_younger ()
{
int ret;
VAR_ rval = *copyCons(top());
pop();
ret = younger(stringStr(top()), stringStr(&rval));
stringDestructor(top());
*top() = *intConstructor_i(ret);
}
icmake-7.21.01/exec/opcodefun/eq.c 0000644 0001750 0001750 00000001234 12000542231 015543 0 ustar frank frank /*
\funcref{fun\_eq}{void fun\_eq ()}
{}
{}
{push(), compare(), pop()}
{}
{funeq.c}
{
Function {\em fun\_eq()} is called when opcode {\em op\_eq} is read.
This function pops two variables, calls {\em compare()} to compare the
values, and pushes the result of the comparison. The two compared
variables are discarded.
The result of the comparison is logically {\em not}-ted when two
integers are beging compared, since {\em compare()} subtracts two
integer values as result.
}
*/
#include "opcodefun.ih"
void fun_eq ()
{
fun_neq();
intSetValue(top(), !intValue(top()));
}
icmake-7.21.01/exec/opcodefun/add.c 0000644 0001750 0001750 00000001526 12000542231 015672 0 ustar frank frank /*
\funcref{fun\_add}{void fun\_add ()}
{}
{}
{pop(), xstrdup(), copylist(), addtolist(), discard()}
{}
{funadd.c}
{
Function {\em fun\_add()} processes opcode {\em op\_add}. Two variables
are popped and added. Depending on their type, two integer values are
added, two strings are concatenated, or two lists are merged.
The result of the addition is stored in a temporary variable, which is
then pushed.
The two popped variables are discarded after use.
}
*/
#include "opcodefun.ih"
void fun_add()
{
VAR_ rval = *copyCons(top()); /* make a copy */
pop(); /* remove the r-operand */
add(top(), &rval); /* add the rval to the top */
destructor(&rval); /* remove the local var */
}
icmake-7.21.01/exec/opcodefun/data.c 0000644 0001750 0001750 00000001735 12000542231 016055 0 ustar frank frank #include "opcodefun.ih"
void (*procfun[])(void) =
{
fun_jmp,
fun_jmp_false,
fun_jmp_true,
fun_push_1_jmp_end,
fun_push_0,
fun_push_imm,
fun_push_strconst,
fun_push_var,
fun_push_reg,
fun_pop_var,
fun_umin,
fun_atoi,
fun_itoa,
fun_atol,
fun_mul,
fun_div,
fun_mod,
fun_add,
fun_sub,
fun_eq,
fun_neq,
fun_sm,
fun_gr,
fun_younger,
fun_older,
fun_smeq,
fun_greq,
fun_call_rss,
fun_asp,
fun_exit,
fun_copy_var,
fun_inc,
fun_dec,
fun_call,
fun_frame,
fun_ret,
fun_pop_reg,
fun_band,
fun_bor,
fun_bnot,
fun_xor,
fun_shl,
fun_shr,
/* fun_hlt does not exist, op_hlt is a dummy... */
};
icmake-7.21.01/exec/opcodefun/istrue.c 0000644 0001750 0001750 00000001422 12000542231 016450 0 ustar frank frank /*
\funcref{istrue}{void istrue ()}
{}
{0: the last pushed variable yields `false'; otherwise: the last pushed
variable yields `true'}
{pop(), discard()}
{fun\_jmp\_true(), fun\_jmp\_false()}
{istrue.c}
{
This function pops the last pushed variable and determines if that
variable should yield true. If the variable is of type {\em e\_int},
then the integer representation is returned. If the variable is of
type {\em e\_str}, then the first character in the string (this may
be a zero-byte) is returned. If the variable is of type {\em
e\_list}, the list size is returned.
The popped variable is discarded.
}
*/
#include "opcodefun.ih"
int istrue()
{
int ret = logical(top());
pop();
return ret;
}
icmake-7.21.01/exec/opcodefun/atoi.c 0000644 0001750 0001750 00000001265 12000542231 016076 0 ustar frank frank /*
\funcref{fun\_atoi}{void fun\_atoi ()}
{}
{}
{discard()}
{fun\_atol(), etc.}
{funatoi.c}
{
This funtion converts the string variable which was last pushed to an
integer variable. The {\em type} field of the last used stack position
(this is {\em stack[sp]}) is set to {\em e\_int} and the {\em
vu.intval} field is assigned to hold the integer representation of the
{\em vu.str} field.
The string variable which occupied the stack is discarded.
}
*/
#include "opcodefun.ih"
void fun_atoi()
{
INTVAR_ value = *intConstructor_i(atoi(stringStr(top())));
assign(top(), &value);
intDestructor(&value);
}
icmake-7.21.01/exec/opcodefun/umin.c 0000644 0001750 0001750 00000000514 12000542231 016106 0 ustar frank frank /*
\funcref{fun\_umin}{void fun\_umin ()}
{}
{}
{}
{}
{funumin.c}
{
Function {\em fun\_umin()} reverses the sign of the last pushed
variable. This variable is assumed to be of type {\em e\_int}.
}
*/
#include "opcodefun.ih"
void fun_umin()
{
top()->vu.intval = -top()->vu.intval;
}
icmake-7.21.01/exec/opcodefun/getdest.c 0000644 0001750 0001750 00000001072 12000542231 016575 0 ustar frank frank /*
\funcref{getdest}{VAR\_ $*$getdest ()}
{}
{pointer to {\em VAR\_} structure}
{getint16()}
{}
{getdest.c}
{
This function is called when an opcode is read which is followed by a
variable number (e.g., {\em op\_push\_var}). The index is read and a
pointer to a {\em VAR\_} structure is returned; either in the variables
section or in the stack (relative to {\em bp}).
}
*/
#include "opcodefun.ih"
VAR_ *getdest()
{
int index = getint16 (infile);
return index >= 0 ? var + index : local(index);
}
icmake-7.21.01/exec/opcodefun/opcodefun.ih 0000644 0001750 0001750 00000003032 12000542231 017274 0 ustar frank frank #include "opcodefun.h"
#ifdef MSDOS
# include
# include
# include
# include
# include
# include
#else
# include
#endif
#include
#include "../../rss/icm.h"
#include "../../rss/icrss.h"
#include "../global.h"
#include "../var/var.h"
#include "../stack/stack.h"
#include "../virtual/virtual.h"
#include "../int/int.h"
#include "../list/list.h"
#include "../string/string.h"
#include "../builtin/builtin.h"
extern void (*procfun[])(void);
VAR_ *getdest(void);
int istrue(void);
void fun_call(void);
void fun_exit(void);
void fun_ret(void);
void fun_pop_reg(void);
void fun_push_imm(void);
void fun_call_rss(void);
void fun_push_strconst(void);
void fun_push_var(void);
void fun_pop_var(void);
void fun_frame(void);
void fun_asp(void);
void fun_add(void);
void fun_shl(void);
void fun_shr(void);
void fun_empty(void);
void fun_jmp(void);
void fun_jmp_true(void);
void fun_push_reg(void);
void fun_older(void);
void fun_younger(void);
void fun_atoi(void);
void fun_atol(void);
void fun_band (void);
void fun_bnot(void);
void fun_bor(void);
void fun_dec(void);
void fun_div(void);
void fun_eq(void);
void fun_gr(void);
void fun_greq(void);
void fun_inc(void);
void fun_itoa(void);
void fun_jmp_false(void);
void fun_mod(void);
void fun_mul(void);
void fun_neq(void);
void fun_push_0(void);
void fun_push_1_jmp_end(void);
void fun_sm(void);
void fun_smeq(void);
void fun_sub(void);
void fun_umin(void);
void fun_xor(void);
void fun_copy_var(void);
icmake-7.21.01/exec/opcodefun/call.c 0000644 0001750 0001750 00000001330 12000542231 016046 0 ustar frank frank /*
\funcref{fun\_call}{void fun\_call ()}
{}
{}
{getint16(), push()}
{fun\_ret()}
{funcall.c}
{
This function is executed whan an {\em op\_call} opcode is read.
Following the opcode a 16-bits unsigned value is expected, stating the
offset of the function to call.
The offset of the next instruction is pushed as an {\em e\_int}
variable. Then the file pointer associated with the binary makefile is
set to the offset of the called function.
}
*/
#include "opcodefun.ih"
void fun_call ()
{
UNS16 offs = getint16(infile);
VAR_ ra = *intConstructor_i(ftell(infile));
push(&ra);
pushBP();
fseek(infile, (INT32)offs, SEEK_SET);
}
icmake-7.21.01/exec/opcodefun/band.c 0000644 0001750 0001750 00000000711 12000542231 016041 0 ustar frank frank /*
\funcref{fun\_band}{void fun\_band ()}
{}
{}
{pop(), push()}
{}
{funband.c}
{
This function pops two variables and pushes the bitwise and-ed result
of the {\em vu.intval} fields of these variables. The resulting
pushed variable is of type {\em e\_int}. } */
#include "opcodefun.ih"
void fun_band ()
{
int rvalue = intValue(top());
pop();
intSetValue(top(), intValue(top()) & rvalue);
}
icmake-7.21.01/exec/opcodefun/gr.c 0000644 0001750 0001750 00000000750 12000542231 015550 0 ustar frank frank /*
\funcref{fun\_gr}{void fun\_gr ()}
{}
{}
{push(), compare(), pop()}
{}
{fungr.c}
{
Function {\em fun\_gr()} is called when opcode {\em op\_gr} is read.
This function pops two variables, calls {\em compare()} to compare the
values, and pushes the result of the comparison. The two compared
variables are discarded.
}
*/
#include "opcodefun.ih"
void fun_gr ()
{
fun_neq();
intSetValue(top(), intValue(top()) > 0);
}
icmake-7.21.01/exec/opcodefun/copyv.c 0000644 0001750 0001750 00000001266 12000542231 016303 0 ustar frank frank /*
\funcref{fun\_copy\_var}{void fun\_copy\_var ()}
{}
{}
{error()}
{}
{funcopyv.c}
{
This function is called when an {\em op\_copy\_var} opcode is
encountered in the makefile. Following this opcode, a variable index is
expected. The index may point to a global variable, to a function
parameter or to a local variable.
The function serves multiple assignments. The last pushed variable is
copied onto the indicated variable. For {\em e\_str} and {\em e\_list}
variables, this may involve the sharing of occupied memory.
}
*/
#include "opcodefun.ih"
void fun_copy_var ()
{
assign(getdest(), top());
}
icmake-7.21.01/exec/opcodefun/jmpf.c 0000644 0001750 0001750 00000001235 12000542231 016073 0 ustar frank frank /*
\funcref{fun\_jmp\_false}{void fun\_jmp\_false ()}
{}
{}
{getint16(), istrue()}
{fun\_jmp\_true(), fun\_jmp()}
{funjmpf.c}
{
This function is executed when an {\em op\_jmp\_false} opcode is read
in the binary makefile. Following the opcode, an {\em INT16} offset is
expected. The result of a previous expression is popped and if this
yields zero, a jump is made relative to the current offset by
repositioning the file pointer.
}
*/
#include "opcodefun.ih"
void fun_jmp_false()
{
register INT16 offs = getint16(infile);
if (!istrue())
fseek (infile, (INT32) offs, SEEK_CUR);
}
icmake-7.21.01/exec/opcodefun/jmpt.c 0000644 0001750 0001750 00000001236 12000542231 016112 0 ustar frank frank /*
\funcref{fun\_jmp\_true}{void fun\_jmp\_true ()}
{}
{}
{getint16(), istrue()}
{fun\_jmp\_false(), fun\_jmp()}
{funjmpt.c}
{
This function is executed when an {\em op\_jmp\_true} opcode is read in
the binary makefile. Following the opcode, an {\em INT16} offset is
expected. The result of a previous expression is popped and if this
yields non-zero, a jump is made relative to the current offset by
repositioning the file pointer.
}
*/
#include "opcodefun.ih"
void fun_jmp_true ()
{
register INT16 offs = getint16 (infile);
if (istrue())
fseek(infile, (INT32) offs, SEEK_CUR);
}
icmake-7.21.01/exec/opcodefun/sm.c 0000644 0001750 0001750 00000000750 12000542231 015557 0 ustar frank frank /*
\funcref{fun\_sm}{void fun\_sm ()}
{}
{}
{push(), compare(), pop()}
{}
{funsm.c}
{
Function {\em fun\_sm()} is called when opcode {\em op\_sm} is read.
This function pops two variables, calls {\em compare()} to compare the
values, and pushes the result of the comparison. The two compared
variables are discarded.
}
*/
#include "opcodefun.ih"
void fun_sm ()
{
fun_neq();
intSetValue(top(), intValue(top()) < 0);
}
icmake-7.21.01/exec/opcodefun/xor.c 0000644 0001750 0001750 00000000705 12000542231 015750 0 ustar frank frank /*
\funcref{fun\_xor}{void fun\_xor ()}
{}
{}
{pop(), push()}
{}
{funxor.c}
{
This function pops two variables and pushes the bitwise xor-ed result
of the {\em vu.intval} fields of these variables. The resulting
pushed variable is of type {\em e\_int}. } */
#include "opcodefun.ih"
void fun_xor ()
{
int rvalue = intValue(top());
pop();
intSetValue(top(), intValue(top()) ^ rvalue);
}
icmake-7.21.01/exec/opcodefun/pushv.c 0000644 0001750 0001750 00000001330 12000542231 016300 0 ustar frank frank /*
\funcref{fun\_push\_var}{void fun\_push\_var ()}
{}
{}
{push(), getint16(), getdest(), initvar()}
{}
{funpushv.c}
{
This function is executed when an {\em op\_push\_var} opcode is read in
the binary makefile. Follwing the opcode a variable index is expected.
This variable is pushed onto the stack.
}
*/
#include "opcodefun.ih"
void fun_push_var()
{
push(getdest()); /* A global var's address is returned, push() will */
/* increment its count. Since it's a var, */
/* getDest()'s return variable shouldn't be */
/* destroyed */
}
icmake-7.21.01/exec/opcodefun/pushi.c 0000644 0001750 0001750 00000001073 12000542231 016267 0 ustar frank frank /*
\funcref{fun\_push\_imm}{void fun\_push\_imm ()}
{}
{}
{push(), getint16()}
{}
{funpushi.c}
{
This function is called when an immediate value is to be pushed. The
value (type {\em INT16}) is expected to follow the opcode.
A variable of type {\em e\_int}, with its {\em vu.intval} field set
to the value retrieved from the binary makefile, is pushed.
}
*/
#include "opcodefun.ih"
void fun_push_imm ()
{
INTVAR_ tmp = *intConstructor_i(getint16(infile));
push(&tmp);
intDestructor(&tmp);
}
icmake-7.21.01/exec/opcodefun/sub.c 0000644 0001750 0001750 00000001527 12000542231 015734 0 ustar frank frank /*
\funcref{fun\_sub}{void fun\_sub ()}
{}
{}
{pop(), copylist(), delfromlist(), discard()}
{}
{funsub.c}
{
Function {\em fun\_sub()} processes opcode {\em op\_sub}. Two variables
are popped and subtracted. Depending on their type, two integer values
are subtracted or a difference between two lists is computed.
The result of the subtraction is stored in a temporary variable, which
is then pushed.
The two popped variables are discarded after use.
}
*/
#include "opcodefun.ih"
void fun_sub ()
{
VAR_ rval = *copyCons(top()); /* make a copy */
pop(); /* remove the r-operand */
subtract(top(), &rval); /* subtract the rval to the top */
destructor(&rval); /* remove the local var */
}
icmake-7.21.01/exec/opcodefun/inc.c 0000644 0001750 0001750 00000000661 12000542231 015712 0 ustar frank frank /*
\funcref{fun\_inc}{void fun\_inc ()}
{}
{}
{}
{fun\_dec()}
{funinc.c}
{
This function decrements the {\em vu.intval} field of a variable. The
The number of the variable (a 16-bits unsigned number) is assumed to
follow the {\em op\_dec} opcode.
}
*/
#include "opcodefun.ih"
void fun_inc ()
{
register VAR_ *dest = getdest();
intSetValue(dest, intValue(dest) + 1);
}
icmake-7.21.01/exec/opcodefun/mul.c 0000644 0001750 0001750 00000001100 12000542231 015723 0 ustar frank frank /*
\funcref{fun\_mul}{void fun\_mul ()}
{}
{}
{pop(), push()}
{}
{funmul.c}
{
This function pops two variables and pushes the product of the {\em
vu.intval} fields of these variables. The resulting pushed variable is
of type {\em e\_int}.
}
*/
#include "opcodefun.ih"
void fun_mul()
{
int value = intValue(top());
pop(); /* remove rhs */
value *= intValue(top()); /* multiply with lhs */
intSetValue(top(), value); /* update the top()'s value */
}
icmake-7.21.01/exec/opcodefun/pushr.c 0000644 0001750 0001750 00000001532 12000542231 016300 0 ustar frank frank /*
\funcref{fun\_push\_reg}{void fun\_push\_reg ()}
{}
{}
{push()}
{}
{funpushr.c}
{
This function is called when the return register is to be pushed. The
return register is used to return information from built-in functions.
{\bf Note that} the {\em count} field of the return register is {\bf
not} incremented when the register is pushed. The associated memory is
assigned by internal functions and may be freed by subsequent {\em
pop}-instructions.
Therefore, also the builtin functions do not have to free the reg's
memory when assigning a value to reg.
}
*/
#include "opcodefun.ih"
void fun_push_reg()
{
push(®); /* do not de-allocate, since it merely */
/* transfers its memory to its dest. */
}
icmake-7.21.01/exec/opcodefun/mod.c 0000644 0001750 0001750 00000001402 12000542231 015712 0 ustar frank frank /*
\funcref{fun\_mod}{void fun\_mod ()}
{}
{}
{pop(), push(), error()}
{}
{funmod.c}
{
This function pops two variables and pushes the modulo value of the
{\em vu.intval} fields of these variables. The resulting pushed
variable is of type {\em e\_int}.
It is assumed that the left argument of the modision was pushed first;
therefore, the right argument is popped first. A division by zero leads
to an error.
}
*/
#include "opcodefun.ih"
void fun_mod ()
{
int value = intValue(top());
if (!value)
error ("division by zero at %s", hexstring(curoffs, 4));
pop();
value = intValue(top()) % value;
intSetValue(top(), value); /* update the top()'s value */
}
icmake-7.21.01/exec/opcodefun/pushs.c 0000644 0001750 0001750 00000002107 12000542231 016300 0 ustar frank frank /*
\funcref{fun\_push\_strconst} {void fun\_push\_strconst ()}
{}
{}
{getint16(), getstring(), error(), push()}
{}
{funpushs.c}
{
This function is called when a string constant is to be pushed onto the
stack. The offset of the string to be pushed, relative to the strings
section of the binary makefile, is expected to follow the opcode. This
relative offset is an {\em UNS16} variable.
A variable of type {\em e\_str} and with field {\em vu.str} set to
a duplicate of the string constant is pushed.
}
*/
#include "opcodefun.ih"
void fun_push_strconst()
{
register char *str = getstring(infile, headerp->offset[0],
(size_t)getint16(infile));
if (str == (char *)-1)
error ("cannot get string, opcode at %s", hexstring (curoffs, 4));
{
/* str is allocated by getstring() */
STRINGVAR_ tmp = *stringConstructor_cP(str);
push(&tmp);
stringDestructor(&tmp);
free(str);
}
}
icmake-7.21.01/exec/opcodefun/jmp.c 0000644 0001750 0001750 00000001033 12000542231 015721 0 ustar frank frank /*
\funcref{fun\_jmp}{void fun\_jmp ()}
{}
{}
{getint16()}
{fun\_jmp\_true(), fun\_jmp\_false()}
{funjmp.c}
{
This function is executed when an {\em op\_jmp} opcode is read in the
binary makefile. Following the opcode, an {\em INT16} offset is
expected. An unconditional jump is made relative to the current offset
by repositioning the file pointer.
}
*/
#include "opcodefun.ih"
void fun_jmp ()
{
INT16 offs = getint16(infile);
fseek(infile, (INT32) offs, SEEK_CUR);
}
icmake-7.21.01/exec/opcodefun/neq.c 0000644 0001750 0001750 00000001022 12000542231 015714 0 ustar frank frank /*
\funcref{fun\_neq}{void fun\_neq ()}
{}
{}
{push(), compare(), pop()}
{}
{funneq.c}
{
Function {\em fun\_neq()} is called when opcode {\em op\_neq} is read.
This function pops two variables, calls {\em compare()} to compare the
values, and pushes the result of the comparison. The two compared
variables are discarded.
}
*/
#include "opcodefun.ih"
void fun_neq ()
{
VAR_ rval = *copyCons(top());
pop();
compare(top(), &rval);
destructor(&rval);
}
icmake-7.21.01/exec/CLASSES 0000644 0001750 0001750 00000001102 12000542231 014022 0 ustar frank frank # This file contains the names of all subdirectories containing sources to
# compile. Each directory should be specified on a line of its own. Initial
# blanks are ok. Compilation is 1-level deep.
# If a parser or scanner is used, (see icmconfig's USE_PARSER and USE_SCANNER
# defines) then those directories are automatically included (although they
# could be included here as well)
# Lines starting with # or with // are ignored, as are empty lines.
# sources in the current (i.e., this) directory are also compiled.
var
virtual
int
list
string
stack
opcodefun
builtin
icmake-7.21.01/exec/string/ 0000755 0001750 0001750 00000000000 12267172022 014332 5 ustar frank frank icmake-7.21.01/exec/string/constructorcp.c 0000644 0001750 0001750 00000000261 12000542231 017371 0 ustar frank frank #include "string.ih"
STRINGVAR_ *stringConstructor_cP(char const *str)
{
static STRINGVAR_ ret = {e_str, {0}};
ret.vu.i = newstring(xstrdup(str));
return &ret;
}
icmake-7.21.01/exec/string/newstring.c 0000644 0001750 0001750 00000000233 12000542231 016500 0 ustar frank frank #include "string.ih"
INTER_ *newstring(char *cp)
{
INTER_ *ret = malloc(sizeof(INTER_));
ret->count = 1;
ret->ls.str = cp;
return ret;
}
icmake-7.21.01/exec/string/string.h 0000644 0001750 0001750 00000001063 12000542231 015775 0 ustar frank frank #ifndef _INCLUDED_STRING_H_
#define _INCLUDED_STRING_H_
#include "../../rss/icrss.h"
typedef VAR_ STRINGVAR_;
STRINGVAR_ *stringConstructor(void);
STRINGVAR_ *stringConstructor_cP(char const *str);
void stringDestructor(STRINGVAR_ *var);
STRINGVAR_ *stringCopyCons(STRINGVAR_ const *var);
void stringAssign(STRINGVAR_ *lhs, STRINGVAR_ const *rhs);
void stringAdd(STRINGVAR_ *lhs, STRINGVAR_ const *rhs);
int stringLogical(STRINGVAR_ const *lhs);
char *stringStr(STRINGVAR_ const *lhs); /* const removed */
#endif
icmake-7.21.01/exec/string/logical.c 0000644 0001750 0001750 00000000131 12000542231 016067 0 ustar frank frank #include "string.ih"
int stringLogical(STRINGVAR_ const *lhs)
{
return *str(lhs);
}
icmake-7.21.01/exec/string/assign.c 0000644 0001750 0001750 00000000275 12000542231 015752 0 ustar frank frank #include "string.ih"
void stringAssign(STRINGVAR_ *lhs, STRINGVAR_ const *rhs)
{
if (lhs != rhs)
{
destructor(lhs);
*lhs = *rhs;
varIncCount(lhs);
}
}
icmake-7.21.01/exec/string/string.ih 0000644 0001750 0001750 00000000375 12000542231 016153 0 ustar frank frank #include "string.h"
#include
#include
#include "../var/var.h"
#include "../virtual/virtual.h"
#include "../int/int.h"
INTER_ *newstring(char *cp); /* cp must be free-able */
#define str(pstring) ((pstring)->vu.i->ls.str)
icmake-7.21.01/exec/string/destructor.c 0000644 0001750 0001750 00000000175 12000542231 016663 0 ustar frank frank #include "string.ih"
void stringDestructor(VAR_ *var)
{
if (varDecCount(var) == 0)
free (var->vu.i->ls.str);
}
icmake-7.21.01/exec/string/compare.c 0000644 0001750 0001750 00000001035 12000542231 016107 0 ustar frank frank #include "string.ih"
void stringCompare(STRINGVAR_ *lhs, STRINGVAR_ const *rhs)
{
int ret = strcmp(stringStr(lhs), stringStr(rhs));
destructor(lhs);
/* Can't use the return value as-is, since */
/* the non-16 bit return value may have its */
/* lower 16 bits set to zero (as happened */
/* on the powerpc */
*lhs = *intConstructor_i(ret < 0 ? -1 : ret > 0 ? 1 : 0);
}
icmake-7.21.01/exec/string/add.c 0000644 0001750 0001750 00000000352 12000542231 015212 0 ustar frank frank #include "string.ih"
void stringAdd(STRINGVAR_ *lhs, STRINGVAR_ const *rhs)
{
char *catstr = xstrcat(xstrdup(stringStr(lhs)), stringStr(rhs));
destructor(lhs);
*lhs = *stringConstructor_cP(catstr);
free(catstr);
}
icmake-7.21.01/exec/string/str.c 0000644 0001750 0001750 00000000127 12000542231 015272 0 ustar frank frank #include "string.ih"
char *stringStr(STRINGVAR_ const *lhs)
{
return str(lhs);
}
icmake-7.21.01/exec/string/copycons.c 0000644 0001750 0001750 00000000271 12000542231 016317 0 ustar frank frank #include "string.ih"
STRINGVAR_ *stringCopyCons(STRINGVAR_ const *str)
{
static STRINGVAR_ ret;
ret = *str;
varIncCount(&ret);
ret.type = e_str;
return &ret;
}
icmake-7.21.01/exec/string/constructor.c 0000644 0001750 0001750 00000000237 12000542231 017051 0 ustar frank frank #include "string.ih"
STRINGVAR_ *stringConstructor()
{
static STRINGVAR_ ret = {e_str, {0}};
ret.vu.i = newstring(xstrdup(""));
return &ret;
}
icmake-7.21.01/exec/builtin/ 0000755 0001750 0001750 00000000000 12267172022 014472 5 ustar frank frank icmake-7.21.01/exec/builtin/builtin.c 0000644 0001750 0001750 00000000120 12000542231 016261 0 ustar frank frank #include "builtin.ih"
void builtin(size_t funnr)
{
builtinfun[funnr]();
}
icmake-7.21.01/exec/builtin/arghe.c 0000644 0001750 0001750 00000000766 12000542231 015721 0 ustar frank frank /*
\funcref{fun\_arg\_head}{void fun\_arg\_head ()}
{}
{}
{setstring()}
{fun\_arg\_tail(), fun\_cmd\_tail()}
{funarghe.c}
{
This function is called when an {\em op\_arg\_head} opcode is read in
the binary makefile. The {\em arghead} variable is set to a duplicate
of the string in the last pushed variable. The last pushed variable is
then discarded.
}
*/
#include "builtin.ih"
void fun_arg_head ()
{
arghead = setstring (arghead);
}
icmake-7.21.01/exec/builtin/puten.c 0000644 0001750 0001750 00000001374 12000542231 015762 0 ustar frank frank /*
\funcref{fun\_putenv}{void fun\_chdir ()}
{}
{}
{}
{}
{funchdir.c}
{
This function expects a string to enter in the environment on top of
the stack.
Return register {\em reg} is set to type {\em e\_int}. The value of the
return register is set to 0 if the setting was added to the
environment.
}
*/
#include "builtin.ih"
#ifdef M_UNIX /* sco unix 3.2.4.0 conflicting header files ... */
extern int putenv(const char *);
#endif
void fun_putenv ()
{
reg = *intConstructor_i
(
putenv
(
xstrdup
(
stringStr(top())
)
)
);
}
icmake-7.21.01/exec/builtin/strfind.c 0000644 0001750 0001750 00000000747 12000542231 016303 0 ustar frank frank /*
\funcref{fun\_strfind}{void fun\_strfind ()}
{}
{}
{strfind()}
{}
{funstrfind.c}
{
Function {\em fun\_strfind()} returns the first index in a string
haystack where a substring needle was found. If not found, -1 is returned.
}
*/
#include "builtin.ih"
void fun_strfind()
{
char const *haystack = stringStr(top());
char const *ret = strstr(haystack, stringStr(top() - 1));
reg = *intConstructor_i(ret ? ret - haystack : -1);
}
icmake-7.21.01/exec/builtin/addcmd.c 0000644 0001750 0001750 00000002117 12000542231 016037 0 ustar frank frank /*
\funcref{addcmd}{char $**$addcmd (\params)}
{
{char} {**cmd} {{\em argv}-like array of strings}
{char} {*string} {string to add to {\em cmd}}
}
{resized {\em cmd} to which reference to {\em string} is added}
{xrealloc()}
{}
{addcmd.c}
{
Function {\em addcmd()} expects a pointer to an array of {\em char $*$}'s as
first argument. This pointer may be {\em NULL}. The {\em argv}-like
array is expanded to hold a reference to {\em string}.
The reallocated array {\em cmd} is returned. The last field in the
array is {\em NULL} to indicate the ending of the list.
{\bf Note that} a reference to {\em string} itself is not added to the
list: a duplicate is made.
}
*/
#include "builtin.ih"
char **addcmd (cmd, string)
char **cmd, *string;
{
register int
i,
size = 0;
if (cmd)
for (i = 0; cmd [i]; i++)
size++;
cmd = xrealloc (cmd, (size + 2) * sizeof (char *));
cmd [size] = xstrdup (string);
cmd [size + 1] = NULL;
return (cmd);
}
icmake-7.21.01/exec/builtin/cpath.c 0000644 0001750 0001750 00000001074 12000542231 015723 0 ustar frank frank /*
\funcref{fun\_c\_path}{void fun\_c\_path ()}
{}
{}
{change\_path(), newvar()}
{fun\_c\_base(), fun\_c\_ext()}
{funcpath.c}
{
The last pushed string is taken as a file name. The pathname is
converted to the one but last pushed string. A new {\em e\_str}
variable is created holding the new string and is returned via {\em
reg}.
}
*/
#include "builtin.ih"
void fun_c_path ()
{
reg = *stringConstructor_cP(
change_path(stringStr(top()), stringStr(top() - 1))
);
}
icmake-7.21.01/exec/builtin/strlwr.c 0000644 0001750 0001750 00000000353 12000542231 016160 0 ustar frank frank /*
Function {\em fun\_strlwr()} returns lower-case transformed string
}
*/
#include "builtin.ih"
void fun_strlwr()
{
char *cp = _strlwr(xstrdup(stringStr(top())));
reg = *stringConstructor_cP(cp);
free(cp);
}
icmake-7.21.01/exec/builtin/getenv.c 0000644 0001750 0001750 00000000470 12000542231 016113 0 ustar frank frank /*
*/
#include "builtin.ih"
void fun_getenv()
{
char *env = getenv(stringStr(top()));
reg = *listConstructor();
if (!env)
{
listAdd_cP(®, "0");
listAdd_cP(®, "");
}
else
{
listAdd_cP(®, "1");
listAdd_cP(®, env);
}
}
icmake-7.21.01/exec/builtin/chdir.c 0000644 0001750 0001750 00000003614 12000542231 015717 0 ustar frank frank /*
\funcref{fun\_chdir}{void fun\_chdir ()}
{}
{}
{}
{}
{funchdir.c}
{
This function expects a string to {\em chdir} to as second-but-last
argument on the stack. The last argument is the mode, {\em
P\_CHECK} or {\em P\_NOCHECK}. If the directory name is a non-null
string, 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.
Modifier {\em P\_CHECK} causes this function to abort upon failure.
Return register {\em reg} is set to type {\em e\_str}. The value of
the return register is set to the obtained working directory. This
may not be the requested directory if the {\em chdir} fails.
}
*/
#include "builtin.ih"
static char dirsep[2] = {DIRSEP};
void fun_chdir ()
{
register char *dir = xstrdup(stringStr(top() - 1)); /* duplicate dest */
register char *last;
register int mode = intValue(top()); /* mode of operation */
char newdir [_MAX_PATH];
if (! *dir) /* empty dest: */
dir = xstrdup(orgdir); /* change to org dir */
last = dir + strlen (dir) - 1; /* remove dir */
if
(
last != dir && /* separator */
(*last == '\\' || *last == '/') &&
*(last - 1) != ':'
)
*last = 0;
if (chdir(dir) && P_CHECKMODE(mode)) /* go to dir */
error ("chdir - can't change dir to %s", dir); /* or quit if */
/* P_CHECK is on */
free(dir);
getcwd (newdir, _MAX_PATH); /* return value: */
if (newdir[strlen(newdir) - 1] != DIRSEP) /* cwd */
strcat (newdir, dirsep);
reg = *stringConstructor_cP(newdir);
}
icmake-7.21.01/exec/builtin/getline.c 0000644 0001750 0001750 00000002144 12000542231 016252 0 ustar frank frank #include "builtin.ih"
#define bufsize (200)
#define buflast (bufsize - 1)
#define lastch (bufsize - 2)
char *getLine(FILE *file)
{
char *dest = xstrdup("");
char buffer[bufsize];
while (1)
{
buffer[lastch] = 0; /* overwritten by \n or the */
/* last char read of a line */
/* otherwise, the end of the*/
/* line is earlier */
if (!fgets(buffer, buflast, file)) /* reading fails */
break;
dest = xstrcat(dest, buffer); /* append the buffer */
/* EOLN encountered */
if (buffer[lastch] == '\n' || !buffer[lastch])
break; /* end of line at then end */
/* or earlier */
}
if (*dest) /* line read */
return dest;
free(dest);
return NULL;
}
icmake-7.21.01/exec/builtin/gext.c 0000644 0001750 0001750 00000000543 12000542231 015573 0 ustar frank frank /*
\funcref{fun\_g\_ext}{void fun\_g\_ext ()}
{}
{}
{newvar(), get\_ext ()}
{fun\_g\_path(), fun\_g\_base()}
{fungext.c}
{
The last pushed string is taken as a file name. The extension is
returned.
}
*/
#include "builtin.ih"
void fun_g_ext ()
{
reg = *stringConstructor_cP(get_ext(stringStr(top())));
}
icmake-7.21.01/exec/builtin/builtin.h 0000644 0001750 0001750 00000000450 12000542231 016274 0 ustar frank frank #ifndef _INCLUDED_BUILTIN_H_
#define _INCLUDED_BUILTIN_H_
#include "../../rss/icrssdef.h"
#include "../var/var.h"
extern char *arghead;
extern char *argtail;
extern char *cmdhead;
extern char *cmdtail;
extern VAR_ reg;
void builtin(size_t funnr);
#endif
icmake-7.21.01/exec/builtin/getcmdle.c 0000644 0001750 0001750 00000001115 12000542231 016404 0 ustar frank frank /*
\funcref{getcmdlen}{int getcmdlen (\params)}
{
{char} {**cmd} {{\em argv}-like array}
}
{length of command line corresponding to {\em cmd}}
{}
{addcmd()}
{getcmdle.c}
{
The length of the command, as represented by {\em cmd}, is returned.
See {\em addcmd()} for a description of the {\em cmd} array.
}
*/
#include "builtin.ih"
int getcmdlen (cmd)
char **cmd;
{
register int
i,
len;
len = 0;
for (i = 0; cmd [i]; i++)
{
len += strlen (cmd [i]);
len++;
}
return (len);
}
icmake-7.21.01/exec/builtin/ascst.c 0000644 0001750 0001750 00000000710 12000542231 015735 0 ustar frank frank /*
\fucref{fun\_ascii\_int}{void fun\_ascii\_int ()}
{}
{}
{}
{}
{funascst.c}
{
This function is called when a call to the built-in function {\em
ascii} is to be processed. The function represents the opcode {\em
op\_ascii\_int}. The last pushed {\em e\_int} is converted to a
string.
}
*/
#include "builtin.ih"
void fun_ascii_int ()
{
reg = *intConstructor_i(*stringStr(top()));
}
icmake-7.21.01/exec/builtin/gpath.c 0000644 0001750 0001750 00000000543 12000542231 015727 0 ustar frank frank /*
\funcref{fun\_g\_path}{void fun\_g\_path ()}
{}
{}
{newvar(), get\_path ()}
{fun\_g\_ext(), fun\_g\_base()}
{fungpath.c}
{
The last pushed string is taken as a file name. The path is
returned.
}
*/
#include "builtin.ih"
void fun_g_path ()
{
reg = *stringConstructor_cP(get_path(stringStr(top())));
}
icmake-7.21.01/exec/builtin/setstrin.c 0000644 0001750 0001750 00000001171 12000542231 016475 0 ustar frank frank /*
\funcref{setstring}{char $*$setstring (\params)}
{
{char} {*s} {string to set}
}
{duplicate of last pushed string}
{xrealloc(), xstrdup()}
{}
{setstrin.c}
{
This function is called from {\em fun\_arg\_head()}, {\em
fun\_cmd\_head()}, etc., to set the appropriate strings to a duplicate
of the last pushed string.
The argument {\em s} is freed if necessary. It should be the same
pointer variable which is assigned the return value.
}
*/
#include "builtin.ih"
char *setstring (char *s)
{
free(s);
return s = xstrdup(stringStr(top()));
}
icmake-7.21.01/exec/builtin/cext.c 0000644 0001750 0001750 00000001074 12000542231 015567 0 ustar frank frank /*
\funcref{fun\_c\_ext}{void fun\_c\_ext ()}
{}
{}
{change\_ext(), newvar()}
{fun\_c\_path(), fun\_c\_name()}
{funcext.c}
{
The last pushed string is taken as a file name. The extension is
converted to the one but last pushed string. A new {\em e\_str}
variable is created holding the new string and is returned via {\em
reg}.
}
*/
#include "builtin.ih"
void fun_c_ext ()
{
reg = *stringConstructor_cP(
change_ext(stringStr(top()), stringStr(top() - 1))
);
}
icmake-7.21.01/exec/builtin/argta.c 0000644 0001750 0001750 00000000764 12000542231 015727 0 ustar frank frank /*
\funcref{fun\_arg\_tail}{void fun\_arg\_tail ()}
{}
{}
{setstring()}
{fun\_arg\_tail(), fun\_cmd\_tail()}
{funargte.c}
{
This function is called when an {\em op\_arg\_tail} opcode is read in
the binary makefile. The {\em argtail} variable is set to a duplicate
of the string in the last pushed variable. The last pushed variable is
then discarded.
}
*/
#include "builtin.ih"
void fun_arg_tail()
{
argtail = setstring(argtail);
}
icmake-7.21.01/exec/builtin/getpi.c 0000644 0001750 0001750 00000000676 12000542231 015743 0 ustar frank frank /*
\funcref{fun\_getpid}{void fun\_getpid ()}
{}
{}
{newvar()}
{}
{fungetpi.c}
{
The process ID number is returned as an {\em e\_int} variable.
Under MS-DOS, this number is set to the paragraph of the PSP. Under
UNIX, the true process ID number is returned.
}
*/
#include "builtin.ih"
void fun_getpid ()
{
reg.type = e_int;
reg.vu.intval = (INT16)
#ifndef MSDOS
getpid ();
#else
_psp;
#endif
}
icmake-7.21.01/exec/builtin/print.c 0000644 0001750 0001750 00000001242 12000542231 015755 0 ustar frank frank /*
\funcref{fun\_print}{void fun\_print ()}
{}
{}
{print(), xrealloc()}
{fun\_exec()}
{funprint.c}
{
This function prints the arguments to a {\em printf()} statement,
pushed onto the stack previously. The number of arguments to printf is
the last pushed value.
}
*/
#include "builtin.ih"
void fun_printf ()
{
size_t i;
int newelement;
size_t nargs = intValue(top());
for (i = 1; i <= nargs; i += newelement)
{
char *string = getarg(i, &newelement);
printf("%s%s", string,
typeValue(top() - i) & e_list && *string ? " " : "");
free(string);
}
}
icmake-7.21.01/exec/builtin/cmdhe.c 0000644 0001750 0001750 00000001006 12000542231 015677 0 ustar frank frank /*
\funcref{fun\_cmd\_head}{void fun\_cmd\_head ()}
{}
{}
{setstring()}
{fun\_arg\_tail(), fun\_arg\_head(), fun\_cmd\_tail()}
{funcmdte.c}
{
This function is called when an {\em op\_cmd\_head} opcode is read in
the binary makefile. The {\em cmdhead} variable is set to a duplicate
of the string in the last pushed variable. The last pushed variable is
then discarded.
}
*/
#include "builtin.ih"
void fun_cmd_head()
{
cmdhead = setstring(cmdhead);
}
icmake-7.21.01/exec/builtin/strel.c 0000644 0001750 0001750 00000001455 12000542231 015760 0 ustar frank frank /*
\fucref{fun\_str\_el}{void fun\_str\_el ()}
{}
{}
{}
{}
{funstrel.c}
{
This function is called when an {\em op\_str\_el} opcode is enountered.
The last pushed value is interpreted as a string, the one but last
pushed value as an index.
The return register {\em reg} is set to an {\em e\_str} variable:
the character from the string at index {\em index}, terminated by
$\backslash$0. If index is smaller than 0 or larger than the size of
the string, {\em reg} holds a null-character.
}
*/
#include "builtin.ih"
static char buf[2];
void fun_str_el ()
{
size_t idx = intValue(top());
char const *str = stringStr(top() - 1);
buf[0] = idx >= strlen(str) ? 0 : str[idx];
reg = *stringConstructor_cP(buf);;
}
icmake-7.21.01/exec/builtin/data.c 0000644 0001750 0001750 00000002471 12000542231 015537 0 ustar frank frank #include "builtin.ih"
VAR_ reg;
int echo = 1;
char *arghead;
char *argtail;
char *cmdhead;
char *cmdtail;
void (*builtinfun[])(void) =
{
fun_arg_head,
fun_arg_tail,
fun_ascii_int,
fun_ascii_str,
fun_c_base,
fun_chdir,
fun_c_ext,
fun_cmd_head,
fun_cmd_tail,
fun_c_path,
fun_echo,
fun_element,
fun_exec,
fun_exec, /* dummy for compiler-used */
fun_exists, /* fun_execute */
fun_fields,
fun_fgets,
fun_fprintf,
fun_g_base, fun_getch,
fun_gets,
fun_g_ext,
fun_g_path,
fun_makelist,
fun_printf,
fun_putenv,
fun_sizeoflist,
fun_stat,
fun_str_el,
fun_strlwr,
fun_strupr,
fun_system,
fun_strlen,
fun_strfind,
fun_getpid,
fun_substr,
fun_getenv,
fun_backtick,
fun_empty,
fun_empty,
fun_empty,
fun_empty,
/* fun_hlt is non-existent.. */
/* f_hlt used to mark unexisting functions */
};
icmake-7.21.01/exec/builtin/strlen.c 0000644 0001750 0001750 00000000441 12000542231 016130 0 ustar frank frank /*
\funcref{fun\_strlen}{void fun\_strlen ()}
{}
{}
{strlen()}
{}
{funstrlen.c}
{
Function {\em fun\_strlen()} returns the length of a string
}
*/
#include "builtin.ih"
void fun_strlen()
{
reg = *intConstructor_i((int)strlen(stringStr(top())));
}
icmake-7.21.01/exec/builtin/cbase.c 0000644 0001750 0001750 00000001073 12000542231 015700 0 ustar frank frank /*
\funcref{fun\_c\_base}{void fun\_c\_base ()}
{}
{}
{newvar(), change\_base()}
{fun\_c\_path(), fun\_c\_ext()}
{funcbase.c}
{
The last pushed string is taken as a file name. The basename is
converted to the one but last pushed string. A new {\em e\_str}
variable is created holding the new string and is returned via {\em
reg}.
}
*/
#include "builtin.ih"
void fun_c_base()
{
reg = *stringConstructor_cP(
change_base(stringStr(top()), stringStr(top() - 1))
);
}
icmake-7.21.01/exec/builtin/getexeca.c 0000644 0001750 0001750 00000002150 12000542231 016405 0 ustar frank frank /*
\funcref{getexecarg}{char $*$getexecarg (\params)}
{
{int} {n} {{\em n}-th argument to retrieve}
{int} {*increment} {address of counter increment}
}
{argument in string format}
{xstrdup(), getarg(), xrealloc()}
{}
{getexeca.c}
{
This function performs a similar function as {\em getarg()} but
prefixes the retrieved argument with the string {\em arghead} and
postfixes the argument with the string {\em argtail}. {\bf Note that}
the return value always points to allocated memory which should be
freed when no longer required.
See further {\em getarg()}.
}
*/
#include "builtin.ih"
char *getexecarg (size_t n, int *flag)
{
register char
*arg,
*start,
*ret;
arg = getarg (n, flag);
if (strlen (arghead))
{
start = xstrdup(arghead);
start = xstrcat(start, arg);
free(arg);
}
else
start = arg;
if (strlen (argtail))
{
ret = xstrcat (start, argtail);
free(start);
}
else
ret = start;
return (ret);
}
icmake-7.21.01/exec/builtin/enterch.c 0000644 0001750 0001750 00000000410 12000542231 016245 0 ustar frank frank #include "builtin.ih"
/*
enter the first of a series of characters, terminated by \n. The first
char may be a \n
*/
int enterch()
{
int ch = getchar();
if (ch != '\n')
{
while (getchar() != '\n')
;
}
return ch;
}
icmake-7.21.01/exec/builtin/empty.c 0000644 0001750 0001750 00000000031 12000542231 015752 0 ustar frank frank void fun_empty (void)
{}
icmake-7.21.01/exec/builtin/getch.c 0000644 0001750 0001750 00000000702 12000542231 015713 0 ustar frank frank /*
\funcref{fun\_getch}{void fun\_getch ()}
{}
{}
{}
{fun\_gets()}
{fungetch.c}
{
This function reads in one key and returns it in the {\em reg} return
register as an {\em e\_str} value.
}
*/
#include "builtin.ih"
#include "../string/string.h"
static char buf[2];
void fun_getch()
{
#ifdef unix
buf[0] = termch();
#else
buf[0] = enterch();
#endif
reg = *stringConstructor_cP(buf);
}
icmake-7.21.01/exec/builtin/getarg.c 0000644 0001750 0001750 00000004306 12000542231 016076 0 ustar frank frank /*
\fucref{getarg}{char $*$getarg (\params)}
{
{int} {n} {{\em n}-th argument to retrieve}
{int} {*increment} {address of counter increment}
}
{argument in string format}
{xstrdup()}
{}
{getarg.c}
{
Function {\em getarg()} can be called to retrieve arguments from the
stack (e.g., the arguments of a {\em print()} statement) in string
format. Parameter {\em n} specifies the argument to retrieve: 0 is the
last pushed argument, 1 is the argument pushed before that, etc..
Parameter {\em increment} tells the caller whether to start retrieving
a next argument or not. In the case of a list argument, {\em getarg()}
sets this flag to 0 while the list is not yet completely processed.
When a list argument is processed or when the retrieved argument is not
a list, the flag value is set to 1.
The return value points to a string duplicate. The caller should free
this memory when it is no longer needed.
}
*/
#include "builtin.ih"
char *getarg (size_t n, int *flag)
{
char
convbuf [50];
static size_t
listindex;
register char
*ret;
VAR_ *base = top() - n;
*flag = 1; /* assume that done with args */
if (typeValue(base) & e_int) /* incase of an int.. */
{
listindex = 0;
sprintf (convbuf, "%d", intValue(base));
return (xstrdup (convbuf));
}
if (typeValue(base) & e_str) /* incase of a string.. */
{
listindex = 0;
return xstrdup(stringStr(base));
}
/* incase of a list: */
if (!listSize(base))
{
listindex = 0;
ret = xstrdup("");
}
else
{
ret = xstrdup(listAt(base, listindex));
listindex++;
if (listindex < listSize(base))
*flag = 0; /* if more elements, not done */
else /* with args.. */
listindex = 0; /* otherwise: returnflag = 1, */
} /* no next elements to get */
return (ret);
}
icmake-7.21.01/exec/builtin/fprin.c 0000644 0001750 0001750 00000001771 12000542231 015746 0 ustar frank frank /*
\funcref{fun\_fprintf}{void fun\_fprintf ()}
{}
{}
{fprintf(), xrealloc()}
{fun\_exec()}
{funfprin.c}
{
This function prints the arguments to a {\em fprint()} statement,
pushed onto the stack previously. The number of arguments to print is
the last pushed value.
The arguments are: the number of arguments (a hidden parameter), a
filename, and then the remaining arguments to print.
}
*/
#include "builtin.ih"
void fun_fprintf()
{
size_t i;
int newelement;
size_t nargs = (size_t)intValue(top());
char const *filename = stringStr(top() - 1);
FILE *outf;
if (! (outf = fopen (filename, "a")) )
error ("failure to open file \"%s\"", filename);
for (i = 2; i <= nargs; i += newelement)
{
char *string = getarg(i, &newelement);
fprintf(outf, "%s%s", string,
typeValue(top() - i) & e_list && *string ? " " : "");
free(string);
}
fclose (outf);
}
icmake-7.21.01/exec/builtin/makel.c 0000644 0001750 0001750 00000003667 12000542231 015727 0 ustar frank frank /*
\funcref{fun\_makelist}{void fun\_makelist ()}
{}
{}
{newvar(), sortlist()}
{}
{funmakel.c}
{
This function converts the last pushed string into a listvariable
holding expanded filenames. The {\em reg} register is set to hold the
list. The list is alphabetically sorted.
{\bf Note that} under MSDOS, the elements of the list are converted
to lower case.
The argument at the top of the stack may be, optionally, an
attribute mask. In this case, the mask is used in a
{\em findfirst() / findnext ()} loop. By default the
attribute {\em \_A\_NORMAL} is used.
}
*/
#include "builtin.ih"
void fun_makelist()
{
char const *name = stringStr(top() - 1); /* filemask string */
reg = *listConstructor();
if (*name) /* if valid name.. */
{
char
drive[_MAX_DRIVE], /* strings to create full */
dir[_MAX_DIR], /* filename, incl. path */
fname[_MAX_FNAME],
ext[_MAX_EXT],
newname[_MAX_PATH];
size_t attrib = intValue(top()); /* attribute to scan for */
/* find a first name */
char *namefound = findfirst (name, attrib);
_splitpath (name, drive, dir, fname, ext);
while (namefound) /* as long as that succeeds */
{
/* make a new path */
_makepath (newname, drive, dir, namefound, "");
/* add entry to the list */
#ifdef MSDOS /* under DOS: lower case */
listAdd_cP(®, _strlwr(newname));
#else /* under UNIX: case as-is */
listAdd_cP(®, newname);
#endif
namefound = findnext(); /* determine new name */
}
listSort(®);
}
}
icmake-7.21.01/exec/builtin/stat.c 0000644 0001750 0001750 00000004242 12000542231 015577 0 ustar frank frank /*
\funcref{fun\_stat}{void fun\_stat ()}
{}
{}
{}
{fun\_exec()}
{funsyste.c}
{
This function expects a filename as last pushed {\em e\_str}
value. The file attributes are retrieved by a {\em stat ()} call and
the return register is set to the type {\em e\_list}. This list
returns the following information:
\begin{itemize}
\item The first element represents the file attributes.
\item The second element represents the file size.
\end{itemize}
}
*/
#include "builtin.ih"
void fun_stat ()
{
struct stat statbuf; /* file stat buffer */
int fileatt = 0; /* file attributes */
int mode = intValue(top()); /* get mode arg */
char const *fname = stringStr(top() - 1); /* get file name */
reg = *listConstructor(); /* return result as list */
if (stat (fname, &statbuf)) /* do stat call */
{ /* failure to stat? */
if (P_CHECKMODE (mode)) /* if mode indicates abort..*/
error ("stat - unable to stat file %s", fname);
return; /* no checking: return */
} /* empty list */
if (statbuf.st_mode & S_IREAD) /* set file attribute int */
fileatt |= IS_IREAD;
if (statbuf.st_mode & S_IWRITE)
fileatt |= IS_IWRITE;
if (statbuf.st_mode & S_IEXEC)
fileatt |= IS_IEXEC;
if (statbuf.st_mode & S_IFDIR)
fileatt |= IS_IFDIR;
if (statbuf.st_mode & S_IFCHR)
fileatt |= IS_IFCHR;
if (statbuf.st_mode & S_IFREG)
fileatt |= IS_IFREG;
{
char buf [80]; /* conversion buf */
sprintf (buf, "%u", fileatt); /* file attr --> string */
listAdd_cP(®, buf); /* = element #0 */
sprintf(buf, "%ld", /* file size --> string */
(long)statbuf.st_size); /* = element #1 */
listAdd_cP(®, buf);
}
}
icmake-7.21.01/exec/builtin/gets.c 0000644 0001750 0001750 00000001131 12000542231 015560 0 ustar frank frank /*
\funcref{fun\_gets}{void fun\_gets ()}
{}
{}
{}
{fun\_getch()}
{fungets.c}
{
This function reads in a string and returns it in the {\em reg} return
register as an {\em e\_str} value.
}
*/
#include "builtin.ih"
void fun_gets ()
{
int last;
char *dest = getLine(stdin);
if (!dest)
{
reg = *listConstructor();
return;
}
last = strlen(dest) - 1; /* cut off final \n as per man-page */
if (dest[last] == '\n')
dest[last] = 0;
reg = *stringConstructor_cP(dest);
free(dest);
}
icmake-7.21.01/exec/builtin/echo.c 0000644 0001750 0001750 00000000557 12000542231 015547 0 ustar frank frank /*
\funcref{fun\_echo}{void fun\_echo ()}
{}
{}
{}
{}
{funecho.c}
{
This function is executed when an {\em op\_echo} opcode is encountered.
The global variable {\em echo} is set to the {\em vu.intval} value of
the last pushed variable.
}
*/
#include "builtin.ih"
void fun_echo()
{
echo = intValue(top());
}
icmake-7.21.01/exec/builtin/substr.c 0000644 0001750 0001750 00000000776 12000542231 016156 0 ustar frank frank /*
*/
#include "builtin.ih"
void fun_substr()
{
char const *str = stringStr(top());
size_t str_len = strlen(str);
int offset = intValue(top() - 1);
int count = intValue(top() - 2);
if (offset < 0)
offset = 0;
if ((size_t)offset >= str_len || count <= 0)
reg = *stringConstructor();
else
{
reg = *stringConstructor_cP(str + offset);
if (count < (int)(str_len - (size_t)offset))
((char *)stringStr(®))[count] = 0;
}
}
icmake-7.21.01/exec/builtin/gbase.c 0000644 0001750 0001750 00000000550 12000542231 015703 0 ustar frank frank /*
\funcref{fun\_g\_base}{void fun\_g\_base ()}
{}
{}
{newvar(), get\_base ()}
{fun\_g\_path(), fun\_g\_ext()}
{fungbase.c}
{
The last pushed string is taken as a file name. The base name is
returned.
}
*/
#include "builtin.ih"
void fun_g_base ()
{
reg = *stringConstructor_cP(get_base(stringStr(top())));
}
icmake-7.21.01/exec/builtin/field.c 0000644 0001750 0001750 00000002313 12000542231 015704 0 ustar frank frank /*
\funcref{fun\_fields}{void fun\_fields ()}
{}
{}
{}
{fun\makelist(), addtolist()}
{funfield.c}
{
This function is executed upon an opcode {\em op\_fields}. 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.
}
*/
#include "builtin.ih"
static char buf[2];
void fun_fields ()
{
char const *str = stringStr(top());
char const *sep = stringStr(top() - 1);
reg = *listConstructor();
if (*str)
{
char *string = xstrdup(str);
char *cp;
if (*sep)
{
if ((cp = strtok(string, sep)))
{
do
{
listAdd_cP(®, cp);
cp = strtok(NULL, sep);
}
while (cp);
}
}
else
{
cp = string;
while (*cp)
{
buf[0] = *cp++;
listAdd_cP(®, buf);
}
}
free(string);
}
}
icmake-7.21.01/exec/builtin/eleme.c 0000644 0001750 0001750 00000001445 12000542231 015715 0 ustar frank frank /*
\fucref{fun\_element}{void fun\_element ()}
{}
{}
{xstrdup(), newvar()}
{}
{funeleme.c}
{
This function is called when an {\em op\_element} opcode is enountered.
The last pushed value is interpreted as a list, the one but last pushed
value as an index.
The return register {\em reg} is set to a string variable, holding a
duplicate of the listelement {\em index}. If index is larger than the
size of the element, {\em reg} holds a null-string.
}
*/
#include "builtin.ih"
void fun_element ()
{
size_t idx = intValue(top());
reg = *stringConstructor_cP
(
idx < listSize(top() - 1) ?
listAt(top() - 1, idx)
:
""
);
}
icmake-7.21.01/exec/builtin/execmd.c 0000644 0001750 0001750 00000003506 12000542231 016073 0 ustar frank frank /*
\funcref{execmd}{char $**$execmd (\params)}
{
{char} {**cmd} {{\em argv}-like array of command}
{int} {mode} {execution mode}
}
{spawn\_err(), error()}
{fun\_exec()}
{execmd.c}
{
This function is called from {\em fun\_exec()} to execute a command.
The command is held in the {\em argv}-like array {\em cmd}. The same
array is returned, since {\em execmd()} may have to resize it to add a
command tail.
The return register is set to the exit status of the program.
The maker aborts when:
\begin{itemize}
\item the indicated program cannot not be executed,
\item the indicated program can be executed but returns a
non-zero exit status while the execution mode allows checking.
\end{itemize}
{\bf Note that} the strings pointed to by the {\em cmd} array are not
freed.
}
*/
#include "builtin.ih"
char **execmd (cmd, mode)
char **cmd;
int mode;
{
register int
i,
ret; /* exit status */
if (strlen (cmdtail)) /* add cmd tail */
cmd = addcmd (cmd, cmdtail);
if (echo) /* re-echo if requested */
{
for (i = 0; cmd [i]; i++)
printf ("%s ", cmd [i]);
putchar ('\n');
}
fflush (stdout);
#ifdef MSDOS
_heapmin (); /* max memory under DOS */
#endif
/* try to execute */
ret = _spawnvp (P_WAIT, cmd [0], (const char **) cmd);
/* if non-zero return and */
if (ret && P_CHECKMODE (mode)) /* if checking requested.. */
error ("execute - program indicates failure (status %d)", ret);
reg = *intConstructor_i(ret); /* return exit status */
return (cmd);
}
icmake-7.21.01/exec/builtin/builtin.ih 0000644 0001750 0001750 00000004046 12000542231 016452 0 ustar frank frank #include "builtin.h"
#include
#include
#include
#include
#include
#include "../../rss/icrss.h"
#include "../global.h"
#include "../stack/stack.h"
#include "../list/list.h"
#include "../string/string.h"
#include "../virtual/virtual.h"
#include "../int/int.h"
extern int echo;
extern void (*builtinfun[])(void);
char *setstring(char *);
/*
From fun_push_reg():
This function is called when the return register is to be pushed. The
return register is used to return information from built-in functions.
{\bf Note that} the {\em count} field of the return register is {\bf
not} incremented when the register is pushed. The associated memory is
assigned by internal functions and may be freed by subsequent {\em
pop}-instructions.
Therefore, also the builtin functions do not have to free the reg's
memory when assigning a value to reg.
*/
int getcmdlen(char **);
int enterch(void);
char *getarg(size_t, int *);
char **addcmd(char **, char *);
char **execmd(char **, int);
char *getexecarg(size_t, int *);
char *getLine(FILE *file);
void fun_empty(void);
void fun_arg_head(void);
void fun_arg_tail(void);
void fun_ascii_int(void);
void fun_ascii_str(void);
void fun_backtick(void);
void fun_stat(void);
void fun_putenv(void);
void fun_chdir(void);
void fun_getenv(void);
void fun_cmd_tail(void);
void fun_c_base(void);
void fun_c_ext(void);
void fun_c_path(void);
void fun_fields(void);
void fun_fgets(void);
void fun_fprintf(void);
void fun_g_base(void);
void fun_getch(void);
void fun_getpid (void);
void fun_gets(void);
void fun_g_ext(void);
void fun_g_path(void);
void fun_echo(void);
void fun_element(void);
void fun_exec(void);
void fun_exists(void);
void fun_makelist(void);
void fun_printf(void);
void fun_sizeoflist(void);
void fun_str_el(void);
void fun_strfind(void);
void fun_strlen(void);
void fun_strlwr(void);
void fun_strupr(void);
void fun_substr(void);
void fun_system(void);
void fun_cmd_head(void);
int termch(void);
icmake-7.21.01/exec/builtin/syste.c 0000644 0001750 0001750 00000001652 12000542231 015775 0 ustar frank frank /*
\funcref{fun\_system}{void fun\_system ()}
{}
{}
{}
{fun\_exec()}
{funsyste.c}
{
This function expects a system string as last pushed {\em e\_str}
value. The string is executed through a {\em system()} call (if this
fails, an error is issued).
}
*/
#include "builtin.ih"
void fun_system ()
{
int mode = intValue(top()); /* get mode arg */
char const *cmd = stringStr(top() - 1); /* get cmd string */
if (echo) /* re-echo if requested */
puts (cmd);
fflush (stdout);
{
int ret; /* system() return */
ret = system(cmd); /* do system call */
if (ret && P_CHECKMODE(mode)) /* terminate upon failure? */
error ("system - failure of system call (status %d)", ret);
reg = *intConstructor_i(ret);
}
}
icmake-7.21.01/exec/builtin/strupr.c 0000644 0001750 0001750 00000000353 12000542231 016162 0 ustar frank frank /*
Function {\em fun\_strupr()} returns lower-case transformed string
}
*/
#include "builtin.ih"
void fun_strupr()
{
char *cp = _strupr(xstrdup(stringStr(top())));
reg = *stringConstructor_cP(cp);
free(cp);
}
icmake-7.21.01/exec/builtin/backtick.c 0000644 0001750 0001750 00000002205 12000542231 016374 0 ustar frank frank /*
\funcref{fun\_backtick}{void fun\_backtick ()}
{}
{}
{}
{fun\_exec()}
{funsyste.c}
{
This function expects a string as last pushed {\em e\_str}
value. The string is executed through a {\em system()} call (if this
fails, an error is issued) and the standard output produced by the
call is returned as a list, one element for each line. If the list
contains zero elements the command has failed. A command not producing
any output will at least result in a list having one (empty) string.
}
*/
#include "builtin.ih"
void fun_backtick()
{
char const *cmd = stringStr(top()); /* get cmd string */
FILE *fpipe = popen(cmd, "r"); /* and open a pipe */
if (echo) /* re-echo if requested */
printf("`%s`\n", cmd);
reg = *listConstructor();
if (!fpipe) /* command failed */
return; /* then empty list return */
{
char *line;
while ((line = getLine(fpipe)))
listAdd_swallow_cP(®, line);
}
pclose(fpipe);
}
icmake-7.21.01/exec/builtin/sizeo.c 0000644 0001750 0001750 00000000521 12000542231 015751 0 ustar frank frank /*
\funcref{fun\_sizeoflist}{void fun\_sizeoflist ()}
{}
{}
{}
{funsizeo.c}
{
This function determines the size of the last pushed list variable and
sets {\em reg.vu.intval} to this size.
}
*/
#include "builtin.ih"
void fun_sizeoflist ()
{
reg = *intConstructor_i((int)listSize(top()));
}
icmake-7.21.01/exec/builtin/exist.c 0000644 0001750 0001750 00000000636 12000542231 015763 0 ustar frank frank /*
\funcref{fun\_exists}{void fun\_exists ()}
{}
{}
{exists()}
{}
{funexist.c}
{
Function {\em fun\_exists()} checks if a file with the name of the
last pushed string exists. If so, {\em reg.vu.intval} is set to 1.
Else, the return register indicates 0.
}
*/
#include "builtin.ih"
void fun_exists()
{
reg = *intConstructor_i(exists(stringStr(top())));
}
icmake-7.21.01/exec/builtin/exec.c 0000644 0001750 0001750 00000005007 12000542231 015550 0 ustar frank frank /*
\funcref{fun\_exec}{void fun\_exec ()}
{}
{}
{xstrdup(), getexecarg(), execmd(), xrealloc()}
{fun\_print()}
{funexec.c}
{
This function is called when an {\em op\_exec} opcode is encountered
in the binary makefile. At this point, the stack is expected to hold
the following information:
\begin{itemize}
\item The last pushed value ({\em stack[sp]} holds the number of
arguments to the original {\em exec()} statement.
\item The value pushed before that ({\em stack [sp-1]}) holds the
execution mode: 0 = checked, !0 = not checked. When the execution
mode is checked, any exit status which is non-zero leads to an
error.
\item The value pushed before that ({\em stack [sp-2]}) holds the
command to execute; a string.
\item Other pushed values are the remaining arguments.
\end{itemize}
{\em fun\_exec()} initializes an array of command strings and
retrieves arguments. When the length of the command list is about to
exceed {\em MAXCMDLEN} (see {\em icm.h}), the command is flushed by
calling {\em execmd()}.
}
*/
#include "builtin.ih"
static char **initcmd (char **cmd)
{
register int
i;
if (cmd)
for (i = 0; cmd [i]; i++)
free(cmd[i]);
free(cmd);
cmd = xrealloc (NULL, 3 * sizeof (char *));
cmd [0] = xstrdup(stringStr(top() - 2));
if (strlen (cmdhead))
{
cmd [1] = xstrdup (cmdhead);
cmd [2] = NULL;
}
else
cmd [1] = NULL;
return (cmd);
}
void fun_exec ()
{
int getnewarg = 1;
char *nextarg = NULL;
char **cmd = initcmd (NULL);
size_t nextarglen;
size_t cmdlen;
size_t i = 3;
size_t nargs = intValue(top());
int mode = intValue(top() - 1);
while (i <= nargs)
{
int newelement;
if (getnewarg)
nextarg = getexecarg(i, &newelement);
else
getnewarg = 1;
nextarglen = strlen(nextarg);
cmdlen = getcmdlen(cmd);
if (cmdlen + nextarglen + strlen(cmdtail) >= MAXCMDLEN)
{
cmd = execmd (cmd, mode);
cmd = initcmd (cmd);
getnewarg = 0;
}
else
{
cmd = addcmd (cmd, nextarg);
i += newelement;
free(nextarg);
}
}
cmd = execmd (cmd, mode);
for (i = 0; cmd [i]; i++)
free(cmd[i]);
free(cmd);
}
icmake-7.21.01/exec/builtin/cmdta.c 0000644 0001750 0001750 00000000764 12000542231 015721 0 ustar frank frank /*
\funcref{fun\_cmd\_tail}{void fun\_cmd\_tail ()}
{}
{}
{setstring()}
{fun\_arg\_tail(), fun\_arg\_head()}
{funcmdte.c}
{
This function is called when an {\em op\_cmd\_tail} opcode is read in
the binary makefile. The {\em cmdtail} variable is set to a duplicate
of the string in the last pushed variable. The last pushed variable is
then discarded.
}
*/
#include "builtin.ih"
void fun_cmd_tail()
{
cmdtail = setstring(cmdtail);
}
icmake-7.21.01/exec/builtin/fgets.c 0000644 0001750 0001750 00000002506 12000542231 015735 0 ustar frank frank /*
\funcref{fun\_fgets}{void fun\_fgets ()}
{}
{}
{}
{fun\_gets(), fun\_printf(), fun\_fprintf()}
{funfgets.c}
{
This function reads in a string from a file and returns it in the {\em
reg} return register as an {\em e\_str} value. The arguments on the
stack are: the filename and an {\em int offset}, where the read
operation should start.
The return value is a list, holding as the first list element the read
string and as the second element the offset where the reading operation
ended. The offset and the string are empty (offset 0, string "") when
the reading operation failed.
}
*/
#include "builtin.ih"
void fun_fgets()
{
char const *filename = stringStr(top());
size_t offset = intValue(top() - 1);
FILE *inf;
reg = *listConstructor();
if
(
(inf = fopen (filename, "r"))
&&
fseek(inf, (long)offset, SEEK_SET) == 0 /* locate the read-pos. */
)
{
char *dest = getLine(inf);
if (dest) /* anything read? */
{
char buffer[20];
sprintf (buffer, "%d", (int)ftell(inf));
listAdd_swallow_cP(®, dest);
listAdd_cP(®, buffer);
}
fclose (inf);
}
}
icmake-7.21.01/exec/builtin/ascin.c 0000644 0001750 0001750 00000001200 12000542231 015710 0 ustar frank frank /*
\fucref{fun\_ascii\_str}{void fun\_ascii\_str ()}
{}
{}
{}
{}
{funascin.c}
{
This function is called when a call to the built-in function {\em
ascii} is to be processed. This function represents the opcode {\em
op\_ascii\_int}: a string is converted to an int.
If the last pushed value is a string, then the return register
is set to the integer (ASCII number) representation of the first
character in the string.
}
*/
#include "builtin.ih"
static char buf[2];
void fun_ascii_str ()
{
buf[0] = intValue(top());
reg = *stringConstructor_cP(buf);
}
icmake-7.21.01/exec/builtin/termch.c 0000644 0001750 0001750 00000001546 12000542231 016112 0 ustar frank frank /*
Enter a single char without \n on systems supporting termios.
If things fail, fall back to `enterch()'
*/
#include
#include "builtin.ih"
int termch(void)
{
struct termios saved;
struct termios tattr;
int key;
if (tcgetattr(STDIN_FILENO, &saved))
{
fprintf(stderr, "Single key input failed. Press `Enter' as well\n");
return enterch();
}
tcgetattr(STDIN_FILENO, &tattr); /* can't assign saved to tattr */
tattr.c_lflag &= ~(ICANON | ECHO);
tattr.c_cc[VMIN] = 1;
tattr.c_cc[VTIME] = 0;
if (tcsetattr(STDIN_FILENO, TCSAFLUSH, &tattr))
{
fprintf(stderr, "Single key input failed. Press `Enter' as well\n");
return enterch();
}
key = getchar();
printf("%c\n", key);
tcsetattr(STDIN_FILENO, TCSANOW, &saved);
return key;
}
icmake-7.21.01/exec/icm-exec.c 0000644 0001750 0001750 00000006140 12175751755 014701 0 ustar frank frank /*
\funcref{main}{void main (\params)}
{
{int} {argc} {argument count}
{char} {**argv} {array of arguments}
{char} {**envp} {array of environment settings}
}
{}
{getvar(), process(), envp2list(), newvar()}
{}
{icm-exec.c}
{
The {\em main()} function opens the binary makefile, reads the offsets
of the variables and strings sections, calls {\em getvar()} to retrieve
the variables, pushes {\em argc}, {\em argv} and {\em envp}
onto the {\em icmake}
stack and then calls {\em process()} to execute the makefile.
The exit value of {\em main()} is held in the global variable {\em
retval} (see also {\em fun\_ret()}).
Function {\em cleanup()} is attached to the `at-exit' list for DOS
systems. This is necessary so that the startup working directory is
restored. For UNIX systems, no {\em atexit()} list is created.
}
*/
#include "icm-exec.h"
#include "var/var.h"
int main (int argc, char **argv)
{
int idx;
register char *progname;
atexit (cleanup);
signal (SIGINT, (void (*)(int))abnormal);
getcwd (orgdir, _MAX_PATH - 1);
if (argc == 1)
{
copyright("ICMAKE Binary Makefile Executor", version, release);
progname = program_name(argv[0]);
printf ("This program is run as a child process of icmake.\n"
"Usage: %s [-t] bimfile\n"
"where: -t - option indicating that 'bimfile' must be\n"
" removed on exit.\n"
" bimfile - binary makefile to execute.\n\n"
, progname);
return 1;
}
if (!strcmp(argv[1], "-t")) /* -t option found */
{
argv[1] = argv[0]; /* remove the -t argument */
argv++;
argc--;
bimname = argv[1]; /* define temporary name */
}
if (!(infile = fopen (argv [1], READBINARY)))
error("cannot open bimfile '%s' to read", argv[1]);
headerp = readheader(infile, (size_t)version[0]);
/* return array of global vars */
if ((INT16)(nvar = getvar(infile, headerp, &var)) == -1)
error("invalid macro file, cannot read variable section");
/* global strings haven't been initialized by the compiler yet, */
/* so that's icm-exec's job */
for (idx = 0; idx < nvar; ++idx)
{
if (typeValue(var + idx) == e_str)
var[idx] = *stringConstructor();
}
fseek(infile, headerp->offset[3], SEEK_SET);
{
LISTVAR_ env = *listConstructor();
environ2list(&env);
push(&env); /* envp: 3rd arg of main() */
listDestructor(&env);
}
{
LISTVAR_ args = *listConstructor_s_cPP((size_t)argc, argv);
push(&args); /* argv: 2nd arg of main() */
listDestructor(&args);
}
{
INTVAR_ nArgs = *intConstructor_i(argc - 1);
push(&nArgs); /* argc: 1st arg of main() */
}
process();
return retval;
}
icmake-7.21.01/exec/stack/ 0000755 0001750 0001750 00000000000 12267172022 014131 5 ustar frank frank icmake-7.21.01/exec/stack/local.c 0000644 0001750 0001750 00000000144 12000542231 015352 0 ustar frank frank #include "stack.ih"
VAR_ *local(int index)
{
return stack + (int)bp + (INT16)0xc000 - index;
}
icmake-7.21.01/exec/stack/pop.c 0000644 0001750 0001750 00000000232 12000542231 015054 0 ustar frank frank #include "stack.ih"
#include "../int/int.h"
#include "../string/string.h"
void pop()
{
stacktestunderflow();
destructor(stack + --sp);
}
icmake-7.21.01/exec/stack/popbp.c 0000644 0001750 0001750 00000000227 12000542231 015402 0 ustar frank frank #include "stack.ih"
void popBP()
{
while (sp - 1 != bp)
pop();
bp = intValue(top()); /* restore old bp */
pop();
}
icmake-7.21.01/exec/stack/pushbp.c 0000644 0001750 0001750 00000000161 12000542231 015560 0 ustar frank frank #include "stack.ih"
void pushBP()
{
VAR_ idx = *intConstructor_i((int)bp);
bp = sp;
push(&idx);
}
icmake-7.21.01/exec/stack/stack.ih 0000644 0001750 0001750 00000000326 12000542231 015545 0 ustar frank frank #include "stack.h"
#include "../var/var.h"
#include "../virtual/virtual.h"
#include "../int/int.h"
#include "../global.h"
void stacktestunderflow(void);
extern VAR_ *stack;
extern size_t sp;
extern size_t bp;
icmake-7.21.01/exec/stack/push.c 0000644 0001750 0001750 00000000517 12000542231 015243 0 ustar frank frank #include "stack.ih"
#include "../int/int.h"
#include "../string/string.h"
static size_t stackSize;
VAR_ *stack;
size_t sp;
size_t bp;
void push(VAR_ const *varEl)
{
if (sp >= stackSize)
{
stackSize += 50;
stack = xrealloc(stack, stackSize * sizeof(VAR_));
}
stack[sp++] = *copyCons(varEl);
}
icmake-7.21.01/exec/stack/testunderflow.c 0000644 0001750 0001750 00000000203 12000542231 017161 0 ustar frank frank #include "stack.ih"
void stacktestunderflow()
{
if (sp == 0)
error("stack underflow at %s", hexstring(curoffs, 4));
}
icmake-7.21.01/exec/stack/stack.h 0000644 0001750 0001750 00000000351 12000542231 015372 0 ustar frank frank #ifndef _INCLUDED_STACK_H_
#define _INCLUDED_STACK_H_
#include "../../rss/icrss.h"
void push(VAR_ const *var);
void pushBP(void);
void pop(void);
void popBP(void);
VAR_ *top(void);
VAR_ *local(int index);
#endif
icmake-7.21.01/exec/stack/top.c 0000644 0001750 0001750 00000000132 12000542231 015057 0 ustar frank frank #include "stack.ih"
VAR_ *top()
{
stacktestunderflow();
return stack + sp - 1;
}
icmake-7.21.01/exec/icmconf 0000644 0001750 0001750 00000006105 12000542231 014353 0 ustar frank frank // Inspect the following #defines. Change them to taste. If you don't
// need a particular option, change its value into an empty string
// should commands be echoed (ON) or not (OFF) ?
#define USE_ECHO ON
// The final program and source containing main():
// ===============================================
// define the name of the program to create:
#define BINARY "icm-exec"
// define the name of the source containing main():
#define MAIN "icm-exec.c"
// #defines used for compilation and linking:
// ==========================================
// define the compiler to use:
#define COMPILER "gcc"
// define the compiler options to use:
#define COMPILER_OPTIONS "-g -Wall -O2"
// define the pattern to locate sources in a directory:
#define SOURCES "*.c"
// define the options used for linking:
#define LINKER_OPTIONS "-s"
// define any additional libraries BINARY may need:
#define ADD_LIBRARIES "icrss"
// define any additional paths (other than the standard paths) the
// additional libraries are located in:
#define ADD_LIBRARY_PATHS "../../rss"
// #defines used for the final product:
// ====================================
#define BIN_INSTALL "../bin"
// Some advanced #defines, used to create parsers and lexical scanners
// ===================================================================
// Lexical Scanner section
// =======================
// Should a lexical scanner be constructed? If so, define the subdirectory
// containing the scanner's specification file.
#define SCANNER_DIR ""
// What is the program generating the lexical scanner?
#define SCANGEN "flex"
// Flags to provide SCANGEN with:
#define SCANFLAGS "-I"
// Name of the lexical scanner specification file
#define SCANSPEC "lexer"
// Name of the file generated by the lexical scanner
#define SCANOUT "yylex.cc"
// Parser section
// ==============
// Should a parser be constructed? If so, define the subdirectory
// containing the parser's specification file
#define PARSER_DIR ""
// What it the program generating a parser?
#define PARSGEN "bisonc++"
// What it the grammar specificication file?
#define PARSSPEC "grammar"
// Flags to provide PARSGEN with:
#define PARSFLAGS "-V -l"
// Name of the file generated by the parser generator containing the
// parser function
#define PARSOUT "parse.cc"
// Additional defines, which should normally not be modified
// =========================================================
// Directory below this directory to contain temporary results
#define TMP_DIR "tmp"
// Local program library to use (comment out if you want to use
// the object modules themselves, rather than a library)
#define LIBRARY "modules"
// The extension of object modules:
#define OBJ_EXT ".o"
icmake-7.21.01/icm_bootstrap 0000755 0001750 0001750 00000005357 12267170127 014711 0 ustar frank frank #!/bin/bash
GLB=-DHAVE_GLOB
if [ "$#" == "0" ] ; then
echo "
Usage: bootstrap root-directory
root-directory: directory under which all icmake files will be
installed. For a normal system-installation use, e.g., /
This script assumes that the GCC compiler is available, and that
the function glob() is available in the gcc-runtime library.
If that's not the case, remove the -DHAVE_GLOB define from the
gcc flags at the top of $0.
Furthermore, it assumes that the parser files parser.c and parser.h have
already been generated from the file parser and that the file lexer.c has
already been generated from the file lexer.
"
exit 1
fi
try()
{
echo $*
$* || exit 1
}
. icm_prepare
if [ "${CFLAGS}" == "" ] ; then CFLAGS="-Wall -O2"; fi
if [ "${CC}" == "" ] ; then CC="gcc"; fi
echo Creating tmp/libicrss.a
try cd rss
try ${CC} -c ${CFLAGS} ${GLB} *.c
try ar rs ../tmp/libicrss.a *.o
rm *.o
cd ..
echo Creating tmp/${BINDIR}/icmake${EXTENSION}
try cd make
try ${CC} ${CFLAGS} ${GLB} \
-o ../tmp/${BINDIR}/icmake${EXTENSION} *.c ../tmp/libicrss.a \
${LDFLAGS}
cd ..
echo Creating tmp/${BINDIR}/icmun${EXTENSION}
try cd un
try ${CC} ${GLB} ${CFLAGS} \
-o ../tmp/${BINDIR}/icmun${EXTENSION} *.c ../tmp/libicrss.a \
${LDFLAGS}
cd ..
echo Creating tmp/${LIBDIR}/icm-pp${EXTENSION}
try cd pp
try ${CC} ${GLB} ${CFLAGS} \
-o ../tmp/${LIBDIR}/icm-pp${EXTENSION} *.c ../tmp/libicrss.a \
${LDFLAGS}
cd ..
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 ..
echo Creating tmp/${LIBDIR}/icm-exec${EXTENSION}
try cd exec
try ${CC} ${CFLAGS} ${GLB} -c *.c
for x in auks var virtual int list string stack opcodefun builtin
do
try cd $x
try ${CC} ${GLB} ${CFLAGS} -c *.c
try cd ..
done
try ${CC} -o ../tmp/${LIBDIR}/icm-exec${EXTENSION} *.o \
*/*.o ../tmp/libicrss.a ${LDFLAGS}
rm *.o */*.o
cd ..
echo Copying icmbuild/icmstart from scripts to tmp
cp scripts/icmbuild.in scripts/icmstart.in tmp/
echo Copying the skeleton files in usr/share/icmake/
try cp -r usr/share/icmake/* tmp/${SKELDIR}
echo Copying the configuration files in etc/icmake/
try cp -r etc/icmake/* tmp/${CONFDIR}
echo Copying the man-pages from doc/
try cp doc/*.1 tmp/${MANDIR}/man1
try cp doc/*.7 tmp/${MANDIR}/man7
echo Copying additional documentation to doc/
try mkdir -p tmp/${DOCDIR}/
try cp changelog tmp/${DOCDIR}/
echo Copying additional documentation to doc-doc/
try cp -r examples doc/icmake.doc doc/icmake.ps doc/README.icmbuild tmp/${DOCDOCDIR}
echo Copying etc files to etc/
try cp -r etc tmp/
echo Done.
icmake-7.21.01/icm_install 0000755 0001750 0001750 00000003062 12267171331 014327 0 ustar frank frank #!/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}/icmun \
tmp/${LIBDIR}/*
fi
try mkdir -p $INSTALLDIR/${BINDIR} $INSTALLDIR/${LIBDIR}
try cp -r tmp/${BINDIR}/icmake tmp/${BINDIR}/icmun $INSTALLDIR/${BINDIR}
try cp -r tmp/${LIBDIR}/* $INSTALLDIR/${LIBDIR}
}
scripts()
{
try mkdir -p $INSTALLDIR/${BINDIR}
# script install-dest.
try scripts/convert icmbuild $INSTALLDIR/$BINDIR
try scripts/convert icmstart $INSTALLDIR/$BINDIR
try chmod +x $INSTALLDIR/$BINDIR/icmbuild $INSTALLDIR/$BINDIR/icmstart
}
into()
{
try mkdir -p $INSTALLDIR/$1
try cp -r tmp/$1/* $INSTALLDIR/$1
}
case $1 in
(all)
progs
scripts
into ${MANDIR}
into ${SKELDIR}
into ${DOCDIR}
into ${DOCDOCDIR}
into ${CONFDIR}
;;
(progs)
progs
;;
(scripts)
scripts
;;
(man)
into ${MANDIR}
;;
(skel)
into ${SKELDIR}
;;
(doc)
into ${DOCDIR}
;;
(etc)
into ${CONFDIR}
;;
(docdoc)
into ${DOCDOCDIR}
;;
(*)
usage
;;
esac
icmake-7.21.01/icm_prepare 0000755 0001750 0001750 00000001463 12000542231 014304 0 ustar frank frank #!/bin/bash
try()
{
echo $*
$* || exit 1
}
echo Creating the intermediate destination directory ./tmp
try rm -rf tmp
try mkdir -p tmp
echo Writing tmp/ROOT
echo "ROOT=$1/" > tmp/ROOT
. scripts/conversions
echo "
#define BINDIR \"${BINDIR}\"
#define SKELDIR \"${SKELDIR}\"
#define MANDIR \"${MANDIR}\"
#define LIBDIR \"${LIBDIR}\"
#define CONFDIR \"${CONFDIR}\"
#define DOCDIR \"${DOCDIR}\"
#define DOCDOCDIR \"${DOCDOCDIR}\"
#define VERSION \"${VERSION}\"
#define YEARS \"${YEARS}\"
" > tmp/INSTALL.im
cat tmp/INSTALL.im
echo Creating remaining intermediate destination directories
try mkdir -p tmp/${BINDIR} tmp/${LIBDIR} tmp/${SKELDIR} \
tmp/${CONFDIR} tmp/${MANDIR}/man1 tmp/${MANDIR}/man7 \
tmp/${DOCDIR} tmp/${DOCDOCDIR}
icmake-7.21.01/legacy/ 0000755 0001750 0001750 00000000000 11743327112 013344 5 ustar frank frank icmake-7.21.01/legacy/lsm.org/ 0000755 0001750 0001750 00000000000 11743327112 014725 5 ustar frank frank icmake-7.21.01/legacy/lsm.org/icmake.lsm 0000644 0001750 0001750 00000003466 11743327112 016704 0 ustar frank frank Begin2
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-7.21.01/legacy/lsm.org/icmakebin.lsm 0000644 0001750 0001750 00000003155 11743327112 017370 0 ustar frank frank Begin2
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-7.21.01/legacy/dos-msc.im 0000644 0001750 0001750 00000015271 11743327112 015246 0 ustar frank frank // 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 = change_ext (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 = change_ext (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 + " " + change_ext(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, change_ext (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 = change_ext (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-7.21.01/legacy/mail.frank 0000644 0001750 0001750 00000002362 11743327112 015314 0 ustar frank frank Michael 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-7.21.01/make/ 0000755 0001750 0001750 00000000000 12175716604 013025 5 ustar frank frank icmake-7.21.01/make/cleanup.c 0000644 0001750 0001750 00000000312 12000542231 014570 0 ustar frank frank /*
C L E A N U P . C
*/
#include "icmake.h"
void cleanup()
{
fflush(stdout);
fflush(stderr);
unlink(temporary);
if (errors)
unlink(dest_name);
}
icmake-7.21.01/make/build 0000755 0001750 0001750 00000023501 12000542231 014027 0 ustar frank frank #!/usr/bin/icmake -qt/tmp/make
// script generated by the C++ icmake script version 2.33
/*
Configurable defines:
CLASSES: string of directory-names under which sources of classes
are found. E.g., CLASSES = "class1 class2"
All class-names must be stored in one string.
If classes are removed from the CLASSES definition or if the names in the
CLASSES definition are reordered, the compilation should start again from
scratch.
*/
string
CLASSES;
void setClasses()
{
// ADD ADDITIONAL DIRECTORIES CONTAINING SOURCES OF CLASSES HERE
// Use the construction `CLASSES += "classname1 classname2";' etc.
CLASSES += "";
}
#define BUILD_LIBRARY
#define BUILD_PROGRAM "../tmp/usr/bin/icmake"
#define COMPILER "gcc"
#define COPT "-Wall -O2 -DHAVE_GLOB -g"
#define ECHO_REQUEST 1
#define LIBS "icrss"
#define LIBPATH "../tmp"
// NO CONFIGURABLE PARTS BELOW THIS LINE
/*
V A R S . I M
*/
string // contain options for
cwd, // current WD
libs, // extra libs, e.g., "-lrss -licce"
libpath, // extra lib-paths, eg, "-L../rss"
copt, // Compiler options
lopt, // Linker options
libxxx, // full library-path
ofiles, // wildcards for o-files
sources, // sources to be used
current, // contains name of current dir.
programname; // the name of the program to create
int
nClasses, // number of classes/subdirectories
program; // 1: program is built
list
classes; // list of classes/directories
/*
parser.im
*/
/*
I N I T I A L . I M
*/
void initialize()
{
echo(ECHO_REQUEST);
sources = "*.c";
ofiles = "o/*.o"; // std set of o-files
copt = COPT;
cwd = chdir(".");
setClasses(); // remaining classes
classes = strtok(CLASSES, " "); // list of classes
nClasses = sizeof(classes);
}
/*
O B J F I L E S . I M
*/
list objfiles(list files)
{
string
file,
objfile;
int
i;
for (i = 0; i < sizeof(files); i++)
{
file = element(i, files); // determine element of the list
objfile = "./o/" + change_ext(file, "o"); // make obj-filename
if (objfile younger file) // objfile is younger
{
files -= (list)file; // remove the file from the list
i--; // reduce i to test the next
}
}
return (files);
}
/*
A L T E R E D . I M
*/
list altered(list files, string target)
{
int
i;
string
file;
for (i = 0; i < sizeof(files); i++) // try all elements of the list
{
file = element(i, files); // use element i of the list
if (file older target) // a file is older than the target
{
files -= (list)file; // remove the file from the list
i--; // reduce i to inspect the next
} // file of the list
}
return (files); // return the new list
}
/*
F I L E L I S T . I M
*/
list file_list(string type, string library)
{
list
files;
files = makelist(type); // make all files of certain type
#ifdef BUILD_LIBRARY
files = altered(files, library); // keep all files newer than lib.
#endif
files = objfiles(files); // remove if younger .obj exist
return (files);
}
/*
L I N K . I M
*/
void link(string library)
{
printf("\n");
exec(COMPILER, "-o", programname,
"-l" + library, libs, "-L.", libpath, lopt, "-s");
printf("ok: ", programname, "\n");
}
/*
P R E F I X C L . I M
*/
void prefix_class(string class_id)
{
list
o_files;
string
o_file;
int
i;
chdir("o");
o_files = makelist("*.o");
for (i = 0; o_file = element(i, o_files); i++)
exec("mv", o_file, class_id + o_file);
chdir("..");
}
/*
R M C L A S S P . I M
*/
string rm_class_id(string class_id, string ofile)
{
string
ret;
int
index,
n;
n = strlen(ofile);
for (index = strlen(class_id); index < n; index++)
ret += element(index, ofile);
return ret;
}
void rm_class_prefix(string class_id)
{
list
o_files;
string
o_file;
int
i;
chdir("o");
o_files = makelist("*.o");
for (i = 0; o_file = element(i, o_files); i++)
exec("mv", o_file, rm_class_id(class_id, o_file));
chdir("..");
}
/*
C C O M P I L E . I M
*/
void c_compile(list cfiles)
{
string
nextfile;
int
i;
if (!exists("o"))
system("mkdir o");
if (sizeof(cfiles)) // files to compile ?
{
printf("\ncompiling: ", current, "\n\n");
// compile all files separately
for (i = 0; nextfile = element(i, cfiles); i++)
exec(COMPILER,
"-c -o o/" + change_ext(nextfile, "o"),
copt, nextfile);
printf("\n");
}
printf("ok: ", current, "\n");
}
/*
U P D A T E L I . I M
*/
void updatelib(string library)
{
list
arlist,
objlist;
string
to,
from;
objlist = makelist("o/*.o");
if (!sizeof(objlist))
return;
printf("\n");
exec("ar", "rvs", library, "o/*.o");
exec("rm", "o/*.o");
printf("\n");
}
/*
S T D C P P . I M
*/
void std_cpp(string library)
{
list
cfiles;
cfiles = file_list(sources, library); // make list of all cpp-files
c_compile(cfiles); // compile cpp-files
}
/*
C P P M A K E . C
CPP files are processed by stdmake.
Arguments of CPPMAKE:
cpp_make(
string mainfile, : name of the main .cpp file, or "" for library
maintenance
string library, : name of the local library to use/create
(without lib prefix or .a/.so suffix
(E.g., use `main' for `libmain.a')
)
Both mainfile and library MUST be in the current directory
*/
void cpp_make(string mainfile, string library)
{
int
index;
string class;
if (nClasses)
ofiles += " */o/*.o"; // set ofiles for no LIBRARY use
// make library name
libxxx = chdir(".") + "lib" + library + ".a";
// first process all classes
for (index = 0; index < nClasses; index++)
{
class = element(index, classes); // next class to process
chdir(class); // change to directory
current = "subdir " + class;
#ifdef QT
moc(class); // see if we should call moc
#endif
std_cpp(libxxx); // compile all files
chdir(cwd); // go back to parent dir
}
current = "auxiliary " + sources + " files";
std_cpp(libxxx); // compile all files in current dir
// prefix class-number for .o files
for (index = 0; index < nClasses; index++)
{
current = element(index, classes); // determine class name
chdir( current); // chdir to a class directory.
prefix_class((string)index);
updatelib(libxxx);
chdir(cwd); // go back to parent dir
}
current = ""; // no class anymore
updatelib(libxxx); // update lib in current dir
if (mainfile != "") // mainfile -> do link
{
link(library);
printf
(
"\nProgram construction completed.\n"
"\n"
);
}
}
/*
S E T L I B S . I M
*/
void setlibs()
{
int
n,
index;
list
cut;
cut = strtok(LIBS, " "); // cut op libraries
n = sizeof(cut);
for (index = 0; index < n; index++)
libs += " -l" + element(index, cut);
cut = strtok(LIBPATH, " "); // cut up the paths
n = sizeof(cut);
for (index = 0; index < n; index++)
libpath += " -L" + element(index, cut);
}
void main(int argc, list argv)
{
int extensive;
if (argc == 1)
{
printf("Usage:\n"
" build prog [-e]\n");
exit (1);
}
if (extensive = (element(argc - 1, argv) == "-e"))
--argc;
initialize();
if (extensive)
copt =
"-O0 -g3 -ansi -pedantic -fno-common -pipe -W -Wall -Wcast-align"
" -Wcast-qual -Wconversion -Wformat=2 -Winline -Wnested-externs"
" -Wpointer-arith -Wshadow -Wstrict-prototypes -Wundef"
" -Wno-unused-parameter -Waggregate-return -Wnested-externs"
" -DHAVE_GLOB";
setlibs();
programname = BUILD_PROGRAM;
system("mkdir -p " + get_path(programname));
cpp_make
(
"icmake.c", // program source
"icmake" // static program library
);
system("rm -rf o lib*.a");
exit (0);
}
icmake-7.21.01/make/quotebla.c 0000644 0001750 0001750 00000001517 12000542231 014765 0 ustar frank frank /*
Q U O T E B L A . C
*/
#include "icmake.h"
void quote_blanks(char **args)
{
char
*arg; /* pointer to modified arg */
while (*args) /* as long as there are args */
{
if (strchr(*args, ' ')) /* if the arg contains a blank */
{ /* arg to become: "arg" */
arg = xrealloc(NULL, 2 + 1 + strlen(*args));
arg[0] = '"'; /* assign first " */
strcpy(arg + 1, *args); /* move in the argument */
strcat(arg, "\""); /* add trailing " */
*args = arg; /* reassign pointer to new arg */
}
args++; /* next argument */
}
}
icmake-7.21.01/make/abnormal.c 0000644 0001750 0001750 00000000226 12000542231 014740 0 ustar frank frank /*
A B N O R M A L . C
*/
#include "icmake.h"
void abnormal_exit(int x)
{
errors++;
error("Abnormal ending");
}
icmake-7.21.01/make/data.c 0000644 0001750 0001750 00000000356 12000542231 014062 0 ustar frank frank /*
D A T A . C
*/
#include "icmake.h"
char
cant_read[] = "Can't read %s",
r[] = "r",
rb[] = "rb";
char *temporary;
char *source_name;
char *dest_name;
FILE *fdest;
FLAGS_ flags;
int errors;
icmake-7.21.01/make/about.c 0000644 0001750 0001750 00000002643 12000542231 014264 0 ustar frank frank /*
A B O U T . C
*/
#include "icmake.h"
void about()
{
copyright("Make Utility", version, release);
error("%s%s",
"ICMAKE consists of a set of five programs. Together, they can\n"
"be used for managing program development comparable to, e.g.,\n"
"the UNIX make facility, or as a SHELL-script language.\n"
"\n"
"Icmake was developed using the C programming language by "
"Karel Kubat\n"
"and Frank Brokken.\n"
"\n"
"ICMAKE is available for several UNIX-platforms. MS-DOS is not\n"
"directly supported anymore\n"
"\n",
"ICMAKE can be obtained by anonymous ftp at:\n"
" http://icmake/sourceforge.net\n"
"Also, ICMAKE is part of the Debian distribution\n"
"\n"
"Questions, remarks, etc. about ICMAKE can be sent to:\n"
"\n"
" Frank B. Brokken,\n"
"phone: (+31) 50 363 9281\n"
"e-mail: f.b.brokken@rug.nl\n"
"surface mail: Center of Information Technology, "
"University of Groningen\n"
" P.O. Box 11044, 9700 CA Groningen, "
"the Netherlands");
}
icmake-7.21.01/make/options.c 0000644 0001750 0001750 00000005126 12000542231 014644 0 ustar frank frank /*
O P T I O N S . C
*/
#include "icmake.h"
int options (char **argv, int *argc)
{
register int
c;
char
*cp;
char
pid_string[30]; /* used with -x */
while ((c = getopt(argc, argv)) != -1)
{
switch (c)
{
case 'a':
about();
break;
case 'b':
flags |= f_blunt;
break;
case 'c':
flags |= f_compiler;
break;
case 'i':
flags |= f_icmake; /* flag icmake taken literally */
if (!(source_name = getoptval(argc, argv)))
error("-i requires source-filename");
return getoptindex(); /* and return the index of args */
/* to icm-exec */
case 'p':
flags |= f_preprocessor;
break;
case 'q':
flags |= f_quiet; /* no banner */
break;
case 't':
flags |= f_tmpbim | f_icmake; /* flag use temporary bimfile */
if (!(cp = getoptval(argc, argv)))
error("-t requires temporary bim-filename");
while (*cp == ' ') /* skip initial blanks in optval*/
cp++;
/* build pid-string */
sprintf(pid_string, "%d", getpid());
/* destination with pid-extension */
dest_name = xstrdup(change_ext(cp, pid_string));
strcat(pid_string, "a"); /* temp. pim-file extension */
temporary = xstrdup(change_ext(cp, pid_string));
source_name = argv[1];
return getoptindex() + 1; /* index of remaining args */
/* + 1 for the extra arg on the */
/* #!/...-x... line */
case '-':
return getoptindex(); /* return index of args to icm-exec
*/
}
}
return *argc;
/* return index of args to icm-exec
*/
}
/*
int flags;
void main(int argc, char **argv)
{
options(argv, &argc);
printf("flags: %x\n"
"arguments:\n"
,
flags);
while (argc--)
puts(*argv++);
}
*/
icmake-7.21.01/make/compilet.c 0000644 0001750 0001750 00000001575 12000542231 014771 0 ustar frank frank /*
C O M P I L E T . C
*/
#include "icmake.h"
int compile_test()
{
char buffer[100];
BIN_HEADER_ hdr;
if
(
(flags & (f_compiler | f_preprocessor))
||
!exists(dest_name)
)
return (1);
if (!(fdest = fopen(dest_name, rb)))
error(cant_read, dest_name);
if (younger(source_name, dest_name))
return(1);
hdr = *readheader(fdest, (size_t)version[0]);
fseek(fdest, hdr.offset[2], SEEK_SET); /* go to filenames area */
while (fgets(buffer, 100, fdest)) /* read the next filename */
{
buffer[strlen(buffer) - 1] = 0; /* remove \n */
if (younger(buffer, dest_name)) /* source name is younger */
return (1); /* recompilation needed */
}
return (0); /* binary file up to date */
}
icmake-7.21.01/make/icmake.c 0000644 0001750 0001750 00000011372 12000542231 014402 0 ustar frank frank /*
I C M A K E . C
*/
#include "icmake.h"
static char
bim[] = "bim",
icm_comp[] = LIBDIR "/icm-comp",
icm_exec[] = LIBDIR "/icm-exec",
icm_pp[] = LIBDIR "/icm-pp",
pim[] = "pim";
int main ( /* icmake source(txt) dest(bin) */
int argc,
char **argv)
{
register int
argc2,
ret;
char
*prog;
argc2 = options(argv, &argc); /* process options */
/* argc2 is index of args to
icm-exec
*/
if (!(flags & f_quiet))
copyright("Make Utility", version, release);
prog = program_name(argv[0]);
if (!(flags & f_icmake) && argc2 == 1) /* argv[1]: already for icm-exec */
error
(
"%s%s%s%s%s",
"Icmake by Frank B. Brokken (and Karel Kubat until V 6.30).\n"
"\n"
"Usage: ",
prog,
" [flags] source[.im] [dest[.bim]] [-- [args]]\n"
"where:\n"
"\tflags: optional flags:\n"
"\t\t-a : information about ",
prog,
"\n"
"\t\t-b : blunt execution of the destinationfile\n"
"\t\t-c : the destination file is compiled\n"
"\t\t-i file: 'file': name of source, argument processing stops\n"
"\t\t-p : only the preprocessor is activated\n"
"\t\t-q : quiet mode: copyright banner not displayed\n"
"\t\t-t file: 'file' is used as a temporary bim-file, to be "
"removed\n",
"\t\t on exit. Argument processing stops.\n"
"\tsource: make description source file (default extension: .im)\n"
"\tdest: binary make file (default: source.bim)\n"
"\t (not used with the -t option)\n"
"\t-- : optional icmake-file arguments separator\n"
"\targs: optional arguments following -- received by\n"
"\t the icmake file in its argv-list"
);
if (!(flags & f_icmake)) /* do not take source literally */
{
source_name = try_source(argv[1]); /* determine source */
if (!(flags & f_tmpbim)) /* unless it's a temp. bimfile */
dest_name = argc2 >= 3 ? argv[2] : argv[1];
}
else if (!(flags & f_tmpbim)) /* unless it's a temp. bimfile */
dest_name = source_name;
if (!(flags & f_tmpbim)) /* adapt extension of destination */
dest_name = xstrdup(change_ext(dest_name, bim)); /* if not tmp. bimfile */
if
(
!(flags & f_blunt) /* no forced execution */
&&
compile_test() /* compilation needed */
)
{
/* preprocessor filename */
if (!(flags & f_tmpbim)) /* use .pim unless -t given */
temporary = xstrdup(change_ext(source_name, pim));
signal(SIGINT, abnormal_exit); /* abnormal exits process */
/* do the preprocessing */
ret = _spawnlp(P_WAIT, icm_pp, icm_pp, source_name, temporary, NULL);
if (ret)
{
if (ret == -1)
spawn_err(icm_pp);
cleanup();
return (1);
}
if (flags & f_preprocessor)
return (0);
/* do the compilation */
errors = _spawnlp(P_WAIT, icm_comp, icm_comp,
temporary, dest_name, NULL);
cleanup();
if (errors)
{
if (errors == -1)
spawn_err(icm_comp);
return (1);
}
if (flags & f_compiler)
return (0);
}
if (flags & f_tmpbim) /* -t used */
{
argc2 -= 3; /* set index to start of args */
argv[argc2 + 1] = "-t"; /* signal temporary */
argv[argc2 + 2] = (char *)dest_name; /* store dest-name */
}
else
{
argc2 -= 2; /* set index to start of args */
argv[argc2 + 1] = (char *)dest_name; /* store dest-name */
}
argv[argc2] = icm_exec; /* store executor's name */
/* do the making of the file */
errors = _execvp(icm_exec, &argv[argc2]);
spawn_err(icm_exec); /* shouldn't get here ... */
cleanup(); /* remove tempfiles etc. */
return (1);
}
icmake-7.21.01/make/icmake.h 0000644 0001750 0001750 00000001704 12000542231 014405 0 ustar frank frank #include "../rss/icrssdef.h"
#include "../tmp/INSTALL.im"
#ifdef SUN
#include