Mercurial > hg > octave-nkf
annotate libinterp/parse-tree/pt-walk.h @ 19318:995df67fc912
Flip arrays - ND support for fliplr and flipud, and replace flipdim with flip.
* fliplr.m, flipud.m: add support for N-dimensional arrays by making use
of flip(). Added new tests for ND arrays and defaults.
* flipdim.m: deprecate in favour of new function flip() which has exactly the
same syntax and is part of Matlab since R2014a.
* flip.m: new function copied from flipdim. Added tests for ND arrays and
defaults.
* matrix.txi: replace flipdim DOCSTRINg with flip.
* rot90.m, rotdim.m, del2.m: replace flipdim() with flip()
* NEWS: note deprecation of flip(), new function flipdim(), and ND support
for flipud() and fliplr().
author | Carnë Draug <carandraug+dev@gmail.com> |
---|---|
date | Sun, 21 Sep 2014 18:49:08 +0100 |
parents | 97e49b588f5d |
children | 4197fc428c7d |
rev | line source |
---|---|
2123 | 1 /* |
2 | |
17744
d63878346099
maint: Update copyright notices for release.
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
3 Copyright (C) 1996-2013 John W. Eaton |
2123 | 4 |
5 This file is part of Octave. | |
6 | |
7 Octave is free software; you can redistribute it and/or modify it | |
8 under the terms of the GNU General Public License as published by the | |
7016 | 9 Free Software Foundation; either version 3 of the License, or (at your |
10 option) any later version. | |
2123 | 11 |
12 Octave is distributed in the hope that it will be useful, but WITHOUT | |
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 for more details. | |
16 | |
17 You should have received a copy of the GNU General Public License | |
7016 | 18 along with Octave; see the file COPYING. If not, see |
19 <http://www.gnu.org/licenses/>. | |
2123 | 20 |
21 */ | |
22 | |
17822
ebb3ef964372
maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
23 #if !defined (octave_pt_walk_h) |
ebb3ef964372
maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
24 #define octave_pt_walk_h 1 |
2123 | 25 |
5861 | 26 class tree_anon_fcn_handle; |
2876 | 27 class tree_argument_list; |
28 class tree_binary_expression; | |
4207 | 29 class tree_break_command; |
2876 | 30 class tree_colon_expression; |
4207 | 31 class tree_continue_command; |
8658
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
7715
diff
changeset
|
32 class tree_global_command; |
14294
9e3983c8963c
deprecate the static keyword
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
33 class tree_persistent_command; |
2876 | 34 class tree_decl_elt; |
35 class tree_decl_init_list; | |
2969 | 36 class tree_simple_for_command; |
37 class tree_complex_for_command; | |
7715
5b4d278ec828
parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
38 class octave_user_script; |
2891 | 39 class octave_user_function; |
7715
5b4d278ec828
parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
40 class tree_function_def; |
2876 | 41 class tree_identifier; |
42 class tree_if_clause; | |
43 class tree_if_command; | |
44 class tree_if_command_list; | |
45 class tree_switch_case; | |
46 class tree_switch_case_list; | |
47 class tree_switch_command; | |
48 class tree_index_expression; | |
49 class tree_matrix; | |
3351 | 50 class tree_cell; |
2969 | 51 class tree_multi_assignment; |
2876 | 52 class tree_no_op_command; |
53 class tree_constant; | |
4342 | 54 class tree_fcn_handle; |
15035 | 55 class tree_funcall; |
2876 | 56 class tree_parameter_list; |
57 class tree_postfix_expression; | |
58 class tree_prefix_expression; | |
4207 | 59 class tree_return_command; |
2876 | 60 class tree_return_list; |
2969 | 61 class tree_simple_assignment; |
2876 | 62 class tree_statement; |
63 class tree_statement_list; | |
64 class tree_try_catch_command; | |
65 class tree_unwind_protect_command; | |
66 class tree_while_command; | |
3484 | 67 class tree_do_until_command; |
2123 | 68 |
15037
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
69 class tree_classdef_attribute; |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
70 class tree_classdef_attribute_list; |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
71 class tree_classdef_superclass; |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
72 class tree_classdef_superclass_list; |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
73 class tree_classdef_property; |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
74 class tree_classdef_property_list; |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
75 class tree_classdef_properties_block; |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
76 class tree_classdef_methods_list; |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
77 class tree_classdef_methods_block; |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
78 class tree_classdef_event; |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
79 class tree_classdef_events_list; |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
80 class tree_classdef_events_block; |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
81 class tree_classdef_enum; |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
82 class tree_classdef_enum_list; |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
83 class tree_classdef_enum_block; |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
84 class tree_classdef_body; |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
85 class tree_classdef; |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
86 |
2123 | 87 class |
88 tree_walker | |
89 { | |
90 public: | |
91 | |
92 virtual void | |
5861 | 93 visit_anon_fcn_handle (tree_anon_fcn_handle&) = 0; |
94 | |
95 virtual void | |
2123 | 96 visit_argument_list (tree_argument_list&) = 0; |
97 | |
98 virtual void | |
99 visit_binary_expression (tree_binary_expression&) = 0; | |
100 | |
101 virtual void | |
4207 | 102 visit_break_command (tree_break_command&) = 0; |
2123 | 103 |
104 virtual void | |
105 visit_colon_expression (tree_colon_expression&) = 0; | |
106 | |
107 virtual void | |
4207 | 108 visit_continue_command (tree_continue_command&) = 0; |
2123 | 109 |
110 virtual void | |
8658
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
7715
diff
changeset
|
111 visit_global_command (tree_global_command&) = 0; |
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
7715
diff
changeset
|
112 |
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
7715
diff
changeset
|
113 virtual void |
14294
9e3983c8963c
deprecate the static keyword
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
114 visit_persistent_command (tree_persistent_command&) = 0; |
2846 | 115 |
116 virtual void | |
117 visit_decl_elt (tree_decl_elt&) = 0; | |
118 | |
119 virtual void | |
120 visit_decl_init_list (tree_decl_init_list&) = 0; | |
121 | |
122 virtual void | |
2969 | 123 visit_simple_for_command (tree_simple_for_command&) = 0; |
124 | |
125 virtual void | |
126 visit_complex_for_command (tree_complex_for_command&) = 0; | |
2123 | 127 |
128 virtual void | |
7715
5b4d278ec828
parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
129 visit_octave_user_script (octave_user_script&) = 0; |
5b4d278ec828
parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
130 |
5b4d278ec828
parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
131 virtual void |
2891 | 132 visit_octave_user_function (octave_user_function&) = 0; |
2123 | 133 |
134 virtual void | |
7715
5b4d278ec828
parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
135 visit_function_def (tree_function_def&) = 0; |
5b4d278ec828
parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
136 |
5b4d278ec828
parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
137 virtual void |
2123 | 138 visit_identifier (tree_identifier&) = 0; |
139 | |
140 virtual void | |
141 visit_if_clause (tree_if_clause&) = 0; | |
142 | |
143 virtual void | |
144 visit_if_command (tree_if_command&) = 0; | |
145 | |
146 virtual void | |
147 visit_if_command_list (tree_if_command_list&) = 0; | |
148 | |
149 virtual void | |
2764 | 150 visit_switch_case (tree_switch_case&) = 0; |
151 | |
152 virtual void | |
153 visit_switch_case_list (tree_switch_case_list&) = 0; | |
154 | |
155 virtual void | |
156 visit_switch_command (tree_switch_command&) = 0; | |
157 | |
158 virtual void | |
2123 | 159 visit_index_expression (tree_index_expression&) = 0; |
160 | |
161 virtual void | |
162 visit_matrix (tree_matrix&) = 0; | |
163 | |
164 virtual void | |
3351 | 165 visit_cell (tree_cell&) = 0; |
166 | |
167 virtual void | |
2969 | 168 visit_multi_assignment (tree_multi_assignment&) = 0; |
2123 | 169 |
170 virtual void | |
2620 | 171 visit_no_op_command (tree_no_op_command&) = 0; |
172 | |
173 virtual void | |
2372 | 174 visit_constant (tree_constant&) = 0; |
2123 | 175 |
176 virtual void | |
4342 | 177 visit_fcn_handle (tree_fcn_handle&) = 0; |
178 | |
179 virtual void | |
15035 | 180 visit_funcall (tree_funcall&) = 0; |
181 | |
182 virtual void | |
2123 | 183 visit_parameter_list (tree_parameter_list&) = 0; |
184 | |
185 virtual void | |
186 visit_postfix_expression (tree_postfix_expression&) = 0; | |
187 | |
188 virtual void | |
189 visit_prefix_expression (tree_prefix_expression&) = 0; | |
190 | |
191 virtual void | |
4207 | 192 visit_return_command (tree_return_command&) = 0; |
2123 | 193 |
194 virtual void | |
195 visit_return_list (tree_return_list&) = 0; | |
196 | |
197 virtual void | |
2969 | 198 visit_simple_assignment (tree_simple_assignment&) = 0; |
2123 | 199 |
200 virtual void | |
201 visit_statement (tree_statement&) = 0; | |
202 | |
203 virtual void | |
204 visit_statement_list (tree_statement_list&) = 0; | |
205 | |
206 virtual void | |
207 visit_try_catch_command (tree_try_catch_command&) = 0; | |
208 | |
209 virtual void | |
210 visit_unwind_protect_command (tree_unwind_protect_command&) = 0; | |
211 | |
212 virtual void | |
213 visit_while_command (tree_while_command&) = 0; | |
214 | |
3484 | 215 virtual void |
216 visit_do_until_command (tree_do_until_command&) = 0; | |
217 | |
15037
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
218 virtual void |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
219 visit_classdef_attribute (tree_classdef_attribute&) { } /* = 0; */ |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
220 |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
221 virtual void |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
222 visit_classdef_attribute_list (tree_classdef_attribute_list&) { } /* = 0; */ |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
223 |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
224 virtual void |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
225 visit_classdef_superclass (tree_classdef_superclass&) { } /* = 0; */ |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
226 |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
227 virtual void |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
228 visit_classdef_superclass_list (tree_classdef_superclass_list&) { } /* = 0; */ |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
229 |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
230 virtual void |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
231 visit_classdef_property (tree_classdef_property&) { } /* = 0; */ |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
232 |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
233 virtual void |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
234 visit_classdef_property_list (tree_classdef_property_list&) { } /* = 0; */ |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
235 |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
236 virtual void |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
237 visit_classdef_properties_block (tree_classdef_properties_block&) { } /* = 0; */ |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
238 |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
239 virtual void |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
240 visit_classdef_methods_list (tree_classdef_methods_list&) { } /* = 0; */ |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
241 |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
242 virtual void |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
243 visit_classdef_methods_block (tree_classdef_methods_block&) { } /* = 0; */ |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
244 |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
245 virtual void |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
246 visit_classdef_event (tree_classdef_event&) { } /* = 0; */ |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
247 |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
248 virtual void |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
249 visit_classdef_events_list (tree_classdef_events_list&) { } /* = 0; */ |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
250 |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
251 virtual void |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
252 visit_classdef_events_block (tree_classdef_events_block&) { } /* = 0; */ |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
253 |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
254 virtual void |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
255 visit_classdef_enum (tree_classdef_enum&) { } /* = 0; */ |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
256 |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
257 virtual void |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
258 visit_classdef_enum_list (tree_classdef_enum_list&) { } /* = 0; */ |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
259 |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
260 virtual void |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
261 visit_classdef_enum_block (tree_classdef_enum_block&) { } /* = 0; */ |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
262 |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
263 virtual void |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
264 visit_classdef_body (tree_classdef_body&) { } /* = 0; */ |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
265 |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
266 virtual void |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
267 visit_classdef (tree_classdef&) { } /* = 0; */ |
56b8eb7c9c04
improvements in parsing classdef
John W. Eaton <jwe@octave.org>
parents:
15035
diff
changeset
|
268 |
2123 | 269 protected: |
270 | |
271 tree_walker (void) { } | |
272 | |
273 virtual ~tree_walker (void) { } | |
274 | |
275 private: | |
276 | |
277 // No copying! | |
278 | |
279 tree_walker (const tree_walker&); | |
280 | |
281 tree_walker& operator = (const tree_walker&); | |
282 }; | |
283 | |
284 #endif |