Class: CodeTools::AST::ClassName

Inherits:
Node
  • Object
show all
Defined in:
lib/rubinius/ast/definitions.rb

Direct Known Subclasses

ScopedClassName, ToplevelClassName

Instance Attribute Summary collapse

Attributes inherited from Node

#line

Instance Method Summary collapse

Methods inherited from Node

#ascii_graph, #attributes, #children, #defined, match_arguments?, match_send?, #new_block_generator, #new_generator, #node_name, #or_bytecode, #pos, #set_child, #transform, transform, transform_comment, transform_kind, transform_kind=, transform_name, #value_defined, #visit, #walk

Constructor Details

#initialize(line, name, superclass) ⇒ ClassName

Returns a new instance of ClassName.



875
876
877
878
879
# File 'lib/rubinius/ast/definitions.rb', line 875

def initialize(line, name, superclass)
  @line = line
  @name = name
  @superclass = superclass
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



873
874
875
# File 'lib/rubinius/ast/definitions.rb', line 873

def name
  @name
end

#superclassObject

Returns the value of attribute superclass.



873
874
875
# File 'lib/rubinius/ast/definitions.rb', line 873

def superclass
  @superclass
end

Instance Method Details

#bytecode(g) ⇒ Object



887
888
889
890
891
892
893
# File 'lib/rubinius/ast/definitions.rb', line 887

def bytecode(g)
  pos(g)

  name_bytecode(g)
  g.push_scope
  g.send :open_class, 3
end

#name_bytecode(g) ⇒ Object



881
882
883
884
885
# File 'lib/rubinius/ast/definitions.rb', line 881

def name_bytecode(g)
  g.push_rubinius
  g.push_literal @name
  @superclass.bytecode(g)
end

#to_sexpObject



895
896
897
# File 'lib/rubinius/ast/definitions.rb', line 895

def to_sexp
  @name
end