Contents | Prev | Next | Index


With Statements

The purpose of a with statement is to specifiy a record designator for a statement sequence. In these statements the qualification of field identifiers may be omitted if they are to refer to the variable specified in the with clause. The with statement opens a new scope.

This compiler also allows an Oberon-2 style regional type guard when the language extensions are enabled via a compiler switch or directive. The purpose of a regional type guard is to execute a statement sequence depending on the result of a type test. The type guard is applied to every occurence of the tested variable within this statement sequence. Notice that in this statement sequence the qualification of record field identifiers for the regional type guard designator may not be omitted.

In the following grammar the language extensions are shown in red:

with_stmt      ::= WITH rec_designator DO stmt_seq END
rec_designator ::= designator
               ::= qualident : qualident


Contents | Prev | Next | Index

Canterbury Modula-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