-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathassertst.m
43 lines (37 loc) · 1.05 KB
/
assertst.m
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
export Assertstat
const assertstat <- class Assertstat (Tree) [xxexp : Tree]
const ln : Integer <- xxexp$ln
field exp : Tree <- xxexp
export function upperbound -> [r : Integer]
r <- 0
end upperbound
export function getElement [i : Integer] -> [r : Tree]
if i = 0 then
r <- exp
end if
end getElement
export operation setElement [i : Integer, r : Tree]
if i = 0 then
exp <- r
end if
end setElement
export operation copy [i : Integer] -> [r : Tree]
var nexp : Tree
if exp !== nil then nexp <- exp.copy[i] end if
r <- assertstat.create[ln, nexp]
end copy
export operation resolveSymbols[pst : SymbolTable, nexp : Integer]
self$exp.resolveSymbols[pst, 1]
end resolveSymbols
export operation generate [xct : Printable]
const bc <- view xct as ByteCode
bc.lineNumber[self$ln]
bc.pushSize[4]
self$exp.generate[xct]
bc.popSize
bc.addCode["TRAPF"]
end generate
export function asString -> [r : String]
r <- "assertstat"
end asString
end Assertstat