Class: HDLRuby::Low::RefThis
- Inherits:
-
Ref
- Object
- Expression
- Ref
- HDLRuby::Low::RefThis
- Defined in:
- lib/HDLRuby/hruby_low.rb,
lib/HDLRuby/hruby_low2c.rb,
lib/HDLRuby/hruby_low2hdr.rb,
lib/HDLRuby/hruby_low2vhd.rb,
lib/HDLRuby/hruby_verilog.rb,
lib/HDLRuby/hruby_low2high.rb,
lib/HDLRuby/hruby_low_mutable.rb,
lib/HDLRuby/hruby_low_skeleton.rb,
lib/HDLRuby/hruby_low_fix_types.rb,
lib/HDLRuby/hruby_low_bool2select.rb,
lib/HDLRuby/hruby_low_casts_without_expression.rb
Overview
Describes a this reference.
This is the current system.
Direct Known Subclasses
Constant Summary
Constants included from Low2Symbol
Low2Symbol::Low2SymbolPrefix, Low2Symbol::Low2SymbolTable, Low2Symbol::Symbol2LowTable
Instance Attribute Summary
Attributes inherited from Expression
Attributes included from Hparent
Instance Method Summary collapse
-
#boolean_in_assign2select ⇒ Object
Converts booleans in assignments to select operators.
-
#casts_without_expression! ⇒ Object
Extracts the expressions from the casts.
-
#clone ⇒ Object
Clones this.
-
#each_deep(&ruby_block) ⇒ Object
Iterates over each object deeply.
-
#eql?(obj) ⇒ Boolean
Comparison for hash: structural comparison.
-
#explicit_types(type = nil) ⇒ Object
Explicit the types conversions in the index ref where +type+ is the expected type of the condition if any.
-
#hash ⇒ Object
Hash function.
-
#map_nodes!(&ruby_block) ⇒ Object
(also: #map_expressions!)
Maps on the children.
-
#to_another_verilog ⇒ Object
Enhances RefThis with generation of verilog code.
-
#to_c(res, level = 0, left = false) ⇒ Object
Generates the C text of the equivalent HDLRuby code.
-
#to_c_signal(res, level = 0) ⇒ Object
Generates the C text for reference as left value to a signal.
-
#to_hdr(level = 0) ⇒ Object
Generates the text of the equivalent hdr text.
-
#to_high ⇒ Object
Creates a new high ref this.
Methods inherited from Ref
#each_node, #each_node_deep, #path_each, #resolve, #to_vhdl
Methods inherited from Expression
#boolean?, #break_types!, #each_node, #each_node_deep, #each_ref_deep, #extract_selects_to!, #immutable?, #initialize, #leftvalue?, #replace_expressions!, #replace_names!, #rightvalue?, #set_type!, #signal2subs!, #statement, #to_c_expr, #to_vhdl, #use_name?
Methods included from Low2Symbol
Methods included from Hparent
#hierarchy, #no_parent!, #scope
Constructor Details
This class inherits a constructor from HDLRuby::Low::Expression
Instance Method Details
#boolean_in_assign2select ⇒ Object
Converts booleans in assignments to select operators.
353 354 355 356 |
# File 'lib/HDLRuby/hruby_low_bool2select.rb', line 353 def boolean_in_assign2select # Simply clone. return self.clone end |
#casts_without_expression! ⇒ Object
Extracts the expressions from the casts.
368 369 370 371 372 |
# File 'lib/HDLRuby/hruby_low_casts_without_expression.rb', line 368 def casts_without_expression! # # Simply clone. # return self.clone return self end |
#clone ⇒ Object
Clones this.
6138 6139 6140 |
# File 'lib/HDLRuby/hruby_low.rb', line 6138 def clone return RefThis.new end |
#each_deep(&ruby_block) ⇒ Object
Iterates over each object deeply.
Returns an enumerator if no ruby block is given.
6128 6129 6130 6131 6132 6133 6134 6135 |
# File 'lib/HDLRuby/hruby_low.rb', line 6128 def each_deep(&ruby_block) # No ruby block? Return an enumerator. return to_enum(:each_deep) unless ruby_block # A ruby block? First apply it to current. ruby_block.call(self) # Then apply on the type. self.type.each_deep(&ruby_block) end |
#eql?(obj) ⇒ Boolean
Comparison for hash: structural comparison.
6143 6144 6145 |
# File 'lib/HDLRuby/hruby_low.rb', line 6143 def eql?(obj) return obj.is_a?(RefThis) end |
#explicit_types(type = nil) ⇒ Object
Explicit the types conversions in the index ref where +type+ is the expected type of the condition if any.
499 500 501 502 |
# File 'lib/HDLRuby/hruby_low_fix_types.rb', line 499 def explicit_types(type = nil) # Simply duplicate. return self.clone end |
#hash ⇒ Object
Hash function.
6148 6149 6150 |
# File 'lib/HDLRuby/hruby_low.rb', line 6148 def hash return super end |
#map_nodes!(&ruby_block) ⇒ Object Also known as: map_expressions!
Maps on the children.
1932 1933 1934 |
# File 'lib/HDLRuby/hruby_low_mutable.rb', line 1932 def map_nodes!(&ruby_block) # Nothing to do. end |
#to_another_verilog ⇒ Object
Enhances RefThis with generation of verilog code.
1815 1816 1817 |
# File 'lib/HDLRuby/hruby_verilog.rb', line 1815 def to_another_verilog return "" end |
#to_c(res, level = 0, left = false) ⇒ Object
Generates the C text of the equivalent HDLRuby code. +level+ is the hierachical level of the object and +left+ tells if it is a left value or not. def to_c(level = 0, left = false)
3152 3153 3154 3155 3156 |
# File 'lib/HDLRuby/hruby_low2c.rb', line 3152 def to_c(res,level = 0, left = false) # return "this()" res << "this()" return res end |
#to_c_signal(res, level = 0) ⇒ Object
Generates the C text for reference as left value to a signal. +level+ is the hierarchical level of the object. def to_c_signal(level = 0)
3161 3162 3163 3164 3165 |
# File 'lib/HDLRuby/hruby_low2c.rb', line 3161 def to_c_signal(res,level = 0) # return "this()" res << "this()" return res end |
#to_hdr(level = 0) ⇒ Object
Generates the text of the equivalent hdr text. +level+ is the hierachical level of the object.
748 749 750 |
# File 'lib/HDLRuby/hruby_low2hdr.rb', line 748 def to_hdr(level = 0) return "" end |