-
Notifications
You must be signed in to change notification settings - Fork 1
/
syntax.ebnf
22 lines (22 loc) · 916 Bytes
/
syntax.ebnf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
statement = function, "(", arguments, ")", ";";
function = identifier;
arguments = argument, {",", argument};
argument = twotuple | str_lit | num_expr;
twotuple = "(", (str_lit | num_expr), ")";
str_lit = ('"' | "'"), { char_alphanum | char_special }, ('"' | "'");
num_expr = (num_literal | "pi" | "e"), num_operator;
num_operator = "+" | "-" | "*" | "/";
num_literal = ["-"], digit, {digit};
identifier = char_alpha, { char_alphanum | char_special };
char_alphanum = char_alpha | digit;
digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9";
char_alpha =
"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" ;
char_special = "_" | "-";