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
The operator of the operation.
Public Class Methods
Creates a new operation with type
applying operator
. def initialize(operator)
# 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
Comparison for hash: structural comparison.
# 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 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
function.
# File lib/HDLRuby/hruby_low.rb, line 4658 def hash return [super,@operator].hash end
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
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
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
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