![]() |
![]() |
![]() |
![]() |
(..Constants..) | Contents | Index | (Symb. Constants) |
We have already mentioned the importance of registers to form a finite
state set, which is easy to handle. Instead of keeping all state information
in one large variable, what will soon lead us to complex and confusing state
indications, SCARLET provides a possibility to split them up into
smaller units, called registers. There are two different kinds,
according to SCARLET'S INT and STRING types: The first
one contains integer constants,
the second kind is intended for string constants.
(We call them integer and string registers respectively.)
At the beginning of each program, number and types of all used registers are
fixed uniquely for all cells of the automaton. In addition they are put in
order by their declaration, and each
register is given a (symbolic) name.
Then the entire state of a cell is given by the cross product of the ordered
tuple of its register contents. Because of the finite range of all registers
the cross product - as the resulting state set - is finite, too.
The structure of a cell induced by the registers must, of course, be evident in the syntax of cell constants, too: The (constant) contents of the different registers stand in sequence (as fixed before by the declaration), surrounded by braces and separated from each other by commas:
|
There has to be values for all declared registers according to their data types, which means: Normally RegConstant is out of IntConstant if the corresponding register type is INT, otherwise it is an element of StringConstant. In both cases RegConstant may also be VOID.
|
VOID does not belong to a special register type, since it is
actually kind of a device. If we assign a cell constant with VOID
in some of its registers to an arbitrary
cell type object, the contents of
all these registers to which VOID is assigned remain unchanged.
Cell constants are of data type CELL.
{"word", -567} /* wrong */
{-123, "state", VOID} /* right */
{0, , 0} /* wrong */
{0, "", 0} /* right */
![]() |
![]() |
![]() |
![]() |
(..Constants..) | Contents | Index | (Symb. Constants) |