-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
1,243 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
module github.com/MlkMahmud/jack-compiler | ||
|
||
go 1.19 | ||
|
||
require github.com/nsf/jsondiff v0.0.0-20230430225905-43f6cf3098c1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
github.com/nsf/jsondiff v0.0.0-20230430225905-43f6cf3098c1 h1:dOYG7LS/WK00RWZc8XGgcUTlTxpp3mKhdR2Q9z9HbXM= | ||
github.com/nsf/jsondiff v0.0.0-20230430225905-43f6cf3098c1/go.mod h1:mpRZBD8SJ55OIICQ3iWH0Yz3cjzA61JdqMLoWXeB2+8= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
{ | ||
"Name": { "Name": "Main" }, | ||
"Subroutines": [ | ||
{ | ||
"Name": { "Name": "main" }, | ||
"Params": null, | ||
"Kind": 1, | ||
"Type": "void", | ||
"Body": { | ||
"Statements": [ | ||
{ | ||
"Target": { "Name": "length" }, | ||
"Value": { | ||
"Arguments": [{ "Type": 3, "Value": "HOW MANY NUMBERS? " }], | ||
"Callee": { | ||
"Object": { "Name": "Keyboard" }, | ||
"Property": { "Name": "readInt" } | ||
} | ||
} | ||
}, | ||
{ | ||
"Target": { "Name": "a" }, | ||
"Value": { | ||
"Arguments": [{ "Name": "length" }], | ||
"Callee": { | ||
"Object": { "Name": "Array" }, | ||
"Property": { "Name": "new" } | ||
} | ||
} | ||
}, | ||
{ "Target": { "Name": "i" }, "Value": { "Type": 1, "Value": "0" } }, | ||
{ | ||
"Body": { | ||
"Statements": [ | ||
{ | ||
"Target": { | ||
"Indexer": { "Name": "i" }, | ||
"Object": { "Name": "a" } | ||
}, | ||
"Value": { | ||
"Arguments": [ | ||
{ "Type": 3, "Value": "ENTER THE NEXT NUMBER: " } | ||
], | ||
"Callee": { | ||
"Object": { "Name": "Keyboard" }, | ||
"Property": { "Name": "readInt" } | ||
} | ||
} | ||
}, | ||
{ | ||
"Target": { "Name": "i" }, | ||
"Value": { | ||
"Operator": 0, | ||
"Left": { "Name": "i" }, | ||
"Right": { "Type": 1, "Value": "1" } | ||
} | ||
} | ||
] | ||
}, | ||
"Condition": { | ||
"Operator": 4, | ||
"Left": { "Name": "i" }, | ||
"Right": { "Name": "length" } | ||
} | ||
}, | ||
{ "Target": { "Name": "i" }, "Value": { "Type": 1, "Value": "0" } }, | ||
{ "Target": { "Name": "sum" }, "Value": { "Type": 1, "Value": "0" } }, | ||
{ | ||
"Body": { | ||
"Statements": [ | ||
{ | ||
"Target": { "Name": "sum" }, | ||
"Value": { | ||
"Operator": 0, | ||
"Left": { "Name": "sum" }, | ||
"Right": { | ||
"Indexer": { "Name": "i" }, | ||
"Object": { "Name": "a" } | ||
} | ||
} | ||
}, | ||
{ | ||
"Target": { "Name": "i" }, | ||
"Value": { | ||
"Operator": 0, | ||
"Left": { "Name": "i" }, | ||
"Right": { "Type": 1, "Value": "1" } | ||
} | ||
} | ||
] | ||
}, | ||
"Condition": { | ||
"Operator": 4, | ||
"Left": { "Name": "i" }, | ||
"Right": { "Name": "length" } | ||
} | ||
}, | ||
{ | ||
"Expression": { | ||
"Arguments": [{ "Type": 3, "Value": "THE AVERAGE IS: " }], | ||
"Callee": { | ||
"Object": { "Name": "Output" }, | ||
"Property": { "Name": "printString" } | ||
} | ||
} | ||
}, | ||
{ | ||
"Expression": { | ||
"Arguments": [ | ||
{ | ||
"Operator": 3, | ||
"Left": { "Name": "sum" }, | ||
"Right": { "Name": "length" } | ||
} | ||
], | ||
"Callee": { | ||
"Object": { "Name": "Output" }, | ||
"Property": { "Name": "printInt" } | ||
} | ||
} | ||
}, | ||
{ | ||
"Expression": { | ||
"Arguments": null, | ||
"Callee": { | ||
"Object": { "Name": "Output" }, | ||
"Property": { "Name": "println" } | ||
} | ||
} | ||
}, | ||
{ "Expression": null } | ||
], | ||
"Vars": [ | ||
{ "Name": "a", "Kind": 2, "Type": "Array" }, | ||
{ "Name": "length", "Kind": 2, "Type": "int" }, | ||
{ "Name": "i", "Kind": 2, "Type": "int" }, | ||
{ "Name": "sum", "Kind": 2, "Type": "int" } | ||
] | ||
} | ||
} | ||
], | ||
"Vars": null | ||
} |
Oops, something went wrong.