Mercurial > hg > octave-nkf
annotate libinterp/parse-tree/pt-bp.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 |
---|---|
3771 | 1 /* |
2 | |
17744
d63878346099
maint: Update copyright notices for release.
John W. Eaton <jwe@octave.org>
parents:
16596
diff
changeset
|
3 Copyright (C) 2001-2013 Ben Sapp |
3771 | 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. | |
3771 | 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/>. | |
3771 | 20 |
21 */ | |
22 | |
17822
ebb3ef964372
maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
23 #if !defined (octave_pt_bp_h) |
ebb3ef964372
maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
24 #define octave_pt_bp_h 1 |
3771 | 25 |
26 #include "input.h" | |
3805 | 27 #include "ov-usr-fcn.h" |
3771 | 28 #include "pt-walk.h" |
3805 | 29 #include "pt-pr-code.h" |
30 #include "toplev.h" | |
3771 | 31 |
32 class tree; | |
8658
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
7818
diff
changeset
|
33 class tree_decl_command; |
3771 | 34 |
35 class | |
36 tree_breakpoint : public tree_walker | |
37 { | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
38 public: |
3771 | 39 |
40 enum action { set = 1, clear = 2, list = 3 }; | |
41 | |
42 tree_breakpoint (int l, action a) | |
3805 | 43 : line (l), act (a), found (false), bp_list () { } |
3771 | 44 |
45 ~tree_breakpoint (void) { } | |
46 | |
47 bool success (void) const { return found; } | |
48 | |
49 void visit_argument_list (tree_argument_list&); | |
50 | |
51 void visit_binary_expression (tree_binary_expression&); | |
52 | |
4207 | 53 void visit_break_command (tree_break_command&); |
3771 | 54 |
55 void visit_colon_expression (tree_colon_expression&); | |
56 | |
4207 | 57 void visit_continue_command (tree_continue_command&); |
3771 | 58 |
8658
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
7818
diff
changeset
|
59 void visit_global_command (tree_global_command&); |
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
7818
diff
changeset
|
60 |
14294
9e3983c8963c
deprecate the static keyword
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
61 void visit_persistent_command (tree_persistent_command&); |
3771 | 62 |
63 void visit_decl_elt (tree_decl_elt&); | |
64 | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
65 void visit_decl_init_list (tree_decl_init_list&); |
3771 | 66 |
67 void visit_while_command (tree_while_command&); | |
68 | |
69 void visit_do_until_command (tree_do_until_command&); | |
70 | |
71 void visit_simple_for_command (tree_simple_for_command&); | |
72 | |
73 void visit_complex_for_command (tree_complex_for_command&); | |
74 | |
7715
5b4d278ec828
parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
75 void visit_octave_user_script (octave_user_script&); |
5b4d278ec828
parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
76 |
3771 | 77 void visit_octave_user_function (octave_user_function&); |
78 | |
79 void visit_octave_user_function_header (octave_user_function&); | |
80 | |
81 void visit_octave_user_function_trailer (octave_user_function&); | |
82 | |
7715
5b4d278ec828
parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
83 void visit_function_def (tree_function_def&); |
5b4d278ec828
parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
84 |
3771 | 85 void visit_identifier (tree_identifier&); |
86 | |
87 void visit_if_clause (tree_if_clause&); | |
88 | |
89 void visit_if_command (tree_if_command&); | |
90 | |
91 void visit_if_command_list (tree_if_command_list&); | |
92 | |
93 void visit_index_expression (tree_index_expression&); | |
94 | |
95 void visit_matrix (tree_matrix&); | |
96 | |
97 void visit_cell (tree_cell&); | |
98 | |
99 void visit_multi_assignment (tree_multi_assignment&); | |
100 | |
101 void visit_no_op_command (tree_no_op_command&); | |
102 | |
5861 | 103 void visit_anon_fcn_handle (tree_anon_fcn_handle&); |
104 | |
3771 | 105 void visit_constant (tree_constant&); |
106 | |
4342 | 107 void visit_fcn_handle (tree_fcn_handle&); |
108 | |
15035 | 109 void visit_funcall (tree_funcall&); |
110 | |
3771 | 111 void visit_parameter_list (tree_parameter_list&); |
112 | |
113 void visit_postfix_expression (tree_postfix_expression&); | |
114 | |
115 void visit_prefix_expression (tree_prefix_expression&); | |
116 | |
4207 | 117 void visit_return_command (tree_return_command&); |
3771 | 118 |
119 void visit_return_list (tree_return_list&); | |
120 | |
121 void visit_simple_assignment (tree_simple_assignment&); | |
122 | |
123 void visit_statement (tree_statement&); | |
124 | |
125 void visit_statement_list (tree_statement_list&); | |
126 | |
127 void visit_switch_case (tree_switch_case&); | |
128 | |
129 void visit_switch_case_list (tree_switch_case_list&); | |
130 | |
131 void visit_switch_command (tree_switch_command&); | |
132 | |
133 void visit_try_catch_command (tree_try_catch_command&); | |
134 | |
135 void visit_unwind_protect_command (tree_unwind_protect_command&); | |
136 | |
3805 | 137 octave_value_list get_list (void) { return bp_list; } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
138 |
16596
645672f1c873
handle setting breakpoints in subfunctions in GUI editor
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
139 int get_line (void) { return found ? line : 0; } |
3771 | 140 |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
141 private: |
3771 | 142 |
8658
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
7818
diff
changeset
|
143 void do_decl_command (tree_decl_command&); |
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
7818
diff
changeset
|
144 |
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
7818
diff
changeset
|
145 void take_action (tree& tr); |
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
7818
diff
changeset
|
146 |
73c4516fae10
New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents:
7818
diff
changeset
|
147 void take_action (tree_statement& stmt); |
3771 | 148 |
3805 | 149 // Statement line number we are looking for. |
3771 | 150 int line; |
151 | |
3805 | 152 // What to do. |
3771 | 153 action act; |
3805 | 154 |
155 // Have we already found the line? | |
3771 | 156 bool found; |
157 | |
3805 | 158 // List of breakpoint line numbers. |
159 octave_value_list bp_list; | |
3771 | 160 |
161 // No copying! | |
162 | |
163 tree_breakpoint (const tree_breakpoint&); | |
164 | |
165 tree_breakpoint& operator = (const tree_breakpoint&); | |
166 }; | |
167 | |
4185 | 168 // TRUE means SIGINT should put us in the debugger at the next |
169 // available breakpoint. | |
170 extern bool octave_debug_on_interrupt_state; | |
171 | |
3771 | 172 #endif |