Class: HDLRuby::Low::RefThis
- Inherits:
-
Ref
- Object
- Base::Expression
- Expression
- Ref
- HDLRuby::Low::RefThis
- Defined in:
- lib/HDLRuby/hruby_db.rb,
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
Extends the RefThis class with functionality for converting booleans in assignments to select operators.
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
Maps on the children.
- #to_another_verilog ⇒ Object
-
#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!, #statement, #to_c_expr, #to_vhdl, #use_name?
Methods included from Low2Symbol
Methods included from Hparent
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.
339 340 341 342 |
# File 'lib/HDLRuby/hruby_low_bool2select.rb', line 339 def boolean_in_assign2select # Simply clone. return self.clone end |
#casts_without_expression! ⇒ Object
Extracts the expressions from the casts.
356 357 358 359 360 |
# File 'lib/HDLRuby/hruby_low_casts_without_expression.rb', line 356 def casts_without_expression! # # Simply clone. # return self.clone return self end |
#clone ⇒ Object
Clones this.
5906 5907 5908 |
# File 'lib/HDLRuby/hruby_low.rb', line 5906 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.
5896 5897 5898 5899 5900 5901 5902 5903 |
# File 'lib/HDLRuby/hruby_low.rb', line 5896 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.
5911 5912 5913 |
# File 'lib/HDLRuby/hruby_low.rb', line 5911 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.
467 468 469 470 |
# File 'lib/HDLRuby/hruby_low_fix_types.rb', line 467 def explicit_types(type = nil) # Simply duplicate. return self.clone end |
#hash ⇒ Object
Hash function.
5916 5917 5918 |
# File 'lib/HDLRuby/hruby_low.rb', line 5916 def hash return super end |
#map_nodes!(&ruby_block) ⇒ Object
Maps on the children.
1970 1971 1972 |
# File 'lib/HDLRuby/hruby_low_mutable.rb', line 1970 def map_nodes!(&ruby_block) # Nothing to do. end |
#to_another_verilog ⇒ Object
1686 1687 1688 |
# File 'lib/HDLRuby/hruby_verilog.rb', line 1686 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)
2935 2936 2937 2938 2939 |
# File 'lib/HDLRuby/hruby_low2c.rb', line 2935 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)
2944 2945 2946 2947 2948 |
# File 'lib/HDLRuby/hruby_low2c.rb', line 2944 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.
723 724 725 |
# File 'lib/HDLRuby/hruby_low2hdr.rb', line 723 def to_hdr(level = 0) return "" end |