surpass 0.0.9 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,7 +5,7 @@
5
5
  # Generated using ANTLR version: 3.2.1-SNAPSHOT Dec 18, 2009 04:29:28
6
6
  # Ruby runtime library version: 1.3.1
7
7
  # Input grammar file: ExcelFormula.g
8
- # Generated at: 2010-05-03 16:34:32
8
+ # Generated at: 2010-06-13 10:19:27
9
9
  #
10
10
 
11
11
  # ~~~> start load path setup
@@ -77,13 +77,13 @@ module ExcelFormula
77
77
 
78
78
  # define the token constants
79
79
  define_tokens(:GE => 8, :LT => 7, :NUM_CONST => 21, :PERCENT => 16,
80
- :REF2D => 22, :CONCAT => 10, :RP => 29, :LP => 26, :INT_CONST => 20,
80
+ :REF2D => 22, :CONCAT => 10, :RP => 25, :LP => 24, :INT_CONST => 20,
81
81
  :STR_CONST => 19, :POWER => 15, :SUB => 12, :FUNC_CHOOSE => 30,
82
- :SEMICOLON => 27, :BANG => 24, :TRUE_CONST => 17, :EOF => -1,
83
- :MUL => 13, :COLON => 23, :NAME => 31, :FALSE_CONST => 18,
84
- :COMMA => 28, :GT => 6, :DIGIT => 33, :EQ => 4, :DIV => 14,
85
- :FUNC_IF => 25, :QUOTENAME => 32, :LE => 9, :NE => 5,
86
- :ADD => 11)
82
+ :SEMICOLON => 28, :BANG => 26, :TRUE_CONST => 17, :EOF => -1,
83
+ :MUL => 13, :ALPHA => 34, :COLON => 23, :NAME => 31, :FALSE_CONST => 18,
84
+ :WS => 35, :COMMA => 29, :GT => 6, :DIGIT => 33, :EQ => 4,
85
+ :DIV => 14, :FUNC_IF => 27, :QUOTENAME => 32, :LE => 9,
86
+ :NE => 5, :ADD => 11)
87
87
 
88
88
  # register the proper human-readable name or literal value
89
89
  # for each token type
@@ -94,8 +94,9 @@ module ExcelFormula
94
94
  register_names("EQ", "NE", "GT", "LT", "GE", "LE", "CONCAT", "ADD",
95
95
  "SUB", "MUL", "DIV", "POWER", "PERCENT", "TRUE_CONST",
96
96
  "FALSE_CONST", "STR_CONST", "INT_CONST", "NUM_CONST",
97
- "REF2D", "COLON", "BANG", "FUNC_IF", "LP", "SEMICOLON",
98
- "COMMA", "RP", "FUNC_CHOOSE", "NAME", "QUOTENAME", "DIGIT")
97
+ "REF2D", "COLON", "LP", "RP", "BANG", "FUNC_IF", "SEMICOLON",
98
+ "COMMA", "FUNC_CHOOSE", "NAME", "QUOTENAME", "DIGIT",
99
+ "ALPHA", "WS")
99
100
 
100
101
  end
101
102
 
@@ -142,7 +143,7 @@ module ExcelFormula
142
143
 
143
144
  begin
144
145
  # at line 25:7: expr[\"V\"]
145
- @state.following.push(TOKENS_FOLLOWING_expr_IN_formula_60)
146
+ @state.following.push(TOKENS_FOLLOWING_expr_IN_formula_56)
146
147
  expr("V")
147
148
  @state.following.pop
148
149
 
@@ -170,7 +171,7 @@ module ExcelFormula
170
171
 
171
172
  begin
172
173
  # at line 29:7: prec0_expr[arg_type] ( ( EQ | NE | GT | LT | GE | LE ) prec0_expr[arg_type] )*
173
- @state.following.push(TOKENS_FOLLOWING_prec0_expr_IN_expr_79)
174
+ @state.following.push(TOKENS_FOLLOWING_prec0_expr_IN_expr_75)
174
175
  prec0_expr(arg_type)
175
176
  @state.following.pop
176
177
  # at line 30:9: ( ( EQ | NE | GT | LT | GE | LE ) prec0_expr[arg_type] )*
@@ -196,48 +197,48 @@ module ExcelFormula
196
197
  case alt_1
197
198
  when 1
198
199
  # at line 32:19: EQ
199
- match(EQ, TOKENS_FOLLOWING_EQ_IN_expr_124)
200
+ match(EQ, TOKENS_FOLLOWING_EQ_IN_expr_120)
200
201
  # --> action
201
202
  op = [PTGEQ].pack('C')
202
203
  # <-- action
203
204
 
204
205
  when 2
205
206
  # at line 33:19: NE
206
- match(NE, TOKENS_FOLLOWING_NE_IN_expr_146)
207
+ match(NE, TOKENS_FOLLOWING_NE_IN_expr_142)
207
208
  # --> action
208
209
  op = [PTGNE].pack('C')
209
210
  # <-- action
210
211
 
211
212
  when 3
212
213
  # at line 34:19: GT
213
- match(GT, TOKENS_FOLLOWING_GT_IN_expr_168)
214
+ match(GT, TOKENS_FOLLOWING_GT_IN_expr_164)
214
215
  # --> action
215
216
  op = [PTGGT].pack('C')
216
217
  # <-- action
217
218
 
218
219
  when 4
219
220
  # at line 35:19: LT
220
- match(LT, TOKENS_FOLLOWING_LT_IN_expr_190)
221
+ match(LT, TOKENS_FOLLOWING_LT_IN_expr_186)
221
222
  # --> action
222
223
  op = [PTGLT].pack('C')
223
224
  # <-- action
224
225
 
225
226
  when 5
226
227
  # at line 36:19: GE
227
- match(GE, TOKENS_FOLLOWING_GE_IN_expr_212)
228
+ match(GE, TOKENS_FOLLOWING_GE_IN_expr_208)
228
229
  # --> action
229
230
  op = [PTGGE].pack('C')
230
231
  # <-- action
231
232
 
232
233
  when 6
233
234
  # at line 37:19: LE
234
- match(LE, TOKENS_FOLLOWING_LE_IN_expr_234)
235
+ match(LE, TOKENS_FOLLOWING_LE_IN_expr_230)
235
236
  # --> action
236
237
  op = [PTGLE].pack('C')
237
238
  # <-- action
238
239
 
239
240
  end
240
- @state.following.push(TOKENS_FOLLOWING_prec0_expr_IN_expr_265)
241
+ @state.following.push(TOKENS_FOLLOWING_prec0_expr_IN_expr_261)
241
242
  prec0_expr(arg_type)
242
243
  @state.following.pop
243
244
  # --> action
@@ -273,7 +274,7 @@ module ExcelFormula
273
274
 
274
275
  begin
275
276
  # at line 45:7: prec1_expr[arg_type] ( ( CONCAT ) prec1_expr[arg_type] )*
276
- @state.following.push(TOKENS_FOLLOWING_prec1_expr_IN_prec0_expr_297)
277
+ @state.following.push(TOKENS_FOLLOWING_prec1_expr_IN_prec0_expr_293)
277
278
  prec1_expr(arg_type)
278
279
  @state.following.pop
279
280
  # at line 46:9: ( ( CONCAT ) prec1_expr[arg_type] )*
@@ -285,12 +286,12 @@ module ExcelFormula
285
286
  # at line 47:13: ( CONCAT ) prec1_expr[arg_type]
286
287
  # at line 47:13: ( CONCAT )
287
288
  # at line 48:17: CONCAT
288
- match(CONCAT, TOKENS_FOLLOWING_CONCAT_IN_prec0_expr_340)
289
+ match(CONCAT, TOKENS_FOLLOWING_CONCAT_IN_prec0_expr_336)
289
290
  # --> action
290
291
  op = [PTGCONCAT].pack('C')
291
292
  # <-- action
292
293
 
293
- @state.following.push(TOKENS_FOLLOWING_prec1_expr_IN_prec0_expr_370)
294
+ @state.following.push(TOKENS_FOLLOWING_prec1_expr_IN_prec0_expr_366)
294
295
  prec1_expr(arg_type)
295
296
  @state.following.pop
296
297
  # --> action
@@ -326,7 +327,7 @@ module ExcelFormula
326
327
 
327
328
  begin
328
329
  # at line 55:7: prec2_expr[arg_type] ( ( ADD | SUB ) prec2_expr[arg_type] )*
329
- @state.following.push(TOKENS_FOLLOWING_prec2_expr_IN_prec1_expr_402)
330
+ @state.following.push(TOKENS_FOLLOWING_prec2_expr_IN_prec1_expr_398)
330
331
  prec2_expr(arg_type)
331
332
  @state.following.pop
332
333
  # at line 56:9: ( ( ADD | SUB ) prec2_expr[arg_type] )*
@@ -351,20 +352,20 @@ module ExcelFormula
351
352
  case alt_4
352
353
  when 1
353
354
  # at line 58:19: ADD
354
- match(ADD, TOKENS_FOLLOWING_ADD_IN_prec1_expr_447)
355
+ match(ADD, TOKENS_FOLLOWING_ADD_IN_prec1_expr_443)
355
356
  # --> action
356
357
  op = [PTGADD].pack('C')
357
358
  # <-- action
358
359
 
359
360
  when 2
360
361
  # at line 59:19: SUB
361
- match(SUB, TOKENS_FOLLOWING_SUB_IN_prec1_expr_469)
362
+ match(SUB, TOKENS_FOLLOWING_SUB_IN_prec1_expr_465)
362
363
  # --> action
363
364
  op = [PTGSUB].pack('C')
364
365
  # <-- action
365
366
 
366
367
  end
367
- @state.following.push(TOKENS_FOLLOWING_prec2_expr_IN_prec1_expr_499)
368
+ @state.following.push(TOKENS_FOLLOWING_prec2_expr_IN_prec1_expr_495)
368
369
  prec2_expr(arg_type)
369
370
  @state.following.pop
370
371
  # --> action
@@ -400,7 +401,7 @@ module ExcelFormula
400
401
 
401
402
  begin
402
403
  # at line 67:7: prec3_expr[arg_type] ( ( MUL | DIV ) prec3_expr[arg_type] )*
403
- @state.following.push(TOKENS_FOLLOWING_prec3_expr_IN_prec2_expr_532)
404
+ @state.following.push(TOKENS_FOLLOWING_prec3_expr_IN_prec2_expr_528)
404
405
  prec3_expr(arg_type)
405
406
  @state.following.pop
406
407
  # at line 68:9: ( ( MUL | DIV ) prec3_expr[arg_type] )*
