You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
463 B
31 lines
463 B
#include "webserv.hpp"
|
|
|
|
enum TOKEN {
|
|
CURLY_OPEN,
|
|
CURLY_CLOSE,
|
|
COLON,
|
|
STRING,
|
|
NUMBER,
|
|
ARRAY_OPEN,
|
|
ARRAY_CLOSE,
|
|
COMMA,
|
|
BOOLEAN,
|
|
NULL_TYPE
|
|
};
|
|
|
|
typedef struct Token_s {
|
|
string value;
|
|
TOKEN type;
|
|
} Token;
|
|
|
|
class Tokenizer {
|
|
std::fstream file;
|
|
size_t prevPos;
|
|
|
|
public:
|
|
Tokenizer(string fileName);
|
|
bool hasMoreTokens();
|
|
char getWithoutWhiteSpace();
|
|
void rollBackToken();
|
|
Token getToken();
|
|
};
|
|
|