Class: ZunScript::Lexer

Inherits:
ANTLR3::Lexer
  • Object
show all
Includes:
TokenData
Defined in:
ext/zunscript/lexer.rb

Defined Under Namespace

Classes: DFA7

Constant Summary collapse

RULE_NAMES =
[ "T__38", "ASSIGN", "BLOCK_LEFT", "BLOCK_RIGHT", "ARITH_SIGN", 
"BANG", "COMMENT", "BLOCK_END", "COMMA", "LPAREN", 
"RPAREN", "NONCONTROL_CHAR", "LETTER", "LOWER", "UPPER", 
"DIGIT", "SYMBOL", "FLOAT", "INTEGER", "NAME", "STRING", 
"NUMBER", "SPACE", "NEWLINE", "WHITESPACE" ].freeze
RULE_METHODS =
[ :t__38!, :assign!, :block_left!, :block_right!, :arith_sign!, 
:bang!, :comment!, :block_end!, :comma!, :lparen!, 
:rparen!, :noncontrol_char!, :letter!, :lower!, :upper!, 
:digit!, :symbol!, :float!, :integer!, :name!, :string!, 
:number!, :space!, :newline!, :whitespace! ].freeze

Instance Method Summary collapse

Constructor Details

#initialize(input = nil, options = {}) ⇒ Lexer

Returns a new instance of Lexer.



102
103
104
# File 'ext/zunscript/lexer.rb', line 102

def initialize( input=nil, options = {} )
  super( input, options )
end

Instance Method Details

#arith_sign!Object

lexer rule arith_sign! (ARITH_SIGN) (in ZunScript.g)



218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
# File 'ext/zunscript/lexer.rb', line 218

def arith_sign!
  # -> uncomment the next line to manually enable rule tracing
  # trace_in( __method__, 5 )



  type = ARITH_SIGN
  channel = ANTLR3::DEFAULT_CHANNEL
# - - - - label initialization - - - -


  # - - - - main rule block - - - -
  # at line 
  if @input.peek( 1 ).between?( 0x2a, 0x2b ) || @input.peek(1) == 0x2d || @input.peek(1) == 0x2f || @input.peek(1) == 0x5e
    @input.consume
  else
    mse = MismatchedSet( nil )
    recover mse
    raise mse

  end




  @state.type = type
  @state.channel = channel
ensure
  # -> uncomment the next line to manually enable rule tracing
  # trace_out( __method__, 5 )


end

#assign!Object

lexer rule assign! (ASSIGN) (in ZunScript.g)



137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# File 'ext/zunscript/lexer.rb', line 137

def assign!
  # -> uncomment the next line to manually enable rule tracing
  # trace_in( __method__, 2 )



  type = ASSIGN
  channel = ANTLR3::DEFAULT_CHANNEL
# - - - - label initialization - - - -


  # - - - - main rule block - - - -
  # at line 20:9: '='
  match( 0x3d )


  @state.type = type
  @state.channel = channel
ensure
  # -> uncomment the next line to manually enable rule tracing
  # trace_out( __method__, 2 )


end

#bang!Object

lexer rule bang! (BANG) (in ZunScript.g)



254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
# File 'ext/zunscript/lexer.rb', line 254

def bang!
  # -> uncomment the next line to manually enable rule tracing
  # trace_in( __method__, 6 )



  type = BANG
  channel = ANTLR3::DEFAULT_CHANNEL
# - - - - label initialization - - - -


  # - - - - main rule block - - - -
  # at line 24:7: '!'
  match( 0x21 )


  @state.type = type
  @state.channel = channel
ensure
  # -> uncomment the next line to manually enable rule tracing
  # trace_out( __method__, 6 )


end

#block_end!Object

lexer rule block_end! (BLOCK_END) (in ZunScript.g)



308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
# File 'ext/zunscript/lexer.rb', line 308

def block_end!
  # -> uncomment the next line to manually enable rule tracing
  # trace_in( __method__, 8 )



  type = BLOCK_END
  channel = ANTLR3::DEFAULT_CHANNEL
# - - - - label initialization - - - -


  # - - - - main rule block - - - -
  # at line 26:12: 'end'
  match( "end" )



  @state.type = type
  @state.channel = channel
ensure
  # -> uncomment the next line to manually enable rule tracing
  # trace_out( __method__, 8 )


end

#block_left!Object

lexer rule block_left! (BLOCK_LEFT) (in ZunScript.g)



164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# File 'ext/zunscript/lexer.rb', line 164

