Class: Furnace::AVM2::Tokens::DoWhileToken
- Inherits:
-
Code::NonterminalToken
- Object
- Code::NonterminalToken
- Furnace::AVM2::Tokens::DoWhileToken
- Defined in:
- lib/furnace-avm2/source/implementation_tokens/do_while_token.rb
Instance Method Summary collapse
-
#initialize(origin, body, condition, options = {}) ⇒ DoWhileToken
constructor
A new instance of DoWhileToken.
- #to_structure(options = {}) ⇒ Object
- #to_text ⇒ Object
Constructor Details
#initialize(origin, body, condition, options = {}) ⇒ DoWhileToken
Returns a new instance of DoWhileToken.
3 4 5 6 |
# File 'lib/furnace-avm2/source/implementation_tokens/do_while_token.rb', line 3 def initialize(origin, body, condition, ={}) super(origin, [body, condition], ) @condition, @body = condition, body end |
Instance Method Details
#to_structure(options = {}) ⇒ Object
12 13 14 |
# File 'lib/furnace-avm2/source/implementation_tokens/do_while_token.rb', line 12 def to_structure(={}) structurize "do ... while(...)", end |
#to_text ⇒ Object
8 9 10 |
# File 'lib/furnace-avm2/source/implementation_tokens/do_while_token.rb', line 8 def to_text "do #{@body.to_text}while(#{@condition.to_text});\n" end |