#ifndef TOKENIZE_H #define TOKENIZE_H #include #include #include #include "types.h" using namespace std; class TokenError : public runtime_error { public: explicit TokenError(const string& message, CodePosition pos) : runtime_error(message), pos(pos) {} const CodePosition pos; }; /* Parses a string into a vector of tokens */ vector tokenize(vector str, int initial_line=0); /* Format and print a Token */ void _debug_print_token(Token token); /* Formats a list of tokens and prints it */ void _debug_print_tokens(vector tokens); #endif