-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patharg.m
36 lines (33 loc) · 882 Bytes
/
arg.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
export Arg
const arg <- class Arg (Tree) [xxexp : Tree]
% If doing move/visit
% field isMove : Boolean <- false
% field isVisit : Boolean <- false
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
var narg : Arg
if exp !== nil then nexp <- exp.copy[i] end if
narg <- arg.create[ln, nexp]
% If doing move/visit
% narg$isMove <- isMove
% narg$isVisit <- isVisit
r <- narg
end copy
export function asString -> [r : String]
r <- "arg"
end asString
end Arg