class HDLRuby::High::Value

Describes a high-level value.

Public Instance Methods

constant?() click to toggle source

Tell if the expression is constant.

# File lib/HDLRuby/hruby_high.rb, line 2894
def constant?
    # A value is a constant.
    return true
end
to_expr() click to toggle source

Converts to a new expression.

# File lib/HDLRuby/hruby_high.rb, line 2900
def to_expr
    return self.to_value
end
to_low() click to toggle source

Converts the value to HDLRuby::Low.

# File lib/HDLRuby/hruby_high.rb, line 2905
def to_low
    # Clone the content if possible
    content = self.content.frozen? ? self.content : self.content.clone
    # Create and return the resulting low-level value
    # return HDLRuby::Low::Value.new(self.type.to_low,self.content)
    valueL = HDLRuby::Low::Value.new(self.type.to_low,self.content)
    # For debugging: set the source high object
    valueL.properties[:low2high] = self.hdr_id
    self.properties[:high2low] = valueL
    return valueL
end
to_value() click to toggle source

Converts to a new value.

# File lib/HDLRuby/hruby_high.rb, line 2887
def to_value
    # # Already a value.
    # self
    return Value.new(self.type,self.content)
end
to_value?() click to toggle source

Tell if the expression can be converted to a value.

# File lib/HDLRuby/hruby_high.rb, line 2882
def to_value?
    return true
end