@@ -425,20 +426,20 @@ module ExcelFormula
425
426
  case alt_6
426
427
  when 1
427
428
  # at line 70:19: MUL
428
- match(MUL, TOKENS_FOLLOWING_MUL_IN_prec2_expr_577)
429
+ match(MUL, TOKENS_FOLLOWING_MUL_IN_prec2_expr_573)
429
430
  # --> action
430
431
  op = [PTGMUL].pack('C')
431
432
  # <-- action
432
433
 
433
434
  when 2
434
435
  # at line 71:19: DIV
435
- match(DIV, TOKENS_FOLLOWING_DIV_IN_prec2_expr_599)
436
+ match(DIV, TOKENS_FOLLOWING_DIV_IN_prec2_expr_595)
436
437
  # --> action
437
438
  op = [PTGDIV].pack('C')
438
439
  # <-- action
439
440
 
440
441
  end
441
- @state.following.push(TOKENS_FOLLOWING_prec3_expr_IN_prec2_expr_629)
442
+ @state.following.push(TOKENS_FOLLOWING_prec3_expr_IN_prec2_expr_625)
442
443
  prec3_expr(arg_type)
443
444
  @state.following.pop
444
445
  # --> action
@@ -467,32 +468,32 @@ module ExcelFormula
467
468
  # parser rule prec3_expr
468
469
  #
469
470
  # (in ExcelFormula.g)
470
- # 77:1: prec3_expr[arg_type] : prec5_expr[arg_type] ( ( POWER ) prec5_expr[arg_type] )* ;
471
+ # 77:1: prec3_expr[arg_type] : prec4_expr[arg_type] ( ( POWER ) prec4_expr[arg_type] )* ;
471
472
  def prec3_expr(arg_type)
472
473
  # -> uncomment the next line to manually enable rule tracing
473
474
  # trace_in(__method__, 6)
474
475
 
475
476
  begin
476
- # at line 78:7: prec5_expr[arg_type] ( ( POWER ) prec5_expr[arg_type] )*
477
- @state.following.push(TOKENS_FOLLOWING_prec5_expr_IN_prec3_expr_661)
478
- prec5_expr(arg_type)
477
+ # at line 78:7: prec4_expr[arg_type] ( ( POWER ) prec4_expr[arg_type] )*
478
+ @state.following.push(TOKENS_FOLLOWING_prec4_expr_IN_prec3_expr_657)
479
+ prec4_expr(arg_type)
479
480
  @state.following.pop
480
- # at line 79:9: ( ( POWER ) prec5_expr[arg_type] )*
481
+ # at line 79:9: ( ( POWER ) prec4_expr[arg_type] )*
481
482
  loop do # decision 8
482
483
  alt_8 = 2
483
484
  alt_8 = @dfa8.predict(@input)
484
485
  case alt_8
485
486
  when 1
486
- # at line 80:13: ( POWER ) prec5_expr[arg_type]
487
+ # at line 80:13: ( POWER ) prec4_expr[arg_type]
487
488
  # at line 80:13: ( POWER )
488
489
  # at line 81:17: POWER
489
- match(POWER, TOKENS_FOLLOWING_POWER_IN_prec3_expr_704)
490
+ match(POWER, TOKENS_FOLLOWING_POWER_IN_prec3_expr_700)
490
491
  # --> action
491
492
  op = [PTGPOWER].pack('C')
492
493
  # <-- action
493
494
 
494
- @state.following.push(TOKENS_FOLLOWING_prec5_expr_IN_prec3_expr_734)
495
- prec5_expr(arg_type)
495
+ @state.following.push(TOKENS_FOLLOWING_prec4_expr_IN_prec3_expr_730)
496
+ prec4_expr(arg_type)
496
497
  @state.following.pop
497
498
  # --> action
498
499
  @rpn += op
@@ -527,20 +528,16 @@ module ExcelFormula
527
528
 
528
529
  begin
529
530
  # at line 88:7: prec5_expr[arg_type] ( PERCENT )?
530
- @state.following.push(TOKENS_FOLLOWING_prec5_expr_IN_prec4_expr_766)
531
+ @state.following.push(TOKENS_FOLLOWING_prec5_expr_IN_prec4_expr_762)
531
532
  prec5_expr(arg_type)
532
533
  @state.following.pop
533
534
  # at line 89:9: ( PERCENT )?
534
535
  alt_9 = 2
535
- look_9_0 = @input.peek(1)
536
-
537
- if (look_9_0 == PERCENT)
538
- alt_9 = 1
539
- end
536
+ alt_9 = @dfa9.predict(@input)
540
537
  case alt_9
541
538
  when 1
542
539
  # at line 90:13: PERCENT
543
- match(PERCENT, TOKENS_FOLLOWING_PERCENT_IN_prec4_expr_791)
540
+ match(PERCENT, TOKENS_FOLLOWING_PERCENT_IN_prec4_expr_787)
544
541
  # --> action
545
542
  @rpn += [PTGPERCENT].pack('C')
546
543
  # <-- action
@@ -576,14 +573,14 @@ module ExcelFormula
576
573
  case alt_10
577
574
  when 1
578
575
  # at line 95:7: primary[arg_type]
579
- @state.following.push(TOKENS_FOLLOWING_primary_IN_prec5_expr_822)
576
+ @state.following.push(TOKENS_FOLLOWING_primary_IN_prec5_expr_818)
580
577
  primary(arg_type)
581
578
  @state.following.pop
582
579
 
583
580
  when 2
584
581
  # at line 96:7: SUB primary[arg_type]
585
- match(SUB, TOKENS_FOLLOWING_SUB_IN_prec5_expr_831)
586
- @state.following.push(TOKENS_FOLLOWING_primary_IN_prec5_expr_833)
582
+ match(SUB, TOKENS_FOLLOWING_SUB_IN_prec5_expr_827)
583
+ @state.following.push(TOKENS_FOLLOWING_primary_IN_prec5_expr_829)
587
584
  primary(arg_type)
588
585
  @state.following.pop
589
586
  # --> action
@@ -608,7 +605,7 @@ module ExcelFormula
608
605
  # parser rule primary
609
606
  #
610
607
  # (in ExcelFormula.g)
611
- # 99:1: primary[arg_type] : ( TRUE_CONST | FALSE_CONST | str_tok= STR_CONST | int_tok= INT_CONST | num_tok= NUM_CONST | ref2d_tok= REF2D | ref2d1_tok= REF2D COLON ref2d2_tok= REF2D | sheet1= sheet ( COLON sheet2= sheet )? BANG ref3d_ref2d= REF2D ( COLON ref3d_ref2d2= REF2D )? | FUNC_IF LP expr[\"V\"] ( SEMICOLON | COMMA ) expr[arg_type] ( SEMICOLON | COMMA ) expr[arg_type] RP | FUNC_CHOOSE LP expr[\"V\"] ( ( SEMICOLON | COMMA ) ( expr[arg_type] | ) )* RP | name_tok= NAME | func_tok= NAME LP arg_count= expr_list[arg_type_list, min_argc, max_argc] RP | LP expr[arg_type] RP );
608
+ # 99:1: primary[arg_type] : ( TRUE_CONST | FALSE_CONST | str_tok= STR_CONST | int_tok= INT_CONST | num_tok= NUM_CONST | ref2d_tok= REF2D | ref2d1_tok= REF2D COLON ref2d2_tok= REF2D | LP expr[arg_type] RP | sheet1= sheet ( COLON sheet2= sheet )? BANG ref3d_ref2d= REF2D ( COLON ref3d_ref2d2= REF2D )? | FUNC_IF LP expr[\"V\"] ( SEMICOLON | COMMA ) expr[arg_type] ( SEMICOLON | COMMA ) expr[arg_type] RP | FUNC_CHOOSE LP expr[\"V\"] ( ( SEMICOLON | COMMA ) ( expr[arg_type] | ) )* RP | name_tok= NAME | func_tok= NAME LP arg_count= expr_list[arg_type_list, min_argc, max_argc] RP );
612
609
  def primary(arg_type)
613
610
  # -> uncomment the next line to manually enable rule tracing
614
611
  # trace_in(__method__, 9)
@@ -627,13 +624,13 @@ module ExcelFormula
627
624
  arg_count = nil
628
625
 
629
626
  begin
630
- # at line 100:5: ( TRUE_CONST | FALSE_CONST | str_tok= STR_CONST | int_tok= INT_CONST | num_tok= NUM_CONST | ref2d_tok= REF2D | ref2d1_tok= REF2D COLON ref2d2_tok= REF2D | sheet1= sheet ( COLON sheet2= sheet )? BANG ref3d_ref2d= REF2D ( COLON ref3d_ref2d2= REF2D )? | FUNC_IF LP expr[\"V\"] ( SEMICOLON | COMMA ) expr[arg_type] ( SEMICOLON | COMMA ) expr[arg_type] RP | FUNC_CHOOSE LP expr[\"V\"] ( ( SEMICOLON | COMMA ) ( expr[arg_type] | ) )* RP | name_tok= NAME | func_tok= NAME LP arg_count= expr_list[arg_type_list, min_argc, max_argc] RP | LP expr[arg_type] RP )
627
+ # at line 100:5: ( TRUE_CONST | FALSE_CONST | str_tok= STR_CONST | int_tok= INT_CONST | num_tok= NUM_CONST | ref2d_tok= REF2D | ref2d1_tok= REF2D COLON ref2d2_tok= REF2D | LP expr[arg_type] RP | sheet1= sheet ( COLON sheet2= sheet )? BANG ref3d_ref2d= REF2D ( COLON ref3d_ref2d2= REF2D )? | FUNC_IF LP expr[\"V\"] ( SEMICOLON | COMMA ) expr[arg_type] ( SEMICOLON | COMMA ) expr[arg_type] RP | FUNC_CHOOSE LP expr[\"V\"] ( ( SEMICOLON | COMMA ) ( expr[arg_type] | ) )* RP | name_tok= NAME | func_tok= NAME LP arg_count= expr_list[arg_type_list, min_argc, max_argc] RP )
631
628
  alt_15 = 13
632
629
  alt_15 = @dfa15.predict(@input)
633
630
  case alt_15
634
631
  when 1
635
632
  # at line 100:7: TRUE_CONST
636
- match(TRUE_CONST, TOKENS_FOLLOWING_TRUE_CONST_IN_primary_854)
633
+ match(TRUE_CONST, TOKENS_FOLLOWING_TRUE_CONST_IN_primary_850)
637
634
  # --> action
638
635
 
639
636
  @rpn += [PTGBOOL, 1].pack("C2")