def block_left!
  # -> uncomment the next line to manually enable rule tracing
  # trace_in( __method__, 3 )



  type = BLOCK_LEFT
  channel = ANTLR3::DEFAULT_CHANNEL
# - - - - label initialization - - - -


  # - - - - main rule block - - - -
  # at line 21:13: '<'
  match( 0x3c )


  @state.type = type
  @state.channel = channel
ensure
  # -> uncomment the next line to manually enable rule tracing
  # trace_out( __method__, 3 )


end

#block_right!Object

lexer rule block_right! (BLOCK_RIGHT) (in ZunScript.g)



191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
# File 'ext/zunscript/lexer.rb', line 191

def block_right!
  # -> uncomment the next line to manually enable rule tracing
  # trace_in( __method__, 4 )



  type = BLOCK_RIGHT
  channel = ANTLR3::DEFAULT_CHANNEL
# - - - - label initialization - - - -


  # - - - - main rule block - - - -
  # at line 22:14: '>'
  match( 0x3e )


  @state.type = type
  @state.channel = channel
ensure
  # -> uncomment the next line to manually enable rule tracing
  # trace_out( __method__, 4 )


end

#comma!Object

lexer rule comma! (COMMA) (in ZunScript.g)



336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
# File 'ext/zunscript/lexer.rb', line 336

def comma!
  # -> uncomment the next line to manually enable rule tracing
  # trace_in( __method__, 9 )



  type = COMMA
  channel = ANTLR3::DEFAULT_CHANNEL
# - - - - label initialization - - - -


  # - - - - main rule block - - - -
  # at line 28:8: ','
  match( 0x2c )


  @state.type = type
  @state.channel = channel
ensure
  # -> uncomment the next line to manually enable rule tracing
  # trace_out( __method__, 9 )


end

#comment!Object

lexer rule comment! (COMMENT) (in ZunScript.g)



281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
# File 'ext/zunscript/lexer.rb', line 281

def comment!
  # -> uncomment the next line to manually enable rule tracing
  # trace_in( __method__, 7 )



  type = COMMENT
  channel = ANTLR3::DEFAULT_CHANNEL
# - - - - label initialization - - - -


  # - - - - main rule block - - - -
  # at line 25:10: '#'
  match( 0x23 )


  @state.type = type
  @state.channel = channel
ensure
  # -> uncomment the next line to manually enable rule tracing
  # trace_out( __method__, 7 )


end

#digit!Object

lexer rule digit! (DIGIT) (in ZunScript.g)



537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
# File 'ext/zunscript/lexer.rb', line 537

def digit!
  # -> uncomment the next line to manually enable rule tracing
  # trace_in( __method__, 16 )


# - - - - label initialization - - - -


  # - - - - main rule block - - - -
  # at line 
  if @input.peek( 1 ).between?( 0x30, 0x39 )
    @input.consume
  else
    mse = MismatchedSet( nil )
    recover mse
    raise mse

  end



ensure
  # -> uncomment the next line to manually enable rule tracing
  # trace_out( __method__, 16 )


end

#float!Object

lexer rule float! (FLOAT) (in ZunScript.g)



597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
# File 'ext/zunscript/lexer.rb', line 597

def float!
  # -> uncomment the next line to manually enable rule tracing
  # trace_in( __method__, 18 )


# - - - - label initialization - - - -


  # - - - - main rule block - - - -
  # at line 39:17: INTEGER '.' ( '0' .. '9' )+
  integer!

  match( 0x2e )
  # at file 39:29: ( '0' .. '9' )+
  match_count_1 = 0
  while true
    alt_1 = 2
    look_1_0 = @input.peek( 1 )

    if ( look_1_0.between?( 0x30, 0x39 ) )
      alt_1 = 1

    end
    case alt_1
    when 1
      # at line 
      if @input.peek( 1 ).between?( 0x30, 0x39 )
        @input.consume
      else
        mse = MismatchedSet( nil )
        recover mse
        raise mse

      end



    else
      match_count_1 > 0 and break
      eee = EarlyExit(1)


      raise eee
    end
    match_count_1 += 1
  end



ensure
  # -> uncomment the next line to manually enable rule tracing
  # trace_out( __method__, 18 )


end

#integer!Object

lexer rule integer! (INTEGER) (in ZunScript.g)



655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
# File 'ext/zunscript/lexer.rb', line 655

def integer!
  # -> uncomment the next line to manually enable rule tracing
  # trace_in( __method__, 19 )


