HANDBOOK / LANGUAGE REFERENCE MANUAL /

# Context Tables

TableDecl = "'table'" Ident "(" Ident ":" Ident{ "," Ident ":" Ident} ")" .

A declaration of the form

- `'table'` T `(` F1 `:` Tn `,` ... `,` Fn `:` Tn `)`

introduces a context table T.

A context table is an unbounded collection of entries. An entry has a unique key and a record of fields. These fields have names F1, ..., Fn and types T1, ..., Tn. The name of the table, T, acts as the name for the type of the keys.

A unique key is created by a key definition statement. The value of a field is defined by a context update and accessed in a context query.

|  | Example
    'table' Label (Coordinate: INT)
This defines a table `Label`. Entries of this table have one field with name `Coordinate` and type `INT`. Keys of entries have type `Label`. A value of type `Label` can be created without knowing the value of field `Coordinate`.
    Lab :: Label
defines `Lab` as unique value of type `Label`.
    Lab'Coordinate <- Loc
may be used later to define the field `Coordinate`.
    Lab'Coordinate -> Loc
is used to access the field `Coordinate`.