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