annotate src/pt-binop.h @ 11091:5677f3f7b5fa

Matlab compatible short-circuit behavior for & and | operators
author John W. Eaton <jwe@octave.org>
date Fri, 08 Oct 2010 15:22:47 -0400
parents f3b65e1ae355
children fd0a3ac60b0e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2980
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
1 /*
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
2
8920
eb63fbe60fab update copyright notices
John W. Eaton <jwe@octave.org>
parents: 8913
diff changeset
3 Copyright (C) 1996, 1997, 2000, 2002, 2003, 2004, 2005, 2006, 2007,
eb63fbe60fab update copyright notices
John W. Eaton <jwe@octave.org>
parents: 8913
diff changeset
4 2008, 2009 John W. Eaton
2980
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
5
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
6 This file is part of Octave.
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
7
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
8 Octave is free software; you can redistribute it and/or modify it
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
9 under the terms of the GNU General Public License as published by the
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5861
diff changeset
10 Free Software Foundation; either version 3 of the License, or (at your
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5861
diff changeset
11 option) any later version.
2980
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
12
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
13 Octave is distributed in the hope that it will be useful, but WITHOUT
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
16 for more details.
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
17
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5861
diff changeset
19 along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5861
diff changeset
20 <http://www.gnu.org/licenses/>.
2980
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
21
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
22 */
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
23
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
24 #if !defined (octave_tree_binop_h)
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
25 #define octave_tree_binop_h 1
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
26
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
27 #include <string>
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
28
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
29 class tree_walker;
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
30
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
31 class octave_value;
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
32 class octave_value_list;
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
33 class octave_lvalue;
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
34
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
35 #include "ov.h"
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
36 #include "pt-exp.h"
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
37 #include "symtab.h"
2980
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
38
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
39 // Binary expressions.
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
40
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
41 class
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
42 tree_binary_expression : public tree_expression
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
43 {
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
44 public:
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
45
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
46 tree_binary_expression (int l = -1, int c = -1,
10313
f3b65e1ae355 untabify src header files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
47 octave_value::binary_op t
f3b65e1ae355 untabify src header files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
48 = octave_value::unknown_binary_op)
11091
5677f3f7b5fa Matlab compatible short-circuit behavior for & and | operators
John W. Eaton <jwe@octave.org>
parents: 10313
diff changeset
49 : tree_expression (l, c), op_lhs (0), op_rhs (0), etype (t),
5677f3f7b5fa Matlab compatible short-circuit behavior for & and | operators
John W. Eaton <jwe@octave.org>
parents: 10313
diff changeset
50 eligible_for_braindead_shortcircuit (false) { }
2980
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
51
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
52 tree_binary_expression (tree_expression *a, tree_expression *b,
10313
f3b65e1ae355 untabify src header files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
53 int l = -1, int c = -1,
f3b65e1ae355 untabify src header files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
54 octave_value::binary_op t
f3b65e1ae355 untabify src header files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
55 = octave_value::unknown_binary_op)
11091
5677f3f7b5fa Matlab compatible short-circuit behavior for & and | operators
John W. Eaton <jwe@octave.org>
parents: 10313
diff changeset
56 : tree_expression (l, c), op_lhs (a), op_rhs (b), etype (t),
5677f3f7b5fa Matlab compatible short-circuit behavior for & and | operators
John W. Eaton <jwe@octave.org>
parents: 10313
diff changeset
57 eligible_for_braindead_shortcircuit (false) { }
2980
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
58
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
59 ~tree_binary_expression (void)
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
60 {
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
61 delete op_lhs;
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
62 delete op_rhs;
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
63 }
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
64
11091
5677f3f7b5fa Matlab compatible short-circuit behavior for & and | operators
John W. Eaton <jwe@octave.org>
parents: 10313
diff changeset
65 void mark_braindead_shortcircuit (const std::string& file)
5677f3f7b5fa Matlab compatible short-circuit behavior for & and | operators
John W. Eaton <jwe@octave.org>
parents: 10313
diff changeset
66 {
5677f3f7b5fa Matlab compatible short-circuit behavior for & and | operators
John W. Eaton <jwe@octave.org>
parents: 10313
diff changeset
67 if (etype == octave_value::op_el_and
5677f3f7b5fa Matlab compatible short-circuit behavior for & and | operators
John W. Eaton <jwe@octave.org>
parents: 10313
diff changeset
68 || etype == octave_value::op_el_or)
5677f3f7b5fa Matlab compatible short-circuit behavior for & and | operators
John W. Eaton <jwe@octave.org>
parents: 10313
diff changeset
69 {
5677f3f7b5fa Matlab compatible short-circuit behavior for & and | operators
John W. Eaton <jwe@octave.org>
parents: 10313
diff changeset
70 if (file.empty ())
5677f3f7b5fa Matlab compatible short-circuit behavior for & and | operators
John W. Eaton <jwe@octave.org>
parents: 10313
diff changeset
71 warning_with_id ("Octave:possible-matlab-short-circuit-operator",
5677f3f7b5fa Matlab compatible short-circuit behavior for & and | operators
John W. Eaton <jwe@octave.org>
parents: 10313
diff changeset
72 "possible Matlab-style short-circuit operator at line %d, column %d",
5677f3f7b5fa Matlab compatible short-circuit behavior for & and | operators
John W. Eaton <jwe@octave.org>
parents: 10313
diff changeset
73 line (), column ());
5677f3f7b5fa Matlab compatible short-circuit behavior for & and | operators
John W. Eaton <jwe@octave.org>
parents: 10313
diff changeset
74 else
5677f3f7b5fa Matlab compatible short-circuit behavior for & and | operators
John W. Eaton <jwe@octave.org>
parents: 10313
diff changeset
75 warning_with_id ("Octave:possible-matlab-short-circuit-operator",
5677f3f7b5fa Matlab compatible short-circuit behavior for & and | operators
John W. Eaton <jwe@octave.org>
parents: 10313
diff changeset
76 "%s: possible Matlab-style short-circuit operator at line %d, column %d",
5677f3f7b5fa Matlab compatible short-circuit behavior for & and | operators
John W. Eaton <jwe@octave.org>
parents: 10313
diff changeset
77 file.c_str (), line (), column ());
5677f3f7b5fa Matlab compatible short-circuit behavior for & and | operators
John W. Eaton <jwe@octave.org>
parents: 10313
diff changeset
78
5677f3f7b5fa Matlab compatible short-circuit behavior for & and | operators
John W. Eaton <jwe@octave.org>
parents: 10313
diff changeset
79 eligible_for_braindead_shortcircuit = true;
5677f3f7b5fa Matlab compatible short-circuit behavior for & and | operators
John W. Eaton <jwe@octave.org>
parents: 10313
diff changeset
80
5677f3f7b5fa Matlab compatible short-circuit behavior for & and | operators
John W. Eaton <jwe@octave.org>
parents: 10313
diff changeset
81 op_lhs->mark_braindead_shortcircuit (file);
5677f3f7b5fa Matlab compatible short-circuit behavior for & and | operators
John W. Eaton <jwe@octave.org>
parents: 10313
diff changeset
82 op_rhs->mark_braindead_shortcircuit (file);
5677f3f7b5fa Matlab compatible short-circuit behavior for & and | operators
John W. Eaton <jwe@octave.org>
parents: 10313
diff changeset
83 }
5677f3f7b5fa Matlab compatible short-circuit behavior for & and | operators
John W. Eaton <jwe@octave.org>
parents: 10313
diff changeset
84 }
5677f3f7b5fa Matlab compatible short-circuit behavior for & and | operators
John W. Eaton <jwe@octave.org>
parents: 10313
diff changeset
85
4267
7cd865a8c815 [project @ 2003-01-03 15:27:05 by jwe]
jwe
parents: 4192
diff changeset
86 bool has_magic_end (void) const
7cd865a8c815 [project @ 2003-01-03 15:27:05 by jwe]
jwe
parents: 4192
diff changeset
87 {
7cd865a8c815 [project @ 2003-01-03 15:27:05 by jwe]
jwe
parents: 4192
diff changeset
88 return ((op_lhs && op_lhs->has_magic_end ())
10313
f3b65e1ae355 untabify src header files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
89 || (op_rhs && op_rhs->has_magic_end ()));
4267
7cd865a8c815 [project @ 2003-01-03 15:27:05 by jwe]
jwe
parents: 4192
diff changeset
90 }
7cd865a8c815 [project @ 2003-01-03 15:27:05 by jwe]
jwe
parents: 4192
diff changeset
91
4023
ef3caf27cb9c [project @ 2002-08-07 06:54:41 by jwe]
jwe
parents: 3933
diff changeset
92 bool is_binary_expression (void) const { return true; }
ef3caf27cb9c [project @ 2002-08-07 06:54:41 by jwe]
jwe
parents: 3933
diff changeset
93
3933
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3523
diff changeset
94 bool rvalue_ok (void) const { return true; }
2980
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
95
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents: 8011
diff changeset
96 octave_value rvalue1 (int nargout = 1);
2980
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
97
3010
1aeb8869e464 [project @ 1997-06-01 19:24:02 by jwe]
jwe
parents: 2988
diff changeset
98 octave_value_list rvalue (int nargout);
2980
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
99
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3010
diff changeset
100 std::string oper (void) const;
2980
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
101
4023
ef3caf27cb9c [project @ 2002-08-07 06:54:41 by jwe]
jwe
parents: 3933
diff changeset
102 octave_value::binary_op op_type (void) const { return etype; }
ef3caf27cb9c [project @ 2002-08-07 06:54:41 by jwe]
jwe
parents: 3933
diff changeset
103
2980
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
104 tree_expression *lhs (void) { return op_lhs; }
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
105 tree_expression *rhs (void) { return op_rhs; }
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
106
7767
71f068b22fcc scope and context fixes for function handles
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
107 tree_expression *dup (symbol_table::scope_id scope,
10313
f3b65e1ae355 untabify src header files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
108 symbol_table::context_id context) const;
5861
2a6cb4ed8f1e [project @ 2006-06-16 05:09:41 by jwe]
jwe
parents: 5307
diff changeset
109
2980
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
110 void accept (tree_walker& tw);
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
111
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
112 protected:
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
113
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
114 // The operands for the expression.
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
115 tree_expression *op_lhs;
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
116 tree_expression *op_rhs;
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
117
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
118 private:
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
119
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
120 // The type of the expression.
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
121 octave_value::binary_op etype;
2988
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2980
diff changeset
122
11091
5677f3f7b5fa Matlab compatible short-circuit behavior for & and | operators
John W. Eaton <jwe@octave.org>
parents: 10313
diff changeset
123 // TRUE if this is an | or & expression in the condition of an IF
5677f3f7b5fa Matlab compatible short-circuit behavior for & and | operators
John W. Eaton <jwe@octave.org>
parents: 10313
diff changeset
124 // or WHILE statement.
5677f3f7b5fa Matlab compatible short-circuit behavior for & and | operators
John W. Eaton <jwe@octave.org>
parents: 10313
diff changeset
125 bool eligible_for_braindead_shortcircuit;
5677f3f7b5fa Matlab compatible short-circuit behavior for & and | operators
John W. Eaton <jwe@octave.org>
parents: 10313
diff changeset
126
2988
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2980
diff changeset
127 // No copying!
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2980
diff changeset
128
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2980
diff changeset
129 tree_binary_expression (const tree_binary_expression&);
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2980
diff changeset
130
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2980
diff changeset
131 tree_binary_expression& operator = (const tree_binary_expression&);
2980
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
132 };
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
133
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
134 // Boolean expressions.
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
135
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
136 class
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
137 tree_boolean_expression : public tree_binary_expression
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
138 {
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
139 public:
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
140
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
141 enum type
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
142 {
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
143 unknown,
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
144 bool_and,
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
145 bool_or
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
146 };
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
147
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
148 tree_boolean_expression (int l = -1, int c = -1, type t = unknown)
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
149 : tree_binary_expression (l, c), etype (t) { }
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
150
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
151 tree_boolean_expression (tree_expression *a, tree_expression *b,
10313
f3b65e1ae355 untabify src header files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
152 int l = -1, int c = -1, type t = unknown)
2980
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
153 : tree_binary_expression (a, b, l, c), etype (t) { }
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
154
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
155 ~tree_boolean_expression (void) { }
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
156
4023
ef3caf27cb9c [project @ 2002-08-07 06:54:41 by jwe]
jwe
parents: 3933
diff changeset
157 bool is_boolean_expression (void) const { return true; }
ef3caf27cb9c [project @ 2002-08-07 06:54:41 by jwe]
jwe
parents: 3933
diff changeset
158
3933
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3523
diff changeset
159 bool rvalue_ok (void) const { return true; }
2980
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
160
8658
73c4516fae10 New evaluator and debugger derived from tree-walker class
John W. Eaton <jwe@octave.org>
parents: 8011
diff changeset
161 octave_value rvalue1 (int nargout = 1);
2980
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
162
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
163 octave_value_list rvalue (int nargout);
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
164
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3010
diff changeset
165 std::string oper (void) const;
2980
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
166
4023
ef3caf27cb9c [project @ 2002-08-07 06:54:41 by jwe]
jwe
parents: 3933
diff changeset
167 type op_type (void) const { return etype; }
ef3caf27cb9c [project @ 2002-08-07 06:54:41 by jwe]
jwe
parents: 3933
diff changeset
168
7767
71f068b22fcc scope and context fixes for function handles
John W. Eaton <jwe@octave.org>
parents: 7336
diff changeset
169 tree_expression *dup (symbol_table::scope_id scope,
10313
f3b65e1ae355 untabify src header files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
170 symbol_table::context_id context) const;
5861
2a6cb4ed8f1e [project @ 2006-06-16 05:09:41 by jwe]
jwe
parents: 5307
diff changeset
171
2980
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
172 private:
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
173
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
174 // The type of the expression.
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
175 type etype;
2988
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2980
diff changeset
176
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2980
diff changeset
177 // No copying!
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2980
diff changeset
178
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2980
diff changeset
179 tree_boolean_expression (const tree_boolean_expression&);
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2980
diff changeset
180
daa1ed1f5462 [project @ 1997-05-16 07:23:15 by jwe]
jwe
parents: 2980
diff changeset
181 tree_boolean_expression& operator = (const tree_boolean_expression&);
2980
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
182 };
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
183
cd5ad3fd8049 [project @ 1997-05-16 01:12:13 by jwe]
jwe
parents:
diff changeset
184 #endif