mirror of
https://github.com/hazemKrimi/jack-vm-translator.git
synced 2026-05-02 02:10:27 +00:00
Translate method refactoring
This commit is contained in:
@@ -5,30 +5,6 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
Operation determineOperation(string operation)
|
||||
{
|
||||
if (operation == "add")
|
||||
return Operation::ADD;
|
||||
if (operation == "sub")
|
||||
return Operation::SUB;
|
||||
if (operation == "neg")
|
||||
return Operation::NEG;
|
||||
if (operation == "eq")
|
||||
return Operation::EQ;
|
||||
if (operation == "gt")
|
||||
return Operation::GT;
|
||||
if (operation == "lt")
|
||||
return Operation::LT;
|
||||
if (operation == "and")
|
||||
return Operation::AND;
|
||||
if (operation == "or")
|
||||
return Operation::OR;
|
||||
if (operation == "not")
|
||||
return Operation::NOT;
|
||||
|
||||
return Operation::NEG;
|
||||
}
|
||||
|
||||
string translateAdd()
|
||||
{
|
||||
stringstream output;
|
||||
|
||||
Reference in New Issue
Block a user