Class: ANTLR3::Template::GroupFile::Lexer

Inherits:
Lexer show all
Includes:
TokenData
Defined in:
lib/antlr3/template/group-file-lexer.rb

Defined Under Namespace

Classes: DFA12

Constant Summary collapse

RULE_NAMES =
[ "T__10", "T__11", "T__12", "T__13", "T__14", "T__15", 
"T__16", "T__17", "T__18", "T__19", "CONSTANT", "ID", 
"TEMPLATE", "STRING", "COMMENT", "WS" ].freeze
RULE_METHODS =
[ :t__10!, :t__11!, :t__12!, :t__13!, :t__14!, :t__15!, 
:t__16!, :t__17!, :t__18!, :t__19!, :constant!, :id!, 
:template!, :string!, :comment!, :ws! ].freeze

Constants included from Constants

Constants::BUILT_IN_TOKEN_NAMES, Constants::DEFAULT, Constants::DOWN, Constants::EOF, Constants::EOF_TOKEN, Constants::EOR_TOKEN_TYPE, Constants::HIDDEN, Constants::INVALID, Constants::INVALID_TOKEN, Constants::MEMO_RULE_FAILED, Constants::MEMO_RULE_UNKNOWN, Constants::MIN_TOKEN_TYPE, Constants::SKIP_TOKEN, Constants::UP

Instance Attribute Summary

Attributes inherited from Recognizer

#input, #state

Attributes included from ANTLR3::TokenFactory

#token_class

Instance Method Summary collapse

Methods inherited from Lexer

associated_parser, #char_stream=, #character_error_display, #character_index, #column, #current_symbol, default_rule, #emit, #error_message, #exhaust, #line, main, #match, #match_any, #match_range, #next_token, #recover, #report_error, #skip, #source_name, #text, #text=

Methods included from ANTLR3::TokenSource

#each, #next, #to_stream

Methods inherited from Recognizer

Scope, #already_parsed_rule?, #antlr_version, #antlr_version_string, #backtrack, #backtracking?, #backtracking_level, #backtracking_level=, #begin_resync, #combine_follows, #compute_context_sensitive_rule_follow, #compute_error_recovery_set, #consume_until, #current_symbol, debug?, define_return_scope, #display_recognition_error, #each_delegate, #emit_error_message, #end_resync, #error_header, #error_message, generic_return_scope, #grammar_file_name, imported_grammars, master, master_grammars, #match, #match_any, #memoize, #mismatch_is_missing_token?, #mismatch_is_unwanted_token?, #missing_symbol, #number_of_syntax_errors, profile?, #recover, #recover_from_mismatched_element, #recover_from_mismatched_set, #recover_from_mismatched_token, #report_error, #reset, #resync, return_scope_members, #rule_memoization, rules, #syntactic_predicate?, #syntax_errors?, token_class, #token_error_display, #trace_in, #trace_out

Methods included from ANTLR3::TokenFactory

#create_token

Methods included from Error

EarlyExit, FailedPredicate, MismatchedNotSet, MismatchedRange, MismatchedSet, MismatchedToken, MismatchedTreeNode, MissingToken, NoViableAlternative, RewriteCardinalityError, RewriteEarlyExit, RewriteEmptyStream, UnwantedToken

Constructor Details

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

Returns a new instance of Lexer.


105
106
107
108
# File 'lib/antlr3/template/group-file-lexer.rb', line 105

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

end

Instance Method Details

#comment!Object

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


