Have almost got the RNGLR recognizer. Something is wrong with the GSS, I think when it's built. It seems to sometimes have parents as children, or something.

This commit is contained in:
Nathan Braswell
2013-07-31 23:51:05 -04:00
parent 3fba45591b
commit 9887555dd5
12 changed files with 169 additions and 77 deletions

View File

@@ -1,17 +1,20 @@
#include <iostream>
#include <queue>
#include "Parser.h"
#include "GraphStructuredStack.h"
class RNGLRParser {
class RNGLRParser: public Parser {
public:
parseInput(std::string inputString);
reducer(int i);
shifter(int i);
RNGLRParser();
~RNGLRParser();
NodeTree<Symbol*>* parseInput(std::string inputString);
void reducer(int i);
void shifter(int i);
private:
Lexer lexer;
std::vector<Symbol*> input;
GraphStructuredStack gss;
//start node, lefthand side of the reduction, reduction length
std::queue<std::pair< std::pair<NodeTree<int>*, Symbol*>, int > toReduce;
std::queue<std::pair< std::pair<NodeTree<int>*, Symbol*>, int > > toReduce;
//Node coming from, state going to
std::queue< std::pair<NodeTree<int>*, int> > toShift;
};