Class: RubyHDL::High::VerbatimStatement
- Defined in:
- lib/HDLRuby/std/sequencer_sw.rb
Overview
Describe some statement text code to paste as is in the result.
Instance Method Summary collapse
-
#initialize(str, *args) ⇒ VerbatimStatement
constructor
Create a new verbatim with +str+ of type +type+ as main text and +args+ as arguments for the text.
-
#to_python(l = "") ⇒ Object
Convert to Python code.
-
#to_ruby ⇒ Object
Convert to Ruby code.
-
#to_tf(l = "") ⇒ Object
Convert to TensorFlow code.
Methods inherited from Statement
#each_statement, #each_statement_deep
Constructor Details
#initialize(str, *args) ⇒ VerbatimStatement
Create a new verbatim with +str+ of type +type+ as main text and +args+ as arguments for the text.
4677 4678 4679 4680 |
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 4677 def initialize(str,*args) @str = str.to_s @args = args end |
Instance Method Details
#to_python(l = "") ⇒ Object
Convert to Python code.
4688 4689 4690 |
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 4688 def to_python(l = "") return "#{l}" + @str % @args.map(&:to_python) end |
#to_ruby ⇒ Object
Convert to Ruby code.
4683 4684 4685 |
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 4683 def to_ruby return @str % @args.map(&:to_ruby) end |
#to_tf(l = "") ⇒ Object
Convert to TensorFlow code.
4693 4694 4695 |
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 4693 def to_tf(l = "") return "#{l}" + @str % @args.map(&:to_tf) end |