#line 1 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/en_scouse.c.rl"
#include <assert.h>
#include <ruby.h>

#if defined(_WIN32)
#include <stddef.h>
#endif

#ifdef HAVE_RUBY_RE_H
#include <ruby/re.h>
#else
#include <re.h>
#endif

#ifdef HAVE_RUBY_ENCODING_H
#include <ruby/encoding.h>
#define ENCODED_STR_NEW(ptr, len) \
    rb_enc_str_new(ptr, len, rb_utf8_encoding())
#else
#define ENCODED_STR_NEW(ptr, len) \
    rb_str_new(ptr, len)
#endif

#define LF_FLAG      0
#define CRLF_FLAG    1
#define LF           "\n"
#define CRLF         "\r\n"

#ifndef RSTRING_PTR
#define RSTRING_PTR(s) (RSTRING(s)->ptr)
#endif

#ifndef RSTRING_LEN
#define RSTRING_LEN(s) (RSTRING(s)->len)
#endif

#define DATA_GET(FROM, TYPE, NAME) \
  Data_Get_Struct(FROM, TYPE, NAME); \
  if (NAME == NULL) { \
    rb_raise(rb_eArgError, "NULL found for " # NAME " when it shouldn't be."); \
  }
 
typedef struct lexer_state {
  int content_len;
  int line_number;
  int current_line;
  int start_col;
  int eol;
  size_t mark;
  size_t keyword_start;
  size_t keyword_end;
  size_t next_keyword_start;
  size_t content_start;
  size_t content_end;
  size_t query_start;
  size_t last_newline;
  size_t final_newline;
} lexer_state;

static VALUE mGherkin;
static VALUE mCLexer;
static VALUE cI18nLexer;
static VALUE rb_eGherkinLexingError;

#define LEN(AT, P) (P - data - lexer->AT)
#define MARK(M, P) (lexer->M = (P) - data)
#define PTR_TO(P) (data + lexer->P)

#define STORE_KW_END_CON(EVENT) \
  store_kw_con(listener, # EVENT, \
    PTR_TO(keyword_start), LEN(keyword_start, PTR_TO(keyword_end - 1)), \
    PTR_TO(content_start), LEN(content_start, PTR_TO(content_end)), \
    lexer->current_line, lexer->eol); \
    if (lexer->content_end != 0) { \
      p = PTR_TO(content_end - 1); \
    } \
    lexer->content_end = 0

#define STORE_ATTR(ATTR) \
    store_attr(listener, # ATTR, \
      PTR_TO(content_start), LEN(content_start, p), \
      lexer->line_number)


#line 235 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/en_scouse.c.rl"


/** Data **/

#line 92 "ext/gherkin_lexer_en_scouse/gherkin_lexer_en_scouse.c"
static const char _lexer_actions[] = {
	0, 1, 0, 1, 1, 1, 2, 1, 
	3, 1, 4, 1, 5, 1, 6, 1, 
	7, 1, 9, 1, 10, 1, 11, 1, 
	14, 1, 15, 1, 16, 1, 17, 1, 
	18, 1, 19, 1, 20, 1, 21, 2, 
	1, 16, 2, 11, 0, 2, 12, 13, 
	2, 15, 0, 2, 15, 2, 2, 15, 
	14, 2, 15, 17, 2, 16, 4, 2, 
	16, 5, 2, 16, 6, 2, 16, 7, 
	2, 16, 8, 2, 16, 14, 2, 18, 
	19, 2, 20, 0, 2, 20, 2, 2, 
	20, 14, 2, 20, 17, 3, 3, 12, 
	13, 3, 9, 12, 13, 3, 10, 12, 
	13, 3, 11, 12, 13, 3, 12, 13, 
	16, 3, 15, 12, 13, 4, 1, 12, 
	13, 16, 4, 15, 0, 12, 13
};

static const short _lexer_key_offsets[] = {
	0, 0, 19, 20, 21, 25, 30, 35, 
	40, 45, 49, 53, 55, 56, 57, 58, 
	59, 60, 61, 62, 63, 64, 65, 66, 
	67, 68, 69, 70, 71, 72, 74, 79, 
	86, 91, 92, 93, 94, 97, 98, 99, 
	100, 101, 102, 103, 104, 105, 106, 107, 
	108, 109, 110, 111, 112, 113, 114, 115, 
	116, 117, 118, 119, 120, 121, 122, 123, 
	124, 125, 126, 127, 128, 129, 130, 131, 
	132, 147, 149, 151, 153, 155, 157, 159, 
	161, 163, 165, 167, 169, 171, 173, 175, 
	177, 196, 197, 198, 199, 200, 201, 202, 
	203, 204, 205, 206, 211, 212, 213, 214, 
	215, 216, 217, 218, 219, 220, 230, 232, 
	234, 236, 238, 240, 242, 244, 246, 248, 
	250, 252, 254, 256, 258, 260, 262, 264, 
	266, 268, 270, 272, 274, 276, 278, 280, 
	282, 284, 286, 288, 290, 292, 294, 296, 
	298, 300, 302, 304, 306, 308, 310, 312, 
	314, 316, 318, 320, 322, 324, 326, 328, 
	330, 332, 334, 336, 338, 340, 342, 344, 
	346, 348, 350, 352, 353, 354, 355, 356, 
	357, 358, 359, 360, 361, 362, 363, 364, 
	365, 366, 367, 368, 369, 370, 371, 372, 
	373, 374, 375, 390, 392, 394, 396, 398, 
	400, 402, 404, 406, 408, 410, 412, 414, 
	416, 418, 420, 422, 424, 426, 429, 431, 
	433, 435, 437, 439, 441, 443, 445, 447, 
	449, 451, 453, 455, 457, 459, 461, 463, 
	465, 467, 469, 471, 473, 475, 477, 479, 
	481, 483, 485, 487, 489, 491, 493, 495, 
	497, 500, 502, 504, 506, 508, 510, 512, 
	514, 516, 518, 520, 522, 524, 526, 528, 
	530, 532, 534, 536, 539, 541, 543, 545, 
	547, 549, 551, 553, 555, 557, 559, 561, 
	563, 565, 567, 569, 571, 573, 575, 577, 
	579, 581, 582, 583, 584, 585, 586, 587, 
	588, 589, 590, 591, 592, 593, 594, 595, 
	610, 612, 614, 616, 618, 620, 622, 624, 
	626, 628, 630, 632, 634, 636, 638, 640, 
	642, 644, 646, 649, 651, 653, 655, 657, 
	659, 661, 663, 665, 667, 669, 671, 673, 
	675, 677, 679, 681, 683, 685, 687, 689, 
	691, 693, 695, 697, 699, 701, 703, 705, 
	707, 709, 711, 713, 715, 717, 719, 721, 
	723, 725, 727, 729, 731, 733, 735, 737, 
	740, 742, 744, 746, 748, 750, 752, 754, 
	756, 758, 760, 762, 764, 766, 768, 770, 
	772, 774, 776, 778, 780, 781, 782, 783, 
	784, 785, 786, 787, 788, 789, 790, 792, 
	793, 794, 795, 796, 797, 798, 799, 800, 
	801, 802, 803, 804, 805, 806, 807, 808, 
	809, 810, 811, 812, 816, 821, 822, 827, 
	846, 848, 850, 852, 855, 857, 859, 861, 
	863, 865, 867, 869, 871, 873, 875, 877, 
	879, 881, 883, 885, 887, 889, 891, 893, 
	895, 897, 899, 901, 903, 905, 907, 909, 
	911, 913, 915, 917, 919, 921, 923, 926, 
	928, 930, 932, 934, 936, 938, 940, 942, 
	944, 946, 948, 950, 952, 954, 956, 958, 
	960, 962, 965, 967, 969, 971, 973, 975, 
	977, 979, 981, 983, 985, 987, 989, 991, 
	993, 995, 997, 999, 1001, 1003, 1005
};

static const char _lexer_trans_keys[] = {
	10, 32, 34, 35, 37, 42, 64, 65, 
	66, 68, 69, 70, 71, 84, 87, 89, 
	124, 9, 13, 34, 34, 10, 32, 9, 
	13, 10, 32, 34, 9, 13, 10, 32, 
	34, 9, 13, 10, 32, 34, 9, 13, 
	10, 32, 34, 9, 13, 10, 32, 9, 
	13, 10, 32, 9, 13, 10, 13, 10, 
	95, 70, 69, 65, 84, 85, 82, 69, 
	95, 69, 78, 68, 95, 37, 32, 10, 
	10, 13, 13, 32, 64, 9, 10, 9, 
	10, 13, 32, 64, 11, 12, 10, 32, 
	64, 9, 13, 110, 117, 104, 101, 105, 
	117, 110, 32, 121, 111, 117, 115, 101, 
	32, 103, 111, 116, 116, 97, 115, 32, 
	105, 115, 32, 119, 104, 97, 116, 32, 
	119, 101, 110, 116, 32, 100, 111, 119, 
	110, 58, 10, 10, 10, 32, 35, 37, 
	42, 64, 65, 66, 68, 71, 84, 87, 
	89, 9, 13, 10, 95, 10, 70, 10, 
	69, 10, 65, 10, 84, 10, 85, 10, 
	82, 10, 69, 10, 95, 10, 69, 10, 
	78, 10, 68, 10, 95, 10, 37, 10, 
	32, 10, 32, 34, 35, 37, 42, 64, 
	65, 66, 68, 69, 70, 71, 84, 87, 
	89, 124, 9, 13, 120, 97, 109, 112, 
	108, 101, 115, 58, 10, 10, 10, 32, 
	124, 9, 13, 101, 97, 116, 117, 114, 
	101, 58, 10, 10, 10, 32, 35, 37, 
	64, 68, 84, 87, 9, 13, 10, 95, 
	10, 70, 10, 69, 10, 65, 10, 84, 
	10, 85, 10, 82, 10, 69, 10, 95, 
	10, 69, 10, 78, 10, 68, 10, 95, 
	10, 37, 10, 105, 10, 115, 10, 32, 
	10, 105, 10, 115, 10, 32, 10, 119, 
	10, 104, 10, 97, 10, 116, 10, 32, 
	10, 119, 10, 101, 10, 110, 10, 116, 
	10, 32, 10, 100, 10, 111, 10, 119, 
	10, 110, 10, 58, 10, 104, 10, 101, 
	10, 32, 10, 116, 10, 104, 10, 105, 
	10, 110, 10, 103, 10, 32, 10, 111, 
	10, 102, 10, 32, 10, 105, 10, 116, 
	10, 32, 10, 105, 10, 115, 10, 104, 
	10, 97, 10, 114, 10, 114, 10, 105, 
	10, 109, 10, 101, 10, 97, 10, 110, 
	105, 118, 117, 104, 101, 32, 116, 104, 
	105, 110, 103, 32, 111, 102, 32, 105, 
	116, 32, 105, 115, 58, 10, 10, 10, 
	32, 35, 37, 42, 64, 65, 66, 68, 
	71, 84, 87, 89, 9, 13, 10, 95, 
	10, 70, 10, 69, 10, 65, 10, 84, 
	10, 85, 10, 82, 10, 69, 10, 95, 
	10, 69, 10, 78, 10, 68, 10, 95, 
	10, 37, 10, 32, 10, 110, 10, 117, 
	10, 104, 10, 101, 117, 10, 110, 10, 
	32, 10, 121, 10, 111, 10, 117, 10, 
	115, 10, 101, 10, 32, 10, 103, 10, 
	111, 10, 116, 10, 116, 10, 97, 10, 
	105, 10, 118, 10, 117, 10, 104, 10, 
	101, 10, 32, 10, 116, 10, 104, 10, 
	105, 10, 110, 10, 103, 10, 32, 10, 
	111, 10, 102, 10, 32, 10, 105, 10, 
	116, 10, 32, 10, 105, 10, 115, 10, 
	58, 10, 104, 117, 10, 97, 10, 114, 
	10, 114, 10, 105, 10, 109, 10, 101, 
	10, 97, 10, 110, 10, 111, 10, 117, 
	10, 115, 10, 101, 10, 32, 10, 107, 
	10, 110, 10, 111, 10, 119, 10, 32, 
	10, 108, 119, 10, 105, 10, 107, 10, 
	101, 10, 32, 10, 119, 10, 104, 10, 
	101, 10, 104, 10, 101, 10, 110, 10, 
	32, 10, 121, 10, 111, 10, 117, 10, 
	115, 10, 101, 10, 32, 10, 103, 10, 
	111, 10, 116, 104, 117, 97, 114, 114, 
	105, 109, 101, 97, 110, 32, 105, 115, 
	58, 10, 10, 10, 32, 35, 37, 42, 
	64, 65, 66, 68, 71, 84, 87, 89, 
	9, 13, 10, 95, 10, 70, 10, 69, 
	10, 65, 10, 84, 10, 85, 10, 82, 
	10, 69, 10, 95, 10, 69, 10, 78, 
	10, 68, 10, 95, 10, 37, 10, 32, 
	10, 110, 10, 117, 10, 104, 10, 101, 
	117, 10, 110, 10, 32, 10, 121, 10, 
	111, 10, 117, 10, 115, 10, 101, 10, 
	32, 10, 103, 10, 111, 10, 116, 10, 
	116, 10, 97, 10, 105, 10, 118, 10, 
	117, 10, 104, 10, 101, 10, 32, 10, 
	116, 10, 104, 10, 105, 10, 110, 10, 
	103, 10, 32, 10, 111, 10, 102, 10, 
	32, 10, 105, 10, 116, 10, 32, 10, 
	105, 10, 115, 10, 58, 10, 111, 10, 
	117, 10, 115, 10, 101, 10, 32, 10, 
	107, 10, 110, 10, 111, 10, 119, 10, 
	32, 10, 108, 119, 10, 105, 10, 107, 
	10, 101, 10, 32, 10, 119, 10, 104, 
	10, 101, 10, 104, 10, 101, 10, 110, 
	10, 32, 10, 121, 10, 111, 10, 117, 
	10, 115, 10, 101, 10, 32, 10, 103, 
	10, 111, 10, 116, 111, 117, 115, 101, 
	32, 107, 110, 111, 119, 32, 108, 119, 
	105, 107, 101, 32, 119, 104, 101, 104, 
	101, 110, 32, 121, 111, 117, 115, 101, 
	32, 103, 111, 116, 32, 124, 9, 13, 
	10, 32, 124, 9, 13, 124, 10, 32, 
	124, 9, 13, 10, 32, 34, 35, 37, 
	42, 64, 65, 66, 68, 69, 70, 71, 
	84, 87, 89, 124, 9, 13, 10, 110, 
	10, 117, 10, 104, 10, 101, 117, 10, 
	110, 10, 32, 10, 121, 10, 111, 10, 
	117, 10, 115, 10, 101, 10, 32, 10, 
	103, 10, 111, 10, 116, 10, 116, 10, 
	97, 10, 105, 10, 118, 10, 117, 10, 
	104, 10, 101, 10, 32, 10, 116, 10, 
	104, 10, 105, 10, 110, 10, 103, 10, 
	32, 10, 111, 10, 102, 10, 32, 10, 
	105, 10, 116, 10, 32, 10, 105, 10, 
	115, 10, 58, 10, 104, 117, 10, 97, 
	10, 114, 10, 114, 10, 105, 10, 109, 
	10, 101, 10, 97, 10, 110, 10, 111, 
	10, 117, 10, 115, 10, 101, 10, 32, 
	10, 107, 10, 110, 10, 111, 10, 119, 
	10, 32, 10, 108, 119, 10, 105, 10, 
	107, 10, 101, 10, 32, 10, 119, 10, 
	104, 10, 101, 10, 104, 10, 101, 10, 
	110, 10, 32, 10, 121, 10, 111, 10, 
	117, 10, 115, 10, 101, 10, 32, 10, 
	103, 10, 111, 10, 116, 0
};

static const char _lexer_single_lengths[] = {
	0, 17, 1, 1, 2, 3, 3, 3, 
	3, 2, 2, 2, 1, 1, 1, 1, 
	1, 1, 1, 1, 1, 1, 1, 1, 
	1, 1, 1, 1, 1, 2, 3, 5, 
	3, 1, 1, 1, 3, 1, 1, 1, 
	1, 1, 1, 1, 1, 1, 1, 1, 
	1, 1, 1, 1, 1, 1, 1, 1, 
	1, 1, 1, 1, 1, 1, 1, 1, 
	1, 1, 1, 1, 1, 1, 1, 1, 
	13, 2, 2, 2, 2, 2, 2, 2, 
	2, 2, 2, 2, 2, 2, 2, 2, 
	17, 1, 1, 1, 1, 1, 1, 1, 
	1, 1, 1, 3, 1, 1, 1, 1, 
	1, 1, 1, 1, 1, 8, 2, 2, 
	2, 2, 2, 2, 2, 2, 2, 2, 
	2, 2, 2, 2, 2, 2, 2, 2, 
	2, 2, 2, 2, 2, 2, 2, 2, 
	2, 2, 2, 2, 2, 2, 2, 2, 
	2, 2, 2, 2, 2, 2, 2, 2, 
	2, 2, 2, 2, 2, 2, 2, 2, 
	2, 2, 2, 2, 2, 2, 2, 2, 
	2, 2, 2, 1, 1, 1, 1, 1, 
	1, 1, 1, 1, 1, 1, 1, 1, 
	1, 1, 1, 1, 1, 1, 1, 1, 
	1, 1, 13, 2, 2, 2, 2, 2, 
	2, 2, 2, 2, 2, 2, 2, 2, 
	2, 2, 2, 2, 2, 3, 2, 2, 
	2, 2, 2, 2, 2, 2, 2, 2, 
	2, 2, 2, 2, 2, 2, 2, 2, 
	2, 2, 2, 2, 2, 2, 2, 2, 
	2, 2, 2, 2, 2, 2, 2, 2, 
	3, 2, 2, 2, 2, 2, 2, 2, 
	2, 2, 2, 2, 2, 2, 2, 2, 
	2, 2, 2, 3, 2, 2, 2, 2, 
	2, 2, 2, 2, 2, 2, 2, 2, 
	2, 2, 2, 2, 2, 2, 2, 2, 
	2, 1, 1, 1, 1, 1, 1, 1, 
	1, 1, 1, 1, 1, 1, 1, 13, 
	2, 2, 2, 2, 2, 2, 2, 2, 
	2, 2, 2, 2, 2, 2, 2, 2, 
	2, 2, 3, 2, 2, 2, 2, 2, 
	2, 2, 2, 2, 2, 2, 2, 2, 
	2, 2, 2, 2, 2, 2, 2, 2, 
	2, 2, 2, 2, 2, 2, 2, 2, 
	2, 2, 2, 2, 2, 2, 2, 2, 
	2, 2, 2, 2, 2, 2, 2, 3, 
	2, 2, 2, 2, 2, 2, 2, 2, 
	2, 2, 2, 2, 2, 2, 2, 2, 
	2, 2, 2, 2, 1, 1, 1, 1, 
	1, 1, 1, 1, 1, 1, 2, 1, 
	1, 1, 1, 1, 1, 1, 1, 1, 
	1, 1, 1, 1, 1, 1, 1, 1, 
	1, 1, 1, 2, 3, 1, 3, 17, 
	2, 2, 2, 3, 2, 2, 2, 2, 
	2, 2, 2, 2, 2, 2, 2, 2, 
	2, 2, 2, 2, 2, 2, 2, 2, 
	2, 2, 2, 2, 2, 2, 2, 2, 
	2, 2, 2, 2, 2, 2, 3, 2, 
	2, 2, 2, 2, 2, 2, 2, 2, 
	2, 2, 2, 2, 2, 2, 2, 2, 
	2, 3, 2, 2, 2, 2, 2, 2, 
	2, 2, 2, 2, 2, 2, 2, 2, 
	2, 2, 2, 2, 2, 2, 0
};

static const char _lexer_range_lengths[] = {
	0, 1, 0, 0, 1, 1, 1, 1, 
	1, 1, 1, 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, 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, 0, 0, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	1, 0, 0, 0, 0, 0, 0, 0, 
	0, 0, 0, 1, 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, 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, 0, 0, 0, 0, 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, 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, 
	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, 
	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, 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, 0, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 
	0, 0, 0, 1, 1, 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, 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
};

static const short _lexer_index_offsets[] = {
	0, 0, 19, 21, 23, 27, 32, 37, 
	42, 47, 51, 55, 58, 60, 62, 64, 
	66, 68, 70, 72, 74, 76, 78, 80, 
	82, 84, 86, 88, 90, 92, 95, 100, 
	107, 112, 114, 116, 118, 122, 124, 126, 
	128, 130, 132, 134, 136, 138, 140, 142, 
	144, 146, 148, 150, 152, 154, 156, 158, 
	160, 162, 164, 166, 168, 170, 172, 174, 
	176, 178, 180, 182, 184, 186, 188, 190, 
	192, 207, 210, 213, 216, 219, 222, 225, 
	228, 231, 234, 237, 240, 243, 246, 249, 
	252, 271, 273, 275, 277, 279, 281, 283, 
	285, 287, 289, 291, 296, 298, 300, 302, 
	304, 306, 308, 310, 312, 314, 324, 327, 
	330, 333, 336, 339, 342, 345, 348, 351, 
	354, 357, 360, 363, 366, 369, 372, 375, 
	378, 381, 384, 387, 390, 393, 396, 399, 
	402, 405, 408, 411, 414, 417, 420, 423, 
	426, 429, 432, 435, 438, 441, 444, 447, 
	450, 453, 456, 459, 462, 465, 468, 471, 
	474, 477, 480, 483, 486, 489, 492, 495, 
	498, 501, 504, 507, 509, 511, 513, 515, 
	517, 519, 521, 523, 525, 527, 529, 531, 
	533, 535, 537, 539, 541, 543, 545, 547, 
	549, 551, 553, 568, 571, 574, 577, 580, 
	583, 586, 589, 592, 595, 598, 601, 604, 
	607, 610, 613, 616, 619, 622, 626, 629, 
	632, 635, 638, 641, 644, 647, 650, 653, 
	656, 659, 662, 665, 668, 671, 674, 677, 
	680, 683, 686, 689, 692, 695, 698, 701, 
	704, 707, 710, 713, 716, 719, 722, 725, 
	728, 732, 735, 738, 741, 744, 747, 750, 
	753, 756, 759, 762, 765, 768, 771, 774, 
	777, 780, 783, 786, 790, 793, 796, 799, 
	802, 805, 808, 811, 814, 817, 820, 823, 
	826, 829, 832, 835, 838, 841, 844, 847, 
	850, 853, 855, 857, 859, 861, 863, 865, 
	867, 869, 871, 873, 875, 877, 879, 881, 
	896, 899, 902, 905, 908, 911, 914, 917, 
	920, 923, 926, 929, 932, 935, 938, 941, 
	944, 947, 950, 954, 957, 960, 963, 966, 
	969, 972, 975, 978, 981, 984, 987, 990, 
	993, 996, 999, 1002, 1005, 1008, 1011, 1014, 
	1017, 1020, 1023, 1026, 1029, 1032, 1035, 1038, 
	1041, 1044, 1047, 1050, 1053, 1056, 1059, 1062, 
	1065, 1068, 1071, 1074, 1077, 1080, 1083, 1086, 
	1090, 1093, 1096, 1099, 1102, 1105, 1108, 1111, 
	1114, 1117, 1120, 1123, 1126, 1129, 1132, 1135, 
	1138, 1141, 1144, 1147, 1150, 1152, 1154, 1156, 
	1158, 1160, 1162, 1164, 1166, 1168, 1170, 1173, 
	1175, 1177, 1179, 1181, 1183, 1185, 1187, 1189, 
	1191, 1193, 1195, 1197, 1199, 1201, 1203, 1205, 
	1207, 1209, 1211, 1213, 1217, 1222, 1224, 1229, 
	1248, 1251, 1254, 1257, 1261, 1264, 1267, 1270, 
	1273, 1276, 1279, 1282, 1285, 1288, 1291, 1294, 
	1297, 1300, 1303, 1306, 1309, 1312, 1315, 1318, 
	1321, 1324, 1327, 1330, 1333, 1336, 1339, 1342, 
	1345, 1348, 1351, 1354, 1357, 1360, 1363, 1367, 
	1370, 1373, 1376, 1379, 1382, 1385, 1388, 1391, 
	1394, 1397, 1400, 1403, 1406, 1409, 1412, 1415, 
	1418, 1421, 1425, 1428, 1431, 1434, 1437, 1440, 
	1443, 1446, 1449, 1452, 1455, 1458, 1461, 1464, 
	1467, 1470, 1473, 1476, 1479, 1482, 1485
};

static const short _lexer_trans_targs[] = {
	1, 1, 2, 11, 13, 27, 30, 33, 
	34, 36, 89, 100, 171, 174, 288, 388, 
	419, 1, 0, 3, 0, 4, 0, 5, 
	4, 4, 0, 6, 6, 7, 6, 6, 
	6, 6, 7, 6, 6, 6, 6, 8, 
	6, 6, 6, 6, 9, 6, 6, 1, 
	10, 10, 0, 1, 10, 10, 0, 1, 
	12, 11, 1, 0, 14, 0, 15, 0, 
	16, 0, 17, 0, 18, 0, 19, 0, 
	20, 0, 21, 0, 22, 0, 23, 0, 
	24, 0, 25, 0, 26, 0, 502, 0, 
	28, 0, 0, 29, 1, 12, 29, 0, 
	0, 0, 0, 31, 32, 1, 32, 32, 
	30, 31, 31, 1, 32, 30, 32, 0, 
	27, 0, 35, 0, 27, 0, 37, 50, 
	33, 0, 38, 0, 39, 0, 40, 0, 
	41, 0, 42, 0, 43, 0, 44, 0, 
	45, 0, 46, 0, 47, 0, 48, 0, 
	49, 0, 27, 0, 51, 0, 52, 0, 
	53, 0, 54, 0, 55, 0, 56, 0, 
	57, 0, 58, 0, 59, 0, 60, 0, 
	61, 0, 62, 0, 63, 0, 64, 0, 
	65, 0, 66, 0, 67, 0, 68, 0, 
	69, 0, 70, 0, 72, 71, 72, 71, 
	72, 72, 1, 73, 87, 1, 424, 425, 
	427, 441, 444, 462, 471, 72, 71, 72, 
	74, 71, 72, 75, 71, 72, 76, 71, 
	72, 77, 71, 72, 78, 71, 72, 79, 
	71, 72, 80, 71, 72, 81, 71, 72, 
	82, 71, 72, 83, 71, 72, 84, 71, 
	72, 85, 71, 72, 86, 71, 72, 1, 
	71, 72, 88, 71, 1, 1, 2, 11, 
	13, 27, 30, 33, 34, 36, 89, 100, 
	171, 174, 288, 388, 419, 1, 0, 90, 
	0, 91, 0, 92, 0, 93, 0, 94, 
	0, 95, 0, 96, 0, 97, 0, 99, 
	98, 99, 98, 99, 99, 1, 99, 98, 
	101, 0, 102, 0, 103, 0, 104, 0, 
	105, 0, 106, 0, 107, 0, 109, 108, 
	109, 108, 109, 109, 1, 110, 1, 124, 
	145, 162, 109, 108, 109, 111, 108, 109, 
	112, 108, 109, 113, 108, 109, 114, 108, 
	109, 115, 108, 109, 116, 108, 109, 117, 
	108, 109, 118, 108, 109, 119, 108, 109, 
	120, 108, 109, 121, 108, 109, 122, 108, 
	109, 123, 108, 109, 1, 108, 109, 125, 
	108, 109, 126, 108, 109, 127, 108, 109, 
	128, 108, 109, 129, 108, 109, 130, 108, 
	109, 131, 108, 109, 132, 108, 109, 133, 
	108, 109, 134, 108, 109, 135, 108, 109, 
	136, 108, 109, 137, 108, 109, 138, 108, 
	109, 139, 108, 109, 140, 108, 109, 141, 
	108, 109, 142, 108, 109, 143, 108, 109, 
	144, 108, 109, 88, 108, 109, 146, 108, 
	109, 147, 108, 109, 148, 108, 109, 149, 
	108, 109, 150, 108, 109, 151, 108, 109, 
	152, 108, 109, 153, 108, 109, 154, 108, 
	109, 155, 108, 109, 156, 108, 109, 157, 
	108, 109, 158, 108, 109, 159, 108, 109, 
	160, 108, 109, 161, 108, 109, 144, 108, 
	109, 163, 108, 109, 164, 108, 109, 165, 
	108, 109, 166, 108, 109, 167, 108, 109, 
	168, 108, 109, 169, 108, 109, 170, 108, 
	109, 159, 108, 172, 0, 173, 0, 33, 
	0, 175, 0, 176, 0, 177, 0, 178, 
	0, 179, 0, 180, 0, 181, 0, 182, 
	0, 183, 0, 184, 0, 185, 0, 186, 
	0, 187, 0, 188, 0, 189, 0, 190, 
	0, 191, 0, 192, 0, 194, 193, 194, 
	193, 194, 194, 1, 195, 209, 1, 210, 
	211, 213, 227, 230, 248, 257, 194, 193, 
	194, 196, 193, 194, 197, 193, 194, 198, 
	193, 194, 199, 193, 194, 200, 193, 194, 
	201, 193, 194, 202, 193, 194, 203, 193, 
	194, 204, 193, 194, 205, 193, 194, 206, 
	193, 194, 207, 193, 194, 208, 193, 194, 
	1, 193, 194, 88, 193, 194, 209, 193, 
	194, 212, 193, 194, 209, 193, 194, 214, 
	210, 193, 194, 215, 193, 194, 216, 193, 
	194, 217, 193, 194, 218, 193, 194, 219, 
	193, 194, 220, 193, 194, 221, 193, 194, 
	222, 193, 194, 223, 193, 194, 224, 193, 
	194, 225, 193, 194, 226, 193, 194, 209, 
	193, 194, 228, 193, 194, 229, 193, 194, 
	210, 193, 194, 231, 193, 194, 232, 193, 
	194, 233, 193, 194, 234, 193, 194, 235, 
	193, 194, 236, 193, 194, 237, 193, 194, 
	238, 193, 194, 239, 193, 194, 240, 193, 
	194, 241, 193, 194, 242, 193, 194, 243, 
	193, 194, 244, 193, 194, 245, 193, 194, 
	246, 193, 194, 247, 193, 194, 88, 193, 
	194, 249, 210, 193, 194, 250, 193, 194, 
	251, 193, 194, 252, 193, 194, 253, 193, 
	194, 254, 193, 194, 255, 193, 194, 256, 
	193, 194, 244, 193, 194, 258, 193, 194, 
	259, 193, 194, 260, 193, 194, 261, 193, 
	194, 262, 193, 194, 263, 193, 194, 264, 
	193, 194, 265, 193, 194, 266, 193, 194, 
	267, 193, 194, 268, 275, 193, 194, 269, 
	193, 194, 270, 193, 194, 271, 193, 194, 
	272, 193, 194, 273, 193, 194, 274, 193, 
	194, 210, 193, 194, 276, 193, 194, 277, 
	193, 194, 278, 193, 194, 279, 193, 194, 
	280, 193, 194, 281, 193, 194, 282, 193, 
	194, 283, 193, 194, 284, 193, 194, 285, 
	193, 194, 286, 193, 194, 287, 193, 194, 
	209, 193, 289, 33, 0, 290, 0, 291, 
	0, 292, 0, 293, 0, 294, 0, 295, 
	0, 296, 0, 297, 0, 298, 0, 299, 
	0, 300, 0, 301, 0, 303, 302, 303, 
	302, 303, 303, 1, 304, 318, 1, 319, 
	320, 322, 336, 339, 338, 357, 303, 302, 
	303, 305, 302, 303, 306, 302, 303, 307, 
	302, 303, 308, 302, 303, 309, 302, 303, 
	310, 302, 303, 311, 302, 303, 312, 302, 
	303, 313, 302, 303, 314, 302, 303, 315, 
	302, 303, 316, 302, 303, 317, 302, 303, 
	1, 302, 303, 88, 302, 303, 318, 302, 
	303, 321, 302, 303, 318, 302, 303, 323, 
	319, 302, 303, 324, 302, 303, 325, 302, 
	303, 326, 302, 303, 327, 302, 303, 328, 
	302, 303, 329, 302, 303, 330, 302, 303, 
	331, 302, 303, 332, 302, 303, 333, 302, 
	303, 334, 302, 303, 335, 302, 303, 318, 
	302, 303, 337, 302, 303, 338, 302, 303, 
	319, 302, 303, 340, 302, 303, 341, 302, 
	303, 342, 302, 303, 343, 302, 303, 344, 
	302, 303, 345, 302, 303, 346, 302, 303, 
	347, 302, 303, 348, 302, 303, 349, 302, 
	303, 350, 302, 303, 351, 302, 303, 352, 
	302, 303, 353, 302, 303, 354, 302, 303, 
	355, 302, 303, 356, 302, 303, 88, 302, 
	303, 358, 302, 303, 359, 302, 303, 360, 
	302, 303, 361, 302, 303, 362, 302, 303, 
	363, 302, 303, 364, 302, 303, 365, 302, 
	303, 366, 302, 303, 367, 302, 303, 368, 
	375, 302, 303, 369, 302, 303, 370, 302, 
	303, 371, 302, 303, 372, 302, 303, 373, 
	302, 303, 374, 302, 303, 319, 302, 303, 
	376, 302, 303, 377, 302, 303, 378, 302, 
	303, 379, 302, 303, 380, 302, 303, 381, 
	302, 303, 382, 302, 303, 383, 302, 303, 
	384, 302, 303, 385, 302, 303, 386, 302, 
	303, 387, 302, 303, 318, 302, 389, 0, 
	390, 0, 391, 0, 392, 0, 393, 0, 
	394, 0, 395, 0, 396, 0, 397, 0, 
	398, 0, 399, 406, 0, 400, 0, 401, 
	0, 402, 0, 403, 0, 404, 0, 405, 
	0, 33, 0, 407, 0, 408, 0, 409, 
	0, 410, 0, 411, 0, 412, 0, 413, 
	0, 414, 0, 415, 0, 416, 0, 417, 
	0, 418, 0, 27, 0, 419, 420, 419, 
	0, 423, 422, 420, 422, 421, 420, 421, 
	423, 422, 420, 422, 421, 423, 423, 2, 
	11, 13, 27, 30, 33, 34, 36, 89, 
	100, 171, 174, 288, 388, 419, 423, 0, 
	72, 87, 71, 72, 426, 71, 72, 87, 
	71, 72, 428, 424, 71, 72, 429, 71, 
	72, 430, 71, 72, 431, 71, 72, 432, 
	71, 72, 433, 71, 72, 434, 71, 72, 
	435, 71, 72, 436, 71, 72, 437, 71, 
	72, 438, 71, 72, 439, 71, 72, 440, 
	71, 72, 87, 71, 72, 442, 71, 72, 
	443, 71, 72, 424, 71, 72, 445, 71, 
	72, 446, 71, 72, 447, 71, 72, 448, 
	71, 72, 449, 71, 72, 450, 71, 72, 
	451, 71, 72, 452, 71, 72, 453, 71, 
	72, 454, 71, 72, 455, 71, 72, 456, 
	71, 72, 457, 71, 72, 458, 71, 72, 
	459, 71, 72, 460, 71, 72, 461, 71, 
	72, 88, 71, 72, 463, 424, 71, 72, 
	464, 71, 72, 465, 71, 72, 466, 71, 
	72, 467, 71, 72, 468, 71, 72, 469, 
	71, 72, 470, 71, 72, 458, 71, 72, 
	472, 71, 72, 473, 71, 72, 474, 71, 
	72, 475, 71, 72, 476, 71, 72, 477, 
	71, 72, 478, 71, 72, 479, 71, 72, 
	480, 71, 72, 481, 71, 72, 482, 489, 
	71, 72, 483, 71, 72, 484, 71, 72, 
	485, 71, 72, 486, 71, 72, 487, 71, 
	72, 488, 71, 72, 424, 71, 72, 490, 
	71, 72, 491, 71, 72, 492, 71, 72, 
	493, 71, 72, 494, 71, 72, 495, 71, 
	72, 496, 71, 72, 497, 71, 72, 498, 
	71, 72, 499, 71, 72, 500, 71, 72, 
	501, 71, 72, 87, 71, 0, 0
};

static const char _lexer_trans_actions[] = {
	45, 0, 5, 1, 0, 23, 1, 23, 
	23, 23, 23, 23, 23, 23, 23, 23, 
	29, 0, 37, 0, 37, 0, 37, 45, 
	0, 0, 37, 117, 39, 39, 39, 3, 
	109, 27, 27, 27, 0, 109, 27, 27, 
	27, 0, 109, 27, 0, 27, 0, 93, 
	7, 7, 37, 45, 0, 0, 37, 101, 
	19, 0, 45, 37, 0, 37, 0, 37, 
	0, 37, 0, 37, 0, 37, 0, 37, 
	0, 37, 0, 37, 0, 37, 0, 37, 
	0, 37, 0, 37, 0, 37, 0, 37, 
	0, 37, 37, 48, 97, 17, 0, 37, 
	37, 37, 37, 0, 21, 105, 21, 21, 
	42, 21, 0, 45, 0, 1, 0, 37, 
	0, 37, 0, 37, 0, 37, 0, 0, 
	0, 37, 0, 37, 0, 37, 0, 37, 
	0, 37, 0, 37, 0, 37, 0, 37, 
	0, 37, 0, 37, 0, 37, 0, 37, 
	0, 37, 0, 37, 0, 37, 0, 37, 
	0, 37, 0, 37, 0, 37, 0, 37, 
	0, 37, 0, 37, 0, 37, 0, 37, 
	0, 37, 0, 37, 0, 37, 0, 37, 
	0, 37, 0, 37, 0, 37, 0, 37, 
	0, 37, 0, 37, 122, 48, 45, 0, 
	45, 0, 63, 27, 75, 63, 75, 75, 
	75, 75, 75, 75, 75, 0, 0, 45, 
	0, 0, 45, 0, 0, 45, 0, 0, 
	45, 0, 0, 45, 0, 0, 45, 0, 
	0, 45, 0, 0, 45, 0, 0, 45, 
	0, 0, 45, 0, 0, 45, 0, 0, 
	45, 0, 0, 45, 0, 0, 45, 11, 
	0, 45, 11, 0, 113, 25, 51, 48, 
	25, 54, 48, 54, 54, 54, 54, 54, 
	54, 54, 54, 54, 57, 25, 37, 0, 
	37, 0, 37, 0, 37, 0, 37, 0, 
	37, 0, 37, 0, 37, 0, 37, 122, 
	48, 45, 0, 45, 0, 72, 0, 0, 
	0, 37, 0, 37, 0, 37, 0, 37, 
	0, 37, 0, 37, 0, 37, 122, 48, 
	45, 0, 45, 0, 60, 27, 60, 75, 
	75, 75, 0, 0, 45, 0, 0, 45, 
	0, 0, 45, 0, 0, 45, 0, 0, 
	45, 0, 0, 45, 0, 0, 45, 0, 
	0, 45, 0, 0, 45, 0, 0, 45, 
	0, 0, 45, 0, 0, 45, 0, 0, 
	45, 0, 0, 45, 9, 0, 45, 0, 
	0, 45, 0, 0, 45, 0, 0, 45, 
	0, 0, 45, 0, 0, 45, 0, 0, 
	45, 0, 0, 45, 0, 0, 45, 0, 
	0, 45, 0, 0, 45, 0, 0, 45, 
	0, 0, 45, 0, 0, 45, 0, 0, 
	45, 0, 0, 45, 0, 0, 45, 0, 
	0, 45, 0, 0, 45, 0, 0, 45, 
	0, 0, 45, 9, 0, 45, 0, 0, 
	45, 0, 0, 45, 0, 0, 45, 0, 
	0, 45, 0, 0, 45, 0, 0, 45, 
	0, 0, 45, 0, 0, 45, 0, 0, 
	45, 0, 0, 45, 0, 0, 45, 0, 
	0, 45, 0, 0, 45, 0, 0, 45, 
	0, 0, 45, 0, 0, 45, 0, 0, 
	45, 0, 0, 45, 0, 0, 45, 0, 
	0, 45, 0, 0, 45, 0, 0, 45, 
	0, 0, 45, 0, 0, 45, 0, 0, 
	45, 0, 0, 0, 37, 0, 37, 0, 
	37, 0, 37, 0, 37, 0, 37, 0, 
	37, 0, 37, 0, 37, 0, 37, 0, 
	37, 0, 37, 0, 37, 0, 37, 0, 
	37, 0, 37, 0, 37, 0, 37, 0, 
	37, 0, 37, 0, 37, 122, 48, 45, 
	0, 45, 0, 66, 27, 75, 66, 75, 
	75, 75, 75, 75, 75, 75, 0, 0, 
	45, 0, 0, 45, 0, 0, 45, 0, 
	0, 45, 0, 0, 45, 0, 0, 45, 
	0, 0, 45, 0, 0, 45, 0, 0, 
	45, 0, 0, 45, 0, 0, 45, 0, 
	0, 45, 0, 0, 45, 0, 0, 45, 
	13, 0, 45, 13, 0, 45, 0, 0, 
	45, 0, 0, 45, 0, 0, 45, 0, 
	0, 0, 45, 0, 0, 45, 0, 0, 
	45, 0, 0, 45, 0, 0, 45, 0, 
	0, 45, 0, 0, 45, 0, 0, 45, 
	0, 0, 45, 0, 0, 45, 0, 0, 
	45, 0, 0, 45, 0, 0, 45, 0, 
	0, 45, 0, 0, 45, 0, 0, 45, 
	0, 0, 45, 0, 0, 45, 0, 0, 
	45, 0, 0, 45, 0, 0, 45, 0, 
	0, 45, 0, 0, 45, 0, 0, 45, 
	0, 0, 45, 0, 0, 45, 0, 0, 
	45, 0, 0, 45, 0, 0, 45, 0, 
	0, 45, 0, 0, 45, 0, 0, 45, 
	0, 0, 45, 0, 0, 45, 13, 0, 
	45, 0, 0, 0, 45, 0, 0, 45, 
	0, 0, 45, 0, 0, 45, 0, 0, 
	45, 0, 0, 45, 0, 0, 45, 0, 
	0, 45, 0, 0, 45, 0, 0, 45, 
	0, 0, 45, 0, 0, 45, 0, 0, 
	45, 0, 0, 45, 0, 0, 45, 0, 
	0, 45, 0, 0, 45, 0, 0, 45, 
	0, 0, 45, 0, 0, 0, 45, 0, 
	0, 45, 0, 0, 45, 0, 0, 45, 
	0, 0, 45, 0, 0, 45, 0, 0, 
	45, 0, 0, 45, 0, 0, 45, 0, 
	0, 45, 0, 0, 45, 0, 0, 45, 
	0, 0, 45, 0, 0, 45, 0, 0, 
	45, 0, 0, 45, 0, 0, 45, 0, 
	0, 45, 0, 0, 45, 0, 0, 45, 
	0, 0, 0, 0, 37, 0, 37, 0, 
	37, 0, 37, 0, 37, 0, 37, 0, 
	37, 0, 37, 0, 37, 0, 37, 0, 
	37, 0, 37, 0, 37, 122, 48, 45, 
	0, 45, 0, 69, 27, 75, 69, 75, 
	75, 75, 75, 75, 75, 75, 0, 0, 
	45, 0, 0, 45, 0, 0, 45, 0, 
	0, 45, 0, 0, 45, 0, 0, 45, 
	0, 0, 45, 0, 0, 45, 0, 0, 
	45, 0, 0, 45, 0, 0, 45, 0, 
	0, 45, 0, 0, 45, 0, 0, 45, 
	15, 0, 45, 15, 0, 45, 0, 0, 
	45, 0, 0, 45, 0, 0, 45, 0, 
	0, 0, 45, 0, 0, 45, 0, 0, 
	45, 0, 0, 45, 0, 0, 45, 0, 
	0, 45, 0, 0, 45, 0, 0, 45, 
	0, 0, 45, 0, 0, 45, 0, 0, 
	45, 0, 0, 45, 0, 0, 45, 0, 
	0, 45, 0, 0, 45, 0, 0, 45, 
	0, 0, 45, 0, 0, 45, 0, 0, 
	45, 0, 0, 45, 0, 0, 45, 0, 
	0, 45, 0, 0, 45, 0, 0, 45, 
	0, 0, 45, 0, 0, 45, 0, 0, 
	45, 0, 0, 45, 0, 0, 45, 0, 
	0, 45, 0, 0, 45, 0, 0, 45, 
	0, 0, 45, 0, 0, 45, 15, 0, 
	45, 0, 0, 45, 0, 0, 45, 0, 
	0, 45, 0, 0, 45, 0, 0, 45, 
	0, 0, 45, 0, 0, 45, 0, 0, 
	45, 0, 0, 45, 0, 0, 45, 0, 
	0, 0, 45, 0, 0, 45, 0, 0, 
	45, 0, 0, 45, 0, 0, 45, 0, 
	0, 45, 0, 0, 45, 0, 0, 45, 
	0, 0, 45, 0, 0, 45, 0, 0, 
	45, 0, 0, 45, 0, 0, 45, 0, 
	0, 45, 0, 0, 45, 0, 0, 45, 
	0, 0, 45, 0, 0, 45, 0, 0, 
	45, 0, 0, 45, 0, 0, 0, 37, 
	0, 37, 0, 37, 0, 37, 0, 37, 
	0, 37, 0, 37, 0, 37, 0, 37, 
	0, 37, 0, 0, 37, 0, 37, 0, 
	37, 0, 37, 0, 37, 0, 37, 0, 
	37, 0, 37, 0, 37, 0, 37, 0, 
	37, 0, 37, 0, 37, 0, 37, 0, 
	37, 0, 37, 0, 37, 0, 37, 0, 
	37, 0, 37, 0, 37, 0, 0, 0, 
	37, 45, 31, 78, 31, 31, 33, 0, 
	45, 0, 33, 0, 0, 45, 0, 84, 
	81, 35, 87, 81, 87, 87, 87, 87, 
	87, 87, 87, 87, 87, 90, 0, 37, 
	45, 0, 0, 45, 0, 0, 45, 0, 
	0, 45, 0, 0, 0, 45, 0, 0, 
	45, 0, 0, 45, 0, 0, 45, 0, 
	0, 45, 0, 0, 45, 0, 0, 45, 
	0, 0, 45, 0, 0, 45, 0, 0, 
	45, 0, 0, 45, 0, 0, 45, 0, 
	0, 45, 0, 0, 45, 0, 0, 45, 
	0, 0, 45, 0, 0, 45, 0, 0, 
	45, 0, 0, 45, 0, 0, 45, 0, 
	0, 45, 0, 0, 45, 0, 0, 45, 
	0, 0, 45, 0, 0, 45, 0, 0, 
	45, 0, 0, 45, 0, 0, 45, 0, 
	0, 45, 0, 0, 45, 0, 0, 45, 
	0, 0, 45, 0, 0, 45, 0, 0, 
	45, 11, 0, 45, 0, 0, 0, 45, 
	0, 0, 45, 0, 0, 45, 0, 0, 
	45, 0, 0, 45, 0, 0, 45, 0, 
	0, 45, 0, 0, 45, 0, 0, 45, 
	0, 0, 45, 0, 0, 45, 0, 0, 
	45, 0, 0, 45, 0, 0, 45, 0, 
	0, 45, 0, 0, 45, 0, 0, 45, 
	0, 0, 45, 0, 0, 45, 0, 0, 
	0, 45, 0, 0, 45, 0, 0, 45, 
	0, 0, 45, 0, 0, 45, 0, 0, 
	45, 0, 0, 45, 0, 0, 45, 0, 
	0, 45, 0, 0, 45, 0, 0, 45, 
	0, 0, 45, 0, 0, 45, 0, 0, 
	45, 0, 0, 45, 0, 0, 45, 0, 
	0, 45, 0, 0, 45, 0, 0, 45, 
	0, 0, 45, 0, 0, 0, 0
};

static const char _lexer_eof_actions[] = {
	0, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37, 37, 
	37, 37, 37, 37, 37, 37, 37
};

static const int lexer_start = 1;
static const int lexer_first_final = 502;
static const int lexer_error = 0;

static const int lexer_en_main = 1;


#line 239 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/en_scouse.c.rl"

static VALUE 
strip_i(VALUE str, VALUE ary)
{
  rb_funcall(str, rb_intern("strip!"), 0);
  rb_ary_push(ary, str);
  
  return Qnil;
}

static VALUE 
multiline_strip(VALUE text, int eol)
{
  VALUE map = rb_ary_new();
  VALUE split = rb_str_split(text, "\n");
  
  rb_iterate(rb_each, split, strip_i, map);
  
  return rb_ary_join(split, rb_str_new2( \
          eol == CRLF_FLAG ? CRLF : LF ));
}

static void 
store_kw_con(VALUE listener, const char * event_name, 
             const char * keyword_at, size_t keyword_length, 
             const char * at,         size_t length, 
             int current_line, int eol)
{
  VALUE con = Qnil, kw = Qnil;
  kw = ENCODED_STR_NEW(keyword_at, keyword_length);
  con = ENCODED_STR_NEW(at, length);
  con = multiline_strip(con, eol);
  rb_funcall(con, rb_intern("strip!"), 0);
  rb_funcall(listener, rb_intern(event_name), 3, kw, con, INT2FIX(current_line)); 
}

static void 
store_attr(VALUE listener, const char * attr_type,
           const char * at, size_t length, 
           int line)
{
  VALUE val = ENCODED_STR_NEW(at, length);
  rb_funcall(listener, rb_intern(attr_type), 2, val, INT2FIX(line));
}

static void 
store_pystring_content(VALUE listener, 
          int start_col, 
          const char *at, size_t length, 
          int current_line)
{
  VALUE con = ENCODED_STR_NEW(at, length);
  // Gherkin will crash gracefully if the string representation of start_col pushes the pattern past 32 characters
  char pat[32]; 
  snprintf(pat, 32, "^ {0,%d}", start_col); 
  VALUE re = rb_reg_regcomp(rb_str_new2(pat));
  VALUE re2 = rb_reg_regcomp(rb_str_new2("\r\\Z"));
  rb_funcall(con, rb_intern("gsub!"), 2, re, rb_str_new2(""));
  rb_funcall(con, rb_intern("sub!"), 2, re2, rb_str_new2(""));
  rb_funcall(listener, rb_intern("py_string"), 2, con, INT2FIX(current_line));
}

static void 
raise_lexer_error(const char * at, int line)
{ 
  rb_raise(rb_eGherkinLexingError, "Lexing error on line %d: '%s'.", line, at);
}

static int 
count_char(char char_to_count, char *str) {

  int count = 0;
  int i = 0;
  while(str[i] != '\0') {
    if(str[i] == char_to_count) {
      count++;
    }
    i++;
  }
  return count;
}

static void lexer_init(lexer_state *lexer) {
  lexer->content_start = 0;
  lexer->content_end = 0;
  lexer->content_len = 0;
  lexer->mark = 0;
  lexer->keyword_start = 0;
  lexer->keyword_end = 0;
  lexer->next_keyword_start = 0;
  lexer->line_number = 1;
  lexer->last_newline = 0;
  lexer->final_newline = 0;
  lexer->start_col = 0;
  lexer->eol = LF_FLAG;
}

static VALUE CLexer_alloc(VALUE klass)
{
  VALUE obj;
  lexer_state *lxr = ALLOC(lexer_state);
  lexer_init(lxr);

  obj = Data_Wrap_Struct(klass, NULL, -1, lxr);

  return obj;
}

static VALUE CLexer_init(VALUE self, VALUE listener)
{
  rb_iv_set(self, "@listener", listener);
  
  lexer_state *lxr = NULL;
  DATA_GET(self, lexer_state, lxr);
  lexer_init(lxr);
  
  return self;
}

static VALUE CLexer_scan(VALUE self, VALUE input)
{
  lexer_state *lexer = NULL;
  DATA_GET(self, lexer_state, lexer);


  VALUE input_copy = rb_str_dup(input);

  rb_str_append(input_copy, rb_str_new2("\n%_FEATURE_END_%"));
  char *data = RSTRING_PTR(input_copy);
  size_t len = RSTRING_LEN(input_copy);
  
  if (count_char('\r', data) > (count_char('\n', data) / 2)) {
    lexer->eol = CRLF_FLAG;
  }
  
  if (len == 0) { 
    rb_raise(rb_eGherkinLexingError, "No content to lex.");
  } else {

    const char *p, *pe, *eof;
    int cs = 0;
    
    VALUE listener = rb_iv_get(self, "@listener");
    VALUE current_row = Qnil;

    p = data;
    pe = data + len;
    eof = pe;
    
    assert(*pe == '\0' && "pointer does not end on NULL");
    
    
#line 1109 "ext/gherkin_lexer_en_scouse/gherkin_lexer_en_scouse.c"
	{
	cs = lexer_start;
	}

#line 391 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/en_scouse.c.rl"
    
#line 1116 "ext/gherkin_lexer_en_scouse/gherkin_lexer_en_scouse.c"
	{
	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 = _lexer_trans_keys + _lexer_key_offsets[cs];
	_trans = _lexer_index_offsets[cs];

	_klen = _lexer_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 += (_mid - _keys);
				goto _match;
			}
		}
		_keys += _klen;
		_trans += _klen;
	}

	_klen = _lexer_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 += ((_mid - _keys)>>1);
				goto _match;
			}
		}
		_trans += _klen;
	}

