Mercurial > hg > octave-thorsten
annotate src/pt-check.h @ 8920:eb63fbe60fab
update copyright notices
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sat, 07 Mar 2009 10:41:27 -0500 |
parents | 73c4516fae10 |
children | cd96d29c5efa |
rev | line source |
---|---|
3011 | 1 /* |
2 | |
8920 | 3 Copyright (C) 1996, 1997, 2000, 2002, 2003, 2004, 2005, 2006, 2007, |
4 2008, 2009 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 | |
8658
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
7715
diff
changeset
|
29 class tree_decl_command; |
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
7715
diff
changeset
|
30 |
3011 | 31 // How to check the semantics of the code that the parse trees represent. |
32 | |
33 class | |
34 tree_checker : public tree_walker | |
35 { | |
36 public: | |
37 | |
38 tree_checker (void) | |
39 : do_lvalue_check (false) { } | |
40 | |
41 ~tree_checker (void) { } | |
42 | |
43 void visit_argument_list (tree_argument_list&); | |
44 | |
45 void visit_binary_expression (tree_binary_expression&); | |
46 | |
4207 | 47 void visit_break_command (tree_break_command&); |
3011 | 48 |
49 void visit_colon_expression (tree_colon_expression&); | |
50 | |
4207 | 51 void visit_continue_command(tree_continue_command&); |
3011 | 52 |
8658
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
7715
diff
changeset
|
53 void visit_global_command (tree_global_command&); |
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
7715
diff
changeset
|
54 |
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
7715
diff
changeset
|
55 void visit_static_command (tree_static_command&); |
3011 | 56 |
57 void visit_decl_elt (tree_decl_elt&); | |
58 | |
59 void visit_decl_init_list (tree_decl_init_list&); | |
60 | |
61 void visit_simple_for_command (tree_simple_for_command&); | |
62 | |
63 void visit_complex_for_command (tree_complex_for_command&); | |
64 | |
7715
5b4d278ec828
parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
65 void visit_octave_user_script (octave_user_script&); |
5b4d278ec828
parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
66 |
3011 | 67 void visit_octave_user_function (octave_user_function&); |
68 | |
7715
5b4d278ec828
parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
69 void visit_function_def (tree_function_def&); |
5b4d278ec828
parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
70 |
3011 | 71 void visit_identifier (tree_identifier&); |
72 | |
73 void visit_if_clause (tree_if_clause&); | |
74 | |
75 void visit_if_command (tree_if_command&); | |
76 | |
77 void visit_if_command_list (tree_if_command_list&); | |
78 | |
79 void visit_index_expression (tree_index_expression&); | |
80 | |
81 void visit_matrix (tree_matrix&); | |
82 | |
4219 | 83 void visit_cell (tree_cell&); |
84 | |
3011 | 85 void visit_multi_assignment (tree_multi_assignment&); |
86 | |
87 void visit_no_op_command (tree_no_op_command&); | |
88 | |
5861 | 89 void visit_anon_fcn_handle (tree_anon_fcn_handle&); |
90 | |
3011 | 91 void visit_constant (tree_constant&); |
92 | |
4342 | 93 void visit_fcn_handle (tree_fcn_handle&); |
94 | |
3011 | 95 void visit_parameter_list (tree_parameter_list&); |
96 | |
97 void visit_postfix_expression (tree_postfix_expression&); | |
98 | |
99 void visit_prefix_expression (tree_prefix_expression&); | |
100 | |
4207 | 101 void visit_return_command (tree_return_command&); |
3011 | 102 |
103 void visit_return_list (tree_return_list&); | |
104 | |
105 void visit_simple_assignment (tree_simple_assignment&); | |
106 | |
107 void visit_statement (tree_statement&); | |
108 | |
109 void visit_statement_list (tree_statement_list&); | |
110 | |
111 void visit_switch_case (tree_switch_case&); | |
112 | |
113 void visit_switch_case_list (tree_switch_case_list&); | |
114 | |
115 void visit_switch_command (tree_switch_command&); | |
116 | |
117 void visit_try_catch_command (tree_try_catch_command&); | |
118 | |
119 void visit_unwind_protect_command (tree_unwind_protect_command&); | |
120 | |
121 void visit_while_command (tree_while_command&); | |
122 | |
4229 | 123 void visit_do_until_command (tree_do_until_command&); |
124 | |
3011 | 125 private: |
126 | |
127 bool do_lvalue_check; | |
128 | |
8658
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
7715
diff
changeset
|
129 void do_decl_command (tree_decl_command&); |
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
7715
diff
changeset
|
130 |
3523 | 131 void gripe (const std::string& msg, int line); |
3011 | 132 |
133 // No copying! | |
134 | |
135 tree_checker (const tree_checker&); | |
136 | |
137 tree_checker& operator = (const tree_checker&); | |
138 }; | |
139 | |
140 #endif | |
141 | |
142 /* | |
143 ;;; Local Variables: *** | |
144 ;;; mode: C++ *** | |
145 ;;; End: *** | |
146 */ |