Open Source Macintosh Pascal Compiler Project

  
Conventions
These are the BNF (Backus-Naur Form) to be implemented in Open Source Mac Pascal. Remember :

the '|' indicates a choice
the '*' indicates zero or more occurences of the terms in brackets
the '+' indicates one or more occurences of the terms in brackets
   
BNFs
<letter>
::= a | b | c | d | e | f | g | h | i | j | k | l | m |
n | o | p | q | r | s | t | u | v | w | x |y | z |
A | B | C | D | E | F | G | H | I | J | K | L | M |
N | O | P | Q | R | S | T | U | V | W | X | Y | Z
<digit> ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
<ident> ::= <letter> [ <letter> | <digit> ]*

<number> ::= [<digit>]+
 
<program> ::= <program-header> <block> '.'
<program-header> ::= PROGRAM <ident>
<block> ::= <declarations> <statements>
<declarations> 
::=
( 
 <label list>    |
 <constant list> |
 <type list>     |
 <variable list> |
 <procedure>     |
 <function> 
)* 
<statements> 
::=
<compound statement>
<compound statement>
::=
BEGIN 
 (<statement> ';')*
END
<statement>
::=
<simple statement> | <structured statement>
<simple statement>
::=
<compound statement> |
<if statement>       |
<case statement>     |
<while statement>    |       
<repeat statement>   |
<for statement>      |
<with statement>
  
Web page setup ©1999 Patrick Iglesias