Appearance
| 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 | visitor.end_try_body(self) | |
| 26 | ||
| 27 | for c in catches do | |
| 28 | c.walk(visitor) | |
| 29 | od | |
| 30 | ||
| 31 | if `finally? then | |
| 32 | `finally.walk(visitor) | |
| 33 | fi | |
| 34 | fi | |
| 35 | accept(visitor) | |
| 36 | si | |
| 37 | si | |
| 38 | ||
| 39 | class CATCH(location: LOCATION, variable: Variables.VARIABLE?, body: LIST): Statement, ScopeCarrier is | |
| 40 | scope: Semantic.Scope? public | |
| 41 | ||
| 42 | super(location) | |
| 43 | ||
| 44 | accept(visitor: Visitor) is | |
| 45 | visitor.visit(self) | |
| 46 | si | |
| 47 | ||
| 48 | walk(visitor: Visitor) is | |
| 49 | if !visitor.pre(self) then | |
| 50 | if variable? then | |
| 51 | variable.walk(visitor) | |
| 52 | fi | |
| 53 | ||
| 54 | body.walk(visitor) | |
| 55 | fi | |
| 56 | ||
| 57 | accept(visitor) | |
| 58 | si | |
| 59 | si | |
| 60 | si |