/**
 *
 */
package ca.uwaterloo.joos;

import java.io.*;
import java.util.*;

/**
 * @author Greg Wang
 *
 */
public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// Construct a DFA from file
		DFA wlDFA = null;
		try {
			wlDFA = new DFA(new File("resources/wl.dfa"));
		} catch (Exception e) {
			System.err.println("ERROR: Invalid DFA File format: " + e.getLocalizedMessage());
		}
		wlDFA.addTokenKindTransformation("wain", "WAIN");
		wlDFA.addTokenKindTransformation("int", "INT");
		wlDFA.addTokenKindTransformation("if", "IF");
		wlDFA.addTokenKindTransformation("else", "ELSE");
		wlDFA.addTokenKindTransformation("while", "WHILE");
		wlDFA.addTokenKindTransformation("println", "PRINTLN");
		wlDFA.addTokenKindTransformation("return", "RETURN");

		// Construct a Scanner which use the DFA
		Scanner scanner = new Scanner(wlDFA);
		List<Token> tokens = null;

		try {
			tokens = scanner.fileToTokens(new File("resources/gcd.wl"));
		} catch (Exception e) {
			System.err.println("ERROR: " + e.getLocalizedMessage());
			System.exit(-1);
		}

		int i = 0;
		for(i = 0; i < tokens.size(); i++) {
			System.out.println(tokens.get(i).toString());
		}
	}

}

@@ -405,24 +405,75 @@
 zedMessage()
+ + %22 %22 + e.getClass().getName());%0A%09%09%09System.exit(-1
 );%0A%09%09%7D%0A%09%09wlD
@@ -1106,16 +1106,47 @@
 essage()
+ + %22 %22 + e.getClass().getName()
 );%0A%09%09%09Sy

Print exception class name