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