Class: CTokenizer::Splitter

Inherits:
LexerBase show all
Defined in:
lib/dbc/ctokenizer.rb

Overview

writes tokens to some output source may not be useful…

Constant Summary

Constants included from CTokenizer

EOF_TOKEN

Instance Attribute Summary

Attributes inherited from LexerBase

#source

Instance Method Summary collapse

Methods inherited from LexerBase

#empty?, #file, #line, #match?, #post_match, #scan

Methods included from CTokenizer

check_token, #collect, #each, #error, error, line_count, #parse_error, #to_a, #token_error, #warning, whitespace?

Constructor Details

#initialize(out, source, file = nil, line = 1) ⇒ Splitter

Returns a new instance of Splitter.



311
312
313
314
# File 'lib/dbc/ctokenizer.rb', line 311

def initialize(out, source, file=nil, line=1)
	super(source, file, line)
	@out = out
end

Instance Method Details

#shiftObject



316
317
318
319
320
# File 'lib/dbc/ctokenizer.rb', line 316

def shift
	t = super
	@out << t
	t
end