private void parse(boolean target, boolean debug) throws IOException{
		System.out.println("stage: parser");
		PrintWriter pw = null;
		if (target){
			outFile = new File(this.name + ".parse");
			outFile.createNewFile();
			pw = new PrintWriter(new FileWriter(outFile));
			if (debug)
				System.out.println("Se creo el archivo de salida "+ outFile.getName());
		}
		compiler.scanner.Decaf lexer = new compiler.scanner.Decaf(new ANTLRFileStream(scanner.getSource().getPath()));
		lexer.removeErrorListeners();
		CommonTokenStream tokens = new CommonTokenStream(lexer);
		parser = new Decaf(tokens);
		parser.removeErrorListeners();
		ParserErrorHandler error = new ParserErrorHandler();
		parser.addErrorListener(error);
		ParseTree tree = parser.program();
		if (debug)
			Debug.parserDebug(tree.toStringTree(parser));
		error.printErrors();
		if (error.getNumberOfErrors() > 0){
			System.out.println("Se encontraron " + error.getNumberOfErrors() + " errores de sintaxis.");
			System.exit(1);
		}
		else{
			System.out.println("No se encontraron errores de sintaxis.");
			System.exit(0);
		}
	}