ICONT(1)

NAME
icont - process Icon programs

SYNOPSIS
icont [ option ... ] file ... [ -x arg ... ]

DESCRIPTION
The program icont is a command processor for running Version 6.0 Icon programs. Used in its simplest form, it produces a file suitable for interpretation by the Icon interpreter. Processing consists of two phases: translation and linking. During translation, each Icon source file is translated into an intermediate language called ucode; during linking, the one or more ucode files are combined and a single icode file is produced. Unless the -o option is specified, the name of the resulting icode file is formed by deleting the suffix of the first input file named on the command line. If the -x argument is used, the file is automatically executed by the interpreter and any arguments following the -x are passed as execution arguments to the Icon program itself.

Files whose names end in .icn are assumed to be Icon source programs. These programs are translated, and the intermediate code is left in two ucode files of the same name with .u1 and .u2 substituted for .icn. The ucode code files normally are deleted when icont completes. Files whose names end in .u1 are assumed to refer to ucode files from a previous translation; these files and the corresponding .u2 files are included in the linking phase after any .icn files have been translated. A .u1 or .u2 file that is explicitly named is not deleted. Icon source programs may be read from standard input. The argument - 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.

The following options are recognized by icont:

-c  Suppress the linking phase. The ucode code files are not deleted.

-m  Preprocess each .icn source file with the m4(1) macro processor before translation.

-o output
    Name the icode file output.

-s  Suppress informative messages from the translator and linker. Normally, both informative messages and error messages are sent to standard error output.

-t  Arrange for &trace to have an initial value of -1 when the program is executed. Normally, &trace has an initial value of 0.

-u  Issue warning messages for undeclared identifiers in the program. The warnings are issued during the linking phase.

Icon has several tables related to the translation and linking of programs. These tables are large enough for most programs, but their sizes can be changed, if necessary, by the -S option. This option has the form -S[cfgilrstCL] n, where the letter following the S specifies the table and n is the number of storage units to allocate for the table. Some sizes depend on the size of the address space of the computer. For this purpose, a VAX has a large address space, while a PDP-11 has a small address space. The tables and their default sizes for computers with large and small memory sizes are:

		large	small

c	constant table	100	100
f	field table	100	100
g	global symbol table	200	200
i	identifier table	500	500
l	local symbol table	100	100
r	field table for records	100	100
s	string space	15,000	7,500
t	tree space	15,000	5,000
C	code buffer	20,000	4,000
L	labels	500	500

The units depend on the table involved, but the default values can be used as a general guide for appropriate settings of -S options without knowing the units.

The environment variable IPATH controls the location of files specified in link directives. The value of IPATH should be a blank-separated form p1 p2 pn where the pi name directories. Each directory is searched in turn to locate files named in link directives. The default value for IPATH is . , that is, the current directory.

The icode file produced by the Icon linker is executable. For example, the command

icont hello.icn

produces a file named hello that can be run by the command

hello

Arguments can be passed to the Icon program by following the program name with the arguments. Any such arguments are passed to the main procedure as a list of strings.

When an Icon program is executed, several environment variables are examined to determine certain execution parameters. The values assigned to these variables should be numbers. The variables that affect execution and the interpretations of their values are as follows:

TRACE
    Initialize the value of &trace. If this variable has a value, it overrides the translation-time -t option.

NBUFS
    The number of i/o buffers to use for files. When a file is opened, it is assigned an i/o buffer if one is available and the file is not a tty. If no buffer is available, the file is not buffered. &input, &output, and &errout are buffered if buffers are available. On large-memory systems, the default value of NBUFS is 10. On small-memory systems, it is 5.

NOERRBUF
    If set, &errout is not buffered.

ICONCORE
    If set, a core dump is produced for error termination.

STRSIZE
    The initial size of the string space, in bytes. The string space grows if necessary, but it never shrinks. On large-memory systems, the default value of STRSIZE is 51,200; on small-memory systems, it is 10,240.

HEAPSIZE
    The initial size of the allocated block region, in bytes. The heap grows if necessary, but it never shrinks. On large-memory systems, the default value of HEAPSIZE is 51,200; on small-memory systems, it is 10,240.

COEXPSIZE
    The size, in words, of each co-expression block. On large-memory systems, the default value of COEXPSIZE is 2,000; on small-memory systems, it is 1,000.

MSTKSIZE
    The size, in words, of the main interpreter stack. On large-memory systems, the default value of MSTKSIZE is 10,000; on small-memory systems, it is 3,000.

STATSIZE
    The size, in bytes, of the static region in which co-expression blocks are allocated. On large-memory systems, the default value of STATSIZE is 20,480; on small-memory systems, it is 1,024.

STATINCR
    The size of the increment used when the static region is expanded. The default increment is one-fourth of the initial size of the static region.

FILES
icont    Icon command processor
itran    Icon translator
ilink    Icon linker
iconx    Icon run-time system

SEE ALSO
The Icon Programming Language, Ralph E. Griswold and Madge T. Griswold, Prentice-Hall Inc., Englewood Cliffs, New Jersey, 1983.

Version 6.0 of Icon, Ralph E. Griswold, William H. Mitchell, and Janalee O'Bagy, TR 86-10, Department of Computer Science, The University of Arizona, May 1986.

m4(1), icon_pi(1)

BUGS

Icode files do not stand alone; the Icon run-time system must be present. An icode file produced on one system will not work on another system unless the Icon run-time system is in the same place on both systems and the run-time system is of the same version of Icon as the linker that produced the icode file.

Stack overflow is checked using a heuristic that is not always effective.

If the -m option is used, line numbers reported in error messages or tracing messages are from the file after, not before, preprocessing.