teditor
1.8.0@@fee5e94
Terminal based editor written in C++
|
Go to the documentation of this file.
6 #include <unordered_map>
7 #include <unordered_set>
34 const char*
token2str(uint32_t tok)
const;
37 std::vector<NFA*> nfas;
39 std::unordered_map<uint32_t, std::string> names;
42 bool step(
char c,
const Point& pt,
int& nActives,
int& nSoleMatches,
44 void getLongestMatchingToken(
Token& ret,
bool lastRemainingState);
const char * token2str(uint32_t tok) const
Definition: lexer.cpp:71
virtual bool isEof() const =0
uint32_t type
Definition: parse_tree.h:19
virtual char next(Point &pt)=0
Ken-Thompson NFA as described here: https://swtch.com/~rsc/regexp/regexp1.html but adjusted to work w...
Definition: nfa.h:23
Point end
Definition: parse_tree.h:23
Lexer(const TokenDefs &t)
Definition: lexer.cpp:8
std::string regex
Definition: lexer.h:19
Definition: parse_tree.h:13
static const uint32_t Unknown
Definition: parse_tree.h:30
static const uint32_t End
Definition: parse_tree.h:28
static const uint32_t Root
Definition: parse_tree.h:32
#define ASSERT(check, fmt,...)
Macro to assert with runtime_error exception if the check fails.
Definition: utils.h:35
std::string name
Definition: lexer.h:20
uint32_t type
Definition: lexer.h:18
std::vector< TokenDef > TokenDefs
Definition: lexer.h:22
virtual ~Lexer()
Definition: lexer.cpp:19
Point start
Definition: parse_tree.h:21
virtual Token next(Scanner *sc)
Definition: lexer.cpp:32