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 |
5861
|
81 tree_argument_list *dup (symbol_table *sym_tab); |
|
82 |
2982
|
83 void accept (tree_walker& tw); |
2988
|
84 |
|
85 private: |
|
86 |
4258
|
87 bool list_includes_magic_end; |
|
88 |
5841
|
89 bool simple_assign_lhs; |
|
90 |
2988
|
91 // No copying! |
|
92 |
|
93 tree_argument_list (const tree_argument_list&); |
|
94 |
|
95 tree_argument_list& operator = (const tree_argument_list&); |
2982
|
96 }; |
|
97 |
|
98 #endif |
|
99 |
|
100 /* |
|
101 ;;; Local Variables: *** |
|
102 ;;; mode: C++ *** |
|
103 ;;; End: *** |
|
104 */ |