3011
|
1 /* |
|
2 |
7017
|
3 Copyright (C) 1996, 1997, 2000, 2002, 2003, 2004, 2005, 2006, 2007 |
|
4 John W. Eaton |
3011
|
5 |
|
6 This file is part of Octave. |
|
7 |
|
8 Octave is free software; you can redistribute it and/or modify it |
|
9 under the terms of the GNU General Public License as published by the |
7016
|
10 Free Software Foundation; either version 3 of the License, or (at your |
|
11 option) any later version. |
3011
|
12 |
|
13 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
16 for more details. |
|
17 |
|
18 You should have received a copy of the GNU General Public License |
7016
|
19 along with Octave; see the file COPYING. If not, see |
|
20 <http://www.gnu.org/licenses/>. |
3011
|
21 |
|
22 */ |
|
23 |
|
24 #if !defined (octave_tree_checker_h) |
|
25 #define octave_tree_checker_h 1 |
|
26 |
|
27 #include "pt-walk.h" |
|
28 |
|
29 // How to check the semantics of the code that the parse trees represent. |
|
30 |
|
31 class |
|
32 tree_checker : public tree_walker |
|
33 { |
|
34 public: |
|
35 |
|
36 tree_checker (void) |
|
37 : do_lvalue_check (false) { } |
|
38 |
|
39 ~tree_checker (void) { } |
|
40 |
|
41 void visit_argument_list (tree_argument_list&); |
|
42 |
|
43 void visit_binary_expression (tree_binary_expression&); |
|
44 |
4207
|
45 void visit_break_command (tree_break_command&); |
3011
|
46 |
|
47 void visit_colon_expression (tree_colon_expression&); |
|
48 |
4207
|
49 void visit_continue_command(tree_continue_command&); |
3011
|
50 |
|
51 void visit_decl_command (tree_decl_command&); |
|
52 |
|
53 void visit_decl_elt (tree_decl_elt&); |
|
54 |
|
55 void visit_decl_init_list (tree_decl_init_list&); |
|
56 |
|
57 void visit_simple_for_command (tree_simple_for_command&); |
|
58 |
|
59 void visit_complex_for_command (tree_complex_for_command&); |
|
60 |
|
61 void visit_octave_user_function (octave_user_function&); |
|
62 |
|
63 void visit_identifier (tree_identifier&); |
|
64 |
|
65 void visit_if_clause (tree_if_clause&); |
|
66 |
|
67 void visit_if_command (tree_if_command&); |
|
68 |
|
69 void visit_if_command_list (tree_if_command_list&); |
|
70 |
|
71 void visit_index_expression (tree_index_expression&); |
|
72 |
|
73 void visit_matrix (tree_matrix&); |
|
74 |
4219
|
75 void visit_cell (tree_cell&); |
|
76 |
3011
|
77 void visit_multi_assignment (tree_multi_assignment&); |
|
78 |
|
79 void visit_no_op_command (tree_no_op_command&); |
|
80 |
5861
|
81 void visit_anon_fcn_handle (tree_anon_fcn_handle&); |
|
82 |
3011
|
83 void visit_constant (tree_constant&); |
|
84 |
4342
|
85 void visit_fcn_handle (tree_fcn_handle&); |
|
86 |
3011
|
87 void visit_parameter_list (tree_parameter_list&); |
|
88 |
|
89 void visit_postfix_expression (tree_postfix_expression&); |
|
90 |
|
91 void visit_prefix_expression (tree_prefix_expression&); |
|
92 |
4207
|
93 void visit_return_command (tree_return_command&); |
3011
|
94 |
|
95 void visit_return_list (tree_return_list&); |
|
96 |
|
97 void visit_simple_assignment (tree_simple_assignment&); |
|
98 |
|
99 void visit_statement (tree_statement&); |
|
100 |
|
101 void visit_statement_list (tree_statement_list&); |
|
102 |
|
103 void visit_switch_case (tree_switch_case&); |
|
104 |
|
105 void visit_switch_case_list (tree_switch_case_list&); |
|
106 |
|
107 void visit_switch_command (tree_switch_command&); |
|
108 |
|
109 void visit_try_catch_command (tree_try_catch_command&); |
|
110 |
|
111 void visit_unwind_protect_command (tree_unwind_protect_command&); |
|
112 |
|
113 void visit_while_command (tree_while_command&); |
|
114 |
4229
|
115 void visit_do_until_command (tree_do_until_command&); |
|
116 |
3011
|
117 private: |
|
118 |
|
119 bool do_lvalue_check; |
|
120 |
3523
|
121 void gripe (const std::string& msg, int line); |
3011
|
122 |
|
123 // No copying! |
|
124 |
|
125 tree_checker (const tree_checker&); |
|
126 |
|
127 tree_checker& operator = (const tree_checker&); |
|
128 }; |
|
129 |
|
130 #endif |
|
131 |
|
132 /* |
|
133 ;;; Local Variables: *** |
|
134 ;;; mode: C++ *** |
|
135 ;;; End: *** |
|
136 */ |