Index of /dee/PL0

Name                    Last modified      Size  Description
Parent Directory                             -   
x64/                    2017-10-21 17:11    -   
Linux/                  2017-10-21 17:11    -   
README.html             2019-07-31 12:05  1.2K  

Here lies the PL0 compiler and interpreter from N. E. Wirth's Algorithms + Data Structures = Programs (1976). It is does not include later additions from various editions of Compilerbau. Binaries are 64-bit only. Following is the EBNF (described on pages 299-300) syntax for PL0, based on the syntax diagrams of figure 5.4 (pages 308-310), essentially exercise 5.5.:

program = block "." .
 
block = [ "const" ident "=" number {"," ident "=" number} ";"]
        [ "var" ident {"," ident} ";"]
        { "procedure" ident ";" block ";" } statement .
 
statement = [ ident ":=" expression | "call" ident 
              | "?" ident | "!" expression 
              | "begin" statement {";" statement } "end" 
              | "if" condition "then" statement 
              | "while" condition "do" statement ].
 
condition = "odd" expression |
            expression ("="|"#"|"<"|"<="|">"|">=") expression .
 
expression = [ "+"|"-"] term { ("+"|"-") term}.
 
term = factor {("*"|"/") factor}.
 
factor = ident | number | "(" expression ")".

Thanks to Hans Otten for making this easy.