6.1 Characterisation of Malaga
A malaga rule file resembles much in programming languages like Pascal
or C (of course, those languages do not have a Left-Associative Grammar
formalism built in). A malaga source file must be translated before
execution, this is the same as for compiler languages. But the
generated Malaga code is not a machine code, but an intermediate code
and has to be executed (interpreted) by an analysis program.
Malaga may be characterised as follows, as far as programming structures and
data structures are concerned:
- structured values:
- The basic values in Malaga are symbols (names that can be used e.g. for
categories or subcategories), numbers (floating point numbers), and
strings. Values can be combined to ordered lists or records (also known
as attribute-value matrixes). A value in a list or a record can be a list or a
record itself. An “ambiguous” symbol like
singular_plural
can
be assigned a list of symbols like <singular, plural>
; such a
symbol is called a multi symbol.
- structured statements:
- In Malaga, the concept of statement blocks is implemented in a similar
way as it is in the programming language Pascal. There are structured
control statements to select or repeat a statement sequence. A variable
is always defined locally, i.e. it only exists from the point
where it has been defined up to the end of the statement sequence in
which it has been defined.
- no type restrictions:
- Any value can be assigned to a variable and the programmer can freely
define the structure of values.
- no side effects:
- Malaga is, unlike programming languages like Pascal or C, free of side
effects. If a variable gets a value, no other variable will be
changed. Analysis paths are independent of each other.
- termination:
- A Malaga grammar that contains no recursive subrules and no
repeat
statements is guaranteed to terminate, i.e. it can never
hang in a loop.
- variables:
- In a
define
statement, a variable is defined and gets an initial
value. Use an assignment to set a variable that has already been defined
to a new value.
- operators:
- Many generative grammar theories or linguistical programming languages use the
concept of unification of feature structures. Malaga does not use unification,
but it offers some operators to build feature structures explicitly. Since
Malaga does without unification, analyses are much faster.