2014-10-05 21:52:34 +00:00
|
|
|
#ifndef REZLEXER_H
|
|
|
|
#define REZLEXER_H
|
|
|
|
|
|
|
|
#include <memory>
|
2015-01-16 15:37:19 +00:00
|
|
|
#include <string>
|
2014-10-05 21:52:34 +00:00
|
|
|
|
2015-07-18 22:59:46 +00:00
|
|
|
#include "location.hh"
|
|
|
|
|
2014-10-05 21:52:34 +00:00
|
|
|
class RezSymbol;
|
2015-07-18 22:59:46 +00:00
|
|
|
class RezWorld;
|
2014-10-05 21:52:34 +00:00
|
|
|
|
|
|
|
class RezLexer
|
|
|
|
{
|
2019-08-18 11:21:00 +00:00
|
|
|
RezWorld& world;
|
|
|
|
struct Priv;
|
|
|
|
std::unique_ptr<Priv> pImpl;
|
2014-10-05 21:52:34 +00:00
|
|
|
|
2019-08-18 11:21:00 +00:00
|
|
|
std::string curFile;
|
|
|
|
yy::location lastLocation;
|
2014-10-05 21:52:34 +00:00
|
|
|
|
2019-08-18 11:21:00 +00:00
|
|
|
class WaveToken;
|
2014-10-05 21:52:34 +00:00
|
|
|
|
2019-08-18 11:21:00 +00:00
|
|
|
bool atEnd();
|
|
|
|
WaveToken nextWave();
|
|
|
|
WaveToken peekWave();
|
2014-10-05 21:52:34 +00:00
|
|
|
|
|
|
|
public:
|
2019-08-18 11:21:00 +00:00
|
|
|
RezLexer(RezWorld& world, std::string filename);
|
|
|
|
RezLexer(RezWorld& world, std::string filename, const std::string& data);
|
|
|
|
~RezLexer();
|
2014-10-05 21:52:34 +00:00
|
|
|
|
2019-08-18 11:21:00 +00:00
|
|
|
RezSymbol nextToken();
|
2014-10-16 00:26:41 +00:00
|
|
|
|
2019-08-18 11:21:00 +00:00
|
|
|
void addDefine(std::string str);
|
|
|
|
void addIncludePath(std::string path);
|
2014-10-05 21:52:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // REZLEXER_H
|