Class: Omnium::Parser::AST::VariableDeclaration

Inherits:
Base
  • Object
show all
Defined in:
lib/omnium/parser/ast/variable_declaration.rb

Overview

Representative of the declaration of a variable, containing a reference to the variable identifier_node and it’s data type.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(identifier, data_type) ⇒ VariableDeclaration

Returns a new instance of VariableDeclaration.



11
12
13
14
# File 'lib/omnium/parser/ast/variable_declaration.rb', line 11

def initialize(identifier, data_type)
  @identifier = identifier
  @data_type = data_type
end

Instance Attribute Details

#data_typeObject (readonly)

Returns the value of attribute data_type.



9
10
11
# File 'lib/omnium/parser/ast/variable_declaration.rb', line 9

def data_type
  @data_type
end

#identifierObject (readonly)

Returns the value of attribute identifier.



9
10
11
# File 'lib/omnium/parser/ast/variable_declaration.rb', line 9

def identifier
  @identifier
end