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