Class: BOAST::OpenMP::OpenMPControlStructure

Inherits:
ControlStructure show all
Includes:
Pragma
Defined in:
lib/BOAST/Language/OpenMP.rb

Instance Attribute Summary

Attributes inherited from ControlStructure

#args

Instance Method Summary collapse

Methods included from Pragma

#openmp_end_clauses_to_s, #openmp_open_clauses_to_s, #openmp_pragma_to_s, register_clause

Methods inherited from ControlStructure

#[], inherited, token_string_generator

Methods included from Inspectable

#inspect

Methods included from PrivateStateAccessor

private_boolean_state_accessor, private_state_accessor

Constructor Details

#initialize(options = {}, &block) ⇒ OpenMPControlStructure

Returns a new instance of OpenMPControlStructure.



142
143
144
145
# File 'lib/BOAST/Language/OpenMP.rb', line 142

def initialize(options = {}, &block)
  @openmp_clauses = options
  @block = block
end

Instance Method Details

#closeObject



168
169
170
171
# File 'lib/BOAST/Language/OpenMP.rb', line 168

def close
  output.puts end_string(openmp_end_clauses_to_s) 
  return self
end

#get_stringsObject



137
138
139
140
# File 'lib/BOAST/Language/OpenMP.rb', line 137

def get_strings
  return { C => get_c_strings,
           FORTRAN => get_fortran_strings }
end

#openObject



154
155
156
157
# File 'lib/BOAST/Language/OpenMP.rb', line 154

def open
  output.puts to_s
  return self
end

#pr(*args) ⇒ Object



159
160
161
162
163
164
165
166
# File 'lib/BOAST/Language/OpenMP.rb', line 159

def pr(*args)
  open
  if @block then
    @block.call(*args)
    close
  end
  return self
end

#to_sObject



150
151
152
# File 'lib/BOAST/Language/OpenMP.rb', line 150

def to_s
  return begin_string(openmp_open_clauses_to_s)
end