blob: 04beb5a3d9ba2507ad5092c19d0ad6dd0d05facf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
Digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" .
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".
Identifier = Letter { Letter | Digit } .
Number = Digit { Digit } .
Constant = Number .
Factor = Constant | VariableName | "(" Expression ")" .
Term = Factor { ( "*" | "/" ) Factor } .
Expression = [ "+" | "-" ] Term { ( "+" | "-" ) Term } .
VariableName = Identifier .
Assignment = VariableName ":=" Expression .
StatementList = Statement { ";" Statement }
IfStatement = "if" Condition "do" StatementList "else" StatementList "end" .
Statement = Assignment | IfStatement .
StatementBlock = "begin" StatementList "end" .
VariableDeclaration = Identifier ":" Type .
DeclarationBlock = "VAR" VariableDeclaration { ";" VariableDeclaration } .
Module = "module" Identifier ";" DeclarationBlock StatementBlock .
|