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