mirror of
https://github.com/hazemKrimi/jack-vm-translator.git
synced 2026-05-01 18:00:27 +00:00
Handle function commands
This commit is contained in:
@@ -4,28 +4,6 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
Segment determineSegment(string segment)
|
||||
{
|
||||
if (segment == "local")
|
||||
return Segment::LCL;
|
||||
if (segment == "argument")
|
||||
return Segment::ARG;
|
||||
if (segment == "this")
|
||||
return Segment::THIS;
|
||||
if (segment == "that")
|
||||
return Segment::THAT;
|
||||
if (segment == "pointer")
|
||||
return Segment::POINTER;
|
||||
if (segment == "static")
|
||||
return Segment::STATIC;
|
||||
if (segment == "temp")
|
||||
return Segment::TEMP;
|
||||
if (segment == "constant")
|
||||
return Segment::CONSTANT;
|
||||
|
||||
return Segment::CONSTANT;
|
||||
}
|
||||
|
||||
string translatePush(string filename, Segment segment, int index)
|
||||
{
|
||||
stringstream output;
|
||||
|
||||
Reference in New Issue
Block a user