_match:
	cs = _lexer_trans_targs[_trans];

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

	_acts = _lexer_actions + _lexer_trans_actions[_trans];
	_nacts = (unsigned int) *_acts++;
	while ( _nacts-- > 0 )
	{
		switch ( *_acts++ )
		{
	case 0:
#line 86 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/en_scouse.c.rl"
	{
		MARK(content_start, p);
    lexer->current_line = lexer->line_number;
  }
	break;
	case 1:
#line 91 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/en_scouse.c.rl"
	{
    MARK(content_start, p);
  }
	break;
	case 2:
#line 95 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/en_scouse.c.rl"
	{
    lexer->current_line = lexer->line_number;
    lexer->start_col = p - data - lexer->last_newline;
  }
	break;
	case 3:
#line 100 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/en_scouse.c.rl"
	{
    int len = LEN(content_start, PTR_TO(final_newline));

    if (len < 0) len = 0;

    store_pystring_content(listener, lexer->start_col, PTR_TO(content_start), len, lexer->current_line);
  }
	break;
	case 4:
#line 108 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/en_scouse.c.rl"
	{
    STORE_KW_END_CON(feature);
  }
	break;
	case 5:
#line 112 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/en_scouse.c.rl"
	{
    STORE_KW_END_CON(background);
  }
	break;
	case 6:
#line 116 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/en_scouse.c.rl"
	{
    STORE_KW_END_CON(scenario);
  }
	break;
	case 7:
#line 120 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/en_scouse.c.rl"
	{
    STORE_KW_END_CON(scenario_outline);
  }
	break;
	case 8:
#line 124 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/en_scouse.c.rl"
	{
    STORE_KW_END_CON(examples);
  }
	break;
	case 9:
#line 128 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/en_scouse.c.rl"
	{
    store_kw_con(listener, "step",
      PTR_TO(keyword_start), LEN(keyword_start, PTR_TO(keyword_end)),
      PTR_TO(content_start), LEN(content_start, p), 
      lexer->current_line, lexer->eol);
  }
	break;
	case 10:
#line 135 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/en_scouse.c.rl"
	{
    STORE_ATTR(comment);
    lexer->mark = 0;
  }
	break;
	case 11:
#line 140 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/en_scouse.c.rl"
	{
    STORE_ATTR(tag);
    lexer->mark = 0;
  }
	break;
	case 12:
#line 145 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/en_scouse.c.rl"
	{
    lexer->line_number += 1;
    MARK(final_newline, p);
  }
	break;
	case 13:
#line 150 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/en_scouse.c.rl"
	{
    MARK(last_newline, p + 1);
  }
	break;
	case 14:
#line 154 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/en_scouse.c.rl"
	{
    if (lexer->mark == 0) {
      MARK(mark, p);
    }
  }
	break;
	case 15:
#line 160 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/en_scouse.c.rl"
	{
    MARK(keyword_end, p);
    MARK(keyword_start, PTR_TO(mark));
    MARK(content_start, p + 1);
    lexer->mark = 0;
  }
	break;
	case 16:
#line 167 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/en_scouse.c.rl"
	{
    MARK(content_end, p);
  }
	break;
	case 17:
#line 171 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/en_scouse.c.rl"
	{
    p = p - 1;
    lexer->current_line = lexer->line_number;
    current_row = rb_ary_new();
  }
	break;
	case 18:
#line 177 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/en_scouse.c.rl"
	{
		MARK(content_start, p);
  }
	break;
	case 19:
#line 181 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/en_scouse.c.rl"
	{
    VALUE con = ENCODED_STR_NEW(PTR_TO(content_start), LEN(content_start, p));
    rb_funcall(con, rb_intern("strip!"), 0);

    rb_ary_push(current_row, con);
  }
	break;
	case 20:
#line 188 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/en_scouse.c.rl"
	{
    rb_funcall(listener, rb_intern("row"), 2, current_row, INT2FIX(lexer->current_line));
  }
	break;
	case 21:
#line 192 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/en_scouse.c.rl"
	{
    if (cs < lexer_first_final) {
      if (raise_lexer_error != NULL) {
        size_t count = 0;
        int newstr_count = 0;
        size_t len;
        const char *buff;
        if (lexer->last_newline != 0) {
          len = LEN(last_newline, eof);
          buff = PTR_TO(last_newline);
        } else {
          len = strlen(data);
          buff = data;
        }

        char newstr[len]; 

        for (count = 0; count < len; count++) {
          if(buff[count] == 10) {
            newstr[newstr_count] = '\0'; // terminate new string at first newline found
            break;
          } else {
            if (buff[count] == '%') {
              newstr[newstr_count++] = buff[count];
              newstr[newstr_count] = buff[count];
            } else {
              newstr[newstr_count] = buff[count];
            }
          }
          newstr_count++;
        }

        int line = lexer->line_number;
        lexer_init(lexer); // Re-initialize so we can scan again with the same lexer
        raise_lexer_error(newstr, line);
      }
    } else {
      rb_funcall(listener, rb_intern("eof"), 0);
    }
  }
	break;
#line 1380 "ext/gherkin_lexer_en_scouse/gherkin_lexer_en_scouse.c"
		}
	}

