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:
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user