Method: ANTLR3::InteractiveStringStream#initialize
- Defined in:
-
lib/antlr3/streams/interactive.rb,
lib/antlr3/streams/interactive.rb
creates a new StringStream object where data is the string data to stream. accepts the following options in a symbol-to-value hash:
the (file) name to associate with the stream; default: '(string)'
the initial line number; default: 1
the initial column number; default: 0
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/antlr3/streams/interactive.rb', line 24 def initialize( = {}, &block ) # for 1.9 @string = '' @data = [] @position = .fetch :position, 0 @line = .fetch :line, 1 @column = .fetch :column, 0 @markers = [] mark @initialized = @eof = false @readline = block or raise( ArgumentError, "no line-reading block was provided" ) @name ||= [ :file ] || [ :name ] || '(interactive)' end |