2017-01-14 19:28:44 +02:00
|
|
|
module Vm
|
2016-12-09 13:56:13 +02:00
|
|
|
module Tree
|
|
|
|
class WhileStatement < Statement
|
|
|
|
attr_accessor :branch_type , :condition , :statements
|
2016-12-23 21:31:31 +02:00
|
|
|
def to_s
|
|
|
|
str = "while_#{branch_type}(#{condition}) do\n"
|
2016-12-28 14:11:05 +02:00
|
|
|
str + statements.to_s + "\nend\n"
|
2016-12-23 21:31:31 +02:00
|
|
|
end
|
2016-12-09 13:56:13 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|