Lugaru's Epsilon
Programmer's
Editor

Context:
Epsilon User's Manual and Reference
   . . .
   Introduction to EEL
      Epsilon Extension Language Features
      EEL Tutorial
   Epsilon Extension Language
      . . .
      Statements
      Conversions
      Operator Grouping
      Order of Evaluation
      Expressions
      . . .
   Primitives and EEL Subroutines
      Buffer Primitives
      Display Primitives
      File Primitives
      . . .
      Defining Language Modes
   . . .

Previous   Up    Next
Conversions  Epsilon Extension Language   Order of Evaluation


Epsilon User's Manual and Reference > Epsilon Extension Language >

Operator Grouping

    Highest Precedence
 
 l-to-r  ()  [ ]  ->  .
 r-to-l  All unary operators (see below)
 l-to-r  *  /  %
 l-to-r  +  -
 l-to-r  <<  >>
 l-to-r  >  <  >=  <=
 l-to-r  ==  !=
 l-to-r  &
 l-to-r  ^
 l-to-r  |
 l-to-r  &&
 l-to-r  ||
 l-to-r  ? :
 r-to-l  All assignment operators (see below)
 l-to-r  ,
 
    Lowest Precedence

 Assignment operators are:   = *= /= %= += -=
   <<= >>= &= ^= |=

 Unary operators are:  * & - ! ~
   ++ -- sizeof ( type-name )

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 left-to-right or right-to-left. 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 left-to-right. 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 "l-to-r" or "r-to-l."

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


Lugaru Copyright (C) 1984, 2012 Lugaru Software Ltd. All Rights Reserved.