/* THIS FILE HAS BEEN AUTOMATICALLY GENERATED BY LLnextgen. DO NOT EDIT */
#define LL_NTERMINALS 21
#define LL_NSETS 11
#define LL_SSETS 4
#define LLinset(LLx) (LLsets[LLx*LL_SSETS + (LLcsymb/8)] & (1<<(LLcsymb & 7)))
#define LL_SCANDONE(LLx) if (LLsymb != LLx) LLerror(LLx);
static int *LLscnt, *LLtcnt;
static int LLcsymb;
#include <string.h>
static const char LLsets[] = {
	'\x32', 	'\xD0', 	'\x00', 	'\x00', 
	'\x02', 	'\x40', 	'\x00', 	'\x00', 
	'\x42', 	'\x90', 	'\x10', 	'\x00', 
	'\x80', 	'\x01', 	'\x00', 	'\x00', 
	'\x12', 	'\x87', 	'\x00', 	'\x00', 
	'\x32', 	'\x50', 	'\x00', 	'\x00', 
	'\x30', 	'\x10', 	'\x00', 	'\x00', 
	'\x04', 	'\x28', 	'\x00', 	'\x00', 
	'\x04', 	'\x20', 	'\x00', 	'\x00', 
	'\x00', 	'\x08', 	'\x0E', 	'\x00', 
	'\x02', 	'\x00', 	'\x10', 	'\x00', 
	0
};
static const int LLindex[] = { 0,
	   0,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
	  -1,   -1,   15,   -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,   20,   16,   17,   19,   -1,
	  -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
	  -1,   -1,   18,   -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,   -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,   -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,   -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,   -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,   -1,   -1,   -1,   -1,   -1,   -1,
	  -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
	  -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
	   0,    1,    2,    3,    4,    5,    6,    7,
	   8,    9,   10,   11,   12,   13,   14};
