Class: MilkTea::SemanticAnalyzer::ModuleContext

Inherits:
Object
  • Object
show all
Defined in:
lib/milk_tea/core/semantic_analyzer/module_context.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ast:, module_name:, module_kind:, imported_modules:, global_import_index:, const_declarations:) ⇒ ModuleContext

Returns a new instance of ModuleContext.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/milk_tea/core/semantic_analyzer/module_context.rb', line 14

def initialize(ast:, module_name:, module_kind:, imported_modules:, global_import_index:, const_declarations:)
  @ast = ast
  @module_name = module_name
  @module_kind = module_kind
  @imported_modules = imported_modules
  @global_import_index = global_import_index
  @const_declarations = const_declarations
  @types = {}
  @interfaces = {}
  @attributes = {}
  @top_level_values = {}
  @top_level_functions = {}
  @imports = {}
  @methods = Hash.new { |hash, key| hash[key] = {} }
  @implemented_interfaces = Hash.new { |hash, key| hash[key] = [] }
  @resolved_attribute_applications = {}
  @validated_attribute_arguments = {}
  @attribute_application_bindings = {}
end

Instance Attribute Details

#astObject

Returns the value of attribute ast.



6
7
8
# File 'lib/milk_tea/core/semantic_analyzer/module_context.rb', line 6

def ast
  @ast
end

#attribute_application_bindingsObject

Returns the value of attribute attribute_application_bindings.



12
13
14
# File 'lib/milk_tea/core/semantic_analyzer/module_context.rb', line 12

def attribute_application_bindings
  @attribute_application_bindings
end

#attributesObject

Returns the value of attribute attributes.



9
10
11
# File 'lib/milk_tea/core/semantic_analyzer/module_context.rb', line 9

def attributes
  @attributes
end

#const_declarationsObject

Returns the value of attribute const_declarations.



8
9
10
# File 'lib/milk_tea/core/semantic_analyzer/module_context.rb', line 8

def const_declarations
  @const_declarations
end

#global_import_indexObject

Returns the value of attribute global_import_index.



7
8
9
# File 'lib/milk_tea/core/semantic_analyzer/module_context.rb', line 7

def global_import_index
  @global_import_index
end

#implemented_interfacesObject

Returns the value of attribute implemented_interfaces.



11
12
13
# File 'lib/milk_tea/core/semantic_analyzer/module_context.rb', line 11

def implemented_interfaces
  @implemented_interfaces
end

#imported_modulesObject

Returns the value of attribute imported_modules.



7
8
9
# File 'lib/milk_tea/core/semantic_analyzer/module_context.rb', line 7

def imported_modules
  @imported_modules
end

#importsObject

Returns the value of attribute imports.



11
12
13
# File 'lib/milk_tea/core/semantic_analyzer/module_context.rb', line 11

def imports
  @imports
end

#interfacesObject

Returns the value of attribute interfaces.



9
10
11
# File 'lib/milk_tea/core/semantic_analyzer/module_context.rb', line 9

def interfaces
  @interfaces
end

#methodsObject

Returns the value of attribute methods.



11
12
13
# File 'lib/milk_tea/core/semantic_analyzer/module_context.rb', line 11

def methods
  @methods
end

#module_kindObject

Returns the value of attribute module_kind.



6
7
8
# File 'lib/milk_tea/core/semantic_analyzer/module_context.rb', line 6

def module_kind
  @module_kind
end

#module_nameObject

Returns the value of attribute module_name.



6
7
8
# File 'lib/milk_tea/core/semantic_analyzer/module_context.rb', line 6

def module_name
  @module_name
end

#resolved_attribute_applicationsObject

Returns the value of attribute resolved_attribute_applications.



12
13
14
# File 'lib/milk_tea/core/semantic_analyzer/module_context.rb', line 12

def resolved_attribute_applications
  @resolved_attribute_applications
end

#top_level_functionsObject

Returns the value of attribute top_level_functions.



10
11
12
# File 'lib/milk_tea/core/semantic_analyzer/module_context.rb', line 10

def top_level_functions
  @top_level_functions
end

#top_level_valuesObject

Returns the value of attribute top_level_values.



10
11
12
# File 'lib/milk_tea/core/semantic_analyzer/module_context.rb', line 10

def top_level_values
  @top_level_values
end

#typesObject

Returns the value of attribute types.



9
10
11
# File 'lib/milk_tea/core/semantic_analyzer/module_context.rb', line 9

def types
  @types
end

#validated_attribute_argumentsObject

Returns the value of attribute validated_attribute_arguments.



12
13
14
# File 'lib/milk_tea/core/semantic_analyzer/module_context.rb', line 12

def validated_attribute_arguments
  @validated_attribute_arguments
end