package edu.asu.plp;

import java.io.File;
import java.io.PrintWriter;
import java.util.List;

import edu.asu.plp.compile.lex.Lexer;
import edu.asu.plp.compile.parser.Parser;
import edu.asu.plp.compile.parser.statements.Statement;

public class Main
{
	public static void main(String[] args) throws Exception
	{
		// Run Oracle Compile
		// if (compileError) ECHO and END
		// Convert and remove modifiers (simplify source code)
		// Create scoped symbol table
		// Convert and simplify variables
		// Create execution graph
		// Write graph to assembly
		
		// TODO: remove comments (preprocess)
		
		File inputFile = new File("sampleData/BasicArithmatic.java");
		File outputFile = new File("sampleData/output/BasicArithmatic.java.lexed");
		Lexer lexer = new Lexer(inputFile);
		PrintWriter output = new PrintWriter(outputFile);
		List<Token> tokens = lexer.lex();
		for (Token token : tokens)
		{
			System.out.println(token);
			output.println(token);
		}
		output.close();
		
		Parser parser = new Parser(tokens);
		
		List<Statement> statements = parser.parse(tokens);
	}
}

@@ -741,129 +741,247 @@
 ;%0A%09%09
-Lexer lexer = new Lexer(inputFile);%0A%09%09PrintWriter output = new PrintWriter(outputFile);%0A%09%09List%3CToken%3E tokens = lexer.lex(
+File dumpFile = new File(%22sampleData/BasicArithmatic.java.PREPROCESS%22);%0A%09%09%0A%09%09Lexer lexer = new Lexer(inputFile);%0A%09%09lexer.dumpPreprocessData(dumpFile);%0A%09%09List%3CToken%3E tokens = lexer.lex();%0A%09%09%0A%09%09PrintWriter output = new PrintWriter(outputFile
 );%0A%09

Refactor preprocess output