int LLsymb;
static int LLreissue;
int cpp_wrap_yylex(void);
static int LLlexerWrapper(void) {
	if (LLreissue == -2 /* LL_NEW_TOKEN */) {
		return cpp_wrap_yylex();
	} else {
		int LLretval = LLreissue;
		LLreissue = -2 /* LL_NEW_TOKEN */;
		return LLretval;
	}
}
void LLmessage(int);
static void LLread(void) { LLcsymb = LLindex[(LLsymb = LLlexerWrapper()) + 1]; }
static int LLskip(void) {
	int LL_i;
	if (LLcsymb >= 0) {
		if (LLtcnt[LLcsymb] != 0) return 0;
		for (LL_i = 0; LL_i < LL_NSETS; LL_i++)
			if (LLscnt[LL_i] != 0 && LLinset(LL_i))
				return 0;
	}

	for (;;) {
		LLmessage(0 /* LL_DELETE */);
		while ((LLcsymb = LLindex[(LLsymb = LLlexerWrapper()) + 1]) < 0) LLmessage(0 /* LL_DELETE */);
		if (LLtcnt[LLcsymb] != 0)
			return 1;
		for (LL_i = 0; LL_i < LL_NSETS; LL_i++)
			if (LLscnt[LL_i] != 0 && LLinset(LL_i))
				return 1;
	}
}
static void LLerror(int LLtoken) {
	if (LLtoken == 256 /* EOFILE */) {
		LLmessage(-1 /* LL_MISSINGEOF */);
		while (LLindex[(LLsymb = LLlexerWrapper()) + 1] != 0) /*NOTHING*/ ;
		return;
	}
	LLtcnt[LLindex[LLtoken + 1]]++;
	LLskip();
	LLtcnt[LLindex[LLtoken + 1]]--;
	if (LLsymb != LLtoken) { LLreissue = LLsymb; LLmessage(LLtoken); }
}
static const char *LLsymbolTable[] = {
"<EOF>", 
"<EOF>", "<SOH>", "<STX>", "<ETX>", 
"<EOT>", "<ENQ>", "<ACK>", "<BEL>", 
"<BS>", "<TAB>", "<NL>", "<VT>", 
"<FF>", "<CR>", "<SO>", "<SI>", 
"<DLE>", "<DC1>", "<DC2>", "<DC3>", 
"<DC4>", "<NAK>", "<SYN>", "<ETB>", 
"<CAN>", "<EM>", "<SUB>", "<ESC>", 
"<FS>", "<GS>", "<RS>", "<US>", 
"<SP>", "'!'", "'\"'", "'#'", 
"'$'", "'%'", "'&'", "'\''", 
"'('", "')'", "'*'", "'+'", 
"','", "'-'", "'.'", "'/'", 
"'0'", "'1'", "'2'", "'3'", 
"'4'", "'5'", "'6'", "'7'", 
"'8'", "'9'", "':'", "';'", 
"'<'", "'='", "'>'", "'?'", 
"'@'", "'A'", "'B'", "'C'", 
"'D'", "'E'", "'F'", "'G'", 
"'H'", "'I'", "'J'", "'K'", 
"'L'", "'M'", "'N'", "'O'", 
"'P'", "'Q'", "'R'", "'S'", 
"'T'", "'U'", "'V'", "'W'", 
"'X'", "'Y'", "'Z'", "'['", 
"'\\'", "']'", "'^'", "'_'", 
"'`'", "'a'", "'b'", "'c'", 
"'d'", "'e'", "'f'", "'g'", 
"'h'", "'i'", "'j'", "'k'", 
"'l'", "'m'", "'n'", "'o'", 
"'p'", "'q'", "'r'", "'s'", 
"'t'", "'u'", "'v'", "'w'", 
"'x'", "'y'", "'z'", "'{'", 
"'|'", "'}'", "'~'", "<DEL>", 
"'\x80'", "'\x81'", "'\x82'", "'\x83'", 
"'\x84'", "'\x85'", "'\x86'", "'\x87'", 
"'\x88'", "'\x89'", "'\x8A'", "'\x8B'", 
"'\x8C'", "'\x8D'", "'\x8E'", "'\x8F'", 
"'\x90'", "'\x91'", "'\x92'", "'\x93'", 
"'\x94'", "'\x95'", "'\x96'", "'\x97'", 
"'\x98'", "'\x99'", "'\x9A'", "'\x9B'", 
"'\x9C'", "'\x9D'", "'\x9E'", "'\x9F'", 
"'\xA0'", "'\xA1'", "'\xA2'", "'\xA3'", 
"'\xA4'", "'\xA5'", "'\xA6'", "'\xA7'", 
"'\xA8'", "'\xA9'", "'\xAA'", "'\xAB'", 
"'\xAC'", "'\xAD'", "'\xAE'", "'\xAF'", 
"'\xB0'", "'\xB1'", "'\xB2'", "'\xB3'", 
"'\xB4'", "'\xB5'", "'\xB6'", "'\xB7'", 
"'\xB8'", "'\xB9'", "'\xBA'", "'\xBB'", 
"'\xBC'", "'\xBD'", "'\xBE'", "'\xBF'", 
"'\xC0'", "'\xC1'", "'\xC2'", "'\xC3'", 
"'\xC4'", "'\xC5'", "'\xC6'", "'\xC7'", 
"'\xC8'", "'\xC9'", "'\xCA'", "'\xCB'", 
"'\xCC'", "'\xCD'", "'\xCE'", "'\xCF'", 
"'\xD0'", "'\xD1'", "'\xD2'", "'\xD3'", 
"'\xD4'", "'\xD5'", "'\xD6'", "'\xD7'", 
"'\xD8'", "'\xD9'", "'\xDA'", "'\xDB'", 
"'\xDC'", "'\xDD'", "'\xDE'", "'\xDF'", 
"'\xE0'", "'\xE1'", "'\xE2'", "'\xE3'", 
"'\xE4'", "'\xE5'", "'\xE6'", "'\xE7'", 
"'\xE8'", "'\xE9'", "'\xEA'", "'\xEB'", 
"'\xEC'", "'\xED'", "'\xEE'", "'\xEF'", 
"'\xF0'", "'\xF1'", "'\xF2'", "'\xF3'", 
"'\xF4'", "'\xF5'", "'\xF6'", "'\xF7'", 
"'\xF8'", "'\xF9'", "'\xFA'", "'\xFB'", 
"'\xFC'", "'\xFD'", "'\xFE'", "'\xFF'", 
"<EOF>", "tag", "surrogates", "action", 
"string", "number", "precision", "CHARMAP", 
"VARIANT", "INTERNAL", "END", "hexadecimal number", 
"character sequence", "initial", "state"};
const char *LLgetSymbol(int LLtoken) {
	if (LLtoken < -1 || LLtoken > 270 /* == LL_MAXTOKNO */)
		return (char *) 0;
	return LLsymbolTable[LLtoken+1];
}
#include "ucmparser.h"
#line 30 "ucmparser.gg"

