1 // consts.h
2 // Copyright (c) 2007-2009 Ben Hanson (http://www.benhanson.net/)
3 //
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_CONSTS_H
7 #define BOOST_LEXER_CONSTS_H
8 
9 #include <boost/config.hpp>
10 #include <boost/integer_traits.hpp>
11 #include "size_t.hpp"
12 
13 namespace boost
14 {
15 namespace lexer
16 {
17     enum regex_flags {none = 0, icase = 1, dot_not_newline = 2};
18     // 0 = end state, 1 = id, 2 = unique_id, 3 = lex state, 4 = bol, 5 = eol,
19     // 6 = dead_state_index
20     enum {end_state_index, id_index, unique_id_index, state_index, bol_index,
21         eol_index, dead_state_index, dfa_offset};
22 
23     const std::size_t max_macro_len = 30;
24     const std::size_t num_chars = 256;
25     // If sizeof(wchar_t) == sizeof(size_t) then don't overflow to 0
26     // by adding one to comparison.
27     const std::size_t num_wchar_ts =
28         (boost::integer_traits<wchar_t>::const_max < 0x110000) ?
29         boost::integer_traits<wchar_t>::const_max +
30         static_cast<std::size_t> (1) : 0x110000;
31     const std::size_t null_token = static_cast<std::size_t> (~0);
32     const std::size_t bol_token = static_cast<std::size_t> (~1);
33     const std::size_t eol_token = static_cast<std::size_t> (~2);
34     const std::size_t end_state = 1;
35     const std::size_t npos = static_cast<std::size_t> (~0);
36 }
37 }
38 
39 #endif
40