class Metasm::C::Array::AryRecorder

this class is a hack to support [1 … 4] array initializer it stores the effects of subsequent initializers (eg [1 … 4].toto.bla[2 … 57] = 12) which are later played back on the range

Attributes

log[RW]

Public Class Methods

new() click to toggle source
# File metasm/parse_c.rb, line 681
def initialize
        @log = []
end

Public Instance Methods

[](idx) click to toggle source
# File metasm/parse_c.rb, line 690
def [](idx)
        @log[idx]
end
[]=(idx, val) click to toggle source
# File metasm/parse_c.rb, line 685
def []=(idx, val)
        val = self.class.new if val == []
        @log[idx] = val
end
playback(ary=[]) click to toggle source
# File metasm/parse_c.rb, line 701
def playback(ary=[])
        @log.each_with_index { |v, i| ary[i] = playback_idx(i) }
        ary
end
playback_idx(i) click to toggle source
# File metasm/parse_c.rb, line 694
def playback_idx(i)
        case v = @log[i]
        when self.class; v.playback
        else v
        end
end