Department of Computer
Science The University of Arizona Tucson, Arizona IPD248b March 24, 1996 http://www.cs.arizona.edu/icon/docs/ipd248.htm |
SMARTDRV
) may cause problems and
should be disabled.These files should be located at a place on youricont.exe translator iconx.exe executor
PATH
specification.lzh
. If you do not have a copy of lha.exe
,
execute the self-extracting archive lha213.exe
on the distribution
diskette. This will produce lha.exe
and documentation.To install thedocs.lzh documents icon.lzh executable binary files readme installation overview and recent notes samples.lzh Icon programs and data
.exe
files, set your current directory to the
desired place, place the appropriate distribution diskette in a drive, and
dearchive the files there using lha.exe
. For example, using
drive A
to dearchive the executable binary files, the following
will do:
The same technique can be used for extracting the remaining files.a:lha x a:icon.lzh
.icn
.
Such files should be plain text files (without line numbers or other extraneous
information).icont
, produces an "icode" file
that is executed using iconx.ex
e. There are two forms of icode
files:iconx.exe
automatically
when they are run. These icode files have the extension exe
.iconx
with the
icode file as an argument. These icode files have the extension icx
.iconx.exe
to run.
prog.icn
is translated by
The result is an icode file with the nameicont prog.icn
prog.exe
. This file
can be run by
The extensionprog
.icn
is optional on the command line. For example,
it is sufficient to use
icont prog
-I
,
as in
The result is an icode file namedicont -I prog
prog.icx
. It can be run by
Note that theiconx prog
icx
extension is not necessary.iconx
will find an icode file if it is in the current directory
or at place given on your PATH
specification.hello.icn
This program prints the Icon version number, time, and date.
Run this test as
icont hello hello
cross.icn
This program prints all the ways that two words intersect in
a common character. The file cross.dat
contains typical data.
Run this test as
icont cross cross <cross.dat
meander.icn
This program prints the "meandering strings" that contain
all subsequences of a specified length from a given set of characters. Run
this test as
icont meander meander <meander.dat
roman.icn
This program converts Arabic numerals to Roman numerals. Run
this test as
icont roman roman
icont
translator supports a variety
of options that may be useful in special situations. There also are several
aspects of execution that can be controlled with environment variables.
These are listed here. If you are new to Icon, you may wish to skip this
section on the first reading but come back to it if you find the need for
more control over the translation and execution of Icon programs.
runs the icode fileiconx prog text.dat log.dat
prog.icx
, passing its main procedure a
list of two strings, "text.dat"
and "log.dat"
.
The program also can be translated and run with these arguments with a single
command line by putting the arguments after the -x
:
These arguments might be the names of files thaticont prog -x text.dat log.dat
prog.icn
reads.
For example, the main procedure might begin as follows:
procedure main(args) in := open(args[1]) | stop("cannot open file") out := open(args[2]) | stop("cannot open file") . . .
icont
translator can accept several Icon source files at
one time. When several files are given, they are translated and combined
into a single icode file whose name is derived from the name of the first
file. For example,
translates the filesicont prog1 prog2
prog1.icn
and prog2.icn
and
produces one icode file, prog1.exe
.-o
option, followed by the desired
name. For example,
produces the icode file namedicont -o probe prog
probe.exe
rather than prog.exe
.-c
option is given to icont
, the translator
stops before producing an icode file and intermediate "ucode"
files with the extensions left for future use (normally they are deleted).
For example,
leavesicont -c prog1
prog1.u1
and prog1.u2
, instead of producing
prog1.exe
. These ucode files can be used in a subsequent icont
command by using the .u1
name. This saves translation time
subsequently. For example,
translatesicont prog2 prog1.u1
prog2.icn
and combines the result with the ucode
files from a previous translation of prog1.icn
. Note that only
the .u1
name is given; the .u2
name is implied.
The extension can be abbreviated to .u
, as in
Ucode files also can be added to a program using a link declaration.icont prog2 prog1.u
-
signifies the use of standard input as a source file. In this case, the
ucode files are named stdin.u1
and stdin.u2
and
the icode file is named stdin.exe
.-s
option. Normally, both informative messages and error
messages are sent to standard error output.-t
option causes &trace
to have an initial
value of -1 when the icode file is executed. Normally, &trace
has an initial value of 0.-u
causes warning messages to be issued for undeclared
identifiers in the program. TRACE
(undefined)
&trace
. If this
variable has a value, it overrides the translation-time -t
option.NOERRBUF
(undefined)
&errout
is not buffered.STRSIZE
(500000)
BLKSIZE
(500000)
COEXPSIZE
(2000)
MSTKSIZE
(10000)
"p"
option. seek()
may not reflect the actual byte position because of the translation of carriage-return/line-feed
sequences to line-feed characters. /
or
a \
. Examples are:
A:\ICON\TEST.ICN
A:/ICON/TEST.ICN
For example,console CON printer PRN LST LPT LPT1 auxiliary port AUX COM RDR PUN null NUL NULL
causes strings written to prompt to be displayed on the console. Use of a null file name means no file is created.prompt := open("CON", "w")
Icon Project
Department of Computer Science
The University of Arizona
P.O. Box 210077
Tucson, AZ 85721-0077
U.S.A.
(520) 621-6613 (voice)
(520) 621-4246 (fax)
icon-project@cs.arizona.edu