Class: ClassHDL::BlockCASEDEFAULT
- Defined in:
- lib/tdl/class_hdl/hdl_block_ifelse.rb
Instance Attribute Summary
Attributes inherited from BlockIF
#cond, #opertor_chains, #slaver
Instance Method Summary collapse
Methods inherited from BlockIF
Constructor Details
This class inherits a constructor from ClassHDL::BlockIF
Instance Method Details
#instance(as_type = :cond) ⇒ Object
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 |
# File 'lib/tdl/class_hdl/hdl_block_ifelse.rb', line 128 def instance(as_type= :cond) head_str = "default:begin " sub_str = [] opertor_chains.each do |oc| unless oc.is_a? BlockIF unless oc.slaver sub_str.push " #{oc.instance(as_type)};" end else sub_str.push( oc.instance(as_type).gsub(/^./){ |m| " #{m}"} ) end end return "#{head_str}\n#{sub_str.join("\n")}\nend" end |