Contents | Prev | Next | Index


Syntax

Throughout most of this documentation (except for the section about Vocabulary and Representation), language constructs are being described using a notation which is a kind of simplified Backus-Naur Formalism (EBNF).

The "::=" stands for "is defined as" or "is a production of".

Alternatives are expressed by repeated productions. Example:

  decl           ::= CONST const_decl_list
                 ::= VAR var_decl_list
                 ::= TYPE type_decl_list

Non-empty lists are always described by stating 2 production rules, the first one being the list, the second one being the list start. Example: A "stmt_seq" is a list of "stmt" separated by ";":

  stmt_seq       ::= stmt_seq ; stmt
                 ::= stmt

A possibly empty list is always described by 2 production rules, the first one being the list, the second one refering to the initially empty list. Example: A "var_decl_list" is a (possibly empty) list of "var_decl" separated by ";".

  var_decl_list  ::= var_decl_list var_decl ;
                 ::= <empty>

A Pascal compilation unit is a series of tokens. There are 2 kind of tokens: terminals and non-terminals. Non-terminal tokens can be broken down into terminal tokens. Terminal tokens are Pascal keywords (shown in capital letters), constants (shown here in "<>" brackets), and special signs. The token <empty> stands for the empty production.


Contents | Prev | Next | Index

Canterbury Pascal for JVM  (Last documentation update Sep 02, 2004)
Copyright © 1999-2004 J.Neuhoff - mhccorp.com  . All rights reserved.
Please send any comments or corrections to neuhoff@mhccorp.com