summaryrefslogtreecommitdiffhomepage
path: root/lexer.h
diff options
context:
space:
mode:
Diffstat (limited to 'lexer.h')
-rw-r--r--lexer.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/lexer.h b/lexer.h
index eb41e3d..a033cbc 100644
--- a/lexer.h
+++ b/lexer.h
@@ -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);