Department of Computer
Science The University of Arizona Tucson, Arizona IPD237b March 5, 1996 http://www.cs.arizona.edu/icon/docs/ipd237.htm |
where options can be any of the following:iconc [ options ] files [ -x [ args ] ]
-c stop compilation after producing C code -e file redirect standard error output to file -f s enable features as indicated by the letters in s
a - all, equivalent to delns d - enable debugging features, including the effect of -f n (see below) e - enable error conversion l - enable large-integer arithmetic n - produce code that keeps track of line numbers and file names in the source code s - enable full string invocation
-m preprocess each source file with the m4 preprocessor (UNIX only) -n s disable specific optimizations. These are indicated by the letters in s:
a - all, equivalent to cest c - control flow optimizations other than switch statement optimizations e - expand operations in-line when reasonable (keywords are always put in-line) s - optimize switch statements associated with operations invocations t - type inference
-o file use file as the name of the executable file -p arg pass arg on to the C compiler used by iconc -r path use the run-time system at path. -s suppress informative messages from the compiler -t enable debugging features as for -f d and initialize &trace to -1 -u issue warning messages for undeclared identifiers in the program -v i set verbosity level of informative messages to i -C prg have iconc use the C compiler given by prg
.icn
is appended. Otherwise, the name must already have a suffix
of .icn
. The argument "-
" indicates
that the source should be read from standard input. If the -o
option is not used, the name of the executable file is constructed from
the name of the first source file; stdin
is used for "-
".
The compiler produces a C program source file and a C include file as intermediate
files. The names of these files are constructed from the name of the executable
file. For example,
createsiconc prog.icn
prog.c
and prog.h
. These files subsequently
are deleted unless the -c
option is specified. In any event,
any previous versions of prog.c
and prog.h
are
overwritten.
-f
options. Use of these features may reduce the optimizations performed by
the compiler.-p
option passes its argument to the C compiler. For example,
might be used to suppress warning messages.iconc -p "-w"
-
p options accumulate;
-p ""
clears the list of options, including the initial
set of standard options.-r
option allows specification of the location of the directory
that contains files needed by iconc
. This overrides the default
location. The path argument must be terminated by a slash, as in
Theiconc -r /usr/icon/lib/
-v
option controls the level of detail of iconc's informative
messages. -v 0
is the same as -s
. -v 1
is the default behavior. Presently -v 2
and -v 3
only affect messages during type inferencing and are useful for monitoring
its progress on large programs. -v 2
causes a dot to be written
for each iteration of type inferencing. -v 3
writes an indication
of the amount of information found in each iteration of type inferencing.-C
option can be used to override the default C compiler
used by iconc. It is possible, although unlikely, that using a different
C compiler than the one expected when iconc
is built may produce
code incompatibilities.-n t
option sometimes is needed when
compiling very large programs. The other -n
options are used
mostly for debugging the compiler.-n c
may result in
unreachable C code and corresponding warning messages when it is compiled.
Such messages may be annoying, but they can safely be ignored. Occasionally
unreachable C code may occur even with control-flow optimizations. This
may indicate unreachable Icon code.
DBLIST
contains a blank separated list of data bases to be searched before the
standard one. (The standard data base can be changed with the -r
option.) An alternate data base may be placed in the search chain to provide
new operations or to override standard operations.LPATH
is used to specify paths to
search for linked Icon source files. See the information on linking files
in Section 3.
-x
option,
which must appear last. For example,
compiles and runsiconc prog -x test.log test.out
prog.icn
with the arguments test.lo
g
and test.out
.
-f l
option enables large integer support. This allows
the use of large integer literals and allows arithmetic expressions to use
and produce large integer values. When this option is used, iconc
produces code that is somewhat less efficient for arithmetic on ordinary
integer values. This option may only be used with a run-time system that
supports large integers. On most platforms, large integer support is the
default; if large integers are not supported, iconc
issues
a warning and ignores the option.
-f d
compiler
option. An attempt to use a debugging function or keyword in a program where
the compiler has not generated code to support it generally results in run-time
error 402, program not compiled with debugging option.Thedisplay() name() variable() &level &trace &line &file
-f n
option enables limited debugging features. These are
&line
, &file
, and the printing of line
numbers and file names in error messages.
-f s
option makes all operations available for string invocation.
Alternately, more selective control is possible using a new language feature,
the invocable declaration. The syntax for this declaration is
Each string-literal is the string representation of an operation that might be invoked with string invocation. This may be a procedure, a record constructor, a built-in function, or an operator. For operators, the integer-literal indicates the number of arguments for the operator. If it is missing, all operators using that operator symbol (typically unary and binary versions) are made available. all indicates that all operations must be available for string invocation. For example, the following declaration indicates that binaryinvocable-declaration ::= invocable operation {, operation }* operation ::=string-literal | string-literal : integer-literal | all
+
, binary and unary -
, and write
may be invoked with string invocation.
There are some minor differences between string invocation in the compiler and in the interpreter. In the compiler, arguments to built-in operations are not automatically dereferenced, while they are in the interpreter. This means that string invocation on operations that make use of variables can produce different results in the two systems. For example, string invocation on assignment performs the assignment in the compiler, but produces a run-time error in the interpreter.invocable "+":2, "-", "write"
[...]
represents list creation; it takes a variable number
of arguments. The compiler treats &
as an ordinary operator,
so it is available for string invocation. In both the interpreter and the
compiler, the string ...
represents the ternary operation to-by
.
The interpreter implements to as a short-hand notation for to-by
with a third argument of 1, so string invocation is not available for binary
to. The compiler, on the other hand, implements to as a separate operation,
and ...
can be used in string invocation on two arguments.proc()
.
.icn
suffixes, and compiles the files as
if they had been specified on the command line. The source files are located
using paths specified with the LPATH
environment variable;
this is analogous to the use of the IPATH
environment variable
in the interpreter.
-f e
option allows the use of &error
to
enable the conversion of run-time errors into failure. Unless -f e
is specified, the value of &error
has no effect, and run-time
errors are not converted to failure.
The Icon Programming
Language, Prentice-Hall, Inc., Englewood Cliffs, NJ, second edition,
1990.
A Tutorial on Adding Functions to the Icon
Run-Time System, The Univ. of Arizona Icon Project Document IPD173,
1991.