Class: RubyHDL::High::VerbatimExpression

Inherits:
Expression
  • Object
show all
Defined in:
lib/HDLRuby/std/sequencer_sw.rb

Overview

Describe some expression text code to paste as is in the result.

Instance Attribute Summary

Attributes inherited from Expression

#type

Instance Method Summary collapse

Methods inherited from Expression

#<=, #[], #heach, #mux, #sdownto, #seach, #stimes, #supto, #to_c, #to_expr, #to_value

Methods included from HEnumerable

#hall?, #hany?, #hchain, #hchunk, #hchunk_while, #hcompact, #hcount, #hcycle, #hdrop, #hdrop_while, #heach_cons, #heach_entry, #heach_range, #heach_slice, #heach_with_index, #heach_with_object, #hfind, #hfind_index, #hfirst, #hflat_map, #hgrep, #hgrep_v, #hgroup_by, #hinclude?, #hinject, #hlazy, #hmap, #hmax, #hmax_by, #hmin, #hmin_by, #hminmax, #hminmax_by, #hnone?, #hone?, #hpartition, #hreduce, #hreject, #hreverse_each, #hselect, #hslice_after, #hslice_before, #hslice_when, #hsort, #hsort_by, #hsum, #htake, #htake_while, #htally, #hto_a, #hto_h, #huniq, #hzip

Constructor Details

#initialize(type, str, *args) ⇒ VerbatimExpression

Create a new verbatim with +str+ of type +type+ as main text and +args+ as arguments for the text.



4705
4706
4707
4708
4709
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 4705

def initialize(type,str,*args)
  @type = type.to_type
  @str = str.to_s
  @args = args
end

Instance Method Details

#to_python(l = "") ⇒ Object

Convert to Python code.



4717
4718
4719
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 4717

def to_python(l = "")
  return "#{l}" + @str % @args.map(&:to_python)
end

#to_rubyObject

Convert to Ruby code.



4712
4713
4714
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 4712

def to_ruby
  return @str % @args.map(&:to_ruby)
end

#to_tf(l = "") ⇒ Object

Convert to TensorFlow code.



4722
4723
4724
# File 'lib/HDLRuby/std/sequencer_sw.rb', line 4722

def to_tf(l = "")
  return "#{l}" + @str % @args.map(&:to_tf)
end