2013-05-23 01:35:54 -04:00
|
|
|
#ifndef PARSE_ACTION_H
|
|
|
|
|
#define PARSE_ACTION_H
|
|
|
|
|
|
|
|
|
|
#ifndef NULL
|
|
|
|
|
#define NULL 0
|
|
|
|
|
#endif
|
|
|
|
|
|
2013-06-04 19:50:16 -04:00
|
|
|
#include "util.h"
|
2013-05-23 01:35:54 -04:00
|
|
|
#include "ParseRule.h"
|
|
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
|
|
class ParseAction {
|
|
|
|
|
public:
|
|
|
|
|
enum ActionType { INVALID, REDUCE, SHIFT, ACCEPT, REJECT };
|
2013-05-29 20:43:35 -04:00
|
|
|
ParseAction(ActionType action);
|
|
|
|
|
ParseAction(ActionType action, ParseRule* reduceRule);
|
|
|
|
|
ParseAction(ActionType action, int shiftState);
|
2013-05-23 01:35:54 -04:00
|
|
|
~ParseAction();
|
2013-06-04 19:50:16 -04:00
|
|
|
bool const operator==(const ParseAction &other);
|
|
|
|
|
bool const operator!=(const ParseAction &other);
|
2013-05-23 01:35:54 -04:00
|
|
|
std::string toString();
|
|
|
|
|
static std::string actionToString(ActionType action);
|
|
|
|
|
|
|
|
|
|
ActionType action;
|
|
|
|
|
ParseRule* reduceRule;
|
|
|
|
|
int shiftState;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|