LL1Checker 3.0
“Tool for verifying LL(1) grammars and validating input strings.”
Loading...
Searching...
No Matches
lexer.hpp
1#include <boost/spirit/include/lex_lexertl.hpp>
2#include <vector>
3class Lex {
4 std::string filename_;
5 std::vector<std::string> tokens_;
6 unsigned current_;
7
8 public:
32 template <typename Lexer>
33 struct ParseInput : boost::spirit::lex::lexer<Lexer> {
34 ParseInput();
35 };
36
52 struct Add {
53 typedef bool result_type;
54 template <typename Token>
55 bool operator()(Token const& t, std::vector<std::string>& tks) const;
56 };
57
66 explicit Lex(std::string filename);
67
76 std::string Next();
77
78 private:
108 void Tokenize();
109};
std::string Next()
Retrieves the next token from the token vector.
Definition lexer.cpp:58
Lex(std::string filename)
Constructs a lexer and tokenizes the specified input file.
Definition lexer.cpp:13
void Tokenize()
Tokenizes the input file using Boost Spirit Lex.
Definition lexer.cpp:40
Functor for adding tokens to the token list during tokenization.
Definition lexer.hpp:52