KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > openccm > generator > common > api > GeneratorBase


1 /*====================================================================
2
3 OpenCCM: The Open CORBA Component Model Platform
4 Copyright (C) 2000-2004 INRIA & USTL - LIFL - GOAL
5 Contact: openccm@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): Christophe Demarey.
23 Contributor(s): .
24
25 ====================================================================*/

26
27 package org.objectweb.openccm.generator.common.api;
28
29
30 /** To access all the AST Declaration. */
31 import org.objectweb.openccm.ast.api.Declaration;
32
33 /** To access all the AST Scope. */
34 import org.objectweb.openccm.ast.api.Scope;
35
36 /** To use List. */
37 import java.util.List JavaDoc;
38
39 /** To use GenerationException. */
40 import org.objectweb.openccm.generator.common.lib.GenerationException;
41
42
43 /**
44  * This interface allows naviguation in the OpenCCM AST
45  * and calls to map files.
46  **/

47 public interface GeneratorBase
48          extends org.objectweb.openccm.generator.common.api.Generator
49 {
50     /**
51      * Initialize the generator.
52      **/

53     public void
54     initialize();
55
56     /**
57      * Obtains the OpenCCM's Abstract Syntax Tree.
58      *
59      * @return The OpenCCM's Abstract Syntax Tree.
60      */

61     public org.objectweb.openccm.ast.api.AST
62     getAST();
63     
64     /**
65      * Is the declaration a business (i.e. a non system) declaration ?
66      *
67      * @param decl - The declaration.
68      *
69      * @return True if the declaration is business declaration, false otherwise.
70      **/

71     public boolean
72     isBusinessDeclaration(Declaration decl);
73
74     /**
75      * Visit a declaration in the repository
76      *
77      * @param obj - The declaration to visit.
78      **/

79     public void
80     visit(Declaration obj);
81
82     /**
83      * Visit dependencies tree.
84      *
85      * @param decl - The declaration to visit.
86      **/

87     public void
88     visit_dep_tree(Declaration decl);
89
90     /**
91      * Visit dependencies tree.
92      *
93      * @param childs - Declarations to visit.
94      **/

95     public void
96     visit_dep_tree(List JavaDoc childs);
97
98     /**
99      * Visit declarations.
100      *
101      * @param vect - A List containing Declarations to visit.
102      **/

103     public void
104     visit(List JavaDoc vect);
105
106     /**
107      * Visit a single contained declaration
108      *
109      * @param contained - The declaration to visit.
110      * @param extension - used to map id
111      **/

112     public void
113     visitContained(Declaration contained, String JavaDoc extension);
114
115     /**
116      * Get a declaration.
117      * name must be a valid declaration name.
118      *
119      * @param name - The name of the declaration to get.
120      *
121      * @return The matching declaration.
122      **/

123     public Declaration
124     getDeclaration(String JavaDoc name)
125     throws GenerationException;
126
127     /**
128      * Get a declaration from a scope.
129      * name must be a valid declaration name.
130      *
131      * @param scope - The scope to visit.
132      * @param name - The name of the declaration to get.
133      *
134      * @return The matching declaration.
135      **/

136     public Declaration
137     getDeclaration(Scope scope, String JavaDoc name)
138     throws GenerationException;
139
140     /**
141      * Get contents of the scope matching limited_types.
142      *
143      * @param scope - The scope to visit.
144      * @param limited_types - A logical combination of DeclarationKind.
145      *
146      * @return The list of contained declarations.
147      **/

148     public List JavaDoc
149     getDeclarations(Scope scope, long limited_types)
150     throws GenerationException;
151
152     /**
153      * Get all declarations matching with limited_types contained in the file scope,
154      * including sub-scopes.
155      *
156      * @param limited_types - A logical combination of DeclarationKind.
157      *
158      * @return The list of founded declarations.
159      **/

160     public List JavaDoc
161     getAllDeclarations(Scope scope, long limited_types)
162     throws GenerationException;
163 }
164
Popular Tags