1 // Copyright (c) 2008-2009 Ben Hanson
2 // Copyright (c) 2008-2011 Hartmut Kaiser
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)
7 // Auto-generated by boost::lexer, do not edit
9 #if !defined(BOOST_SPIRIT_LEXER_NEXT_TOKEN_CONJURE_STATIC_SWITCH_JUL_25_2011_07_03_08)
10 #define BOOST_SPIRIT_LEXER_NEXT_TOKEN_CONJURE_STATIC_SWITCH_JUL_25_2011_07_03_08
12 #include <boost/spirit/home/support/detail/lexer/char_traits.hpp>
14 ////////////////////////////////////////////////////////////////////////////////
15 // the generated table of state names and the tokenizer have to be
16 // defined in the boost::spirit::lex::lexertl::static_ namespace
17 namespace boost { namespace spirit { namespace lex { namespace lexertl { namespace static_ {
19 ////////////////////////////////////////////////////////////////////////////////
20 // this table defines the names of the lexer states
21 char const* const lexer_state_names_conjure_static_switch[1] =
26 ////////////////////////////////////////////////////////////////////////////////
27 // this variable defines the number of lexer states
28 std::size_t const lexer_state_count_conjure_static_switch = 1;
30 ////////////////////////////////////////////////////////////////////////////////
31 // this function returns the next matched token
32 template<typename Iterator>
33 std::size_t next_token_conjure_static_switch (std::size_t& /*start_state_*/, bool& /*bol_*/,
34 Iterator &start_token_, Iterator const& end_, std::size_t& unique_id_)
36 static std::size_t const npos = static_cast<std::size_t>(~0);
38 if (start_token_ == end_)
44 Iterator curr_ = start_token_;
45 bool end_state_ = false;
46 std::size_t id_ = npos;
47 std::size_t uid_ = npos;
48 Iterator end_token_ = start_token_;
52 if (curr_ == end_) goto end;
56 if ((ch_ >= '0' && ch_ <= '9')) goto state0_1;
58 if (ch_ == 't') goto state0_2;
60 if (ch_ == 'f') goto state0_3;
62 if (ch_ == 'v') goto state0_4;
64 if (ch_ == 'i') goto state0_5;
66 if (ch_ == 'e') goto state0_6;
68 if (ch_ == 'w') goto state0_7;
70 if (ch_ == 'r') goto state0_8;
72 if (ch_ == '|') goto state0_9;
74 if (ch_ == '&') goto state0_10;
76 if (ch_ == '=') goto state0_11;
78 if (ch_ == '!') goto state0_12;
80 if (ch_ == '<') goto state0_13;
82 if (ch_ == '>') goto state0_14;
84 if (ch_ == '+') goto state0_15;
86 if (ch_ == '-') goto state0_16;
88 if (ch_ == '*') goto state0_17;
90 if (ch_ == '/') goto state0_18;
92 if (ch_ == '(') goto state0_19;
94 if (ch_ == ')') goto state0_20;
96 if (ch_ == '{') goto state0_21;
98 if (ch_ == '}') goto state0_22;
100 if (ch_ == ',') goto state0_23;
102 if (ch_ == ';') goto state0_24;
104 if ((ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'd') || (ch_ >= 'g' && ch_ <= 'h') || (ch_ >= 'j' && ch_ <= 'q') || ch_ == 's' || ch_ == 'u' || (ch_ >= 'x' && ch_ <= 'z')) goto state0_25;
106 if ((ch_ >= '\t' && ch_ <= '\n') || ch_ == '\r' || ch_ == ' ') goto state0_26;
115 if (curr_ == end_) goto end;
119 if ((ch_ >= '0' && ch_ <= '9')) goto state0_1;
128 if (curr_ == end_) goto end;
132 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'q') || (ch_ >= 's' && ch_ <= 'z')) goto state0_25;
134 if (ch_ == 'r') goto state0_27;
143 if (curr_ == end_) goto end;
147 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'b' && ch_ <= 'z')) goto state0_25;
149 if (ch_ == 'a') goto state0_28;
158 if (curr_ == end_) goto end;
162 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'n') || (ch_ >= 'p' && ch_ <= 'z')) goto state0_25;
164 if (ch_ == 'o') goto state0_29;
173 if (curr_ == end_) goto end;
177 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'e') || (ch_ >= 'g' && ch_ <= 'm') || (ch_ >= 'o' && ch_ <= 'z')) goto state0_25;
179 if (ch_ == 'n') goto state0_30;
181 if (ch_ == 'f') goto state0_31;
190 if (curr_ == end_) goto end;
194 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'k') || (ch_ >= 'm' && ch_ <= 'z')) goto state0_25;
196 if (ch_ == 'l') goto state0_32;
205 if (curr_ == end_) goto end;
209 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'g') || (ch_ >= 'i' && ch_ <= 'z')) goto state0_25;
211 if (ch_ == 'h') goto state0_33;
220 if (curr_ == end_) goto end;
224 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'd') || (ch_ >= 'f' && ch_ <= 'z')) goto state0_25;
226 if (ch_ == 'e') goto state0_34;
230 if (curr_ == end_) goto end;
234 if (ch_ == '|') goto state0_35;
238 if (curr_ == end_) goto end;
242 if (ch_ == '&') goto state0_36;
251 if (curr_ == end_) goto end;
255 if (ch_ == '=') goto state0_37;
264 if (curr_ == end_) goto end;
268 if (ch_ == '=') goto state0_38;
277 if (curr_ == end_) goto end;
281 if (ch_ == '=') goto state0_39;
290 if (curr_ == end_) goto end;
294 if (ch_ == '=') goto state0_40;
324 if (curr_ == end_) goto end;
328 if (ch_ == '*') goto state0_41;
379 if (curr_ == end_) goto end;
383 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'z')) goto state0_25;
392 if (curr_ == end_) goto end;
396 if ((ch_ >= '\t' && ch_ <= '\n') || ch_ == '\r' || ch_ == ' ') goto state0_26;
405 if (curr_ == end_) goto end;
409 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 't') || (ch_ >= 'v' && ch_ <= 'z')) goto state0_25;
411 if (ch_ == 'u') goto state0_42;
420 if (curr_ == end_) goto end;
424 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'k') || (ch_ >= 'm' && ch_ <= 'z')) goto state0_25;
426 if (ch_ == 'l') goto state0_43;
435 if (curr_ == end_) goto end;
439 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'h') || (ch_ >= 'j' && ch_ <= 'z')) goto state0_25;
441 if (ch_ == 'i') goto state0_44;
450 if (curr_ == end_) goto end;
454 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 's') || (ch_ >= 'u' && ch_ <= 'z')) goto state0_25;
456 if (ch_ == 't') goto state0_45;
465 if (curr_ == end_) goto end;
469 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'z')) goto state0_25;
478 if (curr_ == end_) goto end;
482 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'r') || (ch_ >= 't' && ch_ <= 'z')) goto state0_25;
484 if (ch_ == 's') goto state0_46;
493 if (curr_ == end_) goto end;
497 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'h') || (ch_ >= 'j' && ch_ <= 'z')) goto state0_25;
499 if (ch_ == 'i') goto state0_47;
508 if (curr_ == end_) goto end;
512 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 's') || (ch_ >= 'u' && ch_ <= 'z')) goto state0_25;
514 if (ch_ == 't') goto state0_48;
560 if (curr_ == end_) goto end;
564 if (ch_ != '*') goto state0_41;
566 if (ch_ == '*') goto state0_49;
575 if (curr_ == end_) goto end;
579 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'd') || (ch_ >= 'f' && ch_ <= 'z')) goto state0_25;
581 if (ch_ == 'e') goto state0_50;
590 if (curr_ == end_) goto end;
594 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'r') || (ch_ >= 't' && ch_ <= 'z')) goto state0_25;
596 if (ch_ == 's') goto state0_42;
605 if (curr_ == end_) goto end;
609 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'c') || (ch_ >= 'e' && ch_ <= 'z')) goto state0_25;
611 if (ch_ == 'd') goto state0_51;
620 if (curr_ == end_) goto end;
624 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'z')) goto state0_25;
633 if (curr_ == end_) goto end;
637 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'd') || (ch_ >= 'f' && ch_ <= 'z')) goto state0_25;
639 if (ch_ == 'e') goto state0_52;
648 if (curr_ == end_) goto end;
652 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'k') || (ch_ >= 'm' && ch_ <= 'z')) goto state0_25;
654 if (ch_ == 'l') goto state0_53;
663 if (curr_ == end_) goto end;
667 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 't') || (ch_ >= 'v' && ch_ <= 'z')) goto state0_25;
669 if (ch_ == 'u') goto state0_54;
673 if (curr_ == end_) goto end;
677 if (ch_ == '*') goto state0_49;
679 if (ch_ != '*' && ch_ != '/') goto state0_55;
681 if (ch_ == '/') goto state0_56;
690 if (curr_ == end_) goto end;
694 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'z')) goto state0_25;
703 if (curr_ == end_) goto end;
707 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'z')) goto state0_25;
716 if (curr_ == end_) goto end;
720 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'z')) goto state0_25;
729 if (curr_ == end_) goto end;
733 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'd') || (ch_ >= 'f' && ch_ <= 'z')) goto state0_25;
735 if (ch_ == 'e') goto state0_57;
744 if (curr_ == end_) goto end;
748 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'q') || (ch_ >= 's' && ch_ <= 'z')) goto state0_25;
750 if (ch_ == 'r') goto state0_58;
754 if (curr_ == end_) goto end;
758 if (ch_ != '*') goto state0_55;
760 if (ch_ == '*') goto state0_59;
776 if (curr_ == end_) goto end;
780 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'z')) goto state0_25;
789 if (curr_ == end_) goto end;
793 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'm') || (ch_ >= 'o' && ch_ <= 'z')) goto state0_25;
795 if (ch_ == 'n') goto state0_60;
799 if (curr_ == end_) goto end;
803 if (ch_ != '*' && ch_ != '/') goto state0_55;
805 if (ch_ == '/') goto state0_56;
807 if (ch_ == '*') goto state0_59;
816 if (curr_ == end_) goto end;
820 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'z')) goto state0_25;
825 // return longest match
826 start_token_ = end_token_;
838 ////////////////////////////////////////////////////////////////////////////////
839 // this defines a generic accessors for the information above
840 struct lexer_conjure_static_switch
842 // version number and feature-set of compatible static lexer engine
845 static_version = 65536,
846 supports_bol = false,
850 // return the number of lexer states
851 static std::size_t state_count()
853 return lexer_state_count_conjure_static_switch;
856 // return the name of the lexer state as given by 'idx'
857 static char const* state_name(std::size_t idx)
859 return lexer_state_names_conjure_static_switch[idx];
862 // return the next matched token
863 template<typename Iterator>
864 static std::size_t next(std::size_t &start_state_, bool& bol_
865 , Iterator &start_token_, Iterator const& end_, std::size_t& unique_id_)
867 return next_token_conjure_static_switch(start_state_, bol_, start_token_, end_, unique_id_);
871 }}}}} // namespace boost::spirit::lex::lexertl::static_