forked from ceu-lang/ceu
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtops.lua
More file actions
31 lines (26 loc) · 694 Bytes
/
Copy pathtops.lua
File metadata and controls
31 lines (26 loc) · 694 Bytes
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
local TOP = {} -- holds all clss/exts/nats
local TOP_i = 1 -- next top
-- TODO: pra q serve?
local node = _AST.node
F = {
Root_pos = function (me)
_AST.root = node('Root', me.ln, unpack(TOP))
return _AST.root
end,
Dcl_cls_pos = function (me)
table.insert(TOP, TOP_i, me)
TOP_i = TOP_i + 1
return node('Nothing', me.ln)
end,
Dcl_nat_pos = function (me)
table.insert(TOP, TOP_i, me)
TOP_i = TOP_i + 1
return node('Nothing', me.ln)
end,
Dcl_ext_pos = function (me)
table.insert(TOP, TOP_i, me)
TOP_i = TOP_i + 1
return node('Nothing', me.ln)
end,
}
_AST.visit(F)