51 import java.util.StringTokenizer;
52 import java.lang.reflect.Modifier;
53 import java.lang.reflect.Field;
54
55 import com.sun.tools.corba.se.idl.som.cff.FileLocator;
56
57 /**
58 * This class is responsible for parsing the command line arguments to the
59 * compiler. To add new arguments to the compiler, this class must be extended
60 * and the parseOtherArgs method overridden.
61 **/
62 public class Arguments
63 {
64 /**
65 * Method parseOtherArgs() is called when the framework detects arguments
66 * which are unknown to it. The default implementation of this method simply
67 * throws an InvalidArgument exception. Any overriding implementation
68 * must check the arguments passed to it for validity and process the
69 * arguments appropriately. If it detects an invalid argument, it should
70 * throw an InvalidArgument exception. Arguments MUST be of the form
71 * `/<arg> [<qualifiers>]' or `-<arg> [<qualifiers>]' where <qualifiers>
72 * is optional (for example, -iC:\includes, `C:\includes' is the qualifier
73 * for the argument `i').
74 * @param args The arguments which are unknown by the framework.
75 * @param properties Environment-style properties collected from the
76 * file idl.config.
77 * @exception idl.InvalidArgument if the argument is unknown.
78 **/
79 protected void parseOtherArgs (String[] args, Properties properties) throws InvalidArgument
80 {
81 if (args.length > 0)
82 throw new InvalidArgument (args[0]);
83 } // parseOtherArgs
84
85
86 protected void setDebugFlags( String args )
87 {
88 StringTokenizer st = new StringTokenizer( args, "," ) ;
89 while (st.hasMoreTokens()) {
90 String token = st.nextToken() ;
91
92 // If there is a public boolean data member in this class
93 // named token + "DebugFlag", set it to true.
272 // * If this is true, then stateful interfaces (for the Objects-by-Value
273 // * proposal) are allowed. This is not yet a standard, so it must
274 // * explicitly be called for by setting the -stateful argument to the
275 // * compiler. If -stateful does not appear on the command line, then
276 // * the IDL will be parsed according to the standards.
277 // **/
278 //public boolean parseStateful = false;
279 /**
280 * A list of strings, each of which is a path from which included files
281 * are found.
282 **/
283 public Vector includePaths = new Vector ();
284
285 /**
286 * A table of defined symbols. The key is the symbol name; the value
287 * (if any) is the replacement value for the symbol.
288 **/
289 public Hashtable definedSymbols = new Hashtable ();
290
291 /**
292 * <f46082.46.01> True if new module entries are created for each
293 * re-opened module.
294 **/
295 public boolean cppModule = false;
296
297 /**
298 * -version option.
299 **/
300 public boolean versionRequest = false; // <D58319>
301
302 // <f60858.1> Specify the maximal level of the CORBA spec. the parser
303 // will support.
304 //
305 // NOTE: For BOSS 3.0, specify at 2.2. Raise to greater value in future
306 // releases.
307 /**
308 * -corba [level] option, where [level] is a floating-point number indicating
309 * the maximal level of CORBA IDL the parser framework can accept.
310 **/
311 public float corbaLevel = 2.2f;
312 // <d62023>
|
51 import java.util.StringTokenizer;
52 import java.lang.reflect.Modifier;
53 import java.lang.reflect.Field;
54
55 import com.sun.tools.corba.se.idl.som.cff.FileLocator;
56
57 /**
58 * This class is responsible for parsing the command line arguments to the
59 * compiler. To add new arguments to the compiler, this class must be extended
60 * and the parseOtherArgs method overridden.
61 **/
62 public class Arguments
63 {
64 /**
65 * Method parseOtherArgs() is called when the framework detects arguments
66 * which are unknown to it. The default implementation of this method simply
67 * throws an InvalidArgument exception. Any overriding implementation
68 * must check the arguments passed to it for validity and process the
69 * arguments appropriately. If it detects an invalid argument, it should
70 * throw an InvalidArgument exception. Arguments MUST be of the form
71 * {@code '/<arg> [<qualifiers>]'} or {@code '-<arg> [<qualifiers>]'} where {@code <qualifiers>}
72 * is optional (for example, -iC:\includes, 'C:\includes' is the qualifier
73 * for the argument 'i').
74 * @param args The arguments which are unknown by the framework.
75 * @param properties Environment-style properties collected from the
76 * file idl.config.
77 * @exception idl.InvalidArgument if the argument is unknown.
78 **/
79 protected void parseOtherArgs (String[] args, Properties properties) throws InvalidArgument
80 {
81 if (args.length > 0)
82 throw new InvalidArgument (args[0]);
83 } // parseOtherArgs
84
85
86 protected void setDebugFlags( String args )
87 {
88 StringTokenizer st = new StringTokenizer( args, "," ) ;
89 while (st.hasMoreTokens()) {
90 String token = st.nextToken() ;
91
92 // If there is a public boolean data member in this class
93 // named token + "DebugFlag", set it to true.
272 // * If this is true, then stateful interfaces (for the Objects-by-Value
273 // * proposal) are allowed. This is not yet a standard, so it must
274 // * explicitly be called for by setting the -stateful argument to the
275 // * compiler. If -stateful does not appear on the command line, then
276 // * the IDL will be parsed according to the standards.
277 // **/
278 //public boolean parseStateful = false;
279 /**
280 * A list of strings, each of which is a path from which included files
281 * are found.
282 **/
283 public Vector includePaths = new Vector ();
284
285 /**
286 * A table of defined symbols. The key is the symbol name; the value
287 * (if any) is the replacement value for the symbol.
288 **/
289 public Hashtable definedSymbols = new Hashtable ();
290
291 /**
292 * (f46082.46.01) True if new module entries are created for each
293 * re-opened module.
294 **/
295 public boolean cppModule = false;
296
297 /**
298 * -version option.
299 **/
300 public boolean versionRequest = false; // <D58319>
301
302 // <f60858.1> Specify the maximal level of the CORBA spec. the parser
303 // will support.
304 //
305 // NOTE: For BOSS 3.0, specify at 2.2. Raise to greater value in future
306 // releases.
307 /**
308 * -corba [level] option, where [level] is a floating-point number indicating
309 * the maximal level of CORBA IDL the parser framework can accept.
310 **/
311 public float corbaLevel = 2.2f;
312 // <d62023>
|