Class: BOAST::Pragma

Inherits:
Object show all
Defined in:
lib/BOAST/Algorithm.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, options) ⇒ Pragma

Returns a new instance of Pragma.



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

def initialize(name, options)
  @name = name
  @options = options
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



165
166
167
# File 'lib/BOAST/Algorithm.rb', line 165

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



166
167
168
# File 'lib/BOAST/Algorithm.rb', line 166

def options
  @options
end

Class Method Details

.parens(*args, &block) ⇒ Object



161
162
163
# File 'lib/BOAST/Algorithm.rb', line 161

def self.parens(*args,&block)
  return self::new(*args,&block)
end

Instance Method Details



190
191
192
193
194
195
# File 'lib/BOAST/Algorithm.rb', line 190

def print(final = true)
  s=""
  s += self.to_str
  BOAST::get_output.puts s if final
  return s
end

#to_sObject



173
174
175
# File 'lib/BOAST/Algorithm.rb', line 173

def to_s
  self.to_str
end

#to_strObject



177
178
179
180
181
182
183
184
185
186
187
188
# File 'lib/BOAST/Algorithm.rb', line 177

def to_str
  s = ""
  if BOAST::get_lang == FORTRAN then
    s += "$!"
  else
    s += "#pragma"
  end
  @options.each{ |opt|
    s += " #{opt}"
  }
  return s
end