# - - - - label initialization - - - -


  # - - - - main rule block - - - -
  # at line 40:17: ( '0' | ( '-' )? '1' .. '9' ( '0' .. '9' )* )
  alt_4 = 2
  look_4_0 = @input.peek( 1 )

  if ( look_4_0 == 0x30 )
    alt_4 = 1
  elsif ( look_4_0 == 0x2d || look_4_0.between?( 0x31, 0x39 ) )
    alt_4 = 2
  else
    raise NoViableAlternative( "", 4, 0 )

  end
  case alt_4
  when 1
    # at line 40:19: '0'
    match( 0x30 )

  when 2
    # at line 40:25: ( '-' )? '1' .. '9' ( '0' .. '9' )*
    # at line 40:25: ( '-' )?
    alt_2 = 2
    look_2_0 = @input.peek( 1 )

    if ( look_2_0 == 0x2d )
      alt_2 = 1
    end
    case alt_2
    when 1
      # at line 40:25: '-'
      match( 0x2d )

    end
    match_range( 0x31, 0x39 )
    # at line 40:39: ( '0' .. '9' )*
    while true # decision 3
      alt_3 = 2
      look_3_0 = @input.peek( 1 )

      if ( look_3_0.between?( 0x30, 0x39 ) )
        alt_3 = 1

      end
      case alt_3
      when 1
        # at line 
        if @input.peek( 1 ).between?( 0x30, 0x39 )
          @input.consume
        else
          mse = MismatchedSet( nil )
          recover mse
          raise mse

        end



      else
        break # out of loop for decision 3
      end
    end # loop for decision 3


  end
ensure
  # -> uncomment the next line to manually enable rule tracing
  # trace_out( __method__, 19 )


end

#letter!Object

lexer rule letter! (LETTER) (in ZunScript.g)



447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
# File 'ext/zunscript/lexer.rb', line 447

def letter!
  # -> uncomment the next line to manually enable rule tracing
  # trace_in( __method__, 13 )


# - - - - label initialization - - - -


  # - - - - main rule block - - - -
  # at line 
  if @input.peek( 1 ).between?( 0x41, 0x5a ) || @input.peek( 1 ).between?( 0x61, 0x7a )
    @input.consume
  else
    mse = MismatchedSet( nil )
    recover mse
    raise mse

  end



ensure
  # -> uncomment the next line to manually enable rule tracing
  # trace_out( __method__, 13 )


end

#lower!Object

lexer rule lower! (LOWER) (in ZunScript.g)



477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
# File 'ext/zunscript/lexer.rb', line 477

def lower!
  # -> uncomment the next line to manually enable rule tracing
  # trace_in( __method__, 14 )


# - - - - label initialization - - - -


  # - - - - main rule block - - - -
  # at line 
  if @input.peek( 1 ).between?( 0x61, 0x7a )
    @input.consume
  else
    mse = MismatchedSet( nil )
    recover mse
    raise mse

  end



ensure
  # -> uncomment the next line to manually enable rule tracing
  # trace_out( __method__, 14 )


end

#lparen!Object

lexer rule lparen! (LPAREN) (in ZunScript.g)



363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
# File 'ext/zunscript/lexer.rb', line 363

def lparen!
  # -> uncomment the next line to manually enable rule tracing
  # trace_in( __method__, 10 )



  type = LPAREN
  channel = ANTLR3::DEFAULT_CHANNEL
# - - - - label initialization - - - -


  # - - - - main rule block - - - -
  # at line 29:9: '('
  match( 0x28 )


  @state.type = type
  @state.channel = channel
ensure
  # -> uncomment the next line to manually enable rule tracing
  # trace_out( __method__, 10 )


end

#name!Object

lexer rule name! (NAME) (in ZunScript.g)



736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
# File 'ext/zunscript/lexer.rb', line 736

def name!
  # -> uncomment the next line to manually enable rule tracing
  # trace_in( __method__, 20 )



  type = NAME
  channel = ANTLR3::DEFAULT_CHANNEL
