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_25_53)
10 #define BOOST_SPIRIT_LEXER_NEXT_TOKEN_CONJURE_STATIC_SWITCH_JUL_25_2011_07_25_53
12 #include <boost/detail/iterator.hpp>
13 #include <boost/spirit/home/support/detail/lexer/char_traits.hpp>
15 ////////////////////////////////////////////////////////////////////////////////
16 // the generated table of state names and the tokenizer have to be
17 // defined in the boost::spirit::lex::lexertl::static_ namespace
18 namespace boost { namespace spirit { namespace lex { namespace lexertl { namespace static_ {
20 ////////////////////////////////////////////////////////////////////////////////
21 // this table defines the names of the lexer states
22 char const* const lexer_state_names_conjure_static_switch[1] =
27 ////////////////////////////////////////////////////////////////////////////////
28 // this variable defines the number of lexer states
29 std::size_t const lexer_state_count_conjure_static_switch = 1;
31 ////////////////////////////////////////////////////////////////////////////////
32 // this function returns the next matched token
33 template<typename Iterator>
34 std::size_t next_token_conjure_static_switch (std::size_t& /*start_state_*/, bool& /*bol_*/,
35 Iterator &start_token_, Iterator const& end_, std::size_t& unique_id_)
37 static std::size_t const npos = static_cast<std::size_t>(~0);
39 if (start_token_ == end_)
45 Iterator curr_ = start_token_;
46 bool end_state_ = false;
47 std::size_t id_ = npos;
48 std::size_t uid_ = npos;
49 Iterator end_token_ = start_token_;
53 if (curr_ == end_) goto end;
57 if ((ch_ >= '0' && ch_ <= '9')) goto state0_1;
59 if (ch_ == 't') goto state0_2;
61 if (ch_ == 'f') goto state0_3;
63 if (ch_ == 'v') goto state0_4;
65 if (ch_ == 'i') goto state0_5;
67 if (ch_ == 'e') goto state0_6;
69 if (ch_ == 'w') goto state0_7;
71 if (ch_ == 'r') goto state0_8;
73 if (ch_ == '|') goto state0_9;
75 if (ch_ == '&') goto state0_10;
77 if (ch_ == '=') goto state0_11;
79 if (ch_ == '!') goto state0_12;
81 if (ch_ == '<') goto state0_13;
83 if (ch_ == '>') goto state0_14;
85 if (ch_ == '+') goto state0_15;
87 if (ch_ == '-') goto state0_16;
89 if (ch_ == '*') goto state0_17;
91 if (ch_ == '/') goto state0_18;
93 if (ch_ == '(') goto state0_19;
95 if (ch_ == ')') goto state0_20;
97 if (ch_ == '{') goto state0_21;
99 if (ch_ == '}') goto state0_22;
101 if (ch_ == ',') goto state0_23;
103 if (ch_ == ';') goto state0_24;
105 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;
107 if ((ch_ >= '\t' && ch_ <= '\n') || ch_ == '\r' || ch_ == ' ') goto state0_26;
116 if (curr_ == end_) goto end;
120 if ((ch_ >= '0' && ch_ <= '9')) goto state0_1;
129 if (curr_ == end_) goto end;
133 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'q') || (ch_ >= 's' && ch_ <= 'z')) goto state0_25;
135 if (ch_ == 'r') goto state0_27;
144 if (curr_ == end_) goto end;
148 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'b' && ch_ <= 'z')) goto state0_25;
150 if (ch_ == 'a') goto state0_28;
159 if (curr_ == end_) goto end;
163 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'n') || (ch_ >= 'p' && ch_ <= 'z')) goto state0_25;
165 if (ch_ == 'o') goto state0_29;
174 if (curr_ == end_) goto end;
178 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;
180 if (ch_ == 'n') goto state0_30;
182 if (ch_ == 'f') goto state0_31;
191 if (curr_ == end_) goto end;
195 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'k') || (ch_ >= 'm' && ch_ <= 'z')) goto state0_25;
197 if (ch_ == 'l') goto state0_32;
206 if (curr_ == end_) goto end;
210 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'g') || (ch_ >= 'i' && ch_ <= 'z')) goto state0_25;
212 if (ch_ == 'h') goto state0_33;
221 if (curr_ == end_) goto end;
225 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'd') || (ch_ >= 'f' && ch_ <= 'z')) goto state0_25;
227 if (ch_ == 'e') goto state0_34;
231 if (curr_ == end_) goto end;
235 if (ch_ == '|') goto state0_35;
239 if (curr_ == end_) goto end;
243 if (ch_ == '&') goto state0_36;
252 if (curr_ == end_) goto end;
256 if (ch_ == '=') goto state0_37;
265 if (curr_ == end_) goto end;
269 if (ch_ == '=') goto state0_38;
278 if (curr_ == end_) goto end;
282 if (ch_ == '=') goto state0_39;
291 if (curr_ == end_) goto end;
295 if (ch_ == '=') goto state0_40;
325 if (curr_ == end_) goto end;
329 if (ch_ == '*') goto state0_41;
380 if (curr_ == end_) goto end;
384 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'z')) goto state0_25;
393 if (curr_ == end_) goto end;
397 if ((ch_ >= '\t' && ch_ <= '\n') || ch_ == '\r' || ch_ == ' ') goto state0_26;
406 if (curr_ == end_) goto end;
410 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 't') || (ch_ >= 'v' && ch_ <= 'z')) goto state0_25;
412 if (ch_ == 'u') goto state0_42;
421 if (curr_ == end_) goto end;
425 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'k') || (ch_ >= 'm' && ch_ <= 'z')) goto state0_25;
427 if (ch_ == 'l') goto state0_43;
436 if (curr_ == end_) goto end;
440 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'h') || (ch_ >= 'j' && ch_ <= 'z')) goto state0_25;
442 if (ch_ == 'i') goto state0_44;
451 if (curr_ == end_) goto end;
455 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 's') || (ch_ >= 'u' && ch_ <= 'z')) goto state0_25;
457 if (ch_ == 't') goto state0_45;
466 if (curr_ == end_) goto end;
470 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'z')) goto state0_25;
479 if (curr_ == end_) goto end;
483 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'r') || (ch_ >= 't' && ch_ <= 'z')) goto state0_25;
485 if (ch_ == 's') goto state0_46;
494 if (curr_ == end_) goto end;
498 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'h') || (ch_ >= 'j' && ch_ <= 'z')) goto state0_25;
500 if (ch_ == 'i') goto state0_47;
509 if (curr_ == end_) goto end;
513 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 's') || (ch_ >= 'u' && ch_ <= 'z')) goto state0_25;
515 if (ch_ == 't') goto state0_48;
561 if (curr_ == end_) goto end;
565 if (ch_ != '*') goto state0_41;
567 if (ch_ == '*') goto state0_49;
576 if (curr_ == end_) goto end;
580 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'd') || (ch_ >= 'f' && ch_ <= 'z')) goto state0_25;
582 if (ch_ == 'e') goto state0_50;
591 if (curr_ == end_) goto end;
595 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'r') || (ch_ >= 't' && ch_ <= 'z')) goto state0_25;
597 if (ch_ == 's') goto state0_42;
606 if (curr_ == end_) goto end;
610 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'c') || (ch_ >= 'e' && ch_ <= 'z')) goto state0_25;
612 if (ch_ == 'd') goto state0_51;
621 if (curr_ == end_) goto end;
625 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'z')) goto state0_25;
634 if (curr_ == end_) goto end;
638 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'd') || (ch_ >= 'f' && ch_ <= 'z')) goto state0_25;
640 if (ch_ == 'e') goto state0_52;
649 if (curr_ == end_) goto end;
653 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'k') || (ch_ >= 'm' && ch_ <= 'z')) goto state0_25;
655 if (ch_ == 'l') goto state0_53;
664 if (curr_ == end_) goto end;
668 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 't') || (ch_ >= 'v' && ch_ <= 'z')) goto state0_25;
670 if (ch_ == 'u') goto state0_54;
674 if (curr_ == end_) goto end;
678 if (ch_ == '*') goto state0_49;
680 if (ch_ != '*' && ch_ != '/') goto state0_55;
682 if (ch_ == '/') goto state0_56;
691 if (curr_ == end_) goto end;
695 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'z')) goto state0_25;
704 if (curr_ == end_) goto end;
708 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'z')) goto state0_25;
717 if (curr_ == end_) goto end;
721 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'z')) goto state0_25;
730 if (curr_ == end_) goto end;
734 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'd') || (ch_ >= 'f' && ch_ <= 'z')) goto state0_25;
736 if (ch_ == 'e') goto state0_57;
745 if (curr_ == end_) goto end;
749 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'q') || (ch_ >= 's' && ch_ <= 'z')) goto state0_25;
751 if (ch_ == 'r') goto state0_58;
755 if (curr_ == end_) goto end;
759 if (ch_ != '*') goto state0_55;
761 if (ch_ == '*') goto state0_59;
777 if (curr_ == end_) goto end;
781 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'z')) goto state0_25;
790 if (curr_ == end_) goto end;
794 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'm') || (ch_ >= 'o' && ch_ <= 'z')) goto state0_25;
796 if (ch_ == 'n') goto state0_60;
800 if (curr_ == end_) goto end;
804 if (ch_ != '*' && ch_ != '/') goto state0_55;
806 if (ch_ == '/') goto state0_56;
808 if (ch_ == '*') goto state0_59;
817 if (curr_ == end_) goto end;
821 if ((ch_ >= '0' && ch_ <= '9') || (ch_ >= 'A' && ch_ <= 'Z') || ch_ == '_' || (ch_ >= 'a' && ch_ <= 'z')) goto state0_25;
826 // return longest match
827 start_token_ = end_token_;
839 ////////////////////////////////////////////////////////////////////////////////
840 // this defines a generic accessors for the information above
841 struct lexer_conjure_static_switch
843 // version number and feature-set of compatible static lexer engine
846 static_version = 65536,
847 supports_bol = false,
851 // return the number of lexer states
852 static std::size_t state_count()
854 return lexer_state_count_conjure_static_switch;
857 // return the name of the lexer state as given by 'idx'
858 static char const* state_name(std::size_t idx)
860 return lexer_state_names_conjure_static_switch[idx];
863 // return the next matched token
864 template<typename Iterator>
865 static std::size_t next(std::size_t &start_state_, bool& bol_
866 , Iterator &start_token_, Iterator const& end_, std::size_t& unique_id_)
868 return next_token_conjure_static_switch(start_state_, bol_, start_token_, end_, unique_id_);
872 }}}}} // namespace boost::spirit::lex::lexertl::static_