Class: MilkTea::Lowerer::ModuleContext
- Inherits:
-
Object
- Object
- MilkTea::Lowerer::ModuleContext
- Defined in:
- lib/milk_tea/core/lowering/lowering_context.rb
Instance Attribute Summary collapse
-
#analysis ⇒ Object
Returns the value of attribute analysis.
-
#ast ⇒ Object
Returns the value of attribute ast.
-
#attribute_applications ⇒ Object
Returns the value of attribute attribute_applications.
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#const_values ⇒ Object
Returns the value of attribute const_values.
-
#current_analysis_path ⇒ Object
Returns the value of attribute current_analysis_path.
-
#current_type_substitutions ⇒ Object
Returns the value of attribute current_type_substitutions.
-
#directives ⇒ Object
Returns the value of attribute directives.
-
#functions ⇒ Object
Returns the value of attribute functions.
-
#implemented_interfaces ⇒ Object
Returns the value of attribute implemented_interfaces.
-
#imports ⇒ Object
Returns the value of attribute imports.
-
#interfaces ⇒ Object
Returns the value of attribute interfaces.
-
#methods ⇒ Object
Returns the value of attribute methods.
-
#module_kind ⇒ Object
Returns the value of attribute module_kind.
-
#module_name ⇒ Object
Returns the value of attribute module_name.
-
#module_prefix ⇒ Object
Returns the value of attribute module_prefix.
-
#opaque_types ⇒ Object
Returns the value of attribute opaque_types.
-
#resolved_call_kinds ⇒ Object
Returns the value of attribute resolved_call_kinds.
-
#resolved_expr_types ⇒ Object
Returns the value of attribute resolved_expr_types.
-
#struct_types ⇒ Object
Returns the value of attribute struct_types.
-
#types ⇒ Object
Returns the value of attribute types.
-
#union_types ⇒ Object
Returns the value of attribute union_types.
-
#values ⇒ Object
Returns the value of attribute values.
Instance Method Summary collapse
-
#initialize ⇒ ModuleContext
constructor
A new instance of ModuleContext.
- #install(analysis, module_roots: nil) ⇒ Object
- #restore(saved) ⇒ Object
- #save ⇒ Object
Constructor Details
#initialize ⇒ ModuleContext
Returns a new instance of ModuleContext.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/milk_tea/core/lowering/lowering_context.rb', line 16 def initialize @imports = {} @types = {} @values = {} @functions = {} @interfaces = {} @struct_types = {} @union_types = {} @opaque_types = {} @methods = {} @attributes = {} @attribute_applications = {} @implemented_interfaces = {} @current_type_substitutions = nil @resolved_expr_types = {} @resolved_call_kinds = {} @const_values = {} end |
Instance Attribute Details
#analysis ⇒ Object
Returns the value of attribute analysis.
6 7 8 |
# File 'lib/milk_tea/core/lowering/lowering_context.rb', line 6 def analysis @analysis end |
#ast ⇒ Object
Returns the value of attribute ast.
7 8 9 |
# File 'lib/milk_tea/core/lowering/lowering_context.rb', line 7 def ast @ast end |
#attribute_applications ⇒ Object
Returns the value of attribute attribute_applications.
9 10 11 |
# File 'lib/milk_tea/core/lowering/lowering_context.rb', line 9 def attribute_applications @attribute_applications end |
#attributes ⇒ Object
Returns the value of attribute attributes.
9 10 11 |
# File 'lib/milk_tea/core/lowering/lowering_context.rb', line 9 def attributes @attributes end |
#const_values ⇒ Object
Returns the value of attribute const_values.
14 15 16 |
# File 'lib/milk_tea/core/lowering/lowering_context.rb', line 14 def const_values @const_values end |
#current_analysis_path ⇒ Object
Returns the value of attribute current_analysis_path.
6 7 8 |
# File 'lib/milk_tea/core/lowering/lowering_context.rb', line 6 def current_analysis_path @current_analysis_path end |
#current_type_substitutions ⇒ Object
Returns the value of attribute current_type_substitutions.
11 12 13 |
# File 'lib/milk_tea/core/lowering/lowering_context.rb', line 11 def current_type_substitutions @current_type_substitutions end |
#directives ⇒ Object
Returns the value of attribute directives.
7 8 9 |
# File 'lib/milk_tea/core/lowering/lowering_context.rb', line 7 def directives @directives end |
#functions ⇒ Object
Returns the value of attribute functions.
8 9 10 |
# File 'lib/milk_tea/core/lowering/lowering_context.rb', line 8 def functions @functions end |
#implemented_interfaces ⇒ Object
Returns the value of attribute implemented_interfaces.
9 10 11 |
# File 'lib/milk_tea/core/lowering/lowering_context.rb', line 9 def implemented_interfaces @implemented_interfaces end |
#imports ⇒ Object
Returns the value of attribute imports.
8 9 10 |
# File 'lib/milk_tea/core/lowering/lowering_context.rb', line 8 def imports @imports end |
#interfaces ⇒ Object
Returns the value of attribute interfaces.
8 9 10 |
# File 'lib/milk_tea/core/lowering/lowering_context.rb', line 8 def interfaces @interfaces end |
#methods ⇒ Object
Returns the value of attribute methods.
9 10 11 |
# File 'lib/milk_tea/core/lowering/lowering_context.rb', line 9 def methods @methods end |
#module_kind ⇒ Object
Returns the value of attribute module_kind.
7 8 9 |
# File 'lib/milk_tea/core/lowering/lowering_context.rb', line 7 def module_kind @module_kind end |
#module_name ⇒ Object
Returns the value of attribute module_name.
7 8 9 |
# File 'lib/milk_tea/core/lowering/lowering_context.rb', line 7 def module_name @module_name end |
#module_prefix ⇒ Object
Returns the value of attribute module_prefix.
7 8 9 |
# File 'lib/milk_tea/core/lowering/lowering_context.rb', line 7 def module_prefix @module_prefix end |
#opaque_types ⇒ Object
Returns the value of attribute opaque_types.
10 11 12 |
# File 'lib/milk_tea/core/lowering/lowering_context.rb', line 10 def opaque_types @opaque_types end |
#resolved_call_kinds ⇒ Object
Returns the value of attribute resolved_call_kinds.
13 14 15 |
# File 'lib/milk_tea/core/lowering/lowering_context.rb', line 13 def resolved_call_kinds @resolved_call_kinds end |
#resolved_expr_types ⇒ Object
Returns the value of attribute resolved_expr_types.
12 13 14 |
# File 'lib/milk_tea/core/lowering/lowering_context.rb', line 12 def resolved_expr_types @resolved_expr_types end |
#struct_types ⇒ Object
Returns the value of attribute struct_types.
10 11 12 |
# File 'lib/milk_tea/core/lowering/lowering_context.rb', line 10 def struct_types @struct_types end |
#types ⇒ Object
Returns the value of attribute types.
8 9 10 |
# File 'lib/milk_tea/core/lowering/lowering_context.rb', line 8 def types @types end |
#union_types ⇒ Object
Returns the value of attribute union_types.
10 11 12 |
# File 'lib/milk_tea/core/lowering/lowering_context.rb', line 10 def union_types @union_types end |
#values ⇒ Object
Returns the value of attribute values.
8 9 10 |
# File 'lib/milk_tea/core/lowering/lowering_context.rb', line 8 def values @values end |
Instance Method Details
#install(analysis, module_roots: nil) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/milk_tea/core/lowering/lowering_context.rb', line 35 def install(analysis, module_roots: nil) @analysis = analysis @ast = analysis.ast @module_name = analysis.module_name @module_kind = analysis.module_kind @imports = analysis.imports @types = analysis.types @values = analysis.values @functions = analysis.functions @interfaces = analysis.interfaces @methods = analysis.methods @attributes = analysis.attributes @attribute_applications = analysis.attribute_applications @implemented_interfaces = analysis.implemented_interfaces @directives = analysis.directives @resolved_expr_types = analysis.resolved_expr_types @resolved_call_kinds = analysis.resolved_call_kinds @const_values = analysis.const_values @struct_types = {} @union_types = {} @opaque_types = {} end |
#restore(saved) ⇒ Object
75 76 77 |
# File 'lib/milk_tea/core/lowering/lowering_context.rb', line 75 def restore(saved) saved.each { |k, v| send(:"#{k}=", v) } end |
#save ⇒ Object
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/milk_tea/core/lowering/lowering_context.rb', line 58 def save { analysis: @analysis, current_analysis_path: @current_analysis_path, ast: @ast, module_name: @module_name, module_prefix: @module_prefix, module_kind: @module_kind, directives: @directives, imports: @imports, types: @types, values: @values, functions: @functions, interfaces: @interfaces, methods: @methods, attributes: @attributes, attribute_applications: @attribute_applications, implemented_interfaces: @implemented_interfaces, struct_types: @struct_types, union_types: @union_types, opaque_types: @opaque_types, current_type_substitutions: @current_type_substitutions, resolved_expr_types: @resolved_expr_types, resolved_call_kinds: @resolved_call_kinds, const_values: @const_values, } end |