577
|
1 /* |
|
2 |
7017
|
3 Copyright (C) 1994, 1995, 1996, 1997, 1999, 2002, 2003, 2004, 2005, |
|
4 2006, 2007 John W. Eaton |
577
|
5 |
|
6 This file is part of Octave. |
|
7 |
|
8 Octave is free software; you can redistribute it and/or modify it |
|
9 under the terms of the GNU General Public License as published by the |
7016
|
10 Free Software Foundation; either version 3 of the License, or (at your |
|
11 option) any later version. |
577
|
12 |
|
13 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
16 for more details. |
|
17 |
|
18 You should have received a copy of the GNU General Public License |
7016
|
19 along with Octave; see the file COPYING. If not, see |
|
20 <http://www.gnu.org/licenses/>. |
577
|
21 |
|
22 */ |
|
23 |
|
24 #if !defined (octave_tree_misc_h) |
|
25 #define octave_tree_misc_h 1 |
|
26 |
5848
|
27 class Cell; |
|
28 |
2982
|
29 class octave_value; |
|
30 class octave_value_list; |
577
|
31 |
2982
|
32 class tree_identifier; |
|
33 class tree_index_expression; |
|
34 class tree_va_return_list; |
1588
|
35 |
2982
|
36 class tree_walker; |
577
|
37 |
4219
|
38 #include "base-list.h" |
6215
|
39 #include "pt-decl.h" |
4219
|
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 |
6215
|
46 tree_parameter_list : public octave_base_list<tree_decl_elt *> |
577
|
47 { |
|
48 public: |
2124
|
49 |
1227
|
50 tree_parameter_list (void) |
4219
|
51 : marked_for_varargs (0) { } |
632
|
52 |
6215
|
53 tree_parameter_list (tree_decl_elt *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 |
5848
|
77 octave_value_list convert_to_const_vector (const Cell& varargout); |
577
|
78 |
5861
|
79 tree_parameter_list *dup (symbol_table *sym_tab); |
|
80 |
2124
|
81 void accept (tree_walker& tw); |
581
|
82 |
577
|
83 private: |
2124
|
84 |
577
|
85 int marked_for_varargs; |
2988
|
86 |
|
87 // No copying! |
|
88 |
|
89 tree_parameter_list (const tree_parameter_list&); |
|
90 |
|
91 tree_parameter_list& operator = (const tree_parameter_list&); |
577
|
92 }; |
|
93 |
|
94 // Return lists. Used to hold the right hand sides of multiple |
|
95 // assignment expressions. |
|
96 |
|
97 class |
4219
|
98 tree_return_list : public octave_base_list<tree_index_expression *> |
577
|
99 { |
|
100 public: |
2124
|
101 |
4219
|
102 tree_return_list (void) { } |
1227
|
103 |
4219
|
104 tree_return_list (tree_index_expression *t) { append (t); } |
577
|
105 |
1740
|
106 ~tree_return_list (void); |
581
|
107 |
5861
|
108 tree_return_list *dup (symbol_table *sym_tab); |
|
109 |
2124
|
110 void accept (tree_walker& tw); |
2988
|
111 |
|
112 private: |
|
113 |
|
114 // No copying! |
|
115 |
|
116 tree_return_list (const tree_return_list&); |
|
117 |
|
118 tree_return_list& operator = (const tree_return_list&); |
577
|
119 }; |
|
120 |
723
|
121 class |
4219
|
122 tree_va_return_list : public octave_base_list<octave_value> |
723
|
123 { |
|
124 public: |
2124
|
125 |
4219
|
126 tree_va_return_list (void) { } |
1269
|
127 |
|
128 ~tree_va_return_list (void) { } |
2988
|
129 |
|
130 private: |
|
131 |
|
132 // No copying! |
|
133 |
|
134 tree_va_return_list (const tree_va_return_list&); |
|
135 |
|
136 tree_va_return_list& operator = (const tree_va_return_list&); |
723
|
137 }; |
|
138 |
577
|
139 #endif |
|
140 |
|
141 /* |
|
142 ;;; Local Variables: *** |
|
143 ;;; mode: C++ *** |
|
144 ;;; End: *** |
|
145 */ |