-
Notifications
You must be signed in to change notification settings - Fork 5
/
symbol_table.inc
55 lines (55 loc) · 1019 Bytes
/
symbol_table.inc
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
macro ?!
local output, context, latest
virtual as 'lab'
output::
end virtual
context equ
latest equ
macro namespace? name*
namespace? name
match expand, context
context equ expand.name
else
context equ name
end match
latest equ
end macro
macro end?.namespace?
restore context, latest
end?.namespace?
end macro
struc (name) ? line&
name line
match :: @, line*
else match : @, line*
if defined name
local value
value = name
if value eqtype 0 & value relativeto 0
virtual output
match expand, context
db `expand, '.'
end match
if `name and $FF = '.'
match expand, latest
db `expand
end match
else match :== @@, line*
else
latest reequ name
end match
db `name, ' = '
if value < 0
db '-'
value = -value
end if
repeat 1, bind: value
db `bind, 10
end repeat
end virtual
end if
end if
end match
end struc
purge ?
end macro