Class: ClassHDL::HDLAssignBlock
- Inherits:
-
Object
- Object
- ClassHDL::HDLAssignBlock
- Defined in:
- lib/tdl/class_hdl/hdl_assign.rb
Instance Attribute Summary collapse
-
#opertor_chains ⇒ Object
Returns the value of attribute opertor_chains.
Instance Method Summary collapse
-
#initialize ⇒ HDLAssignBlock
constructor
A new instance of HDLAssignBlock.
- #instance ⇒ Object
Constructor Details
#initialize ⇒ HDLAssignBlock
Returns a new instance of HDLAssignBlock.
7 8 9 |
# File 'lib/tdl/class_hdl/hdl_assign.rb', line 7 def initialize @opertor_chains = [] end |
Instance Attribute Details
#opertor_chains ⇒ Object
Returns the value of attribute opertor_chains.
5 6 7 |
# File 'lib/tdl/class_hdl/hdl_assign.rb', line 5 def opertor_chains @opertor_chains end |
Instance Method Details
#instance ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/tdl/class_hdl/hdl_assign.rb', line 11 def instance str = [] opertor_chains.each do |op| unless op.slaver sub_str = op.instance(:assign) # if sub_str =~ /^(?<head>[\w\.\[\]\:]+\s*)(?<eq><?=\s*)\((?<body>.+)\)$/ # rel_str = $~[:head] + $~[:eq] + $~[:body] # else # rel_str = sub_str # end rel_str = ClassHDL.compact_op_ch(sub_str) str << "assign " + rel_str + ";\n" end end str.join("") end |