Added main loop of parser.

This commit is contained in:
Nathan Braswell
2013-05-23 01:35:54 -04:00
parent 14fc410e00
commit e4f83cbb67
9 changed files with 142 additions and 2 deletions

28
include/ParseAction.h Normal file
View File

@@ -0,0 +1,28 @@
#ifndef PARSE_ACTION_H
#define PARSE_ACTION_H
#ifndef NULL
#define NULL 0
#endif
#include "ParseRule.h"
#include <vector>
#include <string>
class ParseAction {
public:
enum ActionType { INVALID, REDUCE, SHIFT, ACCEPT, REJECT };
ParseAction(ActionType action, ParseRule* reduceRule = NULL, int shiftState = 0);
~ParseAction();
std::string toString();
static std::string actionToString(ActionType action);
ActionType action;
ParseRule* reduceRule;
int shiftState;
};
#endif