The syntax of Malaga source texts is defined formally by a sort of EBNF notation:
assert
and :=
stand for themselves.
The start productions for Malaga source texts are
lexicon-file, rule-file, and symbol-file. A
nonterminal marked with *
in its definition is a lexical
symbol.
assert
| !
) condition ;
:=
| :=+
| :=-
| :=*
|
:=/
) expression ;
| <
path {,
path} >
:=
expression ;
break
[label] ;
choose
variable in
expression ;
#
{printing-char}
not
] (expression [comparison-operator
expression] | match-comparison)
=
| /=
| ~
| /~
| in
| less
|
greater
| less_equal
| greater_equal
and
comparison} | {or
comparison})
@
identifier
define
| default
) constant :=
constant-expression ;
define
variable :=
expression ;
|
define
<
variable {,
variable}
>
:=
expression ;
error
expression ;
+
| -
) term}
.
value}
:
] foreach
variable in
expression :
statements end
[foreach
] ;
_
| &
) {letter | digit |
_
| &
}
if
condition then
statements
{elseif
condition then
statements}
[else
statements] end
[if
] ;
include
string ;
initial
constant-expression ,
rule-set ;
;
}
<
{expression {,
expression}} >
:
variable] | variable
:
constant-expression
matches
( (
match {,
match} )
| match {,
match} )
L
| R
| [.
digit
{digit}] [E
digit {digit}] )
parallel
statements {or
statements}
end
[parallel
] ;
.
value}
[
{symbol-value-pair {,
symbol-value-pair}} ]
repeat
statements while
condition ;
statements end
[repeat
] ;
require
| ?
) condition ;
result
expression [,
(rule-set |
accept
)] ;
return
expression ;
(
variable {,
variable} )
:
statements end
[rule-type] [rule-name] ;
rules
(rules {else
rules} | (
rules {else
rules} )
)
allo_rule
| combi_rule
| end_rule
|
pruning_rule
| robust_rule
| input_filter
|
output_filter
| subrule
,
rule-name}
stop
;
"
{char-except-double-quotes | \"
| \\
} "
(
expression {,
expression}
:=
<
symbol {,
symbol}
>
] ;
:
expression
*
| /
) factor}
-
] (symbol | string | number | list |
record | constant | subrule-invocation |
variable | (
condition )
)
$
identifier