Mercurial > hg > octave-lyh
comparison libinterp/parse-tree/pt-except.h @ 15195:2fc554ffbc28
split libinterp from src
* libinterp: New directory. Move all files from src directory here
except Makefile.am, main.cc, main-cli.cc, mkoctfile.in.cc,
mkoctfilr.in.sh, octave-config.in.cc, octave-config.in.sh.
* libinterp/Makefile.am: New file, extracted from src/Makefile.am.
* src/Makefile.am: Delete everything except targets and definitions
needed to build and link main and utility programs.
* Makefile.am (SUBDIRS): Include libinterp in the list.
* autogen.sh: Run config-module.sh in libinterp/dldfcn directory, not
src/dldfcn directory.
* configure.ac (AC_CONFIG_SRCDIR): Use libinterp/octave.cc, not
src/octave.cc.
(DL_LDFLAGS, LIBOCTINTERP): Use libinterp, not src.
(AC_CONFIG_FILES): Include libinterp/Makefile in the list.
* find-docstring-files.sh: Look in libinterp, not src.
* gui/src/Makefile.am (liboctgui_la_CPPFLAGS): Find header files in
libinterp, not src.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sat, 18 Aug 2012 16:23:39 -0400 |
parents | src/parse-tree/pt-except.h@46b19589b593 |
children | 923ce8b42db2 |
comparison
equal
deleted
inserted
replaced
15194:0f0b795044c3 | 15195:2fc554ffbc28 |
---|---|
1 /* | |
2 | |
3 Copyright (C) 1996-2012 John W. Eaton | |
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 | |
9 Free Software Foundation; either version 3 of the License, or (at your | |
10 option) any later version. | |
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 | |
18 along with Octave; see the file COPYING. If not, see | |
19 <http://www.gnu.org/licenses/>. | |
20 | |
21 */ | |
22 | |
23 #if !defined (octave_tree_except_h) | |
24 #define octave_tree_except_h 1 | |
25 | |
26 class tree_statement_list; | |
27 | |
28 class tree_walker; | |
29 | |
30 #include "comment-list.h" | |
31 #include "pt-cmd.h" | |
32 #include "symtab.h" | |
33 | |
34 // Simple exception handling. | |
35 | |
36 class | |
37 tree_try_catch_command : public tree_command | |
38 { | |
39 public: | |
40 | |
41 tree_try_catch_command (int l = -1, int c = -1) | |
42 : tree_command (l, c), try_code (0), catch_code (0), lead_comm (0), | |
43 mid_comm (0), trail_comm (0) { } | |
44 | |
45 tree_try_catch_command (tree_statement_list *tc, tree_statement_list *cc, | |
46 octave_comment_list *cl = 0, | |
47 octave_comment_list *cm = 0, | |
48 octave_comment_list *ct = 0, | |
49 int l = -1, int c = -1) | |
50 : tree_command (l, c), try_code (tc), catch_code (cc), | |
51 lead_comm (cl), mid_comm (cm), trail_comm (ct) { } | |
52 | |
53 ~tree_try_catch_command (void); | |
54 | |
55 tree_statement_list *body (void) { return try_code; } | |
56 | |
57 tree_statement_list *cleanup (void) { return catch_code; } | |
58 | |
59 octave_comment_list *leading_comment (void) { return lead_comm; } | |
60 | |
61 octave_comment_list *middle_comment (void) { return mid_comm; } | |
62 | |
63 octave_comment_list *trailing_comment (void) { return trail_comm; } | |
64 | |
65 tree_command *dup (symbol_table::scope_id scope, | |
66 symbol_table::context_id context) const; | |
67 | |
68 void accept (tree_walker& tw); | |
69 | |
70 private: | |
71 | |
72 // The first block of code to attempt to execute. | |
73 tree_statement_list *try_code; | |
74 | |
75 // The code to execute if an error occurs in the first block. | |
76 tree_statement_list *catch_code; | |
77 | |
78 // Comment preceding TRY token. | |
79 octave_comment_list *lead_comm; | |
80 | |
81 // Comment preceding CATCH token. | |
82 octave_comment_list *mid_comm; | |
83 | |
84 // Comment preceding END_TRY_CATCH token. | |
85 octave_comment_list *trail_comm; | |
86 | |
87 // No copying! | |
88 | |
89 tree_try_catch_command (const tree_try_catch_command&); | |
90 | |
91 tree_try_catch_command& operator = (const tree_try_catch_command&); | |
92 }; | |
93 | |
94 // Simple exception handling. | |
95 | |
96 class | |
97 tree_unwind_protect_command : public tree_command | |
98 { | |
99 public: | |
100 | |
101 tree_unwind_protect_command (int l = -1, int c = -1) | |
102 : tree_command (l, c), unwind_protect_code (0), cleanup_code (0), | |
103 lead_comm (0), mid_comm (0), trail_comm (0) { } | |
104 | |
105 tree_unwind_protect_command (tree_statement_list *tc, | |
106 tree_statement_list *cc, | |
107 octave_comment_list *cl = 0, | |
108 octave_comment_list *cm = 0, | |
109 octave_comment_list *ct = 0, | |
110 int l = -1, int c = -1) | |
111 : tree_command (l, c), unwind_protect_code (tc), cleanup_code (cc), | |
112 lead_comm (cl), mid_comm (cm), trail_comm (ct) { } | |
113 | |
114 ~tree_unwind_protect_command (void); | |
115 | |
116 tree_statement_list *body (void) { return unwind_protect_code; } | |
117 | |
118 tree_statement_list *cleanup (void) { return cleanup_code; } | |
119 | |
120 octave_comment_list *leading_comment (void) { return lead_comm; } | |
121 | |
122 octave_comment_list *middle_comment (void) { return mid_comm; } | |
123 | |
124 octave_comment_list *trailing_comment (void) { return trail_comm; } | |
125 | |
126 tree_command *dup (symbol_table::scope_id scope, | |
127 symbol_table::context_id context) const; | |
128 | |
129 void accept (tree_walker& tw); | |
130 | |
131 private: | |
132 | |
133 // The first body of code to attempt to execute. | |
134 tree_statement_list *unwind_protect_code; | |
135 | |
136 // The body of code to execute no matter what happens in the first | |
137 // body of code. | |
138 tree_statement_list *cleanup_code; | |
139 | |
140 // Comment preceding UNWIND_PROTECT token. | |
141 octave_comment_list *lead_comm; | |
142 | |
143 // Comment preceding UNWIND_PROTECT_CLEANUP token. | |
144 octave_comment_list *mid_comm; | |
145 | |
146 // Comment preceding END_UNWIND_PROTECT token. | |
147 octave_comment_list *trail_comm; | |
148 | |
149 // No copying! | |
150 | |
151 tree_unwind_protect_command (const tree_unwind_protect_command&); | |
152 | |
153 tree_unwind_protect_command& operator = (const tree_unwind_protect_command&); | |
154 }; | |
155 | |
156 #endif |