// This file was generated from Parser.cpp.rl.

#line 1 "Parser.cpp.rl"
// Copyright 2015-2021 Thomas Trapp
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#include "Parser.h"

#include "hext/AppendPipe.h"
#include "hext/AttributeCapture.h"
#include "hext/AttributeCountMatch.h"
#include "hext/AttributeMatch.h"
#include "hext/BeginsWithTest.h"
#include "hext/Builtins.h"
#include "hext/Capture.h"
#include "hext/CasePipe.h"
#include "hext/ChildCountMatch.h"
#include "hext/CollapseWsPipe.h"
#include "hext/ContainsTest.h"
#include "hext/ContainsWordsTest.h"
#include "hext/EndsWithTest.h"
#include "hext/EqualsTest.h"
#include "hext/FunctionCapture.h"
#include "hext/FunctionValueMatch.h"
#include "hext/Match.h"
#include "hext/NegateMatch.h"
#include "hext/NegateTest.h"
#include "hext/NthChildMatch.h"
#include "hext/OnlyChildMatch.h"
#include "hext/PrependPipe.h"
#include "hext/RegexPipe.h"
#include "hext/RegexReplacePipe.h"
#include "hext/RegexTest.h"
#include "hext/TrimPipe.h"
#include "hext/ValueTest.h"

#include "PatternValues.h"
#include "StringUtil.h"

#include <vector>
#include <sstream>
#include <utility>
#include <algorithm>

#include <gumbo.h>


