33 lines
429 B
C++
33 lines
429 B
C++
#ifndef LEXER_HPP
|
|
#define LEXER_HPP
|
|
|
|
#include <map>
|
|
#include <regex>
|
|
|
|
#include "Token.hpp"
|
|
#include "TokenList.hpp"
|
|
|
|
namespace Blang{
|
|
|
|
class Buffer{
|
|
public:
|
|
Buffer(const std::string& text);
|
|
|
|
char nextChar();
|
|
std::string nextChars(int n);
|
|
|
|
private:
|
|
std::string _text;
|
|
};
|
|
|
|
class Lexer
|
|
{
|
|
public:
|
|
TokenList tokenize(const std::string& text);
|
|
TokenList tokenizeFile(const std::string& filename);
|
|
|
|
};
|
|
}
|
|
|
|
#endif
|