@@ -642,7 +639,7 @@ module ExcelFormula
642
639
 
643
640
  when 2
644
641
  # at line 104:7: FALSE_CONST
645
- match(FALSE_CONST, TOKENS_FOLLOWING_FALSE_CONST_IN_primary_872)
642
+ match(FALSE_CONST, TOKENS_FOLLOWING_FALSE_CONST_IN_primary_868)
646
643
  # --> action
647
644
 
648
645
  @rpn += [PTGBOOL, 0].pack("C2")
@@ -651,7 +648,7 @@ module ExcelFormula
651
648
 
652
649
  when 3
653
650
  # at line 108:7: str_tok= STR_CONST
654
- str_tok = match(STR_CONST, TOKENS_FOLLOWING_STR_CONST_IN_primary_894)
651
+ str_tok = match(STR_CONST, TOKENS_FOLLOWING_STR_CONST_IN_primary_890)
655
652
  # --> action
656
653
 
657
654
  s = str_tok.text.gsub("\"", "")
@@ -661,7 +658,7 @@ module ExcelFormula
661
658
 
662
659
  when 4
663
660
  # at line 113:7: int_tok= INT_CONST
664
- int_tok = match(INT_CONST, TOKENS_FOLLOWING_INT_CONST_IN_primary_916)
661
+ int_tok = match(INT_CONST, TOKENS_FOLLOWING_INT_CONST_IN_primary_912)
665
662
  # --> action
666
663
 
667
664
  int_value = int_tok.text.to_i
@@ -675,7 +672,7 @@ module ExcelFormula
675
672
 
676
673
  when 5
677
674
  # at line 122:7: num_tok= NUM_CONST
678
- num_tok = match(NUM_CONST, TOKENS_FOLLOWING_NUM_CONST_IN_primary_934)
675
+ num_tok = match(NUM_CONST, TOKENS_FOLLOWING_NUM_CONST_IN_primary_930)
679
676
  # --> action
680
677
 
681
678
  @rpn += [PTGNUM, num_tok.text.to_f].pack("CE")
@@ -684,32 +681,45 @@ module ExcelFormula
684
681
 
685
682
  when 6
686
683
  # at line 126:7: ref2d_tok= REF2D
687
- ref2d_tok = match(REF2D, TOKENS_FOLLOWING_REF2D_IN_primary_956)
684
+ ref2d_tok = match(REF2D, TOKENS_FOLLOWING_REF2D_IN_primary_952)
688
685
  # --> action
689
686
 
690
687
  r, c = Utilities.cell_to_packed_rowcol(ref2d_tok.text)
691
- ptg = PTGREFR + RVA_DELTA[arg_type]
688
+ ptg = PTGREFR + RVA_DELTA_REF[arg_type]
692
689
  @rpn += [ptg, r, c].pack("Cv2")
693
690
 
694
691
  # <-- action
695
692
 
696
693
  when 7
697
694
  # at line 132:7: ref2d1_tok= REF2D COLON ref2d2_tok= REF2D
698
- ref2d1_tok = match(REF2D, TOKENS_FOLLOWING_REF2D_IN_primary_978)
699
- match(COLON, TOKENS_FOLLOWING_COLON_IN_primary_980)
700
- ref2d2_tok = match(REF2D, TOKENS_FOLLOWING_REF2D_IN_primary_986)
695
+ ref2d1_tok = match(REF2D, TOKENS_FOLLOWING_REF2D_IN_primary_974)
696
+ match(COLON, TOKENS_FOLLOWING_COLON_IN_primary_976)
697
+ ref2d2_tok = match(REF2D, TOKENS_FOLLOWING_REF2D_IN_primary_982)
701
698
  # --> action
702
699
 
703
700
  r1, c1 = Utilities.cell_to_packed_rowcol(ref2d1_tok.text)
704
701
  r2, c2 = Utilities.cell_to_packed_rowcol(ref2d2_tok.text)
705
- ptg = PTGAREAR + RVA_DELTA[arg_type]
702
+ ptg = PTGAREAR + RVA_DELTA_AREA[arg_type]
706
703
  @rpn += [ptg, r1, r2, c1, c2].pack("Cv4")
707
704
 
708
705
  # <-- action
709
706
 
710
707
  when 8
711
- # at line 140:7: sheet1= sheet ( COLON sheet2= sheet )? BANG ref3d_ref2d= REF2D ( COLON ref3d_ref2d2= REF2D )?
712
- @state.following.push(TOKENS_FOLLOWING_sheet_IN_primary_1010)
708
+ # at line 139:7: LP expr[arg_type] RP
709
+ match(LP, TOKENS_FOLLOWING_LP_IN_primary_1000)
710
+ @state.following.push(TOKENS_FOLLOWING_expr_IN_primary_1002)
711
+ expr(arg_type)
712
+ @state.following.pop
713
+ match(RP, TOKENS_FOLLOWING_RP_IN_primary_1005)
714
+ # --> action
715
+
716
+ @rpn += [PTGPAREN].pack('C')
717
+
718
+ # <-- action
719
+
720
+ when 9
721
+ # at line 143:7: sheet1= sheet ( COLON sheet2= sheet )? BANG ref3d_ref2d= REF2D ( COLON ref3d_ref2d2= REF2D )?
722
+ @state.following.push(TOKENS_FOLLOWING_sheet_IN_primary_1028)
713
723
  sheet1 = sheet
714
724
  @state.following.pop
715
725
  # --> action
@@ -717,7 +727,7 @@ module ExcelFormula
717
727
  sheet2 = sheet1
718
728
 
719
729
  # <-- action
720
- # at line 144:9: ( COLON sheet2= sheet )?
730
+ # at line 147:9: ( COLON sheet2= sheet )?
721
731
  alt_11 = 2
722
732
  look_11_0 = @input.peek(1)
723
733
 
@@ -726,34 +736,33 @@ module ExcelFormula
726
736
  end
727
737
  case alt_11
728
738
  when 1
729
- # at line 144:11: COLON sheet2= sheet
730
- match(COLON, TOKENS_FOLLOWING_COLON_IN_primary_1032)
731
- @state.following.push(TOKENS_FOLLOWING_sheet_IN_primary_1038)
739
+ # at line 147:11: COLON sheet2= sheet
740
+ match(COLON, TOKENS_FOLLOWING_COLON_IN_primary_1050)
741
+ @state.following.push(TOKENS_FOLLOWING_sheet_IN_primary_1056)
732
742
  sheet2 = sheet
733
743
  @state.following.pop
734
744
 
735
745
  end
736
- match(BANG, TOKENS_FOLLOWING_BANG_IN_primary_1043)
737
- ref3d_ref2d = match(REF2D, TOKENS_FOLLOWING_REF2D_IN_primary_1047)
746
+ match(BANG, TOKENS_FOLLOWING_BANG_IN_primary_1061)
747
+ ref3d_ref2d = match(REF2D, TOKENS_FOLLOWING_REF2D_IN_primary_1065)
738
748
  # --> action
739
749
 
740
- ptg = PTGREF3DR + RVA_DELTA[arg_type]
741
- rpn_ref2d = ""
750
+ ptg = PTGREF3DR + RVA_DELTA_REF[arg_type]
742
751
  r1, c1 = Utilities.cell_to_packed_rowcol(ref3d_ref2d.text)
743
752
  rpn_ref2d = [0x0000, r1, c1].pack("v3")
744
753
 
745
754
  # <-- action
746
- # at line 151:9: ( COLON ref3d_ref2d2= REF2D )?
755
+ # at line 153:9: ( COLON ref3d_ref2d2= REF2D )?
747
756
  alt_12 = 2
748
757
  alt_12 = @dfa12.predict(@input)
749
758
  case alt_12
750
759
  when 1
751
- # at line 151:11: COLON ref3d_ref2d2= REF2D
752
- match(COLON, TOKENS_FOLLOWING_COLON_IN_primary_1069)
753
- ref3d_ref2d2 = match(REF2D, TOKENS_FOLLOWING_REF2D_IN_primary_1074)
760
+ # at line 153:11: COLON ref3d_ref2d2= REF2D
761
+ match(COLON, TOKENS_FOLLOWING_COLON_IN_primary_1087)
762
+ ref3d_ref2d2 = match(REF2D, TOKENS_FOLLOWING_REF2D_IN_primary_1092)
754
763
  # --> action
755
764
 
756
- ptg = PTGAREA3DR + RVA_DELTA[arg_type]
765
+ ptg = PTGAREA3DR + RVA_DELTA_AREA[arg_type]
757
766
  r2, c2 = Utilities.cell_to_packed_rowcol(ref3d_ref2d2.text)
758
767
  rpn_ref2d = [0x0000, r1, r2, c1, c2].pack("v5")
759
768
 
@@ -768,11 +777,11 @@ module ExcelFormula
768
777
 
769
778
  # <-- action
770
779
 
771
- when 9
772
- # at line 163:7: FUNC_IF LP expr[\"V\"] ( SEMICOLON | COMMA ) expr[arg_type] ( SEMICOLON | COMMA ) expr[arg_type] RP
773
- match(FUNC_IF, TOKENS_FOLLOWING_FUNC_IF_IN_primary_1117)
774
- match(LP, TOKENS_FOLLOWING_LP_IN_primary_1127)
775
- @state.following.push(TOKENS_FOLLOWING_expr_IN_primary_1129)
780
+ when 10
781
+ # at line 165:7: FUNC_IF LP expr[\"V\"] ( SEMICOLON | COMMA ) expr[arg_type] ( SEMICOLON | COMMA ) expr[arg_type] RP
782
+ match(FUNC_IF, TOKENS_FOLLOWING_FUNC_IF_IN_primary_1135)
783
+ match(LP, TOKENS_FOLLOWING_LP_IN_primary_1145)
784
+ @state.following.push(TOKENS_FOLLOWING_expr_IN_primary_1147)
776
785
  expr("V")
777
786
  @state.following.pop
778
787
  if @input.peek(1).between?(SEMICOLON, COMMA)
@@ -790,7 +799,7 @@ module ExcelFormula
790
799
  pos0 = @rpn.size - 2
791
800
 
792
801
  # <-- action
793
- @state.following.push(TOKENS_FOLLOWING_expr_IN_primary_1158)
802
+ @state.following.push(TOKENS_FOLLOWING_expr_IN_primary_1176)
794
803
  expr(arg_type)
795
804
  @state.following.pop
796
805
  if @input.peek(1).between?(SEMICOLON, COMMA)
@@ -805,44 +814,42 @@ module ExcelFormula
805
814
  # --> action
806
815
 
