@Override
    protected int processOptions(String[] args)
    {
        ArrayList<SymbolTable> imports = new ArrayList<SymbolTable>();

        int i;
        for (i = 0; i < args.length; i++)
        {
            String arg = args[i];
            if ("--catalog".equals(arg))
            {
                String symtabPath = args[++i];
                loadCatalog(symtabPath);
            }
            else if ("--import".equals(arg))
            {
                // We'll use the latest version available.
                String name = args[++i];
                SymbolTable symtab = getLatestSharedSymtab(name);
                imports.add(symtab);
            }
            else if ("--output-dir".equals(arg))
            {
                String path = args[++i];
                myOutputDir = new File(path);
                if (! myOutputDir.isDirectory() || ! myOutputDir.canWrite())
                {
                    throw new RuntimeException("Not a writeable directory: "
                                               + path);
                }
            }
            else if ("--output".equals(arg))
	    {
		String path = args[++i];
                myOutputFile = path;
                myOutputDir = new File(path).getParentFile();
                if (! myOutputDir.isDirectory() || ! myOutputDir.canWrite())
                {
                    throw new RuntimeException("Not a writeable directory: "
                                               + path);
                }
            }
            else
            {
                // this arg is not an option, we're done here
                break;
            }
        }

        myImports = imports.toArray(new SymbolTable[0]);

        return i;
    }
@ Override protected int processOptions ( String [ ] args ) { ArrayList < SymbolTable > imports = new ArrayList < SymbolTable > ( ) ; int i ; for ( i = 0 ; i < args . length ; i ++ ) { String arg = args [ i ] ; if ( "--catalog" . equals ( arg ) ) { String symtabPath = args [ ++ i ] ; loadCatalog ( symtabPath ) ; } else if ( "--import" . equals ( arg ) ) { String name = args [ ++ i ] ; SymbolTable symtab = getLatestSharedSymtab ( name ) ; imports . add ( symtab ) ; } else if ( "--output-dir" . equals ( arg ) ) { String path = args [ ++ i ] ; myOutputDir = new File ( path ) ; if ( ! myOutputDir . isDirectory ( ) || ! myOutputDir . canWrite ( ) ) { throw new RuntimeException ( "Not a writeable directory: " + path ) ; } } else if ( "--output" . equals ( arg ) ) { String path = args [ ++ i ] ; myOutputFile = path ; myOutputDir = new File ( path ) . getParentFile ( ) ; if ( ! myOutputDir . isDirectory ( ) || ! myOutputDir . canWrite ( ) ) { throw new RuntimeException ( "Not a writeable directory: " + path ) ; } } else { break ; } } myImports = imports . toArray ( new SymbolTable [ 0 ] ) ; return i ; }
@param args
@return the next index to process