Class: CTokenizer::LexerBase
- Inherits:
-
Object
- Object
- CTokenizer::LexerBase
- Includes:
- CTokenizer
- Defined in:
- lib/dbc/ctokenizer.rb
Overview
wraps a lexer and uses that to produce new tokens
Direct Known Subclasses
CLexer, CPLexer, SkipMacros, Splitter, DBC::Cache, DBC::Parser, Preprocessor::Parser
Instance Method Summary collapse
- #empty? ⇒ Boolean
- #file ⇒ Object
-
#initialize(str, file = nil, line = 1) ⇒ LexerBase
constructor
A new instance of LexerBase.
- #line ⇒ Object
- #shift ⇒ Object
Methods included from CTokenizer
check_string, check_token, #collect, create_newlines, #each, error, #error, join, line_count, #parse_error, split, split_token, #to_a, #token_error, #warning
Constructor Details
Instance Method Details
#empty? ⇒ Boolean
237 238 239 |
# File 'lib/dbc/ctokenizer.rb', line 237 def empty? @source.empty? end |
#file ⇒ Object
224 225 226 |
# File 'lib/dbc/ctokenizer.rb', line 224 def file @source.file end |
#line ⇒ Object
227 228 229 |
# File 'lib/dbc/ctokenizer.rb', line 227 def line @source.line end |
#shift ⇒ Object
231 232 233 234 235 |
# File 'lib/dbc/ctokenizer.rb', line 231 def shift t = @source.shift CTokenizer.check_token(t) t end |