Retro68/Rez/RezLexer.h

39 lines
663 B
C
Raw Normal View History

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
{
RezWorld& world;
struct Priv;
std::unique_ptr<Priv> pImpl;
2014-10-05 21:52:34 +00:00
std::string curFile;
yy::location lastLocation;
2014-10-05 21:52:34 +00:00
class WaveToken;
2014-10-05 21:52:34 +00:00
bool atEnd();
WaveToken nextWave();
WaveToken peekWave();
2014-10-05 21:52:34 +00:00
public:
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
RezSymbol nextToken();
void addDefine(std::string str);
void addIncludePath(std::string path);
2014-10-05 21:52:34 +00:00
};
#endif // REZLEXER_H