# - - - - label initialization - - - -


  # - - - - main rule block - - - -
  # at line 42:7: LETTER ( LETTER | DIGIT | '_' | '?' )*
  letter!

  # at line 42:14: ( LETTER | DIGIT | '_' | '?' )*
  while true # decision 5
    alt_5 = 2
    look_5_0 = @input.peek( 1 )

    if ( look_5_0.between?( 0x30, 0x39 ) || look_5_0 == 0x3f || look_5_0.between?( 0x41, 0x5a ) || look_5_0 == 0x5f || look_5_0.between?( 0x61, 0x7a ) )
      alt_5 = 1

    end
    case alt_5
    when 1
      # at line 
      if @input.peek( 1 ).between?( 0x30, 0x39 ) || @input.peek(1) == 0x3f || @input.peek( 1 ).between?( 0x41, 0x5a ) || @input.peek(1) == 0x5f || @input.peek( 1 ).between?( 0x61, 0x7a )
        @input.consume
      else
        mse = MismatchedSet( nil )
        recover mse
        raise mse

      end



    else
      break # out of loop for decision 5
    end
  end # loop for decision 5



  @state.type = type
  @state.channel = channel
ensure
  # -> uncomment the next line to manually enable rule tracing
  # trace_out( __method__, 20 )


end

#newline!Object

lexer rule newline! (NEWLINE) (in ZunScript.g)



917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
# File 'ext/zunscript/lexer.rb', line 917

def newline!
  # -> uncomment the next line to manually enable rule tracing
  # trace_in( __method__, 24 )



  type = NEWLINE
  channel = ANTLR3::DEFAULT_CHANNEL
# - - - - label initialization - - - -


  # - - - - main rule block - - - -
  # at line 47:10: ( ( '\\r' )? '\\n' )+
  # at file 47:10: ( ( '\\r' )? '\\n' )+
  match_count_9 = 0
  while true
    alt_9 = 2
    look_9_0 = @input.peek( 1 )

    if ( look_9_0 == 0xa || look_9_0 == 0xd )
      alt_9 = 1

    end
    case alt_9
    when 1
      # at line 47:11: ( '\\r' )? '\\n'
      # at line 47:11: ( '\\r' )?
      alt_8 = 2
      look_8_0 = @input.peek( 1 )

      if ( look_8_0 == 0xd )
        alt_8 = 1
      end
      case alt_8
      when 1
        # at line 47:11: '\\r'
        match( 0xd )

      end
      match( 0xa )

    else
      match_count_9 > 0 and break
      eee = EarlyExit(9)


      raise eee
    end
    match_count_9 += 1
  end




  @state.type = type
  @state.channel = channel
ensure
  # -> uncomment the next line to manually enable rule tracing
  # trace_out( __method__, 24 )


end

#noncontrol_char!Object

lexer rule noncontrol_char! (NONCONTROL_CHAR) (in ZunScript.g)



417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
# File 'ext/zunscript/lexer.rb', line 417

def noncontrol_char!
  # -> uncomment the next line to manually enable rule tracing
  # trace_in( __method__, 12 )


# - - - - label initialization - - - -


  # - - - - main rule block - - - -
  # at line 
  if @input.peek(1) == 0x9 || @input.peek( 1 ).between?( 0x20, 0x21 ) || @input.peek( 1 ).between?( 0x23, 0x7e )
    @input.consume
  else
    mse = MismatchedSet( nil )
    recover mse
    raise mse

  end



ensure
  # -> uncomment the next line to manually enable rule tracing
  # trace_out( __method__, 12 )


end

#number!Object

lexer rule number! (NUMBER) (in ZunScript.g)



848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
# File 'ext/zunscript/lexer.rb', line 848

def number!
  # -> uncomment the next line to manually enable rule tracing
  # trace_in( __method__, 22 )



  type = NUMBER
  channel = ANTLR3::DEFAULT_CHANNEL
# - - - - label initialization - - - -


  # - - - - main rule block - - - -
  # at line 44:7: ( INTEGER | FLOAT )
  alt_7 = 2
  alt_7 = @dfa7.predict( @input )
  case alt_7
  when 1
    # at line 44:9: INTEGER
    integer!


  when 2
    # at line 44:19: FLOAT
    float!


  end

  @state.type = type
  @state.channel = channel
ensure
  # -> uncomment the next line to manually enable rule tracing
  # trace_out( __method__, 22 )


end

#rparen!Object

lexer rule rparen! (RPAREN) (in ZunScript.g)



390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
# File 'ext/zunscript/lexer.rb', line 390

def rparen!
  # -> uncomment the next line to manually enable rule tracing
  # trace_in( __method__, 11 )



  type = RPAREN
  channel = ANTLR3::DEFAULT_CHANNEL
# - - - - label initialization - - - -


  # - - - - main rule block - - - -
  # at line 30:9: ')'
  match( 0x29 )


  @state.type = type
  @state.channel = channel
ensure
  # -> uncomment the next line to manually enable rule tracing
  # trace_out( __method__, 11 )


