removed blocks and moved to labels

somewhat easier to understand the code as a linked list
relatively painless change, considering
This commit is contained in:
Torsten Ruger
2015-10-23 21:27:36 +03:00
parent f1f56f0d4e
commit 57f37ec023
22 changed files with 281 additions and 370 deletions

View File

@ -6,14 +6,22 @@ module Register
def initialize source , to
super(source)
raise "No block" unless to
@block = to
@label = to
end
attr_reader :block
attr_reader :label
def to_s
"#{self.class.name}: #{block.name}"
"#{self.class.name}: #{label.name}"
end
alias :inspect :to_s
def length labels = []
super(labels) + self.label.length(labels)
end
def to_ac labels = []
super(labels) + self.label.to_ac(labels)
end
end
class IsZero < Branch