The language supports two different types of assignments. The
:= operator is used to assign a variable.
Example 10:
x := 1 str := "hello"
The second kind of assignment <-
is used to replace a fortran code (i.e. a AST)
by another code. Its left hand side is not necessary a variable
Example 11:Replacement of the step of a DO loop statement by the constant 2
stat.STEP <- PARSEEXPR("2")
Example 12:Replacement of the selected statement by 'print *,100'
$cstat <- PARSESTAT("~~~~~~~~~print *,100")
Remark: When the left hand side of the AST assignment is a variable name, this
variable is assigned with the AST. So, there is an important difference
between the expression ($cstat) and the variable $cstat. For example, the
previous transformation is equivalent to the following:
tmp := PARSESTAT(" ~~~~~~~~~print *,1") ($cstat) <- tmp $cstat := tmp