Class: Tracksperanto::ShakeGrammar::Lexer
- Inherits:
-
Object
- Object
- Tracksperanto::ShakeGrammar::Lexer
- Defined in:
- lib/import/shake_grammar/lexer.rb
Overview
Since Shake uses a C-like language for it’s scripts we rig up a very sloppy but concise C-like lexer to cope
Direct Known Subclasses
Instance Attribute Summary collapse
-
#stack ⇒ Object
readonly
Returns the value of attribute stack.
Instance Method Summary collapse
-
#initialize(with_io) ⇒ Lexer
constructor
A new instance of Lexer.
Constructor Details
#initialize(with_io) ⇒ Lexer
Returns a new instance of Lexer.
8 9 10 11 12 |
# File 'lib/import/shake_grammar/lexer.rb', line 8 def initialize(with_io) @io, @stack, @buf = with_io, [], '' parse until (@io.eof? || @stop) in_comment? ? consume_comment("\n") : consume_atom! end |
Instance Attribute Details
#stack ⇒ Object (readonly)
Returns the value of attribute stack.
6 7 8 |
# File 'lib/import/shake_grammar/lexer.rb', line 6 def stack @stack end |