end

#space!Object

lexer rule space! (SPACE) (in ZunScript.g)



887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
# File 'ext/zunscript/lexer.rb', line 887

def space!
  # -> uncomment the next line to manually enable rule tracing
  # trace_in( __method__, 23 )


# - - - - label initialization - - - -


  # - - - - main rule block - - - -
  # at line 
  if @input.peek(1) == 0x9 || @input.peek(1) == 0x20
    @input.consume
  else
    mse = MismatchedSet( nil )
    recover mse
    raise mse

  end



ensure
  # -> uncomment the next line to manually enable rule tracing
  # trace_out( __method__, 23 )


end

#string!Object

lexer rule string! (STRING) (in ZunScript.g)



792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
# File 'ext/zunscript/lexer.rb', line 792

def string!
  # -> uncomment the next line to manually enable rule tracing
  # trace_in( __method__, 21 )



  type = STRING
  channel = ANTLR3::DEFAULT_CHANNEL
# - - - - label initialization - - - -


  # - - - - main rule block - - - -
  # at line 43:9: '\"' ( NONCONTROL_CHAR )* '\"'
  match( 0x22 )
  # at line 43:13: ( NONCONTROL_CHAR )*
  while true # decision 6
    alt_6 = 2
    look_6_0 = @input.peek( 1 )

    if ( look_6_0 == 0x9 || look_6_0.between?( 0x20, 0x21 ) || look_6_0.between?( 0x23, 0x7e ) )
      alt_6 = 1

    end
    case alt_6
    when 1
      # at line 
      if @input.peek(1) == 0x9 || @input.peek( 1 ).between?( 0x20, 0x21 ) || @input.peek( 1 ).between?( 0x23, 0x7e )
        @input.consume
      else
        mse = MismatchedSet( nil )
        recover mse
        raise mse

      end



    else
      break # out of loop for decision 6
    end
  end # loop for decision 6

  match( 0x22 )


  @state.type = type
  @state.channel = channel
ensure
  # -> uncomment the next line to manually enable rule tracing
  # trace_out( __method__, 21 )


end

#symbol!Object

lexer rule symbol! (SYMBOL) (in ZunScript.g)



567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
# File 'ext/zunscript/lexer.rb', line 567

def symbol!
  # -> uncomment the next line to manually enable rule tracing
  # trace_in( __method__, 17 )


# - - - - label initialization - - - -


  # - - - - main rule block - - - -
  # at line 
  if @input.peek(1) == 0x21 || @input.peek( 1 ).between?( 0x23, 0x2f ) || @input.peek( 1 ).between?( 0x3a, 0x40 ) || @input.peek( 1 ).between?( 0x5b, 0x60 ) || @input.peek( 1 ).between?( 0x7b, 0x7e )
    @input.consume
  else
    mse = MismatchedSet( nil )
    recover mse
    raise mse

  end



ensure
  # -> uncomment the next line to manually enable rule tracing
  # trace_out( __method__, 17 )


end

#t__38!Object

                      • lexer rules - - - - - - - - - - - -

lexer rule t__38! (T__38) (in ZunScript.g)



110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'ext/zunscript/lexer.rb', line 110

def t__38!
  # -> uncomment the next line to manually enable rule tracing
  # trace_in( __method__, 1 )



  type = T__38
  channel = ANTLR3::DEFAULT_CHANNEL
# - - - - label initialization - - - -


  # - - - - main rule block - - - -
  # at line 7:9: '.'
  match( 0x2e )


  @state.type = type
  @state.channel = channel
ensure
  # -> uncomment the next line to manually enable rule tracing
  # trace_out( __method__, 1 )


end

#token!Object

main rule used to study the input at the current position, and choose the proper lexer rule to call in order to fetch the next token

usually, you don’t make direct calls to this method, but instead use the next_token method, which will build and emit the actual next token



1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
# File 'ext/zunscript/lexer.rb', line 1053

