Mercurial > hg > octave-nkf
annotate src/pt-check.h @ 7715:5b4d278ec828
parse scripts completely before executing
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 16 Apr 2008 15:09:56 -0400 |
parents | a1dbe9d80eee |
children | 73c4516fae10 |
rev | line source |
---|---|
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 | |
7715
5b4d278ec828
parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
61 void visit_octave_user_script (octave_user_script&); |
5b4d278ec828
parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
62 |
3011 | 63 void visit_octave_user_function (octave_user_function&); |
64 | |
7715
5b4d278ec828
parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
65 void visit_function_def (tree_function_def&); |
5b4d278ec828
parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
66 |
3011 | 67 void visit_identifier (tree_identifier&); |
68 | |
69 void visit_if_clause (tree_if_clause&); | |
70 | |
71 void visit_if_command (tree_if_command&); | |
72 | |
73 void visit_if_command_list (tree_if_command_list&); | |
74 | |
75 void visit_index_expression (tree_index_expression&); | |
76 | |
77 void visit_matrix (tree_matrix&); | |
78 | |
4219 | 79 void visit_cell (tree_cell&); |
80 | |
3011 | 81 void visit_multi_assignment (tree_multi_assignment&); |
82 | |
83 void visit_no_op_command (tree_no_op_command&); | |
84 | |
5861 | 85 void visit_anon_fcn_handle (tree_anon_fcn_handle&); |
86 | |
3011 | 87 void visit_constant (tree_constant&); |
88 | |
4342 | 89 void visit_fcn_handle (tree_fcn_handle&); |
90 | |
3011 | 91 void visit_parameter_list (tree_parameter_list&); |
92 | |
93 void visit_postfix_expression (tree_postfix_expression&); | |
94 | |
95 void visit_prefix_expression (tree_prefix_expression&); | |
96 | |
4207 | 97 void visit_return_command (tree_return_command&); |
3011 | 98 |
99 void visit_return_list (tree_return_list&); | |
100 | |
101 void visit_simple_assignment (tree_simple_assignment&); | |
102 | |
103 void visit_statement (tree_statement&); | |
104 | |
105 void visit_statement_list (tree_statement_list&); | |
106 | |
107 void visit_switch_case (tree_switch_case&); | |
108 | |
109 void visit_switch_case_list (tree_switch_case_list&); | |
110 | |
111 void visit_switch_command (tree_switch_command&); | |
112 | |
113 void visit_try_catch_command (tree_try_catch_command&); | |
114 | |
115 void visit_unwind_protect_command (tree_unwind_protect_command&); | |
116 | |
117 void visit_while_command (tree_while_command&); | |
118 | |
4229 | 119 void visit_do_until_command (tree_do_until_command&); |
120 | |
3011 | 121 private: |
122 | |
123 bool do_lvalue_check; | |
124 | |
3523 | 125 void gripe (const std::string& msg, int line); |
3011 | 126 |
127 // No copying! | |
128 | |
129 tree_checker (const tree_checker&); | |
130 | |
131 tree_checker& operator = (const tree_checker&); | |
132 }; | |
133 | |
134 #endif | |
135 | |
136 /* | |
137 ;;; Local Variables: *** | |
138 ;;; mode: C++ *** | |
139 ;;; End: *** | |
140 */ |