Fixed some bugs in Parser::firstSet and added a bit of caching. It still doesn't work quite right, though, there's some problem with nullable left recursion. However, it's better than it was, and I need to go to bed. More work later.
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
|
||||
class ParseAction {
|
||||
public:
|
||||
enum ActionType { INVALID, REDUCE, SHIFT, ACCEPT, REJECT };
|
||||
@@ -18,10 +19,11 @@ class ParseAction {
|
||||
ParseAction(ActionType action, ParseRule* reduceRule);
|
||||
ParseAction(ActionType action, int shiftState);
|
||||
~ParseAction();
|
||||
bool const equalsExceptLookahead(const ParseAction &other);
|
||||
bool const operator==(const ParseAction &other);
|
||||
bool const operator!=(const ParseAction &other);
|
||||
std::string toString();
|
||||
bool const equalsExceptLookahead(const ParseAction &other) const;
|
||||
bool const operator==(const ParseAction &other) const;
|
||||
bool const operator!=(const ParseAction &other) const;
|
||||
bool const operator<(const ParseAction &other) const;
|
||||
std::string toString(bool printRuleLookahead = true);
|
||||
static std::string actionToString(ActionType action);
|
||||
|
||||
ActionType action;
|
||||
@@ -31,4 +33,4 @@ class ParseAction {
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user