Class: Mirah::AST::InterfaceDeclaration

Inherits:
ClassDefinition show all
Defined in:
lib/mirah/ast/class.rb

Instance Attribute Summary collapse

Attributes inherited from ClassDefinition

#abstract, #current_access_level

Attributes included from Scope

#static_scope, #type_scope

Attributes included from Named

#name

Attributes included from Annotated

#annotations

Attributes inherited from Node

#children, #inferred_type, #newline, #parent, #position

Instance Method Summary collapse

Methods inherited from ClassDefinition

#_define_method, #append_node, #compile, #declare_field, #define_constructor, #define_method, #define_static_method, #implements

Methods included from Scoped

#containing_scope, #scope

Methods included from Named

#string_value, #to_s, #validate_name

Methods included from Annotated

#annotation

Methods inherited from Node

#<<, ===, #[], #[]=, #_dump, _load, #_set_parent, child, child_name, #child_nodes, #each, #empty?, #expr?, #inferred_type!, #initialize_copy, #insert, #inspect, #inspect_children, #line_number, #log, #precompile, #resolve_if, #resolved!, #resolved?, #simple_name, #string_value, #temp, #to_s, #validate_child, #validate_children

Constructor Details

#initialize(parent, position, name, annotations) ⇒ InterfaceDeclaration

Returns a new instance of InterfaceDeclaration.



148
149
150
151
152
153
154
# File 'lib/mirah/ast/class.rb', line 148

def initialize(parent, position, name, annotations)
  super(parent, position, name, annotations) {|p| }
  @abstract = true
  self.name = name
  @children = [[], nil]
  @children = yield(self)
end

Instance Attribute Details

#interfacesObject

Returns the value of attribute interfaces.



144
145
146
# File 'lib/mirah/ast/class.rb', line 144

def interfaces
  @interfaces
end

#superclassObject

Returns the value of attribute superclass.



144
145
146
# File 'lib/mirah/ast/class.rb', line 144

def superclass
  @superclass
end

Instance Method Details

#infer(typer, expression) ⇒ Object



156
157
158
159
160
161
# File 'lib/mirah/ast/class.rb', line 156

def infer(typer, expression)
  resolve_if(typer) do
    @interfaces = interface_nodes.map {|i| i.type_reference(typer)}
    super
  end
end

#superclass_nodeObject



163
164
165
# File 'lib/mirah/ast/class.rb', line 163

def superclass_node
  nil
end

#top_level?Boolean

Returns:



167
168
169
# File 'lib/mirah/ast/class.rb', line 167

def top_level?
  true
end