2982
|
1 /* |
|
2 |
|
3 Copyright (C) 1996, 1997 John W. Eaton |
|
4 |
|
5 This file is part of Octave. |
|
6 |
|
7 Octave is free software; you can redistribute it and/or modify it |
|
8 under the terms of the GNU General Public License as published by the |
|
9 Free Software Foundation; either version 2, or (at your option) any |
|
10 later version. |
|
11 |
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
15 for more details. |
|
16 |
|
17 You should have received a copy of the GNU General Public License |
|
18 along with Octave; see the file COPYING. If not, write to the Free |
5307
|
19 Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
20 02110-1301, USA. |
2982
|
21 |
|
22 */ |
|
23 |
|
24 #if !defined (octave_tree_arg_list_h) |
|
25 #define octave_tree_arg_list_h 1 |
|
26 |
|
27 class octave_value_list; |
|
28 |
|
29 class tree_expression; |
|
30 |
|
31 class tree_walker; |
|
32 |
|
33 #include "str-vec.h" |
|
34 |
4219
|
35 #include "base-list.h" |
|
36 |
2982
|
37 // Argument lists. Used to hold the list of expressions that are the |
|
38 // arguments in a function call or index expression. |
|
39 |
|
40 class |
4219
|
41 tree_argument_list : public octave_base_list<tree_expression *> |
2982
|
42 { |
|
43 public: |
|
44 |
4258
|
45 typedef tree_expression* element_type; |
2982
|
46 |
4258
|
47 tree_argument_list (void) |
|
48 : list_includes_magic_end (false) { } |
|
49 |
|
50 tree_argument_list (tree_expression *t) |
|
51 : list_includes_magic_end (false) { append (t); } |
2982
|
52 |
|
53 ~tree_argument_list (void); |
|
54 |
4267
|
55 bool has_magic_end (void) const; |
|
56 |
4219
|
57 tree_expression *remove_front (void) |
|
58 { |
|
59 iterator p = begin (); |
|
60 tree_expression *retval = *p; |
|
61 erase (p); |
|
62 return retval; |
|
63 } |
4212
|
64 |
4258
|
65 void append (const element_type& s); |
|
66 |
3977
|
67 int nargout_count (void) const; |
|
68 |
2982
|
69 bool all_elements_are_constant (void) const; |
|
70 |
4234
|
71 octave_value_list convert_to_const_vector (const octave_value *object = 0); |
2982
|
72 |
|
73 string_vector get_arg_names (void) const; |
|
74 |
|
75 void accept (tree_walker& tw); |
2988
|
76 |
|
77 private: |
|
78 |
4258
|
79 bool list_includes_magic_end; |
|
80 |
2988
|
81 // No copying! |
|
82 |
|
83 tree_argument_list (const tree_argument_list&); |
|
84 |
|
85 tree_argument_list& operator = (const tree_argument_list&); |
2982
|
86 }; |
|
87 |
|
88 #endif |
|
89 |
|
90 /* |
|
91 ;;; Local Variables: *** |
|
92 ;;; mode: C++ *** |
|
93 ;;; End: *** |
|
94 */ |