Contents | Prev | Next | Index


Operators

The syntax of expressions specifies operator precedences according to four classes of operators. The not-operator ~ has the highest binding strength, followed by multiplication operators, addition operators, and finally relations. Operators of the same binding strength associate from left to right. For example, x-y-z stands for (x-y)-z.

expr            ::= simple_expr relation simple_expr
                ::= simple_expr
simple_expr     ::= simple_expr add_operator term
                ::= term
                ::= unary term
term            ::= term mul_operator factor
                ::= factor
factor          ::= <character>
                ::= <integer>
                ::= <real>
                ::= <string>
                ::= set
                ::= designator
                ::= func_designator actual_parameters
                ::= ( expr )
                ::= ~ factor
set             ::= { elem_list }
                ::= { }
elem_list       ::= elem_list , elem
                ::= elem
elem            ::= elem_expr .. elem_expr
                ::= elem_expr
elem_expr       ::= expr
func_designator ::= designator

relation     ::= =
             ::= #
             ::= <
             ::= <=
             ::= >
             ::= >=
             ::= IN
             ::= IS

add_operator ::= +
             ::= -
             ::= OR

mul_operator ::= *
             ::= /
             ::= DIV
             ::= MOD
             ::= &

unary        ::= +
             ::= -


Contents | Prev | Next | Index

Canterbury Oberon-2 for Java  (Last documentation update Feb 8, 2000)
Copyright © 1998 Mill Hill & Canterbury Corporation, Ltd. All rights reserved
Please send any comments or corrections to mhc@webcom.com