-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexp.cfg
29 lines (25 loc) · 901 Bytes
/
exp.cfg
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
TOP = _ {EXP} _ ;
.EXP = {EXP_2} | {EQUALS} | {LESS} | {LEQ} | {NEQ} | {GREATER} | {GEQ};
.EXP_2 = {EXP_3} | {SUM};
.EXP_3 = {EXP_4} | {PROD};
.EXP_4 = {EXP_5} | {MINUS};
.EXP_5 = {UNIT} | {INT} | {CHAR} | {STR} | \( _ {EXP} _ \) | {VAR} | {LEN} | {GETCHAR} | {ATOI};
EQUALS = {EXP_2} _ \= _ {EXP_2};
NEQ = {EXP_2} _ \!\= _ {EXP_2};
LESS = {EXP_2} _ \< _ {EXP_2};
LEQ = {EXP_2} _ \<\= _ {EXP_2};
GREATER = {EXP_2} _ \> _ {EXP_2};
GEQ = {EXP_2} _ \>\= _ {EXP_2};
SUM = {EXP_3}( _ (\+ _ {EXP_3} | {MINUS}))+;
PROD = {EXP_4}( _ \* _ {EXP_4})+;
MINUS = \- _ {EXP_5};
NOT = \! _ {EXP_5};
GETCHAR = {EXP} _ \[ _ {EXP} _ \];
LEN = len _ \( _ {EXP} _ \);
ATOI = int _ \( _ {EXP} _ \);
UNIT = \(\);
INT = $(\d+);
CHAR = \'{EC}\';
STR = \"{EC}*\";
EC = $(\w | \\.);
VAR = $(\a(\w | \_)*);