Skip to content
← Back

src/syntax/trees/statements/try.ghul

1
namespace Syntax.Trees.Statements is
2
use Source
3
4
class TRY(
5
location: LOCATION,
6
keyword_location: LOCATION,
7
body: LIST,
8
catches: Collections.LIST[CATCH],
9
`finally: LIST?
10
): Statement, ScopeCarrier is
11
scope: Semantic.Scope? public
12
13
super(location)
14
15
debug_location: LOCATION => location.start_position
16
17
accept(visitor: Visitor) is
18
visitor.visit(self)
19
si
20
21
walk(visitor: Visitor) is
22
if !visitor.pre(self) then
23
body.walk(visitor)
24
25
for c in catches do
26
c.walk(visitor)
27
od
28
29
if `finally? then
30
`finally.walk(visitor)
31
fi
32
fi
33
accept(visitor)
34
si
35
si
36
37
class CATCH(location: LOCATION, variable: Variables.VARIABLE?, body: LIST): Statement, ScopeCarrier is
38
scope: Semantic.Scope? public
39
40
super(location)
41
42
accept(visitor: Visitor) is
43
visitor.visit(self)
44
si
45
46
walk(visitor: Visitor) is
47
if !visitor.pre(self) then
48
if variable? then
49
variable.walk(visitor)
50
fi
51
52
body.walk(visitor)
53
fi
54
55
accept(visitor)
56
si
57
si
58
si