807
816
  @rpn += [PTGATTR, 0x08, 0].pack("C2v") # tAttrSkip
808
- pos1 = @rpn.length - 2
817
+ pos1 = @rpn.size - 2
809
818
 
810
- rem = @rpn.length - (pos0 + 2)
811
- @rpn = @rpn[0..pos0] + [pos1-pos0].pack("v") + @rpn[pos0+2, rem] # TODO Check for OBO
819
+ @rpn = @rpn[0...pos0] + [pos1-pos0].pack("v") + @rpn[(pos0+2)...(@rpn.size)]
812
820
 
813
821
  # <-- action
814
- @state.following.push(TOKENS_FOLLOWING_expr_IN_primary_1187)
822
+ @state.following.push(TOKENS_FOLLOWING_expr_IN_primary_1205)
815
823
  expr(arg_type)
816
824
  @state.following.pop
817
- match(RP, TOKENS_FOLLOWING_RP_IN_primary_1190)
825
+ match(RP, TOKENS_FOLLOWING_RP_IN_primary_1208)
818
826
  # --> action
819
827
 
820
828
  @rpn += [PTGATTR, 0x08, 3].pack("C2v") # tAttrSkip
821
829
  @rpn += [PTGFUNCVARR, 3, 1].pack("C2v") # 3 = nargs, 1 = IF func
822
- pos2 = @rpn.length
830
+ pos2 = @rpn.size
823
831
 
824
- rem = @rpn.length - (pos1 + 2)
825
- @rpn = @rpn[0..pos1] + [pos2-(pos1+2)-1].pack("v") + @rpn[pos1+2, rem] # TODO Check for OBO
832
+ @rpn = @rpn[0...pos1] + [pos2-(pos1+2)-1].pack("v") + @rpn[(pos1+2)...(@rpn.size)]
826
833
 
827
834
  # <-- action
828
835
 
829
- when 10
836
+ when 11
830
837
  # at line 186:7: FUNC_CHOOSE LP expr[\"V\"] ( ( SEMICOLON | COMMA ) ( expr[arg_type] | ) )* RP
831
- match(FUNC_CHOOSE, TOKENS_FOLLOWING_FUNC_CHOOSE_IN_primary_1208)
838
+ match(FUNC_CHOOSE, TOKENS_FOLLOWING_FUNC_CHOOSE_IN_primary_1226)
832
839
  # --> action
833
840
 
834
841
  arg_type = "R"
835
842
  rpn_chunks = []
836
843
 
837
844
  # <-- action
838
- match(LP, TOKENS_FOLLOWING_LP_IN_primary_1228)
839
- @state.following.push(TOKENS_FOLLOWING_expr_IN_primary_1230)
845
+ match(LP, TOKENS_FOLLOWING_LP_IN_primary_1246)
846
+ @state.following.push(TOKENS_FOLLOWING_expr_IN_primary_1248)
840
847
  expr("V")
841
848
  @state.following.pop
842
849
  # --> action
843
850
 
844
- rpn_start = @rpn.length
845
- ref_markers = [@sheet_references.length]
851
+ rpn_start = @rpn.size
852
+ ref_markers = [@sheet_references.size]
846
853
 
847
854
  # <-- action
848
855
  # at line 196:9: ( ( SEMICOLON | COMMA ) ( expr[arg_type] | ) )*
@@ -867,7 +874,7 @@ module ExcelFormula
867
874
 
868
875
 
869
876
  # --> action
870
- mark = @rpn.length
877
+ mark = @rpn.size
871
878
  # <-- action
872
879
  # at line 199:17: ( expr[arg_type] | )
873
880
  alt_13 = 2
@@ -875,7 +882,7 @@ module ExcelFormula
875
882
  case alt_13
876
883
  when 1
877
884
  # at line 200:19: expr[arg_type]
878
- @state.following.push(TOKENS_FOLLOWING_expr_IN_primary_1327)
885
+ @state.following.push(TOKENS_FOLLOWING_expr_IN_primary_1345)
879
886
  expr(arg_type)
880
887
  @state.following.pop
881
888
 
@@ -888,7 +895,7 @@ module ExcelFormula
888
895
  end
889
896
  # --> action
890
897
 
891
- rem = @rpn.length - mark
898
+ rem = @rpn.size - mark
892
899
  rpn_chunks << @rpn[mark, rem]
893
900
  ref_markers << @sheet_references.size
894
901
 
@@ -898,24 +905,24 @@ module ExcelFormula
898
905
  break # out of loop for decision 14
899
906
  end
900
907
  end # loop for decision 14
901
- match(RP, TOKENS_FOLLOWING_RP_IN_primary_1405)
908
+ match(RP, TOKENS_FOLLOWING_RP_IN_primary_1423)
902
909
  # --> action
903
910
 
904
- @rpn = @rpn[0..rpn_start]
911
+ @rpn = @rpn[0...rpn_start]
905
912
  nc = rpn_chunks.length
906
913
  chunklens = rpn_chunks.collect {|c| c.length}
907
914
  skiplens = [0] * nc
908
- skiplens[-1] = 3
915
+ skiplens[nc-1] = 3
909
916
 
910
917
  (nc-1).downto(1) do |i|
911
918
  skiplens[i-1] = skiplens[i] + chunklens[i] + 4
912
919
  end
913
- jump_pos = [2 * nc + 2]
920
+ jump_pos = [2*nc + 2]
914
921
 
915
922
  (0...nc).each do |i|
916
- jump_pos.append(jump_pos[-1] + chunklens[ic] + 4)
923
+ jump_pos << (jump_pos.last + chunklens[i] + 4)
917
924
  end
918
- chunk_shift = 2 * nc + 6 # size of tAttrChoose
925
+ chunk_shift = 2*nc + 6 # size of tAttrChoose
919
926
 
920
927
  (0...nc).each do |i|
921
928
  (ref_markers[i]...ref_markers[i+1]).each do |r|
@@ -938,18 +945,18 @@ module ExcelFormula
938
945
 
939
946
  # <-- action
940
947
 
941
- when 11
948
+ when 12
942
949
  # at line 246:7: name_tok= NAME
943
- name_tok = match(NAME, TOKENS_FOLLOWING_NAME_IN_primary_1427)
950
+ name_tok = match(NAME, TOKENS_FOLLOWING_NAME_IN_primary_1445)
944
951
  # --> action
945
952
 
946
953
  raise "[formula] found unexpected NAME token #{name_tok.text}"
947
954
 
948
955
  # <-- action
949
956
 
950
- when 12
957
+ when 13
951
958
  # at line 250:7: func_tok= NAME LP arg_count= expr_list[arg_type_list, min_argc, max_argc] RP
952
- func_tok = match(NAME, TOKENS_FOLLOWING_NAME_IN_primary_1449)
959
+ func_tok = match(NAME, TOKENS_FOLLOWING_NAME_IN_primary_1467)
953
960
  # --> action
954
961
 
955
962
  func_toku = func_tok.text.upcase
@@ -967,15 +974,15 @@ module ExcelFormula
967
974
  end
968
975
 
969
976
  # <-- action
970
- match(LP, TOKENS_FOLLOWING_LP_IN_primary_1469)
971
- @state.following.push(TOKENS_FOLLOWING_expr_list_IN_primary_1475)
977
+ match(LP, TOKENS_FOLLOWING_LP_IN_primary_1487)
978
+ @state.following.push(TOKENS_FOLLOWING_expr_list_IN_primary_1493)
972
979
  arg_count = expr_list(arg_type_list, min_argc, max_argc)
973
980
  @state.following.pop
974
- match(RP, TOKENS_FOLLOWING_RP_IN_primary_1478)
981
+ match(RP, TOKENS_FOLLOWING_RP_IN_primary_1496)
975
982
  # --> action
976
983
 
977
984
  if (arg_count > max_argc) || (arg_count < min_argc)
978
- raise "#{arg_count} parameters for function: #{func_tok.text}"
985
+ raise "incorrect number #{arg_count} of parameters for function: #{func_tok.text}"
979
986
  end
980
987
 
981
988
  if xcall
@@ -984,28 +991,15 @@ module ExcelFormula
984
991
  elsif (min_argc == max_argc)
985
992
  func_ptg = PTGFUNCR + RVA_DELTA[func_type]
986
993
  @rpn += [func_ptg, opcode].pack("Cv")
987
- elsif (arg_count == 1) && (func_tok.text.upcase == "SUM")
994
+ elsif (arg_count == 1) && (func_tok.text.upcase === "SUM")
988
995
  @rpn += [PTGATTR, 0x10, 0].pack("CCv") # tAttrSum
989
996
  else
990
- func_ptg = PTGFUNCVARR + RVA_DELTA[func_type]
997
+ func_ptg = PTGFUNCVARR + RVA_DELTA[func_type]
991
998
  @rpn += [func_ptg, arg_count, opcode].pack("CCv")
992
999
  end
993
1000
 
994
1001
  # <-- action
995
1002
 
996
- when 13
997
- # at line 285:7: LP expr[arg_type] RP
998
- match(LP, TOKENS_FOLLOWING_LP_IN_primary_1496)
999
- @state.following.push(TOKENS_FOLLOWING_expr_IN_primary_1498)
1000
- expr(arg_type)
1001
- @state.following.pop
1002
- match(RP, TOKENS_FOLLOWING_RP_IN_primary_1501)
1003
- # --> action
1004
-
1005
- @rpn += [PTGPAREN].pack('C')
1006
-
1007
- # <-- action
1008
-
1009
1003
  end
1010
1004
  rescue ANTLR3::Error::RecognitionError => re
1011
1005
  report_error(re)
@@ -1024,26 +1018,36 @@ module ExcelFormula
1024
1018
  # parser rule expr_list
1025
1019
  #
1026
1020
  # (in ExcelFormula.g)
1027
- # 292:1: expr_list[arg_type_list, min_argc, max_argc] returns [arg_cnt] : ( expr[arg_type] ( ( SEMICOLON | COMMA ) ( expr[arg_type] | ) )* | );
1021
+ # 288:1: expr_list[arg_type_list, min_argc, max_argc] returns [arg_cnt] : ( ( expr[arg_type] ( ( SEMICOLON | COMMA ) ( expr[arg_type] | ) )* ) | );
1028
1022
  def expr_list(arg_type_list, min_argc, max_argc)
1029
1023
  # -> uncomment the next line to manually enable rule tracing
1030
1024
  # trace_in(__method__, 10)
1031
1025
  arg_cnt = nil
