scanner.c.g2 1.68 MB
Newer Older
1

2
/*  Copyright (C) 2017 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
#include <arpa/inet.h>
#include <fcntl.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <libgen.h>
#include <math.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
33 34

#include "zscanner/scanner.h"
Daniel Salzman's avatar
Daniel Salzman committed
35
#include "zscanner/functions.h"
Lubos Slovak's avatar
Lubos Slovak committed
36
#include "libknot/descriptor.h"
37 38

/*! \brief Shorthand for setting warning data. */
39
#define WARN(err_code) { s->error.code = err_code; }
40
/*! \brief Shorthand for setting error data. */
41 42 43
#define ERR(err_code) { WARN(err_code); s->error.fatal = true; }
/*! \brief Shorthand for error reset. */
#define NOERR { WARN(ZS_OK); s->error.fatal = false; }
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62

/*!
 * \brief Writes record type number to r_data.
 *
 * \param type		Type number.
 * \param rdata_tail	Position where to write type number to.
 */
static inline void type_num(const uint16_t type, uint8_t **rdata_tail)
{
	*((uint16_t *)*rdata_tail) = htons(type);
	*rdata_tail += 2;
}

/*!
 * \brief Sets bit to bitmap window.
 *
 * \param type		Type number.
 * \param s		Scanner context.
 */
Daniel Salzman's avatar
Daniel Salzman committed
63
static inline void window_add_bit(const uint16_t type, zs_scanner_t *s) {
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
	uint8_t win      = type / 256;
	uint8_t bit_pos  = type % 256;
	uint8_t byte_pos = bit_pos / 8;

	((s->windows[win]).bitmap)[byte_pos] |= 128 >> (bit_pos % 8);

	if ((s->windows[win]).length < byte_pos + 1) {
		(s->windows[win]).length = byte_pos + 1;
	}

	if (s->last_window < win) {
		s->last_window = win;
	}
}

// Include scanner file (in Ragel).






86
__attribute__((visibility("default")))
87 88 89 90 91
int zs_init(
	zs_scanner_t *s,
	const char *origin,
	const uint16_t rclass,
	const uint32_t ttl)
92
{
93
	if (s == NULL) {
94
		return -1;
95 96
	}

97 98
	memset(s, 0, sizeof(*s));

99
	// Nonzero initial scanner state.
100
	s->cs = 1127;
101

102 103
	// Reset the file descriptor.
	s->file.descriptor = -1;
104

105 106 107 108
	// Use the root zone as origin if not specified.
	if (origin == NULL || strlen(origin) == 0) {
		origin = ".";
	}
Daniel Salzman's avatar
Daniel Salzman committed
109
	size_t origin_len = strlen(origin);
110 111 112 113

	// Prepare a zone settings header.
	const char *format;
	if (origin[origin_len - 1] != '.') {
Daniel Salzman's avatar
Daniel Salzman committed
114 115 116 117
		format = "$ORIGIN %s.\n";
	} else {
		format = "$ORIGIN %s\n";
	}
118 119

	char settings[1024];
Daniel Salzman's avatar
Daniel Salzman committed
120
	int ret = snprintf(settings, sizeof(settings), format, origin);
121 122 123 124 125 126 127 128 129
	if (ret <= 0 || ret >= sizeof(settings)) {
		ERR(ZS_ENOMEM);
		return -1;
	}

	// Parse the settings to set up the scanner origin.
	if (zs_set_input_string(s, settings, ret) != 0 ||
	    zs_parse_all(s) != 0) {
		return -1;
130 131 132
	}

	// Set scanner defaults.
133 134 135 136 137
	s->path = strdup(".");
	if (s->path == NULL) {
		ERR(ZS_ENOMEM);
		return -1;
	}
138 139 140 141
	s->default_class = rclass;
	s->default_ttl = ttl;
	s->line_counter = 1;

142
	s->state = ZS_STATE_NONE;
143 144 145 146 147
	s->process.automatic = false;

	return 0;
}

148
static void input_deinit(
149 150
	zs_scanner_t *s,
	bool keep_filename)
151
{
152 153 154 155 156 157 158 159 160 161 162
	// Deinit the file input.
	if (s->file.descriptor != -1) {
		// Unmap the file content.
		if (s->input.start != NULL) {
			munmap((void *)s->input.start,
			       s->input.end - s->input.start);
		}

		// Close the opened file.
		close(s->file.descriptor);
		s->file.descriptor = -1;
163 164 165 166
	}

	// Keep file name for possible trailing error report.
	if (!keep_filename) {
167
		free(s->file.name);
168
		s->file.name = NULL;
169 170
	}

171 172 173 174 175
	// Unset the input limits.
	s->input.start   = NULL;
	s->input.current = NULL;
	s->input.end     = NULL;
	s->input.eof     = false;
176 177 178 179 180 181 182 183 184 185
}

__attribute__((visibility("default")))
void zs_deinit(
	zs_scanner_t *s)
{
	if (s == NULL) {
		return;
	}

186
	input_deinit(s, false);
187
	free(s->path);
188 189
}

190
static int set_input_string(
191 192
	zs_scanner_t *s,
	const char *input,
193 194
	size_t size,
	bool final_block)
195
{
196 197 198 199 200 201 202 203 204
	if (s == NULL) {
		return -1;
	}

	if (input == NULL) {
		ERR(ZS_EINVAL);
		return -1;
	}

205 206
	// Deinit possibly opened file.
	input_deinit(s, final_block);
207 208 209 210 211

	// Set the scanner input limits.
	s->input.start   = input;
	s->input.current = input;
	s->input.end     = input + size;
212
	s->input.eof     = final_block;
213

214 215 216
	return 0;
}

217 218 219 220 221 222 223 224 225
__attribute__((visibility("default")))
int zs_set_input_string(
	zs_scanner_t *s,
	const char *input,
	size_t size)
{
	return set_input_string(s, input, size, false);
}

