00001 /* 00002 00003 Copyright (C) 1996-2012 John W. Eaton 00004 00005 This file is part of Octave. 00006 00007 Octave is free software; you can redistribute it and/or modify it 00008 under the terms of the GNU General Public License as published by the 00009 Free Software Foundation; either version 3 of the License, or (at your 00010 option) any later version. 00011 00012 Octave is distributed in the hope that it will be useful, but WITHOUT 00013 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00014 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00015 for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with Octave; see the file COPYING. If not, see 00019 <http://www.gnu.org/licenses/>. 00020 00021 */ 00022 00023 #if !defined (octave_tree_walker_h) 00024 #define octave_tree_walker_h 1 00025 00026 class tree_anon_fcn_handle; 00027 class tree_argument_list; 00028 class tree_binary_expression; 00029 class tree_break_command; 00030 class tree_colon_expression; 00031 class tree_continue_command; 00032 class tree_global_command; 00033 class tree_static_command; 00034 class tree_decl_elt; 00035 class tree_decl_init_list; 00036 class tree_simple_for_command; 00037 class tree_complex_for_command; 00038 class octave_user_script; 00039 class octave_user_function; 00040 class tree_function_def; 00041 class tree_identifier; 00042 class tree_if_clause; 00043 class tree_if_command; 00044 class tree_if_command_list; 00045 class tree_switch_case; 00046 class tree_switch_case_list; 00047 class tree_switch_command; 00048 class tree_index_expression; 00049 class tree_matrix; 00050 class tree_cell; 00051 class tree_multi_assignment; 00052 class tree_no_op_command; 00053 class tree_constant; 00054 class tree_fcn_handle; 00055 class tree_parameter_list; 00056 class tree_postfix_expression; 00057 class tree_prefix_expression; 00058 class tree_return_command; 00059 class tree_return_list; 00060 class tree_simple_assignment; 00061 class tree_statement; 00062 class tree_statement_list; 00063 class tree_try_catch_command; 00064 class tree_unwind_protect_command; 00065 class tree_while_command; 00066 class tree_do_until_command; 00067 00068 class 00069 tree_walker 00070 { 00071 public: 00072 00073 virtual void 00074 visit_anon_fcn_handle (tree_anon_fcn_handle&) = 0; 00075 00076 virtual void 00077 visit_argument_list (tree_argument_list&) = 0; 00078 00079 virtual void 00080 visit_binary_expression (tree_binary_expression&) = 0; 00081 00082 virtual void 00083 visit_break_command (tree_break_command&) = 0; 00084 00085 virtual void 00086 visit_colon_expression (tree_colon_expression&) = 0; 00087 00088 virtual void 00089 visit_continue_command (tree_continue_command&) = 0; 00090 00091 virtual void 00092 visit_global_command (tree_global_command&) = 0; 00093 00094 virtual void 00095 visit_static_command (tree_static_command&) = 0; 00096 00097 virtual void 00098 visit_decl_elt (tree_decl_elt&) = 0; 00099 00100 virtual void 00101 visit_decl_init_list (tree_decl_init_list&) = 0; 00102 00103 virtual void 00104 visit_simple_for_command (tree_simple_for_command&) = 0; 00105 00106 virtual void 00107 visit_complex_for_command (tree_complex_for_command&) = 0; 00108 00109 virtual void 00110 visit_octave_user_script (octave_user_script&) = 0; 00111 00112 virtual void 00113 visit_octave_user_function (octave_user_function&) = 0; 00114 00115 virtual void 00116 visit_function_def (tree_function_def&) = 0; 00117 00118 virtual void 00119 visit_identifier (tree_identifier&) = 0; 00120 00121 virtual void 00122 visit_if_clause (tree_if_clause&) = 0; 00123 00124 virtual void 00125 visit_if_command (tree_if_command&) = 0; 00126 00127 virtual void 00128 visit_if_command_list (tree_if_command_list&) = 0; 00129 00130 virtual void 00131 visit_switch_case (tree_switch_case&) = 0; 00132 00133 virtual void 00134 visit_switch_case_list (tree_switch_case_list&) = 0; 00135 00136 virtual void 00137 visit_switch_command (tree_switch_command&) = 0; 00138 00139 virtual void 00140 visit_index_expression (tree_index_expression&) = 0; 00141 00142 virtual void 00143 visit_matrix (tree_matrix&) = 0; 00144 00145 virtual void 00146 visit_cell (tree_cell&) = 0; 00147 00148 virtual void 00149 visit_multi_assignment (tree_multi_assignment&) = 0; 00150 00151 virtual void 00152 visit_no_op_command (tree_no_op_command&) = 0; 00153 00154 virtual void 00155 visit_constant (tree_constant&) = 0; 00156 00157 virtual void 00158 visit_fcn_handle (tree_fcn_handle&) = 0; 00159 00160 virtual void 00161 visit_parameter_list (tree_parameter_list&) = 0; 00162 00163 virtual void 00164 visit_postfix_expression (tree_postfix_expression&) = 0; 00165 00166 virtual void 00167 visit_prefix_expression (tree_prefix_expression&) = 0; 00168 00169 virtual void 00170 visit_return_command (tree_return_command&) = 0; 00171 00172 virtual void 00173 visit_return_list (tree_return_list&) = 0; 00174 00175 virtual void 00176 visit_simple_assignment (tree_simple_assignment&) = 0; 00177 00178 virtual void 00179 visit_statement (tree_statement&) = 0; 00180 00181 virtual void 00182 visit_statement_list (tree_statement_list&) = 0; 00183 00184 virtual void 00185 visit_try_catch_command (tree_try_catch_command&) = 0; 00186 00187 virtual void 00188 visit_unwind_protect_command (tree_unwind_protect_command&) = 0; 00189 00190 virtual void 00191 visit_while_command (tree_while_command&) = 0; 00192 00193 virtual void 00194 visit_do_until_command (tree_do_until_command&) = 0; 00195 00196 protected: 00197 00198 tree_walker (void) { } 00199 00200 virtual ~tree_walker (void) { } 00201 00202 private: 00203 00204 // No copying! 00205 00206 tree_walker (const tree_walker&); 00207 00208 tree_walker& operator = (const tree_walker&); 00209 }; 00210 00211 #endif