Files
bits-runner-builder/Token.h
Rafał Grodziński 69bf54a62d Tokenizing input
2025-05-27 22:38:44 +09:00

43 lines
620 B
C++

#ifndef TOKEN_H
#define TOKEN_H
#include <iostream>
class Token {
public:
enum Kind {
PLUS,
MINUS,
STAR,
SLASH,
PERCENT,
LEFT_PAREN,
RIGHT_PAREN,
DOT,
COMMA,
INTEGER,
NEW_LINE,
END,
INVALID
};
private:
Kind kind;
std::string lexme;
public:
Token(Kind kind, std::string lexme);
Kind getKind();
std::string getLexme();
bool operator==(Token const& other);
bool operator!=(Token const& other);
std::string toString();
static Token Invalid;
};
#endif