#include <stdlib.h>
#include <stdio.h>

#include "ucm2ltc.h"

extern char *yytext;

void LLmessage(int _class) {
	switch (_class) {
		case LL_MISSINGEOF:
			fatal("%s:%d: Expected %s, found %s (%s).\n", file_name, line_number, LLgetSymbol(EOFILE), LLgetSymbol(LLsymb), yytext);
			break;
		case LL_DELETE:
			fatal("%s:%d: Unexpected %s (%s).\n", file_name, line_number, LLgetSymbol(LLsymb), yytext);
			break;
		default:
			fatal("%s:%d: Expected %s, found %s (%s).\n", file_name, line_number, LLgetSymbol(_class), LLgetSymbol(LLsymb), yytext);
			break;
	}
}

extern "C" int yylex(void);
inline int cpp_wrap_yylex(void) {
	return yylex();
}


#line 209 "ucmparser.cc"
static void * LL0_ucm(void);
static void LL1_header_line
#line 124 "ucmparser.gg"
(Ucm *ucm)
#line 214 "ucmparser.cc"
;
static void LL2_value(void);
static void LL3_state
#line 148 "ucmparser.gg"
(Ucm *ucm)
#line 220 "ucmparser.cc"
;
static void LL4_entry
#line 169 "ucmparser.gg"
(Ucm *ucm)
#line 225 "ucmparser.cc"
;
static void LL5_mapping
#line 217 "ucmparser.gg"
(UcmBase *ucm)
#line 230 "ucmparser.cc"
;
static void * LL0_ucm(void){
#line 59 "ucmparser.gg"
void *
#line 235 "ucmparser.cc"
LLretval;
memset(&LLretval, 0, sizeof(LLretval));
{
#line 59 "ucmparser.gg"

	Ucm *ucm;
	Variant *variant;
	bool internal = false;

#line 245 "ucmparser.cc"
LLtcnt[15]++;
LLscnt[0]++;
LLtcnt[7]++;
LLtcnt[15]++;
LLscnt[2]++;
LLtcnt[10]++;
LLtcnt[7]++;
LLtcnt[15]++;
#line 64 "ucmparser.gg"
{
		if (option_verbose)
			fprintf(stderr, "Reading input %s\n", file_name);
		LLretval = ucm = new Ucm(file_name);
	}
#line 260 "ucmparser.cc"
for (;;) {
LL_0:
switch (LLcsymb) {
default:
if (LLskip()) goto LL_0;
break;
case 1:/* TAG */
case 14:/* _STATE */
break;
case 15:/* <NL> */
LL_SCANDONE(10);/* <NL> */
LLread();
continue;
}
LLtcnt[15]--;
break;
}
switch (LLcsymb) {
case 1:/* TAG */
case 14:/* _STATE */
break;
default: LLskip(); break;
}
LLscnt[0]--;
LLscnt[1]++;
goto LL_1;
for (;;) {
LL_2:
switch (LLcsymb) {
default:
if (LLskip()) goto LL_2;
break;
case 7:/* CHARMAP */
break;
case 1:/* TAG */
case 14:/* _STATE */
LL_1:
LLscnt[5]++;
LLtcnt[15]++;
LL1_header_line
#line 71 "ucmparser.gg"
(ucm)
#line 303 "ucmparser.cc"
;
switch (LLcsymb) {
case 15:/* <NL> */
break;
default: LLskip(); break;
}
LLtcnt[15]--;
LLtcnt[15]++;
goto LL_3;
for (;;) {
LL_4:
switch (LLcsymb) {
default:
if (LLskip()) goto LL_4;
break;
case 1:/* TAG */
case 7:/* CHARMAP */
case 14:/* _STATE */
break;
case 15:/* <NL> */
LL_3:
LL_SCANDONE(10);/* <NL> */
LLread();
continue;
}
LLtcnt[15]--;
break;
}
continue;
}
LLscnt[1]--;
break;
}
#line 74 "ucmparser.gg"
{
		ucm->process_header();
		ucm->validate_states();
	}
#line 342 "ucmparser.cc"
LLtcnt[7]--;
LL_SCANDONE(263);/* CHARMAP */
LLread();
switch (LLcsymb) {
case 15:/* <NL> */
break;
default: LLskip(); break;
}
LLtcnt[15]--;
LLtcnt[15]++;
goto LL_5;
for (;;) {
LL_6:
switch (LLcsymb) {
default:
if (LLskip()) goto LL_6;
break;
case 1:/* TAG */
break;
case 15:/* <NL> */
LL_5:
LL_SCANDONE(10);/* <NL> */
LLread();
continue;
}
LLtcnt[15]--;
break;
}
switch (LLcsymb) {
case 1:/* TAG */
break;
default: LLskip(); break;
}
LLscnt[2]--;
LLtcnt[1]++;
goto LL_7;
for (;;) {
LL_8:
switch (LLcsymb) {
default:
if (LLskip()) goto LL_8;
break;
case 10:/* END */
break;
case 1:/* TAG */
LL_7:
LLtcnt[15]++;
LL5_mapping
#line 80 "ucmparser.gg"
(ucm)
#line 393 "ucmparser.cc"
;
switch (LLcsymb) {
case 15:/* <NL> */
break;
default: LLskip(); break;
}
LLtcnt[15]--;
LLtcnt[15]++;
goto LL_9;
for (;;) {
LL_10:
switch (LLcsymb) {
default:
if (LLskip()) goto LL_10;
break;
case 1:/* TAG */
case 10:/* END */
break;
case 15:/* <NL> */
LL_9:
LL_SCANDONE(10);/* <NL> */
LLread();
continue;
}
LLtcnt[15]--;
break;
}
continue;
}
LLtcnt[1]--;
break;
}
LLtcnt[10]--;
LL_SCANDONE(266);/* END */
LLread();
LLtcnt[7]--;
LL_SCANDONE(263);/* CHARMAP */
LLread();
LL_11:
switch (LLcsymb) {
default:
if (LLskip()) goto LL_11;
LLtcnt[15]--;
break;
case 0:/* <NUL> */
LLtcnt[15]--;
break;
case 15:/* <NL> */
LLtcnt[15]--;
LLtcnt[15]++;
LLscnt[3]++;
switch (LLcsymb) {
case 15:/* <NL> */
break;
default: LLskip(); break;
}
LLtcnt[15]--;
LLtcnt[15]++;
goto LL_12;
for (;;) {
LL_13:
switch (LLcsymb) {
default:
if (LLskip()) goto LL_13;
break;
case 0:/* <NUL> */
case 7:/* CHARMAP */
case 8:/* VARIANT */
break;
case 15:/* <NL> */
LL_12:
LL_SCANDONE(10);/* <NL> */
LLread();
continue;
}
LLtcnt[15]--;
break;
}
LL_14:
switch (LLcsymb) {
default:
if (LLskip())
goto LL_14;
/*FALLTHROUGH*/
case 0:/* <NUL> */
case 7:/* CHARMAP */
LLscnt[3]--;
LLtcnt[7]++;
LLtcnt[7]--;
LLtcnt[7]++;
LL_15:
switch (LLcsymb) {
default:
if (LLskip()) goto LL_15;
LLtcnt[7]--;
break;
case 0:/* <NUL> */
LLtcnt[7]--;
break;
case 7:/* CHARMAP */
LLtcnt[7]--;
LLtcnt[15]++;
LLscnt[2]++;
LLtcnt[10]++;
LLtcnt[7]++;
LLtcnt[15]++;
LL_SCANDONE(263);/* CHARMAP */
LLread();
switch (LLcsymb) {
case 15:/* <NL> */
break;
default: LLskip(); break;
}
LLtcnt[15]--;
LLtcnt[15]++;
goto LL_16;
for (;;) {
LL_17:
switch (LLcsymb) {
default:
if (LLskip()) goto LL_17;
break;
case 1:/* TAG */
break;
case 15:/* <NL> */
LL_16:
LL_SCANDONE(10);/* <NL> */
LLread();
continue;
}
LLtcnt[15]--;
break;
}
switch (LLcsymb) {
case 1:/* TAG */
break;
default: LLskip(); break;
}
LLscnt[2]--;
LLtcnt[1]++;
goto LL_18;
for (;;) {
LL_19:
switch (LLcsymb) {
default:
if (LLskip()) goto LL_19;
break;
case 10:/* END */
break;
case 1:/* TAG */
LL_18:
LLtcnt[15]++;
LL5_mapping
#line 91 "ucmparser.gg"
(ucm)
#line 549 "ucmparser.cc"
;
switch (LLcsymb) {
case 15:/* <NL> */
break;
default: LLskip(); break;
}
LLtcnt[15]--;
LLtcnt[15]++;
goto LL_20;
for (;;) {
LL_21:
switch (LLcsymb) {
default:
if (LLskip()) goto LL_21;
break;
case 1:/* TAG */
case 10:/* END */
break;
case 15:/* <NL> */
LL_20:
LL_SCANDONE(10);/* <NL> */
LLread();
continue;
}
LLtcnt[15]--;
break;
}
continue;
}
LLtcnt[1]--;
break;
}
LLtcnt[10]--;
LL_SCANDONE(266);/* END */
LLread();
LLtcnt[7]--;
LL_SCANDONE(263);/* CHARMAP */
LLread();
for (;;) {
LL_22:
switch (LLcsymb) {
default:
if (LLskip()) goto LL_22;
break;
case 0:/* <NUL> */
break;
case 15:/* <NL> */
LL_SCANDONE(10);/* <NL> */
LLread();
continue;
}
LLtcnt[15]--;
break;
}
}
break;
case 8:/* VARIANT */
LLscnt[3]--;
LLscnt[4]++;
switch (LLcsymb) {
case 8:/* VARIANT */
break;
default: LLskip(); break;
}
LLscnt[4]--;
LLtcnt[8]++;
goto LL_23;
for (;;) {
LL_24:
switch (LLcsymb) {
default:
if (LLskip()) goto LL_24;
break;
case 0:/* <NUL> */
break;
case 8:/* VARIANT */
LL_23:
LLtcnt[9]++;
LLtcnt[4]++;
LLtcnt[15]++;
LLtcnt[1]++;
LLtcnt[10]++;
LLtcnt[8]++;
LLtcnt[15]++;
LL_SCANDONE(264);/* VARIANT */
LLread();
LL_25:
switch (LLcsymb) {
default:
if (LLskip()) goto LL_25;
LLtcnt[9]--;
break;
case 4:/* STRING */
LLtcnt[9]--;
break;
case 9:/* _INTERNAL */
LLtcnt[9]--;
LL_SCANDONE(265);/* _INTERNAL */
#line 103 "ucmparser.gg"
{ internal = true; }
#line 650 "ucmparser.cc"
LLread();
}
LLtcnt[4]--;
LL_SCANDONE(260);/* STRING */
#line 106 "ucmparser.gg"
{
					variant = new Variant(ucm, yytext, internal);
					internal = false;
					ucm->add_variant(variant);
				}
#line 661 "ucmparser.cc"
LLread();
switch (LLcsymb) {
case 15:/* <NL> */
break;
default: LLskip(); break;
}
LLtcnt[15]--;
LLtcnt[15]++;
goto LL_26;
for (;;) {
LL_27:
switch (LLcsymb) {
default:
if (LLskip()) goto LL_27;
break;
case 1:/* TAG */
case 10:/* END */
break;
case 15:/* <NL> */
LL_26:
LL_SCANDONE(10);/* <NL> */
LLread();
continue;
}
LLtcnt[15]--;
break;
}
for (;;) {
LL_28:
switch (LLcsymb) {
default:
if (LLskip()) goto LL_28;
break;
case 10:/* END */
break;
case 1:/* TAG */
LLtcnt[15]++;
LL5_mapping
#line 113 "ucmparser.gg"
(variant)
#line 702 "ucmparser.cc"
;
switch (LLcsymb) {
case 15:/* <NL> */
break;
default: LLskip(); break;
}
LLtcnt[15]--;
LLtcnt[15]++;
goto LL_29;
for (;;) {
LL_30:
switch (LLcsymb) {
default:
if (LLskip()) goto LL_30;
break;
case 1:/* TAG */
case 10:/* END */
break;
case 15:/* <NL> */
LL_29:
LL_SCANDONE(10);/* <NL> */
LLread();
continue;
}
LLtcnt[15]--;
break;
}
continue;
}
LLtcnt[1]--;
break;
}
LLtcnt[10]--;
LL_SCANDONE(266);/* END */
LLread();
LLtcnt[8]--;
LL_SCANDONE(264);/* VARIANT */
LLread();
LL_31:
switch (LLcsymb) {
default:
if (LLskip())
goto LL_31;
/*FALLTHROUGH*/
case 0:/* <NUL> */
LLtcnt[15]--;
break;
case 8:/* VARIANT */
case 15:/* <NL> */
LLtcnt[15]--;
LLtcnt[15]++;
switch (LLcsymb) {
case 15:/* <NL> */
break;
default: LLskip(); break;
}
LLtcnt[15]--;
LLtcnt[15]++;
goto LL_32;
for (;;) {
LL_33:
switch (LLcsymb) {
default:
if (LLskip()) goto LL_33;
break;
case 0:/* <NUL> */
case 8:/* VARIANT */
break;
case 15:/* <NL> */
LL_32:
LL_SCANDONE(10);/* <NL> */
LLread();
continue;
}
LLtcnt[15]--;
break;
}
}
continue;
}
LLtcnt[8]--;
break;
}
break;
}
}
}
return LLretval;
}
static void LL1_header_line
#line 124 "ucmparser.gg"
(Ucm *ucm)
#line 795 "ucmparser.cc"
{
#line 124 "ucmparser.gg"

	Ucm::tag_t tag;

#line 801 "ucmparser.cc"
LL_0:
switch (LLcsymb) {
default:
if (LLskip())
goto LL_0;
/*FALLTHROUGH*/
case 1:/* TAG */
LLscnt[5]--;
LLscnt[6]++;
LL_SCANDONE(257);/* TAG */
#line 128 "ucmparser.gg"
{ tag = string_to_tag(yytext); }
#line 814 "ucmparser.cc"
LLread();
LL_1:
switch (LLcsymb) {
case 4:/* STRING */
case 5:/* NUMBER */
case 12:/* CHARSEQ */
LLscnt[6]--;
LLscnt[6]++;
LL2_value();
#line 131 "ucmparser.gg"
{ ucm->set_tag_value(tag, yytext); }
#line 826 "ucmparser.cc"
LLread();
break;
default:
if (LLskip())
goto LL_1;
/*FALLTHROUGH*/
case 15:/* <NL> */
LLscnt[6]--;
#line 133 "ucmparser.gg"
{ ucm->set_tag_value(tag, ""); }
#line 837 "ucmparser.cc"
break;
}
break;
case 14:/* _STATE */
LLscnt[5]--;
LLscnt[7]++;
LL_SCANDONE(270);/* _STATE */
LLread();
LLscnt[7]--;
LL3_state
#line 137 "ucmparser.gg"
(ucm)
#line 850 "ucmparser.cc"
;
break;
}
}
static void LL2_value(void){
LL_0:
switch (LLcsymb) {
default:
if (LLskip())
goto LL_0;
/*FALLTHROUGH*/
case 4:/* STRING */
LLscnt[6]--;
LL_SCANDONE(260);/* STRING */
break;
case 5:/* NUMBER */
LLscnt[6]--;
LL_SCANDONE(261);/* NUMBER */
break;
case 12:/* CHARSEQ */
LLscnt[6]--;
LL_SCANDONE(268);/* CHARSEQ */
break;
}
}
static void LL3_state
#line 148 "ucmparser.gg"
(Ucm *ucm)
#line 879 "ucmparser.cc"
{
#line 148 "ucmparser.gg"

	int flags = 0;

#line 885 "ucmparser.cc"
LLscnt[8]++;
LLtcnt[11]++;
LL_0:
switch (LLcsymb) {
default:
if (LLskip()) goto LL_0;
LLscnt[8]--;
break;
case 11:/* HEXNUM */
case 15:/* <NL> */
LLscnt[8]--;
break;
case 2:/* SURROGATES */
case 13:/* _INITIAL */
LLscnt[8]--;
LLscnt[8]++;
LLtcnt[16]++;
LL_1:
switch (LLcsymb) {
default:
if (LLskip())
goto LL_1;
/*FALLTHROUGH*/
case 13:/* _INITIAL */
LLscnt[8]--;
LL_SCANDONE(269);/* _INITIAL */
#line 153 "ucmparser.gg"
{ flags |= State::INITIAL; }
#line 914 "ucmparser.cc"
break;
case 2:/* SURROGATES */
LLscnt[8]--;
LL_SCANDONE(258);/* SURROGATES */
break;
}
LLread();
LLtcnt[16]--;
LL_SCANDONE(44);/* ',' */
LLread();
}
#line 159 "ucmparser.gg"
{ ucm->new_codepage_state(flags); }
#line 928 "ucmparser.cc"
LL_2:
switch (LLcsymb) {
default:
if (LLskip()) goto LL_2;
LLtcnt[11]--;
break;
case 15:/* <NL> */
LLtcnt[11]--;
break;
case 11:/* HEXNUM */
LLtcnt[11]--;
LLtcnt[16]++;
LL4_entry
#line 161 "ucmparser.gg"
(ucm)
#line 944 "ucmparser.cc"
;
for (;;) {
LL_3:
switch (LLcsymb) {
default:
if (LLskip()) goto LL_3;
break;
case 15:/* <NL> */
break;
case 16:/* ',' */
LLscnt[9]++;
LL_SCANDONE(44);/* ',' */
LLread();
LLscnt[9]--;
LL4_entry
#line 164 "ucmparser.gg"
(ucm)
#line 962 "ucmparser.cc"
;
continue;
}
LLtcnt[16]--;
break;
}
}
}
static void LL4_entry
#line 169 "ucmparser.gg"
(Ucm *ucm)
#line 974 "ucmparser.cc"
{
#line 169 "ucmparser.gg"

	Entry result(0, 0, 0, ACTION_FINAL, 0, 0);

#line 980 "ucmparser.cc"
LLtcnt[17]++;
LLtcnt[18]++;
LLtcnt[19]++;
LL_SCANDONE(267);/* HEXNUM */
#line 174 "ucmparser.gg"
{ result.low = result.high = (int) strtol(yytext, NULL, 16); }
#line 987 "ucmparser.cc"
LLread();
LL_0:
switch (LLcsymb) {
default:
if (LLskip()) goto LL_0;
LLtcnt[17]--;
break;
case 15:/* <NL> */
case 16:/* ',' */
case 18:/* ':' */
case 19:/* '.' */
LLtcnt[17]--;
break;
case 17:/* '-' */
LLtcnt[17]--;
LLtcnt[11]++;
LL_SCANDONE(45);/* '-' */
LLread();
LLtcnt[11]--;
LL_SCANDONE(267);/* HEXNUM */
#line 178 "ucmparser.gg"
{ result.high = (int) strtol(yytext, NULL, 16); }
#line 1010 "ucmparser.cc"
LLread();
}
LL_1:
switch (LLcsymb) {
default:
if (LLskip()) goto LL_1;
LLtcnt[18]--;
break;
case 15:/* <NL> */
case 16:/* ',' */
case 19:/* '.' */
LLtcnt[18]--;
break;
case 18:/* ':' */
LLtcnt[18]--;
LLtcnt[11]++;
LL_SCANDONE(58);/* ':' */
LLread();
LLtcnt[11]--;
LL_SCANDONE(267);/* HEXNUM */
#line 183 "ucmparser.gg"
{
			result.next_state = (int) strtol(yytext, NULL, 16);
			result.action = ACTION_VALID;
		}
#line 1036 "ucmparser.cc"
LLread();
}
LL_2:
switch (LLcsymb) {
default:
if (LLskip()) goto LL_2;
LLtcnt[19]--;
break;
case 15:/* <NL> */
case 16:/* ',' */
LLtcnt[19]--;
break;
case 19:/* '.' */
LLtcnt[19]--;
LLtcnt[3]++;
LL_SCANDONE(46);/* '.' */
LLread();
LL_3:
switch (LLcsymb) {
case 3:/* ACTION */
LLtcnt[3]--;
LL_SCANDONE(259);/* ACTION */
#line 192 "ucmparser.gg"
{
				switch (yytext[0]) {
					case 'u':
						result.action = ACTION_UNASSIGNED;
						break;
					case 's':
						result.action = ACTION_SHIFT;
						break;
					case 'p':
						result.action = ACTION_FINAL_PAIR;
						break;
					case 'i':
						result.action = ACTION_ILLEGAL;
						break;
					default:
						PANIC();
				}
			}
#line 1078 "ucmparser.cc"
LLread();
break;
default:
if (LLskip())
goto LL_3;
/*FALLTHROUGH*/
case 15:/* <NL> */
case 16:/* ',' */
LLtcnt[3]--;
#line 211 "ucmparser.gg"
{ result.action = ACTION_FINAL; }
#line 1090 "ucmparser.cc"
break;
}
}
#line 214 "ucmparser.gg"
{ ucm->new_codepage_entry(result); }
#line 1096 "ucmparser.cc"
}
static void LL5_mapping
#line 217 "ucmparser.gg"
(UcmBase *ucm)
#line 1101 "ucmparser.cc"
{
#line 217 "ucmparser.gg"

	Mapping *mapping = new Mapping();

#line 1107 "ucmparser.cc"
LLscnt[10]++;
LLtcnt[12]++;
LLtcnt[6]++;
LL_SCANDONE(257);/* TAG */
#line 221 "ucmparser.gg"
{
		uint32_t codepoint;
		if (sscanf(yytext, "<U%" SCNx32 ">", &codepoint) == 0 || codepoint > 0x10ffff)
			fatal("%s:%d: Tag does not specify a valid unicode codepoint\n", file_name, line_number);
		mapping->codepoints.push_back(codepoint);
	}
#line 1119 "ucmparser.cc"
LLread();
for (;;) {
LL_0:
switch (LLcsymb) {
default:
if (LLskip()) goto LL_0;
break;
case 12:/* CHARSEQ */
break;
case 1:/* TAG */
case 20:/* '+' */
LLtcnt[20]++;
LLtcnt[1]++;
LL_1:
switch (LLcsymb) {
default:
if (LLskip()) goto LL_1;
LLtcnt[20]--;
break;
case 1:/* TAG */
LLtcnt[20]--;
break;
case 20:/* '+' */
LLtcnt[20]--;
LL_SCANDONE(43);/* '+' */
LLread();
}
LLtcnt[1]--;
LL_SCANDONE(257);/* TAG */
#line 229 "ucmparser.gg"
{
		uint32_t codepoint;
		if (sscanf(yytext, "<U%" SCNx32 ">", &codepoint) == 0 || codepoint > 0x10ffff)
			fatal("%s:%d: Tag does not specify a valid unicode codepoint\n", file_name, line_number);
		mapping->codepoints.push_back(codepoint);
	}
#line 1156 "ucmparser.cc"
LLread();
continue;
}
LLscnt[10]--;
break;
}
LLtcnt[12]--;
LL_SCANDONE(268);/* CHARSEQ */
#line 232 "ucmparser.gg"
{ parse_byte_sequence(yytext, mapping->codepage_bytes); }
#line 1167 "ucmparser.cc"
LLread();
LL_2:
switch (LLcsymb) {
default:
if (LLskip()) goto LL_2;
LLtcnt[6]--;
break;
case 15:/* <NL> */
LLtcnt[6]--;
break;
case 6:/* PRECISION */
LLtcnt[6]--;
LL_SCANDONE(262);/* PRECISION */
#line 235 "ucmparser.gg"
{ mapping->precision = yytext[1] - '0'; }
#line 1183 "ucmparser.cc"
LLread();
}
#line 237 "ucmparser.gg"
{ ucm->add_mapping(mapping); }
#line 1188 "ucmparser.cc"
}
void parse_ucm(void * *LLretval) {
	int LLcounts[LL_NTERMINALS + LL_NSETS + 2];
	int *LLbackupLLscnt = LLscnt, *LLbackupLLtcnt = LLtcnt;
	int LLbackupLLreissue = LLreissue;
	LLcounts[0] = LLsymb; LLcounts[1] = LLcsymb;
	LLtcnt = LLcounts + 2; LLscnt = LLcounts + 2 + LL_NTERMINALS;
	memset(LLscnt, 0, LL_NSETS * sizeof(int));
	memset(LLtcnt, 0, LL_NTERMINALS * sizeof(int));
	LLtcnt[0]++;
	LLsymb = 0;
	LLreissue = -2 /* LL_NEW_TOKEN */;
	LLread();
	*LLretval = LL0_ucm();
	if (LLcsymb != 0) LLerror(256 /* EOFILE*/);
	LLscnt = LLbackupLLscnt; LLtcnt = LLbackupLLtcnt;
	LLsymb = LLcounts[0]; LLcsymb = LLcounts[1];
	LLreissue = LLbackupLLreissue;
}

