next up previous contents
Next: Variables Up: Definition of the Programming Previous: Records   Contents

Expressions


$$ Expression ::= ["-"] Term {("+" | "-") Term} .
$$ Term ::= Factor {("*" | "/") Factor} .
$$ Factor ::= Value {"." Value} .
$$ Value ::= Symbol | String | Number | List | Record | Constant 
$$           | Subrule-Invocation | Variable | "(" Condition ")" .
$$ Constant-Expression ::= Expression .

An expression is the form in which a value is used in Malaga. Values can be written as follows:

[Surf: "he", Class: Pron, Case&Number: S3]

Variables (these are placeholders for values within a rule) can as well be used as expressions:

$Pron

Furthermore, constants (placeholders for values in a rule file) can be used as expressions:

@combination_table

All three forms can be mixed:

[Surf: "he", Class: Pron, Case&Number: $result]

Furthermore, there are operators which modify values or combine two values to form a new value. Using those operators complex values can be composed. All operators work left-associatively and have a different priority (an operator with higher priority is applied before one with lower priority):

operator priority
. 3
*, / 2
+, - 1

The order in which the operators are to be applied can be changed by bracketing with round parentheses `` ()''.



Subsections
next up previous contents
Next: Variables Up: Definition of the Programming Previous: Records   Contents
Bjoern Beutel