Class: TypeProf::Core::ConstReadBox

Inherits:
Box
  • Object
show all
Defined in:
lib/typeprof/core/graph/box.rb

Instance Attribute Summary collapse

Attributes inherited from Box

#changes, #destroyed

Instance Method Summary collapse

Methods inherited from Box

#destroy, #diagnostics, #on_type_added, #on_type_removed, #reuse, #run, #to_s

Constructor Details

#initialize(node, genv, const_read) ⇒ ConstReadBox

Returns a new instance of ConstReadBox.



60
61
62
63
64
65
66
# File 'lib/typeprof/core/graph/box.rb', line 60

def initialize(node, genv, const_read)
  super(node)
  @const_read = const_read
  const_read.followers << self
  @ret = Vertex.new(node)
  genv.add_run(self)
end

Instance Attribute Details

#const_readObject (readonly)

Returns the value of attribute const_read.



68
69
70
# File 'lib/typeprof/core/graph/box.rb', line 68

def const_read
  @const_read
end

#nodeObject (readonly)

Returns the value of attribute node.



68
69
70
# File 'lib/typeprof/core/graph/box.rb', line 68

def node
  @node
end

#retObject (readonly)

Returns the value of attribute ret.



68
69
70
# File 'lib/typeprof/core/graph/box.rb', line 68

def ret
  @ret
end

Instance Method Details

#run0(genv, changes) ⇒ Object



70
71
72
73
74
75
76
# File 'lib/typeprof/core/graph/box.rb', line 70

def run0(genv, changes)
  cdef = @const_read.cdef
  if cdef
    changes.add_depended_value_entity(cdef)
    changes.add_edge(genv, cdef.vtx, @ret)
  end
end