* @param fileName
*/
public static void testFile(String fileName) {
SymbolTable idTable = new SymbolTable();
File input = new File("src\\pascalcompiler\\test\\codegeneration\\" + fileName + ".txt");
PascalParser pp = new PascalParser(input, idTable);
SyntaxTreeNode syntaxTree = pp.program();
String output;
CodeGenerator myCode = new CodeGenerator();
FileWriter out = null;
PrintWriter asmFile = null;
try {
out = new FileWriter(fileName + ".asm");
asmFile = new PrintWriter(out);
}
catch (IOException e) {
System.out.println(e.getMessage());
}
if(pp.isParsable()) {
System.out.println("********************Assembly-Language********************");
idTable = pp.getIDTable();
output = myCode.writeCodeForRoot((ProgramNode)syntaxTree,idTable);
asmFile.write(output);
asmFile.close();
System.out.println(output);
}