Mercurial > octave
annotate libinterp/parse-tree/pt-exp.h @ 31394:7781b1e77406
use separate class for braindead shortcircuit evaluation
Change adapted from patch #10238 by Petter Tomner <tomner@kth.se>.
* parse.h, oct-parse.yy
(base_parser::maybe_convert_to_braindead_shortcircuit): New function.
(if_cmd_list1, elseif_clause, loop_command): Use it to convert
expressions that could be evaluated using Matlab-style short-circuit
rules to be tree_braindead_shortcircuit_binary_expression objects
instead of simple tree_binary_expression objects.
* pt-exp.h (tree_expression::mark_braindead_shortcircuit): Delete.
* pt-binop.h (tree_binary_expression::mark_braindead_shortcircuit):
Delete.
* pt-binop.h, pt-binop.cc
(tree_braindead_shortcircuit_binary_expression): New class to evaluate
Matlab-style short-circuit expressions.
* pt-binop.h, pt-binop.cc (tree_binary_expression::preserve_operands):
New function.
(tree_binary_expression::m_preserve_operands): New private data member.
(tree_binary_expression::m_eligible_for_braindead_shortcircuit):
Delete data member.
(tree_binary_expression::is_eligible_for_braindead_shortcircuit):
Delete function.
(tree_binary_expression::mark_braindead_shortcircuit): Delete function.
(tree_binary_expression::~tree_binary_expression): Don't delete m_lhs
or m_rhs if m_preserve_operands is true.
(tree_binary_expression::evaluate): Don't check for or process
Matlab-style short-circuit expressions here.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 03 Nov 2022 17:50:24 -0400 |
parents | 97504d2edcc7 |
children | e88a07dec498 |
rev | line source |
---|---|
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
1 //////////////////////////////////////////////////////////////////////// |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
2 // |
30564
796f54d4ddbf
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
30181
diff
changeset
|
3 // Copyright (C) 1996-2022 The Octave Project Developers |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
4 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
5 // See the file COPYRIGHT.md in the top-level directory of this |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
6 // distribution or <https://octave.org/copyright/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
7 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
8 // This file is part of Octave. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
9 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
10 // Octave is free software: you can redistribute it and/or modify it |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
11 // under the terms of the GNU General Public License as published by |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
12 // the Free Software Foundation, either version 3 of the License, or |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
13 // (at your option) any later version. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
14 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
15 // Octave is distributed in the hope that it will be useful, but |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
16 // WITHOUT ANY WARRANTY; without even the implied warranty of |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
18 // GNU General Public License for more details. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
19 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
20 // You should have received a copy of the GNU General Public License |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
21 // along with Octave; see the file COPYING. If not, see |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
22 // <https://www.gnu.org/licenses/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
23 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
24 //////////////////////////////////////////////////////////////////////// |
1739 | 25 |
20791
f7084eae3318
maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
26 #if ! defined (octave_pt_exp_h) |
17822
ebb3ef964372
maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
27 #define octave_pt_exp_h 1 |
1739 | 28 |
21244
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
29 #include "octave-config.h" |
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
30 |
2980 | 31 #include <string> |
10832
1b2fcd122c6a
allow user detect ignored outputs in m-functions
Jaroslav Hajek <highegg@gmail.com>
parents:
10313
diff
changeset
|
32 #include <list> |
2124 | 33 |
2879 | 34 class octave_value; |
35 | |
2988 | 36 #include "pt.h" |
27371
fcaecdbc8d8a
don't use visitor pattern for expression evaluation (bug #56752)
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
37 #include "pt-eval.h" |
2124 | 38 |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
39 namespace octave |
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
40 { |
24362
3fc24b792a24
avoid including symtab.h, symscope.h, or symrec.h unnecessarily
John W. Eaton <jwe@octave.org>
parents:
24355
diff
changeset
|
41 class symbol_scope; |
24355
cc3b3ceb155c
update octave_lvalue class and move inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24270
diff
changeset
|
42 class octave_lvalue; |
23435
c452180ab672
begin refactoring parse tree evaluator
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
43 |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
44 // A base class for expressions. |
1739 | 45 |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
46 class tree_expression : public tree |
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
47 { |
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
48 public: |
2388 | 49 |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
50 tree_expression (int l = -1, int c = -1) |
30181
667b868861ba
maint: use "m_" prefix for protected member variables in class tree_expression.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
51 : tree (l, c), m_num_parens (0), m_postfix_index_type ('\0'), |
667b868861ba
maint: use "m_" prefix for protected member variables in class tree_expression.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
52 m_for_cmd_expr (false), m_print_flag (false) { } |
2388 | 53 |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
54 // No copying! |
2388 | 55 |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
56 tree_expression (const tree_expression&) = delete; |
4267 | 57 |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
58 tree_expression& operator = (const tree_expression&) = delete; |
5861 | 59 |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
60 virtual ~tree_expression (void) = default; |
2388 | 61 |
24270
bc3819b7cca1
don't use symbol_table:: nesting for symbol_record, symbol_scope, or fcn_info
John W. Eaton <jwe@octave.org>
parents:
23696
diff
changeset
|
62 virtual tree_expression * dup (symbol_scope& scope) const = 0; |
2388 | 63 |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
64 virtual bool is_constant (void) const { return false; } |
1739 | 65 |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
66 virtual bool is_matrix (void) const { return false; } |
1739 | 67 |
23576
00e518162fda
maint: Deprecate is_cell and replace with iscell.
Rik <rik@octave.org>
parents:
23446
diff
changeset
|
68 virtual bool iscell (void) const { return false; } |
1739 | 69 |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
70 virtual bool is_identifier (void) const { return false; } |
1739 | 71 |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
72 virtual bool is_index_expression (void) const { return false; } |
7800
5861b95e9879
support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents:
7767
diff
changeset
|
73 |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
74 virtual bool is_assignment_expression (void) const { return false; } |
4023 | 75 |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
76 virtual bool is_prefix_expression (void) const { return false; } |
4023 | 77 |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
78 virtual bool is_unary_expression (void) const { return false; } |
1739 | 79 |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
80 virtual bool is_binary_expression (void) const { return false; } |
1739 | 81 |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
82 virtual bool is_boolean_expression (void) const { return false; } |
2124 | 83 |
30833
449e26c26b41
new is_colon_expression predicate for parse tree expression objects
John W. Eaton <jwe@octave.org>
parents:
30564
diff
changeset
|
84 virtual bool is_colon_expression (void) const { return false; } |
449e26c26b41
new is_colon_expression predicate for parse tree expression objects
John W. Eaton <jwe@octave.org>
parents:
30564
diff
changeset
|
85 |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
86 virtual bool lvalue_ok (void) const { return false; } |
2879 | 87 |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
88 virtual bool rvalue_ok (void) const { return false; } |
10832
1b2fcd122c6a
allow user detect ignored outputs in m-functions
Jaroslav Hajek <highegg@gmail.com>
parents:
10313
diff
changeset
|
89 |
25383
d3a035528c9a
use reference to tree_evaluator instead of pointer
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
90 virtual octave_lvalue lvalue (tree_evaluator&); |
2124 | 91 |
30181
667b868861ba
maint: use "m_" prefix for protected member variables in class tree_expression.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
92 int paren_count (void) const { return m_num_parens; } |
1739 | 93 |
30346
91c6288781ba
maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents:
30181
diff
changeset
|
94 bool is_postfix_indexed (void) const |
91c6288781ba
maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents:
30181
diff
changeset
|
95 { return (m_postfix_index_type != '\0'); } |
15954
46ca8488de92
Re-engineer tree_expression postfix handling to make it more flexible.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
15606
diff
changeset
|
96 |
30181
667b868861ba
maint: use "m_" prefix for protected member variables in class tree_expression.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
97 char postfix_index (void) const { return m_postfix_index_type; } |
1739 | 98 |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
99 // Check if the result of the expression should be printed. |
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
100 // Should normally be used in conjunction with |
23696
08036a7f3660
remove octave:: namespace tag from symbols used inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
23615
diff
changeset
|
101 // tree_evaluator::statement_printing_enabled. |
30181
667b868861ba
maint: use "m_" prefix for protected member variables in class tree_expression.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
102 bool print_result (void) const { return m_print_flag; } |
2124 | 103 |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
104 virtual std::string oper (void) const { return "<unknown>"; } |
1739 | 105 |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
106 virtual std::string name (void) const { return "<unknown>"; } |
1739 | 107 |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
108 virtual std::string original_text (void) const; |
11091
5677f3f7b5fa
Matlab compatible short-circuit behavior for & and | operators
John W. Eaton <jwe@octave.org>
parents:
10832
diff
changeset
|
109 |
30181
667b868861ba
maint: use "m_" prefix for protected member variables in class tree_expression.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
110 void mark_as_for_cmd_expr (void) { m_for_cmd_expr = true; } |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
111 |
30181
667b868861ba
maint: use "m_" prefix for protected member variables in class tree_expression.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
112 bool is_for_cmd_expr (void) const { return m_for_cmd_expr; } |
19394
b39cbe9f3bb0
allow ranges to be disabled
John W. Eaton <jwe@octave.org>
parents:
18132
diff
changeset
|
113 |
23446
cd4e1ee28716
maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents:
23435
diff
changeset
|
114 tree_expression * mark_in_parens (void) |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
115 { |
30181
667b868861ba
maint: use "m_" prefix for protected member variables in class tree_expression.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
116 m_num_parens++; |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
117 return this; |
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
118 } |
1739 | 119 |
23446
cd4e1ee28716
maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents:
23435
diff
changeset
|
120 tree_expression * set_postfix_index (char type) |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
121 { |
30181
667b868861ba
maint: use "m_" prefix for protected member variables in class tree_expression.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
122 m_postfix_index_type = type; |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
123 return this; |
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
124 } |
2971 | 125 |
23446
cd4e1ee28716
maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents:
23435
diff
changeset
|
126 tree_expression * set_print_flag (bool print) |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
127 { |
30181
667b868861ba
maint: use "m_" prefix for protected member variables in class tree_expression.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
128 m_print_flag = print; |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
129 return this; |
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
130 } |
2971 | 131 |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
132 virtual void copy_base (const tree_expression& e) |
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
133 { |
30181
667b868861ba
maint: use "m_" prefix for protected member variables in class tree_expression.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
134 m_num_parens = e.m_num_parens; |
667b868861ba
maint: use "m_" prefix for protected member variables in class tree_expression.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
135 m_postfix_index_type = e.m_postfix_index_type; |
667b868861ba
maint: use "m_" prefix for protected member variables in class tree_expression.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
136 m_print_flag = e.m_print_flag; |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
137 } |
5861 | 138 |
27371
fcaecdbc8d8a
don't use visitor pattern for expression evaluation (bug #56752)
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
139 virtual octave_value evaluate (tree_evaluator& tw, int nargout = 1) = 0; |
fcaecdbc8d8a
don't use visitor pattern for expression evaluation (bug #56752)
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
140 |
fcaecdbc8d8a
don't use visitor pattern for expression evaluation (bug #56752)
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
141 virtual octave_value_list |
fcaecdbc8d8a
don't use visitor pattern for expression evaluation (bug #56752)
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
142 evaluate_n (tree_evaluator& tw, int nargout = 1) = 0; |
fcaecdbc8d8a
don't use visitor pattern for expression evaluation (bug #56752)
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
143 |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
144 protected: |
2971 | 145 |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
146 // A count of the number of times this expression appears directly |
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
147 // inside a set of parentheses. |
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
148 // |
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
149 // (((e1)) + e2) ==> 2 for expression e1 |
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
150 // ==> 1 for expression ((e1)) + e2 |
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
151 // ==> 0 for expression e2 |
30181
667b868861ba
maint: use "m_" prefix for protected member variables in class tree_expression.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
152 int m_num_parens; |
2971 | 153 |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
154 // The first index type associated with this expression. This field |
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
155 // is 0 (character '\0') if the expression has no associated index. |
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
156 // See the code in tree_identifier::rvalue for the rationale. |
30181
667b868861ba
maint: use "m_" prefix for protected member variables in class tree_expression.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
157 char m_postfix_index_type; |
2971 | 158 |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
159 // TRUE if this expression is the EXPR in for loop: |
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
160 // FOR i = EXPR ... END |
30181
667b868861ba
maint: use "m_" prefix for protected member variables in class tree_expression.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
161 bool m_for_cmd_expr; |
19394
b39cbe9f3bb0
allow ranges to be disabled
John W. Eaton <jwe@octave.org>
parents:
18132
diff
changeset
|
162 |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
163 // Print result of rvalue for this expression? |
30181
667b868861ba
maint: use "m_" prefix for protected member variables in class tree_expression.
Rik <rik@octave.org>
parents:
29358
diff
changeset
|
164 bool m_print_flag; |
23075
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
165 }; |
4e3d47dc7e25
move parse tree classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
166 } |
2988 | 167 |
1739 | 168 #endif |