Module: MetaCL::DSL::DataDefinitions

Included in:
Root
Defined in:
lib/metacl/dsl/data_definitions.rb

Instance Method Summary collapse

Instance Method Details

#array(name, type, length, options = {}) ⇒ Object



12
13
14
15
16
# File 'lib/metacl/dsl/data_definitions.rb', line 12

def array(name, type, length, options = {})
  @program.resources.add_array name, length, type

  @inner_code << Templates::InitArray.render(name, type, length, options[:fill_with], @program.platform) << "\n\n"
end

#matrix(name, type, size_n, size_m, options = {}) ⇒ Object



18
19
20
21
22
# File 'lib/metacl/dsl/data_definitions.rb', line 18

def matrix(name, type, size_n, size_m, options = {})
  @program.resources.add_matrix name, size_n, size_m, type

  @inner_code << Templates::InitMatrix.render(name, type, size_n, size_m, options[:fill_with], @program.platform) << "\n\n"
end

#numeric(name, type, options = {}) ⇒ Object



5
6
7
8
9
10
# File 'lib/metacl/dsl/data_definitions.rb', line 5

def numeric(name, type, options = {})
  value = options[:value]
  @program.resources.add_numeric name, type

  @inner_code << Templates::InitNumeric.render(name, type, value, @program.platform) << "\n\n"
end