KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > ccm > IDL3 > Scope


1 /*====================================================================
2
3 OpenCCM: The Open CORBA Component Model Platform
4 Copyright (C) 2000-2002 USTL - LIFL - GOAL
5 Contact: openccm-team@objectweb.org
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 USA
21
22 Initial developer(s): Philippe Merle, Mathieu Vadet.
23 Contributor(s): ______________________________________.
24
25 ====================================================================*/

26
27 package org.objectweb.ccm.IDL3;
28
29 /**
30  * This interface manages definition scopes.
31  *
32  * @author <a=href="Philippe.Merle@lifl.fr">Philippe Merle</a>
33  * <a=href="Mathieu.Vadet@lifl.fr">Mathieu Vadet</a>
34  *
35  * @version 0.3
36  */

37
38 public interface Scope
39        extends Declaration
40 {
41     //
42
// Parser view of a scope.
43
//
44

45     /**
46      * Start a file scope.
47      *
48      * @param fileName the name of the file represented by this FileScope.
49      * @param isIncluded if set to true, the declarations will be stored
50      * in the new FileScope.
51      * Otherwise, they will be stored in this object.
52      *
53      * @return The new created FileScope.
54      */

55     public FileScope
56     startFileScope(String JavaDoc filename);
57
58     /**
59      * Start a constant declaration.
60      *
61      * @param name The name of the constant declaration.
62      *
63      * @return The new created ConstantDecl.
64      */

65     public ConstantDecl
66     startConstant(String JavaDoc name);
67
68     /**
69      * Declare a struct declaration.
70      * If it doesn't exist, create it.
71      *
72      * @param name The name of the struct declaration.
73      *
74      * @return The new created StructDecl.
75      */

76     public StructDecl
77     declareStruct(String JavaDoc name);
78
79     /**
80      * Declare an union declaration.
81      * If it doesn't exist, create it.
82      *
83      * @param name The name of the union declaration.
84      *
85      * @return The new created UnionDecl.
86      */

87     public UnionDecl
88     declareUnion(String JavaDoc name);
89
90     /**
91      * Start an enum declaration.
92      *
93      * @param name The name of the enum declaration.
94      *
95      * @return The new created EnumDecl.
96      */

97     public EnumDecl
98     startEnum(String JavaDoc name);
99
100     /**
101      * Start an alias declaration.
102      *
103      * @param name The name of the alias declaration.
104      *
105      * @return The new created AliasDecl.
106      */

107     public AliasDecl
108     startAlias(String JavaDoc name);
109
110     /**
111      * Find a module declaration
112      * If it doesn't exist, create it.
113      *
114      * @param The name of the module declaration.
115      *
116      * @return The new created ModuleDecl or a already created ModuleDecl.
117      */

118     public ModuleDecl
119     declareModule(String JavaDoc name);
120
121     /**
122      * Declare an interface declaration.
123      * If it doesn't exist, create it.
124      *
125      * @param name The name of the interface declaration.
126      *
127      * @return The new created InterfaceDecl or
128      * an already created InterfaceDecl.
129      */

130     public InterfaceDecl
131     declareInterface(String JavaDoc name);
132
133     /**
134      * Declare an abstract interface declaration.
135      * If it doesn't exist, create it.
136      *
137      * @param name The name of the abstract interface declaration.
138      *
139      * @return The new created AbstractInterfaceDecl or
140      * an already created AbstractInterfaceDecl.
141      */

142     public AbstractInterfaceDecl
143     declareAbstractInterface(String JavaDoc name);
144
145     /**
146      * Declare a local interface declaration.
147      * If it doesn't exist, create it.
148      *
149      * @param name The name of the local interface declaration.
150      *
151      * @return The new created LocalInterfaceDecl or
152      * an already created LocalInterfaceDecl.
153      */

154     public LocalInterfaceDecl
155     declareLocalInterface(String JavaDoc name);
156
157     /**
158      * Declare a value type declaration.
159      * If it doesn't exist, create it.
160      *
161      * @param name The name of the value type declaration.
162      *
163      * @return The new created ValueDecl or an already created ValueDecl.
164      */

165     public ValueDecl
166     declareValue(String JavaDoc name);
167
168     /**
169      * Start an initializer declaration.
170      *
171      * @param name The name of the initializer declaration.
172      *
173      * @return The new created Initializer.
174      */

175     public Initializer
176     startInitializer(String JavaDoc name);
177
178     /**
179      * Start a value member declaration.
180      *
181      * @param name The name of the value member declaration.
182      *
183      * @return The new created ValueMemberDecl.
184      */

185     public ValueMemberDecl
186     startValueMember(String JavaDoc name);
187
188     /**
189      * Start a value box declaration.
190      *
191      * @param name The name of the value box declaration.
192      *
193      * @return The new created ValueBoxDecl.
194      **/

195     public ValueBoxDecl
196     startValueBox(String JavaDoc name);
197
198     /**
199      * Start an exception declaration.
200      *
201      * @param name The name of the exception declaration.
202      *
203      * @return The new created ExceptionDecl.
204      **/

205     public ExceptionDecl
206     startException(String JavaDoc name);
207
208     /**
209      * Start a native declaration.
210      *
211      * @param name The name of the native declaration.
212      *
213      * @return The new created NativeDecl.
214      */

215     public NativeDecl
216     startNative(String JavaDoc name);
217
218     /**
219      * Start an attribute declaration.
220      *
221      * @param name The name of the attribute declaration.
222      *
223      * @return The new created AttributeDecl.
224      */

225     public AttributeDecl
226     startAttribute(String JavaDoc name);
227
228     /**
229      * Start an operation declaration.
230      *
231      * @param name The name of the operation declaration.
232      *
233      * @return The new created OperationDecl.
234      */

235     public OperationDecl
236     startOperation(String JavaDoc name);
237
238     /**
239      * Declare a component declaration.
240      * If it doesn't exist, create it.
241      *
242      * @param name The name of the component declaration.
243      *
244      * @return The new created ComponentDecl or
245      * an already created ComponentDecl.
246      */

247     public ComponentDecl
248     declareComponent(String JavaDoc name);
249
250     /**
251      * Start a factory declaration.
252      *
253      * @param name The name of the factory declaration.
254      *
255      * @return The new created FactoryDecl.
256      */

257     public FactoryDecl
258     startFactory(String JavaDoc name);
259
260     /**
261      * Start a finder declaration.
262      *
263      * @param name The name of the finder declaration.
264      *
265      * @return The new created FinderDecl.
266      */

267     public FinderDecl
268     startFinder(String JavaDoc name);
269
270     /**
271      * Start a provides declaration.
272      *
273      * @param name The name of the provides declaration.
274      *
275      * @return The new created ProvidesDecl.
276      */

277     public ProvidesDecl
278     startProvides(String JavaDoc name);
279
280     /**
281      * Start a uses declaration.
282      *
283      * @param name The name of the uses declaration.
284      *
285      * @return The new created UsesDecl.
286      */

287     public UsesDecl
288     startUses(String JavaDoc name);
289
290     /**
291      * Start a consumes declaration.
292      *
293      * @param name The name of the consumes declaration.
294      *
295      * @return The new created ConsumesDecl.
296      */

297     public ConsumesDecl
298     startConsumes(String JavaDoc name);
299
300     /**
301      * Start an emits declaration.
302      *
303      * @param name The name of the emits declaration.
304      *
305      * @return The new created EmitsDecl.
306      */

307     public EmitsDecl
308     startEmits(String JavaDoc name);
309
310     /**
311      * Start a publishes declaration.
312      *
313      * @param name The name of the publishes declaration.
314      *
315      * @return The new created PublishesDecl.
316      */

317     public PublishesDecl
318     startPublishes(String JavaDoc name);
319
320     /**
321      * Start a home declaration.
322      *
323      * @param name The name of the home declaration.
324      *
325      * @return The new created HomeDecl.
326      */

327     public HomeDecl
328     startHome(String JavaDoc name);
329
330     /**
331      * Declare a event type declaration.
332      * If it not exists, create it.
333      *
334      * @param name The name of the event type declaration.
335      *
336      * @return The new created EventDecl or an already created EventDecl.
337      */

338     public EventDecl
339     declareEvent(String JavaDoc name);
340
341     /**
342      * Find a declaration.
343      *
344      * Note that the declaration is also recursively
345      * searched in the parent scope and finally searched
346      * in the IR3.
347      *
348      * @param name The name of the searched declaration.
349      *
350      * @return The declaration that was searched
351      * or null if it does not exist.
352      */

353     public Declaration
354     find(String JavaDoc name);
355
356     //
357
// Visitor view of a declaration.
358
//
359

360     /**
361      * To obtain all the contained Declaration objects.
362      *
363      * @param exclude_inherited If false return also objects contained in inherited scopes.
364      * @param limited_types A logical combination of DeclarationKind.
365      *
366      * @return An array of Declaration objects.
367      */

368     public Declaration[]
369     getContents(boolean exclude_inherited,
370                 int limited_types);
371
372     /**
373      * To find a contained Declaration according to it's scoped name.
374      *
375      * @param n The scoped name.
376      *
377      * @return The found or loaded from the IR3 Declaration or null.
378      */

379     public Declaration
380     lookup(String JavaDoc scoped_name);
381 }
382
Popular Tags