class AdLint::Cc1::Scope

Attributes

depth[R]

Public Class Methods

new(depth) click to toggle source
# File lib/adlint/cc1/scope.rb, line 36
def initialize(depth)
  @depth = depth
end

Public Instance Methods

eql?(rhs) click to toggle source
# File lib/adlint/cc1/scope.rb, line 58
def eql?(rhs)
  @depth == rhs.depth
end
global?() click to toggle source
# File lib/adlint/cc1/scope.rb, line 42
def global?
  @depth == 0
end
hash() click to toggle source
# File lib/adlint/cc1/scope.rb, line 62
def hash
  @depth.hash
end
inner_scope() click to toggle source
# File lib/adlint/cc1/scope.rb, line 50
def inner_scope
  Scope.new(@depth + 1)
end
local?() click to toggle source
# File lib/adlint/cc1/scope.rb, line 46
def local?
  @depth > 0
end
outer_scope() click to toggle source
# File lib/adlint/cc1/scope.rb, line 54
def outer_scope
  Scope.new(@depth - 1)
end