2013-07-28 19:45:08 -04:00
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
|
|
class RNGLRParser {
|
|
|
|
|
public:
|
|
|
|
|
parseInput(std::string inputString);
|
|
|
|
|
reducer(int i);
|
|
|
|
|
shifter(int i);
|
|
|
|
|
private:
|
|
|
|
|
Lexer lexer;
|
|
|
|
|
std::vector<Symbol*> input;
|
|
|
|
|
GraphStructuredStack gss;
|
|
|
|
|
//start node, lefthand side of the reduction, reduction length
|
2013-07-28 23:48:10 -04:00
|
|
|
std::queue<std::pair< std::pair<NodeTree<int>*, Symbol*>, int > toReduce;
|
2013-07-28 19:45:08 -04:00
|
|
|
//Node coming from, state going to
|
2013-07-28 23:48:10 -04:00
|
|
|
std::queue< std::pair<NodeTree<int>*, int> > toShift;
|
2013-07-28 19:45:08 -04:00
|
|
|
};
|