Contents | Prev | Next | Index


Statements

Statements cause program execution. They often appear in a statement sequence, where they are executed in sequential order. There are two kinds of statements:

Elementary statements:
Assignment
Procedure call
EXIT
Return statement
Structured statements:
If statement
Case statement
While statement
Repeat statement
For statement
Loop statement
With statement

Elementary statements are not composed of any parts that are themselves statements. Structured statements, however, are composed of parts that are themselves statements. They are used to express sequencing and conditional, selective and repetitive execution. A statement may also be empty, in which case it does nothing. The empty statement is only included in order to relax punctuation rules in statement sequences.

stmt_seq ::= stmt_seq ; stmt
         ::= stmt
stmt     ::= assignment
         ::= procedure_call
         ::= if_stmt
         ::= case_stmt
         ::= while_stmt
         ::= repeat_stmt
         ::= for_stmt
         ::= loop_stmt
         ::= guard_stmt
         ::= EXIT
         ::= return_stmt
         ::= <empty>


Contents | Prev | Next | Index

Canterbury Oberon-2 for Java  (Last documentation update Feb 8, 2000)
Copyright © 1998 Mill Hill & Canterbury Corporation, Ltd. All rights reserved
Please send any comments or corrections to mhc@webcom.com