diff options
author | Roland Reichwein <mail@reichwein.it> | 2020-03-15 21:47:42 +0100 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2020-03-15 21:47:42 +0100 |
commit | 9502989aec80e8f75cf14e7dd7d1d85333090866 (patch) | |
tree | 207785736673b6d70c14775b687dbd070129a163 /lexer.h | |
parent | 9f69b006dde3c3fbe19ed3e0275d3b7348f2aa87 (diff) |
Fix lex error
Diffstat (limited to 'lexer.h')
-rw-r--r-- | lexer.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -27,6 +27,8 @@ class Lexer size_t newState(std::string state_type = ""); void addTransition(size_t state0, size_t state1, char c); + void removeTransition(size_t state0, size_t state1, char c); + std::vector<std::pair<size_t, char>> getSuccessorsViaEmpty(size_t state); std::vector<std::pair<size_t, char>> getSuccessors(size_t state); // Build up automaton, recursively @@ -37,6 +39,9 @@ class Lexer Token getToken(const std::string& s, Location& location); void skipWhitespace(const std::string& s, Location& location); + void replaceEmptyTransitions(); + void removeEmptyTransitions(); + public: Lexer(const BNF& bnf, const std::string& top); std::vector<Token> Lex(const std::string& s); |