647
648
649
650
651
652
653
654
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
733
734
735
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
# File 'lib/antlr3/template/group-file-lexer.rb', line 647

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

  type = COMMENT
  channel = ANTLR3::DEFAULT_CHANNEL

  
  # - - - - main rule block - - - -
  # at line 146:3: ( ( '#' | '//' ) (~ '\\n' )* | '/*' ( . )* '*/' )
  alt_10 = 2
  look_10_0 = @input.peek( 1 )

  if ( look_10_0 == 0x23 )
    alt_10 = 1
  elsif ( look_10_0 == 0x2f )
    look_10_2 = @input.peek( 2 )

    if ( look_10_2 == 0x2f )
      alt_10 = 1
    elsif ( look_10_2 == 0x2a )
      alt_10 = 2
    else
      raise NoViableAlternative( "", 10, 2 )
    end
  else
    raise NoViableAlternative( "", 10, 0 )
  end
  case alt_10
  when 1
    # at line 146:5: ( '#' | '//' ) (~ '\\n' )*
    # at line 146:5: ( '#' | '//' )
    alt_7 = 2
    look_7_0 = @input.peek( 1 )

    if ( look_7_0 == 0x23 )
      alt_7 = 1
    elsif ( look_7_0 == 0x2f )
      alt_7 = 2
    else
      raise NoViableAlternative( "", 7, 0 )
    end
    case alt_7
    when 1
      # at line 146:7: '#'
      match( 0x23 )

    when 2
      # at line 146:13: '//'
      match( "//" )

    end
    # at line 146:20: (~ '\\n' )*
    while true # decision 8
      alt_8 = 2
      look_8_0 = @input.peek( 1 )

      if ( look_8_0.between?( 0x0, 0x9 ) || look_8_0.between?( 0xb, 0xffff ) )
        alt_8 = 1

      end
      case alt_8
      when 1
        # at line 146:20: ~ '\\n'
        if @input.peek( 1 ).between?( 0x0, 0x9 ) || @input.peek( 1 ).between?( 0xb, 0xff )
          @input.consume
        else
          mse = MismatchedSet( nil )
          recover mse
          raise mse
        end



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

  when 2
    # at line 147:5: '/*' ( . )* '*/'
    match( "/*" )
    # at line 147:10: ( . )*
    while true # decision 9
      alt_9 = 2
      look_9_0 = @input.peek( 1 )

      if ( look_9_0 == 0x2a )
        look_9_1 = @input.peek( 2 )

        if ( look_9_1 == 0x2f )
          alt_9 = 2
        elsif ( look_9_1.between?( 0x0, 0x2e ) || look_9_1.between?( 0x30, 0xffff ) )
          alt_9 = 1

        end
      elsif ( look_9_0.between?( 0x0, 0x29 ) || look_9_0.between?( 0x2b, 0xffff ) )
        alt_9 = 1

      end
      case alt_9
      when 1
        # at line 147:10: .
        match_any

      else
        break # out of loop for decision 9
      end
    end # loop for decision 9
    match( "*/" )

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

end

#constant!Object

lexer rule constant! (CONSTANT) (in GroupFile.g)


354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
# File 'lib/antlr3/template/group-file-lexer.rb', line 354

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

  type = CONSTANT
  channel = ANTLR3::DEFAULT_CHANNEL

  
  # - - - - main rule block - - - -
  # at line 125:5: 'A' .. 'Z' ( 'a' .. 'z' | '_' | 'A' .. 'Z' | '0' .. '9' )*
  match_range( 0x41, 0x5a )
  # at line 125:14: ( 'a' .. 'z' | '_' | 'A' .. 'Z' | '0' .. '9' )*
  while true # decision 1
    alt_1 = 2
    look_1_0 = @input.peek( 1 )

    if ( look_1_0.between?( 0x30, 0x39 ) || look_1_0.between?( 0x41, 0x5a ) || look_1_0 == 0x5f || look_1_0.between?( 0x61, 0x7a ) )
      alt_1 = 1

    end
    case alt_1
    when 1
      # at line 
      if @input.peek( 1 ).between?( 0x30, 0x39 ) || @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 1
    end
  end # loop for decision 1

  
  @state.type = type
  @state.channel = channel

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

end

#id!Object

lexer rule id! (ID) (in GroupFile.g)


404
405
406
407
408
409
410
411
412
413
414
415
416
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
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
# File 'lib/antlr3/template/group-file-lexer.rb', line 404

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

  type = ID
  channel = ANTLR3::DEFAULT_CHANNEL

  
  # - - - - main rule block - - - -
  # at line 129:5: ( 'a' .. 'z' | '_' ) ( 'a' .. 'z' | '_' | 'A' .. 'Z' | '0' .. '9' )*
  if @input.peek(1) == 0x5f || @input.peek( 1 ).between?( 0x61, 0x7a )
    @input.consume
  else
    mse = MismatchedSet( nil )
    recover mse
    raise mse
  end


  # at line 130:5: ( 'a' .. 'z' | '_' | 'A' .. 'Z' | '0' .. '9' )*
  while true # decision 2
    alt_2 = 2
    look_2_0 = @input.peek( 1 )

    if ( look_2_0.between?( 0x30, 0x39 ) || look_2_0.between?( 0x41, 0x5a ) || look_2_0 == 0x5f || look_2_0.between?( 0x61, 0x7a ) )
      alt_2 = 1

    end
    case alt_2
    when 1
      # at line 
      if @input.peek( 1 ).between?( 0x30, 0x39 ) || @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 2
    end
  end # loop for decision 2

  
  @state.type = type
  @state.channel = channel

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

