1 /* valacatchclause.vala
3 * Copyright (C) 2007 Jürg Billeter
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 * Jürg Billeter <j@bitron.ch>
26 * Represents a catch clause in a try statement in the source code.
28 public class Vala
.CatchClause
: CodeNode
{
30 * Specifies the error type.
32 public TypeReference type_reference
{ get; set; }
35 * Specifies the error variable name.
37 public string variable_name
{ get; set; }
40 * Specifies the error handler body.
42 public Block body
{ get; set; }
45 * Specifies the declarator for the generated error variable.
47 public VariableDeclarator variable_declarator
{ get; set; }
50 * Creates a new catch clause.
52 * @param type_reference error type
53 * @param variable_name error variable name
54 * @param body error handler body
55 * @param source_reference reference to source code
56 * @return newly created catch clause
58 public CatchClause (construct TypeReference type_reference
, construct string variable_name
, construct Block body
, construct SourceReference source_reference
= null) {
61 public override void accept (CodeVisitor
! visitor
) {
62 visitor
.visit_catch_clause (this
);
65 public override void accept_children (CodeVisitor
! visitor
) {
66 type_reference
.accept (visitor
);
67 body
.accept (visitor
);