
Appendixes
the argument name in the formal parameter list by the keyword VAR; otherwise, the argument is passed by value. Only variables can be passed by address. Expressions like A+B, where A and B are integer variables can be passed by value but cannot be passed by address.
Two basic types of variables are supported:
INTEGER and STRING
In the STRING, since the ASCII null character is internally used to indicate the end of the sequence, it cannot be part of the string. All other characters, including extended ASCII characters can be part of the string.
There are two types of conditional constructs:
IF and SWITCH
The IF statement is a
The SWITCH statement is a
There are two types of iterative constructs:
FOR and WHILE
The FOR construct sets the loop control variable to an initial value. The control variable is checked for bounds, and if within bounds, the <statement_list> given is executed; otherwise the loop execution terminates. After each execution of <statement_list>, the control variable is incremented or decremented by a certain value. This is computed as follows: if the STEP expression is given it is the value of the expression, else it is 1. The control variable is incremented if TO is specified, and is decremented if DOWNTO is specified. After updating the control variable the bounds check is done again. The keyword ENDFOR is mandatory at the end of the loop.
The WHILE loop has an expression and a <statement_list>. The expression is evaluated and if the expression is
Operator Precedence:
Operators are listed in the order of precedence
Unary
Binary Operators :*/ + _< > <= >= == ! = && II
All the operators are left associative. Expressions are evaluated completely; so care must be taken while writing expressions. For example, expressions like (a !=0 && b / a) would create run time error.
59 |