mjplusplus  v0.4.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
stateomat.hpp
Go to the documentation of this file.
1 #ifndef STATEOMAT_HPP
2 #define STATEOMAT_HPP
3 
4 #include <unordered_map>
5 #include <map>
6 #include <set>
7 #include <string>
8 #include <vector>
9 
10 #include "token.hpp"
11 
12 #define STATE_START 0
13 #define STATE_STOP 19
14 
15 namespace lexer
16 {
17  class Stateomat
18  {
19  public:
21  Stateomat();
27  bool state_is_accepting(unsigned int state);
32  void dump_graph(std::string const& file_name);
33 
34  //protected:
36  std::vector<std::vector<unsigned int>> transitions;
38  std::vector<Token::Token_type> state_type;
40  std::unordered_map<std::string, Token::Token_type> keywords;
45  std::vector<std::unordered_map<std::string, Token::Token_type>> operators;
47  std::map<Token::Token_type, std::string> reverse;
48  };
49 }
50 #endif
std::vector< Token::Token_type > state_type
Definition: stateomat.hpp:38
Definition: PositionAwareNode.hpp:6
bool state_is_accepting(unsigned int state)
Definition: stateomat.cpp:171
std::unordered_map< std::string, Token::Token_type > keywords
Definition: stateomat.hpp:40
std::vector< std::vector< unsigned int > > transitions
Definition: stateomat.hpp:36
void dump_graph(std::string const &file_name)
Definition: stateomat.cpp:176
Stateomat()
Definition: stateomat.cpp:9
std::map< Token::Token_type, std::string > reverse
Definition: stateomat.hpp:47
Definition: stateomat.hpp:17
std::vector< std::unordered_map< std::string, Token::Token_type > > operators
Definition: stateomat.hpp:45