Name Last modified Size Description Parent Directory - x64/ 2017-10-21 11:11 - README.html 2021-01-24 09:03 1.2K Linux/ 2017-10-21 11:11 -
Here lies the PL0 compiler and interpreter from N. E. Wirth's Algorithms + Data Structures = Programs (1976). It is does not include changes from the 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 . ident = letter {letter | digit} number = digit {digit} letter = { "a" | ... | "z" | "A" | ... | "Z" } digit = { "0" | ... | "9" } 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 ")".