class SFRP::Low::Function

Constants

Param

Public Class Methods

new(static, name_str, type_str, params, stmts) click to toggle source
# File lib/sfrp/low/element.rb, line 36
def initialize(static, name_str, type_str, params, stmts)
  @static = static
  @name_str = name_str
  @type_str = type_str
  @params = params
  @stmts = stmts
end

Public Instance Methods

pretty_code() click to toggle source
# File lib/sfrp/low/element.rb, line 48
def pretty_code
  inner = @stmts.map { |s| s.pretty_code(1) + "\n" }.join
  param = @params.map { |pa| "#{pa.type_str} #{pa.var_str}" }.join(', ')
  "#{@type_str} #{@name_str}(#{param}) {\n#{inner}}"
end
pretty_code_prototype() click to toggle source
# File lib/sfrp/low/element.rb, line 54
def pretty_code_prototype
  "#{@type_str} #{@name_str}(#{@params.map(&:type_str).join(', ')});"
end
static?() click to toggle source
# File lib/sfrp/low/element.rb, line 44
def static?
  @static
end