Method: ANTLR3::CommonTokenStream#each

Defined in:
lib/antlr3/streams.rb

#each(*args) ⇒ Object

yields each token in the stream (including off-channel tokens) If no block is provided, the method returns an Enumerator object. #each accepts the same arguments as #tokens



996
997
998
999
# File 'lib/antlr3/streams.rb', line 996

def each( *args )
  block_given? or return enum_for( :each, *args )
  tokens( *args ).each { |token| yield( token ) }
end