Class: BOAST::Pragma

Inherits:
Object
  • Object
show all
Extended by:
Functor
Includes:
Inspectable, PrivateStateAccessor
Defined in:
lib/BOAST/Pragma.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Functor

extended

Methods included from Inspectable

#inspect

Methods included from PrivateStateAccessor

private_boolean_state_accessor, private_state_accessor

Constructor Details

#initialize(name, options) ⇒ Pragma

Returns a new instance of Pragma.



11
12
13
14
# File 'lib/BOAST/Pragma.rb', line 11

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

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/BOAST/Pragma.rb', line 8

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



9
10
11
# File 'lib/BOAST/Pragma.rb', line 9

def options
  @options
end

Instance Method Details

#prObject



29
30
31
32
33
34
# File 'lib/BOAST/Pragma.rb', line 29

def pr
  s=""
  s += to_s
  output.puts s
  return self
end

#to_sObject



16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/BOAST/Pragma.rb', line 16

def to_s
  s = ""
  if lang == FORTRAN then
    s += "$!"
  else
    s += "#pragma"
  end
  @options.each{ |opt|
    s += " #{opt}"
  }
  return s
end