Class: MarshalParser::Lexer
- Inherits:
-
Object
- Object
- MarshalParser::Lexer
- Defined in:
- lib/marshal-parser/lexer.rb
Defined Under Namespace
Classes: Token
Instance Attribute Summary collapse
-
#tokens ⇒ Object
readonly
Returns the value of attribute tokens.
Instance Method Summary collapse
-
#initialize(source_string) ⇒ Lexer
constructor
A new instance of Lexer.
- #run ⇒ Object
- #source_string ⇒ Object
Constructor Details
#initialize(source_string) ⇒ Lexer
Returns a new instance of Lexer.
44 45 46 47 |
# File 'lib/marshal-parser/lexer.rb', line 44 def initialize(source_string) @dump = source_string @tokens = [] end |
Instance Attribute Details
#tokens ⇒ Object (readonly)
Returns the value of attribute tokens.
42 43 44 |
# File 'lib/marshal-parser/lexer.rb', line 42 def tokens @tokens end |
Instance Method Details
#run ⇒ Object
49 50 51 52 53 54 55 |
# File 'lib/marshal-parser/lexer.rb', line 49 def run @index = 0 @tokens = [] read_version read end |
#source_string ⇒ Object
57 58 59 |
# File 'lib/marshal-parser/lexer.rb', line 57 def source_string @dump end |