commit
message
[ParserConstants] more renamed constants, giving some to their own files
author
Ben Vogt <[email protected]>
date
2018-02-10 00:28:07
stats
8 file(s) changed,
1669 insertions(+),
1485 deletions(-)
files
src/Parser/Parser.ts
src/Parser/ParserConstants.ts
src/Parser/ReduceActions.ts
src/Parser/ReductionPair.ts
src/Parser/RuleIndex.ts
src/Parser/Rules.ts
src/Parser/Symbols.ts
tests/Formulas/MathTest.ts
1diff --git a/src/Parser/Parser.ts b/src/Parser/Parser.ts
2index 96b407d..b051f31 100644
3--- a/src/Parser/Parser.ts
4+++ b/src/Parser/Parser.ts
5@@ -5,6 +5,18 @@ import {
6 import {
7 Formulas
8 } from "../Formulas";
9+import {
10+ Symbol
11+} from "./Symbols";
12+import {
13+ ReduceActions
14+} from "./ReduceActions";
15+import {
16+ ReductionPair
17+} from "./ReductionPair";
18+import {
19+ RuleIndex
20+} from "./RuleIndex";
21 import {
22 ACTION_TABLE,
23 RULES,
24@@ -13,11 +25,7 @@ import {
25 SHIFT,
26 SYMBOL_INDEX_TO_NAME,
27 SYMBOL_NAME_TO_INDEX,
28- PRODUCTIONS,
29- ReduceActions,
30- ReductionPair,
31- RuleIndex,
32- Symbol
33+ PRODUCTIONS
34 } from "./ParserConstants"
35 import {
36 isArray,
37@@ -62,27 +70,27 @@ let Parser = (function () {
38 const vsl = virtualStack.length - 1;
39 try {
40 switch (reduceActionToPerform) {
41- case ReduceActions.RETURN_LAST:
42+ case ReduceActions.ReturnLast:
43 return virtualStack[vsl - 1];
44- case ReduceActions.CALL_VARIABLE:
45+ case ReduceActions.CallVariable:
46 this.$ = sharedStateYY.handler.callVariable.call(this, virtualStack[vsl]);
47 break;
48- case ReduceActions.AS_NUMBER:
49+ case ReduceActions.AsNumber:
50 this.$ = TypeConverter.valueToNumber(virtualStack[vsl]);
51 break;
52- case ReduceActions.AS_STRING:
53+ case ReduceActions.AsString:
54 this.$ = string(virtualStack[vsl]);
55 break;
56- case ReduceActions.AMPERSAND:
57+ case ReduceActions.Ampersand:
58 this.$ = TypeConverter.valueToString(virtualStack[vsl - 2]) + TypeConverter.valueToString(virtualStack[vsl]);
59 break;
60- case ReduceActions.EQUALS:
61+ case ReduceActions.Equals:
62 this.$ = EQ(virtualStack[vsl - 2], virtualStack[vsl]);
63 break;
64- case ReduceActions.PLUS:
65+ case ReduceActions.Plus:
66 this.$ = SUM(virtualStack[vsl - 2], virtualStack[vsl]);
67 break;
68- case ReduceActions.LAST_NUMBER:
69+ case ReduceActions.LastNumber:
70 this.$ = TypeConverter.valueToNumber(virtualStack[vsl - 1]);
71 break;
72 case ReduceActions.LTE:
73@@ -91,7 +99,7 @@ let Parser = (function () {
74 case ReduceActions.GTE:
75 this.$ = GTE(virtualStack[vsl - 3], virtualStack[vsl]);
76 break;
77- case ReduceActions.NOT_EQ:
78+ case ReduceActions.NotEqual:
79 this.$ = !EQ(virtualStack[vsl - 3], virtualStack[vsl]);
80 break;
81 case ReduceActions.GT:
82@@ -100,56 +108,56 @@ let Parser = (function () {
83 case ReduceActions.LT:
84 this.$ = LT(virtualStack[vsl - 2], virtualStack[vsl]);
85 break;
86- case ReduceActions.MINUS:
87+ case ReduceActions.Minus:
88 this.$ = MINUS(virtualStack[vsl - 2], virtualStack[vsl]);
89 break;
90- case ReduceActions.MULTIPLY:
91+ case ReduceActions.Multiply:
92 this.$ = MULTIPLY(virtualStack[vsl - 2], virtualStack[vsl]);
93 break;
94- case ReduceActions.DIVIDE:
95+ case ReduceActions.Divide:
96 this.$ = DIVIDE(virtualStack[vsl - 2], virtualStack[vsl]);
97 break;
98- case ReduceActions.TO_POWER:
99+ case ReduceActions.ToPower:
100 this.$ = POWER(virtualStack[vsl - 2], virtualStack[vsl]);
101 break;
102- case ReduceActions.INVERT_NUM:
103+ case ReduceActions.InvertNumber:
104 this.$ = TypeConverter.valueToInvertedNumber(virtualStack[vsl]);
105 if (isNaN(this.$)) {
106 this.$ = 0;
107 }
108 break;
109- case ReduceActions.TO_NUMBER_NAN_AS_ZERO:
110+ case ReduceActions.ToNumberNANAsZero:
111 this.$ = TypeConverter.valueToNumber(virtualStack[vsl]);
112 if (isNaN(this.$)) {
113 this.$ = 0;
114 }
115 break;
116- case ReduceActions.CALL_FUNCTION_LAST_BLANK:
117+ case ReduceActions.CallFunctionLastBlank:
118 this.$ = sharedStateYY.handler.callFunction.call(this, virtualStack[vsl - 2], '');
119 break;
120- case ReduceActions.CALL_FUNCTION_LAST_TWO_IN_STACK:
121+ case ReduceActions.CallFunctionLastTwoInStack:
122 this.$ = sharedStateYY.handler.callFunction.call(this, virtualStack[vsl - 3], virtualStack[vsl - 1]);
123 break;
124- case ReduceActions.FIXED_CELL_VAL:
125+ case ReduceActions.FixedCellValue:
126 this.$ = sharedStateYY.handler.fixedCellValue(sharedStateYY.originCellId, virtualStack[vsl]);
127 break;
128- case ReduceActions.FIXED_CELL_RANGE_VAL:
129+ case ReduceActions.FixedCellRangeValue:
130 this.$ = sharedStateYY.handler.fixedCellRangeValue(sharedStateYY.originCellId, virtualStack[vsl - 2], virtualStack[vsl]);
131 break;
132- case ReduceActions.CELL_VALUE:
133+ case ReduceActions.CellValue:
134 this.$ = sharedStateYY.handler.cellValue(sharedStateYY.originCellId, virtualStack[vsl]);
135 break;
136- case ReduceActions.CELL_RANGE_VALUE:
137+ case ReduceActions.CellRangeValue:
138 this.$ = sharedStateYY.handler.cellRangeValue(sharedStateYY.originCellId, virtualStack[vsl - 2], virtualStack[vsl]);
139 break;
140- case ReduceActions.ENSURE_IS_ARRAY:
141+ case ReduceActions.EnsureIsArray:
142 if (isArray(virtualStack[vsl])) {
143 this.$ = virtualStack[vsl];
144 } else {
145 this.$ = [virtualStack[vsl]];
146 }
147 break;
148- case ReduceActions.ENSURE_YYTEXT_ARRAY:
149+ case ReduceActions.EnsureYYTextIsArray:
150 let result = [],
151 arr = eval("[" + rawValueOfReduceOriginToken + "]");
152 arr.forEach(function (item) {
153@@ -157,32 +165,32 @@ let Parser = (function () {
154 });
155 this.$ = result;
156 break;
157- case ReduceActions.REDUCE_INT:
158- case ReduceActions.REDUCE_PERCENT:
159+ case ReduceActions.ReduceInt:
160+ case ReduceActions.ReducePercent:
161 virtualStack[vsl - 2].push(virtualStack[vsl]);
162 this.$ = virtualStack[vsl - 2];
163 break;
164- case ReduceActions.WRAP_CURRENT_INDEX_TOKEN_AS_ARRAY:
165+ case ReduceActions.WrapCurrentTokenAsArray:
166 this.$ = [virtualStack[vsl]];
167 break;
168- case ReduceActions.ENSURE_LAST_TWO_IN_ARRAY_AND_PUSH:
169+ case ReduceActions.EnsureLastTwoINArrayAndPush:
170 this.$ = (isArray(virtualStack[vsl - 2]) ? virtualStack[vsl - 2] : [virtualStack[vsl - 2]]);
171 this.$.push(virtualStack[vsl]);
172 break;
173- case ReduceActions.REFLEXIVE_REDUCE:
174+ case ReduceActions.ReflexiveReduce:
175 this.$ = virtualStack[vsl];
176 break;
177- case ReduceActions.REDUCE_FLOAT:
178+ case ReduceActions.ReduceFloat:
179 this.$ = TypeConverter.valueToNumber(virtualStack[vsl - 2] + '.' + virtualStack[vsl]);
180 break;
181- case ReduceActions.REDUCE_PREV_AS_PERCENT:
182+ case ReduceActions.ReducePrevAsPercent:
183 this.$ = virtualStack[vsl - 1] * 0.01;
184 break;
185- case ReduceActions.REDUCE_LAST_THREE_A:
186- case ReduceActions.REDUCE_LAST_THREE_B:
187+ case ReduceActions.ReduceLastThreeA:
188+ case ReduceActions.ReduceLastThreeB:
189 this.$ = virtualStack[vsl - 2] + virtualStack[vsl - 1] + virtualStack[vsl];
190 break;
191- case ReduceActions.AS_ERROR:
192+ case ReduceActions.AsError:
193 this.$ = constructErrorByName(virtualStack[vsl]);
194 break;
195 }
196@@ -190,52 +198,52 @@ let Parser = (function () {
197 if (catchOnFailure) {
198 // NOTE: I'm not sure if some of these ReduceAction map correctly in the case of an error.
199 switch (reduceActionToPerform) {
200- case ReduceActions.RETURN_LAST:
201+ case ReduceActions.ReturnLast:
202 return virtualStack[vsl - 1];
203- case ReduceActions.CALL_VARIABLE:
204- case ReduceActions.AS_NUMBER:
205- case ReduceActions.AS_STRING:
206- case ReduceActions.AMPERSAND:
207- case ReduceActions.EQUALS:
208- case ReduceActions.PLUS:
209- case ReduceActions.LAST_NUMBER:
210+ case ReduceActions.CallVariable:
211+ case ReduceActions.AsNumber:
212+ case ReduceActions.AsString:
213+ case ReduceActions.Ampersand:
214+ case ReduceActions.Equals:
215+ case ReduceActions.Plus:
216+ case ReduceActions.LastNumber:
217 case ReduceActions.LTE:
218 case ReduceActions.GTE:
219- case ReduceActions.NOT_EQ:
220+ case ReduceActions.NotEqual:
221 case ReduceActions.GT:
222 case ReduceActions.LT:
223- case ReduceActions.MINUS:
224- case ReduceActions.MULTIPLY:
225- case ReduceActions.DIVIDE:
226- case ReduceActions.TO_POWER:
227- case ReduceActions.CALL_FUNCTION_LAST_BLANK:
228- case ReduceActions.CALL_FUNCTION_LAST_TWO_IN_STACK:
229- case ReduceActions.FIXED_CELL_VAL:
230- case ReduceActions.FIXED_CELL_RANGE_VAL:
231- case ReduceActions.CELL_VALUE:
232- case ReduceActions.CELL_RANGE_VALUE:
233+ case ReduceActions.Minus:
234+ case ReduceActions.Multiply:
235+ case ReduceActions.Divide:
236+ case ReduceActions.ToPower:
237+ case ReduceActions.CallFunctionLastBlank:
238+ case ReduceActions.CallFunctionLastTwoInStack:
239+ case ReduceActions.FixedCellValue:
240+ case ReduceActions.FixedCellRangeValue:
241+ case ReduceActions.CellValue:
242+ case ReduceActions.CellRangeValue:
243 this.$ = e;
244 break;
245- case ReduceActions.INVERT_NUM:
246+ case ReduceActions.InvertNumber:
247 this.$ = e;
248 if (isNaN(this.$)) {
249 this.$ = 0;
250 }
251 break;
252- case ReduceActions.TO_NUMBER_NAN_AS_ZERO:
253+ case ReduceActions.ToNumberNANAsZero:
254 this.$ = e;
255 if (isNaN(this.$)) {
256 this.$ = 0;
257 }
258 break;
259- case ReduceActions.ENSURE_IS_ARRAY:
260+ case ReduceActions.EnsureIsArray:
261 if (isArray(virtualStack[vsl])) {
262 this.$ = virtualStack[vsl];
263 } else {
264 this.$ = [virtualStack[vsl]];
265 }
266 break;
267- case ReduceActions.ENSURE_YYTEXT_ARRAY:
268+ case ReduceActions.EnsureYYTextIsArray:
269 let result = [],
270 arr = eval("[" + rawValueOfReduceOriginToken + "]");
271 arr.forEach(function (item) {
272@@ -243,29 +251,29 @@ let Parser = (function () {
273 });
274 this.$ = result;
275 break;
276- case ReduceActions.REDUCE_INT:
277- case ReduceActions.REDUCE_PERCENT:
278+ case ReduceActions.ReduceInt:
279+ case ReduceActions.ReducePercent:
280 virtualStack[vsl - 2].push(virtualStack[vsl]);
281 this.$ = virtualStack[vsl - 2];
282 break;
283- case ReduceActions.WRAP_CURRENT_INDEX_TOKEN_AS_ARRAY:
284+ case ReduceActions.WrapCurrentTokenAsArray:
285 this.$ = [virtualStack[vsl]];
286 break;
287- case ReduceActions.ENSURE_LAST_TWO_IN_ARRAY_AND_PUSH:
288+ case ReduceActions.EnsureLastTwoINArrayAndPush:
289 this.$ = (isArray(virtualStack[vsl - 2]) ? virtualStack[vsl - 2] : [virtualStack[vsl - 2]]);
290 this.$.push(virtualStack[vsl]);
291 break;
292- case ReduceActions.REFLEXIVE_REDUCE:
293+ case ReduceActions.ReflexiveReduce:
294 this.$ = virtualStack[vsl];
295 break;
296- case ReduceActions.REDUCE_FLOAT:
297+ case ReduceActions.ReduceFloat:
298 this.$ = parseFloat(virtualStack[vsl - 2] + '.' + virtualStack[vsl]);
299 break;
300- case ReduceActions.REDUCE_PREV_AS_PERCENT:
301+ case ReduceActions.ReducePrevAsPercent:
302 this.$ = virtualStack[vsl - 1] * 0.01;
303 break;
304- case ReduceActions.REDUCE_LAST_THREE_A:
305- case ReduceActions.REDUCE_LAST_THREE_B:
306+ case ReduceActions.ReduceLastThreeA:
307+ case ReduceActions.ReduceLastThreeB:
308 this.$ = virtualStack[vsl - 2] + virtualStack[vsl - 1] + virtualStack[vsl];
309 break;
310 }
311@@ -274,7 +282,7 @@ let Parser = (function () {
312 }
313 }
314 },
315- defaultActions: {19: [REDUCE, ReduceActions.RETURN_LAST]},
316+ defaultActions: {19: [REDUCE, ReduceActions.ReturnLast]},
317 parseError: function parseError(str, hash) {
318 if (hash.recoverable) {
319 this.trace(str);
320@@ -851,115 +859,115 @@ let Parser = (function () {
321
322 mapRuleIndexToSymbolEnumeration: function (ruleIndex) {
323 switch (ruleIndex) {
324- case RuleIndex.WHITE_SPACE:
325+ case RuleIndex.WhiteSpace:
326 // skip whitespace
327 break;
328- case RuleIndex.DOUBLE_QUOTES:
329- return Symbol.STRING;
330- case RuleIndex.SINGLE_QUOTES:
331- return Symbol.STRING;
332- case RuleIndex.FORMULA_NAME:
333- return Symbol.FUNCTION;
334- case RuleIndex.$_A1_CELL:
335- return Symbol.FIXEDCELL;
336- case RuleIndex.A1_CELL:
337- return Symbol.CELL_UPPER;
338- case RuleIndex.FORMULA_NAME_SIMPLE:
339- return Symbol.FUNCTION;
340- case RuleIndex.VARIABLE:
341- return Symbol.VARIABLE;
342- case RuleIndex.SIMPLE_VARIABLE:
343- return Symbol.VARIABLE;
344- case RuleIndex.INTEGER:
345- return Symbol.NUMBER_UPPER;
346- case RuleIndex.OPEN_AND_CLOSE_OF_ARRAY:
347- return Symbol.ARRAY;
348- case RuleIndex.DOLLAR_SIGN:
349+ case RuleIndex.DoubleQuotes:
350+ return Symbol.String;
351+ case RuleIndex.SingleQuotes:
352+ return Symbol.String;
353+ case RuleIndex.FormulaName:
354+ return Symbol.Function;
355+ case RuleIndex.$A1Cell:
356+ return Symbol.FixedCell;
357+ case RuleIndex.A1Cell:
358+ return Symbol.CellUpper;
359+ case RuleIndex.FormulaNameSimple:
360+ return Symbol.Function;
361+ case RuleIndex.Variable:
362+ return Symbol.Variable;
363+ case RuleIndex.SimpleVariable:
364+ return Symbol.Variable;
365+ case RuleIndex.Integer:
366+ return Symbol.NumberUpper;
367+ case RuleIndex.SelfContainedArray:
368+ return Symbol.Array;
369+ case RuleIndex.DollarSign:
370 // skip whitespace??
371 break;
372- case RuleIndex.AMPERSAND_SIGN:
373- return Symbol.AMPERSAND;
374- case RuleIndex.SINGLE_WHITESPACE:
375+ case RuleIndex.Ampersand:
376+ return Symbol.Ampersand;
377+ case RuleIndex.SingleWhitespace:
378 return ' ';
379- case RuleIndex.PERIOD:
380- return Symbol.DECIMAL;
381- case RuleIndex.COLON:
382- return Symbol.COLON;
383- case RuleIndex.SEMI_COLON:
384- return Symbol.SEMI_COLON;
385- case RuleIndex.COMMA:
386- return Symbol.COMMA;
387- case RuleIndex.ASTERISK:
388- return Symbol.ASTERISK;
389- case RuleIndex.FORWARD_SLASH:
390- return Symbol.DIVIDE;
391- case RuleIndex.MINUS_SIGN:
392- return Symbol.MINUS;
393- case RuleIndex.PLUS_SIGN:
394- return Symbol.PLUS;
395- case RuleIndex.CARET_SIGN:
396- return Symbol.CARROT;
397- case RuleIndex.OPEN_PAREN:
398- return Symbol.LEFT_PAREN;
399- case RuleIndex.CLOSE_PAREN:
400- return Symbol.RIGHT_PAREN;
401- case RuleIndex.GREATER_THAN_SIGN:
402- return Symbol.GREATER_THAN;
403- case RuleIndex.LESS_THAN_SIGN:
404- return Symbol.LESS_THAN;
405- case RuleIndex.OPEN_DOUBLE_QUOTE:
406+ case RuleIndex.Period:
407+ return Symbol.Decimal;
408+ case RuleIndex.Colon:
409+ return Symbol.Colon;
410+ case RuleIndex.Semicolon:
411+ return Symbol.Semicolon;
412+ case RuleIndex.Comma:
413+ return Symbol.Comma;
414+ case RuleIndex.Asterisk:
415+ return Symbol.Asterisk;
416+ case RuleIndex.ForwardSlash:
417+ return Symbol.Divide;
418+ case RuleIndex.Minus:
419+ return Symbol.Minus;
420+ case RuleIndex.Plus:
421+ return Symbol.Plus;
422+ case RuleIndex.Caret:
423+ return Symbol.Carrot;
424+ case RuleIndex.OpenParen:
425+ return Symbol.LeftParen;
426+ case RuleIndex.CloseParen:
427+ return Symbol.RightParen;
428+ case RuleIndex.GreaterThan:
429+ return Symbol.GreaterThan;
430+ case RuleIndex.LessThanSign:
431+ return Symbol.LessThan;
432+ case RuleIndex.OpenDoubleQuote:
433 return '"';
434- case RuleIndex.OPEN_SINGLE_QUITE:
435+ case RuleIndex.OpenSingleQuote:
436 return "'";
437- case RuleIndex.EXCLAMATION_POINT_RULE:
438+ case RuleIndex.ExclamationPoint:
439 return "!";
440- case RuleIndex.EQUALS_SIGN:
441- return Symbol.EQUALS;
442- case RuleIndex.PERCENT_SIGN:
443- return Symbol.PERCENT;
444- case RuleIndex.FULL_ERROR:
445- return Symbol.FULL_ERROR;
446- case RuleIndex.END_OF_STRING:
447+ case RuleIndex.Equals:
448+ return Symbol.Equals;
449+ case RuleIndex.Percent:
450+ return Symbol.Percent;
451+ case RuleIndex.FullError:
452+ return Symbol.FullError;
453+ case RuleIndex.EndOfString:
454 return Symbol.EOF;
455 }
456 },
457 conditions: {
458 INITIAL: {
459 rules: [
460- RuleIndex.WHITE_SPACE,
461- RuleIndex.DOUBLE_QUOTES,
462- RuleIndex.SINGLE_QUOTES,
463- RuleIndex.FORMULA_NAME,
464- RuleIndex.$_A1_CELL,
465- RuleIndex.A1_CELL,
466- RuleIndex.FORMULA_NAME_SIMPLE,
467- RuleIndex.VARIABLE,
468- RuleIndex.SIMPLE_VARIABLE ,
469- RuleIndex.INTEGER,
470- RuleIndex.OPEN_AND_CLOSE_OF_ARRAY,
471- RuleIndex.DOLLAR_SIGN,
472- RuleIndex.AMPERSAND_SIGN ,
473- RuleIndex.SINGLE_WHITESPACE,
474- RuleIndex.PERIOD,
475- RuleIndex.COLON,
476- RuleIndex.SEMI_COLON,
477- RuleIndex.COMMA,
478- RuleIndex.ASTERISK,
479- RuleIndex.FORWARD_SLASH,
480- RuleIndex.MINUS_SIGN,
481- RuleIndex.PLUS_SIGN,
482- RuleIndex.CARET_SIGN,
483- RuleIndex.OPEN_PAREN,
484- RuleIndex.CLOSE_PAREN,
485- RuleIndex.GREATER_THAN_SIGN,
486- RuleIndex.LESS_THAN_SIGN,
487- RuleIndex.OPEN_DOUBLE_QUOTE,
488- RuleIndex.OPEN_SINGLE_QUITE,
489- RuleIndex.EXCLAMATION_POINT_RULE,
490- RuleIndex.EQUALS_SIGN,
491- RuleIndex.PERCENT_SIGN,
492- RuleIndex.FULL_ERROR,
493- RuleIndex.END_OF_STRING,
494+ RuleIndex.WhiteSpace,
495+ RuleIndex.DoubleQuotes,
496+ RuleIndex.SingleQuotes,
497+ RuleIndex.FormulaName,
498+ RuleIndex.$A1Cell,
499+ RuleIndex.A1Cell,
500+ RuleIndex.FormulaNameSimple,
501+ RuleIndex.Variable,
502+ RuleIndex.SimpleVariable ,
503+ RuleIndex.Integer,
504+ RuleIndex.SelfContainedArray,
505+ RuleIndex.DollarSign,
506+ RuleIndex.Ampersand ,
507+ RuleIndex.SingleWhitespace,
508+ RuleIndex.Period,
509+ RuleIndex.Colon,
510+ RuleIndex.Semicolon,
511+ RuleIndex.Comma,
512+ RuleIndex.Asterisk,
513+ RuleIndex.ForwardSlash,
514+ RuleIndex.Minus,
515+ RuleIndex.Plus,
516+ RuleIndex.Caret,
517+ RuleIndex.OpenParen,
518+ RuleIndex.CloseParen,
519+ RuleIndex.GreaterThan,
520+ RuleIndex.LessThanSign,
521+ RuleIndex.OpenDoubleQuote,
522+ RuleIndex.OpenSingleQuote,
523+ RuleIndex.ExclamationPoint,
524+ RuleIndex.Equals,
525+ RuleIndex.Percent,
526+ RuleIndex.FullError,
527+ RuleIndex.EndOfString,
528 37
529 ],
530 "inclusive": true
531diff --git a/src/Parser/ParserConstants.ts b/src/Parser/ParserConstants.ts
532index f196451..cdcf805 100644
533--- a/src/Parser/ParserConstants.ts
534+++ b/src/Parser/ParserConstants.ts
535@@ -1,119 +1,18 @@
536 import {
537 ObjectBuilder
538 } from "../Utilities/ObjectBuilder";
539-
540-// Rules represent the Regular Expressions that will be used in sequence to match a given input to the Parser.
541-const WHITE_SPACE_RULE = /^(?:\s+)/;
542-const DOUBLE_QUOTES_RULE = /^(?:"(\\["]|[^"])*")/;
543-const SINGLE_QUOTES_RULE = /^(?:'(\\[']|[^'])*')/;
544-const FORMULA_NAME_RULE = /^(?:[A-Za-z.]{1,}[A-Za-z_0-9]+(?=[(]))/;
545-const $_A1_CELL_RULE = /^(?:\$[A-Za-z]+\$[0-9]+)/;
546-const A1_CELL_RULE = /^(?:[A-Za-z]+[0-9]+)/;
547-const FORMULA_NAME_SIMPLE_RULE = /^(?:[A-Za-z.]+(?=[(]))/;
548-const VARIABLE_RULE = /^(?:[A-Za-z]{1,}[A-Za-z_0-9]+)/;
549-const SIMPLE_VARIABLE_RILE = /^(?:[A-Za-z_]+)/;
550-const INTEGER_RULE = /^(?:[0-9]+(?:(?:[eE])(?:[\+-])?[0-9]+)?)/;
551-const OPEN_AND_CLOSE_OF_ARRAY_RULE = /^(?:\[([^\]]*)?\])/;
552-const DOLLAR_SIGN_RULE = /^(?:\$)/;
553-const AMPERSAND_SIGN_RULE = /^(?:&)/;
554-const SINGLE_WHITESPACE_RULE = /^(?: )/;
555-const PERIOD_RULE = /^(?:[.])/;
556-const COLON_RULE = /^(?::)/;
557-const SEMI_COLON_RULE = /^(?:;)/;
558-const COMMA_RULE = /^(?:,)/;
559-const ASTERISK_RULE = /^(?:\*)/;
560-const FORWARD_SLASH_RULE = /^(?:\/)/;
561-const MINUS_SIGN_RULE = /^(?:-)/;
562-const PLUS_SIGN_RULE = /^(?:\+)/;
563-const CARET_SIGN_RULE = /^(?:\^)/;
564-const OPEN_PAREN_RULE = /^(?:\()/;
565-const CLOSE_PAREN_RULE = /^(?:\))/;
566-const GREATER_THAN_SIGN_RULE = /^(?:>)/;
567-const LESS_THAN_SIGN_RULE = /^(?:<)/;
568-const OPEN_DOUBLE_QUOTE = /^(?:")/;
569-const OPEN_SINGLE_QUITE = /^(?:')/;
570-const EXCLAMATION_POINT_RULE = /^(?:!)/;
571-const EQUALS_SIGN_RULE = /^(?:=)/;
572-const PERCENT_SIGN_RULE = /^(?:%)/;
573-const FULL_ERROR_RULE = /^(?:#N\/A|#NUM\!|#NULL\!|#DIV\/0\!|#VALUE\!|#REF\!|#ERROR)/;
574-const END_OF_STRING_RULE = /^(?:$)/;
575-
576-
577-const enum RuleIndex {
578- WHITE_SPACE = 0,
579- DOUBLE_QUOTES = 1,
580- SINGLE_QUOTES = 2,
581- FORMULA_NAME = 3,
582- $_A1_CELL = 6,
583- A1_CELL = 7,
584- FORMULA_NAME_SIMPLE = 8,
585- VARIABLE = 9,
586- SIMPLE_VARIABLE = 10,
587- INTEGER = 11,
588- OPEN_AND_CLOSE_OF_ARRAY = 12,
589- DOLLAR_SIGN = 13,
590- AMPERSAND_SIGN = 14,
591- SINGLE_WHITESPACE = 15,
592- PERIOD = 16,
593- COLON = 17,
594- SEMI_COLON = 18,
595- COMMA = 19,
596- ASTERISK = 20,
597- FORWARD_SLASH = 21,
598- MINUS_SIGN = 22,
599- PLUS_SIGN = 23,
600- CARET_SIGN = 24,
601- OPEN_PAREN = 25,
602- CLOSE_PAREN = 26,
603- GREATER_THAN_SIGN = 27,
604- LESS_THAN_SIGN = 28,
605- OPEN_DOUBLE_QUOTE = 30,
606- OPEN_SINGLE_QUITE = 31,
607- EXCLAMATION_POINT_RULE = 32,
608- EQUALS_SIGN = 33,
609- PERCENT_SIGN = 34,
610- FULL_ERROR = 35,
611- END_OF_STRING = 36
612-};
613-
614-
615-// Sequential rules to use when parsing a given input.
616-let RULES = [];
617-RULES[RuleIndex.WHITE_SPACE] = WHITE_SPACE_RULE;
618-RULES[RuleIndex.DOUBLE_QUOTES] = DOUBLE_QUOTES_RULE;
619-RULES[RuleIndex.SINGLE_QUOTES] = SINGLE_QUOTES_RULE;
620-RULES[RuleIndex.FORMULA_NAME] = FORMULA_NAME_RULE;
621-RULES[RuleIndex.$_A1_CELL] = $_A1_CELL_RULE;
622-RULES[RuleIndex.A1_CELL] = A1_CELL_RULE;
623-RULES[RuleIndex.FORMULA_NAME_SIMPLE] = FORMULA_NAME_SIMPLE_RULE;
624-RULES[RuleIndex.VARIABLE] = VARIABLE_RULE;
625-RULES[RuleIndex.SIMPLE_VARIABLE] = SIMPLE_VARIABLE_RILE;
626-RULES[RuleIndex.INTEGER] = INTEGER_RULE;
627-RULES[RuleIndex.OPEN_AND_CLOSE_OF_ARRAY] = OPEN_AND_CLOSE_OF_ARRAY_RULE;
628-RULES[RuleIndex.DOLLAR_SIGN] = DOLLAR_SIGN_RULE;
629-RULES[RuleIndex.AMPERSAND_SIGN] = AMPERSAND_SIGN_RULE;
630-RULES[RuleIndex.SINGLE_WHITESPACE] = SINGLE_WHITESPACE_RULE;
631-RULES[RuleIndex.PERIOD] = PERIOD_RULE;
632-RULES[RuleIndex.COLON] = COLON_RULE;
633-RULES[RuleIndex.SEMI_COLON] = SEMI_COLON_RULE;
634-RULES[RuleIndex.COMMA] = COMMA_RULE;
635-RULES[RuleIndex.ASTERISK] = ASTERISK_RULE;
636-RULES[RuleIndex.FORWARD_SLASH] = FORWARD_SLASH_RULE;
637-RULES[RuleIndex.MINUS_SIGN] = MINUS_SIGN_RULE;
638-RULES[RuleIndex.PLUS_SIGN] = PLUS_SIGN_RULE;
639-RULES[RuleIndex.CARET_SIGN] = CARET_SIGN_RULE;
640-RULES[RuleIndex.OPEN_PAREN] = OPEN_PAREN_RULE;
641-RULES[RuleIndex.CLOSE_PAREN] = CLOSE_PAREN_RULE;
642-RULES[RuleIndex.GREATER_THAN_SIGN] = GREATER_THAN_SIGN_RULE;
643-RULES[RuleIndex.LESS_THAN_SIGN] = LESS_THAN_SIGN_RULE;
644-RULES[RuleIndex.OPEN_DOUBLE_QUOTE] = OPEN_DOUBLE_QUOTE;
645-RULES[RuleIndex.OPEN_SINGLE_QUITE] = OPEN_SINGLE_QUITE;
646-RULES[RuleIndex.EXCLAMATION_POINT_RULE] = EXCLAMATION_POINT_RULE;
647-RULES[RuleIndex.EQUALS_SIGN] = EQUALS_SIGN_RULE;
648-RULES[RuleIndex.PERCENT_SIGN] = PERCENT_SIGN_RULE;
649-RULES[RuleIndex.FULL_ERROR] = FULL_ERROR_RULE;
650-RULES[RuleIndex.END_OF_STRING] = END_OF_STRING_RULE;
651-
652+import {
653+ Symbol
654+} from "./Symbols";
655+import {
656+ ReduceActions
657+} from "./ReduceActions";
658+import {
659+ ReductionPair
660+} from "./ReductionPair";
661+import {
662+ RULES
663+} from "./Rules";
664
665 /**
666 * Actions to take when processing tokens one by one. We're always either taking the next token, reducing our current
667@@ -123,115 +22,6 @@ const SHIFT = 1;
668 const REDUCE = 2;
669 const ACCEPT = 3;
670
671-const enum ReduceActions {
672- NO_ACTION = 0,
673- RETURN_LAST = 1,
674- CALL_VARIABLE = 2,
675- AS_NUMBER = 5,
676- AS_STRING = 6,
677- AMPERSAND = 7,
678- EQUALS = 8,
679- PLUS = 9,
680- LAST_NUMBER = 10,
681- LTE = 11,
682- GTE = 12,
683- NOT_EQ = 13,
684- GT = 15,
685- LT = 16,
686- MINUS = 17,
687- MULTIPLY = 18,
688- DIVIDE = 19,
689- TO_POWER = 20,
690- INVERT_NUM = 21,
691- TO_NUMBER_NAN_AS_ZERO = 22,
692- CALL_FUNCTION_LAST_BLANK = 23,
693- CALL_FUNCTION_LAST_TWO_IN_STACK = 24,
694- CELL_VALUE_AS_EXPRESSION = 25,
695- ERROR_AND_CONTINUE = 26,
696- ERROR_AND_CONTINUE_WITH_OTHER_ERRORS = 27,
697- FIXED_CELL_VAL = 28,
698- FIXED_CELL_RANGE_VAL = 29,
699- CELL_VALUE = 30,
700- CELL_RANGE_VALUE = 31,
701- ENSURE_IS_ARRAY = 32,
702- ENSURE_YYTEXT_ARRAY = 33,
703- REDUCE_INT = 34,
704- REDUCE_PERCENT = 35,
705- WRAP_CURRENT_INDEX_TOKEN_AS_ARRAY = 36,
706- ENSURE_LAST_TWO_IN_ARRAY_AND_PUSH = 37,
707- REFLEXIVE_REDUCE = 38,
708- REDUCE_FLOAT = 39,
709- REDUCE_PREV_AS_PERCENT = 40,
710- REDUCE_LAST_THREE_A = 41,
711- REDUCE_LAST_THREE_B = 42,
712- AS_ERROR = 43
713-}
714-
715-enum Symbol {
716- ACCEPT = 0,
717- END = 1,
718- ERROR = 2,
719- EXPRESSIONS = 3,
720- EXPRESSION = 4,
721- EOF = 5,
722- VARIABLE_SEQUENCE = 6,
723- NUMBER = 9,
724- STRING = 10,
725- AMPERSAND = 11,
726- EQUALS = 12,
727- PLUS = 13,
728- LEFT_PAREN = 14,
729- RIGHT_PAREN = 15,
730- LESS_THAN = 16,
731- GREATER_THAN = 17,
732- MINUS = 19,
733- ASTERISK = 20,
734- DIVIDE = 21,
735- CARROT = 22,
736- FUNCTION = 23,
737- EXP_SEQ = 24,
738- CELL = 25,
739- FIXEDCELL = 26,
740- COLON = 27,
741- CELL_UPPER = 28,
742- ARRAY = 29,
743- SEMI_COLON = 30,
744- COMMA = 31,
745- VARIABLE = 32,
746- DECIMAL = 33,
747- NUMBER_UPPER = 34,
748- PERCENT = 35,
749- FULL_ERROR = 36,
750- EXCLAMATION_POINT = 37
751-}
752-
753-/**
754- * Represents the length to reduce the stack by, and the replacement symbol that will replace those tokens in the stack.
755- */
756-class ReductionPair {
757- private lengthToReduceStackBy : number;
758- private replacementSymbol : number;
759- constructor(replacementSymbol : number, length : number) {
760- this.lengthToReduceStackBy = length;
761- this.replacementSymbol = replacementSymbol;
762- }
763-
764- /**
765- * Get the number representing the length to reduce the stack by.
766- * @returns {number}
767- */
768- getLengthToReduceStackBy() : number {
769- return this.lengthToReduceStackBy;
770- }
771-
772- /**
773- * Get the replacement token index.
774- * @returns {number}
775- */
776- getReplacementSymbol() : number {
777- return this.replacementSymbol;
778- }
779-}
780
781 /**
782 * Productions is used to look up both the number to use when reducing the stack (productions[x][1]) and the semantic
783@@ -241,113 +31,113 @@ class ReductionPair {
784 * Maps a ProductionRule to the appropriate number of previous tokens to use in a reduction action.
785 */
786 let productions : Array<ReductionPair> = [];
787-productions[ReduceActions.NO_ACTION] = null;
788-productions[ReduceActions.RETURN_LAST] = new ReductionPair(Symbol.EXPRESSIONS, 2);
789-productions[ReduceActions.CALL_VARIABLE] = new ReductionPair(Symbol.EXPRESSION, 1);
790-productions[ReduceActions.AS_NUMBER] = new ReductionPair(Symbol.EXPRESSION, 1);
791-productions[ReduceActions.AS_STRING] = new ReductionPair(Symbol.EXPRESSION, 1);
792-productions[ReduceActions.AMPERSAND] = new ReductionPair(Symbol.EXPRESSION, 3);
793-productions[ReduceActions.EQUALS] = new ReductionPair(Symbol.EXPRESSION, 3);
794-productions[ReduceActions.PLUS] = new ReductionPair(Symbol.EXPRESSION, 3);
795-productions[ReduceActions.LAST_NUMBER] = new ReductionPair(Symbol.EXPRESSION, 3);
796-productions[ReduceActions.LTE] = new ReductionPair(Symbol.EXPRESSION, 4);
797-productions[ReduceActions.GTE] = new ReductionPair(Symbol.EXPRESSION, 4);
798-productions[ReduceActions.NOT_EQ] = new ReductionPair(Symbol.EXPRESSION, 4);
799-productions[ReduceActions.GT] = new ReductionPair(Symbol.EXPRESSION, 3);
800-productions[ReduceActions.LT] = new ReductionPair(Symbol.EXPRESSION, 3);
801-productions[ReduceActions.MINUS] = new ReductionPair(Symbol.EXPRESSION, 3);
802-productions[ReduceActions.MULTIPLY] = new ReductionPair(Symbol.EXPRESSION, 3);
803-productions[ReduceActions.DIVIDE] = new ReductionPair(Symbol.EXPRESSION, 3);
804-productions[ReduceActions.TO_POWER] = new ReductionPair(Symbol.EXPRESSION, 3);
805-productions[ReduceActions.INVERT_NUM] = new ReductionPair(Symbol.EXPRESSION, 2);
806-productions[ReduceActions.TO_NUMBER_NAN_AS_ZERO] = new ReductionPair(Symbol.EXPRESSION, 2);
807-productions[ReduceActions.CALL_FUNCTION_LAST_BLANK] = new ReductionPair(Symbol.EXPRESSION, 3);
808-productions[ReduceActions.CALL_FUNCTION_LAST_TWO_IN_STACK] = new ReductionPair(Symbol.EXPRESSION, 4);
809-productions[ReduceActions.CELL_VALUE_AS_EXPRESSION] = new ReductionPair(Symbol.EXPRESSION, 1);
810-productions[ReduceActions.ERROR_AND_CONTINUE] = new ReductionPair(Symbol.EXPRESSION, 1);
811-productions[ReduceActions.ERROR_AND_CONTINUE_WITH_OTHER_ERRORS] = new ReductionPair(Symbol.EXPRESSION, 2);
812-productions[ReduceActions.FIXED_CELL_VAL] = new ReductionPair(Symbol.CELL, 1);
813-productions[ReduceActions.FIXED_CELL_RANGE_VAL] = new ReductionPair(Symbol.CELL, 3);
814-productions[ReduceActions.CELL_VALUE] = new ReductionPair(Symbol.CELL, 1);
815-productions[ReduceActions.CELL_RANGE_VALUE] = new ReductionPair(Symbol.CELL, 3);
816-productions[ReduceActions.ENSURE_IS_ARRAY] = new ReductionPair(Symbol.EXP_SEQ, 1);
817-productions[ReduceActions.ENSURE_YYTEXT_ARRAY] = new ReductionPair(Symbol.EXP_SEQ, 1);
818-productions[ReduceActions.REDUCE_INT] = new ReductionPair(Symbol.EXP_SEQ, 3);
819-productions[ReduceActions.REDUCE_PERCENT] = new ReductionPair(Symbol.EXP_SEQ, 3);
820-productions[ReduceActions.WRAP_CURRENT_INDEX_TOKEN_AS_ARRAY] = new ReductionPair(Symbol.VARIABLE_SEQUENCE, 1);
821-productions[ReduceActions.ENSURE_LAST_TWO_IN_ARRAY_AND_PUSH] = new ReductionPair(Symbol.VARIABLE_SEQUENCE, 3);
822-productions[ReduceActions.REFLEXIVE_REDUCE] = new ReductionPair(Symbol.NUMBER, 1);
823-productions[ReduceActions.REDUCE_FLOAT] = new ReductionPair(Symbol.NUMBER, 3);
824-productions[ReduceActions.REDUCE_PREV_AS_PERCENT] = new ReductionPair(Symbol.NUMBER, 2);
825-productions[ReduceActions.REDUCE_LAST_THREE_A] = new ReductionPair(Symbol.ERROR, 3);
826-productions[ReduceActions.REDUCE_LAST_THREE_B] = new ReductionPair(Symbol.ERROR, 4);
827-productions[ReduceActions.AS_ERROR] = new ReductionPair(Symbol.EXPRESSION, 1);
828+productions[ReduceActions.NoAction] = null;
829+productions[ReduceActions.ReturnLast] = new ReductionPair(Symbol.Expressions, 2);
830+productions[ReduceActions.CallVariable] = new ReductionPair(Symbol.Expression, 1);
831+productions[ReduceActions.AsNumber] = new ReductionPair(Symbol.Expression, 1);
832+productions[ReduceActions.AsString] = new ReductionPair(Symbol.Expression, 1);
833+productions[ReduceActions.Ampersand] = new ReductionPair(Symbol.Expression, 3);
834+productions[ReduceActions.Equals] = new ReductionPair(Symbol.Expression, 3);
835+productions[ReduceActions.Plus] = new ReductionPair(Symbol.Expression, 3);
836+productions[ReduceActions.LastNumber] = new ReductionPair(Symbol.Expression, 3);
837+productions[ReduceActions.LTE] = new ReductionPair(Symbol.Expression, 4);
838+productions[ReduceActions.GTE] = new ReductionPair(Symbol.Expression, 4);
839+productions[ReduceActions.NotEqual] = new ReductionPair(Symbol.Expression, 4);
840+productions[ReduceActions.GT] = new ReductionPair(Symbol.Expression, 3);
841+productions[ReduceActions.LT] = new ReductionPair(Symbol.Expression, 3);
842+productions[ReduceActions.Minus] = new ReductionPair(Symbol.Expression, 3);
843+productions[ReduceActions.Multiply] = new ReductionPair(Symbol.Expression, 3);
844+productions[ReduceActions.Divide] = new ReductionPair(Symbol.Expression, 3);
845+productions[ReduceActions.ToPower] = new ReductionPair(Symbol.Expression, 3);
846+productions[ReduceActions.InvertNumber] = new ReductionPair(Symbol.Expression, 2);
847+productions[ReduceActions.ToNumberNANAsZero] = new ReductionPair(Symbol.Expression, 2);
848+productions[ReduceActions.CallFunctionLastBlank] = new ReductionPair(Symbol.Expression, 3);
849+productions[ReduceActions.CallFunctionLastTwoInStack] = new ReductionPair(Symbol.Expression, 4);
850+productions[ReduceActions.CellValueAsExpression] = new ReductionPair(Symbol.Expression, 1);
851+productions[ReduceActions.ErrorAndContinue] = new ReductionPair(Symbol.Expression, 1);
852+productions[ReduceActions.ErrorAndContinueWithOtherErrors] = new ReductionPair(Symbol.Expression, 2);
853+productions[ReduceActions.FixedCellValue] = new ReductionPair(Symbol.Cell, 1);
854+productions[ReduceActions.FixedCellRangeValue] = new ReductionPair(Symbol.Cell, 3);
855+productions[ReduceActions.CellValue] = new ReductionPair(Symbol.Cell, 1);
856+productions[ReduceActions.CellRangeValue] = new ReductionPair(Symbol.Cell, 3);
857+productions[ReduceActions.EnsureIsArray] = new ReductionPair(Symbol.ExpressionSeq, 1);
858+productions[ReduceActions.EnsureYYTextIsArray] = new ReductionPair(Symbol.ExpressionSeq, 1);
859+productions[ReduceActions.ReduceInt] = new ReductionPair(Symbol.ExpressionSeq, 3);
860+productions[ReduceActions.ReducePercent] = new ReductionPair(Symbol.ExpressionSeq, 3);
861+productions[ReduceActions.WrapCurrentTokenAsArray] = new ReductionPair(Symbol.VariableSeq, 1);
862+productions[ReduceActions.EnsureLastTwoINArrayAndPush] = new ReductionPair(Symbol.VariableSeq, 3);
863+productions[ReduceActions.ReflexiveReduce] = new ReductionPair(Symbol.Number, 1);
864+productions[ReduceActions.ReduceFloat] = new ReductionPair(Symbol.Number, 3);
865+productions[ReduceActions.ReducePrevAsPercent] = new ReductionPair(Symbol.Number, 2);
866+productions[ReduceActions.ReduceLastThreeA] = new ReductionPair(Symbol.Error, 3);
867+productions[ReduceActions.ReduceLastThreeB] = new ReductionPair(Symbol.Error, 4);
868+productions[ReduceActions.AsError] = new ReductionPair(Symbol.Expression, 1);
869
870 const PRODUCTIONS = productions;
871
872 const SYMBOL_NAME_TO_INDEX = {
873- "$accept": Symbol.ACCEPT,
874- "$end": Symbol.END,
875- "error": Symbol.ERROR,
876- "expressions": Symbol.EXPRESSIONS,
877- "expression": Symbol.EXPRESSION,
878+ "$accept": Symbol.Accept,
879+ "$end": Symbol.End,
880+ "error": Symbol.Error,
881+ "expressions": Symbol.Expressions,
882+ "expression": Symbol.Expression,
883 "EOF": Symbol.EOF,
884- "variableSequence": Symbol.VARIABLE_SEQUENCE,
885- "number": Symbol.NUMBER,
886- "STRING": Symbol.STRING,
887- "&": Symbol.AMPERSAND,
888- "=": Symbol.EQUALS,
889- "+": Symbol.PLUS,
890- "(": Symbol.LEFT_PAREN,
891- ")": Symbol.RIGHT_PAREN,
892- "<": Symbol.LESS_THAN,
893- ">": Symbol.GREATER_THAN,
894- "-": Symbol.MINUS,
895- "*": Symbol.ASTERISK,
896- "/": Symbol.DIVIDE,
897- "^": Symbol.CARROT,
898- "FUNCTION": Symbol.FUNCTION,
899- "expseq": Symbol.EXP_SEQ,
900- "cell": Symbol.CELL,
901- "FIXEDCELL": Symbol.FIXEDCELL,
902- ":": Symbol.COLON,
903- "CELL": Symbol.CELL_UPPER,
904- "ARRAY": Symbol.ARRAY,
905- ";": Symbol.SEMI_COLON,
906- ",": Symbol.COMMA,
907- "VARIABLE": Symbol.VARIABLE,
908- "DECIMAL": Symbol.DECIMAL,
909- "NUMBER": Symbol.NUMBER_UPPER,
910- "%": Symbol.PERCENT,
911- "#": Symbol.FULL_ERROR,
912- "!": Symbol.EXCLAMATION_POINT
913+ "variableSequence": Symbol.VariableSeq,
914+ "number": Symbol.Number,
915+ "STRING": Symbol.String,
916+ "&": Symbol.Ampersand,
917+ "=": Symbol.Equals,
918+ "+": Symbol.Plus,
919+ "(": Symbol.LeftParen,
920+ ")": Symbol.RightParen,
921+ "<": Symbol.LessThan,
922+ ">": Symbol.GreaterThan,
923+ "-": Symbol.Minus,
924+ "*": Symbol.Asterisk,
925+ "/": Symbol.Divide,
926+ "^": Symbol.Carrot,
927+ "FUNCTION": Symbol.Function,
928+ "expseq": Symbol.ExpressionSeq,
929+ "cell": Symbol.Cell,
930+ "FIXEDCELL": Symbol.FixedCell,
931+ ":": Symbol.Colon,
932+ "CELL": Symbol.CellUpper,
933+ "ARRAY": Symbol.Array,
934+ ";": Symbol.Semicolon,
935+ ",": Symbol.Comma,
936+ "VARIABLE": Symbol.Variable,
937+ "DECIMAL": Symbol.Decimal,
938+ "NUMBER": Symbol.NumberUpper,
939+ "%": Symbol.Percent,
940+ "#": Symbol.FullError,
941+ "!": Symbol.ExclamationPoint
942 };
943 let symbolIndexToName = {};
944 symbolIndexToName[Symbol.EOF] = "EOF";
945-symbolIndexToName[Symbol.STRING] = "STRING";
946-symbolIndexToName[Symbol.AMPERSAND] = "&";
947-symbolIndexToName[Symbol.EQUALS] = "=";
948-symbolIndexToName[Symbol.PLUS] = "+";
949-symbolIndexToName[Symbol.LEFT_PAREN] = "(";
950-symbolIndexToName[Symbol.RIGHT_PAREN] = ")";
951-symbolIndexToName[Symbol.LESS_THAN] = "<";
952-symbolIndexToName[Symbol.GREATER_THAN] = ">";
953-symbolIndexToName[Symbol.MINUS] = "-";
954-symbolIndexToName[Symbol.ASTERISK] = "*";
955-symbolIndexToName[Symbol.DIVIDE] = "/";
956-symbolIndexToName[Symbol.CARROT] = "^";
957-symbolIndexToName[Symbol.FUNCTION] = "FUNCTION";
958-symbolIndexToName[Symbol.FIXEDCELL] = "FIXED_CELL_REF";
959-symbolIndexToName[Symbol.CELL] = "CELL";
960-symbolIndexToName[Symbol.COLON] = ";";
961-symbolIndexToName[Symbol.COMMA] = ",";
962-symbolIndexToName[Symbol.VARIABLE] = "VARIABLE";
963-symbolIndexToName[Symbol.DECIMAL] = "DECIMAL";
964-symbolIndexToName[Symbol.NUMBER_UPPER] = "NUMBER";
965-symbolIndexToName[Symbol.PERCENT] = "%";
966-symbolIndexToName[Symbol.FULL_ERROR] = "#";
967-symbolIndexToName[Symbol.ARRAY] = "ARRAY";
968-symbolIndexToName[Symbol.EXCLAMATION_POINT] = "!";
969+symbolIndexToName[Symbol.String] = "String";
970+symbolIndexToName[Symbol.Ampersand] = "&";
971+symbolIndexToName[Symbol.Equals] = "=";
972+symbolIndexToName[Symbol.Plus] = "+";
973+symbolIndexToName[Symbol.LeftParen] = "(";
974+symbolIndexToName[Symbol.RightParen] = ")";
975+symbolIndexToName[Symbol.LessThan] = "<";
976+symbolIndexToName[Symbol.GreaterThan] = ">";
977+symbolIndexToName[Symbol.Minus] = "-";
978+symbolIndexToName[Symbol.Asterisk] = "*";
979+symbolIndexToName[Symbol.Divide] = "/";
980+symbolIndexToName[Symbol.Carrot] = "^";
981+symbolIndexToName[Symbol.Function] = "Function";
982+symbolIndexToName[Symbol.FixedCell] = "FIXED_CELL_REF";
983+symbolIndexToName[Symbol.Cell] = "Cell";
984+symbolIndexToName[Symbol.Colon] = ";";
985+symbolIndexToName[Symbol.Comma] = ",";
986+symbolIndexToName[Symbol.Variable] = "Variable";
987+symbolIndexToName[Symbol.Decimal] = "Decimal";
988+symbolIndexToName[Symbol.NumberUpper] = "Number";
989+symbolIndexToName[Symbol.Percent] = "%";
990+symbolIndexToName[Symbol.FullError] = "#";
991+symbolIndexToName[Symbol.Array] = "Array";
992+symbolIndexToName[Symbol.ExclamationPoint] = "!";
993 const SYMBOL_INDEX_TO_NAME = symbolIndexToName;
994
995
996@@ -362,25 +152,31 @@ const enum State {
997 Start_Equals = 21,
998 Start_Equals_Expression = 44,
999 // Number
1000- Number_Plus = 22,
1001- Number_Minus = 26,
1002- Number_Asterisk = 27,
1003- Number_Divide = 28,
1004- Number_Carrot = 29,
1005- Number_Ampersand = 20,
1006- Number_Percent = 31,
1007+ Number = 15,
1008+ Number_Decimal = 39,
1009+ Number_Ampersand_Expression = 43,
1010+ Number_Decimal_NumberUpper = 63,
1011+ // Prefix Operators
1012+ PrefixUnaryMinus = 9,
1013+ PrefixUnaryPlus = 10,
1014+ PrefixUnaryMinus_Expression = 33,
1015+ PrefixUnaryPlus_Expression = 34,
1016 // Error
1017 Error = 13,
1018 Error_Error = 36,
1019+ Error_Variable = 37,
1020 // LessThan
1021 LessThan = 23,
1022 LessThan_Equals = 46,
1023 LessThan_GreaterThan = 47,
1024 LessThan_Expression = 48,
1025+ LessThan_Equals_Expression = 67,
1026+ LessThan_GreaterThan_Expression = 68,
1027 // GreaterThan
1028 GreaterThan = 24,
1029- GreaterThan_Equals = 49,
1030+ GreaterThanEquals = 49,
1031 GreaterThan_Expression = 50,
1032+ GreaterThanEquals_Expressions = 69,
1033 // Operations
1034 AddTwoNumbers = 45,
1035 SubtractTwoNumbers = 52,
1036@@ -389,8 +185,11 @@ const enum State {
1037 PowerTwoNumbers = 55,
1038 // Variable
1039 Variable = 14,
1040+ Variable_FullError_Variable = 62,
1041 Variable_SemiColon = 71,
1042 Variable_Comma = 72,
1043+ Variable_FullError = 38,
1044+ Variable_FullError_Variable_ExclamationPoint = 73,
1045 // VariableSeq
1046 VariableSeq = 3,
1047 VariableSeq_Decimal = 30,
1048@@ -398,31 +197,39 @@ const enum State {
1049 // Pound
1050 Pound = 18,
1051 Pound_Variable = 42,
1052- // Other
1053- Expressions = 1,
1054- Expression = 2,
1055+ Pound_Variable_ExclamationPoint = 66,
1056+ // Left Paren
1057 LeftParen = 8,
1058- PrefixUnaryMinus = 9,
1059- PrefixUnaryPlus = 10,
1060+ LeftParen_Expression = 32,
1061+ LeftParen_Array = 61,
1062+ // Function
1063 Function = 11,
1064+ Function_LeftParen_ExpressionSeq = 59,
1065+ Function_RightParenNoArguments = 58,
1066+ Function_LeftParen_Expression = 60,
1067+ Function_LeftParen = 35,
1068+ Function_Etc_RightParen = 70,
1069+ // Expressions
1070+ Expressions = 1,
1071+ Expression = 2,
1072+ Expression_Plus = 22,
1073+ Expression_Minus = 26,
1074+ Expression_RightParen = 57,
1075+ Expression_Asterisk = 27,
1076+ Expression_Divide = 28,
1077+ Expression_Carrot = 29,
1078+ Expression_Ampersand = 20,
1079+ Expression_Percent = 31,
1080+ // Cell
1081 Cell = 12,
1082- NumberUpper = 15,
1083 FixedCell = 16,
1084 CellUpper = 17,
1085- EOF_ReturnLast = 19,
1086- LeftParen_Expression = 32,
1087- PrefixUnaryMinus_Expression = 33,
1088- PrefixUnaryPlus_Expression = 34,
1089- Function_LeftParen = 35,
1090- Number_Ampersand_Expression = 43,
1091- Expression_RightParen = 57,
1092- Function_RightParenNoArguments = 58,
1093- Function_LeftParen_Expression = 60,
1094- LeftParen_Array = 61,
1095- GTETwoExpressions = 69,
1096- CLOSE_PAREN_ON_FUNCTION = 70,
1097- Variable_FullError = 38,
1098- Error_Variable = 37
1099+ CellUpper_Colon_CellUpper = 65,
1100+ CellUpper_Colon = 41,
1101+ FixedCell_Colon = 40,
1102+ FixedCell_Colon_FixedCell = 64,
1103+ // Other
1104+ EOF_ReturnLast = 19
1105 }
1106
1107
1108@@ -434,1017 +241,997 @@ const enum State {
1109 let table = [];
1110 // All functions in the spreadsheet start with a 0-token.
1111 table[State.Start] = ObjectBuilder
1112- .add(Symbol.ERROR, State.Error)
1113- .add(Symbol.EXPRESSIONS, State.Expressions)
1114- .add(Symbol.EXPRESSION, State.Expression)
1115- .add(Symbol.VARIABLE_SEQUENCE, State.VariableSeq)
1116- .add(Symbol.NUMBER, State.Start_Number)
1117- .add(Symbol.STRING, [SHIFT, State.Start_String])
1118- .add(Symbol.PLUS, [SHIFT, State.PrefixUnaryPlus])
1119- .add(Symbol.LEFT_PAREN, [SHIFT, State.LeftParen])
1120- .add(Symbol.MINUS, [SHIFT, State.PrefixUnaryMinus])
1121- .add(Symbol.FUNCTION, [SHIFT, State.Function])
1122- .add(Symbol.CELL, State.Cell)
1123- .add(Symbol.FIXEDCELL, [SHIFT, State.FixedCell])
1124- .add(Symbol.CELL_UPPER, [SHIFT, State.CellUpper])
1125- .add(Symbol.VARIABLE, [SHIFT, State.Variable])
1126- .add(Symbol.NUMBER_UPPER, [SHIFT, State.NumberUpper])
1127- .add(Symbol.FULL_ERROR, [SHIFT, State.Pound])
1128+ .add(Symbol.Error, State.Error)
1129+ .add(Symbol.Expressions, State.Expressions)
1130+ .add(Symbol.Expression, State.Expression)
1131+ .add(Symbol.VariableSeq, State.VariableSeq)
1132+ .add(Symbol.Number, State.Start_Number)
1133+ .add(Symbol.String, [SHIFT, State.Start_String])
1134+ .add(Symbol.Plus, [SHIFT, State.PrefixUnaryPlus])
1135+ .add(Symbol.LeftParen, [SHIFT, State.LeftParen])
1136+ .add(Symbol.Minus, [SHIFT, State.PrefixUnaryMinus])
1137+ .add(Symbol.Function, [SHIFT, State.Function])
1138+ .add(Symbol.Cell, State.Cell)
1139+ .add(Symbol.FixedCell, [SHIFT, State.FixedCell])
1140+ .add(Symbol.CellUpper, [SHIFT, State.CellUpper])
1141+ .add(Symbol.Variable, [SHIFT, State.Variable])
1142+ .add(Symbol.NumberUpper, [SHIFT, State.Number])
1143+ .add(Symbol.FullError, [SHIFT, State.Pound])
1144 .build();
1145 table[State.Expressions] = ObjectBuilder
1146- .add(Symbol.END, [ACCEPT])
1147+ .add(Symbol.End, [ACCEPT])
1148 .build();
1149 table[State.Expression] = ObjectBuilder
1150 .add(Symbol.EOF, [SHIFT, State.EOF_ReturnLast])
1151- .add(Symbol.AMPERSAND, [SHIFT, State.Number_Ampersand])
1152- .add(Symbol.EQUALS, [SHIFT, State.Start_Equals])
1153- .add(Symbol.PLUS, [SHIFT, State.Number_Plus])
1154- .add(Symbol.LESS_THAN, [SHIFT, State.LessThan])
1155- .add(Symbol.GREATER_THAN, [SHIFT, State.GreaterThan])
1156- .add(Symbol.MINUS, [SHIFT, State.Number_Minus])
1157- .add(Symbol.ASTERISK, [SHIFT, State.Number_Asterisk])
1158- .add(Symbol.DIVIDE, [SHIFT, State.Number_Divide])
1159- .add(Symbol.CARROT, [SHIFT, State.Number_Carrot])
1160+ .add(Symbol.Ampersand, [SHIFT, State.Expression_Ampersand])
1161+ .add(Symbol.Equals, [SHIFT, State.Start_Equals])
1162+ .add(Symbol.Plus, [SHIFT, State.Expression_Plus])
1163+ .add(Symbol.LessThan, [SHIFT, State.LessThan])
1164+ .add(Symbol.GreaterThan, [SHIFT, State.GreaterThan])
1165+ .add(Symbol.Minus, [SHIFT, State.Expression_Minus])
1166+ .add(Symbol.Asterisk, [SHIFT, State.Expression_Asterisk])
1167+ .add(Symbol.Divide, [SHIFT, State.Expression_Divide])
1168+ .add(Symbol.Carrot, [SHIFT, State.Expression_Carrot])
1169 .build();
1170 table[State.VariableSeq] = ObjectBuilder
1171- .add(Symbol.EOF, [REDUCE, ReduceActions.CALL_VARIABLE])
1172- .add(Symbol.AMPERSAND, [REDUCE, ReduceActions.CALL_VARIABLE])
1173- .add(Symbol.EQUALS, [REDUCE, ReduceActions.CALL_VARIABLE])
1174- .add(Symbol.PLUS, [REDUCE, ReduceActions.CALL_VARIABLE])
1175- .add(Symbol.RIGHT_PAREN, [REDUCE, ReduceActions.CALL_VARIABLE])
1176- .add(Symbol.LESS_THAN, [REDUCE, ReduceActions.CALL_VARIABLE])
1177- .add(Symbol.GREATER_THAN, [REDUCE, ReduceActions.CALL_VARIABLE])
1178- .add(Symbol.MINUS, [REDUCE, ReduceActions.CALL_VARIABLE])
1179- .add(Symbol.ASTERISK, [REDUCE, ReduceActions.CALL_VARIABLE])
1180- .add(Symbol.DIVIDE, [REDUCE, ReduceActions.CALL_VARIABLE])
1181- .add(Symbol.CARROT, [REDUCE, ReduceActions.CALL_VARIABLE])
1182- .add(Symbol.SEMI_COLON, [REDUCE, ReduceActions.CALL_VARIABLE])
1183- .add(Symbol.COMMA, [REDUCE, ReduceActions.CALL_VARIABLE])
1184- .add(Symbol.DECIMAL, [SHIFT, State.VariableSeq_Decimal])
1185+ .add(Symbol.EOF, [REDUCE, ReduceActions.CallVariable])
1186+ .add(Symbol.Ampersand, [REDUCE, ReduceActions.CallVariable])
1187+ .add(Symbol.Equals, [REDUCE, ReduceActions.CallVariable])
1188+ .add(Symbol.Plus, [REDUCE, ReduceActions.CallVariable])
1189+ .add(Symbol.RightParen, [REDUCE, ReduceActions.CallVariable])
1190+ .add(Symbol.LessThan, [REDUCE, ReduceActions.CallVariable])
1191+ .add(Symbol.GreaterThan, [REDUCE, ReduceActions.CallVariable])
1192+ .add(Symbol.Minus, [REDUCE, ReduceActions.CallVariable])
1193+ .add(Symbol.Asterisk, [REDUCE, ReduceActions.CallVariable])
1194+ .add(Symbol.Divide, [REDUCE, ReduceActions.CallVariable])
1195+ .add(Symbol.Carrot, [REDUCE, ReduceActions.CallVariable])
1196+ .add(Symbol.Semicolon, [REDUCE, ReduceActions.CallVariable])
1197+ .add(Symbol.Comma, [REDUCE, ReduceActions.CallVariable])
1198+ .add(Symbol.Decimal, [SHIFT, State.VariableSeq_Decimal])
1199 .build();
1200 table[State.Start_Number] = ObjectBuilder
1201- .add(Symbol.EOF, [REDUCE, ReduceActions.AS_NUMBER])
1202- .add(Symbol.AMPERSAND, [REDUCE, ReduceActions.AS_NUMBER])
1203- .add(Symbol.EQUALS, [REDUCE, ReduceActions.AS_NUMBER])
1204- .add(Symbol.PLUS, [REDUCE, ReduceActions.AS_NUMBER])
1205- .add(Symbol.RIGHT_PAREN, [REDUCE, ReduceActions.AS_NUMBER])
1206- .add(Symbol.LESS_THAN, [REDUCE, ReduceActions.AS_NUMBER])
1207- .add(Symbol.GREATER_THAN, [REDUCE, ReduceActions.AS_NUMBER])
1208- .add(Symbol.MINUS, [REDUCE, ReduceActions.AS_NUMBER])
1209- .add(Symbol.ASTERISK, [REDUCE, ReduceActions.AS_NUMBER])
1210- .add(Symbol.DIVIDE, [REDUCE, ReduceActions.AS_NUMBER])
1211- .add(Symbol.CARROT, [REDUCE, ReduceActions.AS_NUMBER])
1212- .add(Symbol.SEMI_COLON, [REDUCE, ReduceActions.AS_NUMBER])
1213- .add(Symbol.COMMA, [REDUCE, ReduceActions.AS_NUMBER])
1214- .add(Symbol.PERCENT, [SHIFT, State.Number_Percent])
1215+ .add(Symbol.EOF, [REDUCE, ReduceActions.AsNumber])
1216+ .add(Symbol.Ampersand, [REDUCE, ReduceActions.AsNumber])
1217+ .add(Symbol.Equals, [REDUCE, ReduceActions.AsNumber])
1218+ .add(Symbol.Plus, [REDUCE, ReduceActions.AsNumber])
1219+ .add(Symbol.RightParen, [REDUCE, ReduceActions.AsNumber])
1220+ .add(Symbol.LessThan, [REDUCE, ReduceActions.AsNumber])
1221+ .add(Symbol.GreaterThan, [REDUCE, ReduceActions.AsNumber])
1222+ .add(Symbol.Minus, [REDUCE, ReduceActions.AsNumber])
1223+ .add(Symbol.Asterisk, [REDUCE, ReduceActions.AsNumber])
1224+ .add(Symbol.Divide, [REDUCE, ReduceActions.AsNumber])
1225+ .add(Symbol.Carrot, [REDUCE, ReduceActions.AsNumber])
1226+ .add(Symbol.Semicolon, [REDUCE, ReduceActions.AsNumber])
1227+ .add(Symbol.Comma, [REDUCE, ReduceActions.AsNumber])
1228+ .add(Symbol.Percent, [SHIFT, State.Expression_Percent])
1229 .build();
1230 table[State.Start_String] = ObjectBuilder
1231- .add(Symbol.EOF, [REDUCE, ReduceActions.AS_STRING])
1232- .add(Symbol.AMPERSAND, [REDUCE, ReduceActions.AS_STRING])
1233- .add(Symbol.EQUALS, [REDUCE, ReduceActions.AS_STRING])
1234- .add(Symbol.PLUS, [REDUCE, ReduceActions.AS_STRING])
1235- .add(Symbol.RIGHT_PAREN, [REDUCE, ReduceActions.AS_STRING])
1236- .add(Symbol.LESS_THAN, [REDUCE, ReduceActions.AS_STRING])
1237- .add(Symbol.GREATER_THAN, [REDUCE, ReduceActions.AS_STRING])
1238- .add(Symbol.MINUS, [REDUCE, ReduceActions.AS_STRING])
1239- .add(Symbol.ASTERISK, [REDUCE, ReduceActions.AS_STRING])
1240- .add(Symbol.DIVIDE, [REDUCE, ReduceActions.AS_STRING])
1241- .add(Symbol.CARROT, [REDUCE, ReduceActions.AS_STRING])
1242- .add(Symbol.SEMI_COLON, [REDUCE, ReduceActions.AS_STRING])
1243- .add(Symbol.COMMA, [REDUCE, ReduceActions.AS_STRING])
1244+ .add(Symbol.EOF, [REDUCE, ReduceActions.AsString])
1245+ .add(Symbol.Ampersand, [REDUCE, ReduceActions.AsString])
1246+ .add(Symbol.Equals, [REDUCE, ReduceActions.AsString])
1247+ .add(Symbol.Plus, [REDUCE, ReduceActions.AsString])
1248+ .add(Symbol.RightParen, [REDUCE, ReduceActions.AsString])
1249+ .add(Symbol.LessThan, [REDUCE, ReduceActions.AsString])
1250+ .add(Symbol.GreaterThan, [REDUCE, ReduceActions.AsString])
1251+ .add(Symbol.Minus, [REDUCE, ReduceActions.AsString])
1252+ .add(Symbol.Asterisk, [REDUCE, ReduceActions.AsString])
1253+ .add(Symbol.Divide, [REDUCE, ReduceActions.AsString])
1254+ .add(Symbol.Carrot, [REDUCE, ReduceActions.AsString])
1255+ .add(Symbol.Semicolon, [REDUCE, ReduceActions.AsString])
1256+ .add(Symbol.Comma, [REDUCE, ReduceActions.AsString])
1257 .build();
1258 table[State.LeftParen] = ObjectBuilder
1259- .add(Symbol.ERROR, State.Error)
1260- .add(Symbol.EXPRESSION, State.LeftParen_Expression)
1261- .add(Symbol.VARIABLE_SEQUENCE, State.VariableSeq)
1262- .add(Symbol.NUMBER, State.Start_Number)
1263- .add(Symbol.STRING, [SHIFT, State.Start_String])
1264- .add(Symbol.PLUS, [SHIFT, State.PrefixUnaryPlus])
1265- .add(Symbol.LEFT_PAREN, [SHIFT, State.LeftParen])
1266- .add(Symbol.MINUS, [SHIFT, State.PrefixUnaryMinus])
1267- .add(Symbol.FUNCTION, [SHIFT, State.Function])
1268- .add(Symbol.CELL, State.Cell)
1269- .add(Symbol.FIXEDCELL, [SHIFT, State.FixedCell])
1270- .add(Symbol.CELL_UPPER, [SHIFT, State.CellUpper])
1271- .add(Symbol.VARIABLE, [SHIFT, State.Variable])
1272- .add(Symbol.NUMBER_UPPER, [SHIFT, State.NumberUpper])
1273- .add(Symbol.FULL_ERROR, [SHIFT, State.Pound])
1274+ .add(Symbol.Error, State.Error)
1275+ .add(Symbol.Expression, State.LeftParen_Expression)
1276+ .add(Symbol.VariableSeq, State.VariableSeq)
1277+ .add(Symbol.Number, State.Start_Number)
1278+ .add(Symbol.String, [SHIFT, State.Start_String])
1279+ .add(Symbol.Plus, [SHIFT, State.PrefixUnaryPlus])
1280+ .add(Symbol.LeftParen, [SHIFT, State.LeftParen])
1281+ .add(Symbol.Minus, [SHIFT, State.PrefixUnaryMinus])
1282+ .add(Symbol.Function, [SHIFT, State.Function])
1283+ .add(Symbol.Cell, State.Cell)
1284+ .add(Symbol.FixedCell, [SHIFT, State.FixedCell])
1285+ .add(Symbol.CellUpper, [SHIFT, State.CellUpper])
1286+ .add(Symbol.Variable, [SHIFT, State.Variable])
1287+ .add(Symbol.NumberUpper, [SHIFT, State.Number])
1288+ .add(Symbol.FullError, [SHIFT, State.Pound])
1289 .build();
1290 table[State.PrefixUnaryMinus] = ObjectBuilder
1291- .add(Symbol.ERROR, State.Error)
1292- .add(Symbol.EXPRESSION, State.PrefixUnaryMinus_Expression)
1293- .add(Symbol.VARIABLE_SEQUENCE, State.VariableSeq)
1294- .add(Symbol.NUMBER, State.Start_Number)
1295- .add(Symbol.STRING, [SHIFT, State.Start_String])
1296- .add(Symbol.PLUS, [SHIFT, State.PrefixUnaryPlus])
1297- .add(Symbol.LEFT_PAREN, [SHIFT, State.LeftParen])
1298- .add(Symbol.MINUS, [SHIFT, State.PrefixUnaryMinus])
1299- .add(Symbol.FUNCTION, [SHIFT, State.Function])
1300- .add(Symbol.CELL, State.Cell)
1301- .add(Symbol.FIXEDCELL, [SHIFT, State.FixedCell])
1302- .add(Symbol.CELL_UPPER, [SHIFT, State.CellUpper])
1303- .add(Symbol.VARIABLE, [SHIFT, State.Variable])
1304- .add(Symbol.NUMBER_UPPER, [SHIFT, State.NumberUpper])
1305- .add(Symbol.FULL_ERROR, [SHIFT, State.Pound])
1306+ .add(Symbol.Error, State.Error)
1307+ .add(Symbol.Expression, State.PrefixUnaryMinus_Expression)
1308+ .add(Symbol.VariableSeq, State.VariableSeq)
1309+ .add(Symbol.Number, State.Start_Number)
1310+ .add(Symbol.String, [SHIFT, State.Start_String])
1311+ .add(Symbol.Plus, [SHIFT, State.PrefixUnaryPlus])
1312+ .add(Symbol.LeftParen, [SHIFT, State.LeftParen])
1313+ .add(Symbol.Minus, [SHIFT, State.PrefixUnaryMinus])
1314+ .add(Symbol.Function, [SHIFT, State.Function])
1315+ .add(Symbol.Cell, State.Cell)
1316+ .add(Symbol.FixedCell, [SHIFT, State.FixedCell])
1317+ .add(Symbol.CellUpper, [SHIFT, State.CellUpper])
1318+ .add(Symbol.Variable, [SHIFT, State.Variable])
1319+ .add(Symbol.NumberUpper, [SHIFT, State.Number])
1320+ .add(Symbol.FullError, [SHIFT, State.Pound])
1321 .build();
1322 table[State.PrefixUnaryPlus] = ObjectBuilder
1323- .add(Symbol.ERROR, State.Error)
1324- .add(Symbol.EXPRESSION, State.PrefixUnaryPlus_Expression)
1325- .add(Symbol.VARIABLE_SEQUENCE, State.VariableSeq)
1326- .add(Symbol.NUMBER, State.Start_Number)
1327- .add(Symbol.STRING, [SHIFT, State.Start_String])
1328- .add(Symbol.PLUS, [SHIFT, State.PrefixUnaryPlus])
1329- .add(Symbol.LEFT_PAREN, [SHIFT, State.LeftParen])
1330- .add(Symbol.MINUS, [SHIFT, State.PrefixUnaryMinus])
1331- .add(Symbol.FUNCTION, [SHIFT, State.Function])
1332- .add(Symbol.CELL, State.Cell)
1333- .add(Symbol.FIXEDCELL, [SHIFT, State.FixedCell])
1334- .add(Symbol.CELL_UPPER, [SHIFT, State.CellUpper])
1335- .add(Symbol.VARIABLE, [SHIFT, State.Variable])
1336- .add(Symbol.NUMBER_UPPER, [SHIFT, State.NumberUpper])
1337- .add(Symbol.FULL_ERROR, [SHIFT, State.Pound])
1338+ .add(Symbol.Error, State.Error)
1339+ .add(Symbol.Expression, State.PrefixUnaryPlus_Expression)
1340+ .add(Symbol.VariableSeq, State.VariableSeq)
1341+ .add(Symbol.Number, State.Start_Number)
1342+ .add(Symbol.String, [SHIFT, State.Start_String])
1343+ .add(Symbol.Plus, [SHIFT, State.PrefixUnaryPlus])
1344+ .add(Symbol.LeftParen, [SHIFT, State.LeftParen])
1345+ .add(Symbol.Minus, [SHIFT, State.PrefixUnaryMinus])
1346+ .add(Symbol.Function, [SHIFT, State.Function])
1347+ .add(Symbol.Cell, State.Cell)
1348+ .add(Symbol.FixedCell, [SHIFT, State.FixedCell])
1349+ .add(Symbol.CellUpper, [SHIFT, State.CellUpper])
1350+ .add(Symbol.Variable, [SHIFT, State.Variable])
1351+ .add(Symbol.NumberUpper, [SHIFT, State.Number])
1352+ .add(Symbol.FullError, [SHIFT, State.Pound])
1353 .build();
1354 table[State.Function] = ObjectBuilder
1355- .add(Symbol.LEFT_PAREN, [SHIFT, State.Function_LeftParen])
1356+ .add(Symbol.LeftParen, [SHIFT, State.Function_LeftParen])
1357 .build();
1358 table[State.Cell] = ObjectBuilder
1359- .add(Symbol.EOF, [REDUCE, ReduceActions.CELL_VALUE_AS_EXPRESSION])
1360- .add(Symbol.AMPERSAND, [REDUCE, ReduceActions.CELL_VALUE_AS_EXPRESSION])
1361- .add(Symbol.EQUALS, [REDUCE, ReduceActions.CELL_VALUE_AS_EXPRESSION])
1362- .add(Symbol.PLUS, [REDUCE, ReduceActions.CELL_VALUE_AS_EXPRESSION])
1363- .add(Symbol.RIGHT_PAREN, [REDUCE, ReduceActions.CELL_VALUE_AS_EXPRESSION])
1364- .add(Symbol.LESS_THAN, [REDUCE, ReduceActions.CELL_VALUE_AS_EXPRESSION])
1365- .add(Symbol.GREATER_THAN, [REDUCE, ReduceActions.CELL_VALUE_AS_EXPRESSION])
1366- .add(Symbol.MINUS, [REDUCE, ReduceActions.CELL_VALUE_AS_EXPRESSION])
1367- .add(Symbol.ASTERISK, [REDUCE, ReduceActions.CELL_VALUE_AS_EXPRESSION])
1368- .add(Symbol.DIVIDE, [REDUCE, ReduceActions.CELL_VALUE_AS_EXPRESSION])
1369- .add(Symbol.CARROT, [REDUCE, ReduceActions.CELL_VALUE_AS_EXPRESSION])
1370- .add(Symbol.SEMI_COLON, [REDUCE, ReduceActions.CELL_VALUE_AS_EXPRESSION])
1371- .add(Symbol.COMMA, [REDUCE, ReduceActions.CELL_VALUE_AS_EXPRESSION])
1372+ .add(Symbol.EOF, [REDUCE, ReduceActions.CellValueAsExpression])
1373+ .add(Symbol.Ampersand, [REDUCE, ReduceActions.CellValueAsExpression])
1374+ .add(Symbol.Equals, [REDUCE, ReduceActions.CellValueAsExpression])
1375+ .add(Symbol.Plus, [REDUCE, ReduceActions.CellValueAsExpression])
1376+ .add(Symbol.RightParen, [REDUCE, ReduceActions.CellValueAsExpression])
1377+ .add(Symbol.LessThan, [REDUCE, ReduceActions.CellValueAsExpression])
1378+ .add(Symbol.GreaterThan, [REDUCE, ReduceActions.CellValueAsExpression])
1379+ .add(Symbol.Minus, [REDUCE, ReduceActions.CellValueAsExpression])
1380+ .add(Symbol.Asterisk, [REDUCE, ReduceActions.CellValueAsExpression])
1381+ .add(Symbol.Divide, [REDUCE, ReduceActions.CellValueAsExpression])
1382+ .add(Symbol.Carrot, [REDUCE, ReduceActions.CellValueAsExpression])
1383+ .add(Symbol.Semicolon, [REDUCE, ReduceActions.CellValueAsExpression])
1384+ .add(Symbol.Comma, [REDUCE, ReduceActions.CellValueAsExpression])
1385 .build();
1386 table[State.Error] = ObjectBuilder
1387- .add(Symbol.ERROR, State.Error_Error)
1388- .add(Symbol.EOF, [REDUCE, ReduceActions.ERROR_AND_CONTINUE])
1389- .add(Symbol.AMPERSAND, [REDUCE, ReduceActions.ERROR_AND_CONTINUE])
1390- .add(Symbol.EQUALS, [REDUCE, ReduceActions.ERROR_AND_CONTINUE])
1391- .add(Symbol.PLUS, [REDUCE, ReduceActions.ERROR_AND_CONTINUE])
1392- .add(Symbol.RIGHT_PAREN, [REDUCE, ReduceActions.ERROR_AND_CONTINUE])
1393- .add(Symbol.LESS_THAN, [REDUCE, ReduceActions.ERROR_AND_CONTINUE])
1394- .add(Symbol.GREATER_THAN, [REDUCE, ReduceActions.ERROR_AND_CONTINUE])
1395- .add(Symbol.MINUS, [REDUCE, ReduceActions.ERROR_AND_CONTINUE])
1396- .add(Symbol.ASTERISK, [REDUCE, ReduceActions.ERROR_AND_CONTINUE])
1397- .add(Symbol.DIVIDE, [REDUCE, ReduceActions.ERROR_AND_CONTINUE])
1398- .add(Symbol.CARROT, [REDUCE, ReduceActions.ERROR_AND_CONTINUE])
1399- .add(Symbol.SEMI_COLON, [REDUCE, ReduceActions.ERROR_AND_CONTINUE])
1400- .add(Symbol.COMMA, [REDUCE, ReduceActions.ERROR_AND_CONTINUE])
1401- .add(Symbol.VARIABLE, [SHIFT, State.Error_Variable])
1402- .add(Symbol.FULL_ERROR, [SHIFT, 18])
1403+ .add(Symbol.Error, State.Error_Error)
1404+ .add(Symbol.EOF, [REDUCE, ReduceActions.ErrorAndContinue])
1405+ .add(Symbol.Ampersand, [REDUCE, ReduceActions.ErrorAndContinue])
1406+ .add(Symbol.Equals, [REDUCE, ReduceActions.ErrorAndContinue])
1407+ .add(Symbol.Plus, [REDUCE, ReduceActions.ErrorAndContinue])
1408+ .add(Symbol.RightParen, [REDUCE, ReduceActions.ErrorAndContinue])
1409+ .add(Symbol.LessThan, [REDUCE, ReduceActions.ErrorAndContinue])
1410+ .add(Symbol.GreaterThan, [REDUCE, ReduceActions.ErrorAndContinue])
1411+ .add(Symbol.Minus, [REDUCE, ReduceActions.ErrorAndContinue])
1412+ .add(Symbol.Asterisk, [REDUCE, ReduceActions.ErrorAndContinue])
1413+ .add(Symbol.Divide, [REDUCE, ReduceActions.ErrorAndContinue])
1414+ .add(Symbol.Carrot, [REDUCE, ReduceActions.ErrorAndContinue])
1415+ .add(Symbol.Semicolon, [REDUCE, ReduceActions.ErrorAndContinue])
1416+ .add(Symbol.Comma, [REDUCE, ReduceActions.ErrorAndContinue])
1417+ .add(Symbol.Variable, [SHIFT, State.Error_Variable])
1418+ .add(Symbol.FullError, [SHIFT, State.Pound])
1419 .build();
1420 table[State.Variable] = ObjectBuilder
1421- .add(Symbol.EOF, [REDUCE, ReduceActions.WRAP_CURRENT_INDEX_TOKEN_AS_ARRAY])
1422- .add(Symbol.AMPERSAND, [REDUCE, ReduceActions.WRAP_CURRENT_INDEX_TOKEN_AS_ARRAY])
1423- .add(Symbol.EQUALS, [REDUCE, ReduceActions.WRAP_CURRENT_INDEX_TOKEN_AS_ARRAY])
1424- .add(Symbol.PLUS, [REDUCE, ReduceActions.WRAP_CURRENT_INDEX_TOKEN_AS_ARRAY])
1425- .add(Symbol.RIGHT_PAREN, [REDUCE, ReduceActions.WRAP_CURRENT_INDEX_TOKEN_AS_ARRAY])
1426- .add(Symbol.LESS_THAN, [REDUCE, ReduceActions.WRAP_CURRENT_INDEX_TOKEN_AS_ARRAY])
1427- .add(Symbol.GREATER_THAN, [REDUCE, ReduceActions.WRAP_CURRENT_INDEX_TOKEN_AS_ARRAY])
1428- .add(Symbol.MINUS, [REDUCE, ReduceActions.WRAP_CURRENT_INDEX_TOKEN_AS_ARRAY])
1429- .add(Symbol.ASTERISK, [REDUCE, ReduceActions.WRAP_CURRENT_INDEX_TOKEN_AS_ARRAY])
1430- .add(Symbol.DIVIDE, [REDUCE, ReduceActions.WRAP_CURRENT_INDEX_TOKEN_AS_ARRAY])
1431- .add(Symbol.CARROT, [REDUCE, ReduceActions.WRAP_CURRENT_INDEX_TOKEN_AS_ARRAY])
1432- .add(Symbol.SEMI_COLON, [REDUCE, ReduceActions.WRAP_CURRENT_INDEX_TOKEN_AS_ARRAY])
1433- .add(Symbol.COMMA, [REDUCE, ReduceActions.WRAP_CURRENT_INDEX_TOKEN_AS_ARRAY])
1434- .add(Symbol.DECIMAL, [REDUCE, ReduceActions.WRAP_CURRENT_INDEX_TOKEN_AS_ARRAY])
1435- .add(Symbol.FULL_ERROR, [SHIFT, State.Variable_FullError])
1436- .build();
1437-table[State.NumberUpper] = ObjectBuilder
1438- .add(Symbol.EOF, [REDUCE, ReduceActions.REFLEXIVE_REDUCE])
1439- .add(Symbol.AMPERSAND, [REDUCE, ReduceActions.REFLEXIVE_REDUCE])
1440- .add(Symbol.EQUALS, [REDUCE, ReduceActions.REFLEXIVE_REDUCE])
1441- .add(Symbol.PLUS, [REDUCE, ReduceActions.REFLEXIVE_REDUCE])
1442- .add(Symbol.RIGHT_PAREN, [REDUCE, ReduceActions.REFLEXIVE_REDUCE])
1443- .add(Symbol.LESS_THAN, [REDUCE, ReduceActions.REFLEXIVE_REDUCE])
1444- .add(Symbol.GREATER_THAN, [REDUCE, ReduceActions.REFLEXIVE_REDUCE])
1445- .add(Symbol.MINUS, [REDUCE, ReduceActions.REFLEXIVE_REDUCE])
1446- .add(Symbol.ASTERISK, [REDUCE, ReduceActions.REFLEXIVE_REDUCE])
1447- .add(Symbol.DIVIDE, [REDUCE, ReduceActions.REFLEXIVE_REDUCE])
1448- .add(Symbol.CARROT, [REDUCE, ReduceActions.REFLEXIVE_REDUCE])
1449- .add(Symbol.SEMI_COLON, [REDUCE, ReduceActions.REFLEXIVE_REDUCE])
1450- .add(Symbol.COMMA, [REDUCE, ReduceActions.REFLEXIVE_REDUCE])
1451- .add(Symbol.DECIMAL, [SHIFT, 39])
1452- .add(Symbol.PERCENT, [REDUCE, ReduceActions.REFLEXIVE_REDUCE])
1453- .add(38, [REDUCE, ReduceActions.REFLEXIVE_REDUCE])
1454+ .add(Symbol.EOF, [REDUCE, ReduceActions.WrapCurrentTokenAsArray])
1455+ .add(Symbol.Ampersand, [REDUCE, ReduceActions.WrapCurrentTokenAsArray])
1456+ .add(Symbol.Equals, [REDUCE, ReduceActions.WrapCurrentTokenAsArray])
1457+ .add(Symbol.Plus, [REDUCE, ReduceActions.WrapCurrentTokenAsArray])
1458+ .add(Symbol.RightParen, [REDUCE, ReduceActions.WrapCurrentTokenAsArray])
1459+ .add(Symbol.LessThan, [REDUCE, ReduceActions.WrapCurrentTokenAsArray])
1460+ .add(Symbol.GreaterThan, [REDUCE, ReduceActions.WrapCurrentTokenAsArray])
1461+ .add(Symbol.Minus, [REDUCE, ReduceActions.WrapCurrentTokenAsArray])
1462+ .add(Symbol.Asterisk, [REDUCE, ReduceActions.WrapCurrentTokenAsArray])
1463+ .add(Symbol.Divide, [REDUCE, ReduceActions.WrapCurrentTokenAsArray])
1464+ .add(Symbol.Carrot, [REDUCE, ReduceActions.WrapCurrentTokenAsArray])
1465+ .add(Symbol.Semicolon, [REDUCE, ReduceActions.WrapCurrentTokenAsArray])
1466+ .add(Symbol.Comma, [REDUCE, ReduceActions.WrapCurrentTokenAsArray])
1467+ .add(Symbol.Decimal, [REDUCE, ReduceActions.WrapCurrentTokenAsArray])
1468+ .add(Symbol.FullError, [SHIFT, State.Variable_FullError])
1469+ .build();
1470+table[State.Number] = ObjectBuilder
1471+ .add(Symbol.EOF, [REDUCE, ReduceActions.ReflexiveReduce])
1472+ .add(Symbol.Ampersand, [REDUCE, ReduceActions.ReflexiveReduce])
1473+ .add(Symbol.Equals, [REDUCE, ReduceActions.ReflexiveReduce])
1474+ .add(Symbol.Plus, [REDUCE, ReduceActions.ReflexiveReduce])
1475+ .add(Symbol.RightParen, [REDUCE, ReduceActions.ReflexiveReduce])
1476+ .add(Symbol.LessThan, [REDUCE, ReduceActions.ReflexiveReduce])
1477+ .add(Symbol.GreaterThan, [REDUCE, ReduceActions.ReflexiveReduce])
1478+ .add(Symbol.Minus, [REDUCE, ReduceActions.ReflexiveReduce])
1479+ .add(Symbol.Asterisk, [REDUCE, ReduceActions.ReflexiveReduce])
1480+ .add(Symbol.Divide, [REDUCE, ReduceActions.ReflexiveReduce])
1481+ .add(Symbol.Carrot, [REDUCE, ReduceActions.ReflexiveReduce])
1482+ .add(Symbol.Semicolon, [REDUCE, ReduceActions.ReflexiveReduce])
1483+ .add(Symbol.Comma, [REDUCE, ReduceActions.ReflexiveReduce])
1484+ .add(Symbol.Decimal, [SHIFT, State.Number_Decimal])
1485+ .add(Symbol.Percent, [REDUCE, ReduceActions.ReflexiveReduce])
1486+ .add(Symbol.ReflexiveReduce, [REDUCE, ReduceActions.ReflexiveReduce])
1487 .build();
1488 table[State.FixedCell] = ObjectBuilder
1489- .add(Symbol.EOF, [REDUCE, ReduceActions.FIXED_CELL_VAL])
1490- .add(Symbol.AMPERSAND, [REDUCE, ReduceActions.FIXED_CELL_VAL])
1491- .add(Symbol.EQUALS, [REDUCE, ReduceActions.FIXED_CELL_VAL])
1492- .add(Symbol.PLUS, [REDUCE, ReduceActions.FIXED_CELL_VAL])
1493- .add(Symbol.RIGHT_PAREN, [REDUCE, ReduceActions.FIXED_CELL_VAL])
1494- .add(Symbol.LESS_THAN, [REDUCE, ReduceActions.FIXED_CELL_VAL])
1495- .add(Symbol.GREATER_THAN, [REDUCE, ReduceActions.FIXED_CELL_VAL])
1496- .add(Symbol.MINUS, [REDUCE, ReduceActions.FIXED_CELL_VAL])
1497- .add(Symbol.ASTERISK, [REDUCE, ReduceActions.FIXED_CELL_VAL])
1498- .add(Symbol.DIVIDE, [REDUCE, ReduceActions.FIXED_CELL_VAL])
1499- .add(Symbol.CARROT, [REDUCE, ReduceActions.FIXED_CELL_VAL])
1500- .add(Symbol.COLON, [SHIFT, 40])
1501- .add(Symbol.SEMI_COLON, [REDUCE, ReduceActions.FIXED_CELL_VAL])
1502- .add(Symbol.COMMA, [REDUCE, ReduceActions.FIXED_CELL_VAL])
1503+ .add(Symbol.EOF, [REDUCE, ReduceActions.FixedCellValue])
1504+ .add(Symbol.Ampersand, [REDUCE, ReduceActions.FixedCellValue])
1505+ .add(Symbol.Equals, [REDUCE, ReduceActions.FixedCellValue])
1506+ .add(Symbol.Plus, [REDUCE, ReduceActions.FixedCellValue])
1507+ .add(Symbol.RightParen, [REDUCE, ReduceActions.FixedCellValue])
1508+ .add(Symbol.LessThan, [REDUCE, ReduceActions.FixedCellValue])
1509+ .add(Symbol.GreaterThan, [REDUCE, ReduceActions.FixedCellValue])
1510+ .add(Symbol.Minus, [REDUCE, ReduceActions.FixedCellValue])
1511+ .add(Symbol.Asterisk, [REDUCE, ReduceActions.FixedCellValue])
1512+ .add(Symbol.Divide, [REDUCE, ReduceActions.FixedCellValue])
1513+ .add(Symbol.Carrot, [REDUCE, ReduceActions.FixedCellValue])
1514+ .add(Symbol.Colon, [SHIFT, State.FixedCell_Colon])
1515+ .add(Symbol.Semicolon, [REDUCE, ReduceActions.FixedCellValue])
1516+ .add(Symbol.Comma, [REDUCE, ReduceActions.FixedCellValue])
1517 .build();
1518 table[State.CellUpper] = ObjectBuilder
1519- .add(Symbol.EOF, [REDUCE, ReduceActions.CELL_VALUE])
1520- .add(Symbol.AMPERSAND, [REDUCE, ReduceActions.CELL_VALUE])
1521- .add(Symbol.EQUALS, [REDUCE, ReduceActions.CELL_VALUE])
1522- .add(Symbol.PLUS, [REDUCE, ReduceActions.CELL_VALUE])
1523- .add(Symbol.RIGHT_PAREN, [REDUCE, ReduceActions.CELL_VALUE])
1524- .add(Symbol.LESS_THAN, [REDUCE, ReduceActions.CELL_VALUE])
1525- .add(Symbol.GREATER_THAN, [REDUCE, ReduceActions.CELL_VALUE])
1526- .add(Symbol.MINUS, [REDUCE, ReduceActions.CELL_VALUE])
1527- .add(Symbol.ASTERISK, [REDUCE, ReduceActions.CELL_VALUE])
1528- .add(Symbol.DIVIDE, [REDUCE, ReduceActions.CELL_VALUE])
1529- .add(Symbol.CARROT, [REDUCE, ReduceActions.CELL_VALUE])
1530- .add(Symbol.COLON, [SHIFT, 41])
1531- .add(Symbol.SEMI_COLON, [REDUCE, ReduceActions.CELL_VALUE])
1532- .add(Symbol.COMMA, [REDUCE, ReduceActions.CELL_VALUE])
1533+ .add(Symbol.EOF, [REDUCE, ReduceActions.CellValue])
1534+ .add(Symbol.Ampersand, [REDUCE, ReduceActions.CellValue])
1535+ .add(Symbol.Equals, [REDUCE, ReduceActions.CellValue])
1536+ .add(Symbol.Plus, [REDUCE, ReduceActions.CellValue])
1537+ .add(Symbol.RightParen, [REDUCE, ReduceActions.CellValue])
1538+ .add(Symbol.LessThan, [REDUCE, ReduceActions.CellValue])
1539+ .add(Symbol.GreaterThan, [REDUCE, ReduceActions.CellValue])
1540+ .add(Symbol.Minus, [REDUCE, ReduceActions.CellValue])
1541+ .add(Symbol.Asterisk, [REDUCE, ReduceActions.CellValue])
1542+ .add(Symbol.Divide, [REDUCE, ReduceActions.CellValue])
1543+ .add(Symbol.Carrot, [REDUCE, ReduceActions.CellValue])
1544+ .add(Symbol.Colon, [SHIFT, State.CellUpper_Colon])
1545+ .add(Symbol.Semicolon, [REDUCE, ReduceActions.CellValue])
1546+ .add(Symbol.Comma, [REDUCE, ReduceActions.CellValue])
1547 .build();
1548 table[State.Pound] = ObjectBuilder
1549- .add(Symbol.VARIABLE, [SHIFT, State.Pound_Variable])
1550- .add(Symbol.EOF, [REDUCE, ReduceActions.AS_ERROR])
1551- .add(Symbol.RIGHT_PAREN, [REDUCE, ReduceActions.AS_ERROR])
1552- .add(Symbol.COMMA, [REDUCE, ReduceActions.AS_ERROR])
1553+ .add(Symbol.Variable, [SHIFT, State.Pound_Variable])
1554+ .add(Symbol.EOF, [REDUCE, ReduceActions.AsError])
1555+ .add(Symbol.RightParen, [REDUCE, ReduceActions.AsError])
1556+ .add(Symbol.Comma, [REDUCE, ReduceActions.AsError])
1557 .build();
1558 table[State.EOF_ReturnLast] = ObjectBuilder
1559- .add(Symbol.END, [REDUCE, ReduceActions.RETURN_LAST])
1560- .build();
1561-table[State.Number_Ampersand] = ObjectBuilder
1562- .add(Symbol.ERROR, State.Error)
1563- .add(Symbol.EXPRESSION, State.Number_Ampersand_Expression)
1564- .add(Symbol.VARIABLE_SEQUENCE, State.VariableSeq)
1565- .add(Symbol.NUMBER, State.Start_Number)
1566- .add(Symbol.STRING, [SHIFT, State.Start_String])
1567- .add(Symbol.PLUS, [SHIFT, State.PrefixUnaryPlus])
1568- .add(Symbol.LEFT_PAREN, [SHIFT, State.LeftParen])
1569- .add(Symbol.MINUS, [SHIFT, State.PrefixUnaryMinus])
1570- .add(Symbol.FUNCTION, [SHIFT, State.Function])
1571- .add(Symbol.CELL, State.Cell)
1572- .add(Symbol.FIXEDCELL, [SHIFT, State.FixedCell])
1573- .add(Symbol.CELL_UPPER, [SHIFT, State.CellUpper])
1574- .add(Symbol.VARIABLE, [SHIFT, State.Variable])
1575- .add(Symbol.NUMBER_UPPER, [SHIFT, State.NumberUpper])
1576- .add(Symbol.FULL_ERROR, [SHIFT, 18])
1577+ .add(Symbol.End, [REDUCE, ReduceActions.ReturnLast])
1578+ .build();
1579+table[State.Expression_Ampersand] = ObjectBuilder
1580+ .add(Symbol.Error, State.Error)
1581+ .add(Symbol.Expression, State.Number_Ampersand_Expression)
1582+ .add(Symbol.VariableSeq, State.VariableSeq)
1583+ .add(Symbol.Number, State.Start_Number)
1584+ .add(Symbol.String, [SHIFT, State.Start_String])
1585+ .add(Symbol.Plus, [SHIFT, State.PrefixUnaryPlus])
1586+ .add(Symbol.LeftParen, [SHIFT, State.LeftParen])
1587+ .add(Symbol.Minus, [SHIFT, State.PrefixUnaryMinus])
1588+ .add(Symbol.Function, [SHIFT, State.Function])
1589+ .add(Symbol.Cell, State.Cell)
1590+ .add(Symbol.FixedCell, [SHIFT, State.FixedCell])
1591+ .add(Symbol.CellUpper, [SHIFT, State.CellUpper])
1592+ .add(Symbol.Variable, [SHIFT, State.Variable])
1593+ .add(Symbol.NumberUpper, [SHIFT, State.Number])
1594+ .add(Symbol.FullError, [SHIFT, State.Pound])
1595 .build();
1596 table[State.Start_Equals] = ObjectBuilder
1597- .add(Symbol.ERROR, State.Error)
1598- .add(Symbol.EXPRESSION, State.Start_Equals_Expression)
1599- .add(Symbol.VARIABLE_SEQUENCE, State.VariableSeq)
1600- .add(Symbol.NUMBER, State.Start_Number)
1601- .add(Symbol.STRING, [SHIFT, State.Start_String])
1602- .add(Symbol.PLUS, [SHIFT, State.PrefixUnaryPlus])
1603- .add(Symbol.LEFT_PAREN, [SHIFT, State.LeftParen])
1604- .add(Symbol.MINUS, [SHIFT, State.PrefixUnaryMinus])
1605- .add(Symbol.FUNCTION, [SHIFT, State.Function])
1606- .add(Symbol.CELL, State.Cell)
1607- .add(Symbol.FIXEDCELL, [SHIFT, State.FixedCell])
1608- .add(Symbol.CELL_UPPER, [SHIFT, State.CellUpper])
1609- .add(Symbol.VARIABLE, [SHIFT, State.Variable])
1610- .add(Symbol.NUMBER_UPPER, [SHIFT, State.NumberUpper])
1611- .add(Symbol.FULL_ERROR, [SHIFT, State.Pound])
1612- .build();
1613-table[State.Number_Plus] = ObjectBuilder
1614- .add(Symbol.ERROR, State.Error)
1615- .add(Symbol.EXPRESSION, State.AddTwoNumbers)
1616- .add(Symbol.VARIABLE_SEQUENCE, State.VariableSeq)
1617- .add(Symbol.NUMBER, State.Start_Number)
1618- .add(Symbol.STRING, [SHIFT, State.Start_String])
1619- .add(Symbol.PLUS, [SHIFT, State.PrefixUnaryPlus])
1620- .add(Symbol.LEFT_PAREN, [SHIFT, State.LeftParen])
1621- .add(Symbol.MINUS, [SHIFT, State.PrefixUnaryMinus])
1622- .add(Symbol.FUNCTION, [SHIFT, State.Function])
1623- .add(Symbol.CELL, State.Cell)
1624- .add(Symbol.FIXEDCELL, [SHIFT, State.FixedCell])
1625- .add(Symbol.CELL_UPPER, [SHIFT, State.CellUpper])
1626- .add(Symbol.VARIABLE, [SHIFT, State.Variable])
1627- .add(Symbol.NUMBER_UPPER, [SHIFT, State.NumberUpper])
1628- .add(Symbol.FULL_ERROR, [SHIFT, State.Pound])
1629+ .add(Symbol.Error, State.Error)
1630+ .add(Symbol.Expression, State.Start_Equals_Expression)
1631+ .add(Symbol.VariableSeq, State.VariableSeq)
1632+ .add(Symbol.Number, State.Start_Number)
1633+ .add(Symbol.String, [SHIFT, State.Start_String])
1634+ .add(Symbol.Plus, [SHIFT, State.PrefixUnaryPlus])
1635+ .add(Symbol.LeftParen, [SHIFT, State.LeftParen])
1636+ .add(Symbol.Minus, [SHIFT, State.PrefixUnaryMinus])
1637+ .add(Symbol.Function, [SHIFT, State.Function])
1638+ .add(Symbol.Cell, State.Cell)
1639+ .add(Symbol.FixedCell, [SHIFT, State.FixedCell])
1640+ .add(Symbol.CellUpper, [SHIFT, State.CellUpper])
1641+ .add(Symbol.Variable, [SHIFT, State.Variable])
1642+ .add(Symbol.NumberUpper, [SHIFT, State.Number])
1643+ .add(Symbol.FullError, [SHIFT, State.Pound])
1644+ .build();
1645+table[State.Expression_Plus] = ObjectBuilder
1646+ .add(Symbol.Error, State.Error)
1647+ .add(Symbol.Expression, State.AddTwoNumbers)
1648+ .add(Symbol.VariableSeq, State.VariableSeq)
1649+ .add(Symbol.Number, State.Start_Number)
1650+ .add(Symbol.String, [SHIFT, State.Start_String])
1651+ .add(Symbol.Plus, [SHIFT, State.PrefixUnaryPlus])
1652+ .add(Symbol.LeftParen, [SHIFT, State.LeftParen])
1653+ .add(Symbol.Minus, [SHIFT, State.PrefixUnaryMinus])
1654+ .add(Symbol.Function, [SHIFT, State.Function])
1655+ .add(Symbol.Cell, State.Cell)
1656+ .add(Symbol.FixedCell, [SHIFT, State.FixedCell])
1657+ .add(Symbol.CellUpper, [SHIFT, State.CellUpper])
1658+ .add(Symbol.Variable, [SHIFT, State.Variable])
1659+ .add(Symbol.NumberUpper, [SHIFT, State.Number])
1660+ .add(Symbol.FullError, [SHIFT, State.Pound])
1661 .build();
1662 table[State.LessThan] = ObjectBuilder
1663- .add(Symbol.ERROR, State.Error)
1664- .add(Symbol.EXPRESSION, State.LessThan_Expression)
1665- .add(Symbol.VARIABLE_SEQUENCE, State.VariableSeq)
1666- .add(Symbol.NUMBER, State.Start_Number)
1667- .add(Symbol.STRING, [SHIFT, State.Start_String])
1668- .add(Symbol.EQUALS, [SHIFT, State.LessThan_Equals])
1669- .add(Symbol.PLUS, [SHIFT, State.PrefixUnaryPlus])
1670- .add(Symbol.LEFT_PAREN, [SHIFT, State.LeftParen])
1671- .add(Symbol.GREATER_THAN, [SHIFT, State.LessThan_GreaterThan])
1672- .add(Symbol.MINUS, [SHIFT, State.PrefixUnaryMinus])
1673- .add(Symbol.FUNCTION, [SHIFT, State.Function])
1674- .add(Symbol.CELL, State.Cell)
1675- .add(Symbol.FIXEDCELL, [SHIFT, State.FixedCell])
1676- .add(Symbol.CELL_UPPER, [SHIFT, State.CellUpper])
1677- .add(Symbol.VARIABLE, [SHIFT, State.Variable])
1678- .add(Symbol.NUMBER_UPPER, [SHIFT, State.NumberUpper])
1679- .add(Symbol.FULL_ERROR, [SHIFT, State.Pound])
1680+ .add(Symbol.Error, State.Error)
1681+ .add(Symbol.Expression, State.LessThan_Expression)
1682+ .add(Symbol.VariableSeq, State.VariableSeq)
1683+ .add(Symbol.Number, State.Start_Number)
1684+ .add(Symbol.String, [SHIFT, State.Start_String])
1685+ .add(Symbol.Equals, [SHIFT, State.LessThan_Equals])
1686+ .add(Symbol.Plus, [SHIFT, State.PrefixUnaryPlus])
1687+ .add(Symbol.LeftParen, [SHIFT, State.LeftParen])
1688+ .add(Symbol.GreaterThan, [SHIFT, State.LessThan_GreaterThan])
1689+ .add(Symbol.Minus, [SHIFT, State.PrefixUnaryMinus])
1690+ .add(Symbol.Function, [SHIFT, State.Function])
1691+ .add(Symbol.Cell, State.Cell)
1692+ .add(Symbol.FixedCell, [SHIFT, State.FixedCell])
1693+ .add(Symbol.CellUpper, [SHIFT, State.CellUpper])
1694+ .add(Symbol.Variable, [SHIFT, State.Variable])
1695+ .add(Symbol.NumberUpper, [SHIFT, State.Number])
1696+ .add(Symbol.FullError, [SHIFT, State.Pound])
1697 .build();
1698 table[State.GreaterThan] = ObjectBuilder
1699- .add(Symbol.ERROR, State.Error)
1700- .add(Symbol.EXPRESSION, State.GreaterThan_Expression)
1701- .add(Symbol.VARIABLE_SEQUENCE, State.VariableSeq)
1702- .add(Symbol.NUMBER, State.Start_Number)
1703- .add(Symbol.STRING, [SHIFT, State.Start_String])
1704- .add(Symbol.EQUALS, [SHIFT, State.GreaterThan_Equals])
1705- .add(Symbol.PLUS, [SHIFT, State.PrefixUnaryPlus])
1706- .add(Symbol.LEFT_PAREN, [SHIFT, State.LeftParen])
1707- .add(Symbol.MINUS, [SHIFT, State.PrefixUnaryMinus])
1708- .add(Symbol.FUNCTION, [SHIFT, State.Function])
1709- .add(Symbol.CELL, State.Cell)
1710- .add(Symbol.FIXEDCELL, [SHIFT, State.FixedCell])
1711- .add(Symbol.CELL_UPPER, [SHIFT, State.CellUpper])
1712- .add(Symbol.VARIABLE, [SHIFT, State.Variable])
1713- .add(Symbol.NUMBER_UPPER, [SHIFT, State.NumberUpper])
1714- .add(Symbol.FULL_ERROR, [SHIFT, State.Pound])
1715- .build();
1716-table[25] = ObjectBuilder
1717- .add(Symbol.ERROR, State.Error)
1718- .add(Symbol.EXPRESSION, 51)
1719- .add(Symbol.VARIABLE_SEQUENCE, State.VariableSeq)
1720- .add(Symbol.NUMBER, State.Start_Number)
1721- .add(Symbol.STRING, [SHIFT, State.Start_String])
1722- .add(Symbol.PLUS, [SHIFT, State.PrefixUnaryPlus])
1723- .add(Symbol.LEFT_PAREN, [SHIFT, State.LeftParen])
1724- .add(Symbol.MINUS, [SHIFT, State.PrefixUnaryMinus])
1725- .add(Symbol.FUNCTION, [SHIFT, State.Function])
1726- .add(Symbol.CELL, State.Cell)
1727- .add(Symbol.FIXEDCELL, [SHIFT, State.FixedCell])
1728- .add(Symbol.CELL_UPPER, [SHIFT, State.CellUpper])
1729- .add(Symbol.VARIABLE, [SHIFT, State.Variable])
1730- .add(Symbol.NUMBER_UPPER, [SHIFT, State.NumberUpper])
1731- .add(Symbol.FULL_ERROR, [SHIFT, State.Pound])
1732- .build();
1733-table[State.Number_Minus] = ObjectBuilder
1734- .add(Symbol.ERROR, State.Error)
1735- .add(Symbol.EXPRESSION, State.SubtractTwoNumbers)
1736- .add(Symbol.VARIABLE_SEQUENCE, State.VariableSeq)
1737- .add(Symbol.NUMBER, State.Start_Number)
1738- .add(Symbol.STRING, [SHIFT, State.Start_String])
1739- .add(Symbol.PLUS, [SHIFT, State.PrefixUnaryPlus])
1740- .add(Symbol.LEFT_PAREN, [SHIFT, State.LeftParen])
1741- .add(Symbol.MINUS, [SHIFT, State.PrefixUnaryMinus])
1742- .add(Symbol.FUNCTION, [SHIFT, State.Function])
1743- .add(Symbol.CELL, State.Cell)
1744- .add(Symbol.FIXEDCELL, [SHIFT, State.FixedCell])
1745- .add(Symbol.CELL_UPPER, [SHIFT, State.CellUpper])
1746- .add(Symbol.VARIABLE, [SHIFT, State.Variable])
1747- .add(Symbol.NUMBER_UPPER, [SHIFT, State.NumberUpper])
1748- .add(Symbol.FULL_ERROR, [SHIFT, State.Pound])
1749- .build();
1750-table[State.Number_Asterisk] = ObjectBuilder
1751- .add(Symbol.ERROR, State.Error)
1752- .add(Symbol.EXPRESSION, State.MultiplyTwoNumbers)
1753- .add(Symbol.VARIABLE_SEQUENCE, State.VariableSeq)
1754- .add(Symbol.NUMBER, State.Start_Number)
1755- .add(Symbol.STRING, [SHIFT, State.Start_String])
1756- .add(Symbol.PLUS, [SHIFT, State.PrefixUnaryPlus])
1757- .add(Symbol.LEFT_PAREN, [SHIFT, State.LeftParen])
1758- .add(Symbol.MINUS, [SHIFT, State.PrefixUnaryMinus])
1759- .add(Symbol.FUNCTION, [SHIFT, State.Function])
1760- .add(Symbol.CELL, State.Cell)
1761- .add(Symbol.FIXEDCELL, [SHIFT, State.FixedCell])
1762- .add(Symbol.CELL_UPPER, [SHIFT, State.CellUpper])
1763- .add(Symbol.VARIABLE, [SHIFT, State.Variable])
1764- .add(Symbol.NUMBER_UPPER, [SHIFT, State.NumberUpper])
1765- .add(Symbol.FULL_ERROR, [SHIFT, State.Pound])
1766- .build();
1767-table[State.Number_Divide] = ObjectBuilder
1768- .add(Symbol.ERROR, State.Error)
1769- .add(Symbol.EXPRESSION, State.DivideTwoNumbers)
1770- .add(Symbol.VARIABLE_SEQUENCE, State.VariableSeq)
1771- .add(Symbol.NUMBER, State.Start_Number)
1772- .add(Symbol.STRING, [SHIFT, State.Start_String])
1773- .add(Symbol.PLUS, [SHIFT, State.PrefixUnaryPlus])
1774- .add(Symbol.LEFT_PAREN, [SHIFT, State.LeftParen])
1775- .add(Symbol.MINUS, [SHIFT, State.PrefixUnaryMinus])
1776- .add(Symbol.FUNCTION, [SHIFT, State.Function])
1777- .add(Symbol.CELL, State.Cell)
1778- .add(Symbol.FIXEDCELL, [SHIFT, State.FixedCell])
1779- .add(Symbol.CELL_UPPER, [SHIFT, State.CellUpper])
1780- .add(Symbol.VARIABLE, [SHIFT, State.Variable])
1781- .add(Symbol.NUMBER_UPPER, [SHIFT, State.NumberUpper])
1782- .add(Symbol.FULL_ERROR, [SHIFT, State.Pound])
1783- .build();
1784-table[State.Number_Carrot] = ObjectBuilder
1785- .add(Symbol.ERROR, State.Error)
1786- .add(Symbol.EXPRESSION, State.PowerTwoNumbers)
1787- .add(Symbol.VARIABLE_SEQUENCE, State.VariableSeq)
1788- .add(Symbol.NUMBER, State.Start_Number)
1789- .add(Symbol.STRING, [SHIFT, State.Start_String])
1790- .add(Symbol.PLUS, [SHIFT, State.PrefixUnaryPlus])
1791- .add(Symbol.LEFT_PAREN, [SHIFT, State.LeftParen])
1792- .add(Symbol.MINUS, [SHIFT, State.PrefixUnaryMinus])
1793- .add(Symbol.FUNCTION, [SHIFT, State.Function])
1794- .add(Symbol.CELL, State.Cell)
1795- .add(Symbol.FIXEDCELL, [SHIFT, State.FixedCell])
1796- .add(Symbol.CELL_UPPER, [SHIFT, State.CellUpper])
1797- .add(Symbol.VARIABLE, [SHIFT, State.Variable])
1798- .add(Symbol.NUMBER_UPPER, [SHIFT, State.NumberUpper])
1799- .add(Symbol.FULL_ERROR, [SHIFT, State.Pound])
1800+ .add(Symbol.Error, State.Error)
1801+ .add(Symbol.Expression, State.GreaterThan_Expression)
1802+ .add(Symbol.VariableSeq, State.VariableSeq)
1803+ .add(Symbol.Number, State.Start_Number)
1804+ .add(Symbol.String, [SHIFT, State.Start_String])
1805+ .add(Symbol.Equals, [SHIFT, State.GreaterThanEquals])
1806+ .add(Symbol.Plus, [SHIFT, State.PrefixUnaryPlus])
1807+ .add(Symbol.LeftParen, [SHIFT, State.LeftParen])
1808+ .add(Symbol.Minus, [SHIFT, State.PrefixUnaryMinus])
1809+ .add(Symbol.Function, [SHIFT, State.Function])
1810+ .add(Symbol.Cell, State.Cell)
1811+ .add(Symbol.FixedCell, [SHIFT, State.FixedCell])
1812+ .add(Symbol.CellUpper, [SHIFT, State.CellUpper])
1813+ .add(Symbol.Variable, [SHIFT, State.Variable])
1814+ .add(Symbol.NumberUpper, [SHIFT, State.Number])
1815+ .add(Symbol.FullError, [SHIFT, State.Pound])
1816+ .build();
1817+// table[25] is absent because it's unreachable.
1818+table[State.Expression_Minus] = ObjectBuilder
1819+ .add(Symbol.Error, State.Error)
1820+ .add(Symbol.Expression, State.SubtractTwoNumbers)
1821+ .add(Symbol.VariableSeq, State.VariableSeq)
1822+ .add(Symbol.Number, State.Start_Number)
1823+ .add(Symbol.String, [SHIFT, State.Start_String])
1824+ .add(Symbol.Plus, [SHIFT, State.PrefixUnaryPlus])
1825+ .add(Symbol.LeftParen, [SHIFT, State.LeftParen])
1826+ .add(Symbol.Minus, [SHIFT, State.PrefixUnaryMinus])
1827+ .add(Symbol.Function, [SHIFT, State.Function])
1828+ .add(Symbol.Cell, State.Cell)
1829+ .add(Symbol.FixedCell, [SHIFT, State.FixedCell])
1830+ .add(Symbol.CellUpper, [SHIFT, State.CellUpper])
1831+ .add(Symbol.Variable, [SHIFT, State.Variable])
1832+ .add(Symbol.NumberUpper, [SHIFT, State.Number])
1833+ .add(Symbol.FullError, [SHIFT, State.Pound])
1834+ .build();
1835+table[State.Expression_Asterisk] = ObjectBuilder
1836+ .add(Symbol.Error, State.Error)
1837+ .add(Symbol.Expression, State.MultiplyTwoNumbers)
1838+ .add(Symbol.VariableSeq, State.VariableSeq)
1839+ .add(Symbol.Number, State.Start_Number)
1840+ .add(Symbol.String, [SHIFT, State.Start_String])
1841+ .add(Symbol.Plus, [SHIFT, State.PrefixUnaryPlus])
1842+ .add(Symbol.LeftParen, [SHIFT, State.LeftParen])
1843+ .add(Symbol.Minus, [SHIFT, State.PrefixUnaryMinus])
1844+ .add(Symbol.Function, [SHIFT, State.Function])
1845+ .add(Symbol.Cell, State.Cell)
1846+ .add(Symbol.FixedCell, [SHIFT, State.FixedCell])
1847+ .add(Symbol.CellUpper, [SHIFT, State.CellUpper])
1848+ .add(Symbol.Variable, [SHIFT, State.Variable])
1849+ .add(Symbol.NumberUpper, [SHIFT, State.Number])
1850+ .add(Symbol.FullError, [SHIFT, State.Pound])
1851+ .build();
1852+table[State.Expression_Divide] = ObjectBuilder
1853+ .add(Symbol.Error, State.Error)
1854+ .add(Symbol.Expression, State.DivideTwoNumbers)
1855+ .add(Symbol.VariableSeq, State.VariableSeq)
1856+ .add(Symbol.Number, State.Start_Number)
1857+ .add(Symbol.String, [SHIFT, State.Start_String])
1858+ .add(Symbol.Plus, [SHIFT, State.PrefixUnaryPlus])
1859+ .add(Symbol.LeftParen, [SHIFT, State.LeftParen])
1860+ .add(Symbol.Minus, [SHIFT, State.PrefixUnaryMinus])
1861+ .add(Symbol.Function, [SHIFT, State.Function])
1862+ .add(Symbol.Cell, State.Cell)
1863+ .add(Symbol.FixedCell, [SHIFT, State.FixedCell])
1864+ .add(Symbol.CellUpper, [SHIFT, State.CellUpper])
1865+ .add(Symbol.Variable, [SHIFT, State.Variable])
1866+ .add(Symbol.NumberUpper, [SHIFT, State.Number])
1867+ .add(Symbol.FullError, [SHIFT, State.Pound])
1868+ .build();
1869+table[State.Expression_Carrot] = ObjectBuilder
1870+ .add(Symbol.Error, State.Error)
1871+ .add(Symbol.Expression, State.PowerTwoNumbers)
1872+ .add(Symbol.VariableSeq, State.VariableSeq)
1873+ .add(Symbol.Number, State.Start_Number)
1874+ .add(Symbol.String, [SHIFT, State.Start_String])
1875+ .add(Symbol.Plus, [SHIFT, State.PrefixUnaryPlus])
1876+ .add(Symbol.LeftParen, [SHIFT, State.LeftParen])
1877+ .add(Symbol.Minus, [SHIFT, State.PrefixUnaryMinus])
1878+ .add(Symbol.Function, [SHIFT, State.Function])
1879+ .add(Symbol.Cell, State.Cell)
1880+ .add(Symbol.FixedCell, [SHIFT, State.FixedCell])
1881+ .add(Symbol.CellUpper, [SHIFT, State.CellUpper])
1882+ .add(Symbol.Variable, [SHIFT, State.Variable])
1883+ .add(Symbol.NumberUpper, [SHIFT, State.Number])
1884+ .add(Symbol.FullError, [SHIFT, State.Pound])
1885 .build();
1886 table[State.VariableSeq_Decimal] = ObjectBuilder
1887- .add(Symbol.VARIABLE, [SHIFT, State.VariableSeq_Decimal_Variable])
1888- .build();
1889-table[State.Number_Percent] = ObjectBuilder
1890- .add(Symbol.EOF, [REDUCE, ReduceActions.REDUCE_PREV_AS_PERCENT])
1891- .add(Symbol.AMPERSAND, [REDUCE, ReduceActions.REDUCE_PREV_AS_PERCENT])
1892- .add(Symbol.EQUALS, [REDUCE, ReduceActions.REDUCE_PREV_AS_PERCENT])
1893- .add(Symbol.PLUS, [REDUCE, ReduceActions.REDUCE_PREV_AS_PERCENT])
1894- .add(Symbol.RIGHT_PAREN, [REDUCE, ReduceActions.REDUCE_PREV_AS_PERCENT])
1895- .add(Symbol.LESS_THAN, [REDUCE, ReduceActions.REDUCE_PREV_AS_PERCENT])
1896- .add(Symbol.GREATER_THAN, [REDUCE, ReduceActions.REDUCE_PREV_AS_PERCENT])
1897- .add(Symbol.MINUS, [REDUCE, ReduceActions.REDUCE_PREV_AS_PERCENT])
1898- .add(Symbol.ASTERISK, [REDUCE, ReduceActions.REDUCE_PREV_AS_PERCENT])
1899- .add(Symbol.DIVIDE, [REDUCE, ReduceActions.REDUCE_PREV_AS_PERCENT])
1900- .add(Symbol.CARROT, [REDUCE, ReduceActions.REDUCE_PREV_AS_PERCENT])
1901- .add(Symbol.SEMI_COLON, [REDUCE, ReduceActions.REDUCE_PREV_AS_PERCENT])
1902- .add(Symbol.COMMA, [REDUCE, ReduceActions.REDUCE_PREV_AS_PERCENT])
1903- .add(Symbol.PERCENT, [REDUCE, ReduceActions.REDUCE_PREV_AS_PERCENT])
1904- .add(38, [REDUCE, ReduceActions.REDUCE_PREV_AS_PERCENT])
1905+ .add(Symbol.Variable, [SHIFT, State.VariableSeq_Decimal_Variable])
1906+ .build();
1907+table[State.Expression_Percent] = ObjectBuilder
1908+ .add(Symbol.EOF, [REDUCE, ReduceActions.ReducePrevAsPercent])
1909+ .add(Symbol.Ampersand, [REDUCE, ReduceActions.ReducePrevAsPercent])
1910+ .add(Symbol.Equals, [REDUCE, ReduceActions.ReducePrevAsPercent])
1911+ .add(Symbol.Plus, [REDUCE, ReduceActions.ReducePrevAsPercent])
1912+ .add(Symbol.RightParen, [REDUCE, ReduceActions.ReducePrevAsPercent])
1913+ .add(Symbol.LessThan, [REDUCE, ReduceActions.ReducePrevAsPercent])
1914+ .add(Symbol.GreaterThan, [REDUCE, ReduceActions.ReducePrevAsPercent])
1915+ .add(Symbol.Minus, [REDUCE, ReduceActions.ReducePrevAsPercent])
1916+ .add(Symbol.Asterisk, [REDUCE, ReduceActions.ReducePrevAsPercent])
1917+ .add(Symbol.Divide, [REDUCE, ReduceActions.ReducePrevAsPercent])
1918+ .add(Symbol.Carrot, [REDUCE, ReduceActions.ReducePrevAsPercent])
1919+ .add(Symbol.Semicolon, [REDUCE, ReduceActions.ReducePrevAsPercent])
1920+ .add(Symbol.Comma, [REDUCE, ReduceActions.ReducePrevAsPercent])
1921+ .add(Symbol.Percent, [REDUCE, ReduceActions.ReducePrevAsPercent])
1922+ .add(Symbol.ReflexiveReduce, [REDUCE, ReduceActions.ReducePrevAsPercent])
1923 .build();
1924 table[State.LeftParen_Expression] = ObjectBuilder
1925- .add(Symbol.AMPERSAND, [SHIFT, State.Number_Ampersand])
1926- .add(Symbol.EQUALS, [SHIFT, State.Start_Equals])
1927- .add(Symbol.PLUS, [SHIFT, State.Number_Plus])
1928- .add(Symbol.RIGHT_PAREN, [SHIFT, State.Expression_RightParen])
1929- .add(Symbol.LESS_THAN, [SHIFT, State.LessThan])
1930- .add(Symbol.GREATER_THAN, [SHIFT, State.GreaterThan])
1931- .add(Symbol.MINUS, [SHIFT, State.Number_Minus])
1932- .add(Symbol.ASTERISK, [SHIFT, State.Number_Asterisk])
1933- .add(Symbol.DIVIDE, [SHIFT, State.Number_Divide])
1934- .add(Symbol.CARROT, [SHIFT, State.Number_Carrot])
1935+ .add(Symbol.Ampersand, [SHIFT, State.Expression_Ampersand])
1936+ .add(Symbol.Equals, [SHIFT, State.Start_Equals])
1937+ .add(Symbol.Plus, [SHIFT, State.Expression_Plus])
1938+ .add(Symbol.RightParen, [SHIFT, State.Expression_RightParen])
1939+ .add(Symbol.LessThan, [SHIFT, State.LessThan])
1940+ .add(Symbol.GreaterThan, [SHIFT, State.GreaterThan])
1941+ .add(Symbol.Minus, [SHIFT, State.Expression_Minus])
1942+ .add(Symbol.Asterisk, [SHIFT, State.Expression_Asterisk])
1943+ .add(Symbol.Divide, [SHIFT, State.Expression_Divide])
1944+ .add(Symbol.Carrot, [SHIFT, State.Expression_Carrot])
1945 .build();
1946 table[State.PrefixUnaryMinus_Expression] = ObjectBuilder
1947- .add(Symbol.EOF, [REDUCE, ReduceActions.INVERT_NUM])
1948- .add(Symbol.AMPERSAND, [SHIFT, State.Number_Ampersand])
1949- .add(Symbol.EQUALS, [REDUCE, ReduceActions.INVERT_NUM])
1950- .add(Symbol.PLUS, [REDUCE, ReduceActions.INVERT_NUM])
1951- .add(Symbol.RIGHT_PAREN, [REDUCE, ReduceActions.INVERT_NUM])
1952- .add(Symbol.LESS_THAN, [REDUCE, ReduceActions.INVERT_NUM])
1953- .add(Symbol.GREATER_THAN, [REDUCE, ReduceActions.INVERT_NUM])
1954- .add(Symbol.MINUS, [REDUCE, ReduceActions.INVERT_NUM])
1955- .add(Symbol.ASTERISK, [SHIFT, 27])
1956- .add(Symbol.DIVIDE, [SHIFT, 28])
1957- .add(Symbol.CARROT, [SHIFT, 29])
1958- .add(Symbol.SEMI_COLON, [REDUCE, ReduceActions.INVERT_NUM])
1959- .add(Symbol.COMMA, [REDUCE, ReduceActions.INVERT_NUM])
1960+ .add(Symbol.EOF, [REDUCE, ReduceActions.InvertNumber])
1961+ .add(Symbol.Ampersand, [SHIFT, State.Expression_Ampersand])
1962+ .add(Symbol.Equals, [REDUCE, ReduceActions.InvertNumber])
1963+ .add(Symbol.Plus, [REDUCE, ReduceActions.InvertNumber])
1964+ .add(Symbol.RightParen, [REDUCE, ReduceActions.InvertNumber])
1965+ .add(Symbol.LessThan, [REDUCE, ReduceActions.InvertNumber])
1966+ .add(Symbol.GreaterThan, [REDUCE, ReduceActions.InvertNumber])
1967+ .add(Symbol.Minus, [REDUCE, ReduceActions.InvertNumber])
1968+ .add(Symbol.Asterisk, [SHIFT, State.Expression_Asterisk])
1969+ .add(Symbol.Divide, [SHIFT, State.Expression_Divide])
1970+ .add(Symbol.Carrot, [SHIFT, State.Expression_Carrot])
1971+ .add(Symbol.Semicolon, [REDUCE, ReduceActions.InvertNumber])
1972+ .add(Symbol.Comma, [REDUCE, ReduceActions.InvertNumber])
1973 .build();
1974 table[State.PrefixUnaryPlus_Expression] = ObjectBuilder
1975- .add(Symbol.EOF, [REDUCE, ReduceActions.TO_NUMBER_NAN_AS_ZERO])
1976- .add(Symbol.AMPERSAND, [SHIFT, State.Number_Ampersand])
1977- .add(Symbol.EQUALS, [REDUCE, ReduceActions.TO_NUMBER_NAN_AS_ZERO])
1978- .add(Symbol.PLUS, [REDUCE, ReduceActions.TO_NUMBER_NAN_AS_ZERO])
1979- .add(Symbol.RIGHT_PAREN, [REDUCE, ReduceActions.TO_NUMBER_NAN_AS_ZERO])
1980- .add(Symbol.LESS_THAN, [REDUCE, ReduceActions.TO_NUMBER_NAN_AS_ZERO])
1981- .add(Symbol.GREATER_THAN, [REDUCE, ReduceActions.TO_NUMBER_NAN_AS_ZERO])
1982- .add(Symbol.MINUS, [REDUCE, ReduceActions.TO_NUMBER_NAN_AS_ZERO])
1983- .add(Symbol.ASTERISK, [SHIFT, State.Number_Asterisk])
1984- .add(Symbol.DIVIDE, [SHIFT, State.Number_Divide])
1985- .add(Symbol.CARROT, [SHIFT, State.Number_Carrot])
1986- .add(Symbol.SEMI_COLON, [REDUCE, ReduceActions.TO_NUMBER_NAN_AS_ZERO])
1987- .add(Symbol.COMMA, [REDUCE, ReduceActions.TO_NUMBER_NAN_AS_ZERO])
1988+ .add(Symbol.EOF, [REDUCE, ReduceActions.ToNumberNANAsZero])
1989+ .add(Symbol.Ampersand, [SHIFT, State.Expression_Ampersand])
1990+ .add(Symbol.Equals, [REDUCE, ReduceActions.ToNumberNANAsZero])
1991+ .add(Symbol.Plus, [REDUCE, ReduceActions.ToNumberNANAsZero])
1992+ .add(Symbol.RightParen, [REDUCE, ReduceActions.ToNumberNANAsZero])
1993+ .add(Symbol.LessThan, [REDUCE, ReduceActions.ToNumberNANAsZero])
1994+ .add(Symbol.GreaterThan, [REDUCE, ReduceActions.ToNumberNANAsZero])
1995+ .add(Symbol.Minus, [REDUCE, ReduceActions.ToNumberNANAsZero])
1996+ .add(Symbol.Asterisk, [SHIFT, State.Expression_Asterisk])
1997+ .add(Symbol.Divide, [SHIFT, State.Expression_Divide])
1998+ .add(Symbol.Carrot, [SHIFT, State.Expression_Carrot])
1999+ .add(Symbol.Semicolon, [REDUCE, ReduceActions.ToNumberNANAsZero])
2000+ .add(Symbol.Comma, [REDUCE, ReduceActions.ToNumberNANAsZero])
2001 .build();
2002 table[State.Function_LeftParen] = ObjectBuilder
2003- .add(Symbol.ERROR, State.Error)
2004- .add(Symbol.EXPRESSION, State.Function_LeftParen_Expression)
2005- .add(Symbol.VARIABLE_SEQUENCE, State.VariableSeq)
2006- .add(Symbol.NUMBER, State.Start_Number)
2007- .add(Symbol.STRING, [SHIFT, State.Start_String])
2008- .add(Symbol.PLUS, [SHIFT, State.PrefixUnaryPlus])
2009- .add(Symbol.LEFT_PAREN, [SHIFT, State.LeftParen])
2010- .add(Symbol.RIGHT_PAREN, [SHIFT, State.Function_RightParenNoArguments])
2011- .add(Symbol.MINUS, [SHIFT, State.PrefixUnaryMinus])
2012- .add(Symbol.FUNCTION, [SHIFT, State.Function])
2013- .add(Symbol.EXP_SEQ, 59)
2014- .add(Symbol.CELL, State.Cell)
2015- .add(Symbol.FIXEDCELL, [SHIFT, State.FixedCell])
2016- .add(Symbol.CELL_UPPER, [SHIFT, State.CellUpper])
2017- .add(Symbol.ARRAY, [SHIFT, State.LeftParen_Array])
2018- .add(Symbol.VARIABLE, [SHIFT, State.Variable])
2019- .add(Symbol.NUMBER_UPPER, [SHIFT, State.NumberUpper])
2020- .add(Symbol.FULL_ERROR, [SHIFT, State.Pound])
2021+ .add(Symbol.Error, State.Error)
2022+ .add(Symbol.Expression, State.Function_LeftParen_Expression)
2023+ .add(Symbol.VariableSeq, State.VariableSeq)
2024+ .add(Symbol.Number, State.Start_Number)
2025+ .add(Symbol.String, [SHIFT, State.Start_String])
2026+ .add(Symbol.Plus, [SHIFT, State.PrefixUnaryPlus])
2027+ .add(Symbol.LeftParen, [SHIFT, State.LeftParen])
2028+ .add(Symbol.RightParen, [SHIFT, State.Function_RightParenNoArguments])
2029+ .add(Symbol.Minus, [SHIFT, State.PrefixUnaryMinus])
2030+ .add(Symbol.Function, [SHIFT, State.Function])
2031+ .add(Symbol.ExpressionSeq, State.Function_LeftParen_ExpressionSeq)
2032+ .add(Symbol.Cell, State.Cell)
2033+ .add(Symbol.FixedCell, [SHIFT, State.FixedCell])
2034+ .add(Symbol.CellUpper, [SHIFT, State.CellUpper])
2035+ .add(Symbol.Array, [SHIFT, State.LeftParen_Array])
2036+ .add(Symbol.Variable, [SHIFT, State.Variable])
2037+ .add(Symbol.NumberUpper, [SHIFT, State.Number])
2038+ .add(Symbol.FullError, [SHIFT, State.Pound])
2039 .build();
2040 table[State.Error_Error] = ObjectBuilder
2041- .add(Symbol.EOF, [REDUCE, ReduceActions.ERROR_AND_CONTINUE_WITH_OTHER_ERRORS])
2042- .add(Symbol.AMPERSAND, [REDUCE, ReduceActions.ERROR_AND_CONTINUE_WITH_OTHER_ERRORS])
2043- .add(Symbol.EQUALS, [REDUCE, ReduceActions.ERROR_AND_CONTINUE_WITH_OTHER_ERRORS])
2044- .add(Symbol.PLUS, [REDUCE, ReduceActions.ERROR_AND_CONTINUE_WITH_OTHER_ERRORS])
2045- .add(Symbol.RIGHT_PAREN, [REDUCE, ReduceActions.ERROR_AND_CONTINUE_WITH_OTHER_ERRORS])
2046- .add(Symbol.LESS_THAN, [REDUCE, ReduceActions.ERROR_AND_CONTINUE_WITH_OTHER_ERRORS])
2047- .add(Symbol.GREATER_THAN, [REDUCE, ReduceActions.ERROR_AND_CONTINUE_WITH_OTHER_ERRORS])
2048- .add(Symbol.MINUS, [REDUCE, ReduceActions.ERROR_AND_CONTINUE_WITH_OTHER_ERRORS])
2049- .add(Symbol.ASTERISK, [REDUCE, ReduceActions.ERROR_AND_CONTINUE_WITH_OTHER_ERRORS])
2050- .add(Symbol.DIVIDE, [REDUCE, ReduceActions.ERROR_AND_CONTINUE_WITH_OTHER_ERRORS])
2051- .add(Symbol.CARROT, [REDUCE, ReduceActions.ERROR_AND_CONTINUE_WITH_OTHER_ERRORS])
2052- .add(Symbol.SEMI_COLON, [REDUCE, ReduceActions.ERROR_AND_CONTINUE_WITH_OTHER_ERRORS])
2053- .add(Symbol.COMMA, [REDUCE, ReduceActions.ERROR_AND_CONTINUE_WITH_OTHER_ERRORS])
2054+ .add(Symbol.EOF, [REDUCE, ReduceActions.ErrorAndContinueWithOtherErrors])
2055+ .add(Symbol.Ampersand, [REDUCE, ReduceActions.ErrorAndContinueWithOtherErrors])
2056+ .add(Symbol.Equals, [REDUCE, ReduceActions.ErrorAndContinueWithOtherErrors])
2057+ .add(Symbol.Plus, [REDUCE, ReduceActions.ErrorAndContinueWithOtherErrors])
2058+ .add(Symbol.RightParen, [REDUCE, ReduceActions.ErrorAndContinueWithOtherErrors])
2059+ .add(Symbol.LessThan, [REDUCE, ReduceActions.ErrorAndContinueWithOtherErrors])
2060+ .add(Symbol.GreaterThan, [REDUCE, ReduceActions.ErrorAndContinueWithOtherErrors])
2061+ .add(Symbol.Minus, [REDUCE, ReduceActions.ErrorAndContinueWithOtherErrors])
2062+ .add(Symbol.Asterisk, [REDUCE, ReduceActions.ErrorAndContinueWithOtherErrors])
2063+ .add(Symbol.Divide, [REDUCE, ReduceActions.ErrorAndContinueWithOtherErrors])
2064+ .add(Symbol.Carrot, [REDUCE, ReduceActions.ErrorAndContinueWithOtherErrors])
2065+ .add(Symbol.Semicolon, [REDUCE, ReduceActions.ErrorAndContinueWithOtherErrors])
2066+ .add(Symbol.Comma, [REDUCE, ReduceActions.ErrorAndContinueWithOtherErrors])
2067 .build();
2068 table[State.Error_Variable] = ObjectBuilder
2069- .add(Symbol.FULL_ERROR, [REDUCE, ReduceActions.AS_ERROR])
2070+ .add(Symbol.FullError, [REDUCE, ReduceActions.AsError])
2071 .build();
2072 table[State.Variable_FullError] = ObjectBuilder
2073- .add(Symbol.VARIABLE, [SHIFT, 62])
2074+ .add(Symbol.Variable, [SHIFT, State.Variable_FullError_Variable])
2075 .build();
2076-table[39] = ObjectBuilder
2077- .add(Symbol.NUMBER_UPPER, [SHIFT, 63])
2078+table[State.Number_Decimal] = ObjectBuilder
2079+ .add(Symbol.NumberUpper, [SHIFT, State.Number_Decimal_NumberUpper])
2080 .build();
2081-table[40] = ObjectBuilder
2082- .add(Symbol.FIXEDCELL, [SHIFT, 64])
2083+table[State.FixedCell_Colon] = ObjectBuilder
2084+ .add(Symbol.FixedCell, [SHIFT, State.FixedCell_Colon_FixedCell])
2085 .build();
2086-table[41] = ObjectBuilder
2087- .add(Symbol.CELL_UPPER, [SHIFT, 65])
2088+table[State.CellUpper_Colon] = ObjectBuilder
2089+ .add(Symbol.CellUpper, [SHIFT, State.CellUpper_Colon_CellUpper])
2090 .build();
2091 table[State.Pound_Variable] = ObjectBuilder
2092- .add(Symbol.EXCLAMATION_POINT, [SHIFT, 66])
2093+ .add(Symbol.ExclamationPoint, [SHIFT, State.Pound_Variable_ExclamationPoint])
2094 .build();
2095 table[State.Number_Ampersand_Expression] = ObjectBuilder
2096- .add(Symbol.EOF, [REDUCE, ReduceActions.AMPERSAND])
2097- .add(Symbol.AMPERSAND, [REDUCE, ReduceActions.AMPERSAND])
2098- .add(Symbol.EQUALS, [REDUCE, ReduceActions.AMPERSAND])
2099- .add(Symbol.PLUS, [REDUCE, ReduceActions.AMPERSAND])
2100- .add(Symbol.RIGHT_PAREN, [REDUCE, ReduceActions.AMPERSAND])
2101- .add(Symbol.LESS_THAN, [REDUCE, ReduceActions.AMPERSAND])
2102- .add(Symbol.GREATER_THAN, [REDUCE, ReduceActions.AMPERSAND])
2103- .add(Symbol.MINUS, [REDUCE, ReduceActions.AMPERSAND])
2104- .add(Symbol.ASTERISK, [REDUCE, ReduceActions.AMPERSAND])
2105- .add(Symbol.DIVIDE, [REDUCE, ReduceActions.AMPERSAND])
2106- .add(Symbol.CARROT, [REDUCE, ReduceActions.AMPERSAND])
2107- .add(Symbol.SEMI_COLON, [REDUCE, ReduceActions.AMPERSAND])
2108- .add(Symbol.COMMA, [REDUCE, ReduceActions.AMPERSAND])
2109+ .add(Symbol.EOF, [REDUCE, ReduceActions.Ampersand])
2110+ .add(Symbol.Ampersand, [REDUCE, ReduceActions.Ampersand])
2111+ .add(Symbol.Equals, [REDUCE, ReduceActions.Ampersand])
2112+ .add(Symbol.Plus, [REDUCE, ReduceActions.Ampersand])
2113+ .add(Symbol.RightParen, [REDUCE, ReduceActions.Ampersand])
2114+ .add(Symbol.LessThan, [REDUCE, ReduceActions.Ampersand])
2115+ .add(Symbol.GreaterThan, [REDUCE, ReduceActions.Ampersand])
2116+ .add(Symbol.Minus, [REDUCE, ReduceActions.Ampersand])
2117+ .add(Symbol.Asterisk, [REDUCE, ReduceActions.Ampersand])
2118+ .add(Symbol.Divide, [REDUCE, ReduceActions.Ampersand])
2119+ .add(Symbol.Carrot, [REDUCE, ReduceActions.Ampersand])
2120+ .add(Symbol.Semicolon, [REDUCE, ReduceActions.Ampersand])
2121+ .add(Symbol.Comma, [REDUCE, ReduceActions.Ampersand])
2122 .build();
2123 table[State.Start_Equals_Expression] = ObjectBuilder
2124- .add(Symbol.EOF, [REDUCE, ReduceActions.EQUALS])
2125- .add(Symbol.AMPERSAND, [SHIFT, State.Number_Ampersand])
2126- .add(Symbol.EQUALS, [REDUCE, ReduceActions.EQUALS])
2127- .add(Symbol.PLUS, [SHIFT, State.Number_Plus])
2128- .add(Symbol.RIGHT_PAREN, [REDUCE, ReduceActions.EQUALS])
2129- .add(Symbol.LESS_THAN, [SHIFT, State.LessThan])
2130- .add(Symbol.GREATER_THAN, [SHIFT, State.GreaterThan])
2131- .add(Symbol.MINUS, [SHIFT, State.Number_Minus])
2132- .add(Symbol.ASTERISK, [SHIFT, State.Number_Asterisk])
2133- .add(Symbol.DIVIDE, [SHIFT, State.Number_Divide])
2134- .add(Symbol.CARROT, [SHIFT, State.Number_Carrot])
2135- .add(Symbol.SEMI_COLON, [REDUCE, ReduceActions.EQUALS])
2136- .add(Symbol.COMMA, [REDUCE, ReduceActions.EQUALS])
2137+ .add(Symbol.EOF, [REDUCE, ReduceActions.Equals])
2138+ .add(Symbol.Ampersand, [SHIFT, State.Expression_Ampersand])
2139+ .add(Symbol.Equals, [REDUCE, ReduceActions.Equals])
2140+ .add(Symbol.Plus, [SHIFT, State.Expression_Plus])
2141+ .add(Symbol.RightParen, [REDUCE, ReduceActions.Equals])
2142+ .add(Symbol.LessThan, [SHIFT, State.LessThan])
2143+ .add(Symbol.GreaterThan, [SHIFT, State.GreaterThan])
2144+ .add(Symbol.Minus, [SHIFT, State.Expression_Minus])
2145+ .add(Symbol.Asterisk, [SHIFT, State.Expression_Asterisk])
2146+ .add(Symbol.Divide, [SHIFT, State.Expression_Divide])
2147+ .add(Symbol.Carrot, [SHIFT, State.Expression_Carrot])
2148+ .add(Symbol.Semicolon, [REDUCE, ReduceActions.Equals])
2149+ .add(Symbol.Comma, [REDUCE, ReduceActions.Equals])
2150 .build();
2151 table[State.AddTwoNumbers] = ObjectBuilder
2152- .add(Symbol.EOF, [REDUCE, ReduceActions.PLUS])
2153- .add(Symbol.AMPERSAND, [SHIFT, State.Number_Ampersand])
2154- .add(Symbol.EQUALS, [REDUCE, ReduceActions.PLUS])
2155- .add(Symbol.PLUS, [REDUCE, ReduceActions.PLUS])
2156- .add(Symbol.RIGHT_PAREN, [REDUCE, ReduceActions.PLUS])
2157- .add(Symbol.LESS_THAN, [REDUCE, ReduceActions.PLUS])
2158- .add(Symbol.GREATER_THAN, [REDUCE, ReduceActions.PLUS])
2159- .add(Symbol.MINUS, [REDUCE, ReduceActions.PLUS])
2160- .add(Symbol.ASTERISK, [SHIFT, State.Number_Asterisk])
2161- .add(Symbol.DIVIDE, [SHIFT, State.Number_Divide])
2162- .add(Symbol.CARROT, [SHIFT, State.Number_Carrot])
2163- .add(Symbol.SEMI_COLON, [REDUCE, ReduceActions.PLUS])
2164- .add(Symbol.COMMA, [REDUCE, ReduceActions.PLUS])
2165+ .add(Symbol.EOF, [REDUCE, ReduceActions.Plus])
2166+ .add(Symbol.Ampersand, [SHIFT, State.Expression_Ampersand])
2167+ .add(Symbol.Equals, [REDUCE, ReduceActions.Plus])
2168+ .add(Symbol.Plus, [REDUCE, ReduceActions.Plus])
2169+ .add(Symbol.RightParen, [REDUCE, ReduceActions.Plus])
2170+ .add(Symbol.LessThan, [REDUCE, ReduceActions.Plus])
2171+ .add(Symbol.GreaterThan, [REDUCE, ReduceActions.Plus])
2172+ .add(Symbol.Minus, [REDUCE, ReduceActions.Plus])
2173+ .add(Symbol.Asterisk, [SHIFT, State.Expression_Asterisk])
2174+ .add(Symbol.Divide, [SHIFT, State.Expression_Divide])
2175+ .add(Symbol.Carrot, [SHIFT, State.Expression_Carrot])
2176+ .add(Symbol.Semicolon, [REDUCE, ReduceActions.Plus])
2177+ .add(Symbol.Comma, [REDUCE, ReduceActions.Plus])
2178 .build();
2179 table[State.LessThan_Equals] = ObjectBuilder
2180- .add(Symbol.ERROR, State.Error)
2181- .add(Symbol.EXPRESSION, 67)
2182- .add(Symbol.VARIABLE_SEQUENCE, State.VariableSeq)
2183- .add(Symbol.NUMBER, State.Start_Number)
2184- .add(Symbol.STRING, [SHIFT, State.Start_String])
2185- .add(Symbol.PLUS, [SHIFT, State.PrefixUnaryPlus])
2186- .add(Symbol.LEFT_PAREN, [SHIFT, State.LeftParen])
2187- .add(Symbol.MINUS, [SHIFT, State.PrefixUnaryMinus])
2188- .add(Symbol.FUNCTION, [SHIFT, State.Function])
2189- .add(Symbol.CELL, State.Cell)
2190- .add(Symbol.FIXEDCELL, [SHIFT, State.FixedCell])
2191- .add(Symbol.CELL_UPPER, [SHIFT, State.CellUpper])
2192- .add(Symbol.VARIABLE, [SHIFT, State.Variable])
2193- .add(Symbol.NUMBER_UPPER, [SHIFT, State.NumberUpper])
2194- .add(Symbol.FULL_ERROR, [SHIFT, State.Pound])
2195+ .add(Symbol.Error, State.Error)
2196+ .add(Symbol.Expression, State.LessThan_Equals_Expression)
2197+ .add(Symbol.VariableSeq, State.VariableSeq)
2198+ .add(Symbol.Number, State.Start_Number)
2199+ .add(Symbol.String, [SHIFT, State.Start_String])
2200+ .add(Symbol.Plus, [SHIFT, State.PrefixUnaryPlus])
2201+ .add(Symbol.LeftParen, [SHIFT, State.LeftParen])
2202+ .add(Symbol.Minus, [SHIFT, State.PrefixUnaryMinus])
2203+ .add(Symbol.Function, [SHIFT, State.Function])
2204+ .add(Symbol.Cell, State.Cell)
2205+ .add(Symbol.FixedCell, [SHIFT, State.FixedCell])
2206+ .add(Symbol.CellUpper, [SHIFT, State.CellUpper])
2207+ .add(Symbol.Variable, [SHIFT, State.Variable])
2208+ .add(Symbol.NumberUpper, [SHIFT, State.Number])
2209+ .add(Symbol.FullError, [SHIFT, State.Pound])
2210 .build();
2211 table[State.LessThan_GreaterThan] = ObjectBuilder
2212- .add(Symbol.ERROR, State.Error)
2213- .add(Symbol.EXPRESSION, 68)
2214- .add(Symbol.VARIABLE_SEQUENCE, State.VariableSeq)
2215- .add(Symbol.NUMBER, State.Start_Number)
2216- .add(Symbol.STRING, [SHIFT, State.Start_String])
2217- .add(Symbol.PLUS, [SHIFT, State.PrefixUnaryPlus])
2218- .add(Symbol.LEFT_PAREN, [SHIFT, State.LeftParen])
2219- .add(Symbol.MINUS, [SHIFT, State.PrefixUnaryMinus])
2220- .add(Symbol.FUNCTION, [SHIFT, State.Function])
2221- .add(Symbol.CELL, State.Cell)
2222- .add(Symbol.FIXEDCELL, [SHIFT, State.FixedCell])
2223- .add(Symbol.CELL_UPPER, [SHIFT, State.CellUpper])
2224- .add(Symbol.VARIABLE, [SHIFT, State.Variable])
2225- .add(Symbol.NUMBER_UPPER, [SHIFT, State.NumberUpper])
2226- .add(Symbol.FULL_ERROR, [SHIFT, State.Pound])
2227+ .add(Symbol.Error, State.Error)
2228+ .add(Symbol.Expression, State.LessThan_GreaterThan_Expression)
2229+ .add(Symbol.VariableSeq, State.VariableSeq)
2230+ .add(Symbol.Number, State.Start_Number)
2231+ .add(Symbol.String, [SHIFT, State.Start_String])
2232+ .add(Symbol.Plus, [SHIFT, State.PrefixUnaryPlus])
2233+ .add(Symbol.LeftParen, [SHIFT, State.LeftParen])
2234+ .add(Symbol.Minus, [SHIFT, State.PrefixUnaryMinus])
2235+ .add(Symbol.Function, [SHIFT, State.Function])
2236+ .add(Symbol.Cell, State.Cell)
2237+ .add(Symbol.FixedCell, [SHIFT, State.FixedCell])
2238+ .add(Symbol.CellUpper, [SHIFT, State.CellUpper])
2239+ .add(Symbol.Variable, [SHIFT, State.Variable])
2240+ .add(Symbol.NumberUpper, [SHIFT, State.Number])
2241+ .add(Symbol.FullError, [SHIFT, State.Pound])
2242 .build();
2243 table[State.LessThan_Expression] = ObjectBuilder
2244 .add(Symbol.EOF, [REDUCE, ReduceActions.LT])
2245- .add(Symbol.AMPERSAND, [SHIFT, State.Number_Ampersand])
2246- .add(Symbol.EQUALS, [REDUCE, ReduceActions.LT])
2247- .add(Symbol.PLUS, [SHIFT, State.Number_Plus])
2248- .add(Symbol.RIGHT_PAREN, [REDUCE, ReduceActions.LT])
2249- .add(Symbol.LESS_THAN, [REDUCE, ReduceActions.LT])
2250- .add(Symbol.GREATER_THAN, [REDUCE, ReduceActions.LT])
2251- .add(Symbol.MINUS, [SHIFT, State.Number_Minus])
2252- .add(Symbol.ASTERISK, [SHIFT, State.Number_Asterisk])
2253- .add(Symbol.DIVIDE, [SHIFT, State.Number_Divide])
2254- .add(Symbol.CARROT, [SHIFT, State.Number_Carrot])
2255- .add(Symbol.SEMI_COLON, [REDUCE, ReduceActions.LT])
2256- .add(Symbol.COMMA, [REDUCE, ReduceActions.LT])
2257- .build();
2258-table[State.GreaterThan_Equals] = ObjectBuilder
2259- .add(Symbol.ERROR, State.Error)
2260- .add(Symbol.EXPRESSION, State.GTETwoExpressions)
2261- .add(Symbol.VARIABLE_SEQUENCE, State.VariableSeq)
2262- .add(Symbol.NUMBER, State.Start_Number)
2263- .add(Symbol.STRING, [SHIFT, State.Start_String])
2264- .add(Symbol.PLUS, [SHIFT, State.PrefixUnaryPlus])
2265- .add(Symbol.LEFT_PAREN, [SHIFT, State.LeftParen])
2266- .add(Symbol.MINUS, [SHIFT, State.PrefixUnaryMinus])
2267- .add(Symbol.FUNCTION, [SHIFT, State.Function])
2268- .add(Symbol.CELL, State.Cell)
2269- .add(Symbol.FIXEDCELL, [SHIFT, State.FixedCell])
2270- .add(Symbol.CELL_UPPER, [SHIFT, State.CellUpper])
2271- .add(Symbol.VARIABLE, [SHIFT, State.Variable])
2272- .add(Symbol.NUMBER_UPPER, [SHIFT, State.NumberUpper])
2273- .add(Symbol.FULL_ERROR, [SHIFT, State.Pound])
2274+ .add(Symbol.Ampersand, [SHIFT, State.Expression_Ampersand])
2275+ .add(Symbol.Equals, [REDUCE, ReduceActions.LT])
2276+ .add(Symbol.Plus, [SHIFT, State.Expression_Plus])
2277+ .add(Symbol.RightParen, [REDUCE, ReduceActions.LT])
2278+ .add(Symbol.LessThan, [REDUCE, ReduceActions.LT])
2279+ .add(Symbol.GreaterThan, [REDUCE, ReduceActions.LT])
2280+ .add(Symbol.Minus, [SHIFT, State.Expression_Minus])
2281+ .add(Symbol.Asterisk, [SHIFT, State.Expression_Asterisk])
2282+ .add(Symbol.Divide, [SHIFT, State.Expression_Divide])
2283+ .add(Symbol.Carrot, [SHIFT, State.Expression_Carrot])
2284+ .add(Symbol.Semicolon, [REDUCE, ReduceActions.LT])
2285+ .add(Symbol.Comma, [REDUCE, ReduceActions.LT])
2286+ .build();
2287+table[State.GreaterThanEquals] = ObjectBuilder
2288+ .add(Symbol.Error, State.Error)
2289+ .add(Symbol.Expression, State.GreaterThanEquals_Expressions)
2290+ .add(Symbol.VariableSeq, State.VariableSeq)
2291+ .add(Symbol.Number, State.Start_Number)
2292+ .add(Symbol.String, [SHIFT, State.Start_String])
2293+ .add(Symbol.Plus, [SHIFT, State.PrefixUnaryPlus])
2294+ .add(Symbol.LeftParen, [SHIFT, State.LeftParen])
2295+ .add(Symbol.Minus, [SHIFT, State.PrefixUnaryMinus])
2296+ .add(Symbol.Function, [SHIFT, State.Function])
2297+ .add(Symbol.Cell, State.Cell)
2298+ .add(Symbol.FixedCell, [SHIFT, State.FixedCell])
2299+ .add(Symbol.CellUpper, [SHIFT, State.CellUpper])
2300+ .add(Symbol.Variable, [SHIFT, State.Variable])
2301+ .add(Symbol.NumberUpper, [SHIFT, State.Number])
2302+ .add(Symbol.FullError, [SHIFT, State.Pound])
2303 .build();
2304 table[State.GreaterThan_Expression] = ObjectBuilder
2305 .add(Symbol.EOF, [REDUCE, ReduceActions.GT])
2306- .add(Symbol.AMPERSAND, [SHIFT, State.Number_Ampersand])
2307- .add(Symbol.EQUALS, [REDUCE, ReduceActions.GT])
2308- .add(Symbol.PLUS, [SHIFT, State.Number_Plus])
2309- .add(Symbol.RIGHT_PAREN, [REDUCE, ReduceActions.GT])
2310- .add(Symbol.LESS_THAN, [REDUCE, ReduceActions.GT])
2311- .add(Symbol.GREATER_THAN, [REDUCE, ReduceActions.GT])
2312- .add(Symbol.MINUS, [SHIFT, State.Number_Minus])
2313- .add(Symbol.ASTERISK, [SHIFT, State.Number_Asterisk])
2314- .add(Symbol.DIVIDE, [SHIFT, State.Number_Divide])
2315- .add(Symbol.CARROT, [SHIFT, State.Number_Carrot])
2316- .add(Symbol.SEMI_COLON, [REDUCE, ReduceActions.GT])
2317- .add(Symbol.COMMA, [REDUCE, ReduceActions.GT])
2318+ .add(Symbol.Ampersand, [SHIFT, State.Expression_Ampersand])
2319+ .add(Symbol.Equals, [REDUCE, ReduceActions.GT])
2320+ .add(Symbol.Plus, [SHIFT, State.Expression_Plus])
2321+ .add(Symbol.RightParen, [REDUCE, ReduceActions.GT])
2322+ .add(Symbol.LessThan, [REDUCE, ReduceActions.GT])
2323+ .add(Symbol.GreaterThan, [REDUCE, ReduceActions.GT])
2324+ .add(Symbol.Minus, [SHIFT, State.Expression_Minus])
2325+ .add(Symbol.Asterisk, [SHIFT, State.Expression_Asterisk])
2326+ .add(Symbol.Divide, [SHIFT, State.Expression_Divide])
2327+ .add(Symbol.Carrot, [SHIFT, State.Expression_Carrot])
2328+ .add(Symbol.Semicolon, [REDUCE, ReduceActions.GT])
2329+ .add(Symbol.Comma, [REDUCE, ReduceActions.GT])
2330 .build();
2331 table[51] = ObjectBuilder
2332- .add(Symbol.AMPERSAND, [SHIFT, State.Number_Ampersand])
2333- .add(Symbol.PLUS, [SHIFT, 22])
2334- .add(Symbol.LESS_THAN, [SHIFT, 23])
2335- .add(Symbol.GREATER_THAN, [SHIFT, 24])
2336- .add(Symbol.MINUS, [SHIFT, State.Number_Minus])
2337- .add(Symbol.ASTERISK, [SHIFT, State.Number_Asterisk])
2338- .add(Symbol.DIVIDE, [SHIFT, 28])
2339- .add(Symbol.CARROT, [SHIFT, 29])
2340+ .add(Symbol.Ampersand, [SHIFT, State.Expression_Ampersand])
2341+ .add(Symbol.Plus, [SHIFT, State.Expression_Plus])
2342+ .add(Symbol.LessThan, [SHIFT, State.LessThan])
2343+ .add(Symbol.GreaterThan, [SHIFT, State.GreaterThan])
2344+ .add(Symbol.Minus, [SHIFT, State.Expression_Minus])
2345+ .add(Symbol.Asterisk, [SHIFT, State.Expression_Asterisk])
2346+ .add(Symbol.Divide, [SHIFT, State.Expression_Divide])
2347+ .add(Symbol.Carrot, [SHIFT, State.Expression_Carrot])
2348 .build();
2349 table[State.SubtractTwoNumbers] = ObjectBuilder
2350- .add(Symbol.EOF, [REDUCE, ReduceActions.MINUS])
2351- .add(Symbol.AMPERSAND, [SHIFT, State.Number_Ampersand])
2352- .add(Symbol.EQUALS, [REDUCE, ReduceActions.MINUS])
2353- .add(Symbol.PLUS, [REDUCE, ReduceActions.MINUS])
2354- .add(Symbol.RIGHT_PAREN, [REDUCE, ReduceActions.MINUS])
2355- .add(Symbol.LESS_THAN, [REDUCE, ReduceActions.MINUS])
2356- .add(Symbol.GREATER_THAN, [REDUCE, ReduceActions.MINUS])
2357- .add(Symbol.MINUS, [REDUCE, ReduceActions.MINUS])
2358- .add(Symbol.ASTERISK, [SHIFT, State.Number_Asterisk])
2359- .add(Symbol.DIVIDE, [SHIFT, 28])
2360- .add(Symbol.CARROT, [SHIFT, 29])
2361- .add(Symbol.SEMI_COLON, [REDUCE, ReduceActions.MINUS])
2362- .add(Symbol.COMMA, [REDUCE, ReduceActions.MINUS])
2363+ .add(Symbol.EOF, [REDUCE, ReduceActions.Minus])
2364+ .add(Symbol.Ampersand, [SHIFT, State.Expression_Ampersand])
2365+ .add(Symbol.Equals, [REDUCE, ReduceActions.Minus])
2366+ .add(Symbol.Plus, [REDUCE, ReduceActions.Minus])
2367+ .add(Symbol.RightParen, [REDUCE, ReduceActions.Minus])
2368+ .add(Symbol.LessThan, [REDUCE, ReduceActions.Minus])
2369+ .add(Symbol.GreaterThan, [REDUCE, ReduceActions.Minus])
2370+ .add(Symbol.Minus, [REDUCE, ReduceActions.Minus])
2371+ .add(Symbol.Asterisk, [SHIFT, State.Expression_Asterisk])
2372+ .add(Symbol.Divide, [SHIFT, State.Expression_Divide])
2373+ .add(Symbol.Carrot, [SHIFT, State.Expression_Carrot])
2374+ .add(Symbol.Semicolon, [REDUCE, ReduceActions.Minus])
2375+ .add(Symbol.Comma, [REDUCE, ReduceActions.Minus])
2376 .build();
2377 table[State.MultiplyTwoNumbers] = ObjectBuilder
2378- .add(Symbol.EOF, [REDUCE, ReduceActions.MULTIPLY])
2379- .add(Symbol.AMPERSAND, [SHIFT, 20])
2380- .add(Symbol.EQUALS, [REDUCE, ReduceActions.MULTIPLY])
2381- .add(Symbol.PLUS, [REDUCE, ReduceActions.MULTIPLY])
2382- .add(Symbol.RIGHT_PAREN, [REDUCE, ReduceActions.MULTIPLY])
2383- .add(Symbol.LESS_THAN, [REDUCE, ReduceActions.MULTIPLY])
2384- .add(Symbol.GREATER_THAN, [REDUCE, ReduceActions.MULTIPLY])
2385- .add(Symbol.MINUS, [REDUCE, ReduceActions.MULTIPLY])
2386- .add(Symbol.ASTERISK, [REDUCE, ReduceActions.MULTIPLY])
2387- .add(Symbol.DIVIDE, [REDUCE, ReduceActions.MULTIPLY])
2388- .add(Symbol.CARROT, [SHIFT, 29])
2389- .add(Symbol.SEMI_COLON, [REDUCE, ReduceActions.MULTIPLY])
2390- .add(Symbol.COMMA, [REDUCE, ReduceActions.MULTIPLY])
2391+ .add(Symbol.EOF, [REDUCE, ReduceActions.Multiply])
2392+ .add(Symbol.Ampersand, [SHIFT, State.Expression_Ampersand])
2393+ .add(Symbol.Equals, [REDUCE, ReduceActions.Multiply])
2394+ .add(Symbol.Plus, [REDUCE, ReduceActions.Multiply])
2395+ .add(Symbol.RightParen, [REDUCE, ReduceActions.Multiply])
2396+ .add(Symbol.LessThan, [REDUCE, ReduceActions.Multiply])
2397+ .add(Symbol.GreaterThan, [REDUCE, ReduceActions.Multiply])
2398+ .add(Symbol.Minus, [REDUCE, ReduceActions.Multiply])
2399+ .add(Symbol.Asterisk, [REDUCE, ReduceActions.Multiply])
2400+ .add(Symbol.Divide, [REDUCE, ReduceActions.Multiply])
2401+ .add(Symbol.Carrot, [SHIFT, State.Expression_Carrot])
2402+ .add(Symbol.Semicolon, [REDUCE, ReduceActions.Multiply])
2403+ .add(Symbol.Comma, [REDUCE, ReduceActions.Multiply])
2404 .build();
2405 table[State.DivideTwoNumbers] = ObjectBuilder
2406- .add(Symbol.EOF, [REDUCE, ReduceActions.DIVIDE])
2407- .add(Symbol.AMPERSAND, [SHIFT, 20]) // ???same
2408- .add(Symbol.EQUALS, [REDUCE, ReduceActions.DIVIDE])
2409- .add(Symbol.PLUS, [REDUCE, ReduceActions.DIVIDE])
2410- .add(Symbol.RIGHT_PAREN, [REDUCE, ReduceActions.DIVIDE])
2411- .add(Symbol.LESS_THAN, [REDUCE, ReduceActions.DIVIDE])
2412- .add(Symbol.GREATER_THAN, [REDUCE, ReduceActions.DIVIDE])
2413- .add(Symbol.MINUS, [REDUCE, ReduceActions.DIVIDE])
2414- .add(Symbol.ASTERISK, [REDUCE, ReduceActions.DIVIDE])
2415- .add(Symbol.DIVIDE, [REDUCE, ReduceActions.DIVIDE])
2416- .add(Symbol.CARROT, [SHIFT, 29])
2417- .add(Symbol.SEMI_COLON, [REDUCE, ReduceActions.DIVIDE])
2418- .add(Symbol.COMMA, [REDUCE, ReduceActions.DIVIDE])
2419+ .add(Symbol.EOF, [REDUCE, ReduceActions.Divide])
2420+ .add(Symbol.Ampersand, [SHIFT, State.Expression_Ampersand])
2421+ .add(Symbol.Equals, [REDUCE, ReduceActions.Divide])
2422+ .add(Symbol.Plus, [REDUCE, ReduceActions.Divide])
2423+ .add(Symbol.RightParen, [REDUCE, ReduceActions.Divide])
2424+ .add(Symbol.LessThan, [REDUCE, ReduceActions.Divide])
2425+ .add(Symbol.GreaterThan, [REDUCE, ReduceActions.Divide])
2426+ .add(Symbol.Minus, [REDUCE, ReduceActions.Divide])
2427+ .add(Symbol.Asterisk, [REDUCE, ReduceActions.Divide])
2428+ .add(Symbol.Divide, [REDUCE, ReduceActions.Divide])
2429+ .add(Symbol.Carrot, [SHIFT, State.Expression_Carrot])
2430+ .add(Symbol.Semicolon, [REDUCE, ReduceActions.Divide])
2431+ .add(Symbol.Comma, [REDUCE, ReduceActions.Divide])
2432 .build();
2433 table[State.PowerTwoNumbers] = ObjectBuilder
2434- .add(Symbol.EOF, [REDUCE, ReduceActions.TO_POWER])
2435- .add(Symbol.AMPERSAND, [SHIFT, 20])
2436- .add(Symbol.EQUALS, [REDUCE, ReduceActions.TO_POWER])
2437- .add(Symbol.PLUS, [REDUCE, ReduceActions.TO_POWER])
2438- .add(Symbol.RIGHT_PAREN, [REDUCE, ReduceActions.TO_POWER])
2439- .add(Symbol.LESS_THAN, [REDUCE, ReduceActions.TO_POWER])
2440- .add(Symbol.GREATER_THAN, [REDUCE, ReduceActions.TO_POWER])
2441- .add(Symbol.MINUS, [REDUCE, ReduceActions.TO_POWER])
2442- .add(Symbol.ASTERISK, [REDUCE, ReduceActions.TO_POWER])
2443- .add(Symbol.DIVIDE, [REDUCE, ReduceActions.TO_POWER])
2444- .add(Symbol.CARROT, [REDUCE, ReduceActions.TO_POWER])
2445- .add(Symbol.SEMI_COLON, [REDUCE, ReduceActions.TO_POWER])
2446- .add(Symbol.COMMA, [REDUCE, ReduceActions.TO_POWER])
2447+ .add(Symbol.EOF, [REDUCE, ReduceActions.ToPower])
2448+ .add(Symbol.Ampersand, [SHIFT, State.Expression_Ampersand])
2449+ .add(Symbol.Equals, [REDUCE, ReduceActions.ToPower])
2450+ .add(Symbol.Plus, [REDUCE, ReduceActions.ToPower])
2451+ .add(Symbol.RightParen, [REDUCE, ReduceActions.ToPower])
2452+ .add(Symbol.LessThan, [REDUCE, ReduceActions.ToPower])
2453+ .add(Symbol.GreaterThan, [REDUCE, ReduceActions.ToPower])
2454+ .add(Symbol.Minus, [REDUCE, ReduceActions.ToPower])
2455+ .add(Symbol.Asterisk, [REDUCE, ReduceActions.ToPower])
2456+ .add(Symbol.Divide, [REDUCE, ReduceActions.ToPower])
2457+ .add(Symbol.Carrot, [REDUCE, ReduceActions.ToPower])
2458+ .add(Symbol.Semicolon, [REDUCE, ReduceActions.ToPower])
2459+ .add(Symbol.Comma, [REDUCE, ReduceActions.ToPower])
2460 .build();
2461 table[State.VariableSeq_Decimal_Variable] = ObjectBuilder
2462- .add(Symbol.EOF, [REDUCE, ReduceActions.ENSURE_LAST_TWO_IN_ARRAY_AND_PUSH])
2463- .add(Symbol.AMPERSAND, [REDUCE, ReduceActions.ENSURE_LAST_TWO_IN_ARRAY_AND_PUSH])
2464- .add(Symbol.EQUALS, [REDUCE, ReduceActions.ENSURE_LAST_TWO_IN_ARRAY_AND_PUSH])
2465- .add(Symbol.PLUS, [REDUCE, ReduceActions.ENSURE_LAST_TWO_IN_ARRAY_AND_PUSH])
2466- .add(Symbol.RIGHT_PAREN, [REDUCE, ReduceActions.ENSURE_LAST_TWO_IN_ARRAY_AND_PUSH])
2467- .add(Symbol.LESS_THAN, [REDUCE, ReduceActions.ENSURE_LAST_TWO_IN_ARRAY_AND_PUSH])
2468- .add(Symbol.GREATER_THAN, [REDUCE, ReduceActions.ENSURE_LAST_TWO_IN_ARRAY_AND_PUSH])
2469- .add(Symbol.MINUS, [REDUCE, ReduceActions.ENSURE_LAST_TWO_IN_ARRAY_AND_PUSH])
2470- .add(Symbol.ASTERISK, [REDUCE, ReduceActions.ENSURE_LAST_TWO_IN_ARRAY_AND_PUSH])
2471- .add(Symbol.DIVIDE, [REDUCE, ReduceActions.ENSURE_LAST_TWO_IN_ARRAY_AND_PUSH])
2472- .add(Symbol.CARROT, [REDUCE, ReduceActions.ENSURE_LAST_TWO_IN_ARRAY_AND_PUSH])
2473- .add(Symbol.SEMI_COLON, [REDUCE, ReduceActions.ENSURE_LAST_TWO_IN_ARRAY_AND_PUSH])
2474- .add(Symbol.COMMA, [REDUCE, ReduceActions.ENSURE_LAST_TWO_IN_ARRAY_AND_PUSH])
2475- .add(Symbol.DECIMAL, [REDUCE, ReduceActions.ENSURE_LAST_TWO_IN_ARRAY_AND_PUSH])
2476+ .add(Symbol.EOF, [REDUCE, ReduceActions.EnsureLastTwoINArrayAndPush])
2477+ .add(Symbol.Ampersand, [REDUCE, ReduceActions.EnsureLastTwoINArrayAndPush])
2478+ .add(Symbol.Equals, [REDUCE, ReduceActions.EnsureLastTwoINArrayAndPush])
2479+ .add(Symbol.Plus, [REDUCE, ReduceActions.EnsureLastTwoINArrayAndPush])
2480+ .add(Symbol.RightParen, [REDUCE, ReduceActions.EnsureLastTwoINArrayAndPush])
2481+ .add(Symbol.LessThan, [REDUCE, ReduceActions.EnsureLastTwoINArrayAndPush])
2482+ .add(Symbol.GreaterThan, [REDUCE, ReduceActions.EnsureLastTwoINArrayAndPush])
2483+ .add(Symbol.Minus, [REDUCE, ReduceActions.EnsureLastTwoINArrayAndPush])
2484+ .add(Symbol.Asterisk, [REDUCE, ReduceActions.EnsureLastTwoINArrayAndPush])
2485+ .add(Symbol.Divide, [REDUCE, ReduceActions.EnsureLastTwoINArrayAndPush])
2486+ .add(Symbol.Carrot, [REDUCE, ReduceActions.EnsureLastTwoINArrayAndPush])
2487+ .add(Symbol.Semicolon, [REDUCE, ReduceActions.EnsureLastTwoINArrayAndPush])
2488+ .add(Symbol.Comma, [REDUCE, ReduceActions.EnsureLastTwoINArrayAndPush])
2489+ .add(Symbol.Decimal, [REDUCE, ReduceActions.EnsureLastTwoINArrayAndPush])
2490 .build();
2491 table[State.Expression_RightParen] = ObjectBuilder
2492- .add(Symbol.EOF, [REDUCE, ReduceActions.LAST_NUMBER])
2493- .add(Symbol.AMPERSAND, [REDUCE, ReduceActions.LAST_NUMBER])
2494- .add(Symbol.EQUALS, [REDUCE, ReduceActions.LAST_NUMBER])
2495- .add(Symbol.PLUS, [REDUCE, ReduceActions.LAST_NUMBER])
2496- .add(Symbol.RIGHT_PAREN, [REDUCE, ReduceActions.LAST_NUMBER])
2497- .add(Symbol.LESS_THAN, [REDUCE, ReduceActions.LAST_NUMBER])
2498- .add(Symbol.GREATER_THAN, [REDUCE, ReduceActions.LAST_NUMBER])
2499- .add(Symbol.MINUS, [REDUCE, ReduceActions.LAST_NUMBER])
2500- .add(Symbol.ASTERISK, [REDUCE, ReduceActions.LAST_NUMBER])
2501- .add(Symbol.DIVIDE, [REDUCE, ReduceActions.LAST_NUMBER])
2502- .add(Symbol.CARROT, [REDUCE, ReduceActions.LAST_NUMBER])
2503- .add(Symbol.SEMI_COLON, [REDUCE, ReduceActions.LAST_NUMBER])
2504- .add(Symbol.COMMA, [REDUCE, ReduceActions.LAST_NUMBER])
2505+ .add(Symbol.EOF, [REDUCE, ReduceActions.LastNumber])
2506+ .add(Symbol.Ampersand, [REDUCE, ReduceActions.LastNumber])
2507+ .add(Symbol.Equals, [REDUCE, ReduceActions.LastNumber])
2508+ .add(Symbol.Plus, [REDUCE, ReduceActions.LastNumber])
2509+ .add(Symbol.RightParen, [REDUCE, ReduceActions.LastNumber])
2510+ .add(Symbol.LessThan, [REDUCE, ReduceActions.LastNumber])
2511+ .add(Symbol.GreaterThan, [REDUCE, ReduceActions.LastNumber])
2512+ .add(Symbol.Minus, [REDUCE, ReduceActions.LastNumber])
2513+ .add(Symbol.Asterisk, [REDUCE, ReduceActions.LastNumber])
2514+ .add(Symbol.Divide, [REDUCE, ReduceActions.LastNumber])
2515+ .add(Symbol.Carrot, [REDUCE, ReduceActions.LastNumber])
2516+ .add(Symbol.Semicolon, [REDUCE, ReduceActions.LastNumber])
2517+ .add(Symbol.Comma, [REDUCE, ReduceActions.LastNumber])
2518 .build();
2519 table[State.Function_RightParenNoArguments] = ObjectBuilder
2520- .add(Symbol.EOF, [REDUCE, ReduceActions.CALL_FUNCTION_LAST_BLANK])
2521- .add(Symbol.AMPERSAND, [REDUCE, ReduceActions.CALL_FUNCTION_LAST_BLANK])
2522- .add(Symbol.EQUALS, [REDUCE, ReduceActions.CALL_FUNCTION_LAST_BLANK])
2523- .add(Symbol.PLUS, [REDUCE, ReduceActions.CALL_FUNCTION_LAST_BLANK])
2524- .add(Symbol.RIGHT_PAREN, [REDUCE, ReduceActions.CALL_FUNCTION_LAST_BLANK])
2525- .add(Symbol.LESS_THAN, [REDUCE, ReduceActions.CALL_FUNCTION_LAST_BLANK])
2526- .add(Symbol.GREATER_THAN, [REDUCE, ReduceActions.CALL_FUNCTION_LAST_BLANK])
2527- .add(Symbol.MINUS, [REDUCE, ReduceActions.CALL_FUNCTION_LAST_BLANK])
2528- .add(Symbol.ASTERISK, [REDUCE, ReduceActions.CALL_FUNCTION_LAST_BLANK])
2529- .add(Symbol.DIVIDE, [REDUCE, ReduceActions.CALL_FUNCTION_LAST_BLANK])
2530- .add(Symbol.CARROT, [REDUCE, ReduceActions.CALL_FUNCTION_LAST_BLANK])
2531- .add(Symbol.SEMI_COLON, [REDUCE, ReduceActions.CALL_FUNCTION_LAST_BLANK])
2532- .add(Symbol.COMMA, [REDUCE, ReduceActions.CALL_FUNCTION_LAST_BLANK])
2533- .build();
2534-table[59] = ObjectBuilder
2535- .add(Symbol.RIGHT_PAREN, [SHIFT, State.CLOSE_PAREN_ON_FUNCTION])
2536- .add(Symbol.SEMI_COLON, [SHIFT, State.Variable_SemiColon])
2537- .add(Symbol.COMMA, [SHIFT, State.Variable_Comma])
2538+ .add(Symbol.EOF, [REDUCE, ReduceActions.CallFunctionLastBlank])
2539+ .add(Symbol.Ampersand, [REDUCE, ReduceActions.CallFunctionLastBlank])
2540+ .add(Symbol.Equals, [REDUCE, ReduceActions.CallFunctionLastBlank])
2541+ .add(Symbol.Plus, [REDUCE, ReduceActions.CallFunctionLastBlank])
2542+ .add(Symbol.RightParen, [REDUCE, ReduceActions.CallFunctionLastBlank])
2543+ .add(Symbol.LessThan, [REDUCE, ReduceActions.CallFunctionLastBlank])
2544+ .add(Symbol.GreaterThan, [REDUCE, ReduceActions.CallFunctionLastBlank])
2545+ .add(Symbol.Minus, [REDUCE, ReduceActions.CallFunctionLastBlank])
2546+ .add(Symbol.Asterisk, [REDUCE, ReduceActions.CallFunctionLastBlank])
2547+ .add(Symbol.Divide, [REDUCE, ReduceActions.CallFunctionLastBlank])
2548+ .add(Symbol.Carrot, [REDUCE, ReduceActions.CallFunctionLastBlank])
2549+ .add(Symbol.Semicolon, [REDUCE, ReduceActions.CallFunctionLastBlank])
2550+ .add(Symbol.Comma, [REDUCE, ReduceActions.CallFunctionLastBlank])
2551+ .build();
2552+table[State.Function_LeftParen_ExpressionSeq] = ObjectBuilder
2553+ .add(Symbol.RightParen, [SHIFT, State.Function_Etc_RightParen])
2554+ .add(Symbol.Semicolon, [SHIFT, State.Variable_SemiColon])
2555+ .add(Symbol.Comma, [SHIFT, State.Variable_Comma])
2556 .build();
2557 table[State.Function_LeftParen_Expression] = ObjectBuilder
2558- .add(Symbol.AMPERSAND, [SHIFT, State.Number_Ampersand])
2559- .add(Symbol.EQUALS, [SHIFT, State.Start_Equals])
2560- .add(Symbol.PLUS, [SHIFT, State.Number_Plus])
2561- .add(Symbol.RIGHT_PAREN, [REDUCE, ReduceActions.ENSURE_IS_ARRAY])
2562- .add(Symbol.LESS_THAN, [SHIFT, State.LessThan])
2563- .add(Symbol.GREATER_THAN, [SHIFT, State.GreaterThan])
2564- .add(Symbol.MINUS, [SHIFT, State.Number_Minus])
2565- .add(Symbol.ASTERISK, [SHIFT, State.Number_Asterisk])
2566- .add(Symbol.DIVIDE, [SHIFT, State.Number_Divide])
2567- .add(Symbol.CARROT, [SHIFT, State.Number_Carrot])
2568- .add(Symbol.SEMI_COLON, [REDUCE, ReduceActions.ENSURE_IS_ARRAY])
2569- .add(Symbol.COMMA, [REDUCE, ReduceActions.ENSURE_IS_ARRAY])
2570+ .add(Symbol.Ampersand, [SHIFT, State.Expression_Ampersand])
2571+ .add(Symbol.Equals, [SHIFT, State.Start_Equals])
2572+ .add(Symbol.Plus, [SHIFT, State.Expression_Plus])
2573+ .add(Symbol.RightParen, [REDUCE, ReduceActions.EnsureIsArray])
2574+ .add(Symbol.LessThan, [SHIFT, State.LessThan])
2575+ .add(Symbol.GreaterThan, [SHIFT, State.GreaterThan])
2576+ .add(Symbol.Minus, [SHIFT, State.Expression_Minus])
2577+ .add(Symbol.Asterisk, [SHIFT, State.Expression_Asterisk])
2578+ .add(Symbol.Divide, [SHIFT, State.Expression_Divide])
2579+ .add(Symbol.Carrot, [SHIFT, State.Expression_Carrot])
2580+ .add(Symbol.Semicolon, [REDUCE, ReduceActions.EnsureIsArray])
2581+ .add(Symbol.Comma, [REDUCE, ReduceActions.EnsureIsArray])
2582 .build();
2583 table[State.LeftParen_Array] = ObjectBuilder
2584- .add(Symbol.RIGHT_PAREN, [REDUCE, ReduceActions.ENSURE_YYTEXT_ARRAY])
2585- .add(Symbol.SEMI_COLON, [REDUCE, ReduceActions.ENSURE_YYTEXT_ARRAY])
2586- .add(Symbol.COMMA, [REDUCE, ReduceActions.ENSURE_YYTEXT_ARRAY])
2587- .build();
2588-table[62] = ObjectBuilder
2589- .add(Symbol.EXCLAMATION_POINT, [SHIFT, 73])
2590- .build();
2591-table[63] = ObjectBuilder
2592- .add(Symbol.EOF, [REDUCE, ReduceActions.REDUCE_FLOAT])
2593- .add(Symbol.AMPERSAND, [REDUCE, ReduceActions.REDUCE_FLOAT])
2594- .add(Symbol.EQUALS, [REDUCE, ReduceActions.REDUCE_FLOAT])
2595- .add(Symbol.PLUS, [REDUCE, ReduceActions.REDUCE_FLOAT])
2596- .add(Symbol.RIGHT_PAREN, [REDUCE, ReduceActions.REDUCE_FLOAT])
2597- .add(Symbol.LESS_THAN, [REDUCE, ReduceActions.REDUCE_FLOAT])
2598- .add(Symbol.GREATER_THAN, [REDUCE, ReduceActions.REDUCE_FLOAT])
2599- .add(Symbol.MINUS, [REDUCE, ReduceActions.REDUCE_FLOAT])
2600- .add(Symbol.ASTERISK, [REDUCE, ReduceActions.REDUCE_FLOAT])
2601- .add(Symbol.DIVIDE, [REDUCE, ReduceActions.REDUCE_FLOAT])
2602- .add(Symbol.CARROT, [REDUCE, ReduceActions.REDUCE_FLOAT])
2603- .add(Symbol.SEMI_COLON, [REDUCE, ReduceActions.REDUCE_FLOAT])
2604- .add(Symbol.COMMA, [REDUCE, ReduceActions.REDUCE_FLOAT])
2605- .add(Symbol.PERCENT, [REDUCE, ReduceActions.REDUCE_FLOAT])
2606- .add(38, [REDUCE, ReduceActions.REDUCE_FLOAT]).build();
2607-table[64] = ObjectBuilder
2608- .add(Symbol.EOF, [REDUCE, ReduceActions.FIXED_CELL_RANGE_VAL])
2609- .add(Symbol.AMPERSAND, [REDUCE, ReduceActions.FIXED_CELL_RANGE_VAL])
2610- .add(Symbol.EQUALS, [REDUCE, ReduceActions.FIXED_CELL_RANGE_VAL])
2611- .add(Symbol.PLUS, [REDUCE, ReduceActions.FIXED_CELL_RANGE_VAL])
2612- .add(Symbol.RIGHT_PAREN, [REDUCE, ReduceActions.FIXED_CELL_RANGE_VAL])
2613- .add(Symbol.LESS_THAN, [REDUCE, ReduceActions.FIXED_CELL_RANGE_VAL])
2614- .add(Symbol.GREATER_THAN, [REDUCE, ReduceActions.FIXED_CELL_RANGE_VAL])
2615- .add(Symbol.MINUS, [REDUCE, ReduceActions.FIXED_CELL_RANGE_VAL])
2616- .add(Symbol.ASTERISK, [REDUCE, ReduceActions.FIXED_CELL_RANGE_VAL])
2617- .add(Symbol.DIVIDE, [REDUCE, ReduceActions.FIXED_CELL_RANGE_VAL])
2618- .add(Symbol.CARROT, [REDUCE, ReduceActions.FIXED_CELL_RANGE_VAL])
2619- .add(Symbol.SEMI_COLON, [REDUCE, ReduceActions.FIXED_CELL_RANGE_VAL])
2620- .add(Symbol.COMMA, [REDUCE, ReduceActions.FIXED_CELL_RANGE_VAL]).build();
2621-table[65] = ObjectBuilder
2622- .add(Symbol.EOF, [REDUCE, ReduceActions.CELL_RANGE_VALUE])
2623- .add(Symbol.AMPERSAND, [REDUCE, ReduceActions.CELL_RANGE_VALUE])
2624- .add(Symbol.EQUALS, [REDUCE, ReduceActions.CELL_RANGE_VALUE])
2625- .add(Symbol.PLUS, [REDUCE, ReduceActions.CELL_RANGE_VALUE])
2626- .add(Symbol.RIGHT_PAREN, [REDUCE, ReduceActions.CELL_RANGE_VALUE])
2627- .add(Symbol.LESS_THAN, [REDUCE, ReduceActions.CELL_RANGE_VALUE])
2628- .add(Symbol.GREATER_THAN, [REDUCE, ReduceActions.CELL_RANGE_VALUE])
2629- .add(Symbol.MINUS, [REDUCE, ReduceActions.CELL_RANGE_VALUE])
2630- .add(Symbol.ASTERISK, [REDUCE, ReduceActions.CELL_RANGE_VALUE])
2631- .add(Symbol.DIVIDE, [REDUCE, ReduceActions.CELL_RANGE_VALUE])
2632- .add(Symbol.CARROT, [REDUCE, ReduceActions.CELL_RANGE_VALUE])
2633- .add(Symbol.SEMI_COLON, [REDUCE, ReduceActions.CELL_RANGE_VALUE])
2634- .add(Symbol.COMMA, [REDUCE, ReduceActions.CELL_RANGE_VALUE]).build();
2635-table[66] = ObjectBuilder
2636- .add(Symbol.EOF, [REDUCE, ReduceActions.REDUCE_LAST_THREE_A])
2637- .add(Symbol.AMPERSAND, [REDUCE, ReduceActions.REDUCE_LAST_THREE_A])
2638- .add(Symbol.EQUALS, [REDUCE, ReduceActions.REDUCE_LAST_THREE_A])
2639- .add(Symbol.PLUS, [REDUCE, ReduceActions.REDUCE_LAST_THREE_A])
2640- .add(Symbol.RIGHT_PAREN, [REDUCE, ReduceActions.REDUCE_LAST_THREE_A])
2641- .add(Symbol.LESS_THAN, [REDUCE, ReduceActions.REDUCE_LAST_THREE_A])
2642- .add(Symbol.GREATER_THAN, [REDUCE, ReduceActions.REDUCE_LAST_THREE_A])
2643- .add(Symbol.MINUS, [REDUCE, ReduceActions.REDUCE_LAST_THREE_A])
2644- .add(Symbol.ASTERISK, [REDUCE, ReduceActions.REDUCE_LAST_THREE_A])
2645- .add(Symbol.DIVIDE, [REDUCE, ReduceActions.REDUCE_LAST_THREE_A])
2646- .add(Symbol.CARROT, [REDUCE, ReduceActions.REDUCE_LAST_THREE_A])
2647- .add(Symbol.SEMI_COLON, [REDUCE, ReduceActions.REDUCE_LAST_THREE_A])
2648- .add(Symbol.COMMA, [REDUCE, ReduceActions.REDUCE_LAST_THREE_A])
2649- .add(Symbol.VARIABLE, [REDUCE, ReduceActions.REDUCE_LAST_THREE_A])
2650- .add(Symbol.FULL_ERROR, [REDUCE, ReduceActions.REDUCE_LAST_THREE_A]).build();
2651-table[67] = ObjectBuilder
2652+ .add(Symbol.RightParen, [REDUCE, ReduceActions.EnsureYYTextIsArray])
2653+ .add(Symbol.Semicolon, [REDUCE, ReduceActions.EnsureYYTextIsArray])
2654+ .add(Symbol.Comma, [REDUCE, ReduceActions.EnsureYYTextIsArray])
2655+ .build();
2656+table[State.Variable_FullError_Variable] = ObjectBuilder
2657+ .add(Symbol.ExclamationPoint, [SHIFT, State.Variable_FullError_Variable_ExclamationPoint])
2658+ .build();
2659+table[State.Number_Decimal_NumberUpper] = ObjectBuilder
2660+ .add(Symbol.EOF, [REDUCE, ReduceActions.ReduceFloat])
2661+ .add(Symbol.Ampersand, [REDUCE, ReduceActions.ReduceFloat])
2662+ .add(Symbol.Equals, [REDUCE, ReduceActions.ReduceFloat])
2663+ .add(Symbol.Plus, [REDUCE, ReduceActions.ReduceFloat])
2664+ .add(Symbol.RightParen, [REDUCE, ReduceActions.ReduceFloat])
2665+ .add(Symbol.LessThan, [REDUCE, ReduceActions.ReduceFloat])
2666+ .add(Symbol.GreaterThan, [REDUCE, ReduceActions.ReduceFloat])
2667+ .add(Symbol.Minus, [REDUCE, ReduceActions.ReduceFloat])
2668+ .add(Symbol.Asterisk, [REDUCE, ReduceActions.ReduceFloat])
2669+ .add(Symbol.Divide, [REDUCE, ReduceActions.ReduceFloat])
2670+ .add(Symbol.Carrot, [REDUCE, ReduceActions.ReduceFloat])
2671+ .add(Symbol.Semicolon, [REDUCE, ReduceActions.ReduceFloat])
2672+ .add(Symbol.Comma, [REDUCE, ReduceActions.ReduceFloat])
2673+ .add(Symbol.Percent, [REDUCE, ReduceActions.ReduceFloat])
2674+ .add(Symbol.ReflexiveReduce, [REDUCE, ReduceActions.ReduceFloat]).build();
2675+table[State.FixedCell_Colon_FixedCell] = ObjectBuilder
2676+ .add(Symbol.EOF, [REDUCE, ReduceActions.FixedCellRangeValue])
2677+ .add(Symbol.Ampersand, [REDUCE, ReduceActions.FixedCellRangeValue])
2678+ .add(Symbol.Equals, [REDUCE, ReduceActions.FixedCellRangeValue])
2679+ .add(Symbol.Plus, [REDUCE, ReduceActions.FixedCellRangeValue])
2680+ .add(Symbol.RightParen, [REDUCE, ReduceActions.FixedCellRangeValue])
2681+ .add(Symbol.LessThan, [REDUCE, ReduceActions.FixedCellRangeValue])
2682+ .add(Symbol.GreaterThan, [REDUCE, ReduceActions.FixedCellRangeValue])
2683+ .add(Symbol.Minus, [REDUCE, ReduceActions.FixedCellRangeValue])
2684+ .add(Symbol.Asterisk, [REDUCE, ReduceActions.FixedCellRangeValue])
2685+ .add(Symbol.Divide, [REDUCE, ReduceActions.FixedCellRangeValue])
2686+ .add(Symbol.Carrot, [REDUCE, ReduceActions.FixedCellRangeValue])
2687+ .add(Symbol.Semicolon, [REDUCE, ReduceActions.FixedCellRangeValue])
2688+ .add(Symbol.Comma, [REDUCE, ReduceActions.FixedCellRangeValue]).build();
2689+table[State.CellUpper_Colon_CellUpper] = ObjectBuilder
2690+ .add(Symbol.EOF, [REDUCE, ReduceActions.CellRangeValue])
2691+ .add(Symbol.Ampersand, [REDUCE, ReduceActions.CellRangeValue])
2692+ .add(Symbol.Equals, [REDUCE, ReduceActions.CellRangeValue])
2693+ .add(Symbol.Plus, [REDUCE, ReduceActions.CellRangeValue])
2694+ .add(Symbol.RightParen, [REDUCE, ReduceActions.CellRangeValue])
2695+ .add(Symbol.LessThan, [REDUCE, ReduceActions.CellRangeValue])
2696+ .add(Symbol.GreaterThan, [REDUCE, ReduceActions.CellRangeValue])
2697+ .add(Symbol.Minus, [REDUCE, ReduceActions.CellRangeValue])
2698+ .add(Symbol.Asterisk, [REDUCE, ReduceActions.CellRangeValue])
2699+ .add(Symbol.Divide, [REDUCE, ReduceActions.CellRangeValue])
2700+ .add(Symbol.Carrot, [REDUCE, ReduceActions.CellRangeValue])
2701+ .add(Symbol.Semicolon, [REDUCE, ReduceActions.CellRangeValue])
2702+ .add(Symbol.Comma, [REDUCE, ReduceActions.CellRangeValue]).build();
2703+table[State.Pound_Variable_ExclamationPoint] = ObjectBuilder
2704+ .add(Symbol.EOF, [REDUCE, ReduceActions.ReduceLastThreeA])
2705+ .add(Symbol.Ampersand, [REDUCE, ReduceActions.ReduceLastThreeA])
2706+ .add(Symbol.Equals, [REDUCE, ReduceActions.ReduceLastThreeA])
2707+ .add(Symbol.Plus, [REDUCE, ReduceActions.ReduceLastThreeA])
2708+ .add(Symbol.RightParen, [REDUCE, ReduceActions.ReduceLastThreeA])
2709+ .add(Symbol.LessThan, [REDUCE, ReduceActions.ReduceLastThreeA])
2710+ .add(Symbol.GreaterThan, [REDUCE, ReduceActions.ReduceLastThreeA])
2711+ .add(Symbol.Minus, [REDUCE, ReduceActions.ReduceLastThreeA])
2712+ .add(Symbol.Asterisk, [REDUCE, ReduceActions.ReduceLastThreeA])
2713+ .add(Symbol.Divide, [REDUCE, ReduceActions.ReduceLastThreeA])
2714+ .add(Symbol.Carrot, [REDUCE, ReduceActions.ReduceLastThreeA])
2715+ .add(Symbol.Semicolon, [REDUCE, ReduceActions.ReduceLastThreeA])
2716+ .add(Symbol.Comma, [REDUCE, ReduceActions.ReduceLastThreeA])
2717+ .add(Symbol.Variable, [REDUCE, ReduceActions.ReduceLastThreeA])
2718+ .add(Symbol.FullError, [REDUCE, ReduceActions.ReduceLastThreeA]).build();
2719+table[State.LessThan_Equals_Expression] = ObjectBuilder
2720 .add(Symbol.EOF, [REDUCE, ReduceActions.LTE])
2721- .add(Symbol.AMPERSAND, [SHIFT, State.Number_Ampersand])
2722- .add(Symbol.EQUALS, [REDUCE, ReduceActions.LTE])
2723- .add(Symbol.PLUS, [SHIFT, State.Number_Plus])
2724- .add(Symbol.RIGHT_PAREN, [REDUCE, ReduceActions.LTE])
2725- .add(Symbol.LESS_THAN, [REDUCE, ReduceActions.LTE])
2726- .add(Symbol.GREATER_THAN, [REDUCE, ReduceActions.LTE])
2727- .add(Symbol.MINUS, [SHIFT, State.Number_Minus])
2728- .add(Symbol.ASTERISK, [SHIFT, State.Number_Asterisk])
2729- .add(Symbol.DIVIDE, [SHIFT, State.Number_Divide])
2730- .add(Symbol.CARROT, [SHIFT, State.Number_Carrot])
2731- .add(Symbol.SEMI_COLON, [REDUCE, ReduceActions.LTE])
2732- .add(Symbol.COMMA, [REDUCE, ReduceActions.LTE]).build();
2733-table[68] = ObjectBuilder
2734- .add(Symbol.EOF, [REDUCE, ReduceActions.NOT_EQ])
2735- .add(Symbol.AMPERSAND, [SHIFT, State.Number_Ampersand])
2736- .add(Symbol.EQUALS, [REDUCE, ReduceActions.NOT_EQ])
2737- .add(Symbol.PLUS, [SHIFT, State.Number_Plus])
2738- .add(Symbol.RIGHT_PAREN, [REDUCE, ReduceActions.NOT_EQ])
2739- .add(Symbol.LESS_THAN, [REDUCE, ReduceActions.NOT_EQ])
2740- .add(Symbol.GREATER_THAN, [REDUCE, ReduceActions.NOT_EQ])
2741- .add(Symbol.MINUS, [SHIFT, State.Number_Minus])
2742- .add(Symbol.ASTERISK, [SHIFT, State.Number_Asterisk])
2743- .add(Symbol.DIVIDE, [SHIFT, State.Number_Divide])
2744- .add(Symbol.CARROT, [SHIFT, State.Number_Carrot])
2745- .add(Symbol.SEMI_COLON, [REDUCE, ReduceActions.NOT_EQ])
2746- .add(Symbol.COMMA, [REDUCE, ReduceActions.NOT_EQ]).build();
2747-table[State.GTETwoExpressions] = ObjectBuilder
2748+ .add(Symbol.Ampersand, [SHIFT, State.Expression_Ampersand])
2749+ .add(Symbol.Equals, [REDUCE, ReduceActions.LTE])
2750+ .add(Symbol.Plus, [SHIFT, State.Expression_Plus])
2751+ .add(Symbol.RightParen, [REDUCE, ReduceActions.LTE])
2752+ .add(Symbol.LessThan, [REDUCE, ReduceActions.LTE])
2753+ .add(Symbol.GreaterThan, [REDUCE, ReduceActions.LTE])
2754+ .add(Symbol.Minus, [SHIFT, State.Expression_Minus])
2755+ .add(Symbol.Asterisk, [SHIFT, State.Expression_Asterisk])
2756+ .add(Symbol.Divide, [SHIFT, State.Expression_Divide])
2757+ .add(Symbol.Carrot, [SHIFT, State.Expression_Carrot])
2758+ .add(Symbol.Semicolon, [REDUCE, ReduceActions.LTE])
2759+ .add(Symbol.Comma, [REDUCE, ReduceActions.LTE]).build();
2760+table[State.LessThan_GreaterThan_Expression] = ObjectBuilder
2761+ .add(Symbol.EOF, [REDUCE, ReduceActions.NotEqual])
2762+ .add(Symbol.Ampersand, [SHIFT, State.Expression_Ampersand])
2763+ .add(Symbol.Equals, [REDUCE, ReduceActions.NotEqual])
2764+ .add(Symbol.Plus, [SHIFT, State.Expression_Plus])
2765+ .add(Symbol.RightParen, [REDUCE, ReduceActions.NotEqual])
2766+ .add(Symbol.LessThan, [REDUCE, ReduceActions.NotEqual])
2767+ .add(Symbol.GreaterThan, [REDUCE, ReduceActions.NotEqual])
2768+ .add(Symbol.Minus, [SHIFT, State.Expression_Minus])
2769+ .add(Symbol.Asterisk, [SHIFT, State.Expression_Asterisk])
2770+ .add(Symbol.Divide, [SHIFT, State.Expression_Divide])
2771+ .add(Symbol.Carrot, [SHIFT, State.Expression_Carrot])
2772+ .add(Symbol.Semicolon, [REDUCE, ReduceActions.NotEqual])
2773+ .add(Symbol.Comma, [REDUCE, ReduceActions.NotEqual]).build();
2774+table[State.GreaterThanEquals_Expressions] = ObjectBuilder
2775 .add(Symbol.EOF, [REDUCE, ReduceActions.GTE])
2776- .add(Symbol.AMPERSAND, [SHIFT, State.Number_Ampersand])
2777- .add(Symbol.EQUALS, [REDUCE, ReduceActions.GTE])
2778- .add(Symbol.PLUS, [SHIFT, State.Number_Plus])
2779- .add(Symbol.RIGHT_PAREN, [REDUCE, ReduceActions.GTE])
2780- .add(Symbol.LESS_THAN, [REDUCE, ReduceActions.GTE])
2781- .add(Symbol.GREATER_THAN, [REDUCE, ReduceActions.GTE])
2782- .add(Symbol.MINUS, [SHIFT, State.Number_Minus])
2783- .add(Symbol.ASTERISK, [SHIFT, State.Number_Asterisk])
2784- .add(Symbol.DIVIDE, [SHIFT, State.Number_Divide])
2785- .add(Symbol.CARROT, [SHIFT, State.Number_Carrot])
2786- .add(Symbol.SEMI_COLON, [REDUCE, ReduceActions.GTE])
2787- .add(Symbol.COMMA, [REDUCE, ReduceActions.GTE])
2788- .build();
2789-table[State.CLOSE_PAREN_ON_FUNCTION] = ObjectBuilder
2790- .add(Symbol.EOF, [REDUCE, ReduceActions.CALL_FUNCTION_LAST_TWO_IN_STACK])
2791- .add(Symbol.AMPERSAND, [REDUCE, ReduceActions.CALL_FUNCTION_LAST_TWO_IN_STACK])
2792- .add(Symbol.EQUALS, [REDUCE, ReduceActions.CALL_FUNCTION_LAST_TWO_IN_STACK])
2793- .add(Symbol.PLUS, [REDUCE, ReduceActions.CALL_FUNCTION_LAST_TWO_IN_STACK])
2794- .add(Symbol.RIGHT_PAREN, [REDUCE, ReduceActions.CALL_FUNCTION_LAST_TWO_IN_STACK])
2795- .add(Symbol.LESS_THAN, [REDUCE, ReduceActions.CALL_FUNCTION_LAST_TWO_IN_STACK])
2796- .add(Symbol.GREATER_THAN, [REDUCE, ReduceActions.CALL_FUNCTION_LAST_TWO_IN_STACK])
2797- .add(Symbol.MINUS, [REDUCE, ReduceActions.CALL_FUNCTION_LAST_TWO_IN_STACK])
2798- .add(Symbol.ASTERISK, [REDUCE, ReduceActions.CALL_FUNCTION_LAST_TWO_IN_STACK])
2799- .add(Symbol.DIVIDE, [REDUCE, ReduceActions.CALL_FUNCTION_LAST_TWO_IN_STACK])
2800- .add(Symbol.CARROT, [REDUCE, ReduceActions.CALL_FUNCTION_LAST_TWO_IN_STACK])
2801- .add(Symbol.SEMI_COLON, [REDUCE, ReduceActions.CALL_FUNCTION_LAST_TWO_IN_STACK])
2802- .add(Symbol.COMMA, [REDUCE, ReduceActions.CALL_FUNCTION_LAST_TWO_IN_STACK])
2803+ .add(Symbol.Ampersand, [SHIFT, State.Expression_Ampersand])
2804+ .add(Symbol.Equals, [REDUCE, ReduceActions.GTE])
2805+ .add(Symbol.Plus, [SHIFT, State.Expression_Plus])
2806+ .add(Symbol.RightParen, [REDUCE, ReduceActions.GTE])
2807+ .add(Symbol.LessThan, [REDUCE, ReduceActions.GTE])
2808+ .add(Symbol.GreaterThan, [REDUCE, ReduceActions.GTE])
2809+ .add(Symbol.Minus, [SHIFT, State.Expression_Minus])
2810+ .add(Symbol.Asterisk, [SHIFT, State.Expression_Asterisk])
2811+ .add(Symbol.Divide, [SHIFT, State.Expression_Divide])
2812+ .add(Symbol.Carrot, [SHIFT, State.Expression_Carrot])
2813+ .add(Symbol.Semicolon, [REDUCE, ReduceActions.GTE])
2814+ .add(Symbol.Comma, [REDUCE, ReduceActions.GTE])
2815+ .build();
2816+table[State.Function_Etc_RightParen] = ObjectBuilder
2817+ .add(Symbol.EOF, [REDUCE, ReduceActions.CallFunctionLastTwoInStack])
2818+ .add(Symbol.Ampersand, [REDUCE, ReduceActions.CallFunctionLastTwoInStack])
2819+ .add(Symbol.Equals, [REDUCE, ReduceActions.CallFunctionLastTwoInStack])
2820+ .add(Symbol.Plus, [REDUCE, ReduceActions.CallFunctionLastTwoInStack])
2821+ .add(Symbol.RightParen, [REDUCE, ReduceActions.CallFunctionLastTwoInStack])
2822+ .add(Symbol.LessThan, [REDUCE, ReduceActions.CallFunctionLastTwoInStack])
2823+ .add(Symbol.GreaterThan, [REDUCE, ReduceActions.CallFunctionLastTwoInStack])
2824+ .add(Symbol.Minus, [REDUCE, ReduceActions.CallFunctionLastTwoInStack])
2825+ .add(Symbol.Asterisk, [REDUCE, ReduceActions.CallFunctionLastTwoInStack])
2826+ .add(Symbol.Divide, [REDUCE, ReduceActions.CallFunctionLastTwoInStack])
2827+ .add(Symbol.Carrot, [REDUCE, ReduceActions.CallFunctionLastTwoInStack])
2828+ .add(Symbol.Semicolon, [REDUCE, ReduceActions.CallFunctionLastTwoInStack])
2829+ .add(Symbol.Comma, [REDUCE, ReduceActions.CallFunctionLastTwoInStack])
2830 .build();
2831 table[State.Variable_SemiColon] = ObjectBuilder
2832- .add(Symbol.ERROR, State.Error)
2833- .add(Symbol.EXPRESSION, 74)
2834- .add(Symbol.VARIABLE_SEQUENCE, State.VariableSeq)
2835- .add(Symbol.NUMBER, State.Start_Number)
2836- .add(Symbol.STRING, [SHIFT, State.Start_String])
2837- .add(Symbol.EQUALS, [SHIFT, State.Start_Equals])
2838- .add(Symbol.PLUS, [SHIFT, State.PrefixUnaryPlus])
2839- .add(Symbol.LEFT_PAREN, [SHIFT, State.LeftParen])
2840- .add(Symbol.MINUS, [SHIFT, State.PrefixUnaryMinus])
2841- .add(Symbol.FUNCTION, [SHIFT, State.Function])
2842- .add(Symbol.CELL, State.Cell)
2843- .add(Symbol.FIXEDCELL, [SHIFT, State.FixedCell])
2844- .add(Symbol.CELL_UPPER, [SHIFT, State.CellUpper])
2845- .add(Symbol.VARIABLE, [SHIFT, State.Variable])
2846- .add(Symbol.NUMBER_UPPER, [SHIFT, State.NumberUpper])
2847- .add(Symbol.FULL_ERROR, [SHIFT, State.Pound])
2848+ .add(Symbol.Error, State.Error)
2849+ .add(Symbol.Expression, 74)
2850+ .add(Symbol.VariableSeq, State.VariableSeq)
2851+ .add(Symbol.Number, State.Start_Number)
2852+ .add(Symbol.String, [SHIFT, State.Start_String])
2853+ .add(Symbol.Equals, [SHIFT, State.Start_Equals])
2854+ .add(Symbol.Plus, [SHIFT, State.PrefixUnaryPlus])
2855+ .add(Symbol.LeftParen, [SHIFT, State.LeftParen])
2856+ .add(Symbol.Minus, [SHIFT, State.PrefixUnaryMinus])
2857+ .add(Symbol.Function, [SHIFT, State.Function])
2858+ .add(Symbol.Cell, State.Cell)
2859+ .add(Symbol.FixedCell, [SHIFT, State.FixedCell])
2860+ .add(Symbol.CellUpper, [SHIFT, State.CellUpper])
2861+ .add(Symbol.Variable, [SHIFT, State.Variable])
2862+ .add(Symbol.NumberUpper, [SHIFT, State.Number])
2863+ .add(Symbol.FullError, [SHIFT, State.Pound])
2864 .build();
2865 table[State.Variable_Comma] = ObjectBuilder
2866- .add(Symbol.ERROR, State.Error)
2867- .add(Symbol.EXPRESSION, 75)
2868- .add(Symbol.VARIABLE_SEQUENCE, State.VariableSeq)
2869- .add(Symbol.NUMBER, State.Start_Number)
2870- .add(Symbol.STRING, [SHIFT, State.Start_String])
2871- .add(Symbol.EQUALS, [SHIFT, State.Start_Equals])
2872- .add(Symbol.PLUS, [SHIFT, State.PrefixUnaryPlus])
2873- .add(Symbol.LEFT_PAREN, [SHIFT, State.LeftParen])
2874- .add(Symbol.MINUS, [SHIFT, State.PrefixUnaryMinus])
2875- .add(Symbol.FUNCTION, [SHIFT, State.Function])
2876- .add(Symbol.CELL, State.Cell)
2877- .add(Symbol.FIXEDCELL, [SHIFT, State.FixedCell])
2878- .add(Symbol.CELL_UPPER, [SHIFT, State.CellUpper])
2879- .add(Symbol.VARIABLE, [SHIFT, State.Variable])
2880- .add(Symbol.NUMBER_UPPER, [SHIFT, State.NumberUpper])
2881- .add(Symbol.ARRAY, [SHIFT, 61])
2882- .add(Symbol.FULL_ERROR, [SHIFT, State.Pound])
2883- .build();
2884-table[73] = ObjectBuilder
2885- .add(Symbol.EOF, [REDUCE, ReduceActions.REDUCE_LAST_THREE_B])
2886- .add(Symbol.AMPERSAND, [REDUCE, ReduceActions.REDUCE_LAST_THREE_B])
2887- .add(Symbol.EQUALS, [REDUCE, ReduceActions.REDUCE_LAST_THREE_B])
2888- .add(Symbol.PLUS, [REDUCE, ReduceActions.REDUCE_LAST_THREE_B])
2889- .add(Symbol.RIGHT_PAREN, [REDUCE, ReduceActions.REDUCE_LAST_THREE_B])
2890- .add(Symbol.LESS_THAN, [REDUCE, ReduceActions.REDUCE_LAST_THREE_B])
2891- .add(Symbol.GREATER_THAN, [REDUCE, ReduceActions.REDUCE_LAST_THREE_B])
2892- .add(Symbol.MINUS, [REDUCE, ReduceActions.REDUCE_LAST_THREE_B])
2893- .add(Symbol.ASTERISK, [REDUCE, ReduceActions.REDUCE_LAST_THREE_B])
2894- .add(Symbol.DIVIDE, [REDUCE, ReduceActions.REDUCE_LAST_THREE_B])
2895- .add(Symbol.CARROT, [REDUCE, ReduceActions.REDUCE_LAST_THREE_B])
2896- .add(Symbol.SEMI_COLON, [REDUCE, ReduceActions.REDUCE_LAST_THREE_B])
2897- .add(Symbol.COMMA, [REDUCE, ReduceActions.REDUCE_LAST_THREE_B])
2898- .add(Symbol.VARIABLE, [REDUCE, ReduceActions.REDUCE_LAST_THREE_B])
2899- .add(Symbol.FULL_ERROR, [REDUCE, ReduceActions.REDUCE_LAST_THREE_B])
2900+ .add(Symbol.Error, State.Error)
2901+ .add(Symbol.Expression, 75)
2902+ .add(Symbol.VariableSeq, State.VariableSeq)
2903+ .add(Symbol.Number, State.Start_Number)
2904+ .add(Symbol.String, [SHIFT, State.Start_String])
2905+ .add(Symbol.Equals, [SHIFT, State.Start_Equals])
2906+ .add(Symbol.Plus, [SHIFT, State.PrefixUnaryPlus])
2907+ .add(Symbol.LeftParen, [SHIFT, State.LeftParen])
2908+ .add(Symbol.Minus, [SHIFT, State.PrefixUnaryMinus])
2909+ .add(Symbol.Function, [SHIFT, State.Function])
2910+ .add(Symbol.Cell, State.Cell)
2911+ .add(Symbol.FixedCell, [SHIFT, State.FixedCell])
2912+ .add(Symbol.CellUpper, [SHIFT, State.CellUpper])
2913+ .add(Symbol.Variable, [SHIFT, State.Variable])
2914+ .add(Symbol.NumberUpper, [SHIFT, State.Number])
2915+ .add(Symbol.Array, [SHIFT, 61])
2916+ .add(Symbol.FullError, [SHIFT, State.Pound])
2917+ .build();
2918+table[State.Variable_FullError_Variable_ExclamationPoint] = ObjectBuilder
2919+ .add(Symbol.EOF, [REDUCE, ReduceActions.ReduceLastThreeB])
2920+ .add(Symbol.Ampersand, [REDUCE, ReduceActions.ReduceLastThreeB])
2921+ .add(Symbol.Equals, [REDUCE, ReduceActions.ReduceLastThreeB])
2922+ .add(Symbol.Plus, [REDUCE, ReduceActions.ReduceLastThreeB])
2923+ .add(Symbol.RightParen, [REDUCE, ReduceActions.ReduceLastThreeB])
2924+ .add(Symbol.LessThan, [REDUCE, ReduceActions.ReduceLastThreeB])
2925+ .add(Symbol.GreaterThan, [REDUCE, ReduceActions.ReduceLastThreeB])
2926+ .add(Symbol.Minus, [REDUCE, ReduceActions.ReduceLastThreeB])
2927+ .add(Symbol.Asterisk, [REDUCE, ReduceActions.ReduceLastThreeB])
2928+ .add(Symbol.Divide, [REDUCE, ReduceActions.ReduceLastThreeB])
2929+ .add(Symbol.Carrot, [REDUCE, ReduceActions.ReduceLastThreeB])
2930+ .add(Symbol.Semicolon, [REDUCE, ReduceActions.ReduceLastThreeB])
2931+ .add(Symbol.Comma, [REDUCE, ReduceActions.ReduceLastThreeB])
2932+ .add(Symbol.Variable, [REDUCE, ReduceActions.ReduceLastThreeB])
2933+ .add(Symbol.FullError, [REDUCE, ReduceActions.ReduceLastThreeB])
2934 .build();
2935 table[74] = ObjectBuilder
2936- .add(Symbol.AMPERSAND, [SHIFT, State.Number_Ampersand])
2937- .add(Symbol.EQUALS, [SHIFT, State.Start_Equals])
2938- .add(Symbol.PLUS, [SHIFT, State.Number_Plus])
2939- .add(Symbol.RIGHT_PAREN, [REDUCE, ReduceActions.REDUCE_INT])
2940- .add(Symbol.LESS_THAN, [SHIFT, State.LessThan])
2941- .add(Symbol.GREATER_THAN, [SHIFT, State.GreaterThan])
2942- .add(Symbol.MINUS, [SHIFT, State.Number_Minus])
2943- .add(Symbol.ASTERISK, [SHIFT, State.Number_Asterisk])
2944- .add(Symbol.DIVIDE, [SHIFT, State.Number_Divide])
2945- .add(Symbol.CARROT, [SHIFT, State.Number_Carrot])
2946- .add(Symbol.SEMI_COLON, [REDUCE, ReduceActions.REDUCE_INT])
2947- .add(Symbol.COMMA, [REDUCE, ReduceActions.REDUCE_INT]).build();
2948+ .add(Symbol.Ampersand, [SHIFT, State.Expression_Ampersand])
2949+ .add(Symbol.Equals, [SHIFT, State.Start_Equals])
2950+ .add(Symbol.Plus, [SHIFT, State.Expression_Plus])
2951+ .add(Symbol.RightParen, [REDUCE, ReduceActions.ReduceInt])
2952+ .add(Symbol.LessThan, [SHIFT, State.LessThan])
2953+ .add(Symbol.GreaterThan, [SHIFT, State.GreaterThan])
2954+ .add(Symbol.Minus, [SHIFT, State.Expression_Minus])
2955+ .add(Symbol.Asterisk, [SHIFT, State.Expression_Asterisk])
2956+ .add(Symbol.Divide, [SHIFT, State.Expression_Divide])
2957+ .add(Symbol.Carrot, [SHIFT, State.Expression_Carrot])
2958+ .add(Symbol.Semicolon, [REDUCE, ReduceActions.ReduceInt])
2959+ .add(Symbol.Comma, [REDUCE, ReduceActions.ReduceInt]).build();
2960 table[75] = ObjectBuilder
2961- .add(Symbol.AMPERSAND, [SHIFT, State.Number_Ampersand])
2962- .add(Symbol.EQUALS, [SHIFT, State.Start_Equals])
2963- .add(Symbol.PLUS, [SHIFT, State.Number_Plus])
2964- .add(Symbol.RIGHT_PAREN, [REDUCE, ReduceActions.REDUCE_PERCENT])
2965- .add(Symbol.LESS_THAN, [SHIFT, State.LessThan])
2966- .add(Symbol.GREATER_THAN, [SHIFT, State.GreaterThan])
2967- .add(Symbol.MINUS, [SHIFT, State.Number_Minus])
2968- .add(Symbol.ASTERISK, [SHIFT, State.Number_Asterisk])
2969- .add(Symbol.DIVIDE, [SHIFT, State.Number_Divide])
2970- .add(Symbol.CARROT, [SHIFT, State.Number_Carrot])
2971- .add(Symbol.SEMI_COLON, [REDUCE, ReduceActions.REDUCE_PERCENT])
2972- .add(Symbol.COMMA, [REDUCE, ReduceActions.REDUCE_PERCENT]).build();
2973+ .add(Symbol.Ampersand, [SHIFT, State.Expression_Ampersand])
2974+ .add(Symbol.Equals, [SHIFT, State.Start_Equals])
2975+ .add(Symbol.Plus, [SHIFT, State.Expression_Plus])
2976+ .add(Symbol.RightParen, [REDUCE, ReduceActions.ReducePercent])
2977+ .add(Symbol.LessThan, [SHIFT, State.LessThan])
2978+ .add(Symbol.GreaterThan, [SHIFT, State.GreaterThan])
2979+ .add(Symbol.Minus, [SHIFT, State.Expression_Minus])
2980+ .add(Symbol.Asterisk, [SHIFT, State.Expression_Asterisk])
2981+ .add(Symbol.Divide, [SHIFT, State.Expression_Divide])
2982+ .add(Symbol.Carrot, [SHIFT, State.Expression_Carrot])
2983+ .add(Symbol.Semicolon, [REDUCE, ReduceActions.ReducePercent])
2984+ .add(Symbol.Comma, [REDUCE, ReduceActions.ReducePercent]).build();
2985 const ACTION_TABLE = table;
2986
2987
2988 export {
2989 ACTION_TABLE,
2990 RULES,
2991- Symbol,
2992- ReduceActions,
2993- ReductionPair,
2994 REDUCE,
2995 ACCEPT,
2996 SHIFT,
2997 SYMBOL_INDEX_TO_NAME,
2998 SYMBOL_NAME_TO_INDEX,
2999- PRODUCTIONS,
3000- RuleIndex
3001+ PRODUCTIONS
3002 }
3003\ No newline at end of file
3004diff --git a/src/Parser/ReduceActions.ts b/src/Parser/ReduceActions.ts
3005new file mode 100644
3006index 0000000..ebcbd97
3007--- /dev/null
3008+++ b/src/Parser/ReduceActions.ts
3009@@ -0,0 +1,47 @@
3010+const enum ReduceActions {
3011+ NoAction = 0,
3012+ ReturnLast = 1,
3013+ CallVariable = 2,
3014+ AsNumber = 5,
3015+ AsString = 6,
3016+ Ampersand = 7,
3017+ Equals = 8,
3018+ Plus = 9,
3019+ LastNumber = 10,
3020+ LTE = 11,
3021+ GTE = 12,
3022+ NotEqual = 13,
3023+ GT = 15,
3024+ LT = 16,
3025+ Minus = 17,
3026+ Multiply = 18,
3027+ Divide = 19,
3028+ ToPower = 20,
3029+ InvertNumber = 21,
3030+ ToNumberNANAsZero = 22,
3031+ CallFunctionLastBlank = 23,
3032+ CallFunctionLastTwoInStack = 24,
3033+ CellValueAsExpression = 25,
3034+ ErrorAndContinue = 26,
3035+ ErrorAndContinueWithOtherErrors = 27,
3036+ FixedCellValue = 28,
3037+ FixedCellRangeValue = 29,
3038+ CellValue = 30,
3039+ CellRangeValue = 31,
3040+ EnsureIsArray = 32,
3041+ EnsureYYTextIsArray = 33,
3042+ ReduceInt = 34,
3043+ ReducePercent = 35,
3044+ WrapCurrentTokenAsArray = 36,
3045+ EnsureLastTwoINArrayAndPush = 37,
3046+ ReflexiveReduce = 38,
3047+ ReduceFloat = 39,
3048+ ReducePrevAsPercent = 40,
3049+ ReduceLastThreeA = 41,
3050+ ReduceLastThreeB = 42,
3051+ AsError = 43
3052+}
3053+
3054+export {
3055+ ReduceActions
3056+}
3057\ No newline at end of file
3058diff --git a/src/Parser/ReductionPair.ts b/src/Parser/ReductionPair.ts
3059new file mode 100644
3060index 0000000..dab9920
3061--- /dev/null
3062+++ b/src/Parser/ReductionPair.ts
3063@@ -0,0 +1,31 @@
3064+/**
3065+ * Represents the length to reduce the stack by, and the replacement symbol that will replace those tokens in the stack.
3066+ */
3067+class ReductionPair {
3068+ private lengthToReduceStackBy : number;
3069+ private replacementSymbol : number;
3070+ constructor(replacementSymbol : number, length : number) {
3071+ this.lengthToReduceStackBy = length;
3072+ this.replacementSymbol = replacementSymbol;
3073+ }
3074+
3075+ /**
3076+ * Get the number representing the length to reduce the stack by.
3077+ * @returns {number}
3078+ */
3079+ getLengthToReduceStackBy() : number {
3080+ return this.lengthToReduceStackBy;
3081+ }
3082+
3083+ /**
3084+ * Get the replacement token index.
3085+ * @returns {number}
3086+ */
3087+ getReplacementSymbol() : number {
3088+ return this.replacementSymbol;
3089+ }
3090+}
3091+
3092+export {
3093+ ReductionPair
3094+}
3095\ No newline at end of file
3096diff --git a/src/Parser/RuleIndex.ts b/src/Parser/RuleIndex.ts
3097new file mode 100644
3098index 0000000..be0e390
3099--- /dev/null
3100+++ b/src/Parser/RuleIndex.ts
3101@@ -0,0 +1,40 @@
3102+const enum RuleIndex {
3103+ WhiteSpace = 0,
3104+ DoubleQuotes = 1,
3105+ SingleQuotes = 2,
3106+ FormulaName = 3,
3107+ $A1Cell = 6,
3108+ A1Cell = 7,
3109+ FormulaNameSimple = 8,
3110+ Variable = 9,
3111+ SimpleVariable = 10,
3112+ Integer = 11,
3113+ SelfContainedArray = 12,
3114+ DollarSign = 13,
3115+ Ampersand = 14,
3116+ SingleWhitespace = 15,
3117+ Period = 16,
3118+ Colon = 17,
3119+ Semicolon = 18,
3120+ Comma = 19,
3121+ Asterisk = 20,
3122+ ForwardSlash = 21,
3123+ Minus = 22,
3124+ Plus = 23,
3125+ Caret = 24,
3126+ OpenParen = 25,
3127+ CloseParen = 26,
3128+ GreaterThan = 27,
3129+ LessThanSign = 28,
3130+ OpenDoubleQuote = 30,
3131+ OpenSingleQuote = 31,
3132+ ExclamationPoint = 32,
3133+ Equals = 33,
3134+ Percent = 34,
3135+ FullError = 35,
3136+ EndOfString = 36
3137+}
3138+
3139+export {
3140+ RuleIndex
3141+}
3142\ No newline at end of file
3143diff --git a/src/Parser/Rules.ts b/src/Parser/Rules.ts
3144new file mode 100644
3145index 0000000..12f8be4
3146--- /dev/null
3147+++ b/src/Parser/Rules.ts
3148@@ -0,0 +1,81 @@
3149+import {
3150+ RuleIndex
3151+} from "./RuleIndex";
3152+
3153+// Rules represent the Regular Expressions that will be used in sequence to match a given input to the Parser.
3154+const WHITE_SPACE_RULE = /^(?:\s+)/;
3155+const DOUBLE_QUOTES_RULE = /^(?:"(\\["]|[^"])*")/;
3156+const SINGLE_QUOTES_RULE = /^(?:'(\\[']|[^'])*')/;
3157+const FORMULA_NAME_RULE = /^(?:[A-Za-z.]{1,}[A-Za-z_0-9]+(?=[(]))/;
3158+const $_A1_CELL_RULE = /^(?:\$[A-Za-z]+\$[0-9]+)/;
3159+const A1_CELL_RULE = /^(?:[A-Za-z]+[0-9]+)/;
3160+const FORMULA_NAME_SIMPLE_RULE = /^(?:[A-Za-z.]+(?=[(]))/;
3161+const VARIABLE_RULE = /^(?:[A-Za-z]{1,}[A-Za-z_0-9]+)/;
3162+const SIMPLE_VARIABLE_RILE = /^(?:[A-Za-z_]+)/;
3163+const INTEGER_RULE = /^(?:[0-9]+(?:(?:[eE])(?:[\+-])?[0-9]+)?)/;
3164+const OPEN_AND_CLOSE_OF_ARRAY_RULE = /^(?:\[([^\]]*)?\])/;
3165+const DOLLAR_SIGN_RULE = /^(?:\$)/;
3166+const AMPERSAND_SIGN_RULE = /^(?:&)/;
3167+const SINGLE_WHITESPACE_RULE = /^(?: )/;
3168+const PERIOD_RULE = /^(?:[.])/;
3169+const COLON_RULE = /^(?::)/;
3170+const SEMI_COLON_RULE = /^(?:;)/;
3171+const COMMA_RULE = /^(?:,)/;
3172+const ASTERISK_RULE = /^(?:\*)/;
3173+const FORWARD_SLASH_RULE = /^(?:\/)/;
3174+const MINUS_SIGN_RULE = /^(?:-)/;
3175+const PLUS_SIGN_RULE = /^(?:\+)/;
3176+const CARET_SIGN_RULE = /^(?:\^)/;
3177+const OPEN_PAREN_RULE = /^(?:\()/;
3178+const CLOSE_PAREN_RULE = /^(?:\))/;
3179+const GREATER_THAN_SIGN_RULE = /^(?:>)/;
3180+const LESS_THAN_SIGN_RULE = /^(?:<)/;
3181+const OPEN_DOUBLE_QUOTE = /^(?:")/;
3182+const OPEN_SINGLE_QUITE = /^(?:')/;
3183+const EXCLAMATION_POINT_RULE = /^(?:!)/;
3184+const EQUALS_SIGN_RULE = /^(?:=)/;
3185+const PERCENT_SIGN_RULE = /^(?:%)/;
3186+const FULL_ERROR_RULE = /^(?:#N\/A|#NUM\!|#NULL\!|#DIV\/0\!|#VALUE\!|#REF\!|#ERROR)/;
3187+const END_OF_STRING_RULE = /^(?:$)/;
3188+
3189+
3190+// Sequential rules to use when parsing a given input.
3191+let RULES = [];
3192+RULES[RuleIndex.WhiteSpace] = WHITE_SPACE_RULE;
3193+RULES[RuleIndex.DoubleQuotes] = DOUBLE_QUOTES_RULE;
3194+RULES[RuleIndex.SingleQuotes] = SINGLE_QUOTES_RULE;
3195+RULES[RuleIndex.FormulaName] = FORMULA_NAME_RULE;
3196+RULES[RuleIndex.$A1Cell] = $_A1_CELL_RULE;
3197+RULES[RuleIndex.A1Cell] = A1_CELL_RULE;
3198+RULES[RuleIndex.FormulaNameSimple] = FORMULA_NAME_SIMPLE_RULE;
3199+RULES[RuleIndex.Variable] = VARIABLE_RULE;
3200+RULES[RuleIndex.SimpleVariable] = SIMPLE_VARIABLE_RILE;
3201+RULES[RuleIndex.Integer] = INTEGER_RULE;
3202+RULES[RuleIndex.SelfContainedArray] = OPEN_AND_CLOSE_OF_ARRAY_RULE;
3203+RULES[RuleIndex.DollarSign] = DOLLAR_SIGN_RULE;
3204+RULES[RuleIndex.Ampersand] = AMPERSAND_SIGN_RULE;
3205+RULES[RuleIndex.SingleWhitespace] = SINGLE_WHITESPACE_RULE;
3206+RULES[RuleIndex.Period] = PERIOD_RULE;
3207+RULES[RuleIndex.Colon] = COLON_RULE;
3208+RULES[RuleIndex.Semicolon] = SEMI_COLON_RULE;
3209+RULES[RuleIndex.Comma] = COMMA_RULE;
3210+RULES[RuleIndex.Asterisk] = ASTERISK_RULE;
3211+RULES[RuleIndex.ForwardSlash] = FORWARD_SLASH_RULE;
3212+RULES[RuleIndex.Minus] = MINUS_SIGN_RULE;
3213+RULES[RuleIndex.Plus] = PLUS_SIGN_RULE;
3214+RULES[RuleIndex.Caret] = CARET_SIGN_RULE;
3215+RULES[RuleIndex.OpenParen] = OPEN_PAREN_RULE;
3216+RULES[RuleIndex.CloseParen] = CLOSE_PAREN_RULE;
3217+RULES[RuleIndex.GreaterThan] = GREATER_THAN_SIGN_RULE;
3218+RULES[RuleIndex.LessThanSign] = LESS_THAN_SIGN_RULE;
3219+RULES[RuleIndex.OpenDoubleQuote] = OPEN_DOUBLE_QUOTE;
3220+RULES[RuleIndex.OpenSingleQuote] = OPEN_SINGLE_QUITE;
3221+RULES[RuleIndex.ExclamationPoint] = EXCLAMATION_POINT_RULE;
3222+RULES[RuleIndex.Equals] = EQUALS_SIGN_RULE;
3223+RULES[RuleIndex.Percent] = PERCENT_SIGN_RULE;
3224+RULES[RuleIndex.FullError] = FULL_ERROR_RULE;
3225+RULES[RuleIndex.EndOfString] = END_OF_STRING_RULE;
3226+
3227+export {
3228+ RULES
3229+}
3230\ No newline at end of file
3231diff --git a/src/Parser/Symbols.ts b/src/Parser/Symbols.ts
3232new file mode 100644
3233index 0000000..758db41
3234--- /dev/null
3235+++ b/src/Parser/Symbols.ts
3236@@ -0,0 +1,42 @@
3237+enum Symbol {
3238+ Accept = 0,
3239+ End = 1,
3240+ Error = 2,
3241+ Expressions = 3,
3242+ Expression = 4,
3243+ EOF = 5,
3244+ VariableSeq = 6,
3245+ Number = 9,
3246+ String = 10,
3247+ Ampersand = 11,
3248+ Equals = 12,
3249+ Plus = 13,
3250+ LeftParen = 14,
3251+ RightParen = 15,
3252+ LessThan = 16,
3253+ GreaterThan = 17,
3254+ Minus = 19,
3255+ Asterisk = 20,
3256+ Divide = 21,
3257+ Carrot = 22,
3258+ Function = 23,
3259+ ExpressionSeq = 24,
3260+ Cell = 25,
3261+ FixedCell = 26,
3262+ Colon = 27,
3263+ CellUpper = 28,
3264+ Array = 29,
3265+ Semicolon = 30,
3266+ Comma = 31,
3267+ Variable = 32,
3268+ Decimal = 33,
3269+ NumberUpper = 34,
3270+ Percent = 35,
3271+ FullError = 36,
3272+ ExclamationPoint = 37,
3273+ ReflexiveReduce = 38
3274+}
3275+
3276+export {
3277+ Symbol
3278+}
3279\ No newline at end of file
3280diff --git a/tests/Formulas/MathTest.ts b/tests/Formulas/MathTest.ts
3281index e08f7b9..22b036f 100644
3282--- a/tests/Formulas/MathTest.ts
3283+++ b/tests/Formulas/MathTest.ts
3284@@ -1316,7 +1316,7 @@ test("MULTIPLY", function(){
3285 });
3286
3287
3288-test("MINUS", function(){
3289+test("Minus", function(){
3290 assertEquals(MINUS(2, 2), 0);
3291 assertEquals(MINUS(2, 10), -8);
3292 assertEquals(MINUS(2, "12"), -10);