summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2018-01-17 13:36:59 -0200
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2018-01-17 13:36:59 -0200
commit166c371e93505adfcc6217c706ec704c30b99450 (patch)
tree2b11f1e704a4f7c2400b882fd8ab6202eb5b0d4b
parentf8e36dce771c6ff0b44e4714437dc143b9354c9a (diff)
eolian-js: Add prototype registration
-rw-r--r--src/Makefile_Efl_Js.am22
-rw-r--r--src/Makefile_Elementary.am2
-rw-r--r--src/bin/eolian_js/eolian/grammar/class_registration.hpp80
-rw-r--r--src/bin/eolian_js/eolian/grammar/stub_function_definition.hpp110
-rw-r--r--src/bin/eolian_js/main.cc399
-rw-r--r--src/bindings/cxx/eina_cxx/eina_tpl_char_switch.hh11168
-rw-r--r--src/bindings/js/efl_js/efl_js.cc62
-rw-r--r--src/bindings/js/eo_js/eo_js_constructor.hh7
-rw-r--r--src/bindings/js/eo_js/eo_js_namespace_accessor.hh6
-rw-r--r--src/bindings/js/eo_js/eo_js_namespace_tree.hh108
-rw-r--r--src/lib/eolian_cxx/grammar/attribute_conditional.hpp60
-rw-r--r--src/lib/eolian_cxx/grammar/attribute_reorder.hpp5
-rw-r--r--src/lib/eolian_cxx/grammar/attributed.hpp66
-rw-r--r--src/lib/eolian_cxx/grammar/attributes.hpp27
-rw-r--r--src/lib/eolian_cxx/grammar/class_definition.hpp5
-rw-r--r--src/lib/eolian_cxx/grammar/function_definition.hpp30
-rw-r--r--src/lib/eolian_cxx/grammar/klass_def.hpp25
-rw-r--r--src/lib/eolian_cxx/grammar/parameter.hpp2
-rw-r--r--src/lib/eolian_cxx/grammar/sequence.hpp9
-rw-r--r--src/lib/eolian_cxx/grammar/type_traits.hpp3
20 files changed, 11969 insertions, 227 deletions
diff --git a/src/Makefile_Efl_Js.am b/src/Makefile_Efl_Js.am
index e253fa70e4..81b4dab9eb 100644
--- a/src/Makefile_Efl_Js.am
+++ b/src/Makefile_Efl_Js.am
@@ -56,14 +56,26 @@ bin_efl_js_eflv8js_LDADD = \
56 56
57endif 57endif
58 58
59ordered_generated_js_bindings = $(sort $(GENERATED_JS_BINDINGS))
60
61AM_V_EOLJS_LINK = $(am__v_EOLJS_LINK_@AM_V@) 59AM_V_EOLJS_LINK = $(am__v_EOLJS_LINK_@AM_V@)
62am__v_EOLJS_LINK_ = $(am__v_EOLJS_LINK_@AM_DEFAULT_V@) 60am__v_EOLJS_LINK_ = $(am__v_EOLJS_LINK_@AM_DEFAULT_V@)
63am__v_EOLJS__LINK_0 = @echo " EOLJS_LINK " $@; 61am__v_EOLJS__LINK_0 = @echo " EOLJS_LINK " $@;
64 62
65bindings/js/efl_js/eolian_js_bindings.js.hh: $(GENERATED_JS_BINDINGS:%.eo.js.cc=%.eo) $(_EOLIAN_JS_DEP) 63$(elm_legacy_eolian_files:%.eo=%.eo.js.cc): %.eo.js.cc : %.eo $(_EOLIAN_JS_DEP)
66 $(AM_V_EOLJS_LINK)$(EOLIAN_JS) -l $(EOLIAN_FLAGS) -o $@ $(filter %.eo, $(^)) 64 $(AM_V_EOLJS)$(EOLIAN_JS) $(EOLIAN_FLAGS) -d -o $@ $<
65
66bindings/js/efl_js/eolian_include_generated.js.hh: $(GENERATED_JS_BINDINGS) $(elm_legacy_eolian_files:%.eo=%.eo.js.cc)
67 @echo @ECHO_E@ "" > $@
68 @for i in $(^); do echo "#include <$$i>" >> $@; done
69
70CLEANFILES += bindings/js/efl_js/eolian_js_bindings.js.hh
71
72bindings/js/efl_js/eolian_js_bindings.js.hh bindings/js/efl_js/eolian_js_bindings.js.hh.params: $(GENERATED_JS_BINDINGS:%.eo.js.cc=%.eo) $(_EOLIAN_JS_DEP)
73 echo > $@.params
74 for i in $(addprefix -l ,$(addprefix $(srcdir)/,$(elm_legacy_eolian_files))); do echo "$$i" >> $@.params; done
75 echo -o >> $@.params
76 echo $@ >> $@.params
77 for i in $(filter %.eo, $(^)); do echo "$$i" >> $@.params;done
78 $(AM_V_EOLJS_LINK)$(EOLIAN_JS) --link --params $@.params $(EOLIAN_FLAGS)
67 79
68CLEANFILES += bindings/js/efl_js/eolian_js_bindings.js.hh 80CLEANFILES += bindings/js/efl_js/eolian_js_bindings.js.hh
69 81
@@ -147,7 +159,7 @@ bindings/js/eio_js/eio_js.cc \
147bindings/js/efl_js/efl_js.cc \ 159bindings/js/efl_js/efl_js.cc \
148bindings/js/ethumb_js/ethumb_js_client.cc 160bindings/js/ethumb_js/ethumb_js_client.cc
149 161
150bindings/js/efl_js/bindings_js_efl_js_libefl_js_la-efl_js.l$(OBJEXT): bindings/js/efl_js/eolian_js_bindings.js.hh 162bindings/js/efl_js/bindings_js_efl_js_libefl_js_la-efl_js.l$(OBJEXT): bindings/js/efl_js/eolian_js_bindings.js.hh bindings/js/efl_js/eolian_include_generated.js.hh
151 163
152bindings/js/efl_js/efl_js.cc $(bindings_js_efl_js_libefl_js_la_SOURCES): $(ecore_eolian_cxx_public_hh) $(ecore_eolian_cxx_public_impl_hh) $(eo_eolian_cxx_public_hh) $(eo_eolian_cxx_public_impl_hh) $(efl_eolian_cxx_public_hh) $(efl_eolian_cxx_public_impl_hh) lib/ecore/Ecore.eo.hh 164bindings/js/efl_js/efl_js.cc $(bindings_js_efl_js_libefl_js_la_SOURCES): $(ecore_eolian_cxx_public_hh) $(ecore_eolian_cxx_public_impl_hh) $(eo_eolian_cxx_public_hh) $(eo_eolian_cxx_public_impl_hh) $(efl_eolian_cxx_public_hh) $(efl_eolian_cxx_public_impl_hh) lib/ecore/Ecore.eo.hh
153 165
diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am
index 5b292a5445..3c521a7ff7 100644
--- a/src/Makefile_Elementary.am
+++ b/src/Makefile_Elementary.am
@@ -97,6 +97,7 @@ elm_public_eolian_files = \
97 lib/elementary/efl_access_window.eo \ 97 lib/elementary/efl_access_window.eo \
98 lib/elementary/efl_config_global.eo \ 98 lib/elementary/efl_config_global.eo \
99 lib/elementary/elm_code_widget.eo \ 99 lib/elementary/elm_code_widget.eo \
100 lib/elementary/efl_ui_list_precise_layouter.eo \
100 $(NULL) 101 $(NULL)
101 102
102# More public files -- FIXME 103# More public files -- FIXME
@@ -220,7 +221,6 @@ elm_legacy_eolian_files = \
220 lib/elementary/elm_slideshow_item.eo \ 221 lib/elementary/elm_slideshow_item.eo \
221 lib/elementary/elm_table.eo \ 222 lib/elementary/elm_table.eo \
222 lib/elementary/elm_thumb.eo \ 223 lib/elementary/elm_thumb.eo \
223 lib/elementary/efl_ui_list_precise_layouter.eo \
224 $(NULL) 224 $(NULL)
225 225
226elm_eolian_type_files = \ 226elm_eolian_type_files = \
diff --git a/src/bin/eolian_js/eolian/grammar/class_registration.hpp b/src/bin/eolian_js/eolian/grammar/class_registration.hpp
index 11ab61f4bf..d6e5cac4b4 100644
--- a/src/bin/eolian_js/eolian/grammar/class_registration.hpp
+++ b/src/bin/eolian_js/eolian/grammar/class_registration.hpp
@@ -4,6 +4,10 @@
4#include <grammar/klass_def.hpp> 4#include <grammar/klass_def.hpp>
5#include <grammar/indentation.hpp> 5#include <grammar/indentation.hpp>
6#include <grammar/string.hpp> 6#include <grammar/string.hpp>
7#include <grammar/attribute_reorder.hpp>
8#include <grammar/attributed.hpp>
9#include <grammar/attribute_replace.hpp>
10#include <eolian/grammar/stub_function_definition.hpp>
7 11
8namespace eolian { namespace js { namespace grammar { 12namespace eolian { namespace js { namespace grammar {
9 13
@@ -38,25 +42,91 @@ struct class_registration_generator
38 42
39 as_generator 43 as_generator
40 ( 44 (
41 "namespace efl { namespace js { namespace binding { namespace {\nstatic void register_" 45 *stub_function_definition(cls)
46 ).generate(sink, cls.functions, context);
47
48 as_generator
49 (
50 attribute_reorder<0, 1, 2, 3, 0, 1, 0, 1>
51 (
52 "static void register_prototype_"
53 << lower_case[*(string << "_")]
54 << lower_case[string]
55 << "(v8::Handle<v8::Object> global, v8::Local<v8::ObjectTemplate> prototype, v8::Isolate* isolate)\n"
56 << "{\n"
57 << *attribute_reorder<1, 1, 1, 1>
58 (
59 scope_tab << "prototype->Set( ::efl::eina::js::compatibility_new<v8::String>(isolate, \""
60 << attribute_replace(&eolian::js::format::format_method)[string] << "\")\n"
61 << scope_tab(2) << ", ::efl::eina::js::compatibility_new<v8::FunctionTemplate>(isolate\n"
62 << scope_tab(3) << ", & ::efl::js::binding::stub_function_"
63 << attributed(std::make_tuple(cls.namespaces, cls.cxx_name))
64 [
65 lower_case[*(string << "_")]
66 << lower_case[string] << "_"
67 ]
68 << lower_case[string]
69 << "));\n"
70 )
71 <<
72 *(
73 scope_tab << "register_prototype_"
74 << lower_case[*(string << "_")]
75 << lower_case[string]
76 << "(global, prototype, isolate);\n"
77 )
78 << "}\nvoid register_constructor_"
79 << lower_case[*(string << "_")]
80 << lower_case[string]
81 << "(v8::Handle<v8::Object> global, v8::Local<v8::FunctionTemplate> constructor, v8::Isolate* isolate)\n"
82 << "{\n"
83 << scope_tab << "v8::Local<v8::ObjectTemplate> instance = constructor->InstanceTemplate();\n"
84 << scope_tab << "instance->SetInternalFieldCount(1);\n"
85 << scope_tab << "v8::Local<v8::ObjectTemplate> prototype = constructor->PrototypeTemplate();\n"
86 << scope_tab << "register_prototype_"
87 << lower_case[*(string << "_")]
88 << lower_case[string]
89 << "(global, prototype, isolate);\n"
90 << "}\n"
91 )).generate(sink, std::make_tuple(cls.namespaces, cls.cxx_name, cls.functions, cls.immediate_inherits), context);
92
93 as_generator
94 (
95 attribute_reorder<0, 1, 0, 1, 0, 1, 0, 1>
96 (
97 "v8::Local<v8::Function> register_"
42 << lower_case[*(string << "_")] 98 << lower_case[*(string << "_")]
43 << lower_case[string] 99 << lower_case[string]
44 << "(v8::Handle<v8::Object> global, v8::Isolate* isolate)\n" 100 << "(v8::Handle<v8::Object> global, v8::Isolate* isolate)\n"
45 << "{\n" 101 << "{\n"
46 << scope_tab << "v8::Handle<v8::FunctionTemplate> constructor = ::efl::eina::js::compatibility_new<v8::FunctionTemplate>\n" 102 << scope_tab << "v8::Handle<v8::FunctionTemplate> constructor = ::efl::eina::js::compatibility_new<v8::FunctionTemplate>\n"
47 << scope_tab << scope_tab << "(isolate, & ::efl::eo::js::constructor, ::efl::eina::js::compatibility_new<v8::External>(isolate, const_cast<Efl_Class*>("<< class_name << ")));\n" 103 << scope_tab(2) << "(isolate, & ::efl::eo::js::constructor, ::efl::eina::js::compatibility_new<v8::External>(isolate, const_cast<Efl_Class*>("<< class_name << ")));\n"
104 << scope_tab << "register_constructor_"
105 << lower_case[*(string << "_")]
106 << lower_case[string]
107 << "(global, constructor, isolate);\n"
48 << scope_tab << "(void)" << class_name << ";\n" 108 << scope_tab << "(void)" << class_name << ";\n"
49 << scope_tab << "(void)global; (void)isolate; (void)constructor;\n" 109 << scope_tab << "(void)global; (void)isolate; (void)constructor;\n"
110 << scope_tab << "return constructor->GetFunction();\n"
50 << "}\n" 111 << "}\n"
51 << "} } } } // namespace efl { namespace js { namespace binding { namespace {\n\n" 112 << "struct register_"
52 ).generate(sink, std::make_tuple(cls.namespaces, cls.cxx_name), context); 113 << lower_case[*(string << "_")]
114 << lower_case[string]
115 << "_functor\n{\n"
116 << scope_tab << "v8::Local<v8::Function> operator()(v8::Handle<v8::Object> global, v8::Isolate* isolate)\n"
117 << scope_tab << "{\n" << scope_tab(2) << "return ::efl::js::binding::register_"
118 << lower_case[*(string << "_")]
119 << lower_case[string]
120 << "(global, isolate);\n"
121 << scope_tab << "}\n"
122 << "};\n"
123 )).generate(sink, std::make_tuple(cls.namespaces, cls.cxx_name), context);
53 124
54 // constructors ? 125 // constructors ?
55 126
56 // v8::Handle<v8::FunctionTemplate> constructor = ::efl::eina::js::compatibility_new<v8::FunctionTemplate> 127 // v8::Handle<v8::FunctionTemplate> constructor = ::efl::eina::js::compatibility_new<v8::FunctionTemplate>
57 // (isolate, &efl::eo::js::constructor, efl::eina::js::compatibility_new<v8::External>(isolate, const_cast<Efl_Class*>(EFL_UI_WIN_CLASS))); 128 // (isolate, &efl::eo::js::constructor, efl::eina::js::compatibility_new<v8::External>(isolate, const_cast<Efl_Class*>(EFL_UI_WIN_CLASS)));
58 129
59
60 // methods 130 // methods
61 131
62 // events 132 // events
diff --git a/src/bin/eolian_js/eolian/grammar/stub_function_definition.hpp b/src/bin/eolian_js/eolian/grammar/stub_function_definition.hpp
new file mode 100644
index 0000000000..d5d7169431
--- /dev/null
+++ b/src/bin/eolian_js/eolian/grammar/stub_function_definition.hpp
@@ -0,0 +1,110 @@
1#ifndef EOLIAN_JS_STUB_FUNCTION_DEFINITION_HPP
2#define EOLIAN_JS_STUB_FUNCTION_DEFINITION_HPP
3
4#include <grammar/klass_def.hpp>
5#include <grammar/indentation.hpp>
6#include <grammar/string.hpp>
7#include <grammar/attribute_reorder.hpp>
8
9namespace eolian { namespace js { namespace grammar {
10
11namespace attributes = efl::eolian::grammar::attributes;
12
13struct stub_function_definition_generator
14{
15 stub_function_definition_generator(attributes::klass_def klass)
16 : klass(klass) {}
17
18 template <typename OutputIterator, typename Context>
19 bool generate(OutputIterator sink, attributes::function_def const& f, Context const& context) const
20 {
21 using namespace efl::eolian::grammar;
22 using efl::eolian::grammar::attributes::unused;
23
24 // std::string suffix;
25 // switch(cls.type)
26 // {
27 // case attributes::class_type::regular:
28 // case attributes::class_type::abstract_:
29 // suffix = "CLASS";
30 // break;
31 // case attributes::class_type::mixin:
32 // suffix = "MIXIN";
33 // break;
34 // case attributes::class_type::interface_:
35 // suffix = "INTERFACE";
36 // break;
37 // }
38
39 std::size_t ins = 0;
40 for(auto&& parameters : f.parameters)
41 {
42 if(parameters.direction == attributes::parameter_direction::in)
43 ++ins;
44 }
45
46 as_generator
47 (
48 //attribute_reorder<0, 1, 0, 1, 0, 1>
49 (
50 "eina::js::compatibility_return_type stub_function_"
51 << lower_case[*(string << "_")]
52 << lower_case[string]
53 << "_"
54 << lower_case[string]
55 << "(eina::js::compatibility_callback_info_type args)\n"
56 << "{\n"
57 << scope_tab << "if(/*input_parameters*/" << std::to_string(ins) << " != args.Length())\n"
58 << scope_tab << "{\n"
59 << scope_tab(2) << "v8::Local<v8::Object> self = args.This();\n"
60 << scope_tab(2) << "v8::Local<v8::Value> external = self->GetInternalField(0);\n"
61 << scope_tab(2) << "Eo* eo = static_cast<Eo*>(v8::External::Cast(*external)->Value());\n"
62 << scope_tab(2) << "try\n"
63 << scope_tab(2) << "{\n"
64 << scope_tab(3) << ";"
65 << scope_tab(2) << "}\n"
66 << scope_tab(2) << "catch(std::logic_error const&)\n"
67 << scope_tab(2) << "{\n"
68 << scope_tab(3) << "return eina::js::compatibility_return();\n"
69 << scope_tab(2) << "}\n"
70 << scope_tab << "}\n"
71 << scope_tab << "else\n"
72 << scope_tab << "{\n"
73 << scope_tab(2) << "return eina::js::compatibility_throw\n"
74 << scope_tab(3) << "(v8::Exception::TypeError\n"
75 << scope_tab(4) << "(eina::js::compatibility_new<v8::String>(nullptr, \"Expected more arguments for this call\")));\n"
76 << scope_tab << "}\n"
77 << "}\n"
78 )).generate(sink, std::make_tuple(klass.namespaces, klass.cxx_name, f.name), context);
79
80 // methods
81
82 // events
83
84 return true;
85 }
86
87 attributes::klass_def klass;
88};
89
90
91struct stub_function_definition_generator_
92{
93 stub_function_definition_generator operator()(attributes::klass_def const& klass) const
94 {
95 return {klass};
96 }
97} const stub_function_definition = {};
98
99} } }
100
101namespace efl { namespace eolian { namespace grammar {
102
103template <>
104struct is_generator< ::eolian::js::grammar::stub_function_definition_generator> : std::true_type {};
105template <>
106struct is_eager_generator< ::eolian::js::grammar::stub_function_definition_generator> : std::true_type {};
107
108} } }
109
110#endif
diff --git a/src/bin/eolian_js/main.cc b/src/bin/eolian_js/main.cc
index a68e7cbb16..6d755da249 100644
--- a/src/bin/eolian_js/main.cc
+++ b/src/bin/eolian_js/main.cc
@@ -438,9 +438,11 @@ int main(int argc, char** argv)
438 namespace format = eolian::js::format; 438 namespace format = eolian::js::format;
439 439
440 std::vector<std::string> include_paths; 440 std::vector<std::string> include_paths;
441 std::string out_file, in_file; 441 std::string out_file, in_file, params_file;
442 std::vector<std::string> in_files; 442 std::vector<std::string> in_files;
443 bool linking = false; 443 bool linking = false;
444 std::set<Eolian_Class const*> legacy_klasses;
445 bool dummy_generation = false;
444 446
445 efl::eina::eina_init eina_init; 447 efl::eina::eina_init eina_init;
446 struct eolian_init 448 struct eolian_init
@@ -453,49 +455,197 @@ int main(int argc, char** argv)
453 { 455 {
454 { "in", required_argument, 0, 'I' }, 456 { "in", required_argument, 0, 'I' },
455 { "out-file", required_argument, 0, 'o' }, 457 { "out-file", required_argument, 0, 'o' },
458 { "legacy", required_argument, 0, 'l' },
456 { "version", no_argument, 0, 'v' }, 459 { "version", no_argument, 0, 'v' },
457 { "help", no_argument, 0, 'h' }, 460 { "help", no_argument, 0, 'h' },
458 { "link", no_argument, 0, 'l' }, 461 { "link", no_argument, 0, 'i' },
462 { "params", required_argument, 0, 'p' },
463 { "dummy", no_argument, 0, 'd' },
459 { 0, 0, 0, 0 } 464 { 0, 0, 0, 0 }
460 }; 465 };
461 const char* options = "I:D:o:c:arvhl"; 466 const char* options = "I:o:l:p:vhid";
462 467
463 // get command line options 468 Eolian* eolian = eolian_new();
464 int c, idx; 469 Eolian_Unit* eolian_unit = static_cast<Eolian_Unit*>(static_cast<void*>(eolian));
465 while ( (c = getopt_long(argc, argv, options, long_options, &idx)) != -1) 470
471 auto cmd_options = [&] (char c)
466 { 472 {
467 if (c == 'I') 473 if (c == 'I')
468 { 474 {
469 include_paths.push_back(optarg); 475 if (!::eolian_directory_scan(eolian, optarg))
470 std::cout << "-I" << optarg << std::endl; 476 {
477 EINA_CXX_DOM_LOG_WARN(eolian::js::domain)
478 << "Couldn't load eolian from '" << optarg << "'.";
479 }
471 } 480 }
472 else if (c == 'o') 481 else if (c == 'o')
473 { 482 {
474 if(!out_file.empty()) 483 if(!out_file.empty())
475 { 484 {
476 // _usage(argv[0]); 485 // _usage(argv[0]);
477 return 1; 486 exit(1);
478 } 487 }
488 std::cout << "out file " << optarg << std::endl;
479 out_file = optarg; 489 out_file = optarg;
480 } 490 }
481 else if (c == 'h') 491 else if (c == 'h')
482 { 492 {
483 // _usage(argv[0]); 493 // _usage(argv[0]);
484 return 1; 494 exit(1);
485 } 495 }
486 else if (c == 'v') 496 else if (c == 'v')
487 { 497 {
488 // _print_version(); 498 // _print_version();
489 // if (argc == 2) exit(EXIT_SUCCESS); 499 // if (argc == 2) exit(EXIT_SUCCESS);
490 } 500 }
491 else if(c == 'l') 501 else if(c == 'i')
492 { 502 {
493 linking = true; 503 linking = true;
494 } 504 }
505 else if(c == 'l')
506 {
507 // legacy file
508 // std::cout << "legacy file|" << optarg << '|' << std::endl;
509 // if (!::eolian_file_parse(eolian, optarg))
510 // {
511 // std::cout
512 // << "Failed parsing: " << optarg << "." << std::endl;
513 // EINA_CXX_DOM_LOG_WARN(eolian::js::domain)
514 // << "Failed parsing: " << optarg << ".";
515 // assert(false && "Error parsing input file");
516 // }
517 // char* dup = strdup(optarg);
518 // char *bn = basename(dup);
519
520 // Eolian_Class const* klass = ::eolian_class_get_by_file(eolian_unit, bn);
521
522 // free(dup);
523
524 // std::cout << " class pointer " << klass << std::endl;
525 // assert(!!klass);
526 // legacy_klasses.insert(klass);
527 }
528 else if(c == 'p')
529 {
530 params_file = optarg;
531 }
532 else if(c == 'd')
533 {
534 dummy_generation = true;
535 }
536 };
537
538 // get command line options
539 int c, idx = 0;
540 while ( (c = getopt_long(argc, argv, options, long_options, &idx)) != -1)
541 {
542 std::cout << "reading, idx " << idx << " optind " << optind << std::endl;
543 std::cout << "char " << (char)c << std::endl;
544 cmd_options(c);
495 } 545 }
496 546
497 std::cout << "optind " << optind << " argc " << argc << std::endl; 547 if(!linking)
548 {
549 if (optind == argc-1)
550 {
551 in_file = argv[optind];
552 }
553 }
554 else
555 {
556 if (!::eolian_all_eot_files_parse(eolian))
557 {
558 EINA_CXX_DOM_LOG_WARN(eolian::js::domain)
559 << "Eolian failed parsing eot files";
560 assert(false && "Error parsing eot files");
561 }
562 int optional_index = optind;
563 while (optional_index != argc)
564 {
565 std::cout << "opening " << argv[optional_index] << std::endl;
566 if (!::eolian_file_parse(eolian, argv[optional_index]))
567 {
568 std::cout
569 << "Failed parsing: " << argv[optional_index] << "." << std::endl;
570 EINA_CXX_DOM_LOG_WARN(eolian::js::domain)
571 << "Failed parsing: " << argv[optional_index] << ".";
572 assert(false && "Error parsing input file");
573 }
574 in_files.push_back(argv[optind]);
575 optional_index++;
576 }
577 }
578
579 if(!params_file.empty())
580 {
581 std::ifstream param_stream(params_file.c_str());
582 if(param_stream.is_open())
583 {
584 std::vector<std::string> lines{argv[0]};
585 std::string line;
586 while(std::getline(param_stream, line))
587 {
588 std::cout << "line read " << line << std::endl;
589 if(!line.empty())
590 lines.push_back(line);
591 }
592
593 std::vector<const char*> more_args(lines.size());
594 std::size_t i = 0;
595 for(auto&& l : lines)
596 {
597 more_args[i] = l.c_str();
598 ++i;
599 }
600 optind = 1;
601 idx = 0;
602 while ( (c = getopt_long(lines.size(), const_cast<char*const*>(&more_args[0]), options, long_options, &idx)) != -1)
603 {
604 std::cout << "reading, idx " << idx << " optind " << optind << std::endl;
605 std::cout << "char " << (char)c << std::endl;
606 cmd_options(c);
607 }
608 std::cout << "while finished idx " << idx << " optind " << optind << std::endl;
609
610 if(!linking)
611 {
612 if (optind == more_args.size()-1)
613 {
614 in_file = lines[optind];
615 }
616 }
617 else
618 {
619 if (!::eolian_all_eot_files_parse(eolian))
620 {
621 EINA_CXX_DOM_LOG_WARN(eolian::js::domain)
622 << "Eolian failed parsing eot files";
623 assert(false && "Error parsing eot files");
624 }
625 int optional_index = optind;
626 std::cout << "optional_index " << optional_index << std::endl;
627 assert(optional_index <= more_args.size());
628 while (optional_index != more_args.size())
629 {
630 std::cout << "opening in params " << lines[optional_index] << std::endl;
631 if (!::eolian_file_parse(eolian, lines[optional_index].c_str()))
632 {
633 std::cout
634 << "Failed parsing: " << lines[optional_index] << "." << std::endl;
635 EINA_CXX_DOM_LOG_WARN(eolian::js::domain)
636 << "Failed parsing: " << lines[optional_index] << ".";
637 assert(false && "Error parsing input file");
638 }
639 in_files.push_back(lines[optional_index]);
640 optional_index++;
641 }
642 }
643
644 }
645 }
498 646
647 std::cout << "going on" << std::endl;
648
499 std::ofstream os (out_file.c_str()); 649 std::ofstream os (out_file.c_str());
500 if(!os.is_open()) 650 if(!os.is_open())
501 { 651 {
@@ -507,27 +657,7 @@ int main(int argc, char** argv)
507 657
508 if(!linking) 658 if(!linking)
509 { 659 {
510 Eolian* eolian = eolian_new();
511 Eolian_Unit* eolian_unit = static_cast<Eolian_Unit*>(static_cast<void*>(eolian));
512
513 if (optind == argc-1)
514 {
515 in_file = argv[optind];
516 }
517
518 // Add include paths to eolian library 660 // Add include paths to eolian library
519 for(auto src : include_paths)
520 if (!::eolian_directory_scan(eolian, src.c_str()))
521 {
522 EINA_CXX_DOM_LOG_WARN(eolian::js::domain)
523 << "Couldn't load eolian from '" << src << "'.";
524 }
525 if (!::eolian_all_eot_files_parse(eolian))
526 {
527 EINA_CXX_DOM_LOG_WARN(eolian::js::domain)
528 << "Eolian failed parsing eot files";
529 assert(false && "Error parsing eot files");
530 }
531 if (!::eolian_file_parse(eolian, in_file.c_str())) 661 if (!::eolian_file_parse(eolian, in_file.c_str()))
532 { 662 {
533 EINA_CXX_DOM_LOG_WARN(eolian::js::domain) 663 EINA_CXX_DOM_LOG_WARN(eolian::js::domain)
@@ -557,22 +687,18 @@ int main(int argc, char** argv)
557 // probably not eot file 687 // probably not eot file
558 if(klass) 688 if(klass)
559 { 689 {
560 os << "#if !defined(EFL_JAVASCRIPT_EOLIAN_GENERATE_REGISTER_STRUCT)\n"; 690 //os << "#if !defined(EFL_JAVASCRIPT_EOLIAN_GENERATE_REGISTER_STRUCT)\n";
561 // function to iterate through all inheritance class 691 // function to iterate through all inheritance class
562 std::function<void(Eolian_Class const*, std::function<void(Eolian_Class const*)>)> 692 std::function<void(Eolian_Class const*, std::function<void(Eolian_Class const*)>)>
563 recurse_inherits 693 recurse_inherits
564 = [&] (Eolian_Class const* klass, std::function<void(Eolian_Class const*)> function) 694 = [&] (Eolian_Class const* klass, std::function<void(Eolian_Class const*)> function)
565 { 695 {
566 for(efl::eina::iterator<const char> first ( ::eolian_class_inherits_get(klass)) 696 for(efl::eina::iterator<Eolian_Class const> inherit_iterator ( ::eolian_class_inherits_get(klass))
567 , last; first != last; ++first) 697 , inherit_last; inherit_iterator != inherit_last; ++inherit_iterator)
568 { 698 {
569 EINA_CXX_DOM_LOG_WARN(eolian::js::domain) << &*first << std::endl; 699 Eolian_Class const* base = &*inherit_iterator;
570 Eolian_Class const* base = ::eolian_class_get_by_name(eolian_unit, &*first); 700 function(base);
571 if(base) 701 recurse_inherits(base, function);
572 {
573 function(base);
574 recurse_inherits(base, function);
575 }
576 } 702 }
577 }; 703 };
578 704
@@ -591,46 +717,70 @@ int main(int argc, char** argv)
591 using efl::eolian::grammar::attributes::unused; 717 using efl::eolian::grammar::attributes::unused;
592 using efl::eolian::grammar::context_null; 718 using efl::eolian::grammar::context_null;
593 efl::eolian::grammar::attributes::klass_def klass_def(klass, eolian_unit); 719 efl::eolian::grammar::attributes::klass_def klass_def(klass, eolian_unit);
594 if (!eolian::js::grammar::class_registration.generate(iterator, klass_def, context_null{})) 720 using efl::eolian::grammar::lower_case;
721 using efl::eolian::grammar::string;
722 using efl::eolian::grammar::as_generator;
723 if(!dummy_generation)
595 { 724 {
596 throw std::runtime_error("Failed to generate class"); 725 context_null context;
726
727 as_generator("namespace efl { namespace js { namespace binding { namespace {\n")
728 .generate(iterator, unused, context);
729
730 {
731 for(efl::eina::iterator<Eolian_Class const> inherit_iterator ( ::eolian_class_inherits_get(klass))
732 , inherit_last; inherit_iterator != inherit_last; ++inherit_iterator)
733 {
734 efl::eolian::grammar::attributes::klass_def klass_def
735 ( &*inherit_iterator, eolian_unit);
736 as_generator
737 (
738 "static void register_prototype_"
739 << lower_case[*(string << "_")]
740 << lower_case[string]
741 << "(v8::Handle<v8::Object>, v8::Local<v8::ObjectTemplate>, v8::Isolate*);\n"
742 ).generate(iterator, std::make_tuple(klass_def.namespaces, klass_def.cxx_name), context);
743 }
744 }
745
746 if (!eolian::js::grammar::class_registration.generate(iterator, klass_def, context))
747 {
748 throw std::runtime_error("Failed to generate class");
749 }
750
751 as_generator("} } } } // namespace efl { namespace js { namespace binding { namespace {\n\n")
752 .generate(iterator, unused, context);
753 }
754 else
755 {
756 as_generator
757 (
758 "namespace efl { namespace js { namespace binding { namespace {\n"
759 "static void register_prototype_"
760 << lower_case[*(string << "_")]
761 << lower_case[string]
762 << "(v8::Handle<v8::Object>, v8::Local<v8::ObjectTemplate>, v8::Isolate*)\n"
763 "{\n}\n"
764 "} } } }\n\n"
765 ).generate(iterator, std::make_tuple(klass_def.namespaces, klass_def.cxx_name), context_null{});
597 } 766 }
598 767
599 os << "#else\n"; 768 //os << "#else\n";
600 // if (!eolian::js::grammar::call_registration.generate(iterator, klass_def, context_null{})) 769 // if (!eolian::js::grammar::call_registration.generate(iterator, klass_def, context_null{}))
601 // { 770 // {
602 // throw std::runtime_error("Failed to generate class"); 771 // throw std::runtime_error("Failed to generate class");
603 // } 772 // }
604 os << "#endif\n"; 773 //os << "#endif\n";
605 } 774 }
606 } 775 }
607 else 776 else
608 { 777 {
609 Eolian* eolian = eolian_new(); 778 // for(auto src : include_paths)
610 Eolian_Unit* eolian_unit = static_cast<Eolian_Unit*>(static_cast<void*>(eolian)); 779 // if (!::eolian_directory_scan(eolian, src.c_str()))
611 780 // {
612 for(auto src : include_paths) 781 // EINA_CXX_DOM_LOG_WARN(eolian::js::domain)
613 if (!::eolian_directory_scan(eolian, src.c_str())) 782 // << "Couldn't load eolian from '" << src << "'.";
614 { 783 // }
615 EINA_CXX_DOM_LOG_WARN(eolian::js::domain)
616 << "Couldn't load eolian from '" << src << "'.";
617 }
618
619 int optional_index = optind;
620 while (optional_index != argc)
621 {
622 std::cout << "opening " << argv[optional_index] << std::endl;
623 if (!::eolian_file_parse(eolian, argv[optional_index]))
624 {
625 std::cout
626 << "Failed parsing: " << argv[optional_index] << "." << std::endl;
627 EINA_CXX_DOM_LOG_WARN(eolian::js::domain)
628 << "Failed parsing: " << argv[optional_index] << ".";
629 assert(false && "Error parsing input file");
630 }
631 // in_files.push_back(argv[optind]);
632 optional_index++;
633 }
634 784
635 // if(!::eolian_all_eo_files_parse(eolian)) 785 // if(!::eolian_all_eo_files_parse(eolian))
636 // { 786 // {
@@ -638,23 +788,48 @@ int main(int argc, char** argv)
638 // << "Eolian failed parsing eo files"; 788 // << "Eolian failed parsing eo files";
639 // assert(false && "Error parsing eot files"); 789 // assert(false && "Error parsing eot files");
640 // } 790 // }
641 if (!::eolian_all_eot_files_parse(eolian)) 791 // if (!::eolian_all_eot_files_parse(eolian))
642 { 792 // {
643 EINA_CXX_DOM_LOG_WARN(eolian::js::domain) 793 // EINA_CXX_DOM_LOG_WARN(eolian::js::domain)
644 << "Eolian failed parsing eot files"; 794 // << "Eolian failed parsing eot files";
645 assert(false && "Error parsing eot files"); 795 // assert(false && "Error parsing eot files");
646 } 796 // }
647 797
648 // ns -> items 798 // ns -> items
649 std::map<std::string, std::set<std::string>> all_names; 799 std::map<std::string, std::set<std::string>> namespace_map;
800 std::map<std::string, std::set<std::string>> class_map;
650 801
651 efl::eina::iterator<Eolian_Class const> klasses (eolian_all_classes_get(eolian_unit)); 802 auto fix_name = [] (std::string& name)
652 for(;klasses != efl::eina::iterator<Eolian_Class const>{} 803 {
653 ;++klasses) 804 std::transform(name.begin()
805 , name.end()
806 , name.begin()
807 , [] (char c)
808 {
809 c = ::tolower(c);
810 if(c == '.')
811 c = '_';
812 return c;
813 });
814 };
815
816 // efl::eina::iterator<Eolian_Class const> klasses (eolian_all_classes_get(eolian_unit));
817 // for(;klasses != efl::eina::iterator<Eolian_Class const>{}
818 // ;++klasses)
819 for(auto&& file : in_files)
654 { 820 {
821 // if(legacy_klasses.find(&*klasses) != legacy_klasses.end())
822 // continue;
823 char* dup = strdup(file.c_str());
824 char *bn = basename(dup);
825
826 Eolian_Class const* klass = ::eolian_class_get_by_file(eolian_unit, bn);
827
655 std::string outer_namespace; // starts with global 828 std::string outer_namespace; // starts with global
656 std::string name = ::eolian_class_full_name_get(&*klasses); 829 std::string name = ::eolian_class_full_name_get(klass);
657 830
831 std::cout << "not considered legacy " << name << std::endl;
832
658 auto iterator_old = name.begin(); 833 auto iterator_old = name.begin();
659 auto iterator = std::find(iterator_old, name.end(), '.'); 834 auto iterator = std::find(iterator_old, name.end(), '.');
660 while(iterator != name.end()) 835 while(iterator != name.end())
@@ -663,7 +838,8 @@ int main(int argc, char** argv)
663 838
664 // std::cout << "outer namespace " << outer_namespace << " name " << namespace_name << std::endl; 839 // std::cout << "outer namespace " << outer_namespace << " name " << namespace_name << std::endl;
665 840
666 all_names[outer_namespace].insert(namespace_name); 841 // other identifiers are namespaces
842 namespace_map[outer_namespace].insert(namespace_name);
667 iterator_old = std::next(iterator); 843 iterator_old = std::next(iterator);
668 if(outer_namespace.empty()) 844 if(outer_namespace.empty())
669 outer_namespace = namespace_name; 845 outer_namespace = namespace_name;
@@ -675,39 +851,28 @@ int main(int argc, char** argv)
675 // std::cout << "before loop outer namespace " << outer_namespace << " name " << namespace_name << std::endl; 851 // std::cout << "before loop outer namespace " << outer_namespace << " name " << namespace_name << std::endl;
676 iterator = std::find(iterator_old, name.end(), '.'); 852 iterator = std::find(iterator_old, name.end(), '.');
677 } 853 }
678 all_names[outer_namespace].insert({iterator_old, iterator}); 854 // last identifier is the class name
855 std::string class_name {iterator_old, iterator};
856 fix_name(class_name);
857 class_map[outer_namespace].insert(class_name);
858 // outer_namespace is still a namespace
859 namespace_map[outer_namespace]; // namespace
679 } 860 }
680 861
681 // os << "typedef efl::eo::js::namespace_object" 862 // os << "typedef efl::eo::js::namespace_object"
682 for(auto&& item : all_names) 863 for(auto&& item : namespace_map)
683 { 864 {
684 std::vector<std::string> classes; 865 std::set<std::string> classes;
685 866
686 std::cout << "namespace " << item.first << std::endl; 867 auto mirrored_iterator = class_map.find(item.first);
687 868 if(mirrored_iterator != class_map.end())
688 for(auto&& object : item.second) 869 classes = mirrored_iterator->second;
689 {
690 std::string ns = item.first;
691 if(!ns.empty())
692 ns += '.';
693 if(all_names.find(ns + object) == all_names.end()) // class name
694 classes.push_back(object);
695 }
696 870
697 std::cout << "generating classes structs" << std::endl; 871 std::cout << "generating classes structs" << std::endl;
698 //if(!classes.empty()) 872
699 { 873 {
700 std::string classes_struct_name = item.first; 874 std::string classes_struct_name = item.first;
701 std::transform(classes_struct_name.begin() 875 fix_name(classes_struct_name);
702 , classes_struct_name.end()
703 , classes_struct_name.begin()
704 , [] (char c)
705 {
706 c = ::tolower(c);
707 if(c == '.')
708 c = '_';
709 return c;
710 });
711 os << "struct " << classes_struct_name << "_classes\n" 876 os << "struct " << classes_struct_name << "_classes\n"
712 << "{\n" 877 << "{\n"
713 << " typedef efl::eo::js::list\n" 878 << " typedef efl::eo::js::list\n"
@@ -726,7 +891,9 @@ int main(int argc, char** argv)
726 os << ", "; 891 os << ", ";
727 ++char_iterator; 892 ++char_iterator;
728 } 893 }
729 os << ">, std::false_type>"; 894 std::string full_name = (item.first == "" ? "" : item.first + '.') + cls;
895 fix_name(full_name);
896 os << ">, ::efl::js::binding::register_" << full_name << "_functor>";
730 cls_iterator++; 897 cls_iterator++;
731 if(cls_iterator != classes.end()) 898 if(cls_iterator != classes.end())
732 os << ", "; 899 os << ", ";
@@ -737,28 +904,18 @@ int main(int argc, char** argv)
737 } 904 }
738 } 905 }
739 906
740 for(auto item_iterator = all_names.rbegin() 907 for(auto item_iterator = namespace_map.rbegin()
741 , last_item_iterator = all_names.rend() 908 , last_item_iterator = namespace_map.rend()
742 ;item_iterator != last_item_iterator 909 ;item_iterator != last_item_iterator
743 ;++item_iterator) 910 ;++item_iterator)
744 { 911 {
745 auto&& item = *item_iterator; 912 auto&& item = *item_iterator;
746 913
747 std::vector<std::string> namespaces; 914 std::set<std::string> namespaces = item.second;
748 //bool is_there_classes = false; 915 //bool is_there_classes = false;
749 916
750 std::cout << "namespace " << item.first << std::endl; 917 std::cout << "namespace " << item.first << std::endl;
751 918
752 for(auto&& object : item.second)
753 {
754 std::cout << "searching if " << object << " is a namespace" << std::endl;
755 std::string ns = item.first;
756 if(!ns.empty())
757 ns += '.';
758 if(all_names.find(ns + object) != all_names.end()) // namespace name
759 namespaces.push_back(object);
760 }
761
762 //if(!namespaces.empty()) 919 //if(!namespaces.empty())
763 { 920 {
764 std::string classes_struct_name = item.first; 921 std::string classes_struct_name = item.first;
diff --git a/src/bindings/cxx/eina_cxx/eina_tpl_char_switch.hh b/src/bindings/cxx/eina_cxx/eina_tpl_char_switch.hh
index cc76bc5f04..98546e02c2 100644
--- a/src/bindings/cxx/eina_cxx/eina_tpl_char_switch.hh
+++ b/src/bindings/cxx/eina_cxx/eina_tpl_char_switch.hh
@@ -999,6 +999,11174 @@ struct tpl_char_switch<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C1
999 } 999 }
1000}; 1000};
1001 1001
1002template <char C0, char C1, char C2, char C3, char C4, char C5, char C6, char C7, char C8, char C9, char C10, char C11, char C12, char C13, char C14, char C15, char C16, char C17, char C18, char C19, char C20, char C21>
1003struct tpl_char_switch<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21>
1004{
1005 template <typename F, typename Fail, typename...Args>
1006 constexpr void operator()(char c, Fail const fail, Args&&...args) const
1007 {
1008 switch(c)
1009 {
1010 case C0:
1011 typename F::template apply<C0>::type{}(args...);
1012 break;
1013 case C1:
1014 typename F::template apply<C1>::type{}(args...);
1015 break;
1016 case C2:
1017 typename F::template apply<C2>::type{}(args...);
1018 break;
1019 case C3:
1020 typename F::template apply<C3>::type{}(args...);
1021 break;
1022 case C4:
1023 typename F::template apply<C4>::type{}(args...);
1024 break;
1025 case C5:
1026 typename F::template apply<C5>::type{}(args...);
1027 break;
1028 case C6:
1029 typename F::template apply<C6>::type{}(args...);
1030 break;
1031 case C7:
1032 typename F::template apply<C7>::type{}(args...);
1033 break;
1034 case C8:
1035 typename F::template apply<C8>::type{}(args...);
1036 break;
1037 case C9:
1038 typename F::template apply<C9>::type{}(args...);
1039 break;
1040 case C10:
1041 typename F::template apply<C10>::type{}(args...);
1042 break;
1043 case C11:
1044 typename F::template apply<C11>::type{}(args...);
1045 break;
1046 case C12:
1047 typename F::template apply<C12>::type{}(args...);
1048 break;
1049 case C13:
1050 typename F::template apply<C13>::type{}(args...);
1051 break;
1052 case C14:
1053 typename F::template apply<C14>::type{}(args...);
1054 break;
1055 case C15:
1056 typename F::template apply<C15>::type{}(args...);
1057 break;
1058 case C16:
1059 typename F::template apply<C16>::type{}(args...);
1060 break;
1061 case C17:
1062 typename F::template apply<C17>::type{}(args...);
1063 break;
1064 case C18:
1065 typename F::template apply<C18>::type{}(args...);
1066 break;
1067 case C19:
1068 typename F::template apply<C19>::type{}(args...);
1069 break;
1070 case C20:
1071 typename F::template apply<C20>::type{}(args...);
1072 break;
1073 case C21:
1074 typename F::template apply<C21>::type{}(args...);
1075 break;
1076 default:
1077 fail(c);
1078 };
1079 }
1080};
1081
1082template <char C0, char C1, char C2, char C3, char C4, char C5, char C6, char C7, char C8, char C9, char C10, char C11, char C12, char C13, char C14, char C15, char C16, char C17, char C18, char C19, char C20, char C21, char C22>
1083struct tpl_char_switch<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22>
1084{
1085 template <typename F, typename Fail, typename...Args>
1086 constexpr void operator()(char c, Fail const fail, Args&&...args) const
1087 {
1088 switch(c)
1089 {
1090 case C0:
1091 typename F::template apply<C0>::type{}(args...);
1092 break;
1093 case C1:
1094 typename F::template apply<C1>::type{}(args...);
1095 break;
1096 case C2:
1097 typename F::template apply<C2>::type{}(args...);
1098 break;
1099 case C3:
1100 typename F::template apply<C3>::type{}(args...);
1101 break;
1102 case C4:
1103 typename F::template apply<C4>::type{}(args...);
1104 break;
1105 case C5:
1106 typename F::template apply<C5>::type{}(args...);
1107 break;
1108 case C6:
1109 typename F::template apply<C6>::type{}(args...);
1110 break;
1111 case C7:
1112 typename F::template apply<C7>::type{}(args...);
1113 break;
1114 case C8:
1115 typename F::template apply<C8>::type{}(args...);
1116 break;
1117 case C9:
1118 typename F::template apply<C9>::type{}(args...);
1119 break;
1120 case C10:
1121 typename F::template apply<C10>::type{}(args...);
1122 break;
1123 case C11:
1124 typename F::template apply<C11>::type{}(args...);
1125 break;
1126 case C12:
1127 typename F::template apply<C12>::type{}(args...);
1128 break;
1129 case C13:
1130 typename F::template apply<C13>::type{}(args...);
1131 break;
1132 case C14:
1133 typename F::template apply<C14>::type{}(args...);
1134 break;
1135 case C15:
1136 typename F::template apply<C15>::type{}(args...);
1137 break;
1138 case C16:
1139 typename F::template apply<C16>::type{}(args...);
1140 break;
1141 case C17:
1142 typename F::template apply<C17>::type{}(args...);
1143 break;
1144 case C18:
1145 typename F::template apply<C18>::type{}(args...);
1146 break;
1147 case C19:
1148 typename F::template apply<C19>::type{}(args...);
1149 break;
1150 case C20:
1151 typename F::template apply<C20>::type{}(args...);
1152 break;
1153 case C21:
1154 typename F::template apply<C21>::type{}(args...);
1155 break;
1156 case C22:
1157 typename F::template apply<C22>::type{}(args...);
1158 break;
1159 default:
1160 fail(c);
1161 };
1162 }
1163};
1164
1165template <char C0, char C1, char C2, char C3, char C4, char C5, char C6, char C7, char C8, char C9, char C10, char C11, char C12, char C13, char C14, char C15, char C16, char C17, char C18, char C19, char C20, char C21, char C22, char C23>
1166struct tpl_char_switch<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23>
1167{
1168 template <typename F, typename Fail, typename...Args>
1169 constexpr void operator()(char c, Fail const fail, Args&&...args) const
1170 {
1171 switch(c)
1172 {
1173 case C0:
1174 typename F::template apply<C0>::type{}(args...);
1175 break;
1176 case C1:
1177 typename F::template apply<C1>::type{}(args...);
1178 break;
1179 case C2:
1180 typename F::template apply<C2>::type{}(args...);
1181 break;
1182 case C3:
1183 typename F::template apply<C3>::type{}(args...);
1184 break;
1185 case C4:
1186 typename F::template apply<C4>::type{}(args...);
1187 break;
1188 case C5:
1189 typename F::template apply<C5>::type{}(args...);
1190 break;
1191 case C6:
1192 typename F::template apply<C6>::type{}(args...);
1193 break;
1194 case C7:
1195 typename F::template apply<C7>::type{}(args...);
1196 break;
1197 case C8:
1198 typename F::template apply<C8>::type{}(args...);
1199 break;
1200 case C9:
1201 typename F::template apply<C9>::type{}(args...);
1202 break;
1203 case C10:
1204 typename F::template apply<C10>::type{}(args...);
1205 break;
1206 case C11:
1207 typename F::template apply<C11>::type{}(args...);
1208 break;
1209 case C12:
1210 typename F::template apply<C12>::type{}(args...);
1211 break;
1212 case C13:
1213 typename F::template apply<C13>::type{}(args...);
1214 break;
1215 case C14:
1216 typename F::template apply<C14>::type{}(args...);
1217 break;
1218 case C15:
1219 typename F::template apply<C15>::type{}(args...);
1220 break;
1221 case C16:
1222 typename F::template apply<C16>::type{}(args...);
1223 break;
1224 case C17:
1225 typename F::template apply<C17>::type{}(args...);
1226 break;
1227 case C18:
1228 typename F::template apply<C18>::type{}(args...);
1229 break;
1230 case C19:
1231 typename F::template apply<C19>::type{}(args...);
1232 break;
1233 case C20:
1234 typename F::template apply<C20>::type{}(args...);
1235 break;
1236 case C21:
1237 typename F::template apply<C21>::type{}(args...);
1238 break;
1239 case C22:
1240 typename F::template apply<C22>::type{}(args...);
1241 break;
1242 case C23:
1243 typename F::template apply<C23>::type{}(args...);
1244 break;
1245 default:
1246 fail(c);
1247 };
1248 }
1249};
1250
1251template <char C0, char C1, char C2, char C3, char C4, char C5, char C6, char C7, char C8, char C9, char C10, char C11, char C12, char C13, char C14, char C15, char C16, char C17, char C18, char C19, char C20, char C21, char C22, char C23, char C24>
1252struct tpl_char_switch<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24>
1253{
1254 template <typename F, typename Fail, typename...Args>
1255 constexpr void operator()(char c, Fail const fail, Args&&...args) const
1256 {
1257 switch(c)
1258 {
1259 case C0:
1260 typename F::template apply<C0>::type{}(args...);
1261 break;
1262 case C1:
1263 typename F::template apply<C1>::type{}(args...);
1264 break;
1265 case C2:
1266 typename F::template apply<C2>::type{}(args...);
1267 break;
1268 case C3:
1269 typename F::template apply<C3>::type{}(args...);
1270 break;
1271 case C4:
1272 typename F::template apply<C4>::type{}(args...);
1273 break;
1274 case C5:
1275 typename F::template apply<C5>::type{}(args...);
1276 break;
1277 case C6:
1278 typename F::template apply<C6>::type{}(args...);
1279 break;
1280 case C7:
1281 typename F::template apply<C7>::type{}(args...);
1282 break;
1283 case C8:
1284 typename F::template apply<C8>::type{}(args...);
1285 break;
1286 case C9:
1287 typename F::template apply<C9>::type{}(args...);
1288 break;
1289 case C10:
1290 typename F::template apply<C10>::type{}(args...);
1291 break;
1292 case C11:
1293 typename F::template apply<C11>::type{}(args...);
1294 break;
1295 case C12:
1296 typename F::template apply<C12>::type{}(args...);
1297 break;
1298 case C13:
1299 typename F::template apply<C13>::type{}(args...);
1300 break;
1301 case C14:
1302 typename F::template apply<C14>::type{}(args...);
1303 break;
1304 case C15:
1305 typename F::template apply<C15>::type{}(args...);
1306 break;
1307 case C16:
1308 typename F::template apply<C16>::type{}(args...);
1309 break;
1310 case C17:
1311 typename F::template apply<C17>::type{}(args...);
1312 break;
1313 case C18:
1314 typename F::template apply<C18>::type{}(args...);
1315 break;
1316 case C19:
1317 typename F::template apply<C19>::type{}(args...);
1318 break;
1319 case C20:
1320 typename F::template apply<C20>::type{}(args...);
1321 break;
1322 case C21:
1323 typename F::template apply<C21>::type{}(args...);
1324 break;
1325 case C22:
1326 typename F::template apply<C22>::type{}(args...);
1327 break;
1328 case C23:
1329 typename F::template apply<C23>::type{}(args...);
1330 break;
1331 case C24:
1332 typename F::template apply<C24>::type{}(args...);
1333 break;
1334 default:
1335 fail(c);
1336 };
1337 }
1338};
1339
1340template <char C0, char C1, char C2, char C3, char C4, char C5, char C6, char C7, char C8, char C9, char C10, char C11, char C12, char C13, char C14, char C15, char C16, char C17, char C18, char C19, char C20, char C21, char C22, char C23, char C24, char C25>
1341struct tpl_char_switch<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25>
1342{
1343 template <typename F, typename Fail, typename...Args>
1344 constexpr void operator()(char c, Fail const fail, Args&&...args) const
1345 {
1346 switch(c)
1347 {
1348 case C0:
1349 typename F::template apply<C0>::type{}(args...);
1350 break;
1351 case C1:
1352 typename F::template apply<C1>::type{}(args...);
1353 break;
1354 case C2:
1355 typename F::template apply<C2>::type{}(args...);
1356 break;
1357 case C3:
1358 typename F::template apply<C3>::type{}(args...);
1359 break;
1360 case C4:
1361 typename F::template apply<C4>::type{}(args...);
1362 break;
1363 case C5:
1364 typename F::template apply<C5>::type{}(args...);
1365 break;
1366 case C6:
1367 typename F::template apply<C6>::type{}(args...);
1368 break;
1369 case C7:
1370 typename F::template apply<C7>::type{}(args...);
1371 break;
1372 case C8:
1373 typename F::template apply<C8>::type{}(args...);
1374 break;
1375 case C9:
1376 typename F::template apply<C9>::type{}(args...);
1377 break;
1378 case C10:
1379 typename F::template apply<C10>::type{}(args...);
1380 break;
1381 case C11:
1382 typename F::template apply<C11>::type{}(args...);
1383 break;
1384 case C12:
1385 typename F::template apply<C12>::type{}(args...);
1386 break;
1387 case C13:
1388 typename F::template apply<C13>::type{}(args...);
1389 break;
1390 case C14:
1391 typename F::template apply<C14>::type{}(args...);
1392 break;
1393 case C15:
1394 typename F::template apply<C15>::type{}(args...);
1395 break;
1396 case C16:
1397 typename F::template apply<C16>::type{}(args...);
1398 break;
1399 case C17:
1400 typename F::template apply<C17>::type{}(args...);
1401 break;
1402 case C18:
1403 typename F::template apply<C18>::type{}(args...);
1404 break;
1405 case C19:
1406 typename F::template apply<C19>::type{}(args...);
1407 break;
1408 case C20:
1409 typename F::template apply<C20>::type{}(args...);
1410 break;
1411 case C21:
1412 typename F::template apply<C21>::type{}(args...);
1413 break;
1414 case C22:
1415 typename F::template apply<C22>::type{}(args...);
1416 break;
1417 case C23:
1418 typename F::template apply<C23>::type{}(args...);
1419 break;
1420 case C24:
1421 typename F::template apply<C24>::type{}(args...);
1422 break;
1423 case C25:
1424 typename F::template apply<C25>::type{}(args...);
1425 break;
1426 default:
1427 fail(c);
1428 };
1429 }
1430};
1431
1432template <char C0, char C1, char C2, char C3, char C4, char C5, char C6, char C7, char C8, char C9, char C10, char C11, char C12, char C13, char C14, char C15, char C16, char C17, char C18, char C19, char C20, char C21, char C22, char C23, char C24, char C25, char C26>
1433struct tpl_char_switch<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25, C26>
1434{
1435 template <typename F, typename Fail, typename...Args>
1436 constexpr void operator()(char c, Fail const fail, Args&&...args) const
1437 {
1438 switch(c)
1439 {
1440 case C0:
1441 typename F::template apply<C0>::type{}(args...);
1442 break;
1443 case C1:
1444 typename F::template apply<C1>::type{}(args...);
1445 break;
1446 case C2:
1447 typename F::template apply<C2>::type{}(args...);
1448 break;
1449 case C3:
1450 typename F::template apply<C3>::type{}(args...);
1451 break;
1452 case C4:
1453 typename F::template apply<C4>::type{}(args...);
1454 break;
1455 case C5:
1456 typename F::template apply<C5>::type{}(args...);
1457 break;
1458 case C6:
1459 typename F::template apply<C6>::type{}(args...);
1460 break;
1461 case C7:
1462 typename F::template apply<C7>::type{}(args...);
1463 break;
1464 case C8:
1465 typename F::template apply<C8>::type{}(args...);
1466 break;
1467 case C9:
1468 typename F::template apply<C9>::type{}(args...);
1469 break;
1470 case C10:
1471 typename F::template apply<C10>::type{}(args...);
1472 break;
1473 case C11:
1474 typename F::template apply<C11>::type{}(args...);
1475 break;
1476 case C12:
1477 typename F::template apply<C12>::type{}(args...);
1478 break;
1479 case C13:
1480 typename F::template apply<C13>::type{}(args...);
1481 break;
1482 case C14:
1483 typename F::template apply<C14>::type{}(args...);
1484 break;
1485 case C15:
1486 typename F::template apply<C15>::type{}(args...);
1487 break;
1488 case C16:
1489 typename F::template apply<C16>::type{}(args...);
1490 break;
1491 case C17:
1492 typename F::template apply<C17>::type{}(args...);
1493 break;
1494 case C18:
1495 typename F::template apply<C18>::type{}(args...);
1496 break;
1497 case C19:
1498 typename F::template apply<C19>::type{}(args...);
1499 break;
1500 case C20:
1501 typename F::template apply<C20>::type{}(args...);
1502 break;
1503 case C21:
1504 typename F::template apply<C21>::type{}(args...);
1505 break;
1506 case C22:
1507 typename F::template apply<C22>::type{}(args...);
1508 break;
1509 case C23:
1510 typename F::template apply<C23>::type{}(args...);
1511 break;
1512 case C24:
1513 typename F::template apply<C24>::type{}(args...);
1514 break;
1515 case C25:
1516 typename F::template apply<C25>::type{}(args...);
1517 break;
1518 case C26:
1519 typename F::template apply<C26>::type{}(args...);
1520 break;
1521 default:
1522 fail(c);
1523 };
1524 }
1525};
1526
1527template <char C0, char C1, char C2, char C3, char C4, char C5, char C6, char C7, char C8, char C9, char C10, char C11, char C12, char C13, char C14, char C15, char C16, char C17, char C18, char C19, char C20, char C21, char C22, char C23, char C24, char C25, char C26, char C27>
1528struct tpl_char_switch<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25, C26, C27>
1529{
1530 template <typename F, typename Fail, typename...Args>
1531 constexpr void operator()(char c, Fail const fail, Args&&...args) const
1532 {
1533 switch(c)
1534 {
1535 case C0:
1536 typename F::template apply<C0>::type{}(args...);
1537 break;
1538 case C1:
1539 typename F::template apply<C1>::type{}(args...);
1540 break;
1541 case C2:
1542 typename F::template apply<C2>::type{}(args...);
1543 break;
1544 case C3:
1545 typename F::template apply<C3>::type{}(args...);
1546 break;
1547 case C4:
1548 typename F::template apply<C4>::type{}(args...);
1549 break;
1550 case C5:
1551 typename F::template apply<C5>::type{}(args...);
1552 break;
1553 case C6:
1554 typename F::template apply<C6>::type{}(args...);
1555 break;
1556 case C7:
1557 typename F::template apply<C7>::type{}(args...);
1558 break;
1559 case C8:
1560 typename F::template apply<C8>::type{}(args...);
1561 break;
1562 case C9:
1563 typename F::template apply<C9>::type{}(args...);
1564 break;
1565 case C10:
1566 typename F::template apply<C10>::type{}(args...);
1567 break;
1568 case C11:
1569 typename F::template apply<C11>::type{}(args...);
1570 break;
1571 case C12:
1572 typename F::template apply<C12>::type{}(args...);
1573 break;
1574 case C13:
1575 typename F::template apply<C13>::type{}(args...);
1576 break;
1577 case C14:
1578 typename F::template apply<C14>::type{}(args...);
1579 break;
1580 case C15:
1581 typename F::template apply<C15>::type{}(args...);
1582 break;
1583 case C16:
1584 typename F::template apply<C16>::type{}(args...);
1585 break;
1586 case C17:
1587 typename F::template apply<C17>::type{}(args...);
1588 break;
1589 case C18:
1590 typename F::template apply<C18>::type{}(args...);
1591 break;
1592 case C19:
1593 typename F::template apply<C19>::type{}(args...);
1594 break;
1595 case C20:
1596 typename F::template apply<C20>::type{}(args...);
1597 break;
1598 case C21:
1599 typename F::template apply<C21>::type{}(args...);
1600 break;
1601 case C22:
1602 typename F::template apply<C22>::type{}(args...);
1603 break;
1604 case C23:
1605 typename F::template apply<C23>::type{}(args...);
1606 break;
1607 case C24:
1608 typename F::template apply<C24>::type{}(args...);
1609 break;
1610 case C25:
1611 typename F::template apply<C25>::type{}(args...);
1612 break;
1613 case C26:
1614 typename F::template apply<C26>::type{}(args...);
1615 break;
1616 case C27:
1617 typename F::template apply<C27>::type{}(args...);
1618 break;
1619 default:
1620 fail(c);
1621 };
1622 }
1623};
1624
1625template <char C0, char C1, char C2, char C3, char C4, char C5, char C6, char C7, char C8, char C9, char C10, char C11, char C12, char C13, char C14, char C15, char C16, char C17, char C18, char C19, char C20, char C21, char C22, char C23, char C24, char C25, char C26, char C27, char C28>
1626struct tpl_char_switch<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25, C26, C27, C28>
1627{
1628 template <typename F, typename Fail, typename...Args>
1629 constexpr void operator()(char c, Fail const fail, Args&&...args) const
1630 {
1631 switch(c)
1632 {
1633 case C0:
1634 typename F::template apply<C0>::type{}(args...);
1635 break;
1636 case C1:
1637 typename F::template apply<C1>::type{}(args...);
1638 break;
1639 case C2:
1640 typename F::template apply<C2>::type{}(args...);
1641 break;
1642 case C3:
1643 typename F::template apply<C3>::type{}(args...);
1644 break;
1645 case C4:
1646 typename F::template apply<C4>::type{}(args...);
1647 break;
1648 case C5:
1649 typename F::template apply<C5>::type{}(args...);
1650 break;
1651 case C6:
1652 typename F::template apply<C6>::type{}(args...);
1653 break;
1654 case C7:
1655 typename F::template apply<C7>::type{}(args...);
1656 break;
1657 case C8:
1658 typename F::template apply<C8>::type{}(args...);
1659 break;
1660 case C9:
1661 typename F::template apply<C9>::type{}(args...);
1662 break;
1663 case C10:
1664 typename F::template apply<C10>::type{}(args...);
1665 break;
1666 case C11:
1667 typename F::template apply<C11>::type{}(args...);
1668 break;
1669 case C12:
1670 typename F::template apply<C12>::type{}(args...);
1671 break;
1672 case C13:
1673 typename F::template apply<C13>::type{}(args...);
1674 break;
1675 case C14:
1676 typename F::template apply<C14>::type{}(args...);
1677 break;
1678 case C15:
1679 typename F::template apply<C15>::type{}(args...);
1680 break;
1681 case C16:
1682 typename F::template apply<C16>::type{}(args...);
1683 break;
1684 case C17:
1685 typename F::template apply<C17>::type{}(args...);
1686 break;
1687 case C18:
1688 typename F::template apply<C18>::type{}(args...);
1689 break;
1690 case C19:
1691 typename F::template apply<C19>::type{}(args...);
1692 break;
1693 case C20:
1694 typename F::template apply<C20>::type{}(args...);
1695 break;
1696 case C21:
1697 typename F::template apply<C21>::type{}(args...);
1698 break;
1699 case C22:
1700 typename F::template apply<C22>::type{}(args...);
1701 break;
1702 case C23:
1703 typename F::template apply<C23>::type{}(args...);
1704 break;
1705 case C24:
1706 typename F::template apply<C24>::type{}(args...);
1707 break;
1708 case C25:
1709 typename F::template apply<C25>::type{}(args...);
1710 break;
1711 case C26:
1712 typename F::template apply<C26>::type{}(args...);
1713 break;
1714 case C27:
1715 typename F::template apply<C27>::type{}(args...);
1716 break;
1717 case C28:
1718 typename F::template apply<C28>::type{}(args...);
1719 break;
1720 default:
1721 fail(c);
1722 };
1723 }
1724};
1725
1726template <char C0, char C1, char C2, char C3, char C4, char C5, char C6, char C7, char C8, char C9, char C10, char C11, char C12, char C13, char C14, char C15, char C16, char C17, char C18, char C19, char C20, char C21, char C22, char C23, char C24, char C25, char C26, char C27, char C28, char C29>
1727struct tpl_char_switch<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25, C26, C27, C28, C29>
1728{
1729 template <typename F, typename Fail, typename...Args>
1730 constexpr void operator()(char c, Fail const fail, Args&&...args) const
1731 {
1732 switch(c)
1733 {
1734 case C0:
1735 typename F::template apply<C0>::type{}(args...);
1736 break;
1737 case C1:
1738 typename F::template apply<C1>::type{}(args...);
1739 break;
1740 case C2:
1741 typename F::template apply<C2>::type{}(args...);
1742 break;
1743 case C3:
1744 typename F::template apply<C3>::type{}(args...);
1745 break;
1746 case C4:
1747 typename F::template apply<C4>::type{}(args...);
1748 break;
1749 case C5:
1750 typename F::template apply<C5>::type{}(args...);
1751 break;
1752 case C6:
1753 typename F::template apply<C6>::type{}(args...);
1754 break;
1755 case C7:
1756 typename F::template apply<C7>::type{}(args...);
1757 break;
1758 case C8:
1759 typename F::template apply<C8>::type{}(args...);
1760 break;
1761 case C9:
1762 typename F::template apply<C9>::type{}(args...);
1763 break;
1764 case C10:
1765 typename F::template apply<C10>::type{}(args...);
1766 break;
1767 case C11:
1768 typename F::template apply<C11>::type{}(args...);
1769 break;
1770 case C12:
1771 typename F::template apply<C12>::type{}(args...);
1772 break;
1773 case C13:
1774 typename F::template apply<C13>::type{}(args...);
1775 break;
1776 case C14:
1777 typename F::template apply<C14>::type{}(args...);
1778 break;
1779 case C15:
1780 typename F::template apply<C15>::type{}(args...);
1781 break;
1782 case C16:
1783 typename F::template apply<C16>::type{}(args...);
1784 break;
1785 case C17:
1786 typename F::template apply<C17>::type{}(args...);
1787 break;
1788 case C18:
1789 typename F::template apply<C18>::type{}(args...);
1790 break;
1791 case C19:
1792 typename F::template apply<C19>::type{}(args...);
1793 break;
1794 case C20:
1795 typename F::template apply<C20>::type{}(args...);
1796 break;
1797 case C21:
1798 typename F::template apply<C21>::type{}(args...);
1799 break;
1800 case C22:
1801 typename F::template apply<C22>::type{}(args...);
1802 break;
1803 case C23:
1804 typename F::template apply<C23>::type{}(args...);
1805 break;
1806 case C24:
1807 typename F::template apply<C24>::type{}(args...);
1808 break;
1809 case C25:
1810 typename F::template apply<C25>::type{}(args...);
1811 break;
1812 case C26:
1813 typename F::template apply<C26>::type{}(args...);
1814 break;
1815 case C27:
1816 typename F::template apply<C27>::type{}(args...);
1817 break;
1818 case C28:
1819 typename F::template apply<C28>::type{}(args...);
1820 break;
1821 case C29:
1822 typename F::template apply<C29>::type{}(args...);
1823 break;
1824 default:
1825 fail(c);
1826 };
1827 }
1828};
1829
1830template <char C0, char C1, char C2, char C3, char C4, char C5, char C6, char C7, char C8, char C9, char C10, char C11, char C12, char C13, char C14, char C15, char C16, char C17, char C18, char C19, char C20, char C21, char C22, char C23, char C24, char C25, char C26, char C27, char C28, char C29, char C30>
1831struct tpl_char_switch<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25, C26, C27, C28, C29, C30>
1832{
1833 template <typename F, typename Fail, typename...Args>
1834 constexpr void operator()(char c, Fail const fail, Args&&...args) const
1835 {
1836 switch(c)
1837 {
1838 case C0:
1839 typename F::template apply<C0>::type{}(args...);
1840 break;
1841 case C1:
1842 typename F::template apply<C1>::type{}(args...);
1843 break;
1844 case C2:
1845 typename F::template apply<C2>::type{}(args...);
1846 break;
1847 case C3:
1848 typename F::template apply<C3>::type{}(args...);
1849 break;
1850 case C4:
1851 typename F::template apply<C4>::type{}(args...);
1852 break;
1853 case C5:
1854 typename F::template apply<C5>::type{}(args...);
1855 break;
1856 case C6:
1857 typename F::template apply<C6>::type{}(args...);
1858 break;
1859 case C7:
1860 typename F::template apply<C7>::type{}(args...);
1861 break;
1862 case C8:
1863 typename F::template apply<C8>::type{}(args...);
1864 break;
1865 case C9:
1866 typename F::template apply<C9>::type{}(args...);
1867 break;
1868 case C10:
1869 typename F::template apply<C10>::type{}(args...);
1870 break;
1871 case C11:
1872 typename F::template apply<C11>::type{}(args...);
1873 break;
1874 case C12:
1875 typename F::template apply<C12>::type{}(args...);
1876 break;
1877 case C13:
1878 typename F::template apply<C13>::type{}(args...);
1879 break;
1880 case C14:
1881 typename F::template apply<C14>::type{}(args...);
1882 break;
1883 case C15:
1884 typename F::template apply<C15>::type{}(args...);
1885 break;
1886 case C16:
1887 typename F::template apply<C16>::type{}(args...);
1888 break;
1889 case C17:
1890 typename F::template apply<C17>::type{}(args...);
1891 break;
1892 case C18:
1893 typename F::template apply<C18>::type{}(args...);
1894 break;
1895 case C19:
1896 typename F::template apply<C19>::type{}(args...);
1897 break;
1898 case C20:
1899 typename F::template apply<C20>::type{}(args...);
1900 break;
1901 case C21:
1902 typename F::template apply<C21>::type{}(args...);
1903 break;
1904 case C22:
1905 typename F::template apply<C22>::type{}(args...);
1906 break;
1907 case C23:
1908 typename F::template apply<C23>::type{}(args...);
1909 break;
1910 case C24:
1911 typename F::template apply<C24>::type{}(args...);
1912 break;
1913 case C25:
1914 typename F::template apply<C25>::type{}(args...);
1915 break;
1916 case C26:
1917 typename F::template apply<C26>::type{}(args...);
1918 break;
1919 case C27:
1920 typename F::template apply<C27>::type{}(args...);
1921 break;
1922 case C28:
1923 typename F::template apply<C28>::type{}(args...);
1924 break;
1925 case C29:
1926 typename F::template apply<C29>::type{}(args...);
1927 break;
1928 case C30:
1929 typename F::template apply<C30>::type{}(args...);
1930 break;
1931 default:
1932 fail(c);
1933 };
1934 }
1935};
1936
1937template <char C0, char C1, char C2, char C3, char C4, char C5, char C6, char C7, char C8, char C9, char C10, char C11, char C12, char C13, char C14, char C15, char C16, char C17, char C18, char C19, char C20, char C21, char C22, char C23, char C24, char C25, char C26, char C27, char C28, char C29, char C30, char C31>
1938struct tpl_char_switch<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25, C26, C27, C28, C29, C30, C31>
1939{
1940 template <typename F, typename Fail, typename...Args>
1941 constexpr void operator()(char c, Fail const fail, Args&&...args) const
1942 {
1943 switch(c)
1944 {
1945 case C0:
1946 typename F::template apply<C0>::type{}(args...);
1947 break;
1948 case C1:
1949 typename F::template apply<C1>::type{}(args...);
1950 break;
1951 case C2:
1952 typename F::template apply<C2>::type{}(args...);
1953 break;
1954 case C3:
1955 typename F::template apply<C3>::type{}(args...);
1956 break;
1957 case C4:
1958 typename F::template apply<C4>::type{}(args...);
1959 break;
1960 case C5:
1961 typename F::template apply<C5>::type{}(args...);
1962 break;
1963 case C6:
1964 typename F::template apply<C6>::type{}(args...);
1965 break;
1966 case C7:
1967 typename F::template apply<C7>::type{}(args...);
1968 break;
1969 case C8:
1970 typename F::template apply<C8>::type{}(args...);
1971 break;
1972 case C9:
1973 typename F::template apply<C9>::type{}(args...);
1974 break;
1975 case C10:
1976 typename F::template apply<C10>::type{}(args...);
1977 break;
1978 case C11:
1979 typename F::template apply<C11>::type{}(args...);
1980 break;
1981 case C12:
1982 typename F::template apply<C12>::type{}(args...);
1983 break;
1984 case C13:
1985 typename F::template apply<C13>::type{}(args...);
1986 break;
1987 case C14:
1988 typename F::template apply<C14>::type{}(args...);
1989 break;
1990 case C15:
1991 typename F::template apply<C15>::type{}(args...);
1992 break;
1993 case C16:
1994 typename F::template apply<C16>::type{}(args...);
1995 break;
1996 case C17:
1997 typename F::template apply<C17>::type{}(args...);
1998 break;
1999 case C18:
2000 typename F::template apply<C18>::type{}(args...);
2001 break;
2002 case C19:
2003 typename F::template apply<C19>::type{}(args...);
2004 break;
2005 case C20:
2006 typename F::template apply<C20>::type{}(args...);
2007 break;
2008 case C21:
2009 typename F::template apply<C21>::type{}(args...);
2010 break;
2011 case C22:
2012 typename F::template apply<C22>::type{}(args...);
2013 break;
2014 case C23:
2015 typename F::template apply<C23>::type{}(args...);
2016 break;
2017 case C24:
2018 typename F::template apply<C24>::type{}(args...);
2019 break;
2020 case C25:
2021 typename F::template apply<C25>::type{}(args...);
2022 break;
2023 case C26:
2024 typename F::template apply<C26>::type{}(args...);
2025 break;
2026 case C27:
2027 typename F::template apply<C27>::type{}(args...);
2028 break;
2029 case C28:
2030 typename F::template apply<C28>::type{}(args...);
2031 break;
2032 case C29:
2033 typename F::template apply<C29>::type{}(args...);
2034 break;
2035 case C30:
2036 typename F::template apply<C30>::type{}(args...);
2037 break;
2038 case C31:
2039 typename F::template apply<C31>::type{}(args...);
2040 break;
2041 default:
2042 fail(c);
2043 };
2044 }
2045};
2046
2047template <char C0, char C1, char C2, char C3, char C4, char C5, char C6, char C7, char C8, char C9, char C10, char C11, char C12, char C13, char C14, char C15, char C16, char C17, char C18, char C19, char C20, char C21, char C22, char C23, char C24, char C25, char C26, char C27, char C28, char C29, char C30, char C31, char C32>
2048struct tpl_char_switch<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25, C26, C27, C28, C29, C30, C31, C32>
2049{
2050 template <typename F, typename Fail, typename...Args>
2051 constexpr void operator()(char c, Fail const fail, Args&&...args) const
2052 {
2053 switch(c)
2054 {
2055 case C0:
2056 typename F::template apply<C0>::type{}(args...);
2057 break;
2058 case C1:
2059 typename F::template apply<C1>::type{}(args...);
2060 break;
2061 case C2:
2062 typename F::template apply<C2>::type{}(args...);
2063 break;
2064 case C3:
2065 typename F::template apply<C3>::type{}(args...);
2066 break;
2067 case C4:
2068 typename F::template apply<C4>::type{}(args...);
2069 break;
2070 case C5:
2071 typename F::template apply<C5>::type{}(args...);
2072 break;
2073 case C6:
2074 typename F::template apply<C6>::type{}(args...);
2075 break;
2076 case C7:
2077 typename F::template apply<C7>::type{}(args...);
2078 break;
2079 case C8:
2080 typename F::template apply<C8>::type{}(args...);
2081 break;
2082 case C9:
2083 typename F::template apply<C9>::type{}(args...);
2084 break;
2085 case C10:
2086 typename F::template apply<C10>::type{}(args...);
2087 break;
2088 case C11:
2089 typename F::template apply<C11>::type{}(args...);
2090 break;
2091 case C12:
2092 typename F::template apply<C12>::type{}(args...);
2093 break;
2094 case C13:
2095 typename F::template apply<C13>::type{}(args...);
2096 break;
2097 case C14:
2098 typename F::template apply<C14>::type{}(args...);
2099 break;
2100 case C15:
2101 typename F::template apply<C15>::type{}(args...);
2102 break;
2103 case C16:
2104 typename F::template apply<C16>::type{}(args...);
2105 break;
2106 case C17:
2107 typename F::template apply<C17>::type{}(args...);
2108 break;
2109 case C18:
2110 typename F::template apply<C18>::type{}(args...);
2111 break;
2112 case C19:
2113 typename F::template apply<C19>::type{}(args...);
2114 break;
2115 case C20:
2116 typename F::template apply<C20>::type{}(args...);
2117 break;
2118 case C21:
2119 typename F::template apply<C21>::type{}(args...);
2120 break;
2121 case C22:
2122 typename F::template apply<C22>::type{}(args...);
2123 break;
2124 case C23:
2125 typename F::template apply<C23>::type{}(args...);
2126 break;
2127 case C24:
2128 typename F::template apply<C24>::type{}(args...);
2129 break;
2130 case C25:
2131 typename F::template apply<C25>::type{}(args...);
2132 break;
2133 case C26:
2134 typename F::template apply<C26>::type{}(args...);
2135 break;
2136 case C27:
2137 typename F::template apply<C27>::type{}(args...);
2138 break;
2139 case C28:
2140 typename F::template apply<C28>::type{}(args...);
2141 break;
2142 case C29:
2143 typename F::template apply<C29>::type{}(args...);
2144 break;
2145 case C30:
2146 typename F::template apply<C30>::type{}(args...);
2147 break;
2148 case C31:
2149 typename F::template apply<C31>::type{}(args...);
2150 break;
2151 case C32:
2152 typename F::template apply<C32>::type{}(args...);
2153 break;
2154 default:
2155 fail(c);
2156 };
2157 }
2158};
2159
2160template <char C0, char C1, char C2, char C3, char C4, char C5, char C6, char C7, char C8, char C9, char C10, char C11, char C12, char C13, char C14, char C15, char C16, char C17, char C18, char C19, char C20, char C21, char C22, char C23, char C24, char C25, char C26, char C27, char C28, char C29, char C30, char C31, char C32, char C33>
2161struct tpl_char_switch<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25, C26, C27, C28, C29, C30, C31, C32, C33>
2162{
2163 template <typename F, typename Fail, typename...Args>
2164 constexpr void operator()(char c, Fail const fail, Args&&...args) const
2165 {
2166 switch(c)
2167 {
2168 case C0:
2169 typename F::template apply<C0>::type{}(args...);
2170 break;
2171 case C1:
2172 typename F::template apply<C1>::type{}(args...);
2173 break;
2174 case C2:
2175 typename F::template apply<C2>::type{}(args...);
2176 break;
2177 case C3:
2178 typename F::template apply<C3>::type{}(args...);
2179 break;
2180 case C4:
2181 typename F::template apply<C4>::type{}(args...);
2182 break;
2183 case C5:
2184 typename F::template apply<C5>::type{}(args...);
2185 break;
2186 case C6:
2187 typename F::template apply<C6>::type{}(args...);
2188 break;
2189 case C7:
2190 typename F::template apply<C7>::type{}(args...);
2191 break;
2192 case C8:
2193 typename F::template apply<C8>::type{}(args...);
2194 break;
2195 case C9:
2196 typename F::template apply<C9>::type{}(args...);
2197 break;
2198 case C10:
2199 typename F::template apply<C10>::type{}(args...);
2200 break;
2201 case C11:
2202 typename F::template apply<C11>::type{}(args...);
2203 break;
2204 case C12:
2205 typename F::template apply<C12>::type{}(args...);
2206 break;
2207 case C13:
2208 typename F::template apply<C13>::type{}(args...);
2209 break;
2210 case C14:
2211 typename F::template apply<C14>::type{}(args...);
2212 break;
2213 case C15:
2214 typename F::template apply<C15>::type{}(args...);
2215 break;
2216 case C16:
2217 typename F::template apply<C16>::type{}(args...);
2218 break;
2219 case C17:
2220 typename F::template apply<C17>::type{}(args...);
2221 break;
2222 case C18:
2223 typename F::template apply<C18>::type{}(args...);
2224 break;
2225 case C19:
2226 typename F::template apply<C19>::type{}(args...);
2227 break;
2228 case C20:
2229 typename F::template apply<C20>::type{}(args...);
2230 break;
2231 case C21:
2232 typename F::template apply<C21>::type{}(args...);
2233 break;
2234 case C22:
2235 typename F::template apply<C22>::type{}(args...);
2236 break;
2237 case C23:
2238 typename F::template apply<C23>::type{}(args...);
2239 break;
2240 case C24:
2241 typename F::template apply<C24>::type{}(args...);
2242 break;
2243 case C25:
2244 typename F::template apply<C25>::type{}(args...);
2245 break;
2246 case C26:
2247 typename F::template apply<C26>::type{}(args...);
2248 break;
2249 case C27:
2250 typename F::template apply<C27>::type{}(args...);
2251 break;
2252 case C28:
2253 typename F::template apply<C28>::type{}(args...);
2254 break;
2255 case C29:
2256 typename F::template apply<C29>::type{}(args...);
2257 break;
2258 case C30:
2259 typename F::template apply<C30>::type{}(args...);
2260 break;
2261 case C31:
2262 typename F::template apply<C31>::type{}(args...);
2263 break;
2264 case C32:
2265 typename F::template apply<C32>::type{}(args...);
2266 break;
2267 case C33:
2268 typename F::template apply<C33>::type{}(args...);
2269 break;
2270 default:
2271 fail(c);
2272 };
2273 }
2274};
2275
2276template <char C0, char C1, char C2, char C3, char C4, char C5, char C6, char C7, char C8, char C9, char C10, char C11, char C12, char C13, char C14, char C15, char C16, char C17, char C18, char C19, char C20, char C21, char C22, char C23, char C24, char C25, char C26, char C27, char C28, char C29, char C30, char C31, char C32, char C33, char C34>
2277struct tpl_char_switch<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25, C26, C27, C28, C29, C30, C31, C32, C33, C34>
2278{
2279 template <typename F, typename Fail, typename...Args>
2280 constexpr void operator()(char c, Fail const fail, Args&&...args) const
2281 {
2282 switch(c)
2283 {
2284 case C0:
2285 typename F::template apply<C0>::type{}(args...);
2286 break;
2287 case C1:
2288 typename F::template apply<C1>::type{}(args...);
2289 break;
2290 case C2:
2291 typename F::template apply<C2>::type{}(args...);
2292 break;
2293 case C3:
2294 typename F::template apply<C3>::type{}(args...);
2295 break;
2296 case C4:
2297 typename F::template apply<C4>::type{}(args...);
2298 break;
2299 case C5:
2300 typename F::template apply<C5>::type{}(args...);
2301 break;
2302 case C6:
2303 typename F::template apply<C6>::type{}(args...);
2304 break;
2305 case C7:
2306 typename F::template apply<C7>::type{}(args...);
2307 break;
2308 case C8:
2309 typename F::template apply<C8>::type{}(args...);
2310 break;
2311 case C9:
2312 typename F::template apply<C9>::type{}(args...);
2313 break;
2314 case C10:
2315 typename F::template apply<C10>::type{}(args...);
2316 break;
2317 case C11:
2318 typename F::template apply<C11>::type{}(args...);
2319 break;
2320 case C12:
2321 typename F::template apply<C12>::type{}(args...);
2322 break;
2323 case C13:
2324 typename F::template apply<C13>::type{}(args...);
2325 break;
2326 case C14:
2327 typename F::template apply<C14>::type{}(args...);
2328 break;
2329 case C15:
2330 typename F::template apply<C15>::type{}(args...);
2331 break;
2332 case C16:
2333 typename F::template apply<C16>::type{}(args...);
2334 break;
2335 case C17:
2336 typename F::template apply<C17>::type{}(args...);
2337 break;
2338 case C18:
2339 typename F::template apply<C18>::type{}(args...);
2340 break;
2341 case C19:
2342 typename F::template apply<C19>::type{}(args...);
2343 break;
2344 case C20:
2345 typename F::template apply<C20>::type{}(args...);
2346 break;
2347 case C21:
2348 typename F::template apply<C21>::type{}(args...);
2349 break;
2350 case C22:
2351 typename F::template apply<C22>::type{}(args...);
2352 break;
2353 case C23:
2354 typename F::template apply<C23>::type{}(args...);
2355 break;
2356 case C24:
2357 typename F::template apply<C24>::type{}(args...);
2358 break;
2359 case C25:
2360 typename F::template apply<C25>::type{}(args...);
2361 break;
2362 case C26:
2363 typename F::template apply<C26>::type{}(args...);
2364 break;
2365 case C27:
2366 typename F::template apply<C27>::type{}(args...);
2367 break;
2368 case C28:
2369 typename F::template apply<C28>::type{}(args...);
2370 break;
2371 case C29:
2372 typename F::template apply<C29>::type{}(args...);
2373 break;
2374 case C30:
2375 typename F::template apply<C30>::type{}(args...);
2376 break;
2377 case C31:
2378 typename F::template apply<C31>::type{}(args...);
2379 break;
2380 case C32:
2381 typename F::template apply<C32>::type{}(args...);
2382 break;
2383 case C33:
2384 typename F::template apply<C33>::type{}(args...);
2385 break;
2386 case C34:
2387 typename F::template apply<C34>::type{}(args...);
2388 break;
2389 default:
2390 fail(c);
2391 };
2392 }
2393};
2394
2395template <char C0, char C1, char C2, char C3, char C4, char C5, char C6, char C7, char C8, char C9, char C10, char C11, char C12, char C13, char C14, char C15, char C16, char C17, char C18, char C19, char C20, char C21, char C22, char C23, char C24, char C25, char C26, char C27, char C28, char C29, char C30, char C31, char C32, char C33, char C34, char C35>
2396struct tpl_char_switch<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25, C26, C27, C28, C29, C30, C31, C32, C33, C34, C35>
2397{
2398 template <typename F, typename Fail, typename...Args>
2399 constexpr void operator()(char c, Fail const fail, Args&&...args) const
2400 {
2401 switch(c)
2402 {
2403 case C0:
2404 typename F::template apply<C0>::type{}(args...);
2405 break;
2406 case C1:
2407 typename F::template apply<C1>::type{}(args...);
2408 break;
2409 case C2:
2410 typename F::template apply<C2>::type{}(args...);
2411 break;
2412 case C3:
2413 typename F::template apply<C3>::type{}(args...);
2414 break;
2415 case C4:
2416 typename F::template apply<C4>::type{}(args...);
2417 break;
2418 case C5:
2419 typename F::template apply<C5>::type{}(args...);
2420 break;
2421 case C6:
2422 typename F::template apply<C6>::type{}(args...);
2423 break;
2424 case C7:
2425 typename F::template apply<C7>::type{}(args...);
2426 break;
2427 case C8:
2428 typename F::template apply<C8>::type{}(args...);
2429 break;
2430 case C9:
2431 typename F::template apply<C9>::type{}(args...);
2432 break;
2433 case C10:
2434 typename F::template apply<C10>::type{}(args...);
2435 break;
2436 case C11:
2437 typename F::template apply<C11>::type{}(args...);
2438 break;
2439 case C12:
2440 typename F::template apply<C12>::type{}(args...);
2441 break;
2442 case C13:
2443 typename F::template apply<C13>::type{}(args...);
2444 break;
2445 case C14:
2446 typename F::template apply<C14>::type{}(args...);
2447 break;
2448 case C15:
2449 typename F::template apply<C15>::type{}(args...);
2450 break;
2451 case C16:
2452 typename F::template apply<C16>::type{}(args...);
2453 break;
2454 case C17:
2455 typename F::template apply<C17>::type{}(args...);
2456 break;
2457 case C18:
2458 typename F::template apply<C18>::type{}(args...);
2459 break;
2460 case C19:
2461 typename F::template apply<C19>::type{}(args...);
2462 break;
2463 case C20:
2464 typename F::template apply<C20>::type{}(args...);
2465 break;
2466 case C21:
2467 typename F::template apply<C21>::type{}(args...);
2468 break;
2469 case C22:
2470 typename F::template apply<C22>::type{}(args...);
2471 break;
2472 case C23:
2473 typename F::template apply<C23>::type{}(args...);
2474 break;
2475 case C24:
2476 typename F::template apply<C24>::type{}(args...);
2477 break;
2478 case C25:
2479 typename F::template apply<C25>::type{}(args...);
2480 break;
2481 case C26:
2482 typename F::template apply<C26>::type{}(args...);
2483 break;
2484 case C27:
2485 typename F::template apply<C27>::type{}(args...);
2486 break;
2487 case C28:
2488 typename F::template apply<C28>::type{}(args...);
2489 break;
2490 case C29:
2491 typename F::template apply<C29>::type{}(args...);
2492 break;
2493 case C30:
2494 typename F::template apply<C30>::type{}(args...);
2495 break;
2496 case C31:
2497 typename F::template apply<C31>::type{}(args...);
2498 break;
2499 case C32:
2500 typename F::template apply<C32>::type{}(args...);
2501 break;
2502 case C33:
2503 typename F::template apply<C33>::type{}(args...);
2504 break;
2505 case C34:
2506 typename F::template apply<C34>::type{}(args...);
2507 break;
2508 case C35:
2509 typename F::template apply<C35>::type{}(args...);
2510 break;
2511 default:
2512 fail(c);
2513 };
2514 }
2515};
2516
2517template <char C0, char C1, char C2, char C3, char C4, char C5, char C6, char C7, char C8, char C9, char C10, char C11, char C12, char C13, char C14, char C15, char C16, char C17, char C18, char C19, char C20, char C21, char C22, char C23, char C24, char C25, char C26, char C27, char C28, char C29, char C30, char C31, char C32, char C33, char C34, char C35, char C36>
2518struct tpl_char_switch<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25, C26, C27, C28, C29, C30, C31, C32, C33, C34, C35, C36>
2519{
2520 template <typename F, typename Fail, typename...Args>
2521 constexpr void operator()(char c, Fail const fail, Args&&...args) const
2522 {
2523 switch(c)
2524 {
2525 case C0:
2526 typename F::template apply<C0>::type{}(args...);
2527 break;
2528 case C1:
2529 typename F::template apply<C1>::type{}(args...);
2530 break;
2531 case C2:
2532 typename F::template apply<C2>::type{}(args...);
2533 break;
2534 case C3:
2535 typename F::template apply<C3>::type{}(args...);
2536 break;
2537 case C4:
2538 typename F::template apply<C4>::type{}(args...);
2539 break;
2540 case C5:
2541 typename F::template apply<C5>::type{}(args...);
2542 break;
2543 case C6:
2544 typename F::template apply<C6>::type{}(args...);
2545 break;
2546 case C7:
2547 typename F::template apply<C7>::type{}(args...);
2548 break;
2549 case C8:
2550 typename F::template apply<C8>::type{}(args...);
2551 break;
2552 case C9:
2553 typename F::template apply<C9>::type{}(args...);
2554 break;
2555 case C10:
2556 typename F::template apply<C10>::type{}(args...);
2557 break;
2558 case C11:
2559 typename F::template apply<C11>::type{}(args...);
2560 break;
2561 case C12:
2562 typename F::template apply<C12>::type{}(args...);
2563 break;
2564 case C13:
2565 typename F::template apply<C13>::type{}(args...);
2566 break;
2567 case C14:
2568 typename F::template apply<C14>::type{}(args...);
2569 break;
2570 case C15:
2571 typename F::template apply<C15>::type{}(args...);
2572 break;
2573 case C16:
2574 typename F::template apply<C16>::type{}(args...);
2575 break;
2576 case C17:
2577 typename F::template apply<C17>::type{}(args...);
2578 break;
2579 case C18:
2580 typename F::template apply<C18>::type{}(args...);
2581 break;
2582 case C19:
2583 typename F::template apply<C19>::type{}(args...);
2584 break;
2585 case C20:
2586 typename F::template apply<C20>::type{}(args...);
2587 break;
2588 case C21:
2589 typename F::template apply<C21>::type{}(args...);
2590 break;
2591 case C22:
2592 typename F::template apply<C22>::type{}(args...);
2593 break;
2594 case C23:
2595 typename F::template apply<C23>::type{}(args...);
2596 break;
2597 case C24:
2598 typename F::template apply<C24>::type{}(args...);
2599 break;
2600 case C25:
2601 typename F::template apply<C25>::type{}(args...);
2602 break;
2603 case C26:
2604 typename F::template apply<C26>::type{}(args...);
2605 break;
2606 case C27:
2607 typename F::template apply<C27>::type{}(args...);
2608 break;
2609 case C28:
2610 typename F::template apply<C28>::type{}(args...);
2611 break;
2612 case C29:
2613 typename F::template apply<C29>::type{}(args...);
2614 break;
2615 case C30:
2616 typename F::template apply<C30>::type{}(args...);
2617 break;
2618 case C31:
2619 typename F::template apply<C31>::type{}(args...);
2620 break;
2621 case C32:
2622 typename F::template apply<C32>::type{}(args...);
2623 break;
2624 case C33:
2625 typename F::template apply<C33>::type{}(args...);
2626 break;
2627 case C34:
2628 typename F::template apply<C34>::type{}(args...);
2629 break;
2630 case C35:
2631 typename F::template apply<C35>::type{}(args...);
2632 break;
2633 case C36:
2634 typename F::template apply<C36>::type{}(args...);
2635 break;
2636 default:
2637 fail(c);
2638 };
2639 }
2640};
2641
2642template <char C0, char C1, char C2, char C3, char C4, char C5, char C6, char C7, char C8, char C9, char C10, char C11, char C12, char C13, char C14, char C15, char C16, char C17, char C18, char C19, char C20, char C21, char C22, char C23, char C24, char C25, char C26, char C27, char C28, char C29, char C30, char C31, char C32, char C33, char C34, char C35, char C36, char C37>
2643struct tpl_char_switch<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25, C26, C27, C28, C29, C30, C31, C32, C33, C34, C35, C36, C37>
2644{
2645 template <typename F, typename Fail, typename...Args>
2646 constexpr void operator()(char c, Fail const fail, Args&&...args) const
2647 {
2648 switch(c)
2649 {
2650 case C0:
2651 typename F::template apply<C0>::type{}(args...);
2652 break;
2653 case C1:
2654 typename F::template apply<C1>::type{}(args...);
2655 break;
2656 case C2:
2657 typename F::template apply<C2>::type{}(args...);
2658 break;
2659 case C3:
2660 typename F::template apply<C3>::type{}(args...);
2661 break;
2662 case C4:
2663 typename F::template apply<C4>::type{}(args...);
2664 break;
2665 case C5:
2666 typename F::template apply<C5>::type{}(args...);
2667 break;
2668 case C6:
2669 typename F::template apply<C6>::type{}(args...);
2670 break;
2671 case C7:
2672 typename F::template apply<C7>::type{}(args...);
2673 break;
2674 case C8:
2675 typename F::template apply<C8>::type{}(args...);
2676 break;
2677 case C9:
2678 typename F::template apply<C9>::type{}(args...);
2679 break;
2680 case C10:
2681 typename F::template apply<C10>::type{}(args...);
2682 break;
2683 case C11:
2684 typename F::template apply<C11>::type{}(args...);
2685 break;
2686 case C12:
2687 typename F::template apply<C12>::type{}(args...);
2688 break;
2689 case C13:
2690 typename F::template apply<C13>::type{}(args...);
2691 break;
2692 case C14:
2693 typename F::template apply<C14>::type{}(args...);
2694 break;
2695 case C15:
2696 typename F::template apply<C15>::type{}(args...);
2697 break;
2698 case C16:
2699 typename F::template apply<C16>::type{}(args...);
2700 break;
2701 case C17:
2702 typename F::template apply<C17>::type{}(args...);
2703 break;
2704 case C18:
2705 typename F::template apply<C18>::type{}(args...);
2706 break;
2707 case C19:
2708 typename F::template apply<C19>::type{}(args...);
2709 break;
2710 case C20:
2711 typename F::template apply<C20>::type{}(args...);
2712 break;
2713 case C21:
2714 typename F::template apply<C21>::type{}(args...);
2715 break;
2716 case C22:
2717 typename F::template apply<C22>::type{}(args...);
2718 break;
2719 case C23:
2720 typename F::template apply<C23>::type{}(args...);
2721 break;
2722 case C24:
2723 typename F::template apply<C24>::type{}(args...);
2724 break;
2725 case C25:
2726 typename F::template apply<C25>::type{}(args...);
2727 break;
2728 case C26:
2729 typename F::template apply<C26>::type{}(args...);
2730 break;
2731 case C27:
2732 typename F::template apply<C27>::type{}(args...);
2733 break;
2734 case C28:
2735 typename F::template apply<C28>::type{}(args...);
2736 break;
2737 case C29:
2738 typename F::template apply<C29>::type{}(args...);
2739 break;
2740 case C30:
2741 typename F::template apply<C30>::type{}(args...);
2742 break;
2743 case C31:
2744 typename F::template apply<C31>::type{}(args...);
2745 break;
2746 case C32:
2747 typename F::template apply<C32>::type{}(args...);
2748 break;
2749 case C33:
2750 typename F::template apply<C33>::type{}(args...);
2751 break;
2752 case C34:
2753 typename F::template apply<C34>::type{}(args...);
2754 break;
2755 case C35:
2756 typename F::template apply<C35>::type{}(args...);
2757 break;
2758 case C36:
2759 typename F::template apply<C36>::type{}(args...);
2760 break;
2761 case C37:
2762 typename F::template apply<C37>::type{}(args...);
2763 break;
2764 default:
2765 fail(c);
2766 };
2767 }
2768};
2769
2770template <char C0, char C1, char C2, char C3, char C4, char C5, char C6, char C7, char C8, char C9, char C10, char C11, char C12, char C13, char C14, char C15, char C16, char C17, char C18, char C19, char C20, char C21, char C22, char C23, char C24, char C25, char C26, char C27, char C28, char C29, char C30, char C31, char C32, char C33, char C34, char C35, char C36, char C37, char C38>
2771struct tpl_char_switch<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25, C26, C27, C28, C29, C30, C31, C32, C33, C34, C35, C36, C37, C38>
2772{
2773 template <typename F, typename Fail, typename...Args>
2774 constexpr void operator()(char c, Fail const fail, Args&&...args) const
2775 {
2776 switch(c)
2777 {
2778 case C0:
2779 typename F::template apply<C0>::type{}(args...);
2780 break;
2781 case C1:
2782 typename F::template apply<C1>::type{}(args...);
2783 break;
2784 case C2:
2785 typename F::template apply<C2>::type{}(args...);
2786 break;
2787 case C3:
2788 typename F::template apply<C3>::type{}(args...);
2789 break;
2790 case C4:
2791 typename F::template apply<C4>::type{}(args...);
2792 break;
2793 case C5:
2794 typename F::template apply<C5>::type{}(args...);
2795 break;
2796 case C6:
2797 typename F::template apply<C6>::type{}(args...);
2798 break;
2799 case C7:
2800 typename F::template apply<C7>::type{}(args...);
2801 break;
2802 case C8:
2803 typename F::template apply<C8>::type{}(args...);
2804 break;
2805 case C9:
2806 typename F::template apply<C9>::type{}(args...);
2807 break;
2808 case C10:
2809 typename F::template apply<C10>::type{}(args...);
2810 break;
2811 case C11:
2812 typename F::template apply<C11>::type{}(args...);
2813 break;
2814 case C12:
2815 typename F::template apply<C12>::type{}(args...);
2816 break;
2817 case C13:
2818 typename F::template apply<C13>::type{}(args...);
2819 break;
2820 case C14:
2821 typename F::template apply<C14>::type{}(args...);
2822 break;
2823 case C15:
2824 typename F::template apply<C15>::type{}(args...);
2825 break;
2826 case C16:
2827 typename F::template apply<C16>::type{}(args...);
2828 break;
2829 case C17:
2830 typename F::template apply<C17>::type{}(args...);
2831 break;
2832 case C18:
2833 typename F::template apply<C18>::type{}(args...);
2834 break;
2835 case C19:
2836 typename F::template apply<C19>::type{}(args...);
2837 break;
2838 case C20:
2839 typename F::template apply<C20>::type{}(args...);
2840 break;
2841 case C21:
2842 typename F::template apply<C21>::type{}(args...);
2843 break;
2844 case C22:
2845 typename F::template apply<C22>::type{}(args...);
2846 break;
2847 case C23:
2848 typename F::template apply<C23>::type{}(args...);
2849 break;
2850 case C24:
2851 typename F::template apply<C24>::type{}(args...);
2852 break;
2853 case C25:
2854 typename F::template apply<C25>::type{}(args...);
2855 break;
2856 case C26:
2857 typename F::template apply<C26>::type{}(args...);
2858 break;
2859 case C27:
2860 typename F::template apply<C27>::type{}(args...);
2861 break;
2862 case C28:
2863 typename F::template apply<C28>::type{}(args...);
2864 break;
2865 case C29:
2866 typename F::template apply<C29>::type{}(args...);
2867 break;
2868 case C30:
2869 typename F::template apply<C30>::type{}(args...);
2870 break;
2871 case C31:
2872 typename F::template apply<C31>::type{}(args...);
2873 break;
2874 case C32:
2875 typename F::template apply<C32>::type{}(args...);
2876 break;
2877 case C33:
2878 typename F::template apply<C33>::type{}(args...);
2879 break;
2880 case C34:
2881 typename F::template apply<C34>::type{}(args...);
2882 break;
2883 case C35:
2884 typename F::template apply<C35>::type{}(args...);
2885 break;
2886 case C36:
2887 typename F::template apply<C36>::type{}(args...);
2888 break;
2889 case C37:
2890 typename F::template apply<C37>::type{}(args...);
2891 break;
2892 case C38:
2893 typename F::template apply<C38>::type{}(args...);
2894 break;
2895 default:
2896 fail(c);
2897 };
2898 }
2899};
2900
2901template <char C0, char C1, char C2, char C3, char C4, char C5, char C6, char C7, char C8, char C9, char C10, char C11, char C12, char C13, char C14, char C15, char C16, char C17, char C18, char C19, char C20, char C21, char C22, char C23, char C24, char C25, char C26, char C27, char C28, char C29, char C30, char C31, char C32, char C33, char C34, char C35, char C36, char C37, char C38, char C39>
2902struct tpl_char_switch<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25, C26, C27, C28, C29, C30, C31, C32, C33, C34, C35, C36, C37, C38, C39>
2903{
2904 template <typename F, typename Fail, typename...Args>
2905 constexpr void operator()(char c, Fail const fail, Args&&...args) const
2906 {
2907 switch(c)
2908 {
2909 case C0:
2910 typename F::template apply<C0>::type{}(args...);
2911 break;
2912 case C1:
2913 typename F::template apply<C1>::type{}(args...);
2914 break;
2915 case C2:
2916 typename F::template apply<C2>::type{}(args...);
2917 break;
2918 case C3:
2919 typename F::template apply<C3>::type{}(args...);
2920 break;
2921 case C4:
2922 typename F::template apply<C4>::type{}(args...);
2923 break;
2924 case C5:
2925 typename F::template apply<C5>::type{}(args...);
2926 break;
2927 case C6:
2928 typename F::template apply<C6>::type{}(args...);
2929 break;
2930 case C7:
2931 typename F::template apply<C7>::type{}(args...);
2932 break;
2933 case C8:
2934 typename F::template apply<C8>::type{}(args...);
2935 break;
2936 case C9:
2937 typename F::template apply<C9>::type{}(args...);
2938 break;
2939 case C10:
2940 typename F::template apply<C10>::type{}(args...);
2941 break;
2942 case C11:
2943 typename F::template apply<C11>::type{}(args...);
2944 break;
2945 case C12:
2946 typename F::template apply<C12>::type{}(args...);
2947 break;
2948 case C13:
2949 typename F::template apply<C13>::type{}(args...);
2950 break;
2951 case C14:
2952 typename F::template apply<C14>::type{}(args...);
2953 break;
2954 case C15:
2955 typename F::template apply<C15>::type{}(args...);
2956 break;
2957 case C16:
2958 typename F::template apply<C16>::type{}(args...);
2959 break;
2960 case C17:
2961 typename F::template apply<C17>::type{}(args...);
2962 break;
2963 case C18:
2964 typename F::template apply<C18>::type{}(args...);
2965 break;
2966 case C19:
2967 typename F::template apply<C19>::type{}(args...);
2968 break;
2969 case C20:
2970 typename F::template apply<C20>::type{}(args...);
2971 break;
2972 case C21:
2973 typename F::template apply<C21>::type{}(args...);
2974 break;
2975 case C22:
2976 typename F::template apply<C22>::type{}(args...);
2977 break;
2978 case C23:
2979 typename F::template apply<C23>::type{}(args...);
2980 break;
2981 case C24:
2982 typename F::template apply<C24>::type{}(args...);
2983 break;
2984 case C25:
2985 typename F::template apply<C25>::type{}(args...);
2986 break;
2987 case C26:
2988 typename F::template apply<C26>::type{}(args...);
2989 break;
2990 case C27:
2991 typename F::template apply<C27>::type{}(args...);
2992 break;
2993 case C28:
2994 typename F::template apply<C28>::type{}(args...);
2995 break;
2996 case C29:
2997 typename F::template apply<C29>::type{}(args...);
2998 break;
2999 case C30:
3000 typename F::template apply<C30>::type{}(args...);
3001 break;
3002 case C31:
3003 typename F::template apply<C31>::type{}(args...);
3004 break;
3005 case C32:
3006 typename F::template apply<C32>::type{}(args...);
3007 break;
3008 case C33:
3009 typename F::template apply<C33>::type{}(args...);
3010 break;
3011 case C34:
3012 typename F::template apply<C34>::type{}(args...);
3013 break;
3014 case C35:
3015 typename F::template apply<C35>::type{}(args...);
3016 break;
3017 case C36:
3018 typename F::template apply<C36>::type{}(args...);
3019 break;
3020 case C37:
3021 typename F::template apply<C37>::type{}(args...);
3022 break;
3023 case C38:
3024 typename F::template apply<C38>::type{}(args...);
3025 break;
3026 case C39:
3027 typename F::template apply<C39>::type{}(args...);
3028 break;
3029 default:
3030 fail(c);
3031 };
3032 }
3033};
3034
3035template <char C0, char C1, char C2, char C3, char C4, char C5, char C6, char C7, char C8, char C9, char C10, char C11, char C12, char C13, char C14, char C15, char C16, char C17, char C18, char C19, char C20, char C21, char C22, char C23, char C24, char C25, char C26, char C27, char C28, char C29, char C30, char C31, char C32, char C33, char C34, char C35, char C36, char C37, char C38, char C39, char C40>
3036struct tpl_char_switch<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25, C26, C27, C28, C29, C30, C31, C32, C33, C34, C35, C36, C37, C38, C39, C40>
3037{
3038 template <typename F, typename Fail, typename...Args>
3039 constexpr void operator()(char c, Fail const fail, Args&&...args) const
3040 {
3041 switch(c)
3042 {
3043 case C0:
3044 typename F::template apply<C0>::type{}(args...);
3045 break;
3046 case C1:
3047 typename F::template apply<C1>::type{}(args...);
3048 break;
3049 case C2:
3050 typename F::template apply<C2>::type{}(args...);
3051 break;
3052 case C3:
3053 typename F::template apply<C3>::type{}(args...);
3054 break;
3055 case C4:
3056 typename F::template apply<C4>::type{}(args...);
3057 break;
3058 case C5:
3059 typename F::template apply<C5>::type{}(args...);
3060 break;
3061 case C6:
3062 typename F::template apply<C6>::type{}(args...);
3063 break;
3064 case C7:
3065 typename F::template apply<C7>::type{}(args...);
3066 break;
3067 case C8:
3068 typename F::template apply<C8>::type{}(args...);
3069 break;
3070 case C9:
3071 typename F::template apply<C9>::type{}(args...);
3072 break;
3073 case C10:
3074 typename F::template apply<C10>::type{}(args...);
3075 break;
3076 case C11:
3077 typename F::template apply<C11>::type{}(args...);
3078 break;
3079 case C12:
3080 typename F::template apply<C12>::type{}(args...);
3081 break;
3082 case C13:
3083 typename F::template apply<C13>::type{}(args...);
3084 break;
3085 case C14:
3086 typename F::template apply<C14>::type{}(args...);
3087 break;
3088 case C15:
3089 typename F::template apply<C15>::type{}(args...);
3090 break;
3091 case C16:
3092 typename F::template apply<C16>::type{}(args...);
3093 break;
3094 case C17:
3095 typename F::template apply<C17>::type{}(args...);
3096 break;
3097 case C18:
3098 typename F::template apply<C18>::type{}(args...);
3099 break;
3100 case C19:
3101 typename F::template apply<C19>::type{}(args...);
3102 break;
3103 case C20:
3104 typename F::template apply<C20>::type{}(args...);
3105 break;
3106 case C21:
3107 typename F::template apply<C21>::type{}(args...);
3108 break;
3109 case C22:
3110 typename F::template apply<C22>::type{}(args...);
3111 break;
3112 case C23:
3113 typename F::template apply<C23>::type{}(args...);
3114 break;
3115 case C24:
3116 typename F::template apply<C24>::type{}(args...);
3117 break;
3118 case C25:
3119 typename F::template apply<C25>::type{}(args...);
3120 break;
3121 case C26:
3122 typename F::template apply<C26>::type{}(args...);
3123 break;
3124 case C27:
3125 typename F::template apply<C27>::type{}(args...);
3126 break;
3127 case C28:
3128 typename F::template apply<C28>::type{}(args...);
3129 break;
3130 case C29:
3131 typename F::template apply<C29>::type{}(args...);
3132 break;
3133 case C30:
3134 typename F::template apply<C30>::type{}(args...);
3135 break;
3136 case C31:
3137 typename F::template apply<C31>::type{}(args...);
3138 break;
3139 case C32:
3140 typename F::template apply<C32>::type{}(args...);
3141 break;
3142 case C33:
3143 typename F::template apply<C33>::type{}(args...);
3144 break;
3145 case C34:
3146 typename F::template apply<C34>::type{}(args...);
3147 break;
3148 case C35:
3149 typename F::template apply<C35>::type{}(args...);
3150 break;
3151 case C36:
3152 typename F::template apply<C36>::type{}(args...);
3153 break;
3154 case C37:
3155 typename F::template apply<C37>::type{}(args...);
3156 break;
3157 case C38:
3158 typename F::template apply<C38>::type{}(args...);
3159 break;
3160 case C39:
3161 typename F::template apply<C39>::type{}(args...);
3162 break;
3163 case C40:
3164 typename F::template apply<C40>::type{}(args...);
3165 break;
3166 default:
3167 fail(c);
3168 };
3169 }
3170};
3171
3172template <char C0, char C1, char C2, char C3, char C4, char C5, char C6, char C7, char C8, char C9, char C10, char C11, char C12, char C13, char C14, char C15, char C16, char C17, char C18, char C19, char C20, char C21, char C22, char C23, char C24, char C25, char C26, char C27, char C28, char C29, char C30, char C31, char C32, char C33, char C34, char C35, char C36, char C37, char C38, char C39, char C40, char C41>
3173struct tpl_char_switch<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25, C26, C27, C28, C29, C30, C31, C32, C33, C34, C35, C36, C37, C38, C39, C40, C41>
3174{
3175 template <typename F, typename Fail, typename...Args>
3176 constexpr void operator()(char c, Fail const fail, Args&&...args) const
3177 {
3178 switch(c)
3179 {
3180 case C0:
3181 typename F::template apply<C0>::type{}(args...);
3182 break;
3183 case C1:
3184 typename F::template apply<C1>::type{}(args...);
3185 break;
3186 case C2:
3187 typename F::template apply<C2>::type{}(args...);
3188 break;
3189 case C3:
3190 typename F::template apply<C3>::type{}(args...);
3191 break;
3192 case C4:
3193 typename F::template apply<C4>::type{}(args...);
3194 break;
3195 case C5:
3196 typename F::template apply<C5>::type{}(args...);
3197 break;
3198 case C6:
3199 typename F::template apply<C6>::type{}(args...);
3200 break;
3201 case C7:
3202 typename F::template apply<C7>::type{}(args...);
3203 break;
3204 case C8:
3205 typename F::template apply<C8>::type{}(args...);
3206 break;
3207 case C9:
3208 typename F::template apply<C9>::type{}(args...);
3209 break;
3210 case C10:
3211 typename F::template apply<C10>::type{}(args...);
3212 break;
3213 case C11:
3214 typename F::template apply<C11>::type{}(args...);
3215 break;
3216 case C12:
3217 typename F::template apply<C12>::type{}(args...);
3218 break;
3219 case C13:
3220 typename F::template apply<C13>::type{}(args...);
3221 break;
3222 case C14:
3223 typename F::template apply<C14>::type{}(args...);
3224 break;
3225 case C15:
3226 typename F::template apply<C15>::type{}(args...);
3227 break;
3228 case C16:
3229 typename F::template apply<C16>::type{}(args...);
3230 break;
3231 case C17:
3232 typename F::template apply<C17>::type{}(args...);
3233 break;
3234 case C18:
3235 typename F::template apply<C18>::type{}(args...);
3236 break;
3237 case C19:
3238 typename F::template apply<C19>::type{}(args...);
3239 break;
3240 case C20:
3241 typename F::template apply<C20>::type{}(args...);
3242 break;
3243 case C21:
3244 typename F::template apply<C21>::type{}(args...);
3245 break;
3246 case C22:
3247 typename F::template apply<C22>::type{}(args...);
3248 break;
3249 case C23:
3250 typename F::template apply<C23>::type{}(args...);
3251 break;
3252 case C24:
3253 typename F::template apply<C24>::type{}(args...);
3254 break;
3255 case C25:
3256 typename F::template apply<C25>::type{}(args...);
3257 break;
3258 case C26:
3259 typename F::template apply<C26>::type{}(args...);
3260 break;
3261 case C27:
3262 typename F::template apply<C27>::type{}(args...);
3263 break;
3264 case C28:
3265 typename F::template apply<C28>::type{}(args...);
3266 break;
3267 case C29:
3268 typename F::template apply<C29>::type{}(args...);
3269 break;
3270 case C30:
3271 typename F::template apply<C30>::type{}(args...);
3272 break;
3273 case C31:
3274 typename F::template apply<C31>::type{}(args...);
3275 break;
3276 case C32:
3277 typename F::template apply<C32>::type{}(args...);
3278 break;
3279 case C33:
3280 typename F::template apply<C33>::type{}(args...);
3281 break;
3282 case C34:
3283 typename F::template apply<C34>::type{}(args...);
3284 break;
3285 case C35:
3286 typename F::template apply<C35>::type{}(args...);
3287 break;
3288 case C36:
3289 typename F::template apply<C36>::type{}(args...);
3290 break;
3291 case C37:
3292 typename F::template apply<C37>::type{}(args...);
3293 break;
3294 case C38:
3295 typename F::template apply<C38>::type{}(args...);
3296 break;
3297 case C39:
3298 typename F::template apply<C39>::type{}(args...);
3299 break;
3300 case C40:
3301 typename F::template apply<C40>::type{}(args...);
3302 break;
3303 case C41:
3304 typename F::template apply<C41>::type{}(args...);
3305 break;
3306 default:
3307 fail(c);
3308 };
3309 }
3310};
3311
3312template <char C0, char C1, char C2, char C3, char C4, char C5, char C6, char C7, char C8, char C9, char C10, char C11, char C12, char C13, char C14, char C15, char C16, char C17, char C18, char C19, char C20, char C21, char C22, char C23, char C24, char C25, char C26, char C27, char C28, char C29, char C30, char C31, char C32, char C33, char C34, char C35, char C36, char C37, char C38, char C39, char C40, char C41, char C42>
3313struct tpl_char_switch<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25, C26, C27, C28, C29, C30, C31, C32, C33, C34, C35, C36, C37, C38, C39, C40, C41, C42>
3314{
3315 template <typename F, typename Fail, typename...Args>
3316 constexpr void operator()(char c, Fail const fail, Args&&...args) const
3317 {
3318 switch(c)
3319 {
3320 case C0:
3321 typename F::template apply<C0>::type{}(args...);
3322 break;
3323 case C1:
3324 typename F::template apply<C1>::type{}(args...);
3325 break;
3326 case C2:
3327 typename F::template apply<C2>::type{}(args...);
3328 break;
3329 case C3:
3330 typename F::template apply<C3>::type{}(args...);
3331 break;
3332 case C4:
3333 typename F::template apply<C4>::type{}(args...);
3334 break;
3335 case C5:
3336 typename F::template apply<C5>::type{}(args...);
3337 break;
3338 case C6:
3339 typename F::template apply<C6>::type{}(args...);
3340 break;
3341 case C7:
3342 typename F::template apply<C7>::type{}(args...);
3343 break;
3344 case C8:
3345 typename F::template apply<C8>::type{}(args...);
3346 break;
3347 case C9:
3348 typename F::template apply<C9>::type{}(args...);
3349 break;
3350 case C10:
3351 typename F::template apply<C10>::type{}(args...);
3352 break;
3353 case C11:
3354 typename F::template apply<C11>::type{}(args...);
3355 break;
3356 case C12:
3357 typename F::template apply<C12>::type{}(args...);
3358 break;
3359 case C13:
3360 typename F::template apply<C13>::type{}(args...);
3361 break;
3362 case C14:
3363 typename F::template apply<C14>::type{}(args...);
3364 break;
3365 case C15:
3366 typename F::template apply<C15>::type{}(args...);
3367 break;
3368 case C16:
3369 typename F::template apply<C16>::type{}(args...);
3370 break;
3371 case C17:
3372 typename F::template apply<C17>::type{}(args...);
3373 break;
3374 case C18:
3375 typename F::template apply<C18>::type{}(args...);
3376 break;
3377 case C19:
3378 typename F::template apply<C19>::type{}(args...);
3379 break;
3380 case C20:
3381 typename F::template apply<C20>::type{}(args...);
3382 break;
3383 case C21:
3384 typename F::template apply<C21>::type{}(args...);
3385 break;
3386 case C22:
3387 typename F::template apply<C22>::type{}(args...);
3388 break;
3389 case C23:
3390 typename F::template apply<C23>::type{}(args...);
3391 break;
3392 case C24:
3393 typename F::template apply<C24>::type{}(args...);
3394 break;
3395 case C25:
3396 typename F::template apply<C25>::type{}(args...);
3397 break;
3398 case C26:
3399 typename F::template apply<C26>::type{}(args...);
3400 break;
3401 case C27:
3402 typename F::template apply<C27>::type{}(args...);
3403 break;
3404 case C28:
3405 typename F::template apply<C28>::type{}(args...);
3406 break;
3407 case C29:
3408 typename F::template apply<C29>::type{}(args...);
3409 break;
3410 case C30:
3411 typename F::template apply<C30>::type{}(args...);
3412 break;
3413 case C31:
3414 typename F::template apply<C31>::type{}(args...);
3415 break;
3416 case C32:
3417 typename F::template apply<C32>::type{}(args...);
3418 break;
3419 case C33:
3420 typename F::template apply<C33>::type{}(args...);
3421 break;
3422 case C34:
3423 typename F::template apply<C34>::type{}(args...);
3424 break;
3425 case C35:
3426 typename F::template apply<C35>::type{}(args...);
3427 break;
3428 case C36:
3429 typename F::template apply<C36>::type{}(args...);
3430 break;
3431 case C37:
3432 typename F::template apply<C37>::type{}(args...);
3433 break;
3434 case C38:
3435 typename F::template apply<C38>::type{}(args...);
3436 break;
3437 case C39:
3438 typename F::template apply<C39>::type{}(args...);
3439 break;
3440 case C40:
3441 typename F::template apply<C40>::type{}(args...);
3442 break;
3443 case C41:
3444 typename F::template apply<C41>::type{}(args...);
3445 break;
3446 case C42:
3447 typename F::template apply<C42>::type{}(args...);
3448 break;
3449 default:
3450 fail(c);
3451 };
3452 }
3453};
3454
3455template <char C0, char C1, char C2, char C3, char C4, char C5, char C6, char C7, char C8, char C9, char C10, char C11, char C12, char C13, char C14, char C15, char C16, char C17, char C18, char C19, char C20, char C21, char C22, char C23, char C24, char C25, char C26, char C27, char C28, char C29, char C30, char C31, char C32, char C33, char C34, char C35, char C36, char C37, char C38, char C39, char C40, char C41, char C42, char C43>
3456struct tpl_char_switch<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25, C26, C27, C28, C29, C30, C31, C32, C33, C34, C35, C36, C37, C38, C39, C40, C41, C42, C43>
3457{
3458 template <typename F, typename Fail, typename...Args>
3459 constexpr void operator()(char c, Fail const fail, Args&&...args) const
3460 {
3461 switch(c)
3462 {
3463 case C0:
3464 typename F::template apply<C0>::type{}(args...);
3465 break;
3466 case C1:
3467 typename F::template apply<C1>::type{}(args...);
3468 break;
3469 case C2:
3470 typename F::template apply<C2>::type{}(args...);
3471 break;
3472 case C3:
3473 typename F::template apply<C3>::type{}(args...);
3474 break;
3475 case C4:
3476 typename F::template apply<C4>::type{}(args...);
3477 break;
3478 case C5:
3479 typename F::template apply<C5>::type{}(args...);
3480 break;
3481 case C6:
3482 typename F::template apply<C6>::type{}(args...);
3483 break;
3484 case C7:
3485 typename F::template apply<C7>::type{}(args...);
3486 break;
3487 case C8:
3488 typename F::template apply<C8>::type{}(args...);
3489 break;
3490 case C9:
3491 typename F::template apply<C9>::type{}(args...);
3492 break;
3493 case C10:
3494 typename F::template apply<C10>::type{}(args...);
3495 break;
3496 case C11:
3497 typename F::template apply<C11>::type{}(args...);
3498 break;
3499 case C12:
3500 typename F::template apply<C12>::type{}(args...);
3501 break;
3502 case C13:
3503 typename F::template apply<C13>::type{}(args...);
3504 break;
3505 case C14:
3506 typename F::template apply<C14>::type{}(args...);
3507 break;
3508 case C15:
3509 typename F::template apply<C15>::type{}(args...);
3510 break;
3511 case C16:
3512 typename F::template apply<C16>::type{}(args...);
3513 break;
3514 case C17:
3515 typename F::template apply<C17>::type{}(args...);
3516 break;
3517 case C18:
3518 typename F::template apply<C18>::type{}(args...);
3519 break;
3520 case C19:
3521 typename F::template apply<C19>::type{}(args...);
3522 break;
3523 case C20:
3524 typename F::template apply<C20>::type{}(args...);
3525 break;
3526 case C21:
3527 typename F::template apply<C21>::type{}(args...);
3528 break;
3529 case C22:
3530 typename F::template apply<C22>::type{}(args...);
3531 break;
3532 case C23:
3533 typename F::template apply<C23>::type{}(args...);
3534 break;
3535 case C24:
3536 typename F::template apply<C24>::type{}(args...);
3537 break;
3538 case C25:
3539 typename F::template apply<C25>::type{}(args...);
3540 break;
3541 case C26:
3542 typename F::template apply<C26>::type{}(args...);
3543 break;
3544 case C27:
3545 typename F::template apply<C27>::type{}(args...);
3546 break;
3547 case C28:
3548 typename F::template apply<C28>::type{}(args...);
3549 break;
3550 case C29:
3551 typename F::template apply<C29>::type{}(args...);
3552 break;
3553 case C30:
3554 typename F::template apply<C30>::type{}(args...);
3555 break;
3556 case C31:
3557 typename F::template apply<C31>::type{}(args...);
3558 break;
3559 case C32:
3560 typename F::template apply<C32>::type{}(args...);
3561 break;
3562 case C33:
3563 typename F::template apply<C33>::type{}(args...);
3564 break;
3565 case C34:
3566 typename F::template apply<C34>::type{}(args...);
3567 break;
3568 case C35:
3569 typename F::template apply<C35>::type{}(args...);
3570 break;
3571 case C36:
3572 typename F::template apply<C36>::type{}(args...);
3573 break;
3574 case C37:
3575 typename F::template apply<C37>::type{}(args...);
3576 break;
3577 case C38:
3578 typename F::template apply<C38>::type{}(args...);
3579 break;
3580 case C39:
3581 typename F::template apply<C39>::type{}(args...);
3582 break;
3583 case C40:
3584 typename F::template apply<C40>::type{}(args...);
3585 break;
3586 case C41:
3587 typename F::template apply<C41>::type{}(args...);
3588 break;
3589 case C42:
3590 typename F::template apply<C42>::type{}(args...);
3591 break;
3592 case C43:
3593 typename F::template apply<C43>::type{}(args...);
3594 break;