KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > openccm > command > lib > IDL3Check


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): Philippe Merle.
23 Contributor(s): ______________________________________.
24
25 ====================================================================*/

26
27 package org.objectweb.openccm.command.lib;
28
29 // Package dependencies.
30
// import org.objectweb.openccm.command.api.IDL3Check;
31
import org.objectweb.util.cmdline.lib.DefaultCommandLine;
32 import org.objectweb.openccm.ast.api.FileScope;
33
34 /**
35  * Implementation of the idl3_check command.
36  *
37  * @author <a HREF="mailto:Philippe.Merle@lifl.fr">Philippe Merle</a>
38  *
39  * @version 1.0
40  */

41
42 public class IDL3Check
43      extends CompilerBase
44   implements org.objectweb.openccm.command.api.IDL3Check
45 {
46     // ==================================================================
47
//
48
// Internal state.
49
//
50
// ==================================================================
51

52     // ==================================================================
53
//
54
// Constructor.
55
//
56
// ==================================================================
57

58     /** The default constructor. */
59     public
60     IDL3Check()
61     {
62         // Calls the CompilerBase constructor.
63
super(new DefaultCommandLine("idl3_check",
64                                      "omg_idl_file",
65                                      "Compile and check an OMG IDL file",
66                                      true));
67     }
68
69     // ==================================================================
70
//
71
// Internal methods.
72
//
73
// ==================================================================
74

75     // ==================================================================
76
//
77
// Public methods for org.objectweb.util.cmdline.api.Application
78
//
79
// ==================================================================
80

81     // ==================================================================
82
//
83
// Public methods for org.objectweb.openccm.command.api.Application
84
//
85
// ==================================================================
86

87     /**
88      * Runs the application.
89      *
90      * @param args The command line arguments.
91      *
92      * @return The status.
93      */

94     public int
95     run(java.lang.String JavaDoc[] args)
96     {
97         String JavaDoc filename = args[0];
98
99         // Inits the OpenCCM Abstract Syntax Tree.
100
if(!initAST())
101             return -1;
102
103         // Compiles the file.
104
FileScope fileScope = compile(filename);
105         if(fileScope == null)
106             return -1;
107
108         // Cleans up the OpenCCM Abstract Syntax Tree and Interface Repository.
109
fileScope.destroy();
110
111         // All is OK.
112
return 0;
113     }
114
115     // ==================================================================
116
//
117
// Public methods for org.objectweb.openccm.command.api.CommandOnIR3
118
//
119
// ==================================================================
120

121     // ==================================================================
122
//
123
// Public methods for org.objectweb.openccm.command.api.CommandOnAST
124
//
125
// ==================================================================
126

127     // ==================================================================
128
//
129
// Public methods for org.objectweb.openccm.command.api.Compiler
130
//
131
// ==================================================================
132

133     // ==================================================================
134
//
135
// Public methods for org.objectweb.openccm.command.api.IDL3Check
136
//
137
// ==================================================================
138

139     // ==================================================================
140
//
141
// Static public methods.
142
//
143
// ==================================================================
144

145     /**
146      * The main bootstrap method.
147      *
148      * @param args The command line arguments.
149      */

150     public static void
151     main(String JavaDoc[] args)
152     {
153         IDL3Check idl3_check = new IDL3Check();
154         idl3_check.runMain(args);
155     }
156 }
157
Popular Tags