def token!
  # at line 1:8: ( T__38 | ASSIGN | BLOCK_LEFT | BLOCK_RIGHT | ARITH_SIGN | BANG | COMMENT | BLOCK_END | COMMA | LPAREN | RPAREN | NAME | STRING | NUMBER | NEWLINE | WHITESPACE )
  alt_11 = 16
  case look_11 = @input.peek( 1 )
  when 0x2e then alt_11 = 1
  when 0x3d then alt_11 = 2
  when 0x3c then alt_11 = 3
  when 0x3e then alt_11 = 4
  when 0x2d then look_11_5 = @input.peek( 2 )

  if ( look_11_5.between?( 0x31, 0x39 ) )
    alt_11 = 14
  else
    alt_11 = 5

  end
  when 0x21 then alt_11 = 6
  when 0x23 then alt_11 = 7
  when 0x65 then look_11_8 = @input.peek( 2 )

  if ( look_11_8 == 0x6e )
    look_11_18 = @input.peek( 3 )

    if ( look_11_18 == 0x64 )
      look_11_19 = @input.peek( 4 )

      if ( look_11_19.between?( 0x30, 0x39 ) || look_11_19 == 0x3f || look_11_19.between?( 0x41, 0x5a ) || look_11_19 == 0x5f || look_11_19.between?( 0x61, 0x7a ) )
        alt_11 = 12
      else
        alt_11 = 8

      end
    else
      alt_11 = 12

    end
  else
    alt_11 = 12

  end
  when 0x2c then alt_11 = 9
  when 0x28 then alt_11 = 10
  when 0x29 then alt_11 = 11
  when 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x61, 0x62, 0x63, 0x64, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a then alt_11 = 12
  when 0x22 then alt_11 = 13
  when 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39 then alt_11 = 14
  when 0x2a, 0x2b, 0x2f, 0x5e then alt_11 = 5
  when 0xa, 0xd then alt_11 = 15
  when 0x9, 0x20 then alt_11 = 16
  else
    raise NoViableAlternative( "", 11, 0 )

  end
  case alt_11
  when 1
    # at line 1:10: T__38
    t__38!


  when 2
    # at line 1:16: ASSIGN
    assign!


  when 3
    # at line 1:23: BLOCK_LEFT
    block_left!


  when 4
    # at line 1:34: BLOCK_RIGHT
    block_right!


  when 5
    # at line 1:46: ARITH_SIGN
    arith_sign!


  when 6
    # at line 1:57: BANG
    bang!


  when 7
    # at line 1:62: COMMENT
    comment!


  when 8
    # at line 1:70: BLOCK_END
    block_end!


  when 9
    # at line 1:80: COMMA
    comma!


  when 10
    # at line 1:86: LPAREN
    lparen!


  when 11
    # at line 1:93: RPAREN
    rparen!


  when 12
    # at line 1:100: NAME
    name!


  when 13
    # at line 1:105: STRING
    string!


  when 14
    # at line 1:112: NUMBER
    number!


  when 15
    # at line 1:119: NEWLINE
    newline!


  when 16
    # at line 1:127: WHITESPACE
    whitespace!


  end
end

#upper!Object

lexer rule upper! (UPPER) (in ZunScript.g)



507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
# File 'ext/zunscript/lexer.rb', line 507

def upper!
  # -> uncomment the next line to manually enable rule tracing
  # trace_in( __method__, 15 )


# - - - - label initialization - - - -


  # - - - - main rule block - - - -
  # at line 
  if @input.peek( 1 ).between?( 0x41, 0x5a )
    @input.consume
  else
    mse = MismatchedSet( nil )
    recover mse
    raise mse

  end



ensure
  # -> uncomment the next line to manually enable rule tracing
  # trace_out( __method__, 15 )


end

#whitespace!Object

lexer rule whitespace! (WHITESPACE) (in ZunScript.g)



982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
# File 'ext/zunscript/lexer.rb', line 982

def whitespace!
  # -> uncomment the next line to manually enable rule tracing
  # trace_in( __method__, 25 )



  type = WHITESPACE
  channel = ANTLR3::DEFAULT_CHANNEL
# - - - - label initialization - - - -


  # - - - - main rule block - - - -
  # at line 48:13: ( SPACE )+
  # at file 48:13: ( SPACE )+
  match_count_10 = 0
  while true
    alt_10 = 2
    look_10_0 = @input.peek( 1 )

    if ( look_10_0 == 0x9 || look_10_0 == 0x20 )
      alt_10 = 1

    end
    case alt_10
    when 1
      # at line 
      if @input.peek(1) == 0x9 || @input.peek(1) == 0x20
        @input.consume
      else
        mse = MismatchedSet( nil )
        recover mse
        raise mse

      end



    else
      match_count_10 > 0 and break
      eee = EarlyExit(10)


      raise eee
    end
    match_count_10 += 1
  end



  # --> action
   channel = HIDDEN; 
  # <-- action



  @state.type = type
  @state.channel = channel
ensure
  # -> uncomment the next line to manually enable rule tracing
  # trace_out( __method__, 25 )


end