private void scan(boolean target, boolean debug) throws IOException{
		System.out.println("stage: scanner");
		PrintWriter pw = null;
		if (target){
			output = new File(this.name + ".scan");
			output.createNewFile();
			pw = new PrintWriter(new FileWriter(output));
			pw.println("LINEA\t\tTIPO\t\t\t\t\t\tVALOR");
			if (debug)
				System.out.println("Se creo el archivo de salida "+ output.getName());
		}
		lexer = new Decaf(new ANTLRFileStream(this.source.getPath()));
		lexer.removeErrorListeners();
		LexerErrorHandler error = new LexerErrorHandler();
		lexer.addErrorListener(error);
		Token actual = lexer.nextToken();
		while (actual.getType() != Token.EOF){
			if (target){
				String tokenString = "" + actual.getLine();
				while (tokenString.length()<10)
					tokenString += " ";
				tokenString += lexer.actualType;
				while (tokenString.length()<40)
					tokenString += " ";
				tokenString += actual.getText();
				pw.println(tokenString);
			}
			if (debug){
				Debug.scannerDebug(lexer.actualType, actual);
			}
			actual = lexer.nextToken();
		}
		error.printErrors();
		if (error.getNumberOfErrors() > 0)
			System.out.println("Se encontraron " + error.getNumberOfErrors() + " errores lexicos.");
		else
				System.out.println("No se encontraron errores lexicos.");
		if (target)
			pw.close();
	}