// FILE. . . . . /home/hak/ilt/src/ilog/rif/Main.java
// EDIT BY . . . Hassan Ait-Kaci
// ON MACHINE. . 4j4zn71
// STARTED ON. . Fri Apr 04 03:33:29 2008

package ilog.rif.bld;

/**
 * This is a driver class implementing a java parser from the Jacc
 * grammar specified in <a href="BLD.html"><tt>BLD.grm</tt></a>. It
 * uses the tokenizer <a href="Tokenizer.html"><tt>Tokenizer.java</tt></a>.
 * (To use it, see <i>e.g.</i>:  <a href="bld"><tt>bld</tt></a>.)
 *
 * @version     Last modified on Mon May 05 19:45:59 2008 by hak
 * @author      <a href="mailto:hak@ilog.com">Hassan A&iuml;t-Kaci</a>
 * @copyright   &copy; 2006 <a href="http://www.ilog.com/">ILOG, Inc.</a>
 */

import java.io.IOException;
import ilog.language.util.Error;

public class Main
{
  static Parser parser;
  static boolean trace = false;

  static void setTrace (boolean flag)
    {
      trace = flag;
    }

  final public static void main (String args[])
    {
      try
        {
          parser = new Parser(new Tokenizer(args[0]));
        }
      catch (IOException e)
        {
          System.err.println("*** No such file: " + args[0]);
          System.exit(1);
        }

      try
        {
	  parser.setTreeType("XML");
          parser.setQuiet(false);
          parser.setStartTime();
          parser.parse();
        }
      catch (IOException e)
        {
          parser.errorManager().reportError(new Error().setLabel("IO Error: ")
                                            .setMsg(e.getMessage()+" - giving up!")
                                            .setSee("..."));
          parser.errorManager().tallyErrors();
        }
      catch (Throwable e)
        {
//  	  System.err.println("*** Sorry - something nasty happened! ...");
          parser.errorManager().tallyErrors();
// 	  e.printStackTrace();
        }
    }
}

