class HDLRuby::Low::Operation

Describes an operation.

NOTE: this is an abstract class which is not to be used directly.

Describes an operation.

NOTE: this is an abstract class which is not to be used directly.

Extends the Operation class with generation of C text.

Extends the Operation class with generation of hdr text.

Add the conversion to high.

Extends the Operation class with generation of HDLRuby::High text.

Extends the Operation class with fixing of types and constants.

Describes an operation.

NOTE: this is an abstract class which is not to be used directly.

Attributes

operator[R]

The operator of the operation.

Public Class Methods

new(type,operator) click to toggle source

Creates a new operation with type applying operator. def initialize(operator)

Calls superclass method
# File lib/HDLRuby/hruby_low.rb, line 4641
def initialize(type,operator)
    super(type)
    # Check and set the operator.
    @operator = operator.to_sym
end

Public Instance Methods

eql?(obj) click to toggle source

Comparison for hash: structural comparison.

Calls superclass method
# File lib/HDLRuby/hruby_low.rb, line 4648
def eql?(obj)
    # General comparison.
    return false unless super(obj)
    # Specific comparison.
    return false unless obj.is_a?(Operation)
    return false unless @operator.eql?(obj.operator)
    return true
end
explicit_types(type = nil) click to toggle source

Explicit the types conversions in the operation where type is the expected type of the condition if any.

# File lib/HDLRuby/hruby_low_fix_types.rb, line 239
def explicit_types(type = nil)
    raise "Should implement explicit_types for class #{self.class}."
end
hash() click to toggle source

Hash function.

Calls superclass method
# File lib/HDLRuby/hruby_low.rb, line 4658
def hash
    return [super,@operator].hash
end
set_operator!(operator) click to toggle source

Sets the operator.

# File lib/HDLRuby/hruby_low_mutable.rb, line 1432
def set_operator!(operator)
    # Check and set the operator.
    @operator = operator.to_sym
end
to_c(level = 0) click to toggle source

Generates the C text of the equivalent HDLRuby code. level is the hierachical level of the object.

# File lib/HDLRuby/hruby_low2c.rb, line 1643
def to_c(level = 0)
    # Should never be here.
    raise AnyError, "Internal error: to_c should be implemented in class :#{self.class}"
end
to_hdr(level = 0) click to toggle source

Generates the text of the equivalent hdr text. level is the hierachical level of the object.

# File lib/HDLRuby/hruby_low2hdr.rb, line 578
def to_hdr(level = 0)
    # Should never be here.
    raise AnyError, "Internal error: to_high should be implemented in class :#{self.class}"
end
to_vhdl(level = 0) click to toggle source

Generates the text of the equivalent HDLRuby::High code. level is the hierachical level of the object.

# File lib/HDLRuby/hruby_low2vhd.rb, line 1236
def to_vhdl(level = 0)
    # Should never be here.
    raise AnyError, "Internal error: to_vhdl should be implemented in class :#{self.class}"
end