Class: Mirah::AST::InterfaceDeclaration
- Inherits:
-
ClassDefinition
- Object
- Node
- ClassDefinition
- Mirah::AST::InterfaceDeclaration
- Defined in:
- lib/mirah/ast/class.rb
Instance Attribute Summary collapse
-
#interfaces ⇒ Object
Returns the value of attribute interfaces.
-
#superclass ⇒ Object
Returns the value of attribute superclass.
Attributes inherited from ClassDefinition
#abstract, #current_access_level
Attributes included from Scope
Attributes included from Named
Attributes included from Annotated
Attributes inherited from Node
#children, #inferred_type, #newline, #parent, #position
Instance Method Summary collapse
- #infer(typer, expression) ⇒ Object
-
#initialize(parent, position, name, annotations) ⇒ InterfaceDeclaration
constructor
A new instance of InterfaceDeclaration.
- #superclass_node ⇒ Object
- #top_level? ⇒ Boolean
Methods inherited from ClassDefinition
#_define_method, #append_node, #compile, #declare_field, #define_constructor, #define_method, #define_static_method, #implements
Methods included from Scoped
Methods included from Named
#string_value, #to_s, #validate_name
Methods included from Annotated
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
#interfaces ⇒ Object
Returns the value of attribute interfaces.
144 145 146 |
# File 'lib/mirah/ast/class.rb', line 144 def interfaces @interfaces end |
#superclass ⇒ Object
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_node ⇒ Object
163 164 165 |
# File 'lib/mirah/ast/class.rb', line 163 def superclass_node nil end |