577
|
1 /* |
|
2 |
2847
|
3 Copyright (C) 1996, 1997 John W. Eaton |
577
|
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. |
577
|
21 |
|
22 */ |
|
23 |
|
24 #if !defined (octave_tree_misc_h) |
|
25 #define octave_tree_misc_h 1 |
|
26 |
2982
|
27 class octave_value; |
|
28 class octave_value_list; |
577
|
29 |
2982
|
30 class tree_identifier; |
|
31 class tree_index_expression; |
|
32 class tree_va_return_list; |
1588
|
33 |
2982
|
34 class tree_walker; |
577
|
35 |
4219
|
36 #include "base-list.h" |
|
37 |
577
|
38 // Parameter lists. Used to hold the list of input and output |
|
39 // parameters in a function definition. Elements are identifiers |
|
40 // only. |
|
41 |
|
42 class |
4219
|
43 tree_parameter_list : public octave_base_list<tree_identifier *> |
577
|
44 { |
|
45 public: |
2124
|
46 |
1227
|
47 tree_parameter_list (void) |
4219
|
48 : marked_for_varargs (0) { } |
632
|
49 |
1227
|
50 tree_parameter_list (tree_identifier *t) |
4219
|
51 : marked_for_varargs (0) { append (t); } |
577
|
52 |
1740
|
53 ~tree_parameter_list (void); |
577
|
54 |
|
55 void mark_as_formal_parameters (void); |
|
56 |
3933
|
57 void mark_varargs (void) { marked_for_varargs = 1; } |
577
|
58 |
3933
|
59 bool takes_varargs (void) const { return marked_for_varargs != 0; } |
577
|
60 |
3933
|
61 void mark_varargs_only (void) { marked_for_varargs = -1; } |
577
|
62 |
3933
|
63 bool varargs_only (void) { return (marked_for_varargs < 0); } |
577
|
64 |
4466
|
65 void initialize_undefined_elements (const std::string& warnfor, |
|
66 int nargout, const octave_value& val); |
1093
|
67 |
2086
|
68 void define_from_arg_vector (const octave_value_list& args); |
577
|
69 |
4219
|
70 void undefine (void); |
3239
|
71 |
1827
|
72 bool is_defined (void); |
577
|
73 |
2086
|
74 octave_value_list convert_to_const_vector (tree_va_return_list *vr_list); |
577
|
75 |
2124
|
76 void accept (tree_walker& tw); |
581
|
77 |
577
|
78 private: |
2124
|
79 |
577
|
80 int marked_for_varargs; |
2988
|
81 |
|
82 // No copying! |
|
83 |
|
84 tree_parameter_list (const tree_parameter_list&); |
|
85 |
|
86 tree_parameter_list& operator = (const tree_parameter_list&); |
577
|
87 }; |
|
88 |
|
89 // Return lists. Used to hold the right hand sides of multiple |
|
90 // assignment expressions. |
|
91 |
|
92 class |
4219
|
93 tree_return_list : public octave_base_list<tree_index_expression *> |
577
|
94 { |
|
95 public: |
2124
|
96 |
4219
|
97 tree_return_list (void) { } |
1227
|
98 |
4219
|
99 tree_return_list (tree_index_expression *t) { append (t); } |
577
|
100 |
1740
|
101 ~tree_return_list (void); |
581
|
102 |
2124
|
103 void accept (tree_walker& tw); |
2988
|
104 |
|
105 private: |
|
106 |
|
107 // No copying! |
|
108 |
|
109 tree_return_list (const tree_return_list&); |
|
110 |
|
111 tree_return_list& operator = (const tree_return_list&); |
577
|
112 }; |
|
113 |
723
|
114 class |
4219
|
115 tree_va_return_list : public octave_base_list<octave_value> |
723
|
116 { |
|
117 public: |
2124
|
118 |
4219
|
119 tree_va_return_list (void) { } |
1269
|
120 |
|
121 ~tree_va_return_list (void) { } |
2988
|
122 |
|
123 private: |
|
124 |
|
125 // No copying! |
|
126 |
|
127 tree_va_return_list (const tree_va_return_list&); |
|
128 |
|
129 tree_va_return_list& operator = (const tree_va_return_list&); |
723
|
130 }; |
|
131 |
577
|
132 #endif |
|
133 |
|
134 /* |
|
135 ;;; Local Variables: *** |
|
136 ;;; mode: C++ *** |
|
137 ;;; End: *** |
|
138 */ |