BNF of the Modula-2 Programming Language
Each element of this page is an anchor to a description of a syntax rule
of the Modula 2 language. Each rule
is illustrated by a graphical syntactic diagram.
The rule names and non-terminal names are extracted from
"Programming in Modula-2" Niklaus Wirth, Springer-Verlag eds., Berlin, 1983.
The rules are listed below
in their order of appearance in the above manual.
[What is BNF?]
[other languages BNF]
[credits & contributors]
Some interesting starting points to explore the language:
Compilation (root of the syntax)
Declarations
Expressions
[index on key words]
[index on special characters]
- identifier_letter
- upper_case_letter
- lower_case_letter
- ident
- qualident
- number
- integer
- real
- scale_factor
- hexdigit
- digit
- octaldigit
- string
- comment
- constant_declaration
- const_expression
- simple_const_expr
- const_term
- const_factor
- set
- element
- type_declaration
- type
- simple_type
- enumeration
- subrange_type
- array_type
- record_type
- field_list
- variant
- case_labels
- set_type
- pointer_type
- procedure_type
- variable_declaration
- designator
- expression
- simple_expression
- term
- factor
- statement
- assignment
- procedure_call
- statement_sequence
- if_statement
- case_statement
- case
- while_statement
- repeat_statement
- for_statement
- loop_statement
- with_statement
- procedure_declaration
- procedure_heading
- block
- declaration
- formal_parameters
- fp_section
- formal_type
- module_declaration
- priority
- export
- import
- definition_module
- definition
- program_module
- implementation_module
- compilation_unit
Credits & Contributors
This document and the syntactic diagrams were generated by "HyperGOS", a syntactic
tools generator, developped at the University of Geneva by Jacques Guyot,
Thibault Estier and Pascal Crausaz. HyperGOS is derived from GOS, a generic
tool "a la Lex & Yacc", initialy developped by Jacques Guyot (some 15 years
ago...) and extended since in many directions by many, many contributors, here
at University of Geneva. The automatic diagram layout program
was originally written by NGuyen Lai in 1981.
© 1994-1995 Th. Estier Geneva / estier@cui.unige.ch
Jacques Guyot | guyot@cui.unige.ch