Language Primitives are particular identifiers used for the definition of basic language
primitives.
As different versions of Gobstones may use different sets of primitives, a field
LanguageVariant provide a name that allows programs to indicate which variant to use for them.
It constitutes one of the elements of the WordsDef interface.
Language primitives are organized in three groups, Types, Data Constructors by Type, and
Operations, following the categories of the Gobstones language.
Types give the particular identifiers to use for the name of primitive types.
The definition of version 3.20 of the Gobstones Language prescribes seven primitive types, but
only six of them require special keywords, and the last one, Event, is used only for
organization of interactive programs and it is not a first class type.
DataConstructorsByType list the keywords used as constructors for the elements of variant
types.
For each of the types given in the previous group that have constructors, a group of keywords
for them is given in this one.
The constructors for events requires further explanation, as they have special organization.
Events are a mechanism to allow a program to react to some external situations --
precisely, external events.
In Gobstones they can be used in interactive programs, where the event keywords are bound to
particular fragments of code.
The lists given here establish the particular identifiers used for these bindings.
The standard Gobstones events are time related events for initialization and time passing and
key press events.
Key press events are treated a bit differently, and thus, provided as a separate group, in
KeyEventElements.
Operations provide the keywords for primitive procedures, functions and operators, and are
thus organized in those groups (with two groups for operators: regular symbolic operators and
identifier operators).
Primitive procedures and functions are expected to be identifiers (sequences of regular
characters different from keywords), and they will be parsed as procedure or function calls
in the language.
Operators are expected to be symbolic identifiers (sequences of punctuation chars not
containing punctuation symbolic keywords), and they will be parsed acording to the fixity
declaration given in the declaration (infix or prefix, and with the corresponding association).
The operators NOT, DIV, and MOD must be declared in some fixity level
(NOT as Prefix, DIV and MOD as InfixL.
Language Primitives are particular identifiers used for the definition of basic language primitives. As different versions of Gobstones may use different sets of primitives, a field
LanguageVariant
provide a name that allows programs to indicate which variant to use for them.It constitutes one of the elements of the WordsDef interface.
Language primitives are organized in three groups, Types, Data Constructors by Type, and Operations, following the categories of the Gobstones language.
Types give the particular identifiers to use for the name of primitive types. The definition of version 3.20 of the Gobstones Language prescribes seven primitive types, but only six of them require special keywords, and the last one, Event, is used only for organization of interactive programs and it is not a first class type.
DataConstructorsByType list the keywords used as constructors for the elements of variant types. For each of the types given in the previous group that have constructors, a group of keywords for them is given in this one. The constructors for events requires further explanation, as they have special organization.
Operations provide the keywords for primitive procedures, functions and operators, and are thus organized in those groups (with two groups for operators: regular symbolic operators and identifier operators). Primitive procedures and functions are expected to be identifiers (sequences of regular characters different from keywords), and they will be parsed as procedure or function calls in the language. Operators are expected to be symbolic identifiers (sequences of punctuation chars not containing punctuation symbolic keywords), and they will be parsed acording to the fixity declaration given in the declaration (infix or prefix, and with the corresponding association). The operators NOT, DIV, and MOD must be declared in some fixity level (NOT as Prefix, DIV and MOD as InfixL.