00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #if !defined (octave_tree_except_h)
00025 #define octave_tree_except_h 1
00026
00027 class tree_statement_list;
00028
00029 class tree_walker;
00030
00031 #include "comment-list.h"
00032 #include "pt-cmd.h"
00033 #include "symtab.h"
00034
00035
00036
00037 class
00038 tree_try_catch_command : public tree_command
00039 {
00040 public:
00041
00042 tree_try_catch_command (int l = -1, int c = -1)
00043 : tree_command (l, c), try_code (0), catch_code (0), lead_comm (0),
00044 mid_comm (0), trail_comm (0) { }
00045
00046 tree_try_catch_command (tree_statement_list *tc, tree_statement_list *cc,
00047 octave_comment_list *cl = 0,
00048 octave_comment_list *cm = 0,
00049 octave_comment_list *ct = 0,
00050 int l = -1, int c = -1)
00051 : tree_command (l, c), try_code (tc), catch_code (cc),
00052 lead_comm (cl), mid_comm (cm), trail_comm (ct) { }
00053
00054 ~tree_try_catch_command (void);
00055
00056 tree_statement_list *body (void) { return try_code; }
00057
00058 tree_statement_list *cleanup (void) { return catch_code; }
00059
00060 octave_comment_list *leading_comment (void) { return lead_comm; }
00061
00062 octave_comment_list *middle_comment (void) { return mid_comm; }
00063
00064 octave_comment_list *trailing_comment (void) { return trail_comm; }
00065
00066 tree_command *dup (symbol_table::scope_id scope,
00067 symbol_table::context_id context) const;
00068
00069 void accept (tree_walker& tw);
00070
00071 private:
00072
00073
00074 tree_statement_list *try_code;
00075
00076
00077 tree_statement_list *catch_code;
00078
00079
00080 octave_comment_list *lead_comm;
00081
00082
00083 octave_comment_list *mid_comm;
00084
00085
00086 octave_comment_list *trail_comm;
00087
00088
00089
00090 tree_try_catch_command (const tree_try_catch_command&);
00091
00092 tree_try_catch_command& operator = (const tree_try_catch_command&);
00093 };
00094
00095
00096
00097 class
00098 tree_unwind_protect_command : public tree_command
00099 {
00100 public:
00101
00102 tree_unwind_protect_command (int l = -1, int c = -1)
00103 : tree_command (l, c), unwind_protect_code (0), cleanup_code (0),
00104 lead_comm (0), mid_comm (0), trail_comm (0) { }
00105
00106 tree_unwind_protect_command (tree_statement_list *tc,
00107 tree_statement_list *cc,
00108 octave_comment_list *cl = 0,
00109 octave_comment_list *cm = 0,
00110 octave_comment_list *ct = 0,
00111 int l = -1, int c = -1)
00112 : tree_command (l, c), unwind_protect_code (tc), cleanup_code (cc),
00113 lead_comm (cl), mid_comm (cm), trail_comm (ct) { }
00114
00115 ~tree_unwind_protect_command (void);
00116
00117 tree_statement_list *body (void) { return unwind_protect_code; }
00118
00119 tree_statement_list *cleanup (void) { return cleanup_code; }
00120
00121 octave_comment_list *leading_comment (void) { return lead_comm; }
00122
00123 octave_comment_list *middle_comment (void) { return mid_comm; }
00124
00125 octave_comment_list *trailing_comment (void) { return trail_comm; }
00126
00127 tree_command *dup (symbol_table::scope_id scope,
00128 symbol_table::context_id context) const;
00129
00130 void accept (tree_walker& tw);
00131
00132 private:
00133
00134
00135 tree_statement_list *unwind_protect_code;
00136
00137
00138
00139 tree_statement_list *cleanup_code;
00140
00141
00142 octave_comment_list *lead_comm;
00143
00144
00145 octave_comment_list *mid_comm;
00146
00147
00148 octave_comment_list *trail_comm;
00149
00150
00151
00152 tree_unwind_protect_command (const tree_unwind_protect_command&);
00153
00154 tree_unwind_protect_command& operator = (const tree_unwind_protect_command&);
00155 };
00156
00157 #endif
00158
00159
00160
00161
00162
00163