Class: ZergXcode::Lexer
- Inherits:
-
Object
- Object
- ZergXcode::Lexer
- Defined in:
- lib/zerg_xcode/file_format/lexer.rb
Overview
Lexer for flattened object graphs stored in .xcodeproj files.
Constant Summary collapse
- SIMPLE_TOKENS =
[ '(', ')', '{', '}', '=', ';', ',' ]
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(string) ⇒ Lexer
constructor
A new instance of Lexer.
- #tokenize ⇒ Object
Constructor Details
#initialize(string) ⇒ Lexer
Returns a new instance of Lexer.
16 17 18 |
# File 'lib/zerg_xcode/file_format/lexer.rb', line 16 def initialize(string) @scan_buffer = ScanBuffer.new(string) end |
Class Method Details
Instance Method Details
#tokenize ⇒ Object
20 21 22 23 24 |
# File 'lib/zerg_xcode/file_format/lexer.rb', line 20 def tokenize tokens, token = [], nil tokens << token until (token = scan_token).nil? tokens end |