end

#string!Object

lexer rule string! (STRING) (in GroupFile.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
564
565
566
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
594
595
596
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
# File 'lib/antlr3/template/group-file-lexer.rb', line 537

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

  type = STRING
  channel = ANTLR3::DEFAULT_CHANNEL

  
  # - - - - main rule block - - - -
  # at line 140:3: ( '\"' (~ ( '\\\\' | '\"' ) | '\\\\' . )* '\"' | '\\'' (~ ( '\\\\' | '\\'' ) | '\\\\' . )* '\\'' )
  alt_6 = 2
  look_6_0 = @input.peek( 1 )

  if ( look_6_0 == 0x22 )
    alt_6 = 1
  elsif ( look_6_0 == 0x27 )
    alt_6 = 2
  else
    raise NoViableAlternative( "", 6, 0 )
  end
  case alt_6
  when 1
    # at line 140:5: '\"' (~ ( '\\\\' | '\"' ) | '\\\\' . )* '\"'
    match( 0x22 )
    # at line 140:10: (~ ( '\\\\' | '\"' ) | '\\\\' . )*
    while true # decision 4
      alt_4 = 3
      look_4_0 = @input.peek( 1 )

      if ( look_4_0.between?( 0x0, 0x21 ) || look_4_0.between?( 0x23, 0x5b ) || look_4_0.between?( 0x5d, 0xffff ) )
        alt_4 = 1
      elsif ( look_4_0 == 0x5c )
        alt_4 = 2

      end
      case alt_4
      when 1
        # at line 140:12: ~ ( '\\\\' | '\"' )
        if @input.peek( 1 ).between?( 0x0, 0x21 ) || @input.peek( 1 ).between?( 0x23, 0x5b ) || @input.peek( 1 ).between?( 0x5d, 0xff )
          @input.consume
        else
          mse = MismatchedSet( nil )
          recover mse
          raise mse
        end



      when 2
        # at line 140:31: '\\\\' .
        match( 0x5c )
        match_any

      else
        break # out of loop for decision 4
      end
    end # loop for decision 4
    match( 0x22 )

  when 2
    # at line 141:5: '\\'' (~ ( '\\\\' | '\\'' ) | '\\\\' . )* '\\''
    match( 0x27 )
    # at line 141:10: (~ ( '\\\\' | '\\'' ) | '\\\\' . )*
    while true # decision 5
      alt_5 = 3
      look_5_0 = @input.peek( 1 )

      if ( look_5_0.between?( 0x0, 0x26 ) || look_5_0.between?( 0x28, 0x5b ) || look_5_0.between?( 0x5d, 0xffff ) )
        alt_5 = 1
      elsif ( look_5_0 == 0x5c )
        alt_5 = 2

      end
      case alt_5
      when 1
        # at line 141:12: ~ ( '\\\\' | '\\'' )
        if @input.peek( 1 ).between?( 0x0, 0x26 ) || @input.peek( 1 ).between?( 0x28, 0x5b ) || @input.peek( 1 ).between?( 0x5d, 0xff )
          @input.consume
        else
          mse = MismatchedSet( nil )
          recover mse
          raise mse
        end



      when 2
        # at line 141:31: '\\\\' .
        match( 0x5c )
        match_any

      else
        break # out of loop for decision 5
      end
    end # loop for decision 5
    match( 0x27 )

  end
  
  @state.type = type
  @state.channel = channel

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

end

#t__10!Object

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

lexer rule t__10! (T__10) (in GroupFile.g)


114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/antlr3/template/group-file-lexer.rb', line 114

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

  type = T__10
  channel = ANTLR3::DEFAULT_CHANNEL

  
  # - - - - main rule block - - - -
  # at line 16:9: 'group'
  match( "group" )

  
  @state.type = type
  @state.channel = channel

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

end

#t__11!Object

lexer rule t__11! (T__11) (in GroupFile.g)


138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/antlr3/template/group-file-lexer.rb', line 138

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

  type = T__11
  channel = ANTLR3::DEFAULT_CHANNEL

  
  # - - - - main rule block - - - -
  # at line 17:9: '::'
  match( "::" )

  
  @state.type = type
  @state.channel = channel

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

end

#t__12!Object

lexer rule t__12! (T__12) (in GroupFile.g)


162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# File 'lib/antlr3/template/group-file-lexer.rb', line 162

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

  type = T__12
  channel = ANTLR3::DEFAULT_CHANNEL

  
  # - - - - main rule block - - - -
  # at line 18:9: ';'
  match( 0x3b )

  
  @state.type = type
  @state.channel = channel

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

end

#t__13!Object

lexer rule t__13! (T__13) (in GroupFile.g)


186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
# File 'lib/antlr3/template/group-file-lexer.rb', line 186

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

  type = T__13
  channel = ANTLR3::DEFAULT_CHANNEL

  
  # - - - - main rule block - - - -
  # at line 19:9: '::='
  match( "::=" )

  
  @state.type = type
  @state.channel = channel

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

end

#t__14!Object

lexer rule t__14! (T__14) (in GroupFile.g)


210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
# File 'lib/antlr3/template/group-file-lexer.rb', line 210

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

  type = T__14
  channel = ANTLR3::DEFAULT_CHANNEL

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

  
  @state.type = type
  @state.channel = channel

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

end

#t__15!Object

lexer rule t__15! (T__15) (in GroupFile.g)


234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
# File 'lib/antlr3/template/group-file-lexer.rb', line 234

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

  type = T__15
  channel = ANTLR3::DEFAULT_CHANNEL

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

  
  @state.type = type
  @state.channel = channel

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

end

#t__16!Object

lexer rule t__16! (T__16) (in GroupFile.g)


258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
# File 'lib/antlr3/template/group-file-lexer.rb', line 258

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

  type = T__16
  channel = ANTLR3::DEFAULT_CHANNEL

  
  # - - - - main rule block - - - -
  # at line 22:9: ','
  match( 0x2c )

  
  @state.type = type
  @state.channel = channel

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

end

#t__17!Object

lexer rule t__17! (T__17) (in GroupFile.g)


282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
# File 'lib/antlr3/template/group-file-lexer.rb', line 282

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

  type = T__17
  channel = ANTLR3::DEFAULT_CHANNEL

  
  # - - - - main rule block - - - -
  # at line 23:9: '*'
  match( 0x2a )

  
  @state.type = type
  @state.channel = channel

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

end

#t__18!Object

lexer rule t__18! (T__18) (in GroupFile.g)


306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
# File 'lib/antlr3/template/group-file-lexer.rb', line 306

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

  type = T__18
  channel = ANTLR3::DEFAULT_CHANNEL

  
  # - - - - main rule block - - - -
  # at line 24:9: '&'
  match( 0x26 )

  
  @state.type = type
  @state.channel = channel

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

end

#t__19!Object

lexer rule t__19! (T__19) (in GroupFile.g)


330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
# File 'lib/antlr3/template/group-file-lexer.rb', line 330

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

  type = T__19
  channel = ANTLR3::DEFAULT_CHANNEL

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

  
  @state.type = type
  @state.channel = channel

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

end

#template!Object

lexer rule template! (TEMPLATE) (in GroupFile.g)


462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
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
504
505
506
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 'lib/antlr3/template/group-file-lexer.rb', line 462

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

  type = TEMPLATE
  channel = ANTLR3::DEFAULT_CHANNEL

  
  # - - - - main rule block - - - -
  # at line 134:5: '<<<' ( options {greedy=false; } : '\\\\' . | . )* '>>>'
  match( "<<<" )
  # at line 135:5: ( options {greedy=false; } : '\\\\' . | . )*
  while true # decision 3
    alt_3 = 3
    look_3_0 = @input.peek( 1 )

    if ( look_3_0 == 0x3e )
      look_3_1 = @input.peek( 2 )

      if ( look_3_1 == 0x3e )
        look_3_4 = @input.peek( 3 )

        if ( look_3_4 == 0x3e )
          alt_3 = 3
        elsif ( look_3_4.between?( 0x0, 0x3d ) || look_3_4.between?( 0x3f, 0xffff ) )
          alt_3 = 2

        end
      elsif ( look_3_1.between?( 0x0, 0x3d ) || look_3_1.between?( 0x3f, 0xffff ) )
        alt_3 = 2

      end
    elsif ( look_3_0 == 0x5c )
      look_3_2 = @input.peek( 2 )

      if ( look_3_2 == 0x3e )
        alt_3 = 1
      elsif ( look_3_2 == 0x5c )
        alt_3 = 1
      elsif ( look_3_2.between?( 0x0, 0x3d ) || look_3_2.between?( 0x3f, 0x5b ) || look_3_2.between?( 0x5d, 0xffff ) )
        alt_3 = 1

      end
    elsif ( look_3_0.between?( 0x0, 0x3d ) || look_3_0.between?( 0x3f, 0x5b ) || look_3_0.between?( 0x5d, 0xffff ) )
      alt_3 = 2

    end
    case alt_3
    when 1
      # at line 135:35: '\\\\' .
      match( 0x5c )
      match_any

    when 2
      # at line 135:44: .
      match_any

    else
      break # out of loop for decision 3
    end
  end # loop for decision 3
  match( ">>>" )

  
  @state.type = type
  @state.channel = channel

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

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


837
838
839
840
841
842
843
844
845
846
847
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
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
# File 'lib/antlr3/template/group-file-lexer.rb', line 837

def token!
  # at line 1:8: ( T__10 | T__11 | T__12 | T__13 | T__14 | T__15 | T__16 | T__17 | T__18 | T__19 | CONSTANT | ID | TEMPLATE | STRING | COMMENT | WS )
  alt_12 = 16
  alt_12 = @dfa12.predict( @input )
  case alt_12
  when 1
    # at line 1:10: T__10
    t__10!

  when 2
    # at line 1:16: T__11
    t__11!

  when 3
    # at line 1:22: T__12
    t__12!

  when 4
    # at line 1:28: T__13
    t__13!

  when 5
    # at line 1:34: T__14
    t__14!

  when 6
    # at line 1:40: T__15
    t__15!

  when 7
    # at line 1:46: T__16
    t__16!

  when 8
    # at line 1:52: T__17
    t__17!

  when 9
    # at line 1:58: T__18
    t__18!

  when 10
    # at line 1:64: T__19
    t__19!

  when 11
    # at line 1:70: CONSTANT
    constant!

  when 12
    # at line 1:79: ID
    id!

  when 13
    # at line 1:82: TEMPLATE
    template!

  when 14
    # at line 1:91: STRING
    string!

  when 15
    # at line 1:98: COMMENT
    comment!

  when 16
    # at line 1:106: WS
    ws!

  end
end

#ws!Object

lexer rule ws! (WS) (in GroupFile.g)


773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
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
# File 'lib/antlr3/template/group-file-lexer.rb', line 773

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

  type = WS
  channel = ANTLR3::DEFAULT_CHANNEL

  
  # - - - - main rule block - - - -
  # at line 151:5: ( ' ' | '\\t' | '\\n' | '\\r' | '\\f' )+
  # at file 151:5: ( ' ' | '\\t' | '\\n' | '\\r' | '\\f' )+
  match_count_11 = 0
  while true
    alt_11 = 2
    look_11_0 = @input.peek( 1 )

    if ( look_11_0.between?( 0x9, 0xa ) || look_11_0.between?( 0xc, 0xd ) || look_11_0 == 0x20 )
      alt_11 = 1

    end
    case alt_11
    when 1
      # at line 
      if @input.peek( 1 ).between?( 0x9, 0xa ) || @input.peek( 1 ).between?( 0xc, 0xd ) || @input.peek(1) == 0x20
        @input.consume
      else
        mse = MismatchedSet( nil )
        recover mse
        raise mse
      end



    else
      match_count_11 > 0 and break
      eee = EarlyExit(11)


      raise eee
    end
    match_count_11 += 1
  end

  # --> action
   skip 
  # <-- action

  
  @state.type = type
  @state.channel = channel

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

end