Add control flow operands

This commit is contained in:
2019-11-21 18:38:02 +01:00
parent 1bac553f4b
commit f0e00ff018
9 changed files with 127 additions and 41 deletions

View File

@@ -13,7 +13,10 @@ namespace Token
{ "muli", OperandType::MultiplyInteger },
{ "shri", OperandType::ShiftIntegerRight },
{ "shli", OperandType::ShiftIntegerLeft },
{ "jmp", OperandType::Jump }
{ "jmp", OperandType::Jump },
{ "lti", OperandType::LessThanInteger },
{ "gti", OperandType::GreaterThanInteger },
{ "eqi", OperandType::EqualInteger },
};
auto const & result = operations.find(op);

View File

@@ -48,6 +48,7 @@ namespace Token
char const postfix = string[string.size() - 1];
if (postfix == ':')
{
// TODO check if label is an Operand?
return Token(lineNumber, lineColumn, string.substr(0, string.size() - 1), true);
}