mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-python
synced 2026-01-15 18:03:31 +01:00
16 lines
849 B
EBNF
16 lines
849 B
EBNF
(* a simple program syntax in EBNF − Wikipedia *)
|
||
program = 'PROGRAM', white space, identifier, white space,
|
||
'BEGIN', white space,
|
||
{ assignment, ";", white space },
|
||
'END.' ;
|
||
identifier = alphabetic character, { alphabetic character | digit } ;
|
||
number = [ "-" ], digit, { digit } ;
|
||
string = '"' , { all characters - '"' }, '"' ;
|
||
assignment = identifier , ":=" , ( number | identifier | string ) ;
|
||
alphabetic character = "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" ;
|
||
white space = ? white space characters ? ;
|
||
all characters = ? all visible characters ? ;
|