2015-09-18 20:55:02 +02:00
|
|
|
class Ifi
|
|
|
|
int ofthen(int n)
|
|
|
|
if(0)
|
|
|
|
isit = 42
|
|
|
|
else
|
|
|
|
maybenot = 667
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
-- -- --
|
2015-09-19 16:11:15 +02:00
|
|
|
s(:expressions,
|
|
|
|
s(:class, :Ifi,
|
|
|
|
s(:derives, nil),
|
|
|
|
s(:function, :int,
|
|
|
|
s(:name, :ofthen),
|
|
|
|
s(:parameters,
|
2015-09-20 11:56:06 +02:00
|
|
|
s(:parameter, :int, :n)),
|
2015-09-19 16:11:15 +02:00
|
|
|
s(:expressions,
|
|
|
|
s(:if,
|
|
|
|
s(:condition,
|
|
|
|
s(:int, 0)),
|
|
|
|
s(:if_true,
|
|
|
|
s(:assign,
|
|
|
|
s(:name, :isit),
|
|
|
|
s(:int, 42))),
|
|
|
|
s(:if_false,
|
|
|
|
s(:assign,
|
|
|
|
s(:name, :maybenot),
|
|
|
|
s(:int, 667))))))))
|