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
- SIMPLE_TOKENS =
[ '(', ')', '{', '}', '=', ';', ',' ]
Class Method Summary (collapse)
Instance Method Summary (collapse)
-
- (Lexer) initialize(string)
constructor
A new instance of Lexer.
- - (Object) tokenize
Constructor Details
- (Lexer) initialize(string)
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
+ (Object) tokenize(string)
124 125 126 |
# File 'lib/zerg_xcode/file_format/lexer.rb', line 124 def self.tokenize(string) Lexer.new(string).tokenize end |
Instance Method Details
- (Object) tokenize
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 |