-
Notifications
You must be signed in to change notification settings - Fork 0
/
language.txt
28 lines (21 loc) · 1.01 KB
/
language.txt
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
<program> ::= "" | <program> <statement>
<statement> ::= @ <identifier> <type> | > <identifier> | < <expr> | <function> | <identifier> := <expr> | on <shortcut_head> <shortcut_body>
<type>::= string | number
//TODO shortcut name should be unique
//TODO modes and keys should be the sdame thing , abstract modes away from lang to windows impl
<shortcut_head> ::= <modes> <key> <shortcut_flag> : <identifier>
<shortcut_body> ::= { <parsed_program> }
<modes> ::= <mode_val> | <mode_val> <modes>
<mode_val> ::= alt | ctrl | shift
//TODO add more keys
<key>::= <letter> | <digit>
<shortcut_flag> ::= "" | on_hold_repeat
<function> ::= open <expr>
<args> ::= <expr> | <args> <expr>
<expr> ::= <term> | <expr> + <term> | <expr> - <term>
<term> ::= <factor> | <term> \* <factor> | <term> / <factor>
<factor> ::= <identifier> | <literal> | ( <expr> )
<literal> ::= ”<string>” | <double>
<string>::= <letter> | <string> <letter>
<identifier> := <letter> | <identifier> <letter>
primitives : <letter> , <double> , <digit>