module Bpl::AST::Binding

Public Class Methods

notify(msg,*args) click to toggle source
# File lib/bpl/ast/binding.rb, line 22
def self.notify(msg,*args)
  case msg
  when :unlink
    _, child = args
    child.each do |node|
      node.unbind if node.respond_to?(:unbind)
    end
  end
end

Public Instance Methods

bind(decl) click to toggle source
# File lib/bpl/ast/binding.rb, line 9
def bind(decl)
  unbind if @declaration != decl
  @declaration = decl
  decl.bindings << self unless decl.nil?
  decl
end
declaration() click to toggle source
# File lib/bpl/ast/binding.rb, line 5
def declaration
  @declaration ||= nil
end
unbind() click to toggle source
# File lib/bpl/ast/binding.rb, line 16
def unbind
  return unless @declaration
  @declaration.bindings.delete(self)
  @declaration = nil
end