226 227 228 229 230 231 232 233 234 235 236 237 238 239 240
__attribute__((visibility("default")))
int zs_set_input_file(
	zs_scanner_t *s,
	const char *file_name)
{
	if (s == NULL) {
		return -1;
	}

	if (file_name == NULL) {
		ERR(ZS_EINVAL);
		return -1;
	}

	// Deinit possibly opened file.
241
	input_deinit(s, false);
242 243 244 245 246 247 248 249 250 251 252 253 254

	// Try to open the file.
	s->file.descriptor = open(file_name, O_RDONLY);
	if (s->file.descriptor == -1) {
		ERR(ZS_FILE_OPEN);
		return -1;
	}

	// Check for regular file input.
	struct stat file_stat;
	if (fstat(s->file.descriptor, &file_stat) == -1 ||
	    !S_ISREG(file_stat.st_mode)) {
		ERR(ZS_FILE_INVALID);
255
		input_deinit(s, false);
256
		return -1;
257 258 259 260 261
	}

	// Check for empty file (cannot mmap).
	if (file_stat.st_size > 0) {
		// Map the file to the memory.
262 263
		char *start = mmap(0, file_stat.st_size, PROT_READ, MAP_SHARED,
		                   s->file.descriptor, 0);
264 265
		if (start == MAP_FAILED) {
			ERR(ZS_FILE_MMAP);
266
			input_deinit(s, false);
267
			return -1;
268 269 270 271
		}

		// Try to set the mapped memory advise to sequential.
		(void)madvise(start, file_stat.st_size, MADV_SEQUENTIAL);
272 273 274 275 276

		// Set the scanner input limits.
		s->input.start   = start;
		s->input.current = start;
		s->input.end     = start + file_stat.st_size;
277 278 279 280 281
	}

	// Get absolute path of the zone file.
	char *full_name = realpath(file_name, NULL);
	if (full_name != NULL) {
282
		free(s->path);
283 284 285 286
		s->path = strdup(dirname(full_name));
		free(full_name);
		if (s->path == NULL) {
			ERR(ZS_ENOMEM);
287
			input_deinit(s, false);
288
			return -1;
289 290 291
		}
	} else {
		ERR(ZS_FILE_PATH);
292
		input_deinit(s, false);
293
		return -1;
294
	}
295 296 297 298

	s->file.name = strdup(file_name);
	if (s->file.name == NULL) {
		ERR(ZS_ENOMEM);
299
		input_deinit(s, false);
300
		return -1;
301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321
	}

	return 0;
}

__attribute__((visibility("default")))
int zs_set_processing(
	zs_scanner_t *s,
	void (*process_record)(zs_scanner_t *),
	void (*process_error)(zs_scanner_t *),
	void *data)
{
	if (s == NULL) {
		return -1;
	}

	s->process.record = process_record;
	s->process.error = process_error;
	s->process.data = data;

	return 0;
322 323
}

324 325 326 327 328 329
typedef enum {
	WRAP_NONE,     // Initial state.
	WRAP_DETECTED, // Input block end is a first '\' in rdata.
	WRAP_PROCESS   // Parsing of auxiliary block = "\".
} wrap_t;

330
static void parse(
331 332
	zs_scanner_t *s,
	wrap_t *wrap)
