Octave-Forge - Extra packages for GNU Octave | |
Home · Packages · Developers · Documentation · FAQ · Bugs · Mailing Lists · Links · Code |
00001 /* 00002 00003 Copyright (C) 1996, 1997, 2000, 2002, 2003, 2004, 2005, 2006, 2007, 00004 2008, 2009 John W. Eaton 00005 00006 This file is part of Octave. 00007 00008 Octave is free software; you can redistribute it and/or modify it 00009 under the terms of the GNU General Public License as published by the 00010 Free Software Foundation; either version 3 of the License, or (at your 00011 option) any later version. 00012 00013 Octave is distributed in the hope that it will be useful, but WITHOUT 00014 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00015 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00016 for more details. 00017 00018 You should have received a copy of the GNU General Public License 00019 along with Octave; see the file COPYING. If not, see 00020 <http://www.gnu.org/licenses/>. 00021 00022 */ 00023 00024 #if !defined (octave_tree_checker_h) 00025 #define octave_tree_checker_h 1 00026 00027 #include "pt-walk.h" 00028 00029 class tree_decl_command; 00030 00031 // How to check the semantics of the code that the parse trees represent. 00032 00033 class 00034 tree_checker : public tree_walker 00035 { 00036 public: 00037 00038 tree_checker (void) 00039 : do_lvalue_check (false) { } 00040 00041 ~tree_checker (void) { } 00042 00043 void visit_argument_list (tree_argument_list&); 00044 00045 void visit_binary_expression (tree_binary_expression&); 00046 00047 void visit_break_command (tree_break_command&); 00048 00049 void visit_colon_expression (tree_colon_expression&); 00050 00051 void visit_continue_command(tree_continue_command&); 00052 00053 void visit_global_command (tree_global_command&); 00054 00055 void visit_static_command (tree_static_command&); 00056 00057 void visit_decl_elt (tree_decl_elt&); 00058 00059 void visit_decl_init_list (tree_decl_init_list&); 00060 00061 void visit_simple_for_command (tree_simple_for_command&); 00062 00063 void visit_complex_for_command (tree_complex_for_command&); 00064 00065 void visit_octave_user_script (octave_user_script&); 00066 00067 void visit_octave_user_function (octave_user_function&); 00068 00069 void visit_function_def (tree_function_def&); 00070 00071 void visit_identifier (tree_identifier&); 00072 00073 void visit_if_clause (tree_if_clause&); 00074 00075 void visit_if_command (tree_if_command&); 00076 00077 void visit_if_command_list (tree_if_command_list&); 00078 00079 void visit_index_expression (tree_index_expression&); 00080 00081 void visit_matrix (tree_matrix&); 00082 00083 void visit_cell (tree_cell&); 00084 00085 void visit_multi_assignment (tree_multi_assignment&); 00086 00087 void visit_no_op_command (tree_no_op_command&); 00088 00089 void visit_anon_fcn_handle (tree_anon_fcn_handle&); 00090 00091 void visit_constant (tree_constant&); 00092 00093 void visit_fcn_handle (tree_fcn_handle&); 00094 00095 void visit_parameter_list (tree_parameter_list&); 00096 00097 void visit_postfix_expression (tree_postfix_expression&); 00098 00099 void visit_prefix_expression (tree_prefix_expression&); 00100 00101 void visit_return_command (tree_return_command&); 00102 00103 void visit_return_list (tree_return_list&); 00104 00105 void visit_simple_assignment (tree_simple_assignment&); 00106 00107 void visit_statement (tree_statement&); 00108 00109 void visit_statement_list (tree_statement_list&); 00110 00111 void visit_switch_case (tree_switch_case&); 00112 00113 void visit_switch_case_list (tree_switch_case_list&); 00114 00115 void visit_switch_command (tree_switch_command&); 00116 00117 void visit_try_catch_command (tree_try_catch_command&); 00118 00119 void visit_unwind_protect_command (tree_unwind_protect_command&); 00120 00121 void visit_while_command (tree_while_command&); 00122 00123 void visit_do_until_command (tree_do_until_command&); 00124 00125 private: 00126 00127 bool do_lvalue_check; 00128 00129 void do_decl_command (tree_decl_command&); 00130 00131 void gripe (const std::string& msg, int line); 00132 00133 // No copying! 00134 00135 tree_checker (const tree_checker&); 00136 00137 tree_checker& operator = (const tree_checker&); 00138 }; 00139 00140 #endif 00141 00142 /* 00143 ;;; Local Variables: *** 00144 ;;; mode: C++ *** 00145 ;;; End: *** 00146 */