Class: RLSL::Prism::IR::FunctionDefinition

Inherits:
Node
  • Object
show all
Defined in:
lib/rlsl/prism/ir/definitions.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#type

Instance Method Summary collapse

Methods inherited from Node

#accept, visits

Constructor Details

#initialize(name, params, body, return_type: nil, param_types: {}) ⇒ FunctionDefinition

Returns a new instance of FunctionDefinition.



30
31
32
33
34
35
36
37
38
# File 'lib/rlsl/prism/ir/definitions.rb', line 30

def initialize(name, params, body, return_type: nil, param_types: {})
  super()
  @name = name
  @params = params
  @body = body
  @return_type = return_type
  @param_types = param_types
  @type = return_type
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



25
26
27
# File 'lib/rlsl/prism/ir/definitions.rb', line 25

def body
  @body
end

#nameObject (readonly)

Returns the value of attribute name.



25
26
27
# File 'lib/rlsl/prism/ir/definitions.rb', line 25

def name
  @name
end

#param_typesObject

Returns the value of attribute param_types.



26
27
28
# File 'lib/rlsl/prism/ir/definitions.rb', line 26

def param_types
  @param_types
end

#paramsObject (readonly)

Returns the value of attribute params.



25
26
27
# File 'lib/rlsl/prism/ir/definitions.rb', line 25

def params
  @params
end

#return_typeObject

Returns the value of attribute return_type.



26
27
28
# File 'lib/rlsl/prism/ir/definitions.rb', line 26

def return_type
  @return_type
end