Previous

Up

Next

Conversions 
Epsilon Extension Language 
Order of Evaluation 
Epsilon User's Manual and Reference >
Epsilon Extension Language >
Operator Grouping
  Highest Precedence 
 
 ltor  ()  [ ]  >  . 
 rtol  All unary operators (see below) 
 ltor  *  /  % 
 ltor  +   
 ltor  <<  >> 
 ltor  >  <  >=  <= 
 ltor  ==  != 
 ltor  & 
 ltor  ^ 
 ltor   
 ltor  && 
 ltor   
 ltor  ? : 
 rtol  All assignment operators (see below) 
 ltor  , 
 
  Lowest Precedence 
 Assignment operators are:  = *= /= %= += = 
  <<= >>= &= ^= = 
 Unary operators are:  * &  ! ~ 
  ++  sizeof ( typename ) 
In an expression like
10 op1 20 op2 30
the compiler determines the rules for grouping by the
precedence and associativity of the operators op1 and
op2. Each operator in EEL has a certain precedence, with some
precedences higher than others. If op1 and op2 have different
precedences, the one with the higher precedence groups tighter. In
the table above, operators with higher precedences appear on a line
above operators with lower precedences. Operators with the same
precedence appear on the same line.
For example, say op1 is + and op2 is * . Since
* 's line appears above + 's, * has a higher precedence
than + and the expression 10 + 20 * 30 is the same as
10 +(20 * 30) .
If two operators have the same precedence, the compiler determines
the grouping by their associativity, which is either lefttoright or
righttoleft. All operators of the same precedence have the same
associativity. For example, suppose op1 is  and op2 is
+ . These operators have the same precedence, and associate
lefttoright. Thus 10  20 + 30 is the same (10  20) + 30 .
All operators on the same line in the table have the same precedence,
and their associativity is given with either "ltor" or
"rtol."
Enclosing an expression in parentheses alters the grouping of
operators. It does not change the value or type of an expression
itself.
Previous

Up

Next

Conversions 
Epsilon Extension Language 
Order of Evaluation 
Copyright (C) 1984, 2012 Lugaru Software Ltd. All Rights Reserved.
