LatFunction implements an array based language interpreter whose Shape language has syntax similar to that of C. The LatFunction module requires a Shape program as input, specified either by its file name or as a null-terminated byte lattice. It also takes three lattices inputs and converts them into arrays in the Shape language.

Modules can be built based on LatFunction by supplying a new control panel and defining new input and output port names. Such a LatFunction-based module can have parameter and lattice ports, while LatFunction has only the latter. All LatFunction-based modules must have the "Program File" input parameter. They may also have the "Debug?" input parameter. Module prototyping in this fashion is discussed in the IRIS Explorer Module Writer's Guide.

The "Debug?" parameter causes LatFunction to echo the Shape statements as the program is parsed, then to echo the statements of the intermediate code as they are executed.

Shape arrays take their name from the input or output port name with which they are associated, with spaces and other non-alphanumeric characters converted to the underscore character (for instance "First In" becomes "First_In" internally). Each external lattice is converted into three internal arrays, giving the data, coordinates, and lattice pair corresponding to the port data. For instance, "First In" creates the internal variables "First_In" for data, "First_In_coord" for coordinates, and "First_In_lat" for the lattice pair of coordinates and data. Parameter port data creates only the data array.

A description of the Shape language and more information on creating a LatFunction-based module are given in the IRIS Explorer Module Writer's Guide in chapter 10, "Prototyping Modules".


Port: Program Text
Type: Lattice
Optional: This port is optional.
Constraints: 1-D
Constraints: byte
Null terminated program text.

Port: First In
Type: Lattice
Optional: This port is optional.
First input data array.

Port: Second In
Type: Lattice
Optional: This port is optional.
Second input data array.

Port: Third In
Type: Lattice
Optional: This port is optional.
Third input data array.


Port: Debug?
Type: Radio Box
Menu Item: Debug off
Menu Item: Debug on
Enable or disable debugging printout.

Port: Program File
Type: Text
File name of program text to interpret.


Port: First Out
Type: Lattice
First output data array.

Port: Second Out
Type: Lattice
Second output data array.

Port: Third Out
Type: Lattice
Third output data array.


The debugging statements printed when "Debug?" is turned on are not extremely informative, and there is no debugger for the language.


[Documentation Home]
© The Numerical Algorithms Group Ltd, Oxford UK. 2000