public void writeToFile() throws IOException {

		String path = "C:\\Users\\lenovo\\Desktop\\1.txt";
		File f = new File(path);

		if (f.exists()) {
			f.delete();
			f = new File(path);
		}

		if (f.createNewFile()) {
			BufferedWriter output = new BufferedWriter(new FileWriter(f));
			while (current != null) {
				System.out.println(current.toString());
				output.write(current.toString());
				output.write('\n');
				current = lexer.nextToken();
			}
			output.close();
		} else
			System.out.println("fail to create the file");

	}