Sha256: c62a45a7e67cb23bd004f8d3f9e1379233fff3daf8331ccf8df1902e894f3f14

Contents?: true

Size: 544 Bytes

Versions: 2

Compression:

Stored size: 544 Bytes

Contents

require "rips/variables/variable"

module Rips
  module Variables
 
    class Address < Variable 

      attr_reader :syntax

      # @syntax: example syntax
      # @range: bit's range for variable
      def initialize(size = 10)
        super(size)
        @range = [0, 2**@length-1]
        @syntax = "#{@range[0]}..#{@range[1]} | label"
      end

      # Check input variable syntax
      def valid_syntax? (value)
        value.extend(Rips::Utils::StringVariableExtension)
        value.address?(@range)
      end
      
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rips-0.1.1 lib/rips/variables/address.rb
rips-0.1.0 lib/rips/variables/address.rb