class BOAST::Comment

@!parse module Functors; functorize Comment; end

Attributes

comment[R]

Public Class Methods

new(string) click to toggle source
# File lib/BOAST/Language/Comment.rb, line 10
def initialize(string)
  @comment = string
end

Public Instance Methods

pr() click to toggle source
# File lib/BOAST/Language/Comment.rb, line 19
def pr
  s = to_s
  output.puts s
  return self
end
to_s() click to toggle source
# File lib/BOAST/Language/Comment.rb, line 14
def to_s
  return to_s_fortran if get_lang == FORTRAN
  return to_s_c if [C,CL,CUDA].include?(get_lang)
end

Private Instance Methods

to_s_c() click to toggle source
# File lib/BOAST/Language/Comment.rb, line 33
def to_s_c
  s = ""
  @comment.each_line { |l| s << "/* #{l.delete("\n")} */\n" }
  return s
end
to_s_fortran() click to toggle source
# File lib/BOAST/Language/Comment.rb, line 27
def to_s_fortran
  s = ""
  @comment.each_line { |l| s << "! #{l}" }
  return s
end