Statements

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: if expr then statement1 [else statement2];
    if expr is true, then execute statement1;
    else, if else branch is present, execute statement2
    Typing:

    • Requires: expr : int

 

  • split regex: split regexp /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 : str var1 : strvarn : str

    Error messages:

    • "duplicate variable vari in split regex"
      vari appears twice or more in list of variables var1, …, varn