fix util namespace

and instruction move ripples
This commit is contained in:
Torsten Ruger
2018-03-26 20:05:30 +03:00
parent c5b3c3f106
commit 4cc1d8455e
7 changed files with 45 additions and 53 deletions

View File

@@ -20,9 +20,9 @@ module Risc
# Labels are the only valid branch targets
#
class Instruction
include Common::List
include Util::List
def initialize source , nekst = nil
def initialize( source , nekst = nil )
@source = source
@next = nekst
return unless source
@@ -40,22 +40,6 @@ module Risc
translator.translate( self )
end
def total_byte_length
ret = 0
self.each{|ins| ret += ins.byte_length}
ret
end
def set_position( position )
Positioned.set_position(self,position)
position += byte_length
if self.next
self.next.set_position( position )
else
position
end
end
def class_source( derived)
"#{self.class.name.split("::").last}: #{derived} #{source_mini}"
end