Class: RubyHDL::High::Unary
- Inherits:
-
Expression
- Object
- Expression
- RubyHDL::High::Unary
- Defined in:
- lib/HDLRuby/std/sequencer_sw.rb
Overview
Describes the software implementation of an unary operation.
Instance Attribute Summary
Attributes inherited from Expression
Instance Method Summary collapse
-
#initialize(type, operator, child) ⇒ Unary
constructor
Create a new unary operation with +type+ data type, operator +operator+ and operand +child+.
-
#to_ruby ⇒ Object
Convert to ruby code.
Methods inherited from Expression
#<=, #[], #mux, #sdownto, #seach, #stimes, #supto, #to_expr, #to_value
Constructor Details
#initialize(type, operator, child) ⇒ Unary
Create a new unary operation with +type+ data type, operator +operator+ and operand +child+
1723 1724 1725 1726 1727 |
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 1723 def initialize(type,operator,child) super(type) @operator = operator.to_sym @child = child.to_expr end |
Instance Method Details
#to_ruby ⇒ Object
Convert to ruby code.
1730 1731 1732 |
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 1730 def to_ruby return RUBY_OPERATOR[@operator] % @child.to_ruby end |