Added structure for Regular Expressions, saving work as a backup because of software upgrade.
This commit is contained in:
27
include/RegExState.h
Normal file
27
include/RegExState.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#ifndef REGEXSTATE_H
|
||||
#define REGEXSTATE_H
|
||||
|
||||
#include "util.h"
|
||||
#include "Symbol.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
class RegExState {
|
||||
public:
|
||||
RegExState(RegExState* inInnerState);
|
||||
RegExState(char inCharacter);
|
||||
|
||||
~RegExState();
|
||||
|
||||
void addNext(RegExState* nextState);
|
||||
bool characterIs(char inCharacter);
|
||||
std::vector<RegExState*>* advance(char advanceCharacter);
|
||||
bool isGoal();
|
||||
|
||||
private:
|
||||
std::vector<RegExState*> nextStates;
|
||||
RegExState* inner;
|
||||
char character;
|
||||
};
|
||||
#endif
|
||||
Reference in New Issue
Block a user