Basic expression parsing

This commit is contained in:
Rafał Grodziński
2025-05-30 13:33:45 +09:00
parent d5d21aa422
commit 1aceef1273
7 changed files with 197 additions and 35 deletions

View File

@@ -21,6 +21,15 @@ bool Token::operator!=(Token const& other) {
return kind != other.kind;
}
bool Token::isOneOf(std::vector<Kind> kinds) {
for (Kind &kind : kinds) {
if (kind == this->kind)
return true;
}
return false;
}
std::string Token::toString() {
switch (kind) {
case PLUS: