2018-07-19 13:59:10 +02:00
|
|
|
module Ruby
|
|
|
|
module Named
|
|
|
|
attr_reader :name
|
|
|
|
def initialize name
|
|
|
|
@name = name
|
|
|
|
end
|
|
|
|
def each(&block)
|
|
|
|
end
|
2018-07-20 13:22:26 +02:00
|
|
|
def to_vool
|
|
|
|
vool_brother.new(@name)
|
|
|
|
end
|
2018-07-19 13:59:10 +02:00
|
|
|
end
|
|
|
|
|
2018-07-20 09:05:11 +02:00
|
|
|
class LocalVariable < Statement
|
2018-07-19 13:59:10 +02:00
|
|
|
include Named
|
|
|
|
def to_s
|
|
|
|
name.to_s
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2018-07-20 09:05:11 +02:00
|
|
|
class InstanceVariable < Statement
|
2018-07-19 13:59:10 +02:00
|
|
|
include Named
|
|
|
|
# used to collect type information
|
|
|
|
def add_ivar( array )
|
|
|
|
array << @name
|
|
|
|
end
|
|
|
|
def to_s
|
|
|
|
"@#{name}"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2018-07-20 09:05:11 +02:00
|
|
|
class ClassVariable < Statement
|
2018-07-19 13:59:10 +02:00
|
|
|
include Named
|
|
|
|
end
|
|
|
|
|
2018-07-20 09:05:11 +02:00
|
|
|
class ModuleName < Statement
|
2018-07-19 13:59:10 +02:00
|
|
|
include Named
|
|
|
|
end
|
|
|
|
end
|