333
{
334 335 336 337 338 339 340 341 342 343
	// Restore scanner input limits (Ragel internals).
	const char *p = s->input.current;
	const char *pe = s->input.end;
	const char *eof = s->input.eof ? pe : NULL;

	// Restore state variables (Ragel internals).
	int cs  = s->cs;
	int top = s->top;
	int stack[RAGEL_STACK_SIZE];
	memcpy(stack, s->stack, sizeof(stack));
344 345 346 347 348 349 350 351 352 353 354 355 356 357

	// Auxiliary variables which are used in scanner body.
	struct in_addr  addr4;
	struct in6_addr addr6;
	uint32_t timestamp;
	int16_t  window;
	int      ret;

	// Next 2 variables are for better performance.
	// Restoring r_data pointer to next free space.
	uint8_t *rdata_tail = s->r_data + s->r_data_tail;
	// Initialization of the last r_data byte.
	uint8_t *rdata_stop = s->r_data + MAX_RDATA_LENGTH - 1;

358
	// Write scanner body (in C).
359

360 361 362 363 364 365 366 367
	{
	short _widec;
	if ( p == pe )
		goto _test_eof;
	goto _resume;

_again:
	switch ( cs ) {
368
		case 1127: goto st1127;
369 370 371 372 373 374 375 376 377 378 379 380 381 382
		case 0: goto st0;
		case 1: goto st1;
		case 2: goto st2;
		case 3: goto st3;
		case 4: goto st4;
		case 5: goto st5;
		case 6: goto st6;
		case 7: goto st7;
		case 8: goto st8;
		case 9: goto st9;
		case 10: goto st10;
		case 11: goto st11;
		case 12: goto st12;
		case 13: goto st13;
383
		case 1128: goto st1128;
384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511
		case 14: goto st14;
		case 15: goto st15;
		case 16: goto st16;
		case 17: goto st17;
		case 18: goto st18;
		case 19: goto st19;
		case 20: goto st20;
		case 21: goto st21;
		case 22: goto st22;
		case 23: goto st23;
		case 24: goto st24;
		case 25: goto st25;
		case 26: goto st26;
		case 27: goto st27;
		case 28: goto st28;
		case 29: goto st29;
		case 30: goto st30;
		case 31: goto st31;
		case 32: goto st32;
		case 33: goto st33;
		case 34: goto st34;
		case 35: goto st35;
		case 36: goto st36;
		case 37: goto st37;
		case 38: goto st38;
		case 39: goto st39;
		case 40: goto st40;
		case 41: goto st41;
		case 42: goto st42;
		case 43: goto st43;
		case 44: goto st44;
		case 45: goto st45;
		case 46: goto st46;
		case 47: goto st47;
		case 48: goto st48;
		case 49: goto st49;
		case 50: goto st50;
		case 51: goto st51;
		case 52: goto st52;
		case 53: goto st53;
		case 54: goto st54;
		case 55: goto st55;
		case 56: goto st56;
		case 57: goto st57;
		case 58: goto st58;
		case 59: goto st59;
		case 60: goto st60;
		case 61: goto st61;
		case 62: goto st62;
		case 63: goto st63;
		case 64: goto st64;
		case 65: goto st65;
		case 66: goto st66;
		case 67: goto st67;
		case 68: goto st68;
		case 69: goto st69;
		case 70: goto st70;
		case 71: goto st71;
		case 72: goto st72;
		case 73: goto st73;
		case 74: goto st74;
		case 75: goto st75;
		case 76: goto st76;
		case 77: goto st77;
		case 78: goto st78;
		case 79: goto st79;
		case 80: goto st80;
		case 81: goto st81;
		case 82: goto st82;
		case 83: goto st83;
		case 84: goto st84;
		case 85: goto st85;
		case 86: goto st86;
		case 87: goto st87;
		case 88: goto st88;
		case 89: goto st89;
		case 90: goto st90;
		case 91: goto st91;
		case 92: goto st92;
		case 93: goto st93;
		case 94: goto st94;
		case 95: goto st95;
		case 96: goto st96;
		case 97: goto st97;
		case 98: goto st98;
		case 99: goto st99;
		case 100: goto st100;
		case 101: goto st101;
		case 102: goto st102;
		case 103: goto st103;
		case 104: goto st104;
		case 105: goto st105;
		case 106: goto st106;
		case 107: goto st107;
		case 108: goto st108;
		case 109: goto st109;
		case 110: goto st110;
		case 111: goto st111;
		case 112: goto st112;
		case 113: goto st113;
		case 114: goto st114;
		case 115: goto st115;
		case 116: goto st116;
		case 117: goto st117;
		case 118: goto st118;
		case 119: goto st119;
		case 120: goto st120;
		case 121: goto st121;
		case 122: goto st122;
		case 123: goto st123;
		case 124: goto st124;
		case 125: goto st125;
		case 126: goto st126;
		case 127: goto st127;
		case 128: goto st128;
		case 129: goto st129;
		case 130: goto st130;
		case 131: goto st131;
		case 132: goto st132;
		case 133: goto st133;
		case 134: goto st134;
		case 135: goto st135;
		case 136: goto st136;
		case 137: goto st137;
		case 138: goto st138;
		case 139: goto st139;
		case 140: goto st140;
		case 141: goto st141;
512
		case 1129: goto st1129;
513 514 515 516 517 518 519 520 521 522
		case 142: goto st142;
		case 143: goto st143;
		case 144: goto st144;
		case 145: goto st145;
		case 146: goto st146;
		case 147: goto st147;
		case 148: goto st148;
		case 149: goto st149;
		case 150: goto st150;
		case 151: goto st151;
523
		case 1130: goto st1130;
524 525 526 527 528 529 530 531
		case 152: goto st152;
		case 153: goto st153;
		case 154: goto st154;
		case 155: goto st155;
		case 156: goto st156;
		case 157: goto st157;
		case 158: goto st158;
		case 159: goto st159;
532
		case 1131: goto st1131;
533 534 535
		case 160: goto st160;
		case 161: goto st161;
		case 162: goto st162;
536
		case 1132: goto st1132;
537 538 539 540 541 542 543 544 545 546 547
		case 163: goto st163;
		case 164: goto st164;
		case 165: goto st165;
		case 166: goto st166;
		case 167: goto st167;
		case 168: goto st168;
		case 169: goto st169;
		case 170: goto st170;
		case 171: goto st171;
		case 172: goto st172;
		case 173: goto st173;
548
		case 1133: goto st1133;
549 550 551 552
		case 174: goto st174;
		case 175: goto st175;
		case 176: goto st176;
		case 177: goto st177;
553
		case 1134: goto st1134;
554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569
		case 178: goto st178;
		case 179: goto st179;
		case 180: goto st180;
		case 181: goto st181;
		case 182: goto st182;
		case 183: goto st183;
		case 184: goto st184;
		case 185: goto st185;
		case 186: goto st186;
		case 187: goto st187;
		case 188: goto st188;
		case 189: goto st189;
		case 190: goto st190;
		case 191: goto st191;
		case 192: goto st192;
		case 193: goto st193;
570
		case 1135: goto st1135;
571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586
		case 194: goto st194;
		case 195: goto st195;
		case 196: goto st196;
		case 197: goto st197;
		case 198: goto st198;
		case 199: goto st199;
		case 200: goto st200;
		case 201: goto st201;
		case 202: goto st202;
		case 203: goto st203;
		case 204: goto st204;
		case 205: goto st205;
		case 206: goto st206;
		case 207: goto st207;
		case 208: goto st208;
		case 209: goto st209;
587
		case 1136: goto st1136;
588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647
		case 210: goto st210;
		case 211: goto st211;
		case 212: goto st212;
		case 213: goto st213;
		case 214: goto st214;
		case 215: goto st215;
		case 216: goto st216;
		case 217: goto st217;
		case 218: goto st218;
		case 219: goto st219;
		case 220: goto st220;
		case 221: goto st221;
		case 222: goto st222;
		case 223: goto st223;
		case 224: goto st224;
		case 225: goto st225;
		case 226: goto st226;
		case 227: goto st227;
		case 228: goto st228;
		case 229: goto st229;
		case 230: goto st230;
		case 231: goto st231;
		case 232: goto st232;
		case 233: goto st233;
		case 234: goto st234;
		case 235: goto st235;
		case 236: goto st236;
		case 237: goto st237;
		case 238: goto st238;
		case 239: goto st239;
		case 240: goto st240;
		case 241: goto st241;
		case 242: goto st242;
		case 243: goto st243;
		case 244: goto st244;
		case 245: goto st245;
		case 246: goto st246;
		case 247: goto st247;
		case 248: goto st248;
		case 249: goto st249;
		case 250: goto st250;
		case 251: goto st251;
		case 252: goto st252;
		case 253: goto st253;
		case 254: goto st254;
		case 255: goto st255;
		case 256: goto st256;
		case 257: goto st257;
		case 258: goto st258;
		case 259: goto st259;
		case 260: goto st260;
		case 261: goto st261;
		case 262: goto st262;
		case 263: goto st263;
		case 264: goto st264;
		case 265: goto st265;
		case 266: goto st266;
		case 267: goto st267;
		case 268: goto st268;
		case 269: goto st269;
648
		case 1137: goto st1137;
649 650
		case 270: goto st270;
		case 271: goto st271;
651
		case 1138: goto st1138;
652 653 654 655 656 657 658 659 660
		case 272: goto st272;
		case 273: goto st273;
		case 274: goto st274;
		case 275: goto st275;
		case 276: goto st276;
		case 277: goto st277;
		case 278: goto st278;
		case 279: goto st279;
		case 280: goto st280;
661 662
		case 1139: goto st1139;
		case 1140: goto st1140;
663 664 665 666 667 668 669 670 671 672 673 674 675 676
		case 281: goto st281;
		case 282: goto st282;
		case 283: goto st283;
		case 284: goto st284;
		case 285: goto st285;
		case 286: goto st286;
		case 287: goto st287;
		case 288: goto st288;
		case 289: goto st289;
		case 290: goto st290;
		case 291: goto st291;
		case 292: goto st292;
		case 293: goto st293;
		case 294: goto st294;
677
		case 1141: goto st1141;
678 679 680 681 682 683 684 685 686 687
		case 295: goto st295;
		case 296: goto st296;
		case 297: goto st297;
		case 298: goto st298;
		case 299: goto st299;
		case 300: goto st300;
		case 301: goto st301;
		case 302: goto st302;
		case 303: goto st303;
		case 304: goto st304;
688
		case 1142: goto st1142;
689 690 691 692 693 694 695 696 697 698 699 700 701 702
		case 305: goto st305;
		case 306: goto st306;
		case 307: goto st307;
		case 308: goto st308;
		case 309: goto st309;
		case 310: goto st310;
		case 311: goto st311;
		case 312: goto st312;
		case 313: goto st313;
		case 314: goto st314;
		case 315: goto st315;
		case 316: goto st316;
		case 317: goto st317;
		case 318: goto st318;
703
		case 1143: goto st1143;
704 705 706 707 708 709 710
		case 319: goto st319;
		case 320: goto st320;
		case 321: goto st321;
		case 322: goto st322;
		case 323: goto st323;
		case 324: goto st324;
		case 325: goto st325;
711
		case 1144: goto st1144;
712 713 714 715 716 717 718 719 720
		case 326: goto st326;
		case 327: goto st327;
		case 328: goto st328;
		case 329: goto st329;
		case 330: goto st330;
		case 331: goto st331;
		case 332: goto st332;
		case 333: goto st333;
		case 334: goto st334;
721 722 723
		case 1145: goto st1145;
		case 1146: goto st1146;
		case 1147: goto st1147;
724 725 726 727 728 729 730 731
		case 335: goto st335;
		case 336: goto st336;
		case 337: goto st337;
		case 338: goto st338;
		case 339: goto st339;
		case 340: goto st340;
		case 341: goto st341;
		case 342: goto st342;
732 733
		case 1148: goto st1148;
		case 1149: goto st1149;
734 735 736
		case 343: goto st343;
		case 344: goto st344;
		case 345: goto st345;
737
		case 1150: goto st1150;
738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843
		case 346: goto st346;
		case 347: goto st347;
		case 348: goto st348;
		case 349: goto st349;
		case 350: goto st350;
		case 351: goto st351;
		case 352: goto st352;
		case 353: goto st353;
		case 354: goto st354;
		case 355: goto st355;
		case 356: goto st356;
		case 357: goto st357;
		case 358: goto st358;
		case 359: goto st359;
		case 360: goto st360;
		case 361: goto st361;
		case 362: goto st362;
		case 363: goto st363;
		case 364: goto st364;
		case 365: goto st365;
		case 366: goto st366;
		case 367: goto st367;
		case 368: goto st368;
		case 369: goto st369;
		case 370: goto st370;
		case 371: goto st371;
		case 372: goto st372;
		case 373: goto st373;
		case 374: goto st374;
		case 375: goto st375;
		case 376: goto st376;
		case 377: goto st377;
		case 378: goto st378;
		case 379: goto st379;
		case 380: goto st380;
		case 381: goto st381;
		case 382: goto st382;
		case 383: goto st383;
		case 384: goto st384;
		case 385: goto st385;
		case 386: goto st386;
		case 387: goto st387;
		case 388: goto st388;
		case 389: goto st389;
		case 390: goto st390;
		case 391: goto st391;
		case 392: goto st392;
		case 393: goto st393;
		case 394: goto st394;
		case 395: goto st395;
		case 396: goto st396;
		case 397: goto st397;
		case 398: goto st398;
		case 399: goto st399;
		case 400: goto st400;
		case 401: goto st401;
		case 402: goto st402;
		case 403: goto st403;
		case 404: goto st404;
		case 405: goto st405;
		case 406: goto st406;
		case 407: goto st407;
		case 408: goto st408;
		case 409: goto st409;
		case 410: goto st410;
		case 411: goto st411;
		case 412: goto st412;
		case 413: goto st413;
		case 414: goto st414;
		case 415: goto st415;
		case 416: goto st416;
		case 417: goto st417;
		case 418: goto st418;
		case 419: goto st419;
		case 420: goto st420;
		case 421: goto st421;
		case 422: goto st422;
		case 423: goto st423;
		case 424: goto st424;
		case 425: goto st425;
		case 426: goto st426;
		case 427: goto st427;
		case 428: goto st428;
		case 429: goto st429;
		case 430: goto st430;
		case 431: goto st431;
		case 432: goto st432;
		case 433: goto st433;
		case 434: goto st434;
		case 435: goto st435;
		case 436: goto st436;
		case 437: goto st437;
		case 438: goto st438;
		case 439: goto st439;
		case 440: goto st440;
		case 441: goto st441;
		case 442: goto st442;
		case 443: goto st443;
		case 444: goto st444;
		case 445: goto st445;
		case 446: goto st446;
		case 447: goto st447;
		case 448: goto st448;
		case 449: goto st449;
		case 450: goto st450;
		case 451: goto st451;
844
		case 452: goto st452;
845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866
		case 453: goto st453;
		case 454: goto st454;
		case 455: goto st455;
		case 456: goto st456;
		case 457: goto st457;
		case 458: goto st458;
		case 459: goto st459;
		case 460: goto st460;
		case 461: goto st461;
		case 462: goto st462;
		case 463: goto st463;
		case 464: goto st464;
		case 465: goto st465;
		case 466: goto st466;
		case 467: goto st467;
		case 468: goto st468;
		case 469: goto st469;
		case 470: goto st470;
		case 471: goto st471;
		case 472: goto st472;
		case 473: goto st473;
		case 474: goto st474;
867 868 869
		case 1151: goto st1151;
		case 1152: goto st1152;
		case 1153: goto st1153;
870 871 872 873 874
		case 475: goto st475;
		case 476: goto st476;
		case 477: goto st477;
		case 478: goto st478;
		case 479: goto st479;
875
		case 1154: goto st1154;
876 877 878 879
		case 480: goto st480;
		case 481: goto st481;
		case 482: goto st482;
		case 483: goto st483;
880 881 882
		case 1155: goto st1155;
		case 1156: goto st1156;
		case 1157: goto st1157;
883 884
		case 484: goto st484;
		case 485: goto st485;
885
		case 1158: goto st1158;
886 887 888
		case 486: goto st486;
		case 487: goto st487;
		case 488: goto st488;
889
		case 1159: goto st1159;
890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993
		case 489: goto st489;
		case 490: goto st490;
		case 491: goto st491;
		case 492: goto st492;
		case 493: goto st493;
		case 494: goto st494;
		case 495: goto st495;
		case 496: goto st496;
		case 497: goto st497;
		case 498: goto st498;
		case 499: goto st499;
		case 500: goto st500;
		case 501: goto st501;
		case 502: goto st502;
		case 503: goto st503;
		case 504: goto st504;
		case 505: goto st505;
		case 506: goto st506;
		case 507: goto st507;
		case 508: goto st508;
		case 509: goto st509;
		case 510: goto st510;
		case 511: goto st511;
		case 512: goto st512;
		case 513: goto st513;
		case 514: goto st514;
		case 515: goto st515;
		case 516: goto st516;
		case 517: goto st517;
		case 518: goto st518;
		case 519: goto st519;
		case 520: goto st520;
		case 521: goto st521;
		case 522: goto st522;
		case 523: goto st523;
		case 524: goto st524;
		case 525: goto st525;
		case 526: goto st526;
		case 527: goto st527;
		case 528: goto st528;
		case 529: goto st529;
		case 530: goto st530;
		case 531: goto st531;
		case 532: goto st532;
		case 533: goto st533;
		case 534: goto st534;
		case 535: goto st535;
		case 536: goto st536;
		case 537: goto st537;
		case 538: goto st538;
		case 539: goto st539;
		case 540: goto st540;
		case 541: goto st541;
		case 542: goto st542;
		case 543: goto st543;
		case 544: goto st544;
		case 545: goto st545;
		case 546: goto st546;
		case 547: goto st547;
		case 548: goto st548;
		case 549: goto st549;
		case 550: goto st550;
		case 551: goto st551;
		case 552: goto st552;
		case 553: goto st553;
		case 554: goto st554;
		case 555: goto st555;
		case 556: goto st556;
		case 557: goto st557;
		case 558: goto st558;
		case 559: goto st559;
		case 560: goto st560;
		case 561: goto st561;
		case 562: goto st562;
		case 563: goto st563;
		case 564: goto st564;
		case 565: goto st565;
		case 566: goto st566;
		case 567: goto st567;
		case 568: goto st568;
		case 569: goto st569;
		case 570: goto st570;
		case 571: goto st571;
		case 572: goto st572;
		case 573: goto st573;
		case 574: goto st574;
		case 575: goto st575;
		case 576: goto st576;
		case 577: goto st577;
		case 578: goto st578;
		case 579: goto st579;
		case 580: goto st580;
		case 581: goto st581;
		case 582: goto st582;
		case 583: goto st583;
		case 584: goto st584;
		case 585: goto st585;
		case 586: goto st586;
		case 587: goto st587;
		case 588: goto st588;
		case 589: goto st589;
		case 590: goto st590;
		case 591: goto st591;
		case 592: goto st592;
994
		case 1160: goto st1160;
995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035
		case 593: goto st593;
		case 594: goto st594;
		case 595: goto st595;
		case 596: goto st596;
		case 597: goto st597;
		case 598: goto st598;
		case 599: goto st599;
		case 600: goto st600;
		case 601: goto st601;
		case 602: goto st602;
		case 603: goto st603;
		case 604: goto st604;
		case 605: goto st605;
		case 606: goto st606;
		case 607: goto st607;
		case 608: goto st608;
		case 609: goto st609;
		case 610: goto st610;
		case 611: goto st611;
		case 612: goto st612;
		case 613: goto st613;
		case 614: goto st614;
		case 615: goto st615;
		case 616: goto st616;
		case 617: goto st617;
		case 618: goto st618;
		case 619: goto st619;
		case 620: goto st620;
		case 621: goto st621;
		case 622: goto st622;
		case 623: goto st623;
		case 624: goto st624;
		case 625: goto st625;
		case 626: goto st626;
		case 627: goto st627;
		case 628: goto st628;
		case 629: goto st629;
		case 630: goto st630;
		case 631: goto st631;
		case 632: goto st632;
		case 633: goto st633;
1036
		case 1161: goto st1161;
1037 1038
		case 634: goto st634;
		case 635: goto st635;
1039
		case 1162: goto st1162;
1040 1041 1042 1043 1044 1045 1046 1047 1048 1049
		case 636: goto st636;
		case 637: goto st637;
		case 638: goto st638;
		case 639: goto st639;
		case 640: goto st640;
		case 641: goto st641;
		case 642: goto st642;
		case 643: goto st643;
		case 644: goto st644;
		case 645: goto st645;
1050
		case 646: goto st646;
1051 1052 1053
		case 647: goto st647;
		case 648: goto st648;
		case 649: goto st649;
1054
		case 1163: goto st1163;
1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076
		case 650: goto st650;
		case 651: goto st651;
		case 652: goto st652;
		case 653: goto st653;
		case 654: goto st654;
		case 655: goto st655;
		case 656: goto st656;
		case 657: goto st657;
		case 658: goto st658;
		case 659: goto st659;
		case 660: goto st660;
		case 661: goto st661;
		case 662: goto st662;
		case 663: goto st663;
		case 664: goto st664;
		case 665: goto st665;
		case 666: goto st666;
		case 667: goto st667;
		case 668: goto st668;
		case 669: goto st669;
		case 670: goto st670;
		case 671: goto st671;
1077
		case 1164: goto st1164;
1078 1079 1080 1081 1082
		case 672: goto st672;
		case 673: goto st673;
		case 674: goto st674;
		case 675: goto st675;
		case 676: goto st676;
1083
		case 1165: goto st1165;
1084 1085 1086 1087 1088
		case 677: goto st677;
		case 678: goto st678;
		case 679: goto st679;
		case 680: goto st680;
		case 681: goto st681;
1089
		case 1166: goto st1166;
1090 1091 1092 1093 1094
		case 682: goto st682;
		case 683: goto st683;
		case 684: goto st684;
		case 685: goto st685;
		case 686: goto st686;
1095 1096 1097
		case 1167: goto st1167;
		case 1168: goto st1168;
		case 1169: goto st1169;
1098 1099
		case 687: goto st687;
		case 688: goto st688;
1100
		case 1170: goto st1170;
1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127
		case 689: goto st689;
		case 690: goto st690;
		case 691: goto st691;
		case 692: goto st692;
		case 693: goto st693;
		case 694: goto st694;
		case 695: goto st695;
		case 696: goto st696;
		case 697: goto st697;
		case 698: goto st698;
		case 699: goto st699;
		case 700: goto st700;
		case 701: goto st701;
		case 702: goto st702;
		case 703: goto st703;
		case 704: goto st704;
		case 705: goto st705;
		case 706: goto st706;
		case 707: goto st707;
		case 708: goto st708;
		case 709: goto st709;
		case 710: goto st710;
		case 711: goto st711;
		case 712: goto st712;
		case 713: goto st713;
		case 714: goto st714;
		case 715: goto st715;
1128 1129 1130
		case 1171: goto st1171;
		case 1172: goto st1172;
		case 1173: goto st1173;
1131 1132 1133
		case 716: goto st716;
		case 717: goto st717;
		case 718: goto st718;
1134 1135
		case 1174: goto st1174;
		case 1175: goto st1175;
1136 1137 1138 1139
		case 719: goto st719;
		case 720: goto st720;
		case 721: goto st721;
		case 722: goto st722;
1140 1141
		case 1176: goto st1176;
		case 1177: goto st1177;
1142 1143 1144 1145
		case 723: goto st723;
		case 724: goto st724;
		case 725: goto st725;
		case 726: goto st726;
1146 1147
		case 1178: goto st1178;
		case 1179: goto st1179;
1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172
		case 727: goto st727;
		case 728: goto st728;
		case 729: goto st729;
		case 730: goto st730;
		case 731: goto st731;
		case 732: goto st732;
		case 733: goto st733;
		case 734: goto st734;
		case 735: goto st735;
		case 736: goto st736;
		case 737: goto st737;
		case 738: goto st738;
		case 739: goto st739;
		case 740: goto st740;
		case 741: goto st741;
		case 742: goto st742;
		case 743: goto st743;
		case 744: goto st744;
		case 745: goto st745;
		case 746: goto st746;
		case 747: goto st747;
		case 748: goto st748;
		case 749: goto st749;
		case 750: goto st750;
		case 751: goto st751;
1173
		case 1180: goto st1180;
1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188
		case 752: goto st752;
		case 753: goto st753;
		case 754: goto st754;
		case 755: goto st755;
		case 756: goto st756;
		case 757: goto st757;
		case 758: goto st758;
		case 759: goto st759;
		case 760: goto st760;
		case 761: goto st761;
		case 762: goto st762;
		case 763: goto st763;
		case 764: goto st764;
		case 765: goto st765;
		case 766: goto st766;
1189
		case 1181: goto st1181;
1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202
		case 767: goto st767;
		case 768: goto st768;
		case 769: goto st769;
		case 770: goto st770;
		case 771: goto st771;
		case 772: goto st772;
		case 773: goto st773;
		case 774: goto st774;
		case 775: goto st775;
		case 776: goto st776;
		case 777: goto st777;
		case 778: goto st778;
		case 779: goto st779;
1203
		case 1182: goto st1182;
1204 1205 1206 1207 1208 1209 1210 1211
		case 780: goto st780;
		case 781: goto st781;
		case 782: goto st782;
		case 783: goto st783;
		case 784: goto st784;
		case 785: goto st785;
		case 786: goto st786;
		case 787: goto st787;
1212 1213 1214
		case 788: goto st788;
		case 789: goto st789;
		case 790: goto st790;
1215 1216
		case 1183: goto st1183;
		case 1184: goto st1184;
1217 1218 1219
		case 791: goto st791;
		case 792: goto st792;
		case 793: goto st793;
1220
		case 1185: goto st1185;
1221 1222 1223 1224 1225 1226 1227 1228 1229 1230
		case 794: goto st794;
		case 795: goto st795;
		case 796: goto st796;
		case 797: goto st797;
		case 798: goto st798;
		case 799: goto st799;
		case 800: goto st800;
		case 801: goto st801;
		case 802: goto st802;
		case 803: goto st803;
1231 1232 1233
		case 1186: goto st1186;
		case 1187: goto st1187;
		case 1188: goto st1188;
1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244
		case 804: goto st804;
		case 805: goto st805;
		case 806: goto st806;
		case 807: goto st807;
		case 808: goto st808;
		case 809: goto st809;
		case 810: goto st810;
		case 811: goto st811;
		case 812: goto st812;
		case 813: goto st813;
		case 814: goto st814;
1245 1246 1247
		case 1189: goto st1189;
		case 1190: goto st1190;
		case 1191: goto st1191;
1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259
		case 815: goto st815;
		case 816: goto st816;
		case 817: goto st817;
		case 818: goto st818;
		case 819: goto st819;
		case 820: goto st820;
		case 821: goto st821;
		case 822: goto st822;
		case 823: goto st823;
		case 824: goto st824;
		case 825: goto st825;
		case 826: goto st826;
1260
		case 1192: goto st1192;
1261 1262 1263
		case 827: goto st827;
		case 828: goto st828;
		case 829: goto st829;
1264 1265
		case 1193: goto st1193;
		case 1194: goto st1194;
1266
		case 830: goto st830;
1267 1268
		case 1195: goto st1195;
		case 1196: goto st1196;
1269
		case 831: goto st831;
1270 1271
		case 1197: goto st1197;
		case 1198: goto st1198;
1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313
		case 832: goto st832;
		case 833: goto st833;
		case 834: goto st834;
		case 835: goto st835;
		case 836: goto st836;
		case 837: goto st837;
		case 838: goto st838;
		case 839: goto st839;
		case 840: goto st840;
		case 841: goto st841;
		case 842: goto st842;
		case 843: goto st843;
		case 844: goto st844;
		case 845: goto st845;
		case 846: goto st846;
		case 847: goto st847;
		case 848: goto st848;
		case 849: goto st849;
		case 850: goto st850;
		case 851: goto st851;
		case 852: goto st852;
		case 853: goto st853;
		case 854: goto st854;
		case 855: goto st855;
		case 856: goto st856;
		case 857: goto st857;
		case 858: goto st858;
		case 859: goto st859;
		case 860: goto st860;
		case 861: goto st861;
		case 862: goto st862;
		case 863: goto st863;
		case 864: goto st864;
		case 865: goto st865;
		case 866: goto st866;
		case 867: goto st867;
		case 868: goto st868;
		case 869: goto st869;
		case 870: goto st870;
		case 871: goto st871;
		case 872: goto st872;
		case 873: goto st873;
1314
		case 1199: goto st1199;
1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453
		case 874: goto st874;
		case 875: goto st875;
		case 876: goto st876;
		case 877: goto st877;
		case 878: goto st878;
		case 879: goto st879;
		case 880: goto st880;
		case 881: goto st881;
		case 882: goto st882;
		case 883: goto st883;
		case 884: goto st884;
		case 885: goto st885;
		case 886: goto st886;
		case 887: goto st887;
		case 888: goto st888;
		case 889: goto st889;
		case 890: goto st890;
		case 891: goto st891;
		case 892: goto st892;
		case 893: goto st893;
		case 894: goto st894;
		case 895: goto st895;
		case 896: goto st896;
		case 897: goto st897;
		case 898: goto st898;
		case 899: goto st899;
		case 900: goto st900;
		case 901: goto st901;
		case 902: goto st902;
		case 903: goto st903;
		case 904: goto st904;
		case 905: goto st905;
		case 906: goto st906;
		case 907: goto st907;
		case 908: goto st908;
		case 909: goto st909;
		case 910: goto st910;
		case 911: goto st911;
		case 912: goto st912;
		case 913: goto st913;
		case 914: goto st914;
		case 915: goto st915;
		case 916: goto st916;
		case 917: goto st917;
		case 918: goto st918;
		case 919: goto st919;
		case 920: goto st920;
		case 921: goto st921;
		case 922: goto st922;
		case 923: goto st923;
		case 924: goto st924;
		case 925: goto st925;
		case 926: goto st926;
		case 927: goto st927;
		case 928: goto st928;
		case 929: goto st929;
		case 930: goto st930;
		case 931: goto st931;
		case 932: goto st932;
		case 933: goto st933;
		case 934: goto st934;
		case 935: goto st935;
		case 936: goto st936;
		case 937: goto st937;
		case 938: goto st938;
		case 939: goto st939;
		case 940: goto st940;
		case 941: goto st941;
		case 942: goto st942;
		case 943: goto st943;
		case 944: goto st944;
		case 945: goto st945;
		case 946: goto st946;
		case 947: goto st947;
		case 948: goto st948;
		case 949: goto st949;
		case 950: goto st950;
		case 951: goto st951;
		case 952: goto st952;
		case 953: goto st953;
		case 954: goto st954;
		case 955: goto st955;
		case 956: goto st956;
		case 957: goto st957;
		case 958: goto st958;
		case 959: goto st959;
		case 960: goto st960;
		case 961: goto st961;
		case 962: goto st962;
		case 963: goto st963;
		case 964: goto st964;
		case 965: goto st965;
		case 966: goto st966;
		case 967: goto st967;
		case 968: goto st968;
		case 969: goto st969;
		case 970: goto st970;
		case 971: goto st971;
		case 972: goto st972;
		case 973: goto st973;
		case 974: goto st974;
		case 975: goto st975;
		case 976: goto st976;
		case 977: goto st977;
		case 978: goto st978;
		case 979: goto st979;
		case 980: goto st980;
		case 981: goto st981;
		case 982: goto st982;
		case 983: goto st983;
		case 984: goto st984;
		case 985: goto st985;
		case 986: goto st986;
		case 987: goto st987;
		case 988: goto st988;
		case 989: goto st989;
		case 990: goto st990;
		case 991: goto st991;
		case 992: goto st992;
		case 993: goto st993;
		case 994: goto st994;
		case 995: goto st995;
		case 996: goto st996;
		case 997: goto st997;
		case 998: goto st998;
		case 999: goto st999;
		case 1000: goto st1000;
		case 1001: goto st1001;
		case 1002: goto st1002;
		case 1003: goto st1003;
		case 1004: goto st1004;
		case 1005: goto st1005;
		case 1006: goto st1006;
		case 1007: goto st1007;
		case 1008: goto st1008;
		case 1009: goto st1009;
		case 1010: goto st1010;
		case 1011: goto st1011;
		case 1012: goto st1012;
1454
		case 1200: goto st1200;
1455 1456 1457 1458 1459 1460 1461 1462
		case 1013: goto st1013;
		case 1014: goto st1014;
		case 1015: goto st1015;
		case 1016: goto st1016;
		case 1017: goto st1017;
		case 1018: goto st1018;
		case 1019: goto st1019;
		case 1020: goto st1020;
1463
		case 1201: goto st1201;
1464 1465 1466 1467 1468
		case 1021: goto st1021;
		case 1022: goto st1022;
		case 1023: goto st1023;
		case 1024: goto st1024;
		case 1025: goto st1025;
1469
		case 1202: goto st1202;
1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487
		case 1026: goto st1026;
		case 1027: goto st1027;
		case 1028: goto st1028;
		case 1029: goto st1029;
		case 1030: goto st1030;
		case 1031: goto st1031;
		case 1032: goto st1032;
		case 1033: goto st1033;
		case 1034: goto st1034;
		case 1035: goto st1035;
		case 1036: goto st1036;
		case 1037: goto st1037;
		case 1038: goto st1038;
		case 1039: goto st1039;
		case 1040: goto st1040;
		case 1041: goto st1041;
		case 1042: goto st1042;
		case 1043: goto st1043;
1488
		case 1203: goto st1203;
1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500
		case 1044: goto st1044;
		case 1045: goto st1045;
		case 1046: goto st1046;
		case 1047: goto st1047;
		case 1048: goto st1048;
		case 1049: goto st1049;
		case 1050: goto st1050;
		case 1051: goto st1051;
		case 1052: goto st1052;
		case 1053: goto st1053;
		case 1054: goto st1054;
		case 1055: goto st1055;
1501 1502 1503 1504 1505 1506 1507
		case 1056: goto st1056;
		case 1057: goto st1057;
		case 1058: goto st1058;
		case 1059: goto st1059;
		case 1060: goto st1060;
		case 1061: goto st1061;
		case 1062: goto st1062;
1508
		case 1204: goto st1204;
1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522
		case 1063: goto st1063;
		case 1064: goto st1064;
		case 1065: goto st1065;
		case 1066: goto st1066;
		case 1067: goto st1067;
		case 1068: goto st1068;
		case 1069: goto st1069;
		case 1070: goto st1070;
		case 1071: goto st1071;
		case 1072: goto st1072;
		case 1073: goto st1073;
		case 1074: goto st1074;
		case 1075: goto st1075;
		case 1076: goto st1076;
1523
		case 1077: goto st1077;
1524 1525 1526
		case 1205: goto st1205;
		case 1206: goto st1206;
		case 1207: goto st1207;
1527 1528 1529 1530 1531 1532 1533
		case 1078: goto st1078;
		case 1079: goto st1079;
		case 1080: goto st1080;
		case 1081: goto st1081;
		case 1082: goto st1082;
		case 1083: goto st1083;
		case 1084: goto st1084;
1534
		case 1208: goto st1208;
1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547
		case 1085: goto st1085;
		case 1086: goto st1086;
		case 1087: goto st1087;
		case 1088: goto st1088;
		case 1089: goto st1089;
		case 1090: goto st1090;
		case 1091: goto st1091;
		case 1092: goto st1092;
		case 1093: goto st1093;
		case 1094: goto st1094;
		case 1095: goto st1095;
		case 1096: goto st1096;
		case 1097: goto st1097;
1548
		case 1209: goto st1209;
1549 1550 1551 1552 1553 1554 1555
		case 1098: goto st1098;
		case 1099: goto st1099;
		case 1100: goto st1100;
		case 1101: goto st1101;
		case 1102: goto st1102;
		case 1103: goto st1103;
		case 1104: goto st1104;
1556
		case 1210: goto st1210;
1557 1558 1559 1560 1561 1562
		case 1105: goto st1105;
		case 1106: goto st1106;
		case 1107: goto st1107;
		case 1108: goto st1108;
		case 1109: goto st1109;
		case 1110: goto st1110;
1563
		case 1211: goto st1211;
1564 1565 1566 1567 1568 1569
		case 1111: goto st1111;
		case 1112: goto st1112;
		case 1113: goto st1113;
		case 1114: goto st1114;
		case 1115: goto st1115;
		case 1116: goto st1116;
1570
		case 1212: goto st1212;
1571 1572 1573
		case 1117: goto st1117;
		case 1118: goto st1118;
		case 1119: goto st1119;
1574 1575 1576 1577 1578 1579 1580 1581
		case 1120: goto st1120;
		case 1121: goto st1121;
		case 1122: goto st1122;
		case 1123: goto st1123;
		case 1124: goto st1124;
		case 1213: goto st1213;
		case 1125: goto st1125;
		case 1126: goto st1126;
1582 1583 1584 1585 1586 1587 1588 1589
	default: break;
	}

	if ( ++p == pe )
		goto _test_eof;
_resume:
	switch ( cs )
	{
1590
tr20:
1591 1592 1593
	{
		s->line_counter++;
	}
1594
	goto st1127;
1595
tr83:
1596 1597 1598 1599
	{
		s->buffer[0] = 0;
		s->buffer_length = 0;
	}
1600 1601
	{
		if (rdata_tail - s->r_data > UINT16_MAX) {
Daniel Salzman's avatar
Daniel Salzman committed
1602
			WARN(ZS_RDATA_OVERFLOW);
1603
			p--; {goto st268;}
1604 1605 1606
		}
		s->r_data_length = rdata_tail - s->r_data;

1607
		s->state = ZS_STATE_DATA;
1608

1609 1610 1611 1612 1613
		// Execute the record callback.
		if (s->process.automatic) {
			if (s->process.record != NULL) {
				s->process.record(s);

1614
				// Stop if required from the callback.
1615
				if (s->state == ZS_STATE_STOP) {
1616
					{p++; cs = 1127; goto _out;}
1617 1618 1619 1620
				}
			}
		} else {
			// Return if external processing.
1621
			p--; {p++; cs = 1127; goto _out;}
1622
		}
1623 1624 1625 1626
	}
	{
		s->line_counter++;
	}
1627 1628
	goto st1127;
tr89:
1629
	{
1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650
		if (rdata_tail - s->r_data > UINT16_MAX) {
			WARN(ZS_RDATA_OVERFLOW);
			p--; {goto st268;}
		}
		s->r_data_length = rdata_tail - s->r_data;

		s->state = ZS_STATE_DATA;

		// Execute the record callback.
		if (s->process.automatic) {
			if (s->process.record != NULL) {
				s->process.record(s);

				// Stop if required from the callback.
				if (s->state == ZS_STATE_STOP) {
					{p++; cs = 1127; goto _out;}
				}
			}
		} else {
			// Return if external processing.
			p--; {p++; cs = 1127; goto _out;}
1651
		}
1652 1653 1654 1655
	}
	{
		s->line_counter++;
	}
1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822
	goto st1127;
tr92:
	{
		s->buffer[s->buffer_length++] = 0;
	}
	{
		if (rdata_tail - s->r_data > UINT16_MAX) {
			WARN(ZS_RDATA_OVERFLOW);
			p--; {goto st268;}
		}
		s->r_data_length = rdata_tail - s->r_data;

		s->state = ZS_STATE_DATA;

		// Execute the record callback.
		if (s->process.automatic) {
			if (s->process.record != NULL) {
				s->process.record(s);

				// Stop if required from the callback.
				if (s->state == ZS_STATE_STOP) {
					{p++; cs = 1127; goto _out;}
				}
			}
		} else {
			// Return if external processing.
			p--; {p++; cs = 1127; goto _out;}
		}
	}
	{
		s->line_counter++;
	}
	goto st1127;
tr665:
	{
		s->buffer[s->buffer_length++] = 0;
	}
	{
		s->line_counter++;
	}
	goto st1127;
tr759:
	{
		s->buffer[0] = 0;
		s->buffer_length = 0;
	}
	{
		s->buffer[s->buffer_length++] = 0;
	}
	{
		if (rdata_tail - s->r_data > UINT16_MAX) {
			WARN(ZS_RDATA_OVERFLOW);
			p--; {goto st268;}
		}
		s->r_data_length = rdata_tail - s->r_data;

		s->state = ZS_STATE_DATA;

		// Execute the record callback.
		if (s->process.automatic) {
			if (s->process.record != NULL) {
				s->process.record(s);

				// Stop if required from the callback.
				if (s->state == ZS_STATE_STOP) {
					{p++; cs = 1127; goto _out;}
				}
			}
		} else {
			// Return if external processing.
			p--; {p++; cs = 1127; goto _out;}
		}
	}
	{
		s->line_counter++;
	}
	goto st1127;
tr874:
	{
		s->buffer[0] = 0;
		s->buffer_length = 0;
	}
	{
		if (rdata_tail - s->r_data > UINT16_MAX) {
			WARN(ZS_RDATA_OVERFLOW);
			p--; {goto st268;}
		}
		s->r_data_length = rdata_tail - s->r_data;

		s->state = ZS_STATE_DATA;

		// Execute the record callback.
		if (s->process.automatic) {
			if (s->process.record != NULL) {
				s->process.record(s);

				// Stop if required from the callback.
				if (s->state == ZS_STATE_STOP) {
					{p++; cs = 1127; goto _out;}
				}
			}
		} else {
			// Return if external processing.
			p--; {p++; cs = 1127; goto _out;}
		}
	}
	{
		s->line_counter++;
	}
	{
		s->buffer[s->buffer_length++] = 0;
	}
	goto st1127;
tr878:
	{
		if (rdata_tail - s->r_data > UINT16_MAX) {
			WARN(ZS_RDATA_OVERFLOW);
			p--; {goto st268;}
		}
		s->r_data_length = rdata_tail - s->r_data;

		s->state = ZS_STATE_DATA;

		// Execute the record callback.
		if (s->process.automatic) {
			if (s->process.record != NULL) {
				s->process.record(s);

				// Stop if required from the callback.
				if (s->state == ZS_STATE_STOP) {
					{p++; cs = 1127; goto _out;}
				}
			}
		} else {
			// Return if external processing.
			p--; {p++; cs = 1127; goto _out;}
		}
	}
	{
		s->line_counter++;
	}
	{
		s->buffer[s->buffer_length++] = 0;
	}
	goto st1127;
tr3614:
	{
		s->buffer[0] = 0;
		s->buffer_length = 0;
	}
	{
		s->line_counter++;
	}
	goto st1127;
tr3674:
	{
		NOERR;
	}
	{
		s->buffer[0] = 0;
		s->buffer_length = 0;
	}
	{
		s->line_counter++;
	}
	goto st1127;
st1127:
1823
	if ( ++p == pe )
1824 1825
		goto _test_eof1127;
case 1127:
1826 1827 1828 1829
	_widec = (*p);
	if ( (*p) > 10 ) {
		if ( 59 <= (*p) && (*p) <= 59 ) {
			_widec = (short)(640 + ((*p) - -128));
1830
			if (
1831 1832
 s->multiline  ) _widec += 256;
		}
1833 1834
	} else if ( (*p) >= 10 ) {
		_widec = (short)(640 + ((*p) - -128));
1835
		if (
1836 1837 1838
 s->multiline  ) _widec += 256;
	}
	switch( _widec ) {
1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850
		case 9: goto tr3609;
		case 32: goto tr3609;
		case 36: goto st152;
		case 40: goto tr3611;
		case 41: goto tr3612;
		case 42: goto tr3613;
		case 92: goto tr3613;
		case 95: goto tr3613;
		case 778: goto tr3614;
		case 827: goto tr3615;
		case 1034: goto tr3616;
		case 1083: goto tr3617;
1851 1852 1853
	}
	if ( _widec < 64 ) {
		if ( 45 <= _widec && _widec <= 57 )
1854
			goto tr3613;
1855 1856
	} else if ( _widec > 90 ) {
		if ( 97 <= _widec && _widec <= 122 )
1857
			goto tr3613;
1858
	} else
1859 1860
		goto tr3613;
	goto tr3608;
1861 1862
tr0:
	{
Daniel Salzman's avatar
Daniel Salzman committed
1863
		WARN(ZS_BAD_NUMBER);
1864
		p--; {goto st268;}
1865 1866
	}
	{
Daniel Salzman's avatar
Daniel Salzman committed
1867
		WARN(ZS_UNSUPPORTED_TYPE);
1868
		p--; {goto st268;}
1869 1870
	}
	{
Daniel Salzman's avatar
Daniel Salzman committed
1871
		WARN(ZS_BAD_REST);
1872
		p--; {goto st268;}
1873 1874
	}
	goto st0;
1875
tr24:
1876
	{
Daniel Salzman's avatar
Daniel Salzman committed
1877
		WARN(ZS_BAD_TIME_UNIT);
1878
		p--; {goto