namespace hext {


/// The ragel namespace holds ragel's static data.
namespace ragel {
  /// Embed the ragel state machine.
  
#line 66 "Parser.cpp.tmp"
static const char _hext_actions[] = {
	0, 1, 2, 1, 3, 1, 4, 1, 
	5, 1, 6, 1, 7, 1, 8, 1, 
	9, 1, 10, 1, 11, 1, 12, 1, 
	13, 1, 14, 1, 15, 1, 16, 1, 
	18, 1, 20, 1, 21, 1, 22, 1, 
	23, 1, 34, 1, 35, 1, 36, 1, 
	37, 1, 38, 1, 39, 1, 40, 1, 
	41, 1, 42, 1, 43, 1, 44, 1, 
	46, 1, 47, 1, 48, 1, 49, 1, 
	50, 1, 51, 1, 52, 1, 53, 1, 
	54, 1, 55, 1, 56, 1, 57, 1, 
	58, 1, 59, 1, 60, 1, 61, 1, 
	62, 1, 63, 1, 64, 1, 65, 1, 
	75, 1, 76, 1, 77, 1, 79, 1, 
	80, 1, 81, 1, 82, 1, 83, 1, 
	84, 1, 85, 1, 86, 1, 87, 2, 
	3, 72, 2, 4, 5, 2, 6, 7, 
	2, 8, 9, 2, 10, 11, 2, 16, 
	17, 2, 19, 35, 2, 19, 81, 2, 
	24, 35, 2, 24, 81, 2, 25, 35, 
	2, 25, 81, 2, 26, 35, 2, 26, 
	81, 2, 27, 35, 2, 27, 81, 2, 
	28, 35, 2, 28, 81, 2, 29, 35, 
	2, 29, 81, 2, 30, 35, 2, 30, 
	81, 2, 31, 35, 2, 31, 81, 2, 
	32, 35, 2, 32, 81, 2, 33, 35, 
	2, 33, 81, 2, 36, 37, 2, 38, 
	39, 2, 40, 41, 2, 42, 44, 2, 
	43, 44, 2, 44, 45, 2, 75, 78, 
	2, 76, 78, 2, 77, 78, 3, 0, 
	69, 74, 3, 1, 67, 74, 3, 1, 
	68, 74, 3, 1, 70, 74, 3, 1, 
	71, 74, 3, 1, 73, 74, 3, 42, 
	44, 45, 3, 43, 44, 45, 3, 58, 
	66, 74, 3, 58, 69, 74, 3, 60, 
	66, 74, 3, 60, 69, 74, 3, 61, 
	68, 74, 3, 61, 71, 74, 3, 62, 
	68, 74, 3, 62, 71, 74, 3, 63, 
	68, 74, 3, 63, 71, 74, 3, 64, 
	68, 74, 3, 64, 71, 74, 3, 65, 
	68, 74, 3, 65, 71, 74, 4, 3, 
	72, 73, 74, 4, 44, 45, 67, 74, 
	4, 44, 45, 70, 74, 5, 42, 44, 
	45, 67, 74, 5, 42, 44, 45, 70, 
	74, 5, 43, 44, 45, 67, 74, 5, 
	43, 44, 45, 70, 74
};

static const short _hext_key_offsets[] = {
	0, 0, 1, 9, 15, 25, 26, 29, 
	30, 31, 32, 33, 34, 35, 36, 37, 
	38, 43, 44, 46, 48, 50, 56, 61, 
	62, 64, 66, 67, 68, 70, 72, 74, 
	80, 81, 83, 85, 86, 103, 105, 107, 
	112, 113, 115, 117, 118, 130, 143, 156, 
	169, 182, 195, 208, 210, 212, 214, 215, 
	216, 217, 219, 221, 222, 235, 248, 261, 
	274, 287, 300, 313, 326, 339, 352, 365, 
	378, 391, 404, 417, 430, 433, 435, 437, 
	440, 441, 444, 447, 448, 450, 452, 453, 
	455, 457, 458, 471, 484, 497, 510, 523, 
	536, 549, 551, 553, 555, 556, 557, 558, 
	560, 562, 563, 576, 589, 602, 615, 628, 
	641, 654, 657, 659, 661, 667, 671, 676, 
	678, 680, 681, 682, 683, 685, 687, 688, 
	694, 700, 701, 703, 705, 706, 708, 710, 
	711, 725, 739, 752, 765, 778, 791, 804, 
	817, 830, 843, 856, 869, 882, 895, 909, 
	911, 913, 915, 916, 917, 918, 920, 922, 
	923, 927, 929, 931, 937, 938, 940, 942, 
	943, 945, 947, 949, 955, 956, 958, 960, 
	961, 964, 966, 968, 976, 981, 989, 997, 
	998, 1000, 1002, 1003, 1005, 1007, 1008, 1009, 
	1011, 1013, 1015, 1021, 1022, 1024, 1026, 1027, 
	1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 
	1036, 1041, 1042, 1043, 1044, 1049, 1068, 1073, 
	1074, 1076, 1078, 1080, 1086, 1091, 1092, 1094, 
	1096, 1097, 1098, 1100, 1102, 1104, 1110, 1111, 
	1113, 1115, 1116, 1133, 1135, 1137, 1143, 1148, 
	1149, 1151, 1153, 1154, 1167, 1181, 1195, 1209, 
	1223, 1237, 1251, 1253, 1255, 1257, 1258, 1259, 
	1260, 1262, 1264, 1265, 1279, 1293, 1307, 1321, 
	1335, 1349, 1363, 1377, 1391, 1405, 1419, 1433, 
	1447, 1461, 1475, 1489, 1492, 1494, 1496, 1499, 
	1500, 1503, 1506, 1507, 1509, 1511, 1512, 1514, 
	1516, 1517, 1531, 1545, 1559, 1573, 1587, 1601, 
	1615, 1617, 1619, 1621, 1622, 1623, 1624, 1626, 
	1628, 1629, 1643, 1657, 1671, 1685, 1699, 1713, 
	1727, 1730, 1732, 1734, 1740, 1744, 1749, 1751, 
	1753, 1754, 1755, 1756, 1758, 1760, 1761, 1767, 
	1773, 1774, 1776, 1778, 1779, 1781, 1783, 1784, 
	1799, 1814, 1828, 1842, 1856, 1870, 1884, 1898, 
	1912, 1926, 1940, 1954, 1968, 1982, 1997, 1999, 
	2001, 2003, 2004, 2005, 2006, 2008, 2010, 2011, 
	2015, 2017, 2019, 2025, 2026, 2028, 2030, 2031, 
	2033, 2035, 2037, 2043, 2044, 2046, 2048, 2049, 
	2052, 2054, 2056, 2064, 2069, 2077, 2085, 2086, 
	2088, 2090, 2091, 2093, 2095, 2096, 2097, 2099, 
	2101, 2103, 2109, 2110, 2112, 2114, 2115, 2122, 
	2123, 2124, 2125, 2126, 2127, 2128, 2129, 2130, 
	2131, 2132, 2133, 2134, 2135, 2136, 2137, 2139, 
	2142, 2148, 2149, 2150, 2151, 2152, 2153, 2154, 
	2155, 2156, 2157, 2158, 2159, 2161, 2164, 2165, 
	2166, 2167, 2168, 2174, 2175, 2176, 2177, 2178, 
	2179, 2181, 2182, 2183, 2184, 2185, 2191, 2192, 
	2193, 2194, 2195, 2196, 2197, 2203, 2204, 2205, 
	2206, 2207, 2209, 2210, 2211, 2212, 2213, 2219, 
	2220, 2221, 2222, 2223, 2224, 2225, 2231, 2233, 
	2234, 2235, 2236, 2243, 2244, 2245, 2246, 2247, 
	2248, 2249, 2250, 2251, 2252, 2253, 2254, 2255, 
	2256, 2257, 2258, 2260, 2263, 2265, 2271, 2272, 
	2273, 2274, 2275, 2276, 2277, 2278, 2279, 2280, 
	2281, 2282, 2284, 2287, 2288, 2289, 2290, 2291, 
	2293, 2294, 2295, 2296, 2297, 2298, 2300, 2301, 
	2302, 2303, 2304, 2306, 2307, 2308, 2309, 2310, 
	2311, 2312, 2314, 2315, 2316, 2317, 2318, 2320, 
	2321, 2322, 2323, 2324, 2326, 2327, 2328, 2329, 
	2330, 2331, 2332, 2334, 2335, 2336, 2337, 2340, 
	2341, 2342, 2343, 2344, 2345, 2350, 2352, 2356, 
	2358, 2361, 2363, 2366, 2367, 2368, 2369, 2370, 
	2371, 2372, 2373, 2374, 2375, 2376, 2377, 2379, 
	2380, 2381, 2382, 2383, 2384, 2389, 2391, 2395, 
	2397, 2400, 2402, 2405, 2406, 2407, 2408, 2409, 
	2410, 2411, 2412, 2413, 2414, 2415, 2416, 2417, 
	2418, 2419, 2424, 2426, 2430, 2432, 2435, 2437, 
	2440, 2441, 2442, 2443, 2444, 2445, 2446, 2447, 
	2448, 2449, 2450, 2451, 2452, 2453, 2454, 2459, 
	2461, 2465, 2467, 2470, 2472, 2475, 2476, 2477, 
	2478, 2479, 2480, 2481, 2482, 2483, 2484, 2485, 
	2486, 2488, 2489, 2490, 2491, 2492, 2494, 2495, 
	2496, 2497, 2498, 2499, 2500, 2502, 2503, 2504, 
	2507, 2508, 2509, 2510, 2511, 2512, 2517, 2519, 
	2523, 2529, 2532, 2534, 2537, 2538, 2539, 2540, 
	2541, 2542, 2543, 2544, 2545, 2546, 2547, 2548, 
	2550, 2551, 2552, 2553, 2554, 2555, 2560, 2562, 
	2566, 2572, 2575, 2577, 2580, 2581, 2582, 2583, 
	2584, 2585, 2586, 2587, 2588, 2589, 2590, 2591, 
	2592, 2593, 2594, 2599, 2601, 2605, 2611, 2614, 
	2616, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 
	2626, 2627, 2628, 2629, 2630, 2631, 2632, 2633, 
	2638, 2640, 2644, 2650, 2653, 2655, 2658, 2659, 
	2660, 2661, 2662, 2663, 2664, 2665, 2666, 2667, 
	2668, 2669, 2671, 2672, 2673, 2674, 2675, 2681, 
	2682, 2683, 2684, 2685, 2686, 2687, 2693, 2700, 
	2707, 2721, 2726, 2727, 2736, 2743, 2750, 2757
};

static const char _hext_trans_keys[] = {
	10, 42, 43, 47, 63, 65, 90, 97, 
	122, 32, 47, 58, 62, 9, 13, 32, 
	47, 62, 64, 9, 13, 65, 90, 97, 
	122, 62, 105, 115, 116, 110, 110, 101, 
	114, 45, 104, 116, 109, 108, 36, 42, 
	58, 61, 94, 61, 34, 39, 34, 92, 
	34, 92, 32, 33, 47, 62, 9, 13, 
	32, 47, 62, 9, 13, 92, 39, 92, 
	39, 92, 92, 61, 34, 39, 34, 92, 
	34, 92, 32, 33, 47, 62, 9, 13, 
	92, 39, 92, 39, 92, 92, 34, 39, 
	95, 97, 99, 102, 112, 114, 116, 45, 
	46, 48, 57, 65, 90, 98, 122, 34, 
	92, 34, 92, 32, 47, 62, 9, 13, 
	92, 39, 92, 39, 92, 92, 32, 47, 
	62, 95, 9, 13, 45, 57, 65, 90, 
	97, 122, 32, 47, 62, 95, 112, 9, 
	13, 45, 57, 65, 90, 97, 122, 32, 
	47, 62, 95, 112, 9, 13, 45, 57, 
	65, 90, 97, 122, 32, 47, 62, 95, 
	101, 9, 13, 45, 57, 65, 90, 97, 
	122, 32, 47, 62, 95, 110, 9, 13, 
	45, 57, 65, 90, 97, 122, 32, 47, 
	62, 95, 100, 9, 13, 45, 57, 65, 
	90, 97, 122, 32, 40, 47, 62, 95, 
	9, 13, 45, 57, 65, 90, 97, 122, 
	34, 39, 34, 92, 34, 92, 41, 58, 
	92, 39, 92, 39, 92, 92, 32, 47, 
	62, 95, 111, 9, 13, 45, 57, 65, 
	90, 97, 122, 32, 47, 62, 95, 108, 
	9, 13, 45, 57, 65, 90, 97, 122, 
	32, 47, 62, 95, 108, 9, 13, 45, 
	57, 65, 90, 97, 122, 32, 47, 62, 
	95, 97, 9, 13, 45, 57, 65, 90, 
	98, 122, 32, 47, 62, 95, 112, 9, 
	13, 45, 57, 65, 90, 97, 122, 32, 
	47, 62, 95, 115, 9, 13, 45, 57, 
	65, 90, 97, 122, 32, 47, 62, 95, 
	101, 9, 13, 45, 57, 65, 90, 97, 
	122, 32, 47, 62, 95, 119, 9, 13, 
	45, 57, 65, 90, 97, 122, 32, 47, 
	62, 95, 115, 9, 13, 45, 57, 65, 
	90, 97, 122, 32, 47, 58, 62, 95, 
	9, 13, 45, 57, 65, 90, 97, 122, 
	32, 47, 62, 95, 105, 9, 13, 45, 
	57, 65, 90, 97, 122, 32, 47, 62, 
	95, 108, 9, 13, 45, 57, 65, 90, 
	97, 122, 32, 47, 62, 95, 116, 9, 
	13, 45, 57, 65, 90, 97, 122, 32, 
	47, 62, 95, 101, 9, 13, 45, 57, 
	65, 90, 97, 122, 32, 47, 62, 95, 
	114, 9, 13, 45, 57, 65, 90, 97, 
	122, 32, 40, 47, 62, 95, 9, 13, 
	45, 57, 65, 90, 97, 122, 34, 39, 
	47, 34, 92, 34, 92, 41, 99, 105, 
	58, 41, 99, 105, 41, 99, 105, 92, 
	39, 92, 39, 92, 92, 47, 92, 47, 
	92, 92, 32, 47, 62, 95, 114, 9, 
	13, 45, 57, 65, 90, 97, 122, 32, 
	47, 62, 95, 101, 9, 13, 45, 57, 
	65, 90, 97, 122, 32, 47, 62, 95, 
	112, 9, 13, 45, 57, 65, 90, 97, 
	122, 32, 47, 62, 95, 101, 9, 13, 
	45, 57, 65, 90, 97, 122, 32, 47, 
	62, 95, 110, 9, 13, 45, 57, 65, 
	90, 97, 122, 32, 47, 62, 95, 100, 
	9, 13, 45, 57, 65, 90, 97, 122, 
	32, 40, 47, 62, 95, 9, 13, 45, 
	57, 65, 90, 97, 122, 34, 39, 34, 
	92, 34, 92, 41, 58, 92, 39, 92, 
	39, 92, 92, 32, 47, 62, 95, 101, 
	9, 13, 45, 57, 65, 90, 97, 122, 
	32, 47, 62, 95, 112, 9, 13, 45, 
	57, 65, 90, 97, 122, 32, 47, 62, 
	95, 108, 9, 13, 45, 57, 65, 90, 
	97, 122, 32, 47, 62, 95, 97, 9, 
	13, 45, 57, 65, 90, 98, 122, 32, 
	47, 62, 95, 99, 9, 13, 45, 57, 
	65, 90, 97, 122, 32, 47, 62, 95, 
	101, 9, 13, 45, 57, 65, 90, 97, 
	122, 32, 40, 47, 62, 95, 9, 13, 
	45, 57, 65, 90, 97, 122, 34, 39, 
	47, 34, 92, 34, 92, 32, 44, 99, 
	105, 9, 13, 32, 44, 9, 13, 32, 
	34, 39, 9, 13, 34, 92, 34, 92, 
	41, 58, 92, 39, 92, 39, 92, 92, 
	32, 44, 99, 105, 9, 13, 32, 44, 
	99, 105, 9, 13, 92, 39, 92, 39, 
	92, 92, 47, 92, 47, 92, 92, 32, 
	47, 62, 95, 111, 114, 9, 13, 45, 
	57, 65, 90, 97, 122, 32, 47, 62, 
	95, 108, 117, 9, 13, 45, 57, 65, 
	90, 97, 122, 32, 47, 62, 95, 111, 
	9, 13, 45, 57, 65, 90, 97, 122, 
	32, 47, 62, 95, 119, 9, 13, 45, 
	57, 65, 90, 97, 122, 32, 47, 62, 
	95, 101, 9, 13, 45, 57, 65, 90, 
	97, 122, 32, 47, 62, 95, 114, 9, 
	13, 45, 57, 65, 90, 97, 122, 32, 
	47, 58, 62, 95, 9, 13, 45, 57, 
	65, 90, 97, 122, 32, 47, 62, 95, 
	112, 9, 13, 45, 57, 65, 90, 97, 
	122, 32, 47, 62, 95, 112, 9, 13, 
	45, 57, 65, 90, 97, 122, 32, 47, 
	62, 95, 101, 9, 13, 45, 57, 65, 
	90, 97, 122, 32, 47, 62, 95, 114, 
	9, 13, 45, 57, 65, 90, 97, 122, 
	32, 47, 58, 62, 95, 9, 13, 45, 
	57, 65, 90, 97, 122, 32, 47, 62, 
	95, 105, 9, 13, 45, 57, 65, 90, 
	97, 122, 32, 47, 62, 95, 109, 9, 
	13, 45, 57, 65, 90, 97, 122, 32, 
	40, 47, 58, 62, 95, 9, 13, 45, 
	57, 65, 90, 97, 122, 34, 39, 34, 
	92, 34, 92, 41, 58, 92, 39, 92, 
	39, 92, 92, 34, 39, 61, 126, 34, 
	92, 34, 92, 32, 33, 47, 62, 9, 
	13, 92, 39, 92, 39, 92, 92, 34, 
	39, 34, 92, 34, 92, 32, 33, 47, 
	62, 9, 13, 92, 39, 92, 39, 92, 
	92, 34, 39, 47, 34, 92, 34, 92, 
	32, 33, 47, 62, 99, 105, 9, 13, 
	32, 47, 62, 9, 13, 32, 33, 47, 
	62, 99, 105, 9, 13, 32, 33, 47, 
	62, 99, 105, 9, 13, 92, 39, 92, 
	39, 92, 92, 47, 92, 47, 92, 92, 
	61, 34, 39, 34, 92, 34, 92, 32, 
	33, 47, 62, 9, 13, 92, 39, 92, 
	39, 92, 92, 116, 114, 105, 112, 45, 
	116, 97, 103, 115, 36, 42, 58, 61, 
	94, 101, 120, 116, 36, 42, 58, 61, 
	94, 32, 33, 36, 42, 45, 47, 58, 
	61, 62, 94, 95, 9, 13, 48, 57, 
	65, 90, 97, 122, 32, 47, 62, 9, 
	13, 61, 34, 39, 34, 92, 34, 92, 
	32, 33, 47, 62, 9, 13, 32, 47, 
	62, 9, 13, 92, 39, 92, 39, 92, 
	92, 61, 34, 39, 34, 92, 34, 92, 
	32, 33, 47, 62, 9, 13, 92, 39, 
	92, 39, 92, 92, 34, 39, 95, 97, 
	99, 102, 112, 114, 116, 45, 46, 48, 
	57, 65, 90, 98, 122, 34, 92, 34, 
	92, 32, 47, 62, 63, 9, 13, 32, 
	47, 62, 9, 13, 92, 39, 92, 39, 
	92, 92, 32, 47, 62, 63, 95, 9, 
	13, 45, 57, 65, 90, 97, 122, 32, 
	47, 62, 63, 95, 112, 9, 13, 45, 
	57, 65, 90, 97, 122, 32, 47, 62, 
	63, 95, 112, 9, 13, 45, 57, 65, 
	90, 97, 122, 32, 47, 62, 63, 95, 
	101, 9, 13, 45, 57, 65, 90, 97, 
	122, 32, 47, 62, 63, 95, 110, 9, 
	13, 45, 57, 65, 90, 97, 122, 32, 
	47, 62, 63, 95, 100, 9, 13, 45, 
	57, 65, 90, 97, 122, 32, 40, 47, 
	62, 63, 95, 9, 13, 45, 57, 65, 
	90, 97, 122, 34, 39, 34, 92, 34, 
	92, 41, 58, 92, 39, 92, 39, 92, 
	92, 32, 47, 62, 63, 95, 111, 9, 
	13, 45, 57, 65, 90, 97, 122, 32, 
	47, 62, 63, 95, 108, 9, 13, 45, 
	57, 65, 90, 97, 122, 32, 47, 62, 
	63, 95, 108, 9, 13, 45, 57, 65, 
	90, 97, 122, 32, 47, 62, 63, 95, 
	97, 9, 13, 45, 57, 65, 90, 98, 
	122, 32, 47, 62, 63, 95, 112, 9, 
	13, 45, 57, 65, 90, 97, 122, 32, 
	47, 62, 63, 95, 115, 9, 13, 45, 
	57, 65, 90, 97, 122, 32, 47, 62, 
	63, 95, 101, 9, 13, 45, 57, 65, 
	90, 97, 122, 32, 47, 62, 63, 95, 
	119, 9, 13, 45, 57, 65, 90, 97, 
	122, 32, 47, 62, 63, 95, 115, 9, 
	13, 45, 57, 65, 90, 97, 122, 32, 
	47, 58, 62, 63, 95, 9, 13, 45, 
	57, 65, 90, 97, 122, 32, 47, 62, 
	63, 95, 105, 9, 13, 45, 57, 65, 
	90, 97, 122, 32, 47, 62, 63, 95, 
	108, 9, 13, 45, 57, 65, 90, 97, 
	122, 32, 47, 62, 63, 95, 116, 9, 
	13, 45, 57, 65, 90, 97, 122, 32, 
	47, 62, 63, 95, 101, 9, 13, 45, 
	57, 65, 90, 97, 122, 32, 47, 62, 
	63, 95, 114, 9, 13, 45, 57, 65, 
	90, 97, 122, 32, 40, 47, 62, 63, 
	95, 9, 13, 45, 57, 65, 90, 97, 
	122, 34, 39, 47, 34, 92, 34, 92, 
	41, 99, 105, 58, 41, 99, 105, 41, 
	99, 105, 92, 39, 92, 39, 92, 92, 
	47, 92, 47, 92, 92, 32, 47, 62, 
	63, 95, 114, 9, 13, 45, 57, 65, 
	90, 97, 122, 32, 47, 62, 63, 95, 
	101, 9, 13, 45, 57, 65, 90, 97, 
	122, 32, 47, 62, 63, 95, 112, 9, 
	13, 45, 57, 65, 90, 97, 122, 32, 
	47, 62, 63, 95, 101, 9, 13, 45, 
	57, 65, 90, 97, 122, 32, 47, 62, 
	63, 95, 110, 9, 13, 45, 57, 65, 
	90, 97, 122, 32, 47, 62, 63, 95, 
	100, 9, 13, 45, 57, 65, 90, 97, 
	122, 32, 40, 47, 62, 63, 95, 9, 
	13, 45, 57, 65, 90, 97, 122, 34, 
	39, 34, 92, 34, 92, 41, 58, 92, 
	39, 92, 39, 92, 92, 32, 47, 62, 
	63, 95, 101, 9, 13, 45, 57, 65, 
	90, 97, 122, 32, 47, 62, 63, 95, 
	112, 9, 13, 45, 57, 65, 90, 97, 
	122, 32, 47, 62, 63, 95, 108, 9, 
	13, 45, 57, 65, 90, 97, 122, 32, 
	47, 62, 63, 95, 97, 9, 13, 45, 
	57, 65, 90, 98, 122, 32, 47, 62, 
	63, 95, 99, 9, 13, 45, 57, 65, 
	90, 97, 122, 32, 47, 62, 63, 95, 
	101, 9, 13, 45, 57, 65, 90, 97, 
	122, 32, 40, 47, 62, 63, 95, 9, 
	13, 45, 57, 65, 90, 97, 122, 34, 
	39, 47, 34, 92, 34, 92, 32, 44, 
	99, 105, 9, 13, 32, 44, 9, 13, 
	32, 34, 39, 9, 13, 34, 92, 34, 
	92, 41, 58, 92, 39, 92, 39, 92, 
	92, 32, 44, 99, 105, 9, 13, 32, 
	44, 99, 105, 9, 13, 92, 39, 92, 
	39, 92, 92, 47, 92, 47, 92, 92, 
	32, 47, 62, 63, 95, 111, 114, 9, 
	13, 45, 57, 65, 90, 97, 122, 32, 
	47, 62, 63, 95, 108, 117, 9, 13, 
	45, 57, 65, 90, 97, 122, 32, 47, 
	62, 63, 95, 111, 9, 13, 45, 57, 
	65, 90, 97, 122, 32, 47, 62, 63, 
	95, 119, 9, 13, 45, 57, 65, 90, 
	97, 122, 32, 47, 62, 63, 95, 101, 
	9, 13, 45, 57, 65, 90, 97, 122, 
	32, 47, 62, 63, 95, 114, 9, 13, 
	45, 57, 65, 90, 97, 122, 32, 47, 
	58, 62, 63, 95, 9, 13, 45, 57, 
	65, 90, 97, 122, 32, 47, 62, 63, 
	95, 112, 9, 13, 45, 57, 65, 90, 
	97, 122, 32, 47, 62, 63, 95, 112, 
	9, 13, 45, 57, 65, 90, 97, 122, 
	32, 47, 62, 63, 95, 101, 9, 13, 
	45, 57, 65, 90, 97, 122, 32, 47, 
	62, 63, 95, 114, 9, 13, 45, 57, 
	65, 90, 97, 122, 32, 47, 58, 62, 
	63, 95, 9, 13, 45, 57, 65, 90, 
	97, 122, 32, 47, 62, 63, 95, 105, 
	9, 13, 45, 57, 65, 90, 97, 122, 
	32, 47, 62, 63, 95, 109, 9, 13, 
	45, 57, 65, 90, 97, 122, 32, 40, 
	47, 58, 62, 63, 95, 9, 13, 45, 
	57, 65, 90, 97, 122, 34, 39, 34, 
	92, 34, 92, 41, 58, 92, 39, 92, 
	39, 92, 92, 34, 39, 61, 126, 34, 
	92, 34, 92, 32, 33, 47, 62, 9, 
	13, 92, 39, 92, 39, 92, 92, 34, 
	39, 34, 92, 34, 92, 32, 33, 47, 
	62, 9, 13, 92, 39, 92, 39, 92, 
	92, 34, 39, 47, 34, 92, 34, 92, 
	32, 33, 47, 62, 99, 105, 9, 13, 
	32, 47, 62, 9, 13, 32, 33, 47, 
	62, 99, 105, 9, 13, 32, 33, 47, 
	62, 99, 105, 9, 13, 92, 39, 92, 
	39, 92, 92, 47, 92, 47, 92, 92, 
	61, 34, 39, 34, 92, 34, 92, 32, 
	33, 47, 62, 9, 13, 92, 39, 92, 
	39, 92, 92, 97, 99, 101, 102, 108, 
	110, 111, 116, 116, 114, 105, 98, 117, 
	116, 101, 45, 99, 111, 117, 110, 116, 
	40, 48, 57, 41, 48, 57, 32, 47, 
	58, 62, 9, 13, 104, 105, 108, 100, 
	45, 99, 111, 117, 110, 116, 40, 48, 
	57, 41, 48, 57, 109, 112, 116, 121, 
	32, 47, 58, 62, 9, 13, 105, 114, 
	115, 116, 45, 99, 111, 104, 105, 108, 
	100, 32, 47, 58, 62, 9, 13, 102, 
	45, 116, 121, 112, 101, 32, 47, 58, 
	62, 9, 13, 97, 115, 116, 45, 99, 
	111, 104, 105, 108, 100, 32, 47, 58, 
	62, 9, 13, 102, 45, 116, 121, 112, 
	101, 32, 47, 58, 62, 9, 13, 111, 
	116, 116, 40, 58, 97, 99, 101, 102, 
	108, 110, 111, 116, 116, 114, 105, 98, 
	117, 116, 101, 45, 99, 111, 117, 110, 
	116, 40, 48, 57, 41, 48, 57, 41, 
	58, 32, 47, 58, 62, 9, 13, 104, 
	105, 108, 100, 45, 99, 111, 117, 110, 
	116, 40, 48, 57, 41, 48, 57, 109, 
	112, 116, 121, 41, 58, 105, 114, 115, 
	116, 45, 99, 111, 104, 105, 108, 100, 
	41, 58, 102, 45, 116, 121, 112, 101, 
	41, 58, 97, 115, 116, 45, 99, 111, 
	104, 105, 108, 100, 41, 58, 102, 45, 
	116, 121, 112, 101, 41, 58, 116, 104, 
	45, 99, 108, 111, 104, 105, 108, 100, 
	40, 45, 101, 111, 48, 57, 48, 57, 
	41, 110, 48, 57, 41, 58, 41, 43, 
	45, 48, 57, 41, 48, 57, 118, 101, 
	110, 41, 100, 100, 41, 97, 115, 116, 
	45, 99, 111, 104, 105, 108, 100, 40, 
	45, 101, 111, 48, 57, 48, 57, 41, 
	110, 48, 57, 41, 58, 41, 43, 45, 
	48, 57, 41, 48, 57, 118, 101, 110, 
	41, 100, 100, 41, 102, 45, 116, 121, 
	112, 101, 40, 45, 101, 111, 48, 57, 
	48, 57, 41, 110, 48, 57, 41, 58, 
	41, 43, 45, 48, 57, 41, 48, 57, 
	118, 101, 110, 41, 100, 100, 41, 102, 
	45, 116, 121, 112, 101, 40, 45, 101, 
	111, 48, 57, 48, 57, 41, 110, 48, 
	57, 41, 58, 41, 43, 45, 48, 57, 
	41, 48, 57, 118, 101, 110, 41, 100, 
	100, 41, 110, 108, 121, 45, 99, 111, 
	104, 105, 108, 100, 41, 58, 102, 45, 
	116, 121, 112, 101, 41, 58, 104, 45, 
	99, 108, 111, 104, 105, 108, 100, 40, 
	45, 101, 111, 48, 57, 48, 57, 41, 
	110, 48, 57, 32, 47, 58, 62, 9, 
	13, 41, 43, 45, 48, 57, 41, 48, 
	57, 118, 101, 110, 41, 100, 100, 41, 
	97, 115, 116, 45, 99, 111, 104, 105, 
	108, 100, 40, 45, 101, 111, 48, 57, 
	48, 57, 41, 110, 48, 57, 32, 47, 
	58, 62, 9, 13, 41, 43, 45, 48, 
	57, 41, 48, 57, 118, 101, 110, 41, 
	100, 100, 41, 102, 45, 116, 121, 112, 
	101, 40, 45, 101, 111, 48, 57, 48, 
	57, 41, 110, 48, 57, 32, 47, 58, 
	62, 9, 13, 41, 43, 45, 48, 57, 
	41, 48, 57, 118, 101, 110, 41, 100, 
	100, 41, 102, 45, 116, 121, 112, 101, 
	40, 45, 101, 111, 48, 57, 48, 57, 
	41, 110, 48, 57, 32, 47, 58, 62, 
	9, 13, 41, 43, 45, 48, 57, 41, 
	48, 57, 118, 101, 110, 41, 100, 100, 
	41, 110, 108, 121, 45, 99, 111, 104, 
	105, 108, 100, 32, 47, 58, 62, 9, 
	13, 102, 45, 116, 121, 112, 101, 32, 
	47, 58, 62, 9, 13, 42, 43, 63, 
	65, 90, 97, 122, 42, 43, 63, 65, 
	90, 97, 122, 32, 45, 47, 58, 62, 
	95, 9, 13, 48, 57, 65, 90, 97, 
	122, 42, 65, 90, 97, 122, 62, 45, 
	62, 95, 48, 57, 65, 90, 97, 122, 
	32, 35, 60, 123, 125, 9, 13, 32, 
	35, 60, 123, 125, 9, 13, 32, 35, 
	60, 123, 125, 9, 13, 32, 35, 60, 
	123, 125, 9, 13, 0
};

static const char _hext_single_lengths[] = {
	0, 1, 4, 4, 4, 1, 3, 1, 
	1, 1, 1, 1, 1, 1, 1, 1, 
	5, 1, 2, 2, 2, 4, 3, 1, 
	2, 2, 1, 1, 2, 2, 2, 4, 
	1, 2, 2, 1, 9, 2, 2, 3, 
	1, 2, 2, 1, 4, 5, 5, 5, 
	5, 5, 5, 2, 2, 2, 1, 1, 
	1, 2, 2, 1, 5, 5, 5, 5, 
	5, 5, 5, 5, 5, 5, 5, 5, 
	5, 5, 5, 5, 3, 2, 2, 3, 
	1, 3, 3, 1, 2, 2, 1, 2, 
	2, 1, 5, 5, 5, 5, 5, 5, 
	5, 2, 2, 2, 1, 1, 1, 2, 
	2, 1, 5, 5, 5, 5, 5, 5, 
	5, 3, 2, 2, 4, 2, 3, 2, 
	2, 1, 1, 1, 2, 2, 1, 4, 
	4, 1, 2, 2, 1, 2, 2, 1, 
	6, 6, 5, 5, 5, 5, 5, 5, 
	5, 5, 5, 5, 5, 5, 6, 2, 
	2, 2, 1, 1, 1, 2, 2, 1, 
	4, 2, 2, 4, 1, 2, 2, 1, 
	2, 2, 2, 4, 1, 2, 2, 1, 
	3, 2, 2, 6, 3, 6, 6, 1, 
	2, 2, 1, 2, 2, 1, 1, 2, 
	2, 2, 4, 1, 2, 2, 1, 1, 
	1, 1, 1, 1, 1, 1, 1, 1, 
	5, 1, 1, 1, 5, 11, 3, 1, 
	2, 2, 2, 4, 3, 1, 2, 2, 
	1, 1, 2, 2, 2, 4, 1, 2, 
	2, 1, 9, 2, 2, 4, 3, 1, 
	2, 2, 1, 5, 6, 6, 6, 6, 
	6, 6, 2, 2, 2, 1, 1, 1, 
	2, 2, 1, 6, 6, 6, 6, 6, 
	6, 6, 6, 6, 6, 6, 6, 6, 
	6, 6, 6, 3, 2, 2, 3, 1, 
	3, 3, 1, 2, 2, 1, 2, 2, 
	1, 6, 6, 6, 6, 6, 6, 6, 
	2, 2, 2, 1, 1, 1, 2, 2, 
	1, 6, 6, 6, 6, 6, 6, 6, 
	3, 2, 2, 4, 2, 3, 2, 2, 
	1, 1, 1, 2, 2, 1, 4, 4, 
	1, 2, 2, 1, 2, 2, 1, 7, 
	7, 6, 6, 6, 6, 6, 6, 6, 
	6, 6, 6, 6, 6, 7, 2, 2, 
	2, 1, 1, 1, 2, 2, 1, 4, 
	2, 2, 4, 1, 2, 2, 1, 2, 
	2, 2, 4, 1, 2, 2, 1, 3, 
	2, 2, 6, 3, 6, 6, 1, 2, 
	2, 1, 2, 2, 1, 1, 2, 2, 
	2, 4, 1, 2, 2, 1, 7, 1, 
	1, 1, 1, 1, 1, 1, 1, 1, 
	1, 1, 1, 1, 1, 1, 0, 1, 
	4, 1, 1, 1, 1, 1, 1, 1, 
	1, 1, 1, 1, 0, 1, 1, 1, 
	1, 1, 4, 1, 1, 1, 1, 1, 
	2, 1, 1, 1, 1, 4, 1, 1, 
	1, 1, 1, 1, 4, 1, 1, 1, 
	1, 2, 1, 1, 1, 1, 4, 1, 
	1, 1, 1, 1, 1, 4, 2, 1, 
	1, 1, 7, 1, 1, 1, 1, 1, 
	1, 1, 1, 1, 1, 1, 1, 1, 
	1, 1, 0, 1, 2, 4, 1, 1, 
	1, 1, 1, 1, 1, 1, 1, 1, 
	1, 0, 1, 1, 1, 1, 1, 2, 
	1, 1, 1, 1, 1, 2, 1, 1, 
	1, 1, 2, 1, 1, 1, 1, 1, 
	1, 2, 1, 1, 1, 1, 2, 1, 
	1, 1, 1, 2, 1, 1, 1, 1, 
	1, 1, 2, 1, 1, 1, 3, 1, 
	1, 1, 1, 1, 3, 0, 2, 2, 
	3, 0, 1, 1, 1, 1, 1, 1, 
	1, 1, 1, 1, 1, 1, 2, 1, 
	1, 1, 1, 1, 3, 0, 2, 2, 
	3, 0, 1, 1, 1, 1, 1, 1, 
	1, 1, 1, 1, 1, 1, 1, 1, 
	1, 3, 0, 2, 2, 3, 0, 1, 
	1, 1, 1, 1, 1, 1, 1, 1, 
	1, 1, 1, 1, 1, 1, 3, 0, 
	2, 2, 3, 0, 1, 1, 1, 1, 
	1, 1, 1, 1, 1, 1, 1, 1, 
	2, 1, 1, 1, 1, 2, 1, 1, 
	1, 1, 1, 1, 2, 1, 1, 3, 
	1, 1, 1, 1, 1, 3, 0, 2, 
	4, 3, 0, 1, 1, 1, 1, 1, 
	1, 1, 1, 1, 1, 1, 1, 2, 
	1, 1, 1, 1, 1, 3, 0, 2, 
	4, 3, 0, 1, 1, 1, 1, 1, 
	1, 1, 1, 1, 1, 1, 1, 1, 
	1, 1, 3, 0, 2, 4, 3, 0, 
	1, 1, 1, 1, 1, 1, 1, 1, 
	1, 1, 1, 1, 1, 1, 1, 3, 
	0, 2, 4, 3, 0, 1, 1, 1, 
	1, 1, 1, 1, 1, 1, 1, 1, 
	1, 2, 1, 1, 1, 1, 4, 1, 
	1, 1, 1, 1, 1, 4, 3, 3, 
	6, 1, 1, 3, 5, 5, 5, 5
};

static const char _hext_range_lengths[] = {
	0, 0, 2, 1, 3, 0, 0, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 1, 1, 0, 
	0, 0, 0, 0, 0, 0, 0, 1, 
	0, 0, 0, 0, 4, 0, 0, 1, 
	0, 0, 0, 0, 4, 4, 4, 4, 
	4, 4, 4, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 4, 4, 4, 4, 
	4, 4, 4, 4, 4, 4, 4, 4, 
	4, 4, 4, 4, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	0, 0, 4, 4, 4, 4, 4, 4, 
	4, 0, 0, 0, 0, 0, 0, 0, 
	0, 0, 4, 4, 4, 4, 4, 4, 
	4, 0, 0, 0, 1, 1, 1, 0, 
	0, 0, 0, 0, 0, 0, 0, 1, 
	1, 0, 0, 0, 0, 0, 0, 0, 
	4, 4, 4, 4, 4, 4, 4, 4, 
	4, 4, 4, 4, 4, 4, 4, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	0, 0, 0, 1, 0, 0, 0, 0, 
	0, 0, 0, 1, 0, 0, 0, 0, 
	0, 0, 0, 1, 1, 1, 1, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	0, 0, 1, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 4, 1, 0, 
	0, 0, 0, 1, 1, 0, 0, 0, 
	0, 0, 0, 0, 0, 1, 0, 0, 
	0, 0, 4, 0, 0, 1, 1, 0, 
	0, 0, 0, 4, 4, 4, 4, 4, 
	4, 4, 0, 0, 0, 0, 0, 0, 
	0, 0, 0, 4, 4, 4, 4, 4, 
	4, 4, 4, 4, 4, 4, 4, 4, 
	4, 4, 4, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	0, 4, 4, 4, 4, 4, 4, 4, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	0, 4, 4, 4, 4, 4, 4, 4, 
	0, 0, 0, 1, 1, 1, 0, 0, 
	0, 0, 0, 0, 0, 0, 1, 1, 
	0, 0, 0, 0, 0, 0, 0, 4, 
	4, 4, 4, 4, 4, 4, 4, 4, 
	4, 4, 4, 4, 4, 4, 0, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	0, 0, 1, 0, 0, 0, 0, 0, 
	0, 0, 1, 0, 0, 0, 0, 0, 
	0, 0, 1, 1, 1, 1, 0, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	0, 1, 0, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 0, 1, 1, 
	1, 0, 0, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 1, 1, 0, 0, 
	0, 0, 1, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 1, 0, 0, 
	0, 0, 0, 0, 1, 0, 0, 0, 
	0, 0, 0, 0, 0, 0, 1, 0, 
	0, 0, 0, 0, 0, 1, 0, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	0, 0, 1, 1, 0, 1, 0, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	0, 1, 1, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 1, 1, 1, 0, 
	0, 1, 1, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 1, 1, 1, 0, 
	0, 1, 1, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	0, 1, 1, 1, 0, 0, 1, 1, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 0, 1, 1, 
	1, 0, 0, 1, 1, 0, 0, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 1, 1, 1, 
	1, 0, 1, 1, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 1, 1, 1, 
	1, 0, 1, 1, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	0, 0, 1, 1, 1, 1, 0, 1, 
	1, 0, 0, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 0, 0, 1, 
	1, 1, 1, 0, 1, 1, 0, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 0, 1, 0, 
	0, 0, 0, 0, 0, 1, 2, 2, 
	4, 2, 0, 3, 1, 1, 1, 1
};

static const short _hext_index_offsets[] = {
	0, 0, 2, 9, 15, 23, 25, 29, 
	31, 33, 35, 37, 39, 41, 43, 45, 
	47, 53, 55, 58, 61, 64, 70, 75, 
	77, 80, 83, 85, 87, 90, 93, 96, 
	102, 104, 107, 110, 112, 126, 129, 132, 
	137, 139, 142, 145, 147, 156, 166, 176, 
	186, 196, 206, 216, 219, 222, 225, 227, 
	229, 231, 234, 237, 239, 249, 259, 269, 
	279, 289, 299, 309, 319, 329, 339, 349, 
	359, 369, 379, 389, 399, 403, 406, 409, 
	413, 415, 419, 423, 425, 428, 431, 433, 
	436, 439, 441, 451, 461, 471, 481, 491, 
	501, 511, 514, 517, 520, 522, 524, 526, 
	529, 532, 534, 544, 554, 564, 574, 584, 
	594, 604, 608, 611, 614, 620, 624, 629, 
	632, 635, 637, 639, 641, 644, 647, 649, 
	655, 661, 663, 666, 669, 671, 674, 677, 
	679, 690, 701, 711, 721, 731, 741, 751, 
	761, 771, 781, 791, 801, 811, 821, 832, 
	835, 838, 841, 843, 845, 847, 850, 853, 
	855, 860, 863, 866, 872, 874, 877, 880, 
	882, 885, 888, 891, 897, 899, 902, 905, 
	907, 911, 914, 917, 925, 930, 938, 946, 
	948, 951, 954, 956, 959, 962, 964, 966, 
	969, 972, 975, 981, 983, 986, 989, 991, 
	993, 995, 997, 999, 1001, 1003, 1005, 1007, 
	1009, 1015, 1017, 1019, 1021, 1027, 1043, 1048, 
	1050, 1053, 1056, 1059, 1065, 1070, 1072, 1075, 
	1078, 1080, 1082, 1085, 1088, 1091, 1097, 1099, 
	1102, 1105, 1107, 1121, 1124, 1127, 1133, 1138, 
	1140, 1143, 1146, 1148, 1158, 1169, 1180, 1191, 
	1202, 1213, 1224, 1227, 1230, 1233, 1235, 1237, 
	1239, 1242, 1245, 1247, 1258, 1269, 1280, 1291, 
	1302, 1313, 1324, 1335, 1346, 1357, 1368, 1379, 
	1390, 1401, 1412, 1423, 1427, 1430, 1433, 1437, 
	1439, 1443, 1447, 1449, 1452, 1455, 1457, 1460, 
	1463, 1465, 1476, 1487, 1498, 1509, 1520, 1531, 
	1542, 1545, 1548, 1551, 1553, 1555, 1557, 1560, 
	1563, 1565, 1576, 1587, 1598, 1609, 1620, 1631, 
	1642, 1646, 1649, 1652, 1658, 1662, 1667, 1670, 
	1673, 1675, 1677, 1679, 1682, 1685, 1687, 1693, 
	1699, 1701, 1704, 1707, 1709, 1712, 1715, 1717, 
	1729, 1741, 1752, 1763, 1774, 1785, 1796, 1807, 
	1818, 1829, 1840, 1851, 1862, 1873, 1885, 1888, 
	1891, 1894, 1896, 1898, 1900, 1903, 1906, 1908, 
	1913, 1916, 1919, 1925, 1927, 1930, 1933, 1935, 
	1938, 1941, 1944, 1950, 1952, 1955, 1958, 1960, 
	1964, 1967, 1970, 1978, 1983, 1991, 1999, 2001, 
	2004, 2007, 2009, 2012, 2015, 2017, 2019, 2022, 
	2025, 2028, 2034, 2036, 2039, 2042, 2044, 2052, 
	2054, 2056, 2058, 2060, 2062, 2064, 2066, 2068, 
	2070, 2072, 2074, 2076, 2078, 2080, 2082, 2084, 
	2087, 2093, 2095, 2097, 2099, 2101, 2103, 2105, 
	2107, 2109, 2111, 2113, 2115, 2117, 2120, 2122, 
	2124, 2126, 2128, 2134, 2136, 2138, 2140, 2142, 
	2144, 2147, 2149, 2151, 2153, 2155, 2161, 2163, 
	2165, 2167, 2169, 2171, 2173, 2179, 2181, 2183, 
	2185, 2187, 2190, 2192, 2194, 2196, 2198, 2204, 
	2206, 2208, 2210, 2212, 2214, 2216, 2222, 2225, 
	2227, 2229, 2231, 2239, 2241, 2243, 2245, 2247, 
	2249, 2251, 2253, 2255, 2257, 2259, 2261, 2263, 
	2265, 2267, 2269, 2271, 2274, 2277, 2283, 2285, 
	2287, 2289, 2291, 2293, 2295, 2297, 2299, 2301, 
	2303, 2305, 2307, 2310, 2312, 2314, 2316, 2318, 
	2321, 2323, 2325, 2327, 2329, 2331, 2334, 2336, 
	2338, 2340, 2342, 2345, 2347, 2349, 2351, 2353, 
	2355, 2357, 2360, 2362, 2364, 2366, 2368, 2371, 
	2373, 2375, 2377, 2379, 2382, 2384, 2386, 2388, 
	2390, 2392, 2394, 2397, 2399, 2401, 2403, 2407, 
	2409, 2411, 2413, 2415, 2417, 2422, 2424, 2428, 
	2431, 2435, 2437, 2440, 2442, 2444, 2446, 2448, 
	2450, 2452, 2454, 2456, 2458, 2460, 2462, 2465, 
	2467, 2469, 2471, 2473, 2475, 2480, 2482, 2486, 
	2489, 2493, 2495, 2498, 2500, 2502, 2504, 2506, 
	2508, 2510, 2512, 2514, 2516, 2518, 2520, 2522, 
	2524, 2526, 2531, 2533, 2537, 2540, 2544, 2546, 
	2549, 2551, 2553, 2555, 2557, 2559, 2561, 2563, 
	2565, 2567, 2569, 2571, 2573, 2575, 2577, 2582, 
	2584, 2588, 2591, 2595, 2597, 2600, 2602, 2604, 
	2606, 2608, 2610, 2612, 2614, 2616, 2618, 2620, 
	2622, 2625, 2627, 2629, 2631, 2633, 2636, 2638, 
	2640, 2642, 2644, 2646, 2648, 2651, 2653, 2655, 
	2659, 2661, 2663, 2665, 2667, 2669, 2674, 2676, 
	2680, 2686, 2690, 2692, 2695, 2697, 2699, 2701, 
	2703, 2705, 2707, 2709, 2711, 2713, 2715, 2717, 
	2720, 2722, 2724, 2726, 2728, 2730, 2735, 2737, 
	2741, 2747, 2751, 2753, 2756, 2758, 2760, 2762, 
	2764, 2766, 2768, 2770, 2772, 2774, 2776, 2778, 
	2780, 2782, 2784, 2789, 2791, 2795, 2801, 2805, 
	2807, 2810, 2812, 2814, 2816, 2818, 2820, 2822, 
	2824, 2826, 2828, 2830, 2832, 2834, 2836, 2838, 
	2843, 2845, 2849, 2855, 2859, 2861, 2864, 2866, 
	2868, 2870, 2872, 2874, 2876, 2878, 2880, 2882, 
	2884, 2886, 2889, 2891, 2893, 2895, 2897, 2903, 
	2905, 2907, 2909, 2911, 2913, 2915, 2921, 2927, 
	2933, 2944, 2948, 2950, 2957, 2964, 2971, 2978
};

static const short _hext_indicies[] = {
	1, 0, 3, 4, 5, 6, 7, 7, 
	2, 8, 9, 10, 11, 8, 2, 12, 
	13, 1, 14, 12, 15, 15, 2, 16, 
	2, 17, 18, 19, 2, 20, 2, 21, 
	2, 22, 2, 23, 2, 24, 2, 25, 
	2, 26, 2, 27, 2, 28, 2, 29, 
	30, 31, 32, 33, 2, 34, 2, 35, 
	36, 2, 38, 39, 37, 41, 42, 40, 
	43, 44, 45, 46, 43, 2, 47, 48, 
	49, 47, 2, 42, 40, 51, 52, 50, 
	54, 55, 53, 55, 53, 56, 2, 57, 
	58, 2, 60, 61, 59, 63, 64, 62, 
	65, 66, 67, 68, 65, 2, 64, 62, 
	70, 71, 69, 73, 74, 72, 74, 72, 
	75, 76, 77, 78, 79, 80, 81, 82, 
	83, 77, 77, 77, 77, 2, 85, 86, 
	84, 88, 89, 87, 90, 91, 92, 90, 
	2, 89, 87, 94, 95, 93, 97, 98, 
	96, 98, 96, 99, 101, 102, 100, 99, 
	100, 100, 100, 2, 99, 101, 102, 100, 
	103, 99, 100, 100, 100, 2, 99, 101, 
	102, 100, 104, 99, 100, 100, 100, 2, 
	99, 101, 102, 100, 105, 99, 100, 100, 
	100, 2, 99, 101, 102, 100, 106, 99, 
	100, 100, 100, 2, 99, 101, 102, 100, 
	107, 99, 100, 100, 100, 2, 99, 108, 
	101, 102, 100, 99, 100, 100, 100, 2, 
	109, 110, 2, 112, 113, 111, 115, 116, 
	114, 117, 2, 118, 2, 116, 114, 120, 
	121, 119, 123, 124, 122, 124, 122, 99, 
	101, 102, 100, 125, 99, 100, 100, 100, 
	2, 99, 101, 102, 100, 126, 99, 100, 
	100, 100, 2, 99, 101, 102, 100, 127, 
	99, 100, 100, 100, 2, 99, 101, 102, 
	100, 128, 99, 100, 100, 100, 2, 99, 
	101, 102, 100, 129, 99, 100, 100, 100, 
	2, 99, 101, 102, 100, 130, 99, 100, 
	100, 100, 2, 99, 101, 102, 100, 131, 
	99, 100, 100, 100, 2, 99, 101, 102, 
	100, 132, 99, 100, 100, 100, 2, 99, 
	101, 102, 100, 133, 99, 100, 100, 100, 
	2, 99, 101, 134, 102, 100, 99, 100, 
	100, 100, 2, 99, 101, 102, 100, 135, 
	99, 100, 100, 100, 2, 99, 101, 102, 
	100, 136, 99, 100, 100, 100, 2, 99, 
	101, 102, 100, 137, 99, 100, 100, 100, 
	2, 99, 101, 102, 100, 138, 99, 100, 
	100, 100, 2, 99, 101, 102, 100, 139, 
	99, 100, 100, 100, 2, 99, 140, 101, 
	102, 100, 99, 100, 100, 100, 2, 141, 
	142, 143, 2, 145, 146, 144, 148, 149, 
	147, 150, 151, 152, 2, 153, 2, 154, 
	155, 156, 2, 157, 158, 159, 2, 149, 
	147, 161, 162, 160, 164, 165, 163, 165, 
	163, 167, 168, 166, 170, 171, 169, 171, 
	169, 99, 101, 102, 100, 172, 99, 100, 
	100, 100, 2, 99, 101, 102, 100, 173, 
	99, 100, 100, 100, 2, 99, 101, 102, 
	100, 174, 99, 100, 100, 100, 2, 99, 
	101, 102, 100, 175, 99, 100, 100, 100, 
	2, 99, 101, 102, 100, 176, 99, 100, 
	100, 100, 2, 99, 101, 102, 100, 177, 
	99, 100, 100, 100, 2, 99, 178, 101, 
	102, 100, 99, 100, 100, 100, 2, 179, 
	180, 2, 182, 183, 181, 185, 186, 184, 
	187, 2, 188, 2, 186, 184, 190, 191, 
	189, 193, 194, 192, 194, 192, 99, 101, 
	102, 100, 195, 99, 100, 100, 100, 2, 
	99, 101, 102, 100, 196, 99, 100, 100, 
	100, 2, 99, 101, 102, 100, 197, 99, 
	100, 100, 100, 2, 99, 101, 102, 100, 
	198, 99, 100, 100, 100, 2, 99, 101, 
	102, 100, 199, 99, 100, 100, 100, 2, 
	99, 101, 102, 100, 200, 99, 100, 100, 
	100, 2, 99, 201, 101, 102, 100, 99, 
	100, 100, 100, 2, 202, 203, 204, 2, 
	206, 207, 205, 209, 210, 208, 211, 212, 
	213, 214, 211, 2, 215, 216, 215, 2, 
	216, 217, 218, 216, 2, 220, 221, 219, 
	223, 224, 222, 225, 2, 226, 2, 224, 
	222, 228, 229, 227, 231, 232, 230, 232, 
	230, 233, 234, 235, 236, 233, 2, 237, 
	238, 239, 240, 237, 2, 210, 208, 242, 
	243, 241, 245, 246, 244, 246, 244, 248, 
	249, 247, 251, 252, 250, 252, 250, 99, 
	101, 102, 100, 253, 254, 99, 100, 100, 
	100, 2, 99, 101, 102, 100, 255, 256, 
	99, 100, 100, 100, 2, 99, 101, 102, 
	100, 257, 99, 100, 100, 100, 2, 99, 
	101, 102, 100, 258, 99, 100, 100, 100, 
	2, 99, 101, 102, 100, 259, 99, 100, 
	100, 100, 2, 99, 101, 102, 100, 260, 
	99, 100, 100, 100, 2, 99, 101, 261, 
	102, 100, 99, 100, 100, 100, 2, 99, 
	101, 102, 100, 262, 99, 100, 100, 100, 
	2, 99, 101, 102, 100, 263, 99, 100, 
	100, 100, 2, 99, 101, 102, 100, 264, 
	99, 100, 100, 100, 2, 99, 101, 102, 
	100, 265, 99, 100, 100, 100, 2, 99, 
	101, 266, 102, 100, 99, 100, 100, 100, 
	2, 99, 101, 102, 100, 267, 99, 100, 
	100, 100, 2, 99, 101, 102, 100, 268, 
	99, 100, 100, 100, 2, 99, 269, 101, 
	270, 102, 100, 99, 100, 100, 100, 2, 
	271, 272, 2, 274, 275, 273, 277, 278, 
	276, 279, 2, 280, 2, 278, 276, 282, 
	283, 281, 285, 286, 284, 286, 284, 287, 
	288, 289, 290, 2, 292, 293, 291, 295, 
	296, 294, 297, 298, 299, 300, 297, 2, 
	296, 294, 302, 303, 301, 305, 306, 304, 
	306, 304, 307, 308, 2, 310, 311, 309, 
	313, 314, 312, 315, 316, 317, 318, 315, 
	2, 314, 312, 320, 321, 319, 323, 324, 
	322, 324, 322, 325, 326, 327, 2, 329, 
	330, 328, 332, 333, 331, 334, 335, 336, 
	337, 338, 339, 334, 2, 340, 341, 342, 
	340, 2, 343, 344, 345, 346, 347, 348, 
	343, 2, 349, 350, 351, 352, 353, 354, 
	349, 2, 333, 331, 356, 357, 355, 359, 
	360, 358, 360, 358, 362, 363, 361, 365, 
	366, 364, 366, 364, 367, 2, 368, 369, 
	2, 371, 372, 370, 374, 375, 373, 376, 
	377, 378, 379, 376, 2, 375, 373, 381, 
	382, 380, 384, 385, 383, 385, 383, 386, 
	2, 387, 2, 388, 2, 389, 2, 390, 
	2, 391, 2, 392, 2, 393, 2, 394, 
	2, 395, 396, 397, 398, 399, 2, 400, 
	2, 401, 2, 402, 2, 403, 404, 405, 
	406, 407, 2, 408, 409, 410, 411, 412, 
	413, 414, 415, 416, 417, 412, 408, 412, 
	412, 412, 2, 418, 419, 420, 418, 2, 
	421, 2, 422, 423, 2, 425, 426, 424, 
	428, 429, 427, 430, 431, 432, 433, 430, 
	2, 434, 435, 436, 434, 2, 429, 427, 
	438, 439, 437, 441, 442, 440, 442, 440, 
	443, 2, 444, 445, 2, 447, 448, 446, 
	450, 451, 449, 452, 453, 454, 455, 452, 
	2, 451, 449, 457, 458, 456, 460, 461, 
	459, 461, 459, 462, 463, 464, 465, 466, 
	467, 468, 469, 470, 464, 464, 464, 464, 
	2, 472, 473, 471, 475, 476, 474, 477, 
	478, 479, 480, 477, 2, 481, 482, 483, 
	481, 2, 476, 474, 485, 486, 484, 488, 
	489, 487, 489, 487, 490, 492, 493, 494, 
	491, 490, 491, 491, 491, 2, 490, 492, 
	493, 494, 491, 495, 490, 491, 491, 491, 
	2, 490, 492, 493, 494, 491, 496, 490, 
	491, 491, 491, 2, 490, 492, 493, 494, 
	491, 497, 490, 491, 491, 491, 2, 490, 
	492, 493, 494, 491, 498, 490, 491, 491, 
	491, 2, 490, 492, 493, 494, 491, 499, 
	490, 491, 491, 491, 2, 490, 500, 492, 
	493, 494, 491, 490, 491, 491, 491, 2, 
	501, 502, 2, 504, 505, 503, 507, 508, 
	506, 509, 2, 510, 2, 508, 506, 512, 
	513, 511, 515, 516, 514, 516, 514, 490, 
	492, 493, 494, 491, 517, 490, 491, 491, 
	491, 2, 490, 492, 493, 494, 491, 518, 
	490, 491, 491, 491, 2, 490, 492, 493, 
	494, 491, 519, 490, 491, 491, 491, 2, 
	490, 492, 493, 494, 491, 520, 490, 491, 
	491, 491, 2, 490, 492, 493, 494, 491, 
	521, 490, 491, 491, 491, 2, 490, 492, 
	493, 494, 491, 522, 490, 491, 491, 491, 
	2, 490, 492, 493, 494, 491, 523, 490, 
	491, 491, 491, 2, 490, 492, 493, 494, 
	491, 524, 490, 491, 491, 491, 2, 490, 
	492, 493, 494, 491, 525, 490, 491, 491, 
	491, 2, 490, 492, 526, 493, 494, 491, 
	490, 491, 491, 491, 2, 490, 492, 493, 
	494, 491, 527, 490, 491, 491, 491, 2, 
	490, 492, 493, 494, 491, 528, 490, 491, 
	491, 491, 2, 490, 492, 493, 494, 491, 
	529, 490, 491, 491, 491, 2, 490, 492, 
	493, 494, 491, 530, 490, 491, 491, 491, 
	2, 490, 492, 493, 494, 491, 531, 490, 
	491, 491, 491, 2, 490, 532, 492, 493, 
	494, 491, 490, 491, 491, 491, 2, 533, 
	534, 535, 2, 537, 538, 536, 540, 541, 
	539, 542, 543, 544, 2, 545, 2, 546, 
	547, 548, 2, 549, 550, 551, 2, 541, 
	539, 553, 554, 552, 556, 557, 555, 557, 
	555, 559, 560, 558, 562, 563, 561, 563, 
	561, 490, 492, 493, 494, 491, 564, 490, 
	491, 491, 491, 2, 490, 492, 493, 494, 
	491, 565, 490, 491, 491, 491, 2, 490, 
	492, 493, 494, 491, 566, 490, 491, 491, 
	491, 2, 490, 492, 493, 494, 491, 567, 
	490, 491, 491, 491, 2, 490, 492, 493, 
	494, 491, 568, 490, 491, 491, 491, 2, 
	490, 492, 493, 494, 491, 569, 490, 491, 
	491, 491, 2, 490, 570, 492, 493, 494, 
	491, 490, 491, 491, 491, 2, 571, 572, 
	2, 574, 575, 573, 577, 578, 576, 579, 
	2, 580, 2, 578, 576, 582, 583, 581, 
	585, 586, 584, 586, 584, 490, 492, 493, 
	494, 491, 587, 490, 491, 491, 491, 2, 
	490, 492, 493, 494, 491, 588, 490, 491, 
	491, 491, 2, 490, 492, 493, 494, 491, 
	589, 490, 491, 491, 491, 2, 490, 492, 
	493, 494, 491, 590, 490, 491, 491, 491, 
	2, 490, 492, 493, 494, 491, 591, 490, 
	491, 491, 491, 2, 490, 492, 493, 494, 
	491, 592, 490, 491, 491, 491, 2, 490, 
	593, 492, 493, 494, 491, 490, 491, 491, 
	491, 2, 594, 595, 596, 2, 598, 599, 
	597, 601, 602, 600, 603, 604, 605, 606, 
	603, 2, 607, 608, 607, 2, 608, 609, 
	610, 608, 2, 612, 613, 611, 615, 616, 
	614, 617, 2, 618, 2, 616, 614, 620, 
	621, 619, 623, 624, 622, 624, 622, 625, 
	626, 627, 628, 625, 2, 629, 630, 631, 
	632, 629, 2, 602, 600, 634, 635, 633, 
	637, 638, 636, 638, 636, 640, 641, 639, 
	643, 644, 642, 644, 642, 490, 492, 493, 
	494, 491, 645, 646, 490, 491, 491, 491, 
	2, 490, 492, 493, 494, 491, 647, 648, 
	490, 491, 491, 491, 2, 490, 492, 493, 
	494, 491, 649, 490, 491, 491, 491, 2, 
	490, 492, 493, 494, 491, 650, 490, 491, 
	491, 491, 2, 490, 492, 493, 494, 491, 
	651, 490, 491, 491, 491, 2, 490, 492, 
	493, 494, 491, 652, 490, 491, 491, 491, 
	2, 490, 492, 653, 493, 494, 491, 490, 
	491, 491, 491, 2, 490, 492, 493, 494, 
	491, 654, 490, 491, 491, 491, 2, 490, 
	492, 493, 494, 491, 655, 490, 491, 491, 
	491, 2, 490, 492, 493, 494, 491, 656, 
	490, 491, 491, 491, 2, 490, 492, 493, 
	494, 491, 657, 490, 491, 491, 491, 2, 
	490, 492, 658, 493, 494, 491, 490, 491, 
	491, 491, 2, 490, 492, 493, 494, 491, 
	659, 490, 491, 491, 491, 2, 490, 492, 
	493, 494, 491, 660, 490, 491, 491, 491, 
	2, 490, 661, 492, 662, 493, 494, 491, 
	490, 491, 491, 491, 2, 663, 664, 2, 
	666, 667, 665, 669, 670, 668, 671, 2, 
	672, 2, 670, 668, 674, 675, 673, 677, 
	678, 676, 678, 676, 679, 680, 681, 682, 
	2, 684, 685, 683, 687, 688, 686, 689, 
	690, 691, 692, 689, 2, 688, 686, 694, 
	695, 693, 697, 698, 696, 698, 696, 699, 
	700, 2, 702, 703, 701, 705, 706, 704, 
	707, 708, 709, 710, 707, 2, 706, 704, 
	712, 713, 711, 715, 716, 714, 716, 714, 
	717, 718, 719, 2, 721, 722, 720, 724, 
	725, 723, 726, 727, 728, 729, 730, 731, 
	726, 2, 732, 733, 734, 732, 2, 735, 
	736, 737, 738, 739, 740, 735, 2, 741, 
	742, 743, 744, 745, 746, 741, 2, 725, 
	723, 748, 749, 747, 751, 752, 750, 752, 
	750, 754, 755, 753, 757, 758, 756, 758, 
	756, 759, 2, 760, 761, 2, 763, 764, 
	762, 766, 767, 765, 768, 769, 770, 771, 
	768, 2, 767, 765, 773, 774, 772, 776, 
	777, 775, 777, 775, 778, 779, 780, 781, 
	782, 783, 784, 2, 785, 2, 786, 2, 
	787, 2, 788, 2, 789, 2, 790, 2, 
	791, 2, 792, 2, 793, 2, 794, 2, 
	795, 2, 796, 2, 797, 2, 798, 2, 
	799, 2, 800, 2, 801, 802, 2, 803, 
	804, 805, 806, 803, 2, 807, 2, 808, 
	2, 809, 2, 810, 2, 811, 2, 812, 
	2, 813, 2, 814, 2, 815, 2, 816, 
	2, 817, 2, 818, 2, 819, 820, 2, 
	821, 2, 822, 2, 823, 2, 824, 2, 
	825, 826, 827, 828, 825, 2, 829, 2, 
	830, 2, 831, 2, 832, 2, 833, 2, 
	834, 835, 2, 836, 2, 837, 2, 838, 
	2, 839, 2, 840, 841, 842, 843, 840, 
	2, 844, 2, 845, 2, 846, 2, 847, 
	2, 848, 2, 849, 2, 850, 851, 852, 
	853, 850, 2, 854, 2, 855, 2, 856, 
	2, 857, 2, 858, 859, 2, 860, 2, 
	861, 2, 862, 2, 863, 2, 864, 865, 
	866, 867, 864, 2, 868, 2, 869, 2, 
	870, 2, 871, 2, 872, 2, 873, 2, 
	874, 875, 876, 877, 874, 2, 878, 879, 
	2, 880, 2, 881, 2, 882, 2, 883, 
	884, 885, 886, 887, 888, 889, 2, 890, 
	2, 891, 2, 892, 2, 893, 2, 894, 
	2, 895, 2, 896, 2, 897, 2, 898, 
	2, 899, 2, 900, 2, 901, 2, 902, 
	2, 903, 2, 904, 2, 905, 2, 906, 
	907, 2, 908, 909, 2, 910, 911, 912, 
	913, 910, 2, 914, 2, 915, 2, 916, 
	2, 917, 2, 918, 2, 919, 2, 920, 
	2, 921, 2, 922, 2, 923, 2, 924, 
	2, 925, 2, 926, 927, 2, 928, 2, 
	929, 2, 930, 2, 931, 2, 932, 933, 
	2, 934, 2, 935, 2, 936, 2, 937, 
	2, 938, 2, 939, 940, 2, 941, 2, 
	942, 2, 943, 2, 944, 2, 945, 946, 
	2, 947, 2, 948, 2, 949, 2, 950, 
	2, 951, 2, 952, 2, 953, 954, 2, 
	955, 2, 956, 2, 957, 2, 958, 2, 
	959, 960, 2, 961, 2, 962, 2, 963, 
	2, 964, 2, 965, 966, 2, 967, 2, 
	968, 2, 969, 2, 970, 2, 971, 2, 
	972, 2, 973, 974, 2, 975, 2, 976, 
	2, 977, 2, 978, 979, 980, 2, 981, 
	2, 982, 2, 983, 2, 984, 2, 985, 
	2, 986, 988, 989, 987, 2, 990, 2, 
	991, 992, 990, 2, 993, 994, 2, 995, 
	996, 996, 2, 997, 2, 998, 997, 2, 
	999, 2, 1000, 2, 1001, 2, 1002, 2, 
	1003, 2, 1004, 2, 1005, 2, 1006, 2, 
	1007, 2, 1008, 2, 1009, 2, 1010, 1011, 
	2, 1012, 2, 1013, 2, 1014, 2, 1015, 
	2, 1016, 2, 1017, 1019, 1020, 1018, 2, 
	1021, 2, 1022, 1023, 1021, 2, 1024, 1025, 
	2, 1026, 1027, 1027, 2, 1028, 2, 1029, 
	1028, 2, 1030, 2, 1031, 2, 1032, 2, 
	1033, 2, 1034, 2, 1035, 2, 1036, 2, 
	1037, 2, 1038, 2, 1039, 2, 1040, 2, 
	1041, 2, 1042, 2, 1043, 2, 1044, 1046, 
	1047, 1045, 2, 1048, 2, 1049, 1050, 1048, 
	2, 1051, 1052, 2, 1053, 1054, 1054, 2, 
	1055, 2, 1056, 1055, 2, 1057, 2, 1058, 
	2, 1059, 2, 1060, 2, 1061, 2, 1062, 
	2, 1063, 2, 1064, 2, 1065, 2, 1066, 
	2, 1067, 2, 1068, 2, 1069, 2, 1070, 
	2, 1071, 1073, 1074, 1072, 2, 1075, 2, 
	1076, 1077, 1075, 2, 1078, 1079, 2, 1080, 
	1081, 1081, 2, 1082, 2, 1083, 1082, 2, 
	1084, 2, 1085, 2, 1086, 2, 1087, 2, 
	1088, 2, 1089, 2, 1090, 2, 1091, 2, 
	1092, 2, 1093, 2, 1094, 2, 1095, 1096, 
	2, 1097, 2, 1098, 2, 1099, 2, 1100, 
	2, 1101, 1102, 2, 1103, 2, 1104, 2, 
	1105, 2, 1106, 2, 1107, 2, 1108, 2, 
	1109, 1110, 2, 1111, 2, 1112, 2, 1113, 
	1114, 1115, 2, 1116, 2, 1117, 2, 1118, 
	2, 1119, 2, 1120, 2, 1121, 1123, 1124, 
	1122, 2, 1125, 2, 1126, 1127, 1125, 2, 
	1128, 1129, 1130, 1131, 1128, 2, 1132, 1133, 
	1133, 2, 1134, 2, 1135, 1134, 2, 1136, 
	2, 1137, 2, 1138, 2, 1139, 2, 1140, 
	2, 1141, 2, 1142, 2, 1143, 2, 1144, 
	2, 1145, 2, 1146, 2, 1147, 1148, 2, 
	1149, 2, 1150, 2, 1151, 2, 1152, 2, 
	1153, 2, 1154, 1156, 1157, 1155, 2, 1158, 
	2, 1159, 1160, 1158, 2, 1161, 1162, 1163, 
	1164, 1161, 2, 1165, 1166, 1166, 2, 1167, 
	2, 1168, 1167, 2, 1169, 2, 1170, 2, 
	1171, 2, 1172, 2, 1173, 2, 1174, 2, 
	1175, 2, 1176, 2, 1177, 2, 1178, 2, 
	1179, 2, 1180, 2, 1181, 2, 1182, 2, 
	1183, 1185, 1186, 1184, 2, 1187, 2, 1188, 
	1189, 1187, 2, 1190, 1191, 1192, 1193, 1190, 
	2, 1194, 1195, 1195, 2, 1196, 2, 1197, 
	1196, 2, 1198, 2, 1199, 2, 1200, 2, 
	1201, 2, 1202, 2, 1203, 2, 1204, 2, 
	1205, 2, 1206, 2, 1207, 2, 1208, 2, 
	1209, 2, 1210, 2, 1211, 2, 1212, 1214, 
	1215, 1213, 2, 1216, 2, 1217, 1218, 1216, 
	2, 1219, 1220, 1221, 1222, 1219, 2, 1223, 
	1224, 1224, 2, 1225, 2, 1226, 1225, 2, 
	1227, 2, 1228, 2, 1229, 2, 1230, 2, 
	1231, 2, 1232, 2, 1233, 2, 1234, 2, 
	1235, 2, 1236, 2, 1237, 2, 1238, 1239, 
	2, 1240, 2, 1241, 2, 1242, 2, 1243, 
	2, 1244, 1245, 1246, 1247, 1244, 2, 1248, 
	2, 1249, 2, 1250, 2, 1251, 2, 1252, 
	2, 1253, 2, 1254, 1255, 1256, 1257, 1254, 
	2, 1258, 1259, 1260, 1261, 1261, 2, 1262, 
	1263, 1264, 1265, 1265, 2, 8, 1266, 9, 
	10, 11, 1266, 8, 1266, 1266, 1266, 2, 
	1267, 1268, 1268, 2, 1269, 2, 1270, 1269, 
	1270, 1270, 1270, 1270, 2, 1, 0, 1271, 
	1272, 1273, 1, 2, 1274, 1275, 1276, 1277, 
	1278, 1274, 2, 1279, 1280, 1281, 1282, 1283, 
	1279, 2, 1284, 1285, 1286, 1287, 1288, 1284, 
	2, 0
};

static const short _hext_trans_targs[] = {
	1, 764, 0, 3, 758, 761, 759, 760, 
	4, 5, 398, 764, 4, 5, 6, 213, 
	765, 7, 199, 209, 8, 9, 10, 11, 
	12, 13, 14, 15, 16, 17, 27, 36, 
	160, 190, 18, 19, 24, 20, 21, 23, 
	20, 21, 23, 4, 22, 5, 764, 4, 
	5, 764, 25, 21, 26, 25, 21, 26, 
	28, 29, 33, 30, 31, 32, 30, 31, 
	32, 4, 22, 5, 764, 34, 31, 35, 
	34, 31, 35, 37, 41, 44, 45, 60, 
	70, 90, 106, 136, 38, 39, 40, 38, 
	39, 40, 4, 5, 764, 42, 39, 43, 
	42, 39, 43, 4, 44, 5, 764, 46, 
	47, 48, 49, 50, 51, 52, 57, 53, 
	54, 56, 53, 54, 56, 55, 36, 58, 
	54, 59, 58, 54, 59, 61, 62, 63, 
	64, 65, 66, 67, 68, 69, 36, 71, 
	72, 73, 74, 75, 76, 77, 84, 87, 
	78, 79, 83, 78, 79, 83, 80, 81, 
	82, 36, 80, 81, 82, 80, 81, 82, 
	85, 79, 86, 85, 79, 86, 88, 79, 
	89, 88, 79, 89, 91, 92, 93, 94, 
	95, 96, 97, 98, 103, 99, 100, 102, 
	99, 100, 102, 101, 36, 104, 100, 105, 
	104, 100, 105, 107, 108, 109, 110, 111, 
	112, 113, 114, 130, 133, 115, 116, 129, 
	115, 116, 129, 117, 118, 127, 128, 117, 
	118, 119, 124, 120, 121, 123, 120, 121, 
	123, 122, 36, 125, 121, 126, 125, 121, 
	126, 117, 118, 127, 128, 117, 118, 127, 
	128, 131, 116, 132, 131, 116, 132, 134, 
	116, 135, 134, 116, 135, 137, 148, 138, 
	143, 139, 140, 141, 142, 36, 144, 145, 
	146, 147, 36, 149, 150, 151, 36, 152, 
	157, 153, 154, 156, 153, 154, 156, 155, 
	36, 158, 154, 159, 158, 154, 159, 161, 
	165, 168, 176, 162, 163, 164, 162, 163, 
	164, 4, 22, 5, 764, 166, 163, 167, 
	166, 163, 167, 169, 173, 170, 171, 172, 
	170, 171, 172, 4, 22, 5, 764, 174, 
	171, 175, 174, 171, 175, 177, 184, 187, 
	178, 179, 183, 178, 179, 183, 4, 180, 
	5, 764, 181, 182, 4, 5, 764, 4, 
	180, 5, 764, 181, 182, 4, 180, 5, 
	764, 181, 182, 185, 179, 186, 185, 179, 
	186, 188, 179, 189, 188, 179, 189, 191, 
	192, 196, 193, 194, 195, 193, 194, 195, 
	4, 22, 5, 764, 197, 194, 198, 197, 
	194, 198, 200, 201, 202, 203, 204, 205, 
	206, 207, 208, 17, 27, 36, 160, 190, 
	210, 211, 212, 17, 27, 36, 160, 190, 
	4, 214, 215, 225, 213, 5, 234, 359, 
	764, 389, 4, 5, 764, 216, 217, 222, 
	218, 219, 221, 218, 219, 221, 4, 220, 
	5, 764, 4, 5, 764, 223, 219, 224, 
	223, 219, 224, 226, 227, 231, 228, 229, 
	230, 228, 229, 230, 4, 220, 5, 764, 
	232, 229, 233, 232, 229, 233, 235, 240, 
	243, 244, 259, 269, 289, 305, 335, 236, 
	237, 239, 236, 237, 239, 4, 5, 764, 
	238, 4, 5, 764, 241, 237, 242, 241, 
	237, 242, 4, 243, 5, 764, 238, 245, 
	246, 247, 248, 249, 250, 251, 256, 252, 
	253, 255, 252, 253, 255, 254, 234, 257, 
	253, 258, 257, 253, 258, 260, 261, 262, 
	263, 264, 265, 266, 267, 268, 234, 270, 
	271, 272, 273, 274, 275, 276, 283, 286, 
	277, 278, 282, 277, 278, 282, 279, 280, 
	281, 234, 279, 280, 281, 279, 280, 281, 
	284, 278, 285, 284, 278, 285, 287, 278, 
	288, 287, 278, 288, 290, 291, 292, 293, 
	294, 295, 296, 297, 302, 298, 299, 301, 
	298, 299, 301, 300, 234, 303, 299, 304, 
	303, 299, 304, 306, 307, 308, 309, 310, 
	311, 312, 313, 329, 332, 314, 315, 328, 
	314, 315, 328, 316, 317, 326, 327, 316, 
	317, 318, 323, 319, 320, 322, 319, 320, 
	322, 321, 234, 324, 320, 325, 324, 320, 
	325, 316, 317, 326, 327, 316, 317, 326, 
	327, 330, 315, 331, 330, 315, 331, 333, 
	315, 334, 333, 315, 334, 336, 347, 337, 
	342, 338, 339, 340, 341, 234, 343, 344, 
	345, 346, 234, 348, 349, 350, 234, 351, 
	356, 352, 353, 355, 352, 353, 355, 354, 
	234, 357, 353, 358, 357, 353, 358, 360, 
	364, 367, 375, 361, 362, 363, 361, 362, 
	363, 4, 220, 5, 764, 365, 362, 366, 
	365, 362, 366, 368, 372, 369, 370, 371, 
	369, 370, 371, 4, 220, 5, 764, 373, 
	370, 374, 373, 370, 374, 376, 383, 386, 
	377, 378, 382, 377, 378, 382, 4, 379, 
	5, 764, 380, 381, 4, 5, 764, 4, 
	379, 5, 764, 380, 381, 4, 379, 5, 
	764, 380, 381, 384, 378, 385, 384, 378, 
	385, 387, 378, 388, 387, 378, 388, 390, 
	391, 395, 392, 393, 394, 392, 393, 394, 
	4, 220, 5, 764, 396, 393, 397, 396, 
	393, 397, 399, 417, 430, 435, 453, 470, 
	741, 400, 401, 402, 403, 404, 405, 406, 
	407, 408, 409, 410, 411, 412, 413, 414, 
	415, 416, 415, 4, 5, 398, 764, 418, 
	419, 420, 421, 422, 423, 424, 425, 426, 
	427, 428, 429, 416, 429, 431, 432, 433, 
	434, 4, 5, 398, 764, 436, 437, 438, 
	439, 440, 441, 446, 442, 443, 444, 445, 
	4, 5, 398, 764, 447, 448, 449, 450, 
	451, 452, 4, 5, 398, 764, 454, 455, 
	456, 457, 458, 463, 459, 460, 461, 462, 
	4, 5, 398, 764, 464, 465, 466, 467, 
	468, 469, 4, 5, 398, 764, 471, 653, 
	472, 473, 474, 475, 494, 507, 512, 530, 
	547, 636, 476, 477, 478, 479, 480, 481, 
	482, 483, 484, 485, 486, 487, 488, 489, 
	490, 491, 492, 491, 493, 474, 4, 5, 
	398, 764, 495, 496, 497, 498, 499, 500, 
	501, 502, 503, 504, 505, 506, 492, 506, 
	508, 509, 510, 511, 493, 474, 513, 514, 
	515, 516, 517, 518, 523, 519, 520, 521, 
	522, 493, 474, 524, 525, 526, 527, 528, 
	529, 493, 474, 531, 532, 533, 534, 535, 
	540, 536, 537, 538, 539, 493, 474, 541, 
	542, 543, 544, 545, 546, 493, 474, 548, 
	549, 550, 551, 570, 615, 552, 553, 554, 
	555, 556, 557, 558, 563, 567, 558, 559, 
	560, 493, 474, 559, 561, 562, 559, 564, 
	565, 566, 559, 568, 569, 559, 571, 572, 
	573, 574, 575, 594, 576, 577, 578, 579, 
	580, 581, 582, 587, 591, 582, 583, 584, 
	493, 474, 583, 585, 586, 583, 588, 589, 
	590, 583, 592, 593, 583, 595, 596, 597, 
	598, 599, 600, 601, 602, 603, 608, 612, 
	603, 604, 605, 493, 474, 604, 606, 607, 
	604, 609, 610, 611, 604, 613, 614, 604, 
	616, 617, 618, 619, 620, 621, 622, 623, 
	624, 629, 633, 624, 625, 626, 493, 474, 
	625, 627, 628, 625, 630, 631, 632, 625, 
	634, 635, 625, 637, 638, 639, 640, 641, 
	646, 642, 643, 644, 645, 493, 474, 647, 
	648, 649, 650, 651, 652, 493, 474, 654, 
	655, 656, 675, 720, 657, 658, 659, 660, 
	661, 662, 663, 668, 672, 663, 664, 665, 
	4, 5, 398, 764, 664, 666, 667, 664, 
	669, 670, 671, 664, 673, 674, 664, 676, 
	677, 678, 679, 680, 699, 681, 682, 683, 
	684, 685, 686, 687, 692, 696, 687, 688, 
	689, 4, 5, 398, 764, 688, 690, 691, 
	688, 693, 694, 695, 688, 697, 698, 688, 
	700, 701, 702, 703, 704, 705, 706, 707, 
	708, 713, 717, 708, 709, 710, 4, 5, 
	398, 764, 709, 711, 712, 709, 714, 715, 
	716, 709, 718, 719, 709, 721, 722, 723, 
	724, 725, 726, 727, 728, 729, 734, 738, 
	729, 730, 731, 4, 5, 398, 764, 730, 
	732, 733, 730, 735, 736, 737, 730, 739, 
	740, 730, 742, 743, 744, 745, 746, 751, 
	747, 748, 749, 750, 4, 5, 398, 764, 
	752, 753, 754, 755, 756, 757, 4, 5, 
	398, 764, 3, 758, 759, 760, 3, 758, 
	759, 760, 760, 762, 763, 764, 763, 2, 
	766, 767, 764, 1, 2, 766, 767, 764, 
	1, 2, 766, 767, 764, 1, 2, 766, 
	767
};

static const short _hext_trans_actions[] = {
	0, 0, 125, 229, 103, 0, 103, 229, 
	109, 109, 109, 109, 0, 0, 0, 1, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 65, 65, 65, 
	65, 65, 0, 0, 0, 13, 136, 13, 
	0, 15, 0, 318, 101, 318, 318, 246, 
	246, 246, 17, 139, 17, 0, 19, 0, 
	0, 0, 0, 13, 136, 13, 0, 15, 
	0, 310, 99, 310, 310, 17, 139, 17, 
	0, 19, 0, 0, 0, 89, 89, 89, 
	89, 89, 89, 89, 13, 136, 13, 0, 
	15, 0, 270, 270, 270, 17, 139, 17, 
	0, 19, 0, 278, 0, 278, 278, 0, 
	0, 0, 0, 0, 0, 0, 0, 13, 
	136, 13, 0, 15, 0, 0, 81, 17, 
	139, 17, 0, 19, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 0, 73, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	53, 217, 53, 0, 55, 0, 61, 0, 
	0, 83, 223, 59, 59, 220, 57, 57, 
	49, 214, 49, 0, 51, 0, 45, 211, 
	45, 0, 47, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 13, 136, 13, 
	0, 15, 0, 0, 79, 17, 139, 17, 
	0, 19, 0, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 53, 217, 53, 
	0, 55, 0, 61, 61, 0, 0, 0, 
	0, 0, 0, 5, 130, 5, 0, 7, 
	0, 0, 85, 9, 133, 9, 0, 11, 
	0, 223, 223, 59, 59, 220, 220, 57, 
	57, 49, 214, 49, 0, 51, 0, 45, 
	211, 45, 0, 47, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 75, 0, 0, 
	0, 0, 77, 0, 0, 0, 69, 0, 
	0, 13, 136, 13, 0, 15, 0, 0, 
	71, 17, 139, 17, 0, 19, 0, 0, 
	0, 0, 0, 13, 136, 13, 0, 15, 
	0, 286, 93, 286, 286, 17, 139, 17, 
	0, 19, 0, 0, 0, 5, 130, 5, 
	0, 7, 0, 294, 95, 294, 294, 9, 
	133, 9, 0, 11, 0, 0, 0, 0, 
	53, 217, 53, 0, 55, 0, 331, 226, 
	331, 331, 0, 0, 242, 242, 242, 353, 
	266, 353, 353, 59, 59, 341, 262, 341, 
	341, 57, 57, 49, 214, 49, 0, 51, 
	0, 45, 211, 45, 0, 47, 0, 0, 
	0, 0, 13, 136, 13, 0, 15, 0, 
	302, 97, 302, 302, 17, 139, 17, 0, 
	19, 0, 0, 0, 0, 0, 0, 0, 
	0, 0, 0, 67, 67, 67, 67, 67, 
	0, 0, 0, 63, 63, 63, 63, 63, 
	326, 127, 3, 3, 0, 326, 3, 3, 
	326, 3, 258, 258, 258, 0, 0, 0, 
	13, 136, 13, 0, 15, 0, 322, 101, 
	322, 322, 254, 254, 254, 17, 139, 17, 
	0, 19, 0, 0, 0, 0, 13, 136, 
	13, 0, 15, 0, 314, 99, 314, 314, 
	17, 139, 17, 0, 19, 0, 0, 0, 
	89, 89, 89, 89, 89, 89, 89, 13, 
	136, 13, 0, 15, 0, 274, 274, 274, 
	87, 238, 238, 238, 17, 139, 17, 0, 
	19, 0, 282, 0, 282, 282, 91, 0, 
	0, 0, 0, 0, 0, 0, 0, 13, 
	136, 13, 0, 15, 0, 0, 81, 17, 
	139, 17, 0, 19, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 0, 73, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	53, 217, 53, 0, 55, 0, 61, 0, 
	0, 83, 223, 59, 59, 220, 57, 57, 
	49, 214, 49, 0, 51, 0, 45, 211, 
	45, 0, 47, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 13, 136, 13, 
	0, 15, 0, 0, 79, 17, 139, 17, 
	0, 19, 0, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 53, 217, 53, 
	0, 55, 0, 61, 61, 0, 0, 0, 
	0, 0, 0, 5, 130, 5, 0, 7, 
	0, 0, 85, 9, 133, 9, 0, 11, 
	0, 223, 223, 59, 59, 220, 220, 57, 
	57, 49, 214, 49, 0, 51, 0, 45, 
	211, 45, 0, 47, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 75, 0, 0, 
	0, 0, 77, 0, 0, 0, 69, 0, 
	0, 13, 136, 13, 0, 15, 0, 0, 
	71, 17, 139, 17, 0, 19, 0, 0, 
	0, 0, 0, 13, 136, 13, 0, 15, 
	0, 290, 93, 290, 290, 17, 139, 17, 
	0, 19, 0, 0, 0, 5, 130, 5, 
	0, 7, 0, 298, 95, 298, 298, 9, 
	133, 9, 0, 11, 0, 0, 0, 0, 
	53, 217, 53, 0, 55, 0, 336, 226, 
	336, 336, 0, 0, 250, 250, 250, 359, 
	266, 359, 359, 59, 59, 347, 262, 347, 
	347, 57, 57, 49, 214, 49, 0, 51, 
	0, 45, 211, 45, 0, 47, 0, 0, 
	0, 0, 13, 136, 13, 0, 15, 0, 
	306, 97, 306, 306, 17, 139, 17, 0, 
	19, 0, 0, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	37, 39, 0, 113, 113, 113, 113, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	0, 0, 33, 35, 0, 0, 0, 0, 
	0, 148, 148, 148, 148, 0, 0, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	172, 172, 172, 172, 0, 0, 0, 0, 
	0, 0, 178, 178, 178, 178, 0, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	184, 184, 184, 184, 0, 0, 0, 0, 
	0, 0, 190, 190, 190, 190, 0, 0, 
	0, 0, 41, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	0, 37, 39, 0, 43, 43, 111, 111, 
	111, 111, 0, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 33, 35, 0, 
	0, 0, 0, 0, 145, 145, 0, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	0, 169, 169, 0, 0, 0, 0, 0, 
	0, 175, 175, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 181, 181, 0, 
	0, 0, 0, 0, 0, 187, 187, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	0, 0, 25, 25, 0, 0, 0, 27, 
	27, 151, 151, 29, 142, 0, 31, 0, 
	0, 0, 21, 0, 0, 23, 0, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	0, 25, 25, 0, 0, 0, 27, 27, 
	157, 157, 29, 142, 0, 31, 0, 0, 
	0, 21, 0, 0, 23, 0, 0, 0, 
	0, 0, 0, 0, 25, 25, 0, 0, 
	0, 27, 27, 193, 193, 29, 142, 0, 
	31, 0, 0, 0, 21, 0, 0, 23, 
	0, 0, 0, 0, 0, 0, 0, 25, 
	25, 0, 0, 0, 27, 27, 163, 163, 
	29, 142, 0, 31, 0, 0, 0, 21, 
	0, 0, 23, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 199, 199, 0, 
	0, 0, 0, 0, 0, 205, 205, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	0, 25, 25, 0, 0, 0, 27, 27, 
	154, 154, 154, 154, 29, 142, 0, 31, 
	0, 0, 0, 21, 0, 0, 23, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	0, 0, 25, 25, 0, 0, 0, 27, 
	27, 160, 160, 160, 160, 29, 142, 0, 
	31, 0, 0, 0, 21, 0, 0, 23, 
	0, 0, 0, 0, 0, 0, 0, 25, 
	25, 0, 0, 0, 27, 27, 196, 196, 
	196, 196, 29, 142, 0, 31, 0, 0, 
	0, 21, 0, 0, 23, 0, 0, 0, 
	0, 0, 0, 0, 25, 25, 0, 0, 
	0, 27, 27, 166, 166, 166, 166, 29, 
	142, 0, 31, 0, 0, 0, 21, 0, 
	0, 23, 0, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 202, 202, 202, 202, 
	0, 0, 0, 0, 0, 0, 208, 208, 
	208, 208, 235, 107, 107, 235, 232, 105, 
	105, 232, 0, 117, 117, 119, 0, 0, 
	0, 0, 115, 115, 115, 115, 115, 121, 
	121, 121, 121, 121, 123, 123, 123, 123, 
	123
};

static const short _hext_eof_actions[] = {
	0, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 125, 125, 125, 125, 
	125, 125, 125, 125, 0, 115, 121, 123
};

static const int hext_start = 764;
static const int hext_first_final = 764;
static const int hext_error = 0;

static const int hext_en_main = 764;


#line 66 "Parser.cpp.rl"

} // namespace ragel


Parser::Parser(const char * begin, const char * end) noexcept
: stacks_()
, p_begin_(begin)
, p(begin)
, pe(end)
, eof(end)
, cs(0)
{
}

Rule Parser::parse()
{
  // Allow ragel to access its namespace.
  using namespace ragel;

  // Hide clang's warning -Wunused-const-variable.
  (void)hext_first_final;
  (void)hext_error;
  (void)hext_en_main;

  // When calling Parser::parse repeatedly, ensure we are always in a valid
  // state.
  this->p = this->p_begin_;

  // Initialize stacks with one result-stack and one work-stack.
  this->stacks_ = {{}, {}};

  // All values required to construct Matches and Captures.
  PatternValues pv;

  const char * tok_begin = nullptr;
  const char * tok_end = nullptr;
  std::string tok = "";

  // Convenience lambda to store the start of a token. Used within the hext
  // machine definition.
  auto tk_start = [this, &tok_begin, &tok_end](){
    tok_begin = this->p;
    tok_end = nullptr;
  };

  // Convenience lambda to complete a token. Used within the hext
  // machine definition.
  auto tk_stop = [this, &tok, &tok_begin, &tok_end](){
    assert(tok_begin);
    assert(this->p);
    tok_end = this->p;
    tok = std::string(
      tok_begin,
      static_cast<std::string::size_type>(std::distance(tok_begin, tok_end))
    );
  };

#ifndef _MSC_VER
  // Hide warnings generated by ragel code.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wold-style-cast"
#pragma GCC diagnostic ignored "-Wpragmas"
#pragma GCC diagnostic ignored "-Wunreachable-code-break"
#pragma GCC diagnostic ignored "-Wunknown-pragmas"
#pragma GCC diagnostic ignored "-Wswitch-default"
#ifdef __clang__
#pragma GCC diagnostic ignored "-Wreserved-identifier"
#endif
#endif
  
#line 1746 "Parser.cpp.tmp"
	{
	cs = hext_start;
	}

#line 1751 "Parser.cpp.tmp"
	{
	int _klen;
	unsigned int _trans;
	const char *_acts;
	unsigned int _nacts;
	const char *_keys;

	if ( p == pe )
		goto _test_eof;
	if ( cs == 0 )
		goto _out;
_resume:
	_keys = _hext_trans_keys + _hext_key_offsets[cs];
	_trans = _hext_index_offsets[cs];

	_klen = _hext_single_lengths[cs];
	if ( _klen > 0 ) {
		const char *_lower = _keys;
		const char *_mid;
		const char *_upper = _keys + _klen - 1;
		while (1) {
			if ( _upper < _lower )
				break;

			_mid = _lower + ((_upper-_lower) >> 1);
			if ( (*p) < *_mid )
				_upper = _mid - 1;
			else if ( (*p) > *_mid )
				_lower = _mid + 1;
			else {
				_trans += (unsigned int)(_mid - _keys);
				goto _match;
			}
		}
		_keys += _klen;
		_trans += _klen;
	}

	_klen = _hext_range_lengths[cs];
	if ( _klen > 0 ) {
		const char *_lower = _keys;
		const char *_mid;
		const char *_upper = _keys + (_klen<<1) - 2;
		while (1) {
			if ( _upper < _lower )
				break;

			_mid = _lower + (((_upper-_lower) >> 1) & ~1);
			if ( (*p) < _mid[0] )
				_upper = _mid - 2;
			else if ( (*p) > _mid[1] )
				_lower = _mid + 2;
			else {
				_trans += (unsigned int)((_mid - _keys)>>1);
				goto _match;
			}
		}
		_trans += _klen;
	}

_match:
	_trans = _hext_indicies[_trans];
	cs = _hext_trans_targs[_trans];

	if ( _hext_trans_actions[_trans] == 0 )
		goto _again;

	_acts = _hext_actions + _hext_trans_actions[_trans];
	_nacts = (unsigned int) *_acts++;
	while ( _nacts-- > 0 )
	{
		switch ( *_acts++ )
		{
	case 0:
#line 25 "hext-machine.rl"
	{ pv.optional = true; }
	break;
	case 1:
#line 29 "hext-machine.rl"
	{ pv.set_test<NegateTest>(std::move(pv.test)); }
	break;
	case 2:
#line 34 "hext-machine.rl"
	{ tk_start(); }
	break;
	case 3:
#line 35 "hext-machine.rl"
	{ tk_stop(); pv.attr_name = tok; }
	break;
	case 4:
#line 41 "hext-machine.rl"
	{ tk_start(); }
	break;
	case 5:
#line 41 "hext-machine.rl"
	{ tk_stop(); pv.literal_value = tok; }
	break;
	case 6:
#line 46 "hext-machine.rl"
	{ tk_start(); }
	break;
	case 7:
#line 46 "hext-machine.rl"
	{ tk_stop(); pv.literal_value = tok; }
	break;
	case 8:
#line 52 "hext-machine.rl"
	{ tk_start(); }
	break;
	case 9:
#line 52 "hext-machine.rl"
	{ tk_stop(); pv.literal_value = tok; }
	break;
	case 10:
#line 57 "hext-machine.rl"
	{ tk_start(); }
	break;
	case 11:
#line 57 "hext-machine.rl"
	{ tk_stop(); pv.literal_value = tok; }
	break;
	case 12:
#line 65 "hext-machine.rl"
	{ pv.nth = {2, 0}; }
	break;
	case 13:
#line 68 "hext-machine.rl"
	{ pv.nth = {2, 1}; }
	break;
	case 14:
#line 72 "hext-machine.rl"
	{ tk_start(); }
	break;
	case 15:
#line 73 "hext-machine.rl"
	{ tk_stop(); pv.nth = {0, std::stoi(tok)}; }
	break;
	case 16:
#line 76 "hext-machine.rl"
	{ pv.nth = {pv.nth.second, 0}; }
	break;
	case 17:
#line 78 "hext-machine.rl"
	{ tk_start(); }
	break;
	case 18:
#line 79 "hext-machine.rl"
	{ tk_stop(); pv.nth.second = std::stoi(tok); }
	break;
	case 19:
#line 88 "hext-machine.rl"
	{ pv.set_trait<ChildCountMatch>(0); }
	break;
	case 20:
#line 93 "hext-machine.rl"
	{ tk_start(); }
	break;
	case 21:
#line 94 "hext-machine.rl"
	{ tk_stop(); pv.set_trait<ChildCountMatch>(std::stoi(tok)); }
	break;
	case 22:
#line 100 "hext-machine.rl"
	{ tk_start(); }
	break;
	case 23:
#line 101 "hext-machine.rl"
	{ tk_stop(); pv.set_trait<AttributeCountMatch>(std::stoi(tok)); }
	break;
	case 24:
#line 106 "hext-machine.rl"
	{ pv.set_trait<NthChildMatch>(pv.nth); }
	break;
	case 25:
#line 110 "hext-machine.rl"
	{ pv.set_trait<NthChildMatch>(pv.nth, NthChildMatch::Last); }
	break;
	case 26:
#line 114 "hext-machine.rl"
	{ pv.set_trait<NthChildMatch>(pv.nth, NthChildMatch::First|NthChildMatch::OfType); }
	break;
	case 27:
#line 118 "hext-machine.rl"
	{ pv.set_trait<NthChildMatch>(0, 1); }
	break;
	case 28:
#line 122 "hext-machine.rl"
	{ pv.set_trait<NthChildMatch>(0, 1, NthChildMatch::First|NthChildMatch::OfType); }
	break;
	case 29:
#line 126 "hext-machine.rl"
	{ pv.set_trait<NthChildMatch>(0, 1, NthChildMatch::Last); }
	break;
	case 30:
#line 130 "hext-machine.rl"
	{ pv.set_trait<NthChildMatch>(0, 1, NthChildMatch::Last|NthChildMatch::OfType); }
	break;
	case 31:
#line 134 "hext-machine.rl"
	{ pv.set_trait<NthChildMatch>(pv.nth, NthChildMatch::Last|NthChildMatch::OfType); }
	break;
	case 32:
#line 137 "hext-machine.rl"
	{ pv.set_trait<OnlyChildMatch>(); }
	break;
	case 33:
#line 140 "hext-machine.rl"
	{ pv.set_trait<OnlyChildMatch>(OnlyChildMatch::OfType); }
	break;
	case 34:
#line 144 "hext-machine.rl"
	{ pv.negate = std::make_unique<NegateMatch>(); }
	break;
	case 35:
#line 147 "hext-machine.rl"
	{
       assert(pv.negate);
       pv.negate->append_match(std::move(pv.trait));
     }
	break;
	case 36:
#line 157 "hext-machine.rl"
	{ tk_start(); }
	break;
	case 37:
#line 157 "hext-machine.rl"
	{ tk_stop(); }
	break;
	case 38:
#line 159 "hext-machine.rl"
	{ tk_start(); }
	break;
	case 39:
#line 159 "hext-machine.rl"
	{ tk_stop(); }
	break;
	case 40:
#line 161 "hext-machine.rl"
	{ tk_start(); }
	break;
	case 41:
#line 161 "hext-machine.rl"
	{ tk_stop(); }
	break;
	case 42:
#line 166 "hext-machine.rl"
	{ pv.regex_flag |= boost::regex::icase; }
	break;
	case 43:
#line 169 "hext-machine.rl"
	{ pv.regex_flag |= boost::regex::collate; }
	break;
	case 44:
#line 171 "hext-machine.rl"
	{ try {
     pv.regex = boost::regex(tok, pv.regex_flag);
   }
   catch( const boost::regex_error& e ) {
     // Mark whole regex as error, including slashes and flags
     auto mark_len = static_cast<std::size_t>(this->p - tok_begin + 1);
     this->throw_regex_error(mark_len, e.code());
   }
}
	break;
	case 45:
#line 181 "hext-machine.rl"
	{ assert(pv.regex); pv.set_test<RegexTest>(*pv.regex); }
	break;
	case 46:
#line 187 "hext-machine.rl"
	{ pv.builtin = TextBuiltin; }
	break;
	case 47:
#line 189 "hext-machine.rl"
	{ pv.builtin = InnerHtmlBuiltin; }
	break;
	case 48:
#line 191 "hext-machine.rl"
	{ pv.builtin = StripTagsBuiltin; }
	break;
	case 49:
#line 199 "hext-machine.rl"
	{ pv.add_pipe<TrimPipe>(); }
	break;
	case 50:
#line 201 "hext-machine.rl"
	{ pv.add_pipe<TrimPipe>(pv.literal_value); }
	break;
	case 51:
#line 203 "hext-machine.rl"
	{ pv.add_pipe<CollapseWsPipe>(); }
	break;
	case 52:
#line 205 "hext-machine.rl"
	{ pv.add_pipe<CasePipe>(); }
	break;
	case 53:
#line 207 "hext-machine.rl"
	{ pv.add_pipe<CasePipe>(CasePipe::ToUpper); }
	break;
	case 54:
#line 209 "hext-machine.rl"
	{ pv.add_pipe<PrependPipe>(pv.literal_value); }
	break;
	case 55:
#line 211 "hext-machine.rl"
	{ pv.add_pipe<AppendPipe>(pv.literal_value); }
	break;
	case 56:
#line 213 "hext-machine.rl"
	{ pv.add_pipe<RegexPipe>(*pv.regex); }
	break;
	case 57:
#line 216 "hext-machine.rl"
	{ pv.add_pipe<RegexReplacePipe>(*pv.regex, pv.literal_value); }
	break;
	case 58:
#line 222 "hext-machine.rl"
	{ pv.cap_var = pv.literal_value; }
	break;
	case 59:
#line 224 "hext-machine.rl"
	{ tk_start(); }
	break;
	case 60:
#line 225 "hext-machine.rl"
	{ tk_stop(); pv.cap_var = tok; }
	break;
	case 61:
#line 232 "hext-machine.rl"
	{ pv.set_test<ContainsWordsTest>(pv.literal_value); }
	break;
	case 62:
#line 235 "hext-machine.rl"
	{ pv.set_test<EqualsTest>(pv.literal_value); }
	break;
	case 63:
#line 238 "hext-machine.rl"
	{ pv.set_test<BeginsWithTest>(pv.literal_value); }
	break;
	case 64:
#line 241 "hext-machine.rl"
	{ pv.set_test<ContainsTest>(pv.literal_value); }
	break;
	case 65:
#line 244 "hext-machine.rl"
	{ pv.set_test<EndsWithTest>(pv.literal_value); }
	break;
	case 66:
#line 252 "hext-machine.rl"
	{ cur_rule().append_capture<FunctionCapture>(
             pv.builtin, pv.cap_var, std::move(pv.pipe)); }
	break;
	case 67:
#line 257 "hext-machine.rl"
	{ cur_rule().append_match<FunctionValueMatch>(pv.builtin, std::move(pv.test)); }
	break;
	case 68:
#line 261 "hext-machine.rl"
	{ cur_rule().append_match<FunctionValueMatch>(pv.builtin, std::move(pv.test)); }
	break;
	case 69:
#line 265 "hext-machine.rl"
	{ cur_rule().append_capture<AttributeCapture>(
             pv.attr_name, pv.cap_var, std::move(pv.pipe));
         if( !pv.optional )
           cur_rule().append_match<AttributeMatch>(pv.attr_name);
       }
	break;
	case 70:
#line 273 "hext-machine.rl"
	{ cur_rule().append_match<AttributeMatch>(pv.attr_name, std::move(pv.test)); }
	break;
	case 71:
#line 277 "hext-machine.rl"
	{ cur_rule().append_match<AttributeMatch>(pv.attr_name, std::move(pv.test)); }
	break;
	case 72:
#line 281 "hext-machine.rl"
	{ pv.test = nullptr; }
	break;
	case 73:
#line 284 "hext-machine.rl"
	{ cur_rule().append_match<AttributeMatch>(pv.attr_name, std::move(pv.test)); }
	break;
	case 74:
#line 285 "hext-machine.rl"
	{ pv.reset(); }
	break;
	case 75:
#line 295 "hext-machine.rl"
	{ push_rule(); }
	break;
	case 76:
#line 300 "hext-machine.rl"
	{ cur_rule().set_optional(true); }
	break;
	case 77:
#line 304 "hext-machine.rl"
	{ cur_rule().set_greedy(true); }
	break;
	case 78:
#line 308 "hext-machine.rl"
	{ tk_start(); }
	break;
	case 79:
#line 309 "hext-machine.rl"
	{ tk_stop(); set_open_tag_or_throw(tok); }
	break;
	case 80:
#line 312 "hext-machine.rl"
	{ cur_rule().append_match(std::move(pv.negate)); }
	break;
	case 81:
#line 315 "hext-machine.rl"
	{ cur_rule().append_match(std::move(pv.trait)); }
	break;
	case 82:
#line 323 "hext-machine.rl"
	{ pop_rule(); }
	break;
	case 83:
#line 330 "hext-machine.rl"
	{ tk_start(); }
	break;
	case 84:
#line 331 "hext-machine.rl"
	{ tk_stop();
                            validate_close_tag_or_throw(tok);
                            pop_rule(); }
	break;
	case 85:
#line 348 "hext-machine.rl"
	{ push_nested(); }
	break;
	case 86:
#line 352 "hext-machine.rl"
	{ pop_nested(); }
	break;
	case 87:
#line 356 "hext-machine.rl"
	{ this->throw_unexpected(); }
	break;
#line 2195 "Parser.cpp.tmp"
		}
	}

_again:
	if ( cs == 0 )
		goto _out;
	if ( ++p != pe )
		goto _resume;
	_test_eof: {}
	if ( p == eof )
	{
	const char *__acts = _hext_actions + _hext_eof_actions[cs];
	unsigned int __nacts = (unsigned int) *__acts++;
	while ( __nacts-- > 0 ) {
		switch ( *__acts++ ) {
	case 82:
#line 323 "hext-machine.rl"
	{ pop_rule(); }
	break;
	case 85:
#line 348 "hext-machine.rl"
	{ push_nested(); }
	break;
	case 86:
#line 352 "hext-machine.rl"
	{ pop_nested(); }
	break;
	case 87:
#line 356 "hext-machine.rl"
	{ this->throw_unexpected(); }
	break;
#line 2227 "Parser.cpp.tmp"
		}
	}
	}

	_out: {}
	}

#line 141 "Parser.cpp.rl"

#ifndef _MSC_VER
#pragma GCC diagnostic pop
#endif

  if( this->stacks_.empty() )
  {
    // stacks_ should never be empty.
    assert(this->stacks_.size());
    return Rule();
  }

  if( this->stacks_.size() > 2 )
    // If there are more than two stacks, then a nested rule is unclosed,
    // because pop_nested() wasn't called enough times.
    this->throw_error_message("Unclosed nested rule");

  while( this->stacks_.size() && this->top_stack().empty() )
    this->stacks_.pop_back();

  if( this->stacks_.empty() )
    // No rules in input
    return Rule();

  // Throw error if there are missing closing tags.
  if( this->stacks_.size() > 1 || this->top_stack().size() > 1 )
    this->throw_missing_tag(
      this->top_stack().back().get_tag(),
      this->top_stack().back().get_tagname());

  return std::move(this->top_stack().back());
}

Rule& Parser::cur_rule()
{
  assert(this->top_stack().size());
  return this->top_stack().back();
}

std::vector<Rule>& Parser::top_stack()
{
  assert(this->stacks_.size());
  return this->stacks_.back();
}

std::vector<Rule>& Parser::previous_stack()
{
  assert(this->stacks_.size() > 1);
  return this->stacks_.at(this->stacks_.size() - 2);
}

void Parser::push_nested()
{
  if( this->top_stack().empty() )
    this->throw_error_message("Nested rules must have a parent");
  this->stacks_.emplace_back();
  this->stacks_.emplace_back();
}

void Parser::pop_nested()
{
  if( this->stacks_.empty() )
  {
    assert(this->stacks_.size());
    this->throw_unexpected();
  }

  if( !this->top_stack().empty() )
    this->throw_error_message("Closing nested rule without open");

  this->stacks_.pop_back();

  if( this->stacks_.empty() )
  {
    assert(this->stacks_.size());
    this->throw_unexpected();
  }

  if( this->top_stack().empty() )
    this->throw_error_message("Nested rules cannot be empty");

  if( this->top_stack().size() > 1 )
  {
    assert(this->top_stack().size() == 1);
    this->throw_unexpected();
  }

  auto nested_rule = std::move(this->top_stack().back());
  this->top_stack().pop_back();
  this->stacks_.pop_back();

  if( this->stacks_.empty() )
    this->throw_error_message("Closing nested rule without open");

  if( this->top_stack().empty() )
    this->throw_error_message("Nested rules must have a parent");
  else
    this->cur_rule().append_nested(std::move(nested_rule));
}

void Parser::push_rule()
{
  this->top_stack().emplace_back();
}

void Parser::pop_rule()
{
  if( this->stacks_.empty() || this->top_stack().empty() )
  {
    assert(this->stacks_.size());
    assert(this->top_stack().size());
    this->throw_unexpected();
  }

  // Collapse elements on same stack
  if( this->top_stack().size() > 1 )
  {
    Rule rule = std::move(this->top_stack().back());
    this->top_stack().pop_back();
    this->top_stack().back().append_child(std::move(rule));
  }
  else // top_stack().size() == 1
  {
    if( this->stacks_.size() < 2 )
    {
      assert(this->stacks_.size() > 1);
      this->throw_unexpected();
    }

    // Here, there is exactly one rule on the top stack. This rule is pushed
    // up one stack, to the temporary or final result.
    Rule rule = std::move(this->top_stack().back());
    this->top_stack().pop_back();

    if( this->previous_stack().empty() )
      // New top rule
      this->previous_stack().push_back(std::move(rule));
    else
      // New sibling rule
      this->previous_stack().back().append_next(std::move(rule));
  }
}

void Parser::set_open_tag_or_throw(const std::string& tag_name)
{
  assert(this->top_stack().size());
  if( this->top_stack().empty() )
    return;

  if( tag_name.size() == 1 && tag_name[0] == '*' )
  {
    this->cur_rule().set_tag(HtmlTag::ANY);
    return;
  }

  GumboTag tag = gumbo_tag_enum(tag_name.c_str());
  this->cur_rule().set_tag(static_cast<HtmlTag>(tag));

  if( tag == GUMBO_TAG_UNKNOWN )
    this->cur_rule().set_tagname(tag_name);
}

void Parser::validate_close_tag_or_throw(const std::string& tag_name)
{
  if( this->top_stack().empty() )
    this->throw_unexpected_tag(tag_name, /* expected no tag: */ {});

  HtmlTag expected_tag = this->cur_rule().get_tag();
  if( expected_tag == HtmlTag::UNKNOWN )
  {
    const auto expected_tagname = this->cur_rule().get_tagname();

    if( !expected_tagname )
    {
      assert(false);
      this->throw_unexpected_tag(tag_name, HtmlTag::UNKNOWN);
    }
    else if( expected_tagname != tag_name )
    {
      this->throw_unexpected_tag(
          tag_name, HtmlTag::UNKNOWN, expected_tagname);
    }
  }
  else if( tag_name.size() == 1 && tag_name[0] == '*' )
  {
    if( expected_tag != HtmlTag::ANY )
      this->throw_unexpected_tag(tag_name, expected_tag);
  }
  else
  {
    GumboTag given_tag = gumbo_tag_enum(tag_name.c_str());
    if( given_tag == GUMBO_TAG_UNKNOWN
        || static_cast<HtmlTag>(given_tag) != expected_tag )
      this->throw_unexpected_tag(tag_name, expected_tag);
  }
}

void Parser::throw_unexpected() const
{
  assert(this->p && this->p_begin_ && this->pe);
  assert(this->p <= this->pe && this->p >= this->p_begin_);

  std::stringstream error_msg;
  if( this->p == this->pe || !this->p )
    error_msg << "Premature termination ";
  else
    error_msg << "Unexpected character '"
              << CharName(*(this->p))
              << "' ";

  if( this->p && this->pe )
    this->print_error_location(this->p, /* mark_len: */ 1, error_msg);

  throw SyntaxError(error_msg.str());
}

void Parser::throw_regex_error(
  std::size_t mark_len,
  boost::regex_constants::error_type e_code
) const
{
  std::stringstream error_msg;
  error_msg << "In regular expression ";

  auto unexpected_char = this->p - 1;
  this->print_error_location(unexpected_char, mark_len, error_msg);

  // regex_error::what() not only contains an error message, but also adds the
  // error location. Therefore we use regex_traits::error_string to get a
  // shorter error description.
  boost::regex_traits<boost::regex::value_type> traits;
  error_msg << "\nError: "
            << traits.error_string(e_code);

  throw SyntaxError(error_msg.str());
}

void Parser::throw_missing_tag(
  HtmlTag missing,
  std::optional<std::string> missing_tagname
) const
{
  std::stringstream error_msg;
  error_msg << "Missing closing tag '</";

  if( missing_tagname )
    error_msg << *missing_tagname;
  else
    error_msg << ( missing == HtmlTag::ANY
                   ? "*"
                   : gumbo_normalized_tagname(static_cast<GumboTag>(missing)) );

  error_msg << ">' ";

  this->print_error_location(this->pe, /* mark_len: */ 0, error_msg);

  throw SyntaxError(error_msg.str());
}

void Parser::throw_unexpected_tag(
  const std::string& tag,
  std::optional<HtmlTag> expected,
  std::optional<std::string> expected_tagname
) const
{
  std::stringstream error_msg;
  error_msg << "Unexpected closing tag '</"
            << tag
            << ">'";

  if( expected_tagname )
  {
    error_msg << ", expected '</"
              << *expected_tagname
              << ">'";
  }
  else if( expected )
  {
    error_msg << ", expected '</"
              << ( *expected == HtmlTag::ANY
                   ? "*"
                   : gumbo_normalized_tagname(static_cast<GumboTag>(*expected)) )
              << ">'";
  }

  error_msg << " ";

  auto mark_len = tag.size() + 2; // strlen("</")
  auto unexpected_char = this->p - 1;
  this->print_error_location(unexpected_char, mark_len, error_msg);

  throw SyntaxError(error_msg.str());
}

void Parser::throw_error_message(const std::string& msg) const
{
  std::stringstream error_msg;
  error_msg << msg << " ";
  std::size_t mark_len = 1;
  auto unexpected_char = this->p - 1;
  this->print_error_location(unexpected_char, mark_len, error_msg);

  throw SyntaxError(error_msg.str());
}

void Parser::print_error_location(
  const char * uc,
  std::size_t mark_len,
  std::ostream& out
) const
{
  assert(uc && this->p_begin_ && this->pe);
  assert(uc <= this->pe && uc >= this->p_begin_);
  if( !uc || !this->p_begin_ || !this->pe || uc > this->pe )
    return;

  // The zero-based line and char offset of the unexpected character
  CharPosPair pos = CharPosition(this->p_begin_, uc);
  auto line_count = static_cast<std::size_t>(pos.first + 1);
  auto char_count = static_cast<std::size_t>(pos.second + 1);

  if( uc == this->pe )
    out << "at end of input:\n\n";
  else
    out << "at line " << line_count
        << ", char " << char_count << ":\n\n";

  // Don't print the unexpected character if it is a newline
  if( uc == this->pe || *uc == '\n' )
    PrintNumberedLines(this->p_begin_, uc, out);
  else
    PrintNumberedLines(this->p_begin_, uc + 1, out);

  if( mark_len < 1 )
    return;

  // If there are non-ascii characters in the input, lazily bail out.
  if( std::any_of(this->p_begin_, this->pe, [](signed char c){return c < 0;}) )
    return;

  // The longest the mark can be is the length of the last line.
  mark_len = std::min(char_count, mark_len);

  // Print a visual indicator directly under the unexpected token ('^').
  // The required amount of indentation must be known.
  std::size_t indent = static_cast<std::size_t>(DecimalWidth(line_count))
                     + 2            // ": "
                     + char_count   // position of the unexpected character from
                                    // the beginning of the line.
                     - mark_len;    // the length of the '^' mark

  out << std::string(indent, ' ')
      << std::string(mark_len, '^')
      << " here\n";
}


} // namespace hext

