start simple with code listner
This commit is contained in:
@ -8,7 +8,7 @@ module Risc
|
||||
# At the end of the list the propagation spills into the next methods
|
||||
# binary and so on
|
||||
#
|
||||
class CodePosition < ObjectPosition
|
||||
class CodeListener
|
||||
|
||||
attr_reader :code , :method
|
||||
|
||||
@ -61,6 +61,18 @@ module Risc
|
||||
return nekst if nekst.methods
|
||||
return next_type(nekst)
|
||||
end
|
||||
def self.init( code , at = -1)
|
||||
while code
|
||||
position = ObjectPosition.new(code , at)
|
||||
Position.set_to(position , at)
|
||||
if code.next
|
||||
listener = ObjectListener.new(code.next)
|
||||
position.register_event(:position_changed , listener)
|
||||
end
|
||||
at += code.padded_length unless at < 0
|
||||
code = code.next
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -74,4 +74,4 @@ end
|
||||
require_relative "object_position"
|
||||
require_relative "object_listener"
|
||||
require_relative "instruction_position"
|
||||
require_relative "code_position"
|
||||
require_relative "code_listener"
|
||||
|
Reference in New Issue
Block a user