Class: Ikra::Translator::ArrayCommandStructBuilder
- Inherits:
-
Symbolic::Visitor
- Object
- Symbolic::Visitor
- Ikra::Translator::ArrayCommandStructBuilder
- Defined in:
- lib/translator/array_command_struct_builder.rb
Defined Under Namespace
Classes: RequireRuntimeSizeChecker, SingleStructBuilder
Instance Attribute Summary collapse
-
#all_structs ⇒ Object
readonly
Returns the value of attribute all_structs.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ ArrayCommandStructBuilder
constructor
A new instance of ArrayCommandStructBuilder.
- #visit_array_command(command) ⇒ Object
Methods inherited from Symbolic::Visitor
#visit_array_combine_command, #visit_array_host_section_command, #visit_array_identity_command, #visit_array_in_host_section_command, #visit_array_index_command, #visit_array_reduce_command, #visit_array_select_command, #visit_array_stencil_command, #visit_array_zip_command, #visit_fixed_size_array_in_host_section_command
Constructor Details
#initialize ⇒ ArrayCommandStructBuilder
Returns a new instance of ArrayCommandStructBuilder.
146 147 148 149 |
# File 'lib/translator/array_command_struct_builder.rb', line 146 def initialize @all_structs = [] @builder = SingleStructBuilder.new end |
Instance Attribute Details
#all_structs ⇒ Object (readonly)
Returns the value of attribute all_structs.
144 145 146 |
# File 'lib/translator/array_command_struct_builder.rb', line 144 def all_structs @all_structs end |
Class Method Details
.build_all_structs(command) ⇒ Object
156 157 158 159 160 |
# File 'lib/translator/array_command_struct_builder.rb', line 156 def self.build_all_structs(command) visitor = self.new command.accept(visitor) return visitor.all_structs end |
.struct_name(command) ⇒ Object
41 42 43 |
# File 'lib/translator/array_command_struct_builder.rb', line 41 def self.struct_name(command) return "array_command_#{command.unique_id}" end |
Instance Method Details
#visit_array_command(command) ⇒ Object
151 152 153 154 |
# File 'lib/translator/array_command_struct_builder.rb', line 151 def visit_array_command(command) super @all_structs.push(command.accept(@builder)) end |