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
|
|
|
|
{
|
2015-07-18 22:59:46 +00:00
|
|
|
RezWorld& world;
|
2014-10-05 21:52:34 +00:00
|
|
|
struct Priv;
|
|
|
|
std::unique_ptr<Priv> pImpl;
|
|
|
|
|
|
|
|
std::string curFile;
|
2015-07-18 22:59:46 +00:00
|
|
|
yy::location lastLocation;
|
2014-10-05 21:52:34 +00:00
|
|
|
|
|
|
|
class WaveToken;
|
|
|
|
|
|
|
|
bool atEnd();
|
|
|
|
WaveToken nextWave();
|
|
|
|
WaveToken peekWave();
|
|
|
|
|
|
|
|
public:
|
2015-07-18 22:59:46 +00:00
|
|
|
RezLexer(RezWorld& world, std::string filename);
|
|
|
|
RezLexer(RezWorld& world, std::string filename, const std::string& data);
|
2014-10-05 21:52:34 +00:00
|
|
|
~RezLexer();
|
|
|
|
|
|
|
|
RezSymbol nextToken();
|
2014-10-16 00:26:41 +00:00
|
|
|
|
|
|
|
void addDefine(std::string str);
|
|
|
|
void addIncludePath(std::string path);
|
2014-10-05 21:52:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // REZLEXER_H
|