class BOAST::FuncCall

@!parse module Functors; functorize FuncCall; end

Attributes

args[R]
func_name[R]
prefix[RW]

Public Class Methods

new(func_name, *args) click to toggle source
# File lib/BOAST/Language/FuncCall.rb, line 14
def initialize(func_name, *args)
  @prefix = nil
  @func_name = func_name
  if args.last.kind_of?(Hash) then
    @options = args.last
    @args = args[0..-2]
  else
    @args = args
    @options = {}
  end
  @return_type = @options[:return] ? @options[:return] : @options[:returns] if @options
end

Public Instance Methods

pr() click to toggle source
# File lib/BOAST/Language/FuncCall.rb, line 62
def pr
  s=""
  s << indent
  s << to_s
  s << ";" if [C, CL, CUDA].include?( lang )
  output.puts s
  return self
end
to_s() click to toggle source
# File lib/BOAST/Language/FuncCall.rb, line 43
def to_s
  return to_s_fortran if lang == FORTRAN
  return to_s_c if [C, CL, CUDA].include?( lang )
end
to_var() click to toggle source
# File lib/BOAST/Language/FuncCall.rb, line 31
def to_var
  if @return_type then
    if @return_type.kind_of?(Variable)
      return @return_type.copy("#{self}")
    else
      return Variable::new("#{self}", @return_type)
    end
  else
    return Variable::new("#{self}", get_default_type)
  end
end
type() click to toggle source
# File lib/BOAST/Language/FuncCall.rb, line 27
def type
  return @return_type.type if @return_type
end

Private Instance Methods

to_s_c() click to toggle source
# File lib/BOAST/Language/FuncCall.rb, line 54
def to_s_c
  s = ""
  s << @prefix if @prefix
  s << "#{func_name}(#{@args.collect(&:to_s).join(", ")})"
end
to_s_fortran() click to toggle source
# File lib/BOAST/Language/FuncCall.rb, line 48
def to_s_fortran
  s = ""
  s << @prefix if @prefix
  s << "#{func_name}(#{@args.collect(&:to_s).join(", ")})"
end