next up previous contents index
Next: Various attributes Up: Various attributes and functions Previous: Objects names and constant

Attributes for expressions

  $\blacktriangleright$ expr.LHS
 
The   expression (i.e. Left Hand Side) returns the first operand of a Fortran binary operator or of an assignment. In most cases this is a shortcut of expr.CHILD(1).
  $\blacktriangleright$ expr.RHS
 
The   expression (i.e. Left Hand Side) returns the second operand of a Fortran binary operator or of an assignment. In most cases this is a shortcut of expr.CHILD(2).

$\vartriangleright$ Example 48:Transforms an expression X1-X2 to -(X2-X1)    

 SCRIPT trans()
   expr := $csel 
   IF (expr.VARIANT=="sub") THEN
     rhs := expr.RHS 
     lhs := expr.LHS 
     expr <- PARSEEXPR("-(%e-%e)",rhs,lhs)
   ENDIF
 ENDSCRIPT



Yann Mevel
1999-04-30