2013-07-01 22:45:33 -04:00
|
|
|
#ifndef REGEX_H
|
|
|
|
|
#define REGEX_H
|
|
|
|
|
|
|
|
|
|
#include "util.h"
|
|
|
|
|
#include "RegExState.h"
|
|
|
|
|
#include "Symbol.h"
|
|
|
|
|
|
|
|
|
|
#include <string>
|
2013-07-07 02:13:05 -04:00
|
|
|
#include <utility>
|
|
|
|
|
#include <stack>
|
|
|
|
|
#include <vector>
|
2013-07-01 22:45:33 -04:00
|
|
|
|
|
|
|
|
class RegEx {
|
|
|
|
|
public:
|
|
|
|
|
RegEx();
|
|
|
|
|
RegEx(std::string inPattern);
|
|
|
|
|
~RegEx();
|
|
|
|
|
|
2014-01-07 21:31:56 -05:00
|
|
|
RegExState* construct(std::vector<RegExState*>* ending, std::string pattern);
|
2013-07-01 22:45:33 -04:00
|
|
|
int longMatch(std::string stringToMatch);
|
|
|
|
|
std::string getPattern();
|
2013-07-02 01:47:42 -04:00
|
|
|
std::string toString();
|
2013-10-26 23:29:23 -07:00
|
|
|
static void test();
|
2013-07-01 22:45:33 -04:00
|
|
|
private:
|
|
|
|
|
std::string pattern;
|
|
|
|
|
RegExState* begin;
|
|
|
|
|
std::vector<RegExState*> currentStates;
|
|
|
|
|
};
|
2013-10-26 23:29:23 -07:00
|
|
|
#endif
|