Skip to content

Commit

Permalink
Fix some errors
Browse files Browse the repository at this point in the history
  • Loading branch information
VipinindKumar committed Aug 27, 2017
1 parent 8bd0cfa commit cbb0e8d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions CodeWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 + ")");
Expand Down
12 changes: 6 additions & 6 deletions Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit cbb0e8d

Please sign in to comment.