lib/antlr4/runtime/lexer.rb in antlr4-runtime-0.2.3 vs lib/antlr4/runtime/lexer.rb in antlr4-runtime-0.2.4
- old
+ new
@@ -53,12 +53,20 @@
@_mode_stack = []
reset
@_factory = CommonTokenFactory.instance
end
+ def token_factory
+ @_factory
+ end
+
+ def token_factory=(factory)
+ @_factory = factory
+ end
+
def next_token
if @_input.nil?
- raise IllegalStateException, 'nextToken requires a non-nil input stream.'
+ raise IllegalStateException, 'next_token requires a non-nil input stream.'
end
# Mark start location in char stream so unbuffered streams are
# guaranteed at least have text of current token
token_start_marker = @_input.mark