-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathscope.rb
65 lines (48 loc) · 854 Bytes
/
scope.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
class Scope
attr_reader :next
def initialize n=nil
@next = n
end
def method
nil
end
def get_arg(a)
@next ? @next.get_arg(a) : nil
end
def add_global(c)
@next.add_global(c) if @next
end
def add_constant(c)
@next.add_constant(c) if @next
end
def find_constant(c)
@next ? @next.find_constant(c) : nil
end
def name
""
end
def class_scope
self
end
def lvaroffset
0
end
def set_vtable_entry(name,realname,f)
@next.set_vtable_entry(name,realname,f) if @next
end
def vtable
@next ? @next.vtable : {}
end
def break_label
@next ? @next.break_label : nil
end
def loop_label
@next ? @next.loop_label : nil
end
end
require 'globalscope'
require 'funcscope'
require 'sexpscope'
require 'localvarscope'
require 'classcope'
require 'controlscope'