25.07.2014 Views

VDM-10 Language Manual

VDM-10 Language Manual

VDM-10 Language Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Appendix C<br />

Operator Precedence<br />

The precedence ordering for operators in the concrete syntax is defined using a two-level approach:<br />

operators are divided into families, and an upper-level precedence ordering, >, is given for the<br />

families, such that if families F 1 and F 2 satisfy<br />

F 1 > F 2<br />

then every operator in the family F 1 is of a higher precedence than every operator in the family F 2 .<br />

The relative precedences of the operators within families is determined by considering type<br />

information, and this is used to resolve ambiguity. The type constructors are treated separately,<br />

and are not placed in a precedence ordering with the other operators.<br />

There are six families of operators, namely Combinators, Applicators, Evaluators, Relations,<br />

Connectives and Constructors:<br />

Combinators: Operations that allow function and mapping values to be combined, and function,<br />

mapping and numeric values to be iterated.<br />

Applicators: Function application, field selection, sequence indexing, etc.<br />

Evaluators: Operators that are non-predicates.<br />

Relations: Operators that are relations.<br />

Connectives: The logical connectives.<br />

Constructors: Operators that are used, implicitly or explicitly, in the construction of expressions;<br />

e.g. if-then-elseif-else, ‘|->’, ‘. . . ’, etc.<br />

The precedence ordering on the families is:<br />

combinators > applicators > evaluators > relations > connectives > constructors<br />

205

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!