-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpuncta.ebnf
More file actions
35 lines (29 loc) · 1.27 KB
/
puncta.ebnf
File metadata and controls
35 lines (29 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
program = { statement } ;
statement = assign_stmt
| action_stmt
| label_stmt
| jump_stmt
| cjump_stmt
;
assign_stmt = variable, ",", rvalue, "." ;
action_stmt = variable, ",", action, "!", [ "@", rvalue, "." ] ;
label_stmt = label, [ "#" ], ":" ;
jump_stmt = label, [ "#" ], ";" ;
cjump_stmt = variable, ",", rvalue, "?", jump_stmt ;
variable = identifier ;
action = identifier ;
label = identifier ;
rvalue = identifier | literal ;
identifier = (letter | "_" ), { letter | digit | "_" } ;
literal = decimal_number
| hexadecimal_number
| string
;
decimal_number = [ "+" | "-" ], digit, { digit }, [ ".", { digit } ] ;
hexadecimal_number = "0", ( "x" | "X" ), hex_digit, { hex_digit } ;
string = "\"", { character - "\"" - "\\" | escape_sequence }, "\"" ;
letter = "a" ... "z" | "A" ... "Z" ;
digit = "0" ... "9" ;
hex_digit = digit | "a" ... "f" | "A" ... "F" ;
escape_sequence = "\\", ( "a" | "b" | "t" | "n" | "v" | "f" | "r" | "\"" | "\\" | "0" ) ;
character = " " ... "~" ;