-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathrules.c
More file actions
57 lines (54 loc) · 982 Bytes
/
Copy pathrules.c
File metadata and controls
57 lines (54 loc) · 982 Bytes
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include "rules.h"
typedef enum { rule_chain,rule_exp,rule_sexp,rule_args,rule_atom, num_grammar_rules } grammar_rules;
grammar_rule language_rules[num_grammar_rules] = {
[rule_chain] = {{
{{
RULE(exp), RULE(chain),
},2},
{{
RULE(exp),
},1},
},2, 0},
[rule_exp] = {{
{{
RULE(sexp),
},1},
{{
RULE(atom),
},1},
},2, 0},
[rule_sexp] = {{
{{
TOKEN(LPAREN), RULE(args), TOKEN(RPAREN),
},3},
{{
TOKEN(LPAREN), TOKEN(RPAREN),
},2},
},2, sem_rule_sexp, sem_action_none},
[rule_args] = {{
{{
RULE(exp), RULE(args),
},2},
{{
RULE(exp),
},1},
},2, 0},
[rule_atom] = {{
{{
SYMCHECK(IDENTIFIER,val),
},1},
{{
SYMCHECK(STRING,val),
},1},
{{
SYMCHECK(NUMBER,val),
},1},
},3, sem_rule_atom, sem_action_none},
};
char* rule_names[num_grammar_rules] = {
[rule_chain] = "chain",
[rule_exp] = "exp",
[rule_sexp] = "sexp",
[rule_args] = "args",
[rule_atom] = "atom",
};