commit
message
[ParserConstants] starting to enumerate states
author
Ben Vogt <[email protected]>
date
2017-12-10 04:22:49
stats
1 file(s) changed,
24 insertions(+),
40 deletions(-)
files
src/Parser/ParserConstants.ts
1diff --git a/src/Parser/ParserConstants.ts b/src/Parser/ParserConstants.ts
2index a30ed50..19b5d1d 100644
3--- a/src/Parser/ParserConstants.ts
4+++ b/src/Parser/ParserConstants.ts
5@@ -377,7 +377,8 @@ const SYMBOL_INDEX_TO_NAME = symbolIndexToName;
6
7
8 const enum State {
9- START = 0
10+ START = 0,
11+ START_NUMBER = 6
12 }
13
14
15@@ -395,7 +396,7 @@ table[State.START] = ObjectBuilder
16 .add(Symbol.VARIABLE_SEQUENCE, 3)
17 .add(Symbol.TIME_AMPM, [SHIFT, 4])
18 .add(Symbol.TIME_24, [SHIFT, 5])
19- .add(Symbol.NUMBER, 6)
20+ .add(Symbol.NUMBER, State.START_NUMBER)
21 .add(Symbol.STRING, [SHIFT, 7])
22 .add(Symbol.PLUS, [SHIFT, 10])
23 .add(Symbol.LEFT_PAREN, [SHIFT, 8])
24@@ -409,7 +410,7 @@ table[State.START] = ObjectBuilder
25 .add(Symbol.POUND, [SHIFT, 18])
26 .build();
27 table[1] = ObjectBuilder
28- .add(Symbol.END, [3])
29+ .add(Symbol.END, [ACCEPT])
30 .build();
31 table[2] = ObjectBuilder
32 .add(Symbol.EOF, [SHIFT, 19])
33@@ -441,23 +442,6 @@ table[3] = ObjectBuilder
34 .add(Symbol.COMMA, [REDUCE, ReduceActions.CALL_VARIABLE])
35 .add(33, [SHIFT, ReduceActions.CELL_VALUE])
36 .build();
37-table[3] = ObjectBuilder
38- .add(Symbol.EOF, [REDUCE, ReduceActions.CALL_VARIABLE])
39- .add(Symbol.AMPERSAND, [REDUCE, ReduceActions.CALL_VARIABLE])
40- .add(Symbol.EQUALS, [REDUCE, ReduceActions.CALL_VARIABLE])
41- .add(Symbol.PLUS, [REDUCE, ReduceActions.CALL_VARIABLE])
42- .add(Symbol.RIGHT_PAREN, [REDUCE, ReduceActions.CALL_VARIABLE])
43- .add(Symbol.LESS_THAN, [REDUCE, ReduceActions.CALL_VARIABLE])
44- .add(Symbol.GREATER_THAN, [REDUCE, ReduceActions.CALL_VARIABLE])
45- .add(Symbol.NOT, [REDUCE, ReduceActions.CALL_VARIABLE])
46- .add(Symbol.MINUS, [REDUCE, ReduceActions.CALL_VARIABLE])
47- .add(Symbol.ASTERISK, [REDUCE, ReduceActions.CALL_VARIABLE])
48- .add(Symbol.DIVIDE, [REDUCE, ReduceActions.CALL_VARIABLE])
49- .add(Symbol.CARROT, [REDUCE, ReduceActions.CALL_VARIABLE])
50- .add(Symbol.SEMI_COLON, [REDUCE, ReduceActions.CALL_VARIABLE])
51- .add(Symbol.COMMA, [REDUCE, ReduceActions.CALL_VARIABLE])
52- .add(33, [SHIFT, ReduceActions.CELL_VALUE])
53- .build();
54 table[4] = ObjectBuilder
55 .add(Symbol.EOF, [REDUCE, ReduceActions.TIME_CALL_TRUE])
56 .add(Symbol.AMPERSAND, [REDUCE, ReduceActions.TIME_CALL_TRUE])
57@@ -490,7 +474,7 @@ table[5] = ObjectBuilder
58 .add(Symbol.SEMI_COLON, [REDUCE, ReduceActions.TIME_CALL])
59 .add(Symbol.COMMA, [REDUCE, ReduceActions.TIME_CALL])
60 .build();
61-table[6] = ObjectBuilder
62+table[State.START_NUMBER] = ObjectBuilder
63 .add(Symbol.EOF, [REDUCE, ReduceActions.AS_NUMBER])
64 .add(Symbol.AMPERSAND, [REDUCE, ReduceActions.AS_NUMBER])
65 .add(Symbol.EQUALS, [REDUCE, ReduceActions.AS_NUMBER])
66@@ -529,7 +513,7 @@ table[8] = ObjectBuilder
67 .add(Symbol.VARIABLE_SEQUENCE, 3)
68 .add(Symbol.TIME_AMPM, [SHIFT, 4])
69 .add(Symbol.TIME_24, [SHIFT, 5])
70- .add(Symbol.NUMBER, 6)
71+ .add(Symbol.NUMBER, State.START_NUMBER)
72 .add(Symbol.STRING, [SHIFT, 7])
73 .add(Symbol.PLUS, [SHIFT, 10])
74 .add(Symbol.LEFT_PAREN, [SHIFT, 8])
75@@ -548,7 +532,7 @@ table[9] = ObjectBuilder
76 .add(Symbol.VARIABLE_SEQUENCE, 3)
77 .add(Symbol.TIME_AMPM, [SHIFT, 4])
78 .add(Symbol.TIME_24, [SHIFT, 5])
79- .add(Symbol.NUMBER, 6)
80+ .add(Symbol.NUMBER, State.START_NUMBER)
81 .add(Symbol.STRING, [SHIFT, 7])
82 .add(Symbol.PLUS, [SHIFT, 10])
83 .add(Symbol.LEFT_PAREN, [SHIFT, 8])
84@@ -567,7 +551,7 @@ table[10] = ObjectBuilder
85 .add(Symbol.VARIABLE_SEQUENCE, 3)
86 .add(Symbol.TIME_AMPM, [SHIFT, 4])
87 .add(Symbol.TIME_24, [SHIFT, 5])
88- .add(Symbol.NUMBER, 6)
89+ .add(Symbol.NUMBER, State.START_NUMBER)
90 .add(Symbol.STRING, [SHIFT, 7])
91 .add(Symbol.PLUS, [SHIFT, 10])
92 .add(Symbol.LEFT_PAREN, [SHIFT, 8])
93@@ -704,7 +688,7 @@ table[20] = ObjectBuilder
94 .add(Symbol.VARIABLE_SEQUENCE, 3)
95 .add(Symbol.TIME_AMPM, [SHIFT, 4])
96 .add(Symbol.TIME_24, [SHIFT, 5])
97- .add(Symbol.NUMBER, 6)
98+ .add(Symbol.NUMBER, State.START_NUMBER)
99 .add(Symbol.STRING, [SHIFT, 7])
100 .add(Symbol.PLUS, [SHIFT, 10])
101 .add(Symbol.LEFT_PAREN, [SHIFT, 8])
102@@ -723,7 +707,7 @@ table[21] = ObjectBuilder
103 .add(Symbol.VARIABLE_SEQUENCE, 3)
104 .add(Symbol.TIME_AMPM, [SHIFT, 4])
105 .add(Symbol.TIME_24, [SHIFT, 5])
106- .add(Symbol.NUMBER, 6)
107+ .add(Symbol.NUMBER, State.START_NUMBER)
108 .add(Symbol.STRING, [SHIFT, 7])
109 .add(Symbol.PLUS, [SHIFT, 10])
110 .add(Symbol.LEFT_PAREN, [SHIFT, 8])
111@@ -742,7 +726,7 @@ table[22] = ObjectBuilder
112 .add(Symbol.VARIABLE_SEQUENCE, 3)
113 .add(Symbol.TIME_AMPM, [SHIFT, 4])
114 .add(Symbol.TIME_24, [SHIFT, 5])
115- .add(Symbol.NUMBER, 6)
116+ .add(Symbol.NUMBER, State.START_NUMBER)
117 .add(Symbol.STRING, [SHIFT, 7])
118 .add(Symbol.PLUS, [SHIFT, 10])
119 .add(Symbol.LEFT_PAREN, [SHIFT, 8])
120@@ -761,7 +745,7 @@ table[23] = ObjectBuilder
121 .add(Symbol.VARIABLE_SEQUENCE, 3)
122 .add(Symbol.TIME_AMPM, [SHIFT, 4])
123 .add(Symbol.TIME_24, [SHIFT, 5])
124- .add(Symbol.NUMBER, 6)
125+ .add(Symbol.NUMBER, State.START_NUMBER)
126 .add(Symbol.STRING, [SHIFT, 7])
127 .add(Symbol.EQUALS, [SHIFT, 46])
128 .add(Symbol.PLUS, [SHIFT, 10])
129@@ -782,7 +766,7 @@ table[24] = ObjectBuilder
130 .add(Symbol.VARIABLE_SEQUENCE, 3)
131 .add(Symbol.TIME_AMPM, [SHIFT, 4])
132 .add(Symbol.TIME_24, [SHIFT, 5])
133- .add(Symbol.NUMBER, 6)
134+ .add(Symbol.NUMBER, State.START_NUMBER)
135 .add(Symbol.STRING, [SHIFT, 7])
136 .add(Symbol.EQUALS, [SHIFT, 49])
137 .add(Symbol.PLUS, [SHIFT, 10])
138@@ -802,7 +786,7 @@ table[25] = ObjectBuilder
139 .add(Symbol.VARIABLE_SEQUENCE, 3)
140 .add(Symbol.TIME_AMPM, [SHIFT, 4])
141 .add(Symbol.TIME_24, [SHIFT, 5])
142- .add(Symbol.NUMBER, 6)
143+ .add(Symbol.NUMBER, State.START_NUMBER)
144 .add(Symbol.STRING, [SHIFT, 7])
145 .add(Symbol.PLUS, [SHIFT, 10])
146 .add(Symbol.LEFT_PAREN, [SHIFT, 8])
147@@ -821,7 +805,7 @@ table[26] = ObjectBuilder
148 .add(Symbol.VARIABLE_SEQUENCE, 3)
149 .add(Symbol.TIME_AMPM, [SHIFT, 4])
150 .add(Symbol.TIME_24, [SHIFT, 5])
151- .add(Symbol.NUMBER, 6)
152+ .add(Symbol.NUMBER, State.START_NUMBER)
153 .add(Symbol.STRING, [SHIFT, 7])
154 .add(Symbol.PLUS, [SHIFT, 10])
155 .add(Symbol.LEFT_PAREN, [SHIFT, 8])
156@@ -840,7 +824,7 @@ table[27] = ObjectBuilder
157 .add(Symbol.VARIABLE_SEQUENCE, 3)
158 .add(Symbol.TIME_AMPM, [SHIFT, 4])
159 .add(Symbol.TIME_24, [SHIFT, 5])
160- .add(Symbol.NUMBER, 6)
161+ .add(Symbol.NUMBER, State.START_NUMBER)
162 .add(Symbol.STRING, [SHIFT, 7])
163 .add(Symbol.PLUS, [SHIFT, 10])
164 .add(Symbol.LEFT_PAREN, [SHIFT, 8])
165@@ -859,7 +843,7 @@ table[28] = ObjectBuilder
166 .add(Symbol.VARIABLE_SEQUENCE, 3)
167 .add(Symbol.TIME_AMPM, [SHIFT, 4])
168 .add(Symbol.TIME_24, [SHIFT, 5])
169- .add(Symbol.NUMBER, 6)
170+ .add(Symbol.NUMBER, State.START_NUMBER)
171 .add(Symbol.STRING, [SHIFT, 7])
172 .add(Symbol.PLUS, [SHIFT, 10])
173 .add(Symbol.LEFT_PAREN, [SHIFT, 8])
174@@ -878,7 +862,7 @@ table[29] = ObjectBuilder
175 .add(Symbol.VARIABLE_SEQUENCE, 3)
176 .add(Symbol.TIME_AMPM, [SHIFT, 4])
177 .add(Symbol.TIME_24, [SHIFT, 5])
178- .add(Symbol.NUMBER, 6)
179+ .add(Symbol.NUMBER, State.START_NUMBER)
180 .add(Symbol.STRING, [SHIFT, 7])
181 .add(Symbol.PLUS, [SHIFT, 10])
182 .add(Symbol.LEFT_PAREN, [SHIFT, 8])
183@@ -963,7 +947,7 @@ table[35] = ObjectBuilder
184 .add(Symbol.VARIABLE_SEQUENCE, 3)
185 .add(Symbol.TIME_AMPM, [SHIFT, 4])
186 .add(Symbol.TIME_24, [SHIFT, 5])
187- .add(Symbol.NUMBER, 6)
188+ .add(Symbol.NUMBER, State.START_NUMBER)
189 .add(Symbol.STRING, [SHIFT, 7])
190 .add(Symbol.PLUS, [SHIFT, 10])
191 .add(Symbol.LEFT_PAREN, [SHIFT, 8])
192@@ -1067,7 +1051,7 @@ table[46] = ObjectBuilder
193 .add(Symbol.VARIABLE_SEQUENCE, 3)
194 .add(Symbol.TIME_AMPM, [SHIFT, 4])
195 .add(Symbol.TIME_24, [SHIFT, 5])
196- .add(Symbol.NUMBER, 6)
197+ .add(Symbol.NUMBER, State.START_NUMBER)
198 .add(Symbol.STRING, [SHIFT, 7])
199 .add(Symbol.PLUS, [SHIFT, 10])
200 .add(Symbol.LEFT_PAREN, [SHIFT, 8])
201@@ -1086,7 +1070,7 @@ table[47] = ObjectBuilder
202 .add(Symbol.VARIABLE_SEQUENCE, 3)
203 .add(Symbol.TIME_AMPM, [SHIFT, 4])
204 .add(Symbol.TIME_24, [SHIFT, 5])
205- .add(Symbol.NUMBER, 6)
206+ .add(Symbol.NUMBER, State.START_NUMBER)
207 .add(Symbol.STRING, [SHIFT, 7])
208 .add(Symbol.PLUS, [SHIFT, 10])
209 .add(Symbol.LEFT_PAREN, [SHIFT, 8])
210@@ -1121,7 +1105,7 @@ table[49] = ObjectBuilder
211 .add(Symbol.VARIABLE_SEQUENCE, 3)
212 .add(Symbol.TIME_AMPM, [SHIFT, 4])
213 .add(Symbol.TIME_24, [SHIFT, 5])
214- .add(Symbol.NUMBER, 6)
215+ .add(Symbol.NUMBER, State.START_NUMBER)
216 .add(Symbol.STRING, [SHIFT, 7])
217 .add(Symbol.PLUS, [SHIFT, 10])
218 .add(Symbol.LEFT_PAREN, [SHIFT, 8])
219@@ -1439,7 +1423,7 @@ table[71] = ObjectBuilder
220 .add(Symbol.VARIABLE_SEQUENCE, 3)
221 .add(Symbol.TIME_AMPM, [SHIFT, 4])
222 .add(Symbol.TIME_24, [SHIFT, 5])
223- .add(Symbol.NUMBER, 6)
224+ .add(Symbol.NUMBER, State.START_NUMBER)
225 .add(Symbol.STRING, [SHIFT, 7])
226 .add(Symbol.EQUALS, [SHIFT, 21])
227 .add(Symbol.PLUS, [SHIFT, 10])
228@@ -1459,7 +1443,7 @@ table[72] = ObjectBuilder
229 .add(Symbol.VARIABLE_SEQUENCE, 3)
230 .add(Symbol.TIME_AMPM, [SHIFT, 4])
231 .add(Symbol.TIME_24, [SHIFT, 5])
232- .add(Symbol.NUMBER, 6)
233+ .add(Symbol.NUMBER, State.START_NUMBER)
234 .add(Symbol.STRING, [SHIFT, 7])
235 .add(Symbol.EQUALS, [SHIFT, 21])
236 .add(Symbol.PLUS, [SHIFT, 10])