mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-python
synced 2026-01-15 09:53:32 +01:00
Continue implementation of grammar.py
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
5b76358238
commit
40e6add5ad
6 changed files with 366 additions and 44 deletions
16
test/grammar/grammartest-input.ebnf
Normal file
16
test/grammar/grammartest-input.ebnf
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
(* 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 ? ;
|
||||
Loading…
Add table
Add a link
Reference in a new issue