
   refines class Main{
      public static void main(String args[]) {
         int                 argc = args.length;
         int                 non_switch_args;

   
       // Step 1: a general routine to pick off command line options
         //         options are removed from command line and
         //         args array is adjusted accordingly.
         //         right now, there are no command-line options
         //         but this code is here for future expansion
      
        
         non_switch_args = 0;
         for (int i=0; i < argc; i++) {
            if (args[i].charAt(0) == '-') {

   
               // switches of form -xxxxx (where xxx is a sequence of 1
                  // or more characters


   
               for (int j=1; j < args[i].length(); j++) {


                    // if (args[i].charAt(j) == 'x' {
 
                   //        ... do this for option 'x'
                    // }
                   }
            }
            else {
               // non-switch arg

               args[non_switch_args] = args[i];
               non_switch_args++;
            }
         }
      
         
         // Step 2: open file (assuming args[0] specifies a file)



         FileInputStream     inputFile = null;
         try {
 
            inputFile = new FileInputStream(args[0]);
 
        }
         catch (Exception e) {
            System.err.println("File " + args[0] + " not found:"
 
               + e.getMessage());
            System.exit(1);
         }

   
      // Step 3: create a parser and parse input files
         //         inputRoot is root of parse tree of input file


   
         BaliParser myParser = Parser.getInstance( inputFile );