Mercurial > hg > octave-lojdl
annotate src/pt-arg-list.h @ 8913:35cd375d4bb3
make tree::dup functions const
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 05 Mar 2009 13:50:25 -0500 |
parents | 71f068b22fcc |
children | eb63fbe60fab |
rev | line source |
---|---|
2982 | 1 /* |
2 | |
7017 | 3 Copyright (C) 1996, 1997, 2002, 2003, 2004, 2005, 2006, 2007 |
4 John W. Eaton | |
2982 | 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. | |
2982 | 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/>. | |
2982 | 21 |
22 */ | |
23 | |
24 #if !defined (octave_tree_arg_list_h) | |
25 #define octave_tree_arg_list_h 1 | |
26 | |
5846 | 27 #include <list> |
2982 | 28 |
5846 | 29 class octave_value_list; |
30 class octave_lvalue; | |
2982 | 31 class tree_expression; |
32 class tree_walker; | |
33 | |
34 #include "str-vec.h" | |
35 | |
4219 | 36 #include "base-list.h" |
37 | |
2982 | 38 // Argument lists. Used to hold the list of expressions that are the |
39 // arguments in a function call or index expression. | |
40 | |
41 class | |
4219 | 42 tree_argument_list : public octave_base_list<tree_expression *> |
2982 | 43 { |
44 public: | |
45 | |
4258 | 46 typedef tree_expression* element_type; |
2982 | 47 |
4258 | 48 tree_argument_list (void) |
5841 | 49 : list_includes_magic_end (false), simple_assign_lhs (false) { } |
4258 | 50 |
51 tree_argument_list (tree_expression *t) | |
5841 | 52 : list_includes_magic_end (false), simple_assign_lhs (false) |
53 { append (t); } | |
2982 | 54 |
55 ~tree_argument_list (void); | |
56 | |
4267 | 57 bool has_magic_end (void) const; |
58 | |
4219 | 59 tree_expression *remove_front (void) |
60 { | |
61 iterator p = begin (); | |
62 tree_expression *retval = *p; | |
63 erase (p); | |
64 return retval; | |
65 } | |
4212 | 66 |
4258 | 67 void append (const element_type& s); |
68 | |
5841 | 69 void mark_as_simple_assign_lhs (void) { simple_assign_lhs = true; } |
70 | |
71 bool is_simple_assign_lhs (void) { return simple_assign_lhs; } | |
72 | |
2982 | 73 bool all_elements_are_constant (void) const; |
74 | |
4234 | 75 octave_value_list convert_to_const_vector (const octave_value *object = 0); |
2982 | 76 |
5846 | 77 std::list<octave_lvalue> lvalue_list (void); |
78 | |
2982 | 79 string_vector get_arg_names (void) const; |
80 | |
7767
71f068b22fcc
scope and context fixes for function handles
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
81 tree_argument_list *dup (symbol_table::scope_id scope, |
8913
35cd375d4bb3
make tree::dup functions const
John W. Eaton <jwe@octave.org>
parents:
7767
diff
changeset
|
82 symbol_table::context_id context) const; |
5861 | 83 |
2982 | 84 void accept (tree_walker& tw); |
2988 | 85 |
86 private: | |
87 | |
4258 | 88 bool list_includes_magic_end; |
89 | |
5841 | 90 bool simple_assign_lhs; |
91 | |
2988 | 92 // No copying! |
93 | |
94 tree_argument_list (const tree_argument_list&); | |
95 | |
96 tree_argument_list& operator = (const tree_argument_list&); | |
2982 | 97 }; |
98 | |
99 #endif | |
100 | |
101 /* | |
102 ;;; Local Variables: *** | |
103 ;;; mode: C++ *** | |
104 ;;; End: *** | |
105 */ |