Mercurial > hg > octave-nkf
comparison libinterp/parse-tree/pt-classdef.cc @ 15841:5861c4bde387 classdef
Move classdef related source files to correct location.
author | Michael Goffioul <michael.goffioul@gmail.com> |
---|---|
date | Sun, 23 Dec 2012 17:43:06 -0500 |
parents | src/parse-tree/pt-classdef.cc@069c552587a0 |
children | 5e5705b3e505 |
comparison
equal
deleted
inserted
replaced
15840:af9e2ad52943 | 15841:5861c4bde387 |
---|---|
1 /* | |
2 | |
3 Copyright (C) 2012 John W. Eaton | |
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 3 of the License, or (at your | |
10 option) any 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, see | |
19 <http://www.gnu.org/licenses/>. | |
20 | |
21 */ | |
22 | |
23 #ifdef HAVE_CONFIG_H | |
24 #include <config.h> | |
25 #endif | |
26 | |
27 #include "ov-classdef.h" | |
28 #include "pt-classdef.h" | |
29 | |
30 // Classdef attribute | |
31 | |
32 void | |
33 tree_classdef_attribute::accept (tree_walker& tw) | |
34 { | |
35 tw.visit_classdef_attribute (*this); | |
36 } | |
37 | |
38 // Classdef attribute_list | |
39 | |
40 tree_classdef_attribute_list::~tree_classdef_attribute_list (void) | |
41 { | |
42 while (! empty ()) | |
43 { | |
44 iterator p = begin (); | |
45 delete *p; | |
46 erase (p); | |
47 } | |
48 } | |
49 | |
50 void | |
51 tree_classdef_attribute_list::accept (tree_walker& tw) | |
52 { | |
53 tw.visit_classdef_attribute_list (*this); | |
54 } | |
55 | |
56 // Classdef superclass | |
57 | |
58 void | |
59 tree_classdef_superclass::accept (tree_walker& tw) | |
60 { | |
61 tw.visit_classdef_superclass (*this); | |
62 } | |
63 | |
64 // Classdef superclass_list | |
65 | |
66 tree_classdef_superclass_list::~tree_classdef_superclass_list (void) | |
67 { | |
68 while (! empty ()) | |
69 { | |
70 iterator p = begin (); | |
71 delete *p; | |
72 erase (p); | |
73 } | |
74 } | |
75 | |
76 void | |
77 tree_classdef_superclass_list::accept (tree_walker& tw) | |
78 { | |
79 tw.visit_classdef_superclass_list (*this); | |
80 } | |
81 | |
82 // Classdef property | |
83 | |
84 void | |
85 tree_classdef_property::accept (tree_walker& tw) | |
86 { | |
87 tw.visit_classdef_property (*this); | |
88 } | |
89 | |
90 // Classdef property_list | |
91 | |
92 tree_classdef_property_list::~tree_classdef_property_list (void) | |
93 { | |
94 while (! empty ()) | |
95 { | |
96 iterator p = begin (); | |
97 delete *p; | |
98 erase (p); | |
99 } | |
100 } | |
101 | |
102 void | |
103 tree_classdef_property_list::accept (tree_walker& tw) | |
104 { | |
105 tw.visit_classdef_property_list (*this); | |
106 } | |
107 | |
108 // Classdef properties_block | |
109 | |
110 void | |
111 tree_classdef_properties_block::accept (tree_walker& tw) | |
112 { | |
113 tw.visit_classdef_properties_block (*this); | |
114 } | |
115 | |
116 // Classdef methods_list | |
117 | |
118 void | |
119 tree_classdef_methods_list::accept (tree_walker& tw) | |
120 { | |
121 tw.visit_classdef_methods_list (*this); | |
122 } | |
123 | |
124 // Classdef methods_block | |
125 | |
126 void | |
127 tree_classdef_methods_block::accept (tree_walker& tw) | |
128 { | |
129 tw.visit_classdef_methods_block (*this); | |
130 } | |
131 | |
132 // Classdef event | |
133 | |
134 void | |
135 tree_classdef_event::accept (tree_walker& tw) | |
136 { | |
137 tw.visit_classdef_event (*this); | |
138 } | |
139 | |
140 // Classdef events_list | |
141 | |
142 tree_classdef_events_list::~tree_classdef_events_list (void) | |
143 { | |
144 while (! empty ()) | |
145 { | |
146 iterator p = begin (); | |
147 delete *p; | |
148 erase (p); | |
149 } | |
150 } | |
151 | |
152 void | |
153 tree_classdef_events_list::accept (tree_walker& tw) | |
154 { | |
155 tw.visit_classdef_events_list (*this); | |
156 } | |
157 | |
158 // Classdef events_block | |
159 | |
160 void | |
161 tree_classdef_events_block::accept (tree_walker& tw) | |
162 { | |
163 tw.visit_classdef_events_block (*this); | |
164 } | |
165 | |
166 // Classdef enum | |
167 | |
168 void | |
169 tree_classdef_enum::accept (tree_walker& tw) | |
170 { | |
171 tw.visit_classdef_enum (*this); | |
172 } | |
173 | |
174 // Classdef enum_list | |
175 | |
176 tree_classdef_enum_list::~tree_classdef_enum_list (void) | |
177 { | |
178 while (! empty ()) | |
179 { | |
180 iterator p = begin (); | |
181 delete *p; | |
182 erase (p); | |
183 } | |
184 } | |
185 | |
186 void | |
187 tree_classdef_enum_list::accept (tree_walker& tw) | |
188 { | |
189 tw.visit_classdef_enum_list (*this); | |
190 } | |
191 | |
192 // Classdef enum_block | |
193 | |
194 void | |
195 tree_classdef_enum_block::accept (tree_walker& tw) | |
196 { | |
197 tw.visit_classdef_enum_block (*this); | |
198 } | |
199 | |
200 // Classdef body | |
201 | |
202 tree_classdef_body::~tree_classdef_body (void) | |
203 { | |
204 while (! properties_lst.empty ()) | |
205 { | |
206 properties_list_iterator p = properties_lst.begin (); | |
207 delete *p; | |
208 properties_lst.erase (p); | |
209 } | |
210 | |
211 while (! methods_lst.empty ()) | |
212 { | |
213 methods_list_iterator p = methods_lst.begin (); | |
214 delete *p; | |
215 methods_lst.erase (p); | |
216 } | |
217 | |
218 while (! events_lst.empty ()) | |
219 { | |
220 events_list_iterator p = events_lst.begin (); | |
221 delete *p; | |
222 events_lst.erase (p); | |
223 } | |
224 | |
225 while (! enum_lst.empty ()) | |
226 { | |
227 enum_list_iterator p = enum_lst.begin (); | |
228 delete *p; | |
229 enum_lst.erase (p); | |
230 } | |
231 } | |
232 | |
233 // Classdef | |
234 | |
235 octave_value | |
236 tree_classdef::make_meta_class (void) const | |
237 { | |
238 octave_value retval; | |
239 cdef_class cls = cdef_class::make_meta_class (this); | |
240 | |
241 if (cls.ok ()) | |
242 retval = to_ov (cls); | |
243 | |
244 return retval; | |
245 } | |
246 | |
247 tree_classdef * | |
248 tree_classdef::dup (symbol_table::scope_id, | |
249 symbol_table::context_id) const | |
250 { | |
251 // FIXME | |
252 return 0; | |
253 } | |
254 | |
255 void | |
256 tree_classdef::accept (tree_walker& tw) | |
257 { | |
258 std::cerr << "I am super accepting" << std::endl; | |
259 // tw.visit_classdef (*this); | |
260 } |