2013-07-01 22:45:33 -04:00
|
|
|
#ifndef REGEXSTATE_H
|
|
|
|
|
#define REGEXSTATE_H
|
|
|
|
|
|
|
|
|
|
#include "util.h"
|
|
|
|
|
#include "Symbol.h"
|
|
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
|
class RegExState {
|
|
|
|
|
public:
|
|
|
|
|
RegExState(char inCharacter);
|
2013-07-02 13:14:40 -04:00
|
|
|
RegExState();
|
2013-07-01 22:45:33 -04:00
|
|
|
~RegExState();
|
|
|
|
|
|
|
|
|
|
void addNext(RegExState* nextState);
|
|
|
|
|
bool characterIs(char inCharacter);
|
|
|
|
|
std::vector<RegExState*>* advance(char advanceCharacter);
|
2015-06-08 21:47:02 -04:00
|
|
|
std::vector<RegExState*> getNextStates();
|
2013-07-07 02:13:05 -04:00
|
|
|
|
2013-07-01 22:45:33 -04:00
|
|
|
bool isGoal();
|
2013-07-02 01:47:42 -04:00
|
|
|
std::string toString();
|
2013-07-07 02:13:05 -04:00
|
|
|
std::string toString(RegExState* avoid);
|
|
|
|
|
std::string toString(std::vector<RegExState*>* avoid);
|
|
|
|
|
|
|
|
|
|
char getCharacter();
|
2013-07-01 22:45:33 -04:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
std::vector<RegExState*> nextStates;
|
|
|
|
|
char character;
|
|
|
|
|
};
|
2015-06-08 21:47:02 -04:00
|
|
|
#endif
|