Mercurial > octave-nkf
annotate src/pt-idx.h @ 7790:c23fab029f46
tree_index_expression constructor: delete default arg values
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 21 May 2008 08:39:00 -0400 |
parents | 71f068b22fcc |
children | 3100283874d7 |
rev | line source |
---|---|
2980 | 1 /* |
2 | |
7017 | 3 Copyright (C) 1996, 1997, 1998, 2000, 2002, 2003, 2004, 2005, 2006, |
4 2007 John W. Eaton | |
2980 | 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. | |
2980 | 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/>. | |
2980 | 21 |
22 */ | |
23 | |
24 #if !defined (octave_tree_index_h) | |
25 #define octave_tree_index_h 1 | |
26 | |
4219 | 27 #include <list> |
28 | |
2980 | 29 class tree_argument_list; |
30 | |
31 class tree_walker; | |
32 | |
3933 | 33 class Octave_map; |
2980 | 34 class octave_value; |
35 class octave_value_list; | |
36 class octave_lvalue; | |
37 | |
38 #include "str-vec.h" | |
39 | |
40 #include "pt-exp.h" | |
7336 | 41 #include "symtab.h" |
2980 | 42 |
43 // Index expressions. | |
44 | |
45 class | |
46 tree_index_expression : public tree_expression | |
47 { | |
48 public: | |
49 | |
50 tree_index_expression (tree_expression *e = 0, tree_argument_list *lst = 0, | |
3933 | 51 int l = -1, int c = -1, char t = '('); |
2980 | 52 |
3930 | 53 tree_index_expression (tree_expression *e, const std::string& n, |
54 int l = -1, int c = -1); | |
55 | |
4131 | 56 tree_index_expression (tree_expression *e, tree_expression* df, |
57 int l = -1, int c = -1); | |
58 | |
2980 | 59 ~tree_index_expression (void); |
60 | |
5099 | 61 bool has_magic_end (void) const; |
4267 | 62 |
3933 | 63 void append (tree_argument_list *lst = 0, char t = '('); |
3930 | 64 |
3933 | 65 void append (const std::string& n); |
66 | |
4131 | 67 void append (tree_expression *df); |
68 | |
3933 | 69 bool is_index_expression (void) const { return true; } |
2980 | 70 |
3523 | 71 std::string name (void) const; |
2991 | 72 |
3933 | 73 tree_expression *expression (void) { return expr; } |
3930 | 74 |
4219 | 75 std::list<tree_argument_list *> arg_lists (void) { return args; } |
3930 | 76 |
3933 | 77 std::string type_tags (void) { return type; } |
2980 | 78 |
4219 | 79 std::list<string_vector> arg_names (void) { return arg_nm; } |
2980 | 80 |
3933 | 81 bool lvalue_ok (void) const { return expr->lvalue_ok (); } |
3010 | 82 |
3933 | 83 bool rvalue_ok (void) const { return true; } |
2980 | 84 |
85 octave_value rvalue (void); | |
86 | |
87 octave_value_list rvalue (int nargout); | |
88 | |
89 octave_lvalue lvalue (void); | |
90 | |
4143 | 91 void eval_error (void) const; |
2980 | 92 |
7767
71f068b22fcc
scope and context fixes for function handles
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
93 tree_index_expression *dup (symbol_table::scope_id scope, |
71f068b22fcc
scope and context fixes for function handles
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
94 symbol_table::context_id context); |
5861 | 95 |
2980 | 96 void accept (tree_walker& tw); |
97 | |
98 private: | |
99 | |
3930 | 100 // The LHS of this index expression. |
2980 | 101 tree_expression *expr; |
102 | |
3933 | 103 // The indices (only valid if type == paren || type == brace). |
4219 | 104 std::list<tree_argument_list *> args; |
2980 | 105 |
3930 | 106 // The type of this index expression. |
3933 | 107 std::string type; |
3929 | 108 |
4131 | 109 // The names of the arguments. Used for constant struct element |
110 // references. | |
4219 | 111 std::list<string_vector> arg_nm; |
3933 | 112 |
4131 | 113 // The list of dynamic field names, if any. |
4219 | 114 std::list<tree_expression *> dyn_field; |
4131 | 115 |
7790
c23fab029f46
tree_index_expression constructor: delete default arg values
John W. Eaton <jwe@octave.org>
parents:
7767
diff
changeset
|
116 tree_index_expression (int l, int c); |
5861 | 117 |
4131 | 118 Octave_map make_arg_struct (void) const; |
119 | |
4219 | 120 std::string |
121 get_struct_index | |
122 (std::list<string_vector>::const_iterator p_arg_nm, | |
123 std::list<tree_expression *>::const_iterator p_dyn_field) const; | |
2988 | 124 |
125 // No copying! | |
126 | |
127 tree_index_expression (const tree_index_expression&); | |
128 | |
129 tree_index_expression& operator = (const tree_index_expression&); | |
2980 | 130 }; |
131 | |
132 #endif | |
133 | |
134 /* | |
135 ;;; Local Variables: *** | |
136 ;;; mode: C++ *** | |
137 ;;; End: *** | |
138 */ |