Mercurial > hg > octave-nkf
annotate src/pt-except.cc @ 11474:8a40037533e2
struct printing changes
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 10 Jan 2011 14:05:12 -0500 |
parents | 57a59eae83cc |
children | fd0a3ac60b0e |
rev | line source |
---|---|
2982 | 1 /* |
2 | |
7017 | 3 Copyright (C) 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, |
8920 | 4 2006, 2007, 2008, 2009 John W. Eaton |
2982 | 5 |
6 This file is part of Octave. | |
7 | |
8 Octave is free software; you can redistribute it and/or modify it | |
9 under the terms of the GNU General Public License as published by the | |
7016 | 10 Free Software Foundation; either version 3 of the License, or (at your |
11 option) any later version. | |
2982 | 12 |
13 Octave is distributed in the hope that it will be useful, but WITHOUT | |
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 for more details. | |
17 | |
18 You should have received a copy of the GNU General Public License | |
7016 | 19 along with Octave; see the file COPYING. If not, see |
20 <http://www.gnu.org/licenses/>. | |
2982 | 21 |
22 */ | |
23 | |
24 #ifdef HAVE_CONFIG_H | |
25 #include <config.h> | |
26 #endif | |
27 | |
4429 | 28 #include "quit.h" |
29 | |
2982 | 30 #include "error.h" |
31 #include "oct-lvalue.h" | |
32 #include "ov.h" | |
3770 | 33 #include "pt-bp.h" |
2982 | 34 #include "pt-cmd.h" |
35 #include "pt-except.h" | |
36 #include "pt-exp.h" | |
2985 | 37 #include "pt-jump.h" |
2982 | 38 #include "pt-stmt.h" |
39 #include "pt-walk.h" | |
40 #include "unwind-prot.h" | |
41 #include "variables.h" | |
42 | |
43 // Simple exception handling. | |
44 | |
45 tree_try_catch_command::~tree_try_catch_command (void) | |
46 { | |
47 delete try_code; | |
48 delete catch_code; | |
3665 | 49 delete lead_comm; |
50 delete mid_comm; | |
51 delete trail_comm; | |
2982 | 52 } |
53 | |
5861 | 54 tree_command * |
7767
71f068b22fcc
scope and context fixes for function handles
John W. Eaton <jwe@octave.org>
parents:
7353
diff
changeset
|
55 tree_try_catch_command::dup (symbol_table::scope_id scope, |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
56 symbol_table::context_id context) const |
5861 | 57 { |
7767
71f068b22fcc
scope and context fixes for function handles
John W. Eaton <jwe@octave.org>
parents:
7353
diff
changeset
|
58 return new |
71f068b22fcc
scope and context fixes for function handles
John W. Eaton <jwe@octave.org>
parents:
7353
diff
changeset
|
59 tree_try_catch_command (try_code ? try_code->dup (scope, context) : 0, |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
60 catch_code ? catch_code->dup (scope, context) : 0, |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
61 lead_comm ? lead_comm->dup () : 0, |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
62 mid_comm ? mid_comm->dup () : 0, |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
63 trail_comm ? trail_comm->dup () : 0, |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
64 line (), column ()); |
5861 | 65 } |
66 | |
2982 | 67 void |
68 tree_try_catch_command::accept (tree_walker& tw) | |
69 { | |
70 tw.visit_try_catch_command (*this); | |
71 } | |
72 | |
73 // Simple exception handling. | |
74 | |
75 tree_unwind_protect_command::~tree_unwind_protect_command (void) | |
76 { | |
77 delete unwind_protect_code; | |
78 delete cleanup_code; | |
3665 | 79 delete lead_comm; |
80 delete mid_comm; | |
81 delete trail_comm; | |
2982 | 82 } |
83 | |
5861 | 84 tree_command * |
7767
71f068b22fcc
scope and context fixes for function handles
John W. Eaton <jwe@octave.org>
parents:
7353
diff
changeset
|
85 tree_unwind_protect_command::dup (symbol_table::scope_id scope, |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
86 symbol_table::context_id context) const |
5861 | 87 { |
88 return new tree_unwind_protect_command | |
7767
71f068b22fcc
scope and context fixes for function handles
John W. Eaton <jwe@octave.org>
parents:
7353
diff
changeset
|
89 (unwind_protect_code ? unwind_protect_code->dup (scope, context) : 0, |
71f068b22fcc
scope and context fixes for function handles
John W. Eaton <jwe@octave.org>
parents:
7353
diff
changeset
|
90 cleanup_code ? cleanup_code->dup (scope, context) : 0, |
5861 | 91 lead_comm ? lead_comm->dup () : 0, |
92 mid_comm ? mid_comm->dup () : 0, | |
93 trail_comm ? trail_comm->dup () : 0, | |
94 line (), column ()); | |
95 } | |
96 | |
2982 | 97 void |
98 tree_unwind_protect_command::accept (tree_walker& tw) | |
99 { | |
100 tw.visit_unwind_protect_command (*this); | |
101 } |