As in C, every expression can serve as a statement, provided that it is followed by a semicolon ;.
In particular, assignments var=expr; are statements.
The other kinds of statements are:
- conditional:
ifexprthenstatement1 [elsestatement2];
if expr is true, then execute statement1;
else, ifelsebranch is present, execute statement2
Typing:- Requires: expr :
int
- Requires: expr :
- split regex:
splitregexp/var1,…,varn/expr
match value of expr against regexp (an explicit string constant)
store values of parenthesized sub-regexps into variables var1, …, varn respectively
Typing:- Requires: var :
strvar1 :str… varn :str
Error messages:
"duplicate variablevariin split regex"
variappears twice or more in list of variables var1, …, varn
- Requires: var :