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