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.



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

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

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



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

def options
  @options
end

Class Method Details

.parens(*args, &block) ⇒ Object



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

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

Instance Method Details



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

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

#to_sObject



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

def to_s
  self.to_str
end

#to_strObject



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

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