The syntax diagrams in this section are more complete and expand upon those given in the body of the text. They are intended as visual aids to understanding the correct structure of Modula-2 programming constructions, but they do not constitute an official or complete definition of the language. For that, see the Modula-2 Draft Standard.
identifier
identifier list
constant literal
numeric literal whole number literal
decimal number digit
octal digit octal number
real literal
scale factor
The numbering in this section (after the A2.2) corresponds to that of the Modula-2 ISO Standard Annex C.
compilation module
program module
module identifier protection
protection expression
definition module
implementation module
import lists
import list
simple import
unqualified import
export list
unqualified export
qualified export
qualified identifier
definitions
definition
procedure heading
type definition opaque type definition
proper procedure heading
formal parameters
formal parameter list
function procedure heading
function result type
formal parameter
value parameter specification
variable parameter specification
declarations
declaration
constant declaration
type declaration
variable declaration
variable identifier list
machine address value of address type
procedure declaration
proper procedure declarations
procedure identifier
function procedure declaration
local module declaration
type denoter ordinal type denoter
type identifier ordinal type identifier
new type new ordinal type
enumeration type identifier list
subrange type
range type
set type
base type
packedset type
pointer type
bound type
procedure type
proper procedure type
function procedure type
formal parameter type list formal parameter type
variable formal type value formal type
formal type
open array formal type
array type
index type component type
record type
field list fields
fixed fields
field type
variant fields
tag identifier tag type
variant list
variant else part
variant
variant label list
variant label
proper procedure block
procedure body
function procedure block
function body
module block
module body
initialization body
finalization body
block body
normal part exceptional part
statement
statement sequence
empty statement
assignment statement
procedure call
procedure designator
return statement
simple return statement
function return statement
retry statement
with statement
record designator
if statement
guarded statements
if else part boolean expression
case statement
case selector
case list
case else part
case alternative
case label list
case label
while statment
repeat statment
loop statement
exit statement
control variable identifier initial value
final value step size
variable designator
entire designator
indexed designator
array variable designator index expression
selected designator
record variable designator field identifier
dereferenced designator pointer variable designator
expression
simple expression
term
factor
ordinal expression
relational operator term operator
factor operator
value designator
entire value
indexed value
array value
selected value
record value
dereferenced value pointer value
function call
function designator
value constructor
array constructor
array type identifier
array constructed value
repeated structure component
repetition factor
structure component
record constructor
record type identifier
record constructed value
set constructor
set type identifier
set constructed value member
interval
singleton
constant literal
constant expression
actual parameters
actual parameter list actual parameter
type parameter