Class: Yadriggy::SingularClassDef

Inherits:
ModuleDef show all
Defined in:
lib/yadriggy/ast.rb

Overview

Singular class definition.

Instance Attribute Summary

Attributes inherited from ModuleDef

#body, #rescue

Attributes inherited from ASTnode

#parent, #usertype

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ModuleDef

#initialize_body

Methods included from AstHelper

#has_tag?, #to_node, #to_nodes

Methods inherited from ASTnode

#add_child, #add_children, #const_value, #const_value_in_class, #get_context_class, #get_receiver_object, #is_proc?, #pretty_print, #root, #source_location, #source_location_string, #value, #value_in_class

Constructor Details

#initialize(sexp) ⇒ SingularClassDef



1616
1617
1618
1619
1620
# File 'lib/yadriggy/ast.rb', line 1616

def initialize(sexp)
  @name = to_node(sexp[1])  # Keyword, VariableCall, ...
  add_child(@name)
  initialize_body(has_tag?(sexp[2], :bodystmt))
end

Class Method Details

.tagObject



1614
# File 'lib/yadriggy/ast.rb', line 1614

def self.tag() :sclass end

Instance Method Details

#accept(evaluator) ⇒ void

This method returns an undefined value.

A method for Visitor pattern.



1628
1629
1630
# File 'lib/yadriggy/ast.rb', line 1628

def accept(evaluator)
  evaluator.singular_class_def(self)
end

#nameKeyword|VariableCall|ASTnode



1623
# File 'lib/yadriggy/ast.rb', line 1623

def name() super end