Skip to content

Commit c1a7a55

Browse files
committed
work in progress
1 parent 7950ef4 commit c1a7a55

7 files changed

+510
-49
lines changed

grammar/bindable-trie-analysis.txt

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
Trie Analysis for Bindable Identifiers
2+
3+
Length = 4
4+
5+
L|A|S|T
6+
N|E|X|T
7+
P|R|E|V
8+
9+
0|0|0|1
10+
*
11+
12+
Length = 5
13+
14+
A|L|L|O|C
15+
C|O|U|N|T
16+
F|I|R|S|T
17+
S|T|D|I|N
18+
S|T|O|R|E
19+
V|A|L|U|E
20+
21+
1|1|1|0|2
22+
*
23+
24+
LENGTH = 6
25+
26+
T|L|I|M|I|T
27+
A|P|P|E|N|D
28+
L|E|N|G|T|H
29+
R|E|M|O|V|E
30+
S|T|D|O|U|T
31+
32+
0|1|0|1|0|1
33+
*
34+
35+
LENGTH = 7
36+
37+
A|T|S|T|O|R|E
38+
A|T|V|A|L|U|E
39+
D|E|A|L|L|O|C
40+
41+
1|1|0|0|1|0|1
42+
*
43+
44+
LENGTH = 8
45+
46+
A|T|I|N|S|E|R|T
47+
A|T|R|E|M|O|V|E
48+
49+
1|1|0|0|0|0|0|0
50+
*
51+
52+
LENGTH = 9
53+
54+
C|O|L|L|A|T|I|O|N
55+
56+
0|0|0|0|0|0|0|0|0
57+
*
58+

grammar/m2c-grammar.gll

+14-16
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,12 @@ constDefinition :=
9292
/* Constant Binding */
9393

9494
constBinding :=
95-
'[' bindableIdent ']'
95+
'[' constBindableIdent ']'
9696
;
9797

98-
/* Bindable Identifier */
98+
/* Constant Bindable Identifier */
9999

100-
.bindableIdent := Pervasive | Primitive ;
101-
102-
/* Constant bindable identifiers: COLLATION, TLIMIT */
100+
.constBindableIdent := Ident=("COLLATION" | "TLIMIT") ;
103101

104102

105103
/* Simple Constant Definition */
@@ -336,22 +334,22 @@ procBinding :=
336334
/* Binding Specifier */
337335

338336
.bindingSpecifier :=
339-
NEW ( argListFlag | capacityFlag )? | RETAIN | RELEASE |
340-
READ allocFlag? | WRITE formatFlag? | bindableIdent
337+
NEW ( ARGLIST | Ident=CAPACITY )? | RETAIN | RELEASE |
338+
READ NEW? | WRITE formatFlag? | procBindableIdent
341339
;
342340

343-
/* Flags */
344-
345-
alias argListFlag = '+' ;
346-
347-
alias capacityFlag = '*' ;
348-
349-
alias allocFlag = '*' ;
341+
/* Format Flag */
350342

351343
alias formatFlag = '#' ;
352344

353-
/* Procedure bindable identifiers:
354-
APPEND, INSERT, REMOVE, COUNT, LENGTH, and all primitives */
345+
/* Procedure bindable identifiers */
346+
347+
.procBindableIdent :=
348+
Ident = (
349+
"ALLOC" | "APPEND" | "INSERT" | "ATINSERT" | "ATREMOVE" | "ATSTORE" |
350+
"ATVALUE" | "COUNT" | "DEALLOC" | "FIRST" | "LAST" | "LENGTH" | "NEXT" |
351+
"PREV" | "REMOVE" | "STDIN" | "STDOUT" | "STORE" | "SUCC" | "VALUE" )
352+
;
355353

356354

357355
/* Procedure Signature */

grammar/resid-trie-analysis.txt

+109
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
Trie Analysis for Reserved Predefined Identifiers
2+
3+
Length = 3
4+
5+
N|I|L
6+
C|H|R
7+
O|R|D
8+
O|D|D
9+
A|B|S
10+
S|G|N
11+
M|I|N
12+
M|A|X
13+
P|T|R
14+
15+
2|1|3
16+
*
17+
18+
Length = 4
19+
20+
T|R|U|E
21+
A|R|C|H
22+
C|H|A|R
23+
R|E|A|L
24+
B|Y|T|E
25+
W|O|R|D
26+
H|A|L|T
27+
C|O|D|E
28+
U|C|H|R
29+
L|O|G|2
30+
P|O|W|2
31+
P|R|E|D
32+
S|U|C|C
33+
L|A|S|T
34+
P|R|E|V
35+
N|E|X|T
36+
C|A|S|T
37+
T|M|I|N
38+
T|M|A|X
39+
40+
7|10|5|8
41+
*
42+
43+
Length = 5
44+
45+
F|A|L|S|E
46+
O|C|T|E|T
47+
C|O|U|N|T
48+
F|I|R|S|T
49+
T|S|I|Z|E
50+
V|A|L|U|E
51+
S|T|O|R|E
52+
A|L|L|O|C
53+
S|T|D|I|N
54+
55+
2|2|3|1|5
56+
*
57+
58+
Length = 6
59+
60+
A|P|P|E|N|D
61+
I|N|S|E|R|T
62+
R|E|M|O|V|E
63+
G|E|T|R|E|G
64+
S|E|T|R|E|G
65+
E|N|T|I|E|R
66+
L|E|N|G|T|H
67+
T|L|I|M|I|T
68+
S|T|D|O|U|T
69+
U|N|S|A|F|E
70+
A|T|O|M|I|C
71+
72+
2|6|3|4|3|4
73+
*
74+
75+
Length = 7
76+
77+
B|O|O|L|E|A|N
78+
U|N|I|C|H|A|R
79+
I|N|T|E|G|E|R
80+
L|O|N|G|I|N|T
81+
A|D|D|R|E|S|S
82+
A|T|V|A|L|U|E
83+
A|T|S|T|O|R|E
84+
D|E|A|L|L|O|C
85+
86+
2|3|0|1|2|1|2
87+
*
88+
89+
Length = 8
90+
91+
C|A|R|D|I|N|A|L
92+
L|O|N|G|C|A|R|D
93+
L|O|N|G|R|E|A|L
94+
L|O|N|G|W|O|R|D
95+
R|E|G|I|S|T|E|R
96+
C|A|P|A|C|I|T|Y
97+
A|T|I|N|S|E|R|T
98+
A|T|R|E|M|O|V|E
99+
100+
4|3|3|2|2|2|3|2
101+
*
102+
103+
Length = 9
104+
105+
C|O|L|L|A|T|I|O|N
106+
A|S|S|E|M|B|L|E|R
107+
108+
0|0|0|0|0|0|0|0|0
109+
*

0 commit comments

Comments
 (0)