17 lines
834 B
EBNF
17 lines
834 B
EBNF
|
(* a simple program 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 ? ;
|