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 |
577
|
30 #include <SLList.h> |
|
31 |
2982
|
32 class octave_value; |
|
33 class octave_value_list; |
577
|
34 |
2982
|
35 class tree_identifier; |
|
36 class tree_index_expression; |
|
37 class tree_va_return_list; |
1588
|
38 |
2982
|
39 class tree_walker; |
577
|
40 |
|
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 |
2124
|
46 tree_parameter_list : public SLList<tree_identifier *> |
577
|
47 { |
|
48 public: |
2124
|
49 |
1227
|
50 tree_parameter_list (void) |
2124
|
51 : SLList<tree_identifier *> (), marked_for_varargs (0) { } |
632
|
52 |
1227
|
53 tree_parameter_list (tree_identifier *t) |
2124
|
54 : SLList<tree_identifier *> (), 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 |
2086
|
68 void initialize_undefined_elements (octave_value& val); |
1093
|
69 |
2086
|
70 void define_from_arg_vector (const octave_value_list& args); |
577
|
71 |
3239
|
72 void clear (void); |
|
73 |
1827
|
74 bool is_defined (void); |
577
|
75 |
2086
|
76 octave_value_list convert_to_const_vector (tree_va_return_list *vr_list); |
577
|
77 |
2124
|
78 void accept (tree_walker& tw); |
581
|
79 |
577
|
80 private: |
2124
|
81 |
577
|
82 int marked_for_varargs; |
2988
|
83 |
|
84 // No copying! |
|
85 |
|
86 tree_parameter_list (const tree_parameter_list&); |
|
87 |
|
88 tree_parameter_list& operator = (const tree_parameter_list&); |
577
|
89 }; |
|
90 |
|
91 // Return lists. Used to hold the right hand sides of multiple |
|
92 // assignment expressions. |
|
93 |
|
94 class |
2124
|
95 tree_return_list : public SLList<tree_index_expression *> |
577
|
96 { |
|
97 public: |
2124
|
98 |
1227
|
99 tree_return_list (void) |
2124
|
100 : SLList<tree_index_expression *> () { } |
1227
|
101 |
577
|
102 tree_return_list (tree_index_expression *t) |
2124
|
103 : SLList<tree_index_expression *> () { append (t); } |
577
|
104 |
1740
|
105 ~tree_return_list (void); |
581
|
106 |
2124
|
107 void accept (tree_walker& tw); |
2988
|
108 |
|
109 private: |
|
110 |
|
111 // No copying! |
|
112 |
|
113 tree_return_list (const tree_return_list&); |
|
114 |
|
115 tree_return_list& operator = (const tree_return_list&); |
577
|
116 }; |
|
117 |
723
|
118 class |
2086
|
119 tree_va_return_list : public SLList<octave_value> |
723
|
120 { |
|
121 public: |
2124
|
122 |
2086
|
123 tree_va_return_list (void) : SLList<octave_value> () { } |
1269
|
124 |
|
125 ~tree_va_return_list (void) { } |
2988
|
126 |
|
127 private: |
|
128 |
|
129 // No copying! |
|
130 |
|
131 tree_va_return_list (const tree_va_return_list&); |
|
132 |
|
133 tree_va_return_list& operator = (const tree_va_return_list&); |
723
|
134 }; |
|
135 |
577
|
136 #endif |
|
137 |
|
138 /* |
|
139 ;;; Local Variables: *** |
|
140 ;;; mode: C++ *** |
|
141 ;;; End: *** |
|
142 */ |