public static void main(String args []) throws Exception
  {
    Decaf parser;
    DecafVisitor visitor = new TypeChecker();
    CodeGenerator codeGen = new CodeGenerator();
    ScopeFactory sf = ScopeFactory.getScopeFactory();
    if (args.length == 1) {
      try {
        parser = new Decaf(new java.io.FileInputStream(args[0]));
      } catch (java.io.FileNotFoundException e) {
        System.out.println("File "+args[0]+ " not found," +
            " reading from terminal instead");
        parser = new Decaf(System.in);
      }
    } else {
      System.out.println("Reading from standard input...");
      parser =  new Decaf(System.in);
    }
    start_AST start = null;
    try
    {
           /**
      *Defaults IO
      */
          parser = new Decaf(new java.io.FileInputStream("src/stage2/Defaults.decaf"));
      start = parser.Start();
      System.out.println("Parsed Successfully.");
      MODE = 1;
      sf.getCurrentScope().setKidLevel(0);

      parser = new Decaf(new java.io.FileInputStream("src/stage2/Defaults.decaf"));
      start = parser.Start();
          MODE = 0;
      sf.getCurrentScope().setKidLevel(0);
      /**
      *Parser and Symbol Table Generator
      */
          parser = new Decaf(new java.io.FileInputStream(args[0]));
      start = parser.Start();
      System.out.println("Parsed Successfully.");
      MODE = 1;
          sf.getCurrentScope().setKidLevel(0);
      /**
      *Symbol Table Verification
      */
      parser = new Decaf(new java.io.FileInputStream(args[0]));
      start = parser.Start();
          sf.getCurrentScope().setKidLevel(0);
      /**
      *TypeChecking
      */
      SYMBOL_TABLE.enterScope(true, 1);
      visitor.visitStart_AST(start,sf.getCurrentScope());
      SYMBOL_TABLE.exitScope(1);
      sf.getCurrentScope().setKidLevel(0);
          /**
	  *Code Generation
	  */
      SYMBOL_TABLE.enterScope(true, 1);
      codeGen.visitStart(start, sf.getCurrentScope());
      SYMBOL_TABLE.exitScope(1);
      //start.dump(" -> ");
    }
    catch (Exception e)
    {
      System.out.println("ERROR : " + e.getMessage());
      throw e;
    }

  }