public void parseFile(MidLayerControl mlc) throws Exception
   {
      String inputFile = mlc.getInputFileName();
      this.codeTree = mlc.getCodeTree();
      getGlobalSymTab();
      this.symbolTable = mlc.getSymbolTable(currentNestingLevel++, symTabStack);

      Scanner scanPrint = new Scanner(inputFile);
      scanPrint.scan(); //printout all the stuff in scanner first

      scanner = new Scanner(inputFile);
      Token token;
      //need to call this first for the scanner to work.
      scanner.nextCharNoPrint();
      while ((token = scanner.getNextToken()) != null)
      {
         if ("()".contains(token.getValue()))
         {
            putToStack(token, parentStack);
         }
         //put to Symbol table
         parseToSymbolTable(token, this.symbolTable, mlc);
         if (isBalanced(parentStack))
         {
            if (currentNestingLevel > symTabStack.size() - 1)
            {
               symTabStack.add(this.symbolTable);
            }
            currentNestingLevel = 1;
            this.symbolTable = mlc.getSymbolTable(currentNestingLevel++, symTabStack);
         }
      }

      //do cleanup
      removeEmptyStack();

      scanner = new Scanner(inputFile);
      //need to call this first for the scanner to work.
      scanner.nextCharNoPrint();
      while ((token = scanner.getNextToken()) != null)
      {
         //add the token to the tree and list - assuming it is not a comment
         //Note that even comments should be handled by the tree itself
         this.codeTree.addToken(token);
      }

      //don't remember if this is needed...
      mlc.setCodeTree(this.codeTree);
      mlc.setSymbolTable(this.symbolTable);
   }