KickJava   Java API By Example, From Geeks To Geeks.

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


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): Philippe Merle.
24
25 ====================================================================*/

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

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

53     // ==================================================================
54
//
55
// Constructors.
56
//
57
// ==================================================================
58

59     /** The default constructor. */
60     public
61     IR3Feed()
62     {
63         // Calls the constructor with the command line manager.
64
this( new DefaultCommandLine("ir3_feed",
65                                      "omg_idl_file",
66                                      "Feed the OpenCCM Interface Repository with OMG IDL files",
67                                      true) );
68     }
69
70     /**
71      * The constructor with the command line manager.
72      *
73      * @param commandLine The command line manager.
74      */

75     public
76     IR3Feed(CommandLine commandLine)
77     {
78         // Calls the CompilerBase constructor.
79
super(commandLine);
80      
81         // Disables arguments checking.
82
commandLine.setCheckingArguments(false);
83     }
84     
85     // ==================================================================
86
//
87
// Internal methods.
88
//
89
// ==================================================================
90

91     // ==================================================================
92
//
93
// Public methods for org.objectweb.util.cmdline.api.Application
94
//
95
// ==================================================================
96

97     // ==================================================================
98
//
99
// Public methods for org.objectweb.openccm.command.api.Application
100
//
101
// ==================================================================
102

103     /**
104      * Runs the application.
105      *
106      * @param args The command line arguments.
107      *
108      * @return The status.
109      */

110     public int
111     run(java.lang.String JavaDoc[] args)
112     {
113         // Inits the OpenCCM Abstract Syntax Tree.
114
if(!initAST())
115             return -1;
116
117         for(int i=0; i<args.length; i++)
118         {
119             // Compiles the file.
120
FileScope fileScope = compile(args[i]);
121             if(fileScope == null)
122                 return -1;
123         }
124
125         // All is OK.
126
return 0;
127     }
128
129     // ==================================================================
130
//
131
// Public methods for org.objectweb.openccm.command.api.CommandOnIR3
132
//
133
// ==================================================================
134

135     // ==================================================================
136
//
137
// Public methods for org.objectweb.openccm.command.api.CommandOnAST
138
//
139
// ==================================================================
140

141     // ==================================================================
142
//
143
// Public methods for org.objectweb.openccm.command.api.Compiler
144
//
145
// ==================================================================
146

147     // ==================================================================
148
//
149
// Public methods for org.objectweb.openccm.command.api.IR3Feed
150
//
151
// ==================================================================
152

153     // ==================================================================
154
//
155
// Static public methods.
156
//
157
// ==================================================================
158

159     /**
160      * The main bootstrap method.
161      *
162      * @param args The command line arguments.
163      */

164     public static void
165     main(String JavaDoc[] args)
166     {
167         IR3Feed ir3feed = new IR3Feed();
168         ir3feed.runMain(args);
169     }
170 }
171
Popular Tags