1 // char_state_machine.hpp
2 // Copyright (c) 2007-2009 Ben Hanson (http://www.benhanson.net/)
4 // Distributed under the Boost Software License, Version 1.0. (See accompanying
5 // file licence_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 #ifndef BOOST_LEXER_CHAR_STATE_MACHINE_HPP
7 #define BOOST_LEXER_CHAR_STATE_MACHINE_HPP
9 #include "../consts.hpp"
11 #include "../size_t.hpp"
12 #include "../string_token.hpp"
21 template<typename CharT>
22 struct basic_char_state_machine
26 typedef basic_string_token<CharT> string_token;
27 typedef std::map<std::size_t, string_token> size_t_string_token_map;
28 typedef std::pair<std::size_t, string_token> size_t_string_token_pair;
32 std::size_t _unique_id;
34 std::size_t _bol_index;
35 std::size_t _eol_index;
36 size_t_string_token_map _transitions;
49 typedef std::vector<state> state_vector;
50 typedef std::vector<state_vector> state_vector_vector;
52 state_vector_vector _sm_vector;
56 return _sm_vector.empty ();
64 void swap (basic_char_state_machine &csm_)
66 _sm_vector.swap (csm_._sm_vector);
70 typedef basic_char_state_machine<char> char_state_machine;
71 typedef basic_char_state_machine<wchar_t> wchar_state_machine;
In the beginning the Universe was created. This has made a lot of
people very angry and has been widely regarded as a bad move.
Douglas Adams