1026
+ # - - - - @init action - - - -
1027
+
1028
+ arg_cnt = 0
1029
+
1030
+ # Set these for processing first argument,
1031
+ # it's simpler because first argument type can't be '...'
1032
+ arg_type = arg_type_list.first
1033
+
1034
+ # need to check for '-' for a fn with no arguments
1035
+ arg_cnt += 1 unless arg_type === '-'
1036
+
1032
1037
 
1033
1038
  begin
1034
- # at line 297:5: ( expr[arg_type] ( ( SEMICOLON | COMMA ) ( expr[arg_type] | ) )* | )
1039
+ # at line 300:5: ( ( expr[arg_type] ( ( SEMICOLON | COMMA ) ( expr[arg_type] | ) )* ) | )
1035
1040
  alt_18 = 2
1036
1041
  alt_18 = @dfa18.predict(@input)
1037
1042
  case alt_18
1038
1043
  when 1
1039
- # at line 297:7: expr[arg_type] ( ( SEMICOLON | COMMA ) ( expr[arg_type] | ) )*
1040
- @state.following.push(TOKENS_FOLLOWING_expr_IN_expr_list_1542)
1044
+ # at line 301:5: ( expr[arg_type] ( ( SEMICOLON | COMMA ) ( expr[arg_type] | ) )* )
1045
+ # at line 301:5: ( expr[arg_type] ( ( SEMICOLON | COMMA ) ( expr[arg_type] | ) )* )
1046
+ # at line 301:6: expr[arg_type] ( ( SEMICOLON | COMMA ) ( expr[arg_type] | ) )*
1047
+ @state.following.push(TOKENS_FOLLOWING_expr_IN_expr_list_1540)
1041
1048
  expr(arg_type)
1042
1049
  @state.following.pop
1043
- # --> action
1044
- arg_cnt += 1
1045
- # <-- action
1046
- # at line 298:5: ( ( SEMICOLON | COMMA ) ( expr[arg_type] | ) )*
1050
+ # at line 302:9: ( ( SEMICOLON | COMMA ) ( expr[arg_type] | ) )*
1047
1051
  loop do # decision 17
1048
1052
  alt_17 = 2
1049
1053
  look_17_0 = @input.peek(1)
@@ -1054,19 +1058,7 @@ module ExcelFormula
1054
1058
  end
1055
1059
  case alt_17
1056
1060
  when 1
1057
- # at line 299:9: ( SEMICOLON | COMMA ) ( expr[arg_type] | )
1058
- # --> action
1059
-
1060
- if arg_cnt < arg_type_list.size
1061
- arg_type = arg_type_list[arg_cnt]
1062
- else
1063
- arg_type = arg_type_list[-1]
1064
- end
1065
- if arg_type == "+"
1066
- arg_type = arg_type_list[-2]
1067
- end
1068
-
1069
- # <-- action
1061
+ # at line 303:14: ( SEMICOLON | COMMA ) ( expr[arg_type] | )
1070
1062
  if @input.peek(1).between?(SEMICOLON, COMMA)
1071
1063
  @input.consume
1072
1064
  @state.error_recovery = false
@@ -1076,34 +1068,52 @@ module ExcelFormula
1076
1068
  end
1077
1069
 
1078
1070
 
1079
- # at line 310:13: ( expr[arg_type] | )
1071
+ # --> action
1072
+ arg_cnt += 1
1073
+ # <-- action
1074
+ # at line 304:17: ( expr[arg_type] | )
1080
1075
  alt_16 = 2
1081
1076
  alt_16 = @dfa16.predict(@input)
1082
1077
  case alt_16
1083
1078
  when 1
1084
- # at line 311:19: expr[arg_type]
1085
- @state.following.push(TOKENS_FOLLOWING_expr_IN_expr_list_1611)
1079
+ # at line 306:22: expr[arg_type]
1080
+ @state.following.push(TOKENS_FOLLOWING_expr_IN_expr_list_1634)
1086
1081
  expr(arg_type)
1087
1082
  @state.following.pop
1083
+ # --> action
1084
+
1085
+ if arg_cnt - 2 < arg_type_list.size
1086
+ arg_type = arg_type_list[arg_cnt - 2]
1087
+ else
1088
+ if arg_type_list.last === "..."
1089
+ # e.g. "V R ..." arbitrary number of args of type R
1090
+ # this will always be last element in arg_type_list
1091
+ # 2nd to last element will provide type
1092
+ arg_type = arg_type_list[arg_type_list.size - 2]
1093
+ else
1094
+ # Just read last element normally.
1095
+ arg_type = arg_type_list[arg_cnt - 2]
1096
+ end
1097
+ end
1098
+
1099
+ # <-- action
1088
1100
 
1089
1101
  when 2
1090
- # at line 312:19:
1102
+ # at line 323:19:
1091
1103
  # --> action
1092
- @rpn += [PTGMISSARG].pack("B")
1104
+ @rpn += [PTGMISSARG].pack("C")
1093
1105
  # <-- action
1094
1106
 
1095
1107
  end
1096
- # --> action
1097
- arg_cnt += 1
1098
- # <-- action
1099
1108
 
1100
1109
  else
1101
1110
  break # out of loop for decision 17
1102
1111
  end
1103
1112
  end # loop for decision 17
1104
1113
 
1114
+
1105
1115
  when 2
1106
- # at line 317:5:
1116
+ # at line 328:5:
1107
1117
 
1108
1118
  end
1109
1119
  rescue ANTLR3::Error::RecognitionError => re
@@ -1123,7 +1133,7 @@ module ExcelFormula
1123
1133
  # parser rule sheet
1124
1134
  #
1125
1135
  # (in ExcelFormula.g)
1126
- # 319:1: sheet returns [ref] : (sheet_ref_name= NAME | sheet_ref_int= INT_CONST | sheet_ref_quote= QUOTENAME );
1136
+ # 330:1: sheet returns [ref] : (sheet_ref_name= NAME | sheet_ref_int= INT_CONST | sheet_ref_quote= QUOTENAME );
1127
1137
  def sheet
1128
1138
  # -> uncomment the next line to manually enable rule tracing
1129
1139
  # trace_in(__method__, 11)
@@ -1133,7 +1143,7 @@ module ExcelFormula
1133
1143
  sheet_ref_quote = nil
1134
1144
 
1135
1145
  begin
1136
- # at line 320:5: (sheet_ref_name= NAME | sheet_ref_int= INT_CONST | sheet_ref_quote= QUOTENAME )
1146
+ # at line 331:5: (sheet_ref_name= NAME | sheet_ref_int= INT_CONST | sheet_ref_quote= QUOTENAME )
1137
1147
  alt_19 = 3
1138
1148
  case look_19 = @input.peek(1)
1139
1149
  when NAME then alt_19 = 1
@@ -1145,22 +1155,22 @@ module ExcelFormula
1145
1155
  end
1146
1156
  case alt_19
1147
1157
  when 1
1148
- # at line 320:7: sheet_ref_name= NAME
1149
- sheet_ref_name = match(NAME, TOKENS_FOLLOWING_NAME_IN_sheet_1701)
1158
+ # at line 331:7: sheet_ref_name= NAME
1159
+ sheet_ref_name = match(NAME, TOKENS_FOLLOWING_NAME_IN_sheet_1768)
1150
1160
  # --> action
1151
1161
  ref = sheet_ref_name.text
1152
1162
  # <-- action
1153
1163
 
1154
1164
  when 2
1155
- # at line 322:7: sheet_ref_int= INT_CONST
1156
- sheet_ref_int = match(INT_CONST, TOKENS_FOLLOWING_INT_CONST_IN_sheet_1721)
1165
+ # at line 333:7: sheet_ref_int= INT_CONST
1166
+ sheet_ref_int = match(INT_CONST, TOKENS_FOLLOWING_INT_CONST_IN_sheet_1788)
1157
1167
  # --> action
1158
1168
  ref = sheet_ref_int.text
1159
1169
  # <-- action
1160
1170
 
1161
1171
  when 3
1162
- # at line 324:7: sheet_ref_quote= QUOTENAME
1163
- sheet_ref_quote = match(QUOTENAME, TOKENS_FOLLOWING_QUOTENAME_IN_sheet_1741)
1172
+ # at line 335:7: sheet_ref_quote= QUOTENAME
1173
+ sheet_ref_quote = match(QUOTENAME, TOKENS_FOLLOWING_QUOTENAME_IN_sheet_1808)
1164
1174
  # --> action
1165
1175
  ref = sheet_ref_quote.text[1, len(sheet_ref_quote.text) - 1].replace("''", "'")
1166
1176
  # <-- action
@@ -1190,7 +1200,7 @@ module ExcelFormula
1190
1200
  ACCEPT = unpack(1, -1, 1, 2, 2, -1, 1, 1, 5, -1)
1191
1201
  SPECIAL = unpack(10, -1)
