Class: AdLint::StringLexer
- Inherits:
-
Object
- Object
- AdLint::StringLexer
- Defined in:
- lib/adlint/lexer.rb
Overview
DESCRIPTION
Base class of the lexical analyzer of the string.
Direct Known Subclasses
Instance Method Summary collapse
-
#execute ⇒ Object
DESCRIPTION Executes the lexical analysis.
-
#initialize(str) ⇒ StringLexer
constructor
DESCRIPTION Constructs a lexical analyzer of the string.
Constructor Details
#initialize(str) ⇒ StringLexer
DESCRIPTION
Constructs a lexical analyzer of the string.
PARAMETER
- str
-
String – Target string.
231 232 233 |
# File 'lib/adlint/lexer.rb', line 231 def initialize(str) @str = str end |
Instance Method Details
#execute ⇒ Object
DESCRIPTION
Executes the lexical analysis.
RETURN VALUE
TokenArray – Scanned tokens.
240 241 242 243 244 245 246 247 248 249 250 251 |
# File 'lib/adlint/lexer.rb', line 240 def execute lexer_ctxt = create_lexer_context(@str) tokenize(lexer_ctxt) rescue Error raise rescue => ex if lexer_ctxt raise InternalError.new(ex, lexer_ctxt.location) else raise InternalError.new(ex, nil) end end |