diff --git a/CodeWriter.java b/CodeWriter.java index 949720d..346f56f 100644 --- a/CodeWriter.java +++ b/CodeWriter.java @@ -432,7 +432,7 @@ public void writeIf(String label) { * Set ARG * Jumps to execute the function **/ - public void writeCall(String funcName, int nArgs) { + public void writeCall(String funcName, String nArgs) { try { // Save caller's frame // push return address @@ -617,7 +617,7 @@ private void endFrameMinus(String seg, String n) { } // Write Assembly code for the function command - public void writeFunction(String funcName, int nLocals) { + public void writeFunction(String funcName, String nLocals) { try { // (funcName) out.write("(" + funcName + ")"); diff --git a/Parser.java b/Parser.java index 8434f3e..5eb6e15 100644 --- a/Parser.java +++ b/Parser.java @@ -94,22 +94,22 @@ else if (type.equals("pop")) { else if (type.equals("arithmetic")) { type = "C_ARITHMETIC"; } - else if (type.equals("label") { + else if (type.equals("label")) { type = "C_LABEL"; } - else if (type.equals("goto") { + else if (type.equals("goto")) { type = "C_GOTO"; } - else if (type.equals("if-goto") { + else if (type.equals("if-goto")) { type = "C_IF"; } - else if (type.equals("function") { + else if (type.equals("function")) { type = "C_FUNCTION"; } - else if (type.equals("return") { + else if (type.equals("return")) { type = "C_RETURN"; } - else if (type.equals("call") { + else if (type.equals("call")) { type = "C_CALL"; } return type;