1192
1202
  TRANSITION = [
1193
- unpack(6, 4, 17, -1, 3, 1),
1203
+ unpack(6, 4, 15, -1, 1, 1, 2, -1, 2, 1),
1194
1204
  unpack(),
1195
1205
  unpack(),
1196
1206
  unpack(),
@@ -1225,7 +1235,7 @@ module ExcelFormula
1225
1235
  ACCEPT = unpack(1, -1, 1, 2, 8, -1, 1, 1)
1226
1236
  SPECIAL = unpack(11, -1)
1227
1237
  TRANSITION = [
1228
- unpack(6, 1, 1, 10, 16, -1, 3, 1),
1238
+ unpack(6, 1, 1, 10, 14, -1, 1, 1, 2, -1, 2, 1),
1229
1239
  unpack(),
1230
1240
  unpack(),
1231
1241
  unpack(),
@@ -1261,7 +1271,7 @@ module ExcelFormula
1261
1271
  ACCEPT = unpack(1, -1, 1, 2, 9, -1, 1, 1, 1, -1)
1262
1272
  SPECIAL = unpack(13, -1)
1263
1273
  TRANSITION = [
1264
- unpack(7, 1, 2, 11, 14, -1, 3, 1),
1274
+ unpack(7, 1, 2, 11, 12, -1, 1, 1, 2, -1, 2, 1),
1265
1275
  unpack(),
1266
1276
  unpack(),
1267
1277
  unpack(),
@@ -1299,7 +1309,7 @@ module ExcelFormula
1299
1309
  ACCEPT = unpack(1, -1, 1, 2, 11, -1, 1, 1, 1, -1)
1300
1310
  SPECIAL = unpack(15, -1)
1301
1311
  TRANSITION = [
1302
- unpack(9, 1, 2, 13, 12, -1, 3, 1),
1312
+ unpack(9, 1, 2, 13, 10, -1, 1, 1, 2, -1, 2, 1),
1303
1313
  unpack(),
1304
1314
  unpack(),
1305
1315
  unpack(),
@@ -1339,7 +1349,7 @@ module ExcelFormula
1339
1349
  ACCEPT = unpack(1, -1, 1, 2, 13, -1, 1, 1)
1340
1350
  SPECIAL = unpack(16, -1)
1341
1351
  TRANSITION = [
1342
- unpack(11, 1, 1, 15, 11, -1, 3, 1),
1352
+ unpack(11, 1, 1, 15, 9, -1, 1, 1, 2, -1, 2, 1),
1343
1353
  unpack(),
1344
1354
  unpack(),
1345
1355
  unpack(),
@@ -1368,7 +1378,49 @@ module ExcelFormula
1368
1378
 
1369
1379
  def description
1370
1380
  <<-'__dfa_description__'.strip!
1371
- ()* loopback of 79:9: ( ( POWER ) prec5_expr[arg_type] )*
1381
+ ()* loopback of 79:9: ( ( POWER ) prec4_expr[arg_type] )*
1382
+ __dfa_description__
1383
+ end
1384
+ end
1385
+ class DFA9 < ANTLR3::DFA
1386
+ EOT = unpack(17, -1)
1387
+ EOF = unpack(1, 2, 16, -1)
1388
+ MIN = unpack(1, 4, 16, -1)
1389
+ MAX = unpack(1, 29, 16, -1)
1390
+ ACCEPT = unpack(1, -1, 1, 1, 1, 2, 14, -1)
1391
+ SPECIAL = unpack(17, -1)
1392
+ TRANSITION = [
1393
+ unpack(12, 2, 1, 1, 8, -1, 1, 2, 2, -1, 2, 2),
1394
+ unpack(),
1395
+ unpack(),
1396
+ unpack(),
1397
+ unpack(),
1398
+ unpack(),
1399
+ unpack(),
1400
+ unpack(),
1401
+ unpack(),
1402
+ unpack(),
1403
+ unpack(),
1404
+ unpack(),
1405
+ unpack(),
1406
+ unpack(),
1407
+ unpack(),
1408
+ unpack(),
1409
+ unpack()
1410
+ ].freeze
1411
+
1412
+ ( 0 ... MIN.length ).zip( MIN, MAX ) do | i, a, z |
1413
+ if a > 0 and z < 0
1414
+ MAX[ i ] %= 0x10000
1415
+ end
1416
+ end
1417
+
1418
+ @decision = 9
1419
+
1420
+
1421
+ def description
1422
+ <<-'__dfa_description__'.strip!
1423
+ 89:9: ( PERCENT )?
1372
1424
  __dfa_description__
1373
1425
  end
1374
1426
  end
@@ -1380,7 +1432,7 @@ module ExcelFormula
1380
1432
  ACCEPT = unpack(1, -1, 1, 1, 10, -1, 1, 2)
1381
1433
  SPECIAL = unpack(13, -1)
1382
1434
  TRANSITION = [
1383
- unpack(1, 12, 4, -1, 6, 1, 2, -1, 2, 1, 3, -1, 3, 1),
1435
+ unpack(1, 12, 4, -1, 6, 1, 1, -1, 1, 1, 2, -1, 1, 1, 2, -1, 3, 1),
1384
1436
  unpack(),
1385
1437
  unpack(),
1386
1438
  unpack(),
@@ -1412,24 +1464,25 @@ module ExcelFormula
1412
1464
  end
1413
1465
  class DFA15 < ANTLR3::DFA
1414
1466
  EOT = unpack(66, -1)
1415
- EOF = unpack(4, -1, 1, 12, 1, -1, 1, 31, 1, 48, 58, -1)
1416
- MIN = unpack(1, 17, 3, -1, 1, 4, 1, -1, 2, 4, 58, -1)
1417
- MAX = unpack(1, 32, 3, -1, 1, 29, 1, -1, 2, 29, 58, -1)
1418
- ACCEPT = unpack(1, -1, 1, 1, 1, 2, 1, 3, 1, -1, 1, 5, 2, -1, 1, 8,
1419
- 1, 9, 1, 10, 1, 13, 1, 4, 17, -1, 1, 7, 1, 6, 15,
1420
- -1, 1, 12, 1, 11, 17, -1)
1467
+ EOF = unpack(4, -1, 1, 12, 1, -1, 1, 31, 1, -1, 1, 49, 57, -1)
1468
+ MIN = unpack(1, 17, 3, -1, 1, 4, 1, -1, 1, 4, 1, -1, 1, 4, 57, -1)
1469
+ MAX = unpack(1, 32, 3, -1, 1, 29, 1, -1, 1, 29, 1, -1, 1, 29, 57,
1470
+ -1)
1471
+ ACCEPT = unpack(1, -1, 1, 1, 1, 2, 1, 3, 1, -1, 1, 5, 1, -1, 1, 8,
1472
+ 1, -1, 1, 9, 1, 10, 1, 11, 1, 4, 17, -1, 1, 7, 1,
1473
+ 6, 17, -1, 1, 12, 15, -1, 1, 13)
1421
1474
  SPECIAL = unpack(66, -1)
1422
1475
  TRANSITION = [
1423
- unpack(1, 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 2, -1, 1, 9, 1, 11, 3,
1424
- -1, 1, 10, 1, 7, 1, 8),
1476
+ unpack(1, 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, -1, 1, 7, 2, -1, 1,
1477
+ 10, 2, -1, 1, 11, 1, 8, 1, 9),
1425
1478
  unpack(),
1426
1479
  unpack(),
1427
1480
  unpack(),
1428
- unpack(13, 12, 6, -1, 2, 8, 2, -1, 3, 12),
1481
+ unpack(13, 12, 6, -1, 1, 9, 1, -1, 1, 12, 1, 9, 1, -1, 2, 12),
1429
1482
  unpack(),
1430
- unpack(13, 31, 6, -1, 1, 30, 3, -1, 3, 31),
1431
- unpack(13, 48, 6, -1, 2, 8, 1, -1, 1, 47, 3, 48),
1483
+ unpack(13, 31, 6, -1, 1, 30, 1, -1, 1, 31, 2, -1, 2, 31),
1432
1484
  unpack(),
1485
+ unpack(13, 49, 6, -1, 1, 9, 1, 65, 1, 49, 1, 9, 1, -1, 2, 49),
1433
1486
  unpack(),
1434
1487
  unpack(),
1435
1488
  unpack(),
@@ -1500,7 +1553,7 @@ module ExcelFormula
1500
1553
 
1501
1554
  def description
1502
1555
  <<-'__dfa_description__'.strip!
1503
- 99:1: primary[arg_type] : ( TRUE_CONST | FALSE_CONST | str_tok= STR_CONST | int_tok= INT_CONST | num_tok= NUM_CONST | ref2d_tok= REF2D | ref2d1_tok= REF2D COLON ref2d2_tok= REF2D | sheet1= sheet ( COLON sheet2= sheet )? BANG ref3d_ref2d= REF2D ( COLON ref3d_ref2d2= REF2D )? | FUNC_IF LP expr[\"V\"] ( SEMICOLON | COMMA ) expr[arg_type] ( SEMICOLON | COMMA ) expr[arg_type] RP | FUNC_CHOOSE LP expr[\"V\"] ( ( SEMICOLON | COMMA ) ( expr[arg_type] | ) )* RP | name_tok= NAME | func_tok= NAME LP arg_count= expr_list[arg_type_list, min_argc, max_argc] RP | LP expr[arg_type] RP );
1556
+ 99:1: primary[arg_type] : ( TRUE_CONST | FALSE_CONST | str_tok= STR_CONST | int_tok= INT_CONST | num_tok= NUM_CONST | ref2d_tok= REF2D | ref2d1_tok= REF2D COLON ref2d2_tok= REF2D | LP expr[arg_type] RP | sheet1= sheet ( COLON sheet2= sheet )? BANG ref3d_ref2d= REF2D ( COLON ref3d_ref2d2= REF2D )? | FUNC_IF LP expr[\"V\"] ( SEMICOLON | COMMA ) expr[arg_type] ( SEMICOLON | COMMA ) expr[arg_type] RP | FUNC_CHOOSE LP expr[\"V\"] ( ( SEMICOLON | COMMA ) ( expr[arg_type] | ) )* RP | name_tok= NAME | func_tok= NAME LP arg_count= expr_list[arg_type_list, min_argc, max_argc] RP );
1504
1557
  __dfa_description__
1505
1558
  end
1506
1559
  end
@@ -1512,7 +1565,7 @@ module ExcelFormula
1512
1565
  ACCEPT = unpack(1, -1, 1, 1, 1, 2, 15, -1)
1513
1566
  SPECIAL = unpack(18, -1)
1514
1567
  TRANSITION = [
1515
- unpack(13, 2, 6, -1, 1, 1, 3, -1, 3, 2),
1568
+ unpack(13, 2, 6, -1, 1, 1, 1, -1, 1, 2, 2, -1, 2, 2),
1516
1569
  unpack(),
1517
1570
  unpack(),
1518
1571
  unpack(),
@@ -1543,7 +1596,7 @@ module ExcelFormula
1543
1596
 
1544
1597
  def description
1545
1598
  <<-'__dfa_description__'.strip!
1546
- 151:9: ( COLON ref3d_ref2d2= REF2D )?
1599
+ 153:9: ( COLON ref3d_ref2d2= REF2D )?
1547
1600
  __dfa_description__
1548
1601
  end
1549
1602
  end
@@ -1555,7 +1608,8 @@ module ExcelFormula
1555
1608
  ACCEPT = unpack(1, -1, 1, 1, 11, -1, 1, 2, 1, -1)
1556
1609
  SPECIAL = unpack(15, -1)
1557
1610
  TRANSITION = [
1558
- unpack(1, 1, 4, -1, 6, 1, 2, -1, 2, 1, 3, 13, 3, 1),
1611
+ unpack(1, 1, 4, -1, 6, 1, 1, -1, 1, 1, 1, 13, 1, -1, 1, 1, 2, 13,
1612
+ 3, 1),
1559
1613
  unpack(),
1560
1614
  unpack(),
1561
1615
  unpack(),
@@ -1595,7 +1649,8 @@ module ExcelFormula
1595
1649
  ACCEPT = unpack(1, -1, 1, 1, 11, -1, 1, 2)
1596
1650
  SPECIAL = unpack(14, -1)
1597
1651
  TRANSITION = [
1598
- unpack(1, 1, 4, -1, 6, 1, 2, -1, 2, 1, 2, -1, 1, 13, 3, 1),
1652
+ unpack(1, 1, 4, -1, 6, 1, 1, -1, 1, 1, 1, 13, 1, -1, 1, 1, 2, -1,
1653
+ 3, 1),
1599
1654
  unpack(),
1600
1655
  unpack(),
1601
1656
  unpack(),
@@ -1622,7 +1677,7 @@ module ExcelFormula
1622
1677
 
1623
1678
  def description
1624
1679
  <<-'__dfa_description__'.strip!
1625
- 292:1: expr_list[arg_type_list, min_argc, max_argc] returns [arg_cnt] : ( expr[arg_type] ( ( SEMICOLON | COMMA ) ( expr[arg_type] | ) )* | );
1680
+ 288:1: expr_list[arg_type_list, min_argc, max_argc] returns [arg_cnt] : ( ( expr[arg_type] ( ( SEMICOLON | COMMA ) ( expr[arg_type] | ) )* ) | );
1626
1681
  __dfa_description__
1627
1682
  end
1628
1683
  end
@@ -1634,7 +1689,8 @@ module ExcelFormula
1634
1689
  ACCEPT = unpack(1, -1, 1, 1, 11, -1, 1, 2, 1, -1)
1635
1690
  SPECIAL = unpack(15, -1)
1636
1691
  TRANSITION = [
1637
- unpack(1, 1, 4, -1, 6, 1, 2, -1, 2, 1, 3, 13, 3, 1),
1692
+ unpack(1, 1, 4, -1, 6, 1, 1, -1, 1, 1, 1, 13, 1, -1, 1, 1, 2, 13,
1693
+ 3, 1),
1638
1694
  unpack(),
1639
1695
  unpack(),
1640
1696
  unpack(),
@@ -1662,7 +1718,7 @@ module ExcelFormula
1662
1718
 
1663
1719
  def description
1664
1720
  <<-'__dfa_description__'.strip!
1665
- 310:13: ( expr[arg_type] | )
1721
+ 304:17: ( expr[arg_type] | )
1666
1722
  __dfa_description__
1667
1723
  end
1668
1724
  end
@@ -1677,6 +1733,7 @@ module ExcelFormula
1677
1733
  @dfa5 = DFA5.new(self, 5)
1678
1734
  @dfa7 = DFA7.new(self, 7)
1679
1735
  @dfa8 = DFA8.new(self, 8)
1736
+ @dfa9 = DFA9.new(self, 9)
1680
1737
  @dfa10 = DFA10.new(self, 10)
1681
1738
  @dfa15 = DFA15.new(self, 15)
1682
1739
  @dfa12 = DFA12.new(self, 12)
@@ -1685,78 +1742,78 @@ module ExcelFormula
1685
1742
  @dfa16 = DFA16.new(self, 16)
1686
1743
 
1687
1744
  end
1688
- TOKENS_FOLLOWING_expr_IN_formula_60 = Set[1]
1689
- TOKENS_FOLLOWING_prec0_expr_IN_expr_79 = Set[1, 4, 5, 6, 7, 8, 9]
1690
- TOKENS_FOLLOWING_EQ_IN_expr_124 = Set[12, 17, 18, 19, 20, 21, 22, 25, 26, 30, 31, 32]
1691
- TOKENS_FOLLOWING_NE_IN_expr_146 = Set[12, 17, 18, 19, 20, 21, 22, 25, 26, 30, 31, 32]
1692
- TOKENS_FOLLOWING_GT_IN_expr_168 = Set[12, 17, 18, 19, 20, 21, 22, 25, 26, 30, 31, 32]
1693
- TOKENS_FOLLOWING_LT_IN_expr_190 = Set[12, 17, 18, 19, 20, 21, 22, 25, 26, 30, 31, 32]
1694
- TOKENS_FOLLOWING_GE_IN_expr_212 = Set[12, 17, 18, 19, 20, 21, 22, 25, 26, 30, 31, 32]
1695
- TOKENS_FOLLOWING_LE_IN_expr_234 = Set[12, 17, 18, 19, 20, 21, 22, 25, 26, 30, 31, 32]
1696
- TOKENS_FOLLOWING_prec0_expr_IN_expr_265 = Set[1, 4, 5, 6, 7, 8, 9]
1697
- TOKENS_FOLLOWING_prec1_expr_IN_prec0_expr_297 = Set[1, 10]
1698
- TOKENS_FOLLOWING_CONCAT_IN_prec0_expr_340 = Set[12, 17, 18, 19, 20, 21, 22, 25, 26, 30, 31, 32]
1699
- TOKENS_FOLLOWING_prec1_expr_IN_prec0_expr_370 = Set[1, 10]
1700
- TOKENS_FOLLOWING_prec2_expr_IN_prec1_expr_402 = Set[1, 11, 12]
1701
- TOKENS_FOLLOWING_ADD_IN_prec1_expr_447 = Set[12, 17, 18, 19, 20, 21, 22, 25, 26, 30, 31, 32]
1702
- TOKENS_FOLLOWING_SUB_IN_prec1_expr_469 = Set[12, 17, 18, 19, 20, 21, 22, 25, 26, 30, 31, 32]
1703
- TOKENS_FOLLOWING_prec2_expr_IN_prec1_expr_499 = Set[1, 11, 12]
1704
- TOKENS_FOLLOWING_prec3_expr_IN_prec2_expr_532 = Set[1, 13, 14]
1705
- TOKENS_FOLLOWING_MUL_IN_prec2_expr_577 = Set[12, 17, 18, 19, 20, 21, 22, 25, 26, 30, 31, 32]
1706
- TOKENS_FOLLOWING_DIV_IN_prec2_expr_599 = Set[12, 17, 18, 19, 20, 21, 22, 25, 26, 30, 31, 32]
1707
- TOKENS_FOLLOWING_prec3_expr_IN_prec2_expr_629 = Set[1, 13, 14]
1708
- TOKENS_FOLLOWING_prec5_expr_IN_prec3_expr_661 = Set[1, 15]
1709
- TOKENS_FOLLOWING_POWER_IN_prec3_expr_704 = Set[12, 17, 18, 19, 20, 21, 22, 25, 26, 30, 31, 32]
1710
- TOKENS_FOLLOWING_prec5_expr_IN_prec3_expr_734 = Set[1, 15]
1711
- TOKENS_FOLLOWING_prec5_expr_IN_prec4_expr_766 = Set[1, 16]
1712
- TOKENS_FOLLOWING_PERCENT_IN_prec4_expr_791 = Set[1]
1713
- TOKENS_FOLLOWING_primary_IN_prec5_expr_822 = Set[1]
1714
- TOKENS_FOLLOWING_SUB_IN_prec5_expr_831 = Set[17, 18, 19, 20, 21, 22, 25, 26, 30, 31, 32]
1715
- TOKENS_FOLLOWING_primary_IN_prec5_expr_833 = Set[1]
1716
- TOKENS_FOLLOWING_TRUE_CONST_IN_primary_854 = Set[1]
1717
- TOKENS_FOLLOWING_FALSE_CONST_IN_primary_872 = Set[1]
1718
- TOKENS_FOLLOWING_STR_CONST_IN_primary_894 = Set[1]
1719
- TOKENS_FOLLOWING_INT_CONST_IN_primary_916 = Set[1]
1720
- TOKENS_FOLLOWING_NUM_CONST_IN_primary_934 = Set[1]
1721
- TOKENS_FOLLOWING_REF2D_IN_primary_956 = Set[1]
1722
- TOKENS_FOLLOWING_REF2D_IN_primary_978 = Set[23]
1723
- TOKENS_FOLLOWING_COLON_IN_primary_980 = Set[22]
1724
- TOKENS_FOLLOWING_REF2D_IN_primary_986 = Set[1]
1725
- TOKENS_FOLLOWING_sheet_IN_primary_1010 = Set[23, 24]
1726
- TOKENS_FOLLOWING_COLON_IN_primary_1032 = Set[20, 31, 32]
1727
- TOKENS_FOLLOWING_sheet_IN_primary_1038 = Set[24]
1728
- TOKENS_FOLLOWING_BANG_IN_primary_1043 = Set[22]
1729
- TOKENS_FOLLOWING_REF2D_IN_primary_1047 = Set[1, 23]
1730
- TOKENS_FOLLOWING_COLON_IN_primary_1069 = Set[22]
1731
- TOKENS_FOLLOWING_REF2D_IN_primary_1074 = Set[1]
1732
- TOKENS_FOLLOWING_FUNC_IF_IN_primary_1117 = Set[26]
1733
- TOKENS_FOLLOWING_LP_IN_primary_1127 = Set[12, 17, 18, 19, 20, 21, 22, 25, 26, 30, 31, 32]
1734
- TOKENS_FOLLOWING_expr_IN_primary_1129 = Set[27, 28]
1735
- TOKENS_FOLLOWING_set_IN_primary_1132 = Set[12, 17, 18, 19, 20, 21, 22, 25, 26, 30, 31, 32]
1736
- TOKENS_FOLLOWING_expr_IN_primary_1158 = Set[27, 28]
1737
- TOKENS_FOLLOWING_set_IN_primary_1161 = Set[12, 17, 18, 19, 20, 21, 22, 25, 26, 30, 31, 32]
1738
- TOKENS_FOLLOWING_expr_IN_primary_1187 = Set[29]
1739
- TOKENS_FOLLOWING_RP_IN_primary_1190 = Set[1]
1740
- TOKENS_FOLLOWING_FUNC_CHOOSE_IN_primary_1208 = Set[26]
1741
- TOKENS_FOLLOWING_LP_IN_primary_1228 = Set[12, 17, 18, 19, 20, 21, 22, 25, 26, 30, 31, 32]
1742
- TOKENS_FOLLOWING_expr_IN_primary_1230 = Set[27, 28, 29]
1743
- TOKENS_FOLLOWING_set_IN_primary_1265 = Set[12, 17, 18, 19, 20, 21, 22, 25, 26, 27, 28, 29, 30, 31, 32]
1744
- TOKENS_FOLLOWING_expr_IN_primary_1327 = Set[27, 28, 29]
1745
- TOKENS_FOLLOWING_RP_IN_primary_1405 = Set[1]
1746
- TOKENS_FOLLOWING_NAME_IN_primary_1427 = Set[1]
1747
- TOKENS_FOLLOWING_NAME_IN_primary_1449 = Set[26]
1748
- TOKENS_FOLLOWING_LP_IN_primary_1469 = Set[12, 17, 18, 19, 20, 21, 22, 25, 26, 29, 30, 31, 32]
1749
- TOKENS_FOLLOWING_expr_list_IN_primary_1475 = Set[29]
1750
- TOKENS_FOLLOWING_RP_IN_primary_1478 = Set[1]
1751
- TOKENS_FOLLOWING_LP_IN_primary_1496 = Set[12, 17, 18, 19, 20, 21, 22, 25, 26, 30, 31, 32]
1752
- TOKENS_FOLLOWING_expr_IN_primary_1498 = Set[29]
1753
- TOKENS_FOLLOWING_RP_IN_primary_1501 = Set[1]
1754
- TOKENS_FOLLOWING_expr_IN_expr_list_1542 = Set[1, 27, 28]
1755
- TOKENS_FOLLOWING_set_IN_expr_list_1571 = Set[1, 12, 17, 18, 19, 20, 21, 22, 25, 26, 27, 28, 30, 31, 32]
1756
- TOKENS_FOLLOWING_expr_IN_expr_list_1611 = Set[1, 27, 28]
1757
- TOKENS_FOLLOWING_NAME_IN_sheet_1701 = Set[1]
1758
- TOKENS_FOLLOWING_INT_CONST_IN_sheet_1721 = Set[1]
1759
- TOKENS_FOLLOWING_QUOTENAME_IN_sheet_1741 = Set[1]
1745
+ TOKENS_FOLLOWING_expr_IN_formula_56 = Set[1]
1746
+ TOKENS_FOLLOWING_prec0_expr_IN_expr_75 = Set[1, 4, 5, 6, 7, 8, 9]
1747
+ TOKENS_FOLLOWING_EQ_IN_expr_120 = Set[12, 17, 18, 19, 20, 21, 22, 24, 27, 30, 31, 32]
1748
+ TOKENS_FOLLOWING_NE_IN_expr_142 = Set[12, 17, 18, 19, 20, 21, 22, 24, 27, 30, 31, 32]
1749
+ TOKENS_FOLLOWING_GT_IN_expr_164 = Set[12, 17, 18, 19, 20, 21, 22, 24, 27, 30, 31, 32]
1750
+ TOKENS_FOLLOWING_LT_IN_expr_186 = Set[12, 17, 18, 19, 20, 21, 22, 24, 27, 30, 31, 32]
1751
+ TOKENS_FOLLOWING_GE_IN_expr_208 = Set[12, 17, 18, 19, 20, 21, 22, 24, 27, 30, 31, 32]
1752
+ TOKENS_FOLLOWING_LE_IN_expr_230 = Set[12, 17, 18, 19, 20, 21, 22, 24, 27, 30, 31, 32]
1753
+ TOKENS_FOLLOWING_prec0_expr_IN_expr_261 = Set[1, 4, 5, 6, 7, 8, 9]
1754
+ TOKENS_FOLLOWING_prec1_expr_IN_prec0_expr_293 = Set[1, 10]
1755
+ TOKENS_FOLLOWING_CONCAT_IN_prec0_expr_336 = Set[12, 17, 18, 19, 20, 21, 22, 24, 27, 30, 31, 32]
1756
+ TOKENS_FOLLOWING_prec1_expr_IN_prec0_expr_366 = Set[1, 10]
1757
+ TOKENS_FOLLOWING_prec2_expr_IN_prec1_expr_398 = Set[1, 11, 12]
1758
+ TOKENS_FOLLOWING_ADD_IN_prec1_expr_443 = Set[12, 17, 18, 19, 20, 21, 22, 24, 27, 30, 31, 32]
1759
+ TOKENS_FOLLOWING_SUB_IN_prec1_expr_465 = Set[12, 17, 18, 19, 20, 21, 22, 24, 27, 30, 31, 32]
1760
+ TOKENS_FOLLOWING_prec2_expr_IN_prec1_expr_495 = Set[1, 11, 12]
1761
+ TOKENS_FOLLOWING_prec3_expr_IN_prec2_expr_528 = Set[1, 13, 14]
1762
+ TOKENS_FOLLOWING_MUL_IN_prec2_expr_573 = Set[12, 17, 18, 19, 20, 21, 22, 24, 27, 30, 31, 32]
1763
+ TOKENS_FOLLOWING_DIV_IN_prec2_expr_595 = Set[12, 17, 18, 19, 20, 21, 22, 24, 27, 30, 31, 32]
1764
+ TOKENS_FOLLOWING_prec3_expr_IN_prec2_expr_625 = Set[1, 13, 14]
1765
+ TOKENS_FOLLOWING_prec4_expr_IN_prec3_expr_657 = Set[1, 15]
1766
+ TOKENS_FOLLOWING_POWER_IN_prec3_expr_700 = Set[12, 17, 18, 19, 20, 21, 22, 24, 27, 30, 31, 32]
1767
+ TOKENS_FOLLOWING_prec4_expr_IN_prec3_expr_730 = Set[1, 15]
1768
+ TOKENS_FOLLOWING_prec5_expr_IN_prec4_expr_762 = Set[1, 16]
1769
+ TOKENS_FOLLOWING_PERCENT_IN_prec4_expr_787 = Set[1]
1770
+ TOKENS_FOLLOWING_primary_IN_prec5_expr_818 = Set[1]
1771
+ TOKENS_FOLLOWING_SUB_IN_prec5_expr_827 = Set[17, 18, 19, 20, 21, 22, 24, 27, 30, 31, 32]
1772
+ TOKENS_FOLLOWING_primary_IN_prec5_expr_829 = Set[1]
1773
+ TOKENS_FOLLOWING_TRUE_CONST_IN_primary_850 = Set[1]
1774
+ TOKENS_FOLLOWING_FALSE_CONST_IN_primary_868 = Set[1]
1775
+ TOKENS_FOLLOWING_STR_CONST_IN_primary_890 = Set[1]
1776
+ TOKENS_FOLLOWING_INT_CONST_IN_primary_912 = Set[1]
1777
+ TOKENS_FOLLOWING_NUM_CONST_IN_primary_930 = Set[1]
1778
+ TOKENS_FOLLOWING_REF2D_IN_primary_952 = Set[1]
1779
+ TOKENS_FOLLOWING_REF2D_IN_primary_974 = Set[23]
1780
+ TOKENS_FOLLOWING_COLON_IN_primary_976 = Set[22]
1781
+ TOKENS_FOLLOWING_REF2D_IN_primary_982 = Set[1]
1782
+ TOKENS_FOLLOWING_LP_IN_primary_1000 = Set[12, 17, 18, 19, 20, 21, 22, 24, 27, 30, 31, 32]
1783
+ TOKENS_FOLLOWING_expr_IN_primary_1002 = Set[25]
1784
+ TOKENS_FOLLOWING_RP_IN_primary_1005 = Set[1]
1785
+ TOKENS_FOLLOWING_sheet_IN_primary_1028 = Set[23, 26]
1786
+ TOKENS_FOLLOWING_COLON_IN_primary_1050 = Set[20, 31, 32]
1787
+ TOKENS_FOLLOWING_sheet_IN_primary_1056 = Set[26]
1788
+ TOKENS_FOLLOWING_BANG_IN_primary_1061 = Set[22]
1789
+ TOKENS_FOLLOWING_REF2D_IN_primary_1065 = Set[1, 23]
1790
+ TOKENS_FOLLOWING_COLON_IN_primary_1087 = Set[22]
1791
+ TOKENS_FOLLOWING_REF2D_IN_primary_1092 = Set[1]
1792
+ TOKENS_FOLLOWING_FUNC_IF_IN_primary_1135 = Set[24]
1793
+ TOKENS_FOLLOWING_LP_IN_primary_1145 = Set[12, 17, 18, 19, 20, 21, 22, 24, 27, 30, 31, 32]
1794
+ TOKENS_FOLLOWING_expr_IN_primary_1147 = Set[28, 29]
1795
+ TOKENS_FOLLOWING_set_IN_primary_1150 = Set[12, 17, 18, 19, 20, 21, 22, 24, 27, 30, 31, 32]
1796
+ TOKENS_FOLLOWING_expr_IN_primary_1176 = Set[28, 29]
1797
+ TOKENS_FOLLOWING_set_IN_primary_1179 = Set[12, 17, 18, 19, 20, 21, 22, 24, 27, 30, 31, 32]
1798
+ TOKENS_FOLLOWING_expr_IN_primary_1205 = Set[25]
1799
+ TOKENS_FOLLOWING_RP_IN_primary_1208 = Set[1]
1800
+ TOKENS_FOLLOWING_FUNC_CHOOSE_IN_primary_1226 = Set[24]
1801
+ TOKENS_FOLLOWING_LP_IN_primary_1246 = Set[12, 17, 18, 19, 20, 21, 22, 24, 27, 30, 31, 32]
1802
+ TOKENS_FOLLOWING_expr_IN_primary_1248 = Set[25, 28, 29]
1803
+ TOKENS_FOLLOWING_set_IN_primary_1283 = Set[12, 17, 18, 19, 20, 21, 22, 24, 25, 27, 28, 29, 30, 31, 32]
1804
+ TOKENS_FOLLOWING_expr_IN_primary_1345 = Set[25, 28, 29]
1805
+ TOKENS_FOLLOWING_RP_IN_primary_1423 = Set[1]
1806
+ TOKENS_FOLLOWING_NAME_IN_primary_1445 = Set[1]
1807
+ TOKENS_FOLLOWING_NAME_IN_primary_1467 = Set[24]
1808
+ TOKENS_FOLLOWING_LP_IN_primary_1487 = Set[12, 17, 18, 19, 20, 21, 22, 24, 25, 27, 30, 31, 32]
1809
+ TOKENS_FOLLOWING_expr_list_IN_primary_1493 = Set[25]
1810
+ TOKENS_FOLLOWING_RP_IN_primary_1496 = Set[1]
1811
+ TOKENS_FOLLOWING_expr_IN_expr_list_1540 = Set[1, 28, 29]
1812
+ TOKENS_FOLLOWING_set_IN_expr_list_1566 = Set[1, 12, 17, 18, 19, 20, 21, 22, 24, 27, 28, 29, 30, 31, 32]
1813
+ TOKENS_FOLLOWING_expr_IN_expr_list_1634 = Set[1, 28, 29]
1814
+ TOKENS_FOLLOWING_NAME_IN_sheet_1768 = Set[1]
1815
+ TOKENS_FOLLOWING_INT_CONST_IN_sheet_1788 = Set[1]
1816
+ TOKENS_FOLLOWING_QUOTENAME_IN_sheet_1808 = Set[1]
1760
1817
 
1761
1818
  end # class Parser < ANTLR3::Parser
1762
1819