Files
kraken/include/ParseRule.h

49 lines
898 B
C
Raw Normal View History

2013-05-20 19:34:15 -04:00
#ifndef PARSERULE_H
#define PARSERULE_H
#ifndef NULL
#define NULL 0
#endif
#include "Symbol.h"
#include <vector>
#include <string>
#include <iostream>
class ParseRule {
public:
ParseRule();
ParseRule(Symbol* leftHandle, int pointerIndex, std::vector<Symbol*> &rightSide, Symbol* lookahead = NULL);
2013-05-20 19:34:15 -04:00
~ParseRule();
bool const operator==(const ParseRule &other);
bool const operator!=(const ParseRule &other);
ParseRule* clone();
2013-05-20 19:34:15 -04:00
void setLeftHandle(Symbol* leftHandle);
void appendToRight(Symbol* appendee);
2013-05-23 01:35:54 -04:00
Symbol* getLeftSide();
std::vector<Symbol*> getRightSide();
Symbol* getAtNextIndex();
Symbol* getAtIndex();
int getRightSize();
int getIndex();
2013-05-23 01:35:54 -04:00
bool advancePointer();
bool isAtEnd();
2013-05-20 19:34:15 -04:00
std::string toString();
std::string toDOT();
2013-05-20 19:34:15 -04:00
private:
int pointerIndex;
Symbol* leftHandle;
Symbol* lookahead;
2013-05-20 19:34:15 -04:00
std::vector<Symbol*> rightSide;
};
#endif