Class: RLSL::Prism::IR::VarDecl

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

Instance Attribute Summary collapse

Attributes inherited from Node

#type

Instance Method Summary collapse

Methods inherited from Node

#accept, visits

Constructor Details

#initialize(name, initializer, type = nil) ⇒ VarDecl

Returns a new instance of VarDecl.



22
23
24
25
26
27
# File 'lib/rlsl/prism/ir/expressions.rb', line 22

def initialize(name, initializer, type = nil)
  super()
  @name = name
  @initializer = initializer
  @type = type
end

Instance Attribute Details

#initializerObject (readonly)

Returns the value of attribute initializer.



18
19
20
# File 'lib/rlsl/prism/ir/expressions.rb', line 18

def initializer
  @initializer
end

#nameObject (readonly)

Returns the value of attribute name.



18
19
20
# File 'lib/rlsl/prism/ir/expressions.rb', line 18

def name
  @name
end