remove all that label stuff
left over after rewrite from blocks to linked list
This commit is contained in:
@ -15,42 +15,6 @@ module Risc
|
||||
end
|
||||
alias :inspect :to_s
|
||||
|
||||
def length( labels = [])
|
||||
ret = super(labels)
|
||||
ret += self.label.length(labels) if self.label
|
||||
ret
|
||||
end
|
||||
|
||||
def to_arr( labels = [] )
|
||||
ret = super(labels)
|
||||
ret += self.label.to_arr(labels) if self.label
|
||||
ret
|
||||
end
|
||||
|
||||
def total_byte_length labels = []
|
||||
ret = super(labels)
|
||||
ret += self.label.total_byte_length(labels) if self.label
|
||||
#puts "#{self.class.name} return #{ret}"
|
||||
ret
|
||||
end
|
||||
|
||||
# labels have the same position as their next
|
||||
def set_position( position , labels = [])
|
||||
set_position self.label.set_position( position , labels ) if self.label
|
||||
super(position,labels)
|
||||
end
|
||||
|
||||
def assemble_all( io , labels = [])
|
||||
self.assemble(io)
|
||||
self.label.assemble_all(io,labels) if self.label
|
||||
self.next.assemble_all(io, labels) if self.next
|
||||
end
|
||||
|
||||
def each_label( labels =[] , &block)
|
||||
super
|
||||
self.label.each_label(labels , &block) if self.label
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# dynamic version of an Unconditional branch that jumps to the contents
|
||||
|
@ -31,43 +31,13 @@ module Risc
|
||||
@name.split(".").length == 2
|
||||
end
|
||||
|
||||
def to_arr labels = []
|
||||
return [] if labels.include?(self)
|
||||
labels << self
|
||||
super
|
||||
end
|
||||
|
||||
def length labels = []
|
||||
return 0 if labels.include?(self)
|
||||
labels << self
|
||||
ret = 1
|
||||
ret += self.next.length(labels) if self.next
|
||||
ret
|
||||
end
|
||||
|
||||
def assemble io
|
||||
end
|
||||
|
||||
def assemble_all io , labels = []
|
||||
return if labels.include?(self) or self.next.nil?
|
||||
labels << self
|
||||
self.next.assemble_all(io,labels)
|
||||
end
|
||||
|
||||
def total_byte_length labels = []
|
||||
return 0 if labels.include?(self) or self.next.nil?
|
||||
labels << self
|
||||
ret = self.next.total_byte_length(labels)
|
||||
#puts "#{self.class.name} return #{ret}"
|
||||
ret
|
||||
end
|
||||
|
||||
# labels have the same position as their next
|
||||
def set_position position , labels = []
|
||||
return position if labels.include?(self)
|
||||
labels << self
|
||||
super(position , labels)
|
||||
self.next.set_position(position,labels) if self.next
|
||||
def set_position( position )
|
||||
super(position)
|
||||
self.next.set_position(position) if self.next
|
||||
end
|
||||
|
||||
# shame we need this, just for logging
|
||||
@ -75,12 +45,6 @@ module Risc
|
||||
0
|
||||
end
|
||||
|
||||
def each_label labels =[] , &block
|
||||
return if labels.include?(self)
|
||||
labels << self
|
||||
block.yield(self)
|
||||
super
|
||||
end
|
||||
end
|
||||
|
||||
def self.label( source , name , nekst = nil)
|
||||
|
Reference in New Issue
Block a user