_again:
	if ( cs == 0 )
		goto _out;
	if ( ++p != pe )
		goto _resume;
	_test_eof: {}
	if ( p == eof )
	{
	const char *__acts = _lexer_actions + _lexer_eof_actions[cs];
	unsigned int __nacts = (unsigned int) *__acts++;
	while ( __nacts-- > 0 ) {
		switch ( *__acts++ ) {
	case 21:
#line 192 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/en_scouse.c.rl"
	{
    if (cs < lexer_first_final) {
      if (raise_lexer_error != NULL) {
        size_t count = 0;
        int newstr_count = 0;
        size_t len;
        const char *buff;
        if (lexer->last_newline != 0) {
          len = LEN(last_newline, eof);
          buff = PTR_TO(last_newline);
        } else {
          len = strlen(data);
          buff = data;
        }

        char newstr[len]; 

        for (count = 0; count < len; count++) {
          if(buff[count] == 10) {
            newstr[newstr_count] = '\0'; // terminate new string at first newline found
            break;
          } else {
            if (buff[count] == '%') {
              newstr[newstr_count++] = buff[count];
              newstr[newstr_count] = buff[count];
            } else {
              newstr[newstr_count] = buff[count];
            }
          }
          newstr_count++;
        }

        int line = lexer->line_number;
        lexer_init(lexer); // Re-initialize so we can scan again with the same lexer
        raise_lexer_error(newstr, line);
      }
    } else {
      rb_funcall(listener, rb_intern("eof"), 0);
    }
  }
	break;
#line 1439 "ext/gherkin_lexer_en_scouse/gherkin_lexer_en_scouse.c"
		}
	}
	}

	_out: {}
	}

#line 392 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/en_scouse.c.rl"

    assert(p <= pe && "data overflow after parsing execute");
    assert(lexer->content_start <= len && "content starts after data end");
    assert(lexer->mark < len && "mark is after data end");
    
    // Reset lexer by re-initializing the whole thing
    lexer_init(lexer);

    if (cs == lexer_error) {
      rb_raise(rb_eGherkinLexingError, "Invalid format, lexing fails.");
    } else {
      return Qtrue;
    }
  }
}

void Init_gherkin_lexer_en_scouse()
{
  mGherkin = rb_define_module("Gherkin");
  rb_eGherkinLexingError = rb_const_get(mGherkin, rb_intern("LexingError"));

  mCLexer = rb_define_module_under(mGherkin, "CLexer");
  cI18nLexer = rb_define_class_under(mCLexer, "En_scouse", rb_cObject);
  rb_define_alloc_func(cI18nLexer, CLexer_alloc);
  rb_define_method(cI18nLexer, "initialize", CLexer_init, 1);
  rb_define_method(cI18nLexer, "scan", CLexer_scan, 1);
}