/* Generated by re2c 0.15.3 on Tue Nov 22 15:42:35 2016 */
/**********************************************************************************************/
/* The MIT License                                                                            */
/*                                                                                            */
/* Copyright 2016-2016 Twitch Interactive, Inc. or its affiliates. All Rights Reserved.       */
/*                                                                                            */
/* Permission is hereby granted, free of charge, to any person obtaining a copy               */
/* of this software and associated documentation files (the "Software"), to deal              */
/* in the Software without restriction, including without limitation the rights               */
/* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell                  */
/* copies of the Software, and to permit persons to whom the Software is                      */
/* furnished to do so, subject to the following conditions:                                   */
/*                                                                                            */
/* The above copyright notice and this permission notice shall be included in                 */
/* all copies or substantial portions of the Software.                                        */
/*                                                                                            */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR                 */
/* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,                   */
/* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE                */
/* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER                     */
/* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,              */
/* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN                  */
/* THE SOFTWARE.                                                                              */
/**********************************************************************************************/
#include "eia608.h"
#include <string.h>
#include <stdio.h>

////////////////////////////////////////////////////////////////////////////////
int eia608_row_map[] = {10, -1, 0, 1, 2, 3, 11, 12, 13, 14, 4, 5, 6, 7, 8, 9};
int eia608_reverse_row_map[] = {2, 3, 4, 5, 10, 11, 12, 13, 14, 15, 0, 6, 7, 8, 9, 1};

const char* eia608_mode_map[] = {
    "clear",
    "loading",
    "popOn",
    "paintOn",
    "rollUp",
};

const char* eia608_style_map[] = {
    "white",
    "green",
    "blue",
    "cyan",
    "red",
    "yellow",
    "magenta",
    "italics",
};

static inline uint16_t eia608_row_pramble (int row, int chan, int x, int underline)
{
    row = eia608_reverse_row_map[row&0x0F];
    return eia608_parity (0x1040 | (chan?0x0800:0x0000) | ( (row<<7) &0x0700) | ( (row<<5) &0x0020)) | ( (x<<1) &0x001E) | (underline?0x0001:0x0000);
}

uint16_t eia608_row_column_pramble (int row, int col, int chan, int underline) { return eia608_row_pramble (row,chan,0x10| (col/4),underline); }
uint16_t eia608_row_style_pramble (int row, eia608_style_t style, int chan, int underline) { return eia608_row_pramble (row,chan,style,underline); }

int eia608_parse_preamble (uint16_t cc_data, int* row, int* col, eia608_style_t* style, int* chan, int* underline)
{
    (*row) = eia608_row_map[ ( (0x0700 & cc_data) >> 7) | ( (0x0020 & cc_data) >> 5)];
    (*chan) = !! (0x0800 & cc_data);
    (*underline) = 0x0001 & cc_data;

    if (0x0010 & cc_data) {
        (*style) = eia608_style_white;
        (*col) = 4* ( (0x000E & cc_data) >> 1);
    } else {
        (*style) = (0x000E & cc_data) >> 1;
        (*col) = 0;
    }

    return 1;
}

int eia608_parse_midrowchange (uint16_t cc_data, int* chan, eia608_style_t* style, int* underline)
{
    (*chan) = !! (0x0800 & cc_data);

    if (0x1120 == (0x7770 & cc_data)) {
        (*style) = (0x000E & cc_data) >> 1;
        (*underline) = 0x0001 & cc_data;
    }

    return 1;
}
////////////////////////////////////////////////////////////////////////////////
// control command
eia608_control_t eia608_parse_control (uint16_t cc_data, int* cc)
{
    if (0x0200&cc_data) {
        (*cc) = (cc_data&0x0800?0x01:0x00);
        return (eia608_control_t) (0x177F & cc_data);
    } else {
        (*cc) = (cc_data&0x0800?0x01:0x00) | (cc_data&0x0100?0x02:0x00);
        return (eia608_control_t) (0x167F & cc_data);
    }
}

uint16_t eia608_control_command (eia608_control_t cmd, int cc)
{
    uint16_t c = (cc&0x01) ?0x0800:0x0000;
    uint16_t f = (cc&0x02) ?0x0100:0x0000;

    if (eia608_tab_offset_0 == (eia608_control_t) (cmd&0xFFC0)) {
        return (eia608_control_t) eia608_parity (cmd|c);
    } else {
        return (eia608_control_t) eia608_parity (cmd|c|f);
    }
}
////////////////////////////////////////////////////////////////////////////////
// text
static const char* utf8_from_index (int idx) { return (0<=idx && EIA608_CHAR_COUNT>idx) ? eia608_char_map[idx] : ""; }
static int eia608_to_index (uint16_t cc_data, int* chan, int* c1, int* c2)
{
    (*c1) = (*c2) = -1; (*chan) = 0;
    cc_data &= 0x7F7F; // strip off parity bits

    // Handle Basic NA BEFORE we strip the channel bit
    if (eia608_is_basicna (cc_data)) {
        // we got first char, yes. But what about second char?
        (*c1) = (cc_data>>8) - 0x20;
        cc_data &= 0x00FF;

        if (0x0020<=cc_data && 0x0080>cc_data) {
            (*c2) = cc_data - 0x20;
            return 2;
        }

        return 1;
    }

    // Check then strip second channel toggle
    (*chan) = cc_data & 0x0800;
    cc_data = cc_data & 0xF7FF;

    if (eia608_is_specialna (cc_data)) {
        // Special North American character
        (*c1) = cc_data - 0x1130 + 0x60;
        return 1;
    }

    if (0x1220<=cc_data && 0x1240>cc_data) {
        // Extended Western European character set, Spanish/Miscellaneous/French
        (*c1) = cc_data - 0x1220 + 0x70;
        return 1;
    }

    if (0x1320<=cc_data && 0x1340>cc_data) {
        // Extended Western European character set, Portuguese/German/Danish
        (*c1) = cc_data - 0x1320 + 0x90;
        return 1;
    }

    return 0;
}


int eia608_to_utf8 (uint16_t c, int* chan, char* str1,  char* str2)
{
    int c1, c2;
    size_t size = eia608_to_index (c,chan,&c1,&c2);
    strncpy (str1, utf8_from_index (c1),5);
    strncpy (str2, utf8_from_index (c2),5);
    return (int)size;
}

uint16_t eia608_from_basicna (uint16_t bna1, uint16_t bna2)
{
    if (! eia608_is_basicna (bna1) || ! eia608_is_basicna (bna2)) {
        return 0;
    }

    return eia608_parity ( ( (0xFF00&bna1) >>0) | ( (0xFF00&bna2) >>8));
}

// prototype for re2c generated function
uint16_t _eia608_from_utf8 (const utf8_char_t* s);
uint16_t eia608_from_utf8_1 (const utf8_char_t* c, int chan)
{
    uint16_t cc_data = _eia608_from_utf8 (c);

    if (0 == cc_data) {
        return cc_data;
    }

    if (chan && ! eia608_is_basicna (cc_data)) {
        cc_data |= 0x0800;
    }

    return eia608_parity (cc_data);
}

uint16_t eia608_from_utf8_2 (const utf8_char_t* c1, const utf8_char_t* c2)
{
    uint16_t cc1 = _eia608_from_utf8 (c1);
    uint16_t cc2 = _eia608_from_utf8 (c2);
    return eia608_from_basicna (cc1,cc2);
}
////////////////////////////////////////////////////////////////////////////////
void eia608_dump (uint16_t cc_data)
{
    eia608_style_t style;
    const char* text = 0;
    char char1[5], char2[5];
    char1[0] = char2[0] = 0;
    int row, col, chan, underline;

    if (!eia608_parity_varify (cc_data)) {
        text = "parity failed";
    } else if (0 == eia608_parity_strip (cc_data)) {
        text = "pad";
    } else if (eia608_is_basicna (cc_data)) {
        text = "basicna";
        eia608_to_utf8 (cc_data,&chan,&char1[0],&char2[0]);
    } else if (eia608_is_specialna (cc_data)) {
        text = "specialna";
        eia608_to_utf8 (cc_data,&chan,&char1[0],&char2[0]);
    } else if (eia608_is_westeu (cc_data)) {
        text = "westeu";
        eia608_to_utf8 (cc_data,&chan,&char1[0],&char2[0]);
    } else if (eia608_is_xds (cc_data)) {
        text = "xds";
    } else if (eia608_is_midrowchange (cc_data)) {
        text = "midrowchange";
    } else if (eia608_is_norpak (cc_data)) {
        text = "norpak";
    } else if (eia608_is_preamble (cc_data)) {
        text = "preamble";
        eia608_parse_preamble (cc_data, &row, &col, &style, &chan, &underline);
        fprintf (stderr,"preamble %d %d %d %d %d\n", row, col, style, chan, underline);

    } else if (eia608_is_control (cc_data)) {
        switch (eia608_parse_control (cc_data,&chan)) {

        default: text = "unknown_control"; break;

        case eia608_tab_offset_0: text = "eia608_tab_offset_0"; break;

        case eia608_tab_offset_1: text = "eia608_tab_offset_1"; break;

        case eia608_tab_offset_2:text = "eia608_tab_offset_2"; break;

        case eia608_tab_offset_3: text = "eia608_tab_offset_3"; break;

        case eia608_control_resume_caption_loading: text = "eia608_control_resume_caption_loading"; break;

        case eia608_control_backspace: text = "eia608_control_backspace"; break;

        case eia608_control_alarm_off: text = "eia608_control_alarm_off"; break;

        case eia608_control_alarm_on: text = "eia608_control_alarm_on"; break;

        case eia608_control_delete_to_end_of_row: text = "eia608_control_delete_to_end_of_row"; break;

        case eia608_control_roll_up_2: text = "eia608_control_roll_up_2"; break;

        case eia608_control_roll_up_3: text = "eia608_control_roll_up_3"; break;

        case eia608_control_roll_up_4: text = "eia608_control_roll_up_4"; break;

        case eia608_control_resume_direct_captioning: text = "eia608_control_resume_direct_captioning"; break;

        case eia608_control_text_restart: text = "eia608_control_text_restart"; break;

        case eia608_control_text_resume_text_display: text = "eia608_control_text_resume_text_display"; break;

        case eia608_control_erase_display_memory: text = "eia608_control_erase_display_memory"; break;

        case eia608_control_carriage_return: text = "eia608_control_carriage_return"; break;

        case eia608_control_erase_non_displayed_memory:text = "eia608_control_erase_non_displayed_memory"; break;

        case eia608_control_end_of_caption: text = "eia608_control_end_of_caption"; break;
        }
    } else {
        text = "unhandled";
    }

    fprintf (stderr,"cc %04X (%04X) '%s' '%s' (%s)\n", cc_data, eia608_parity_strip (cc_data), char1, char2, text);
}
////////////////////////////////////////////////////////////////////////////////
// below this line is re2c
uint16_t _eia608_from_utf8 (const utf8_char_t* s)
{
    const unsigned char* YYMARKER; // needed by default rule
    const unsigned char* YYCURSOR = (const unsigned char*) s;

    if (0==s) { return 0x0000;}

    
{
    unsigned char yych;
    yych = *YYCURSOR;
    if (yych <= '`') {
        if (yych <= '*') {
            if (yych <= '&') {
                if (yych <= 0x00) goto yy2;
                if (yych <= 0x1F) goto yy32;
                goto yy26;
            } else {
                if (yych <= '\'') goto yy4;
                if (yych <= ')') goto yy26;
                goto yy6;
            }
        } else {
            if (yych <= ']') {
                if (yych == '\\') goto yy8;
                goto yy26;
            } else {
                if (yych <= '^') goto yy10;
                if (yych <= '_') goto yy12;
                goto yy14;
            }
        }
    } else {
        if (yych <= 0x7F) {
            if (yych <= '|') {
                if (yych <= 'z') goto yy26;
                if (yych <= '{') goto yy16;
                goto yy18;
            } else {
                if (yych <= '}') goto yy20;
                if (yych <= '~') goto yy22;
                goto yy24;
            }
        } else {
            if (yych <= 0xC3) {
                if (yych <= 0xC1) goto yy32;
                if (yych <= 0xC2) goto yy31;
                goto yy28;
            } else {
                if (yych == 0xE2) goto yy30;
                goto yy32;
            }
        }
    }
yy2:
    ++YYCURSOR;
    { /*NULL*/ return 0x0000; }
yy4:
    ++YYCURSOR;
    { /*APOSTROPHE -> RIGHT_SINGLE_QUOTATION_MARK*/ return 0x1229; }
yy6:
    ++YYCURSOR;
    { /*ASTERISK*/ return 0x1228; }
yy8:
    ++YYCURSOR;
    { /*REVERSE_SOLIDUS*/ return 0x132B; }
yy10:
    ++YYCURSOR;
    { /*CIRCUMFLEX_ACCENT*/ return 0x132C; }
yy12:
    ++YYCURSOR;
    { /*LOW_LINE*/ return 0x132D; }
yy14:
    ++YYCURSOR;
    { /*GRAVE_ACCENT, No equivalent return 0x0000; return 1;*/ /*LEFT_SINGLE_QUOTATION_MARK*/ return 0x1226; }
yy16:
    ++YYCURSOR;
    { /*LEFT_CURLY_BRACKET*/ return 0x1329; }
yy18:
    ++YYCURSOR;
    { /*VERTICAL_LINE*/ return 0x132E; }
yy20:
    ++YYCURSOR;
    { /*RIGHT_CURLY_BRACKET*/ return 0x132A; }
yy22:
    ++YYCURSOR;
    { /*TILDE*/ return 0x132F; }
yy24:
    ++YYCURSOR;
    { /*DEL/BACKSPACE. Need to set bits 9 and 12! return 0x1421;*/ return 0x0000; }
yy26:
    ++YYCURSOR;
    { /*ASCII range*/ return (s[0]<<8) &0xFF00; }
yy28:
    ++YYCURSOR;
    switch ((yych = *YYCURSOR)) {
    case 0x80:    goto yy157;
    case 0x81:    goto yy169;
    case 0x82:    goto yy155;
    case 0x83:    goto yy129;
    case 0x84:    goto yy111;
    case 0x85:    goto yy101;
    case 0x87:    goto yy153;
    case 0x88:    goto yy151;
    case 0x89:    goto yy167;
    case 0x8A:    goto yy149;
    case 0x8B:    goto yy147;
    case 0x8C:    goto yy123;
    case 0x8D:    goto yy125;
    case 0x8E:    goto yy143;
    case 0x8F:    goto yy141;
    case 0x91:    goto yy187;
    case 0x92:    goto yy119;
    case 0x93:    goto yy165;
    case 0x94:    goto yy137;
    case 0x95:    goto yy115;
    case 0x96:    goto yy107;
    case 0x98:    goto yy97;
    case 0x99:    goto yy135;
    case 0x9A:    goto yy163;
    case 0x9B:    goto yy131;
    case 0x9C:    goto yy161;
    case 0x9F:    goto yy103;
    case 0xA0:    goto yy183;
    case 0xA1:    goto yy201;
    case 0xA2:    goto yy179;
    case 0xA3:    goto yy127;
    case 0xA4:    goto yy109;
    case 0xA5:    goto yy99;
    case 0xA7:    goto yy191;
    case 0xA8:    goto yy181;
    case 0xA9:    goto yy199;
    case 0xAA:    goto yy177;
    case 0xAB:    goto yy145;
    case 0xAC:    goto yy121;
    case 0xAD:    goto yy197;
    case 0xAE:    goto yy175;
    case 0xAF:    goto yy139;
    case 0xB1:    goto yy185;
    case 0xB2:    goto yy117;
    case 0xB3:    goto yy195;
    case 0xB4:    goto yy173;
    case 0xB5:    goto yy113;
    case 0xB6:    goto yy105;
    case 0xB7:    goto yy189;
    case 0xB8:    goto yy95;
    case 0xB9:    goto yy133;
    case 0xBA:    goto yy193;
    case 0xBB:    goto yy171;
    case 0xBC:    goto yy159;
    default:    goto yy29;
    }
yy29:
    { /*DEFAULT_RULE*/ return 0x0000; }
yy30:
    yych = *(YYMARKER = ++YYCURSOR);
    switch (yych) {
    case 0x80:    goto yy63;
    case 0x84:    goto yy64;
    case 0x94:    goto yy61;
    case 0x96:    goto yy66;
    case 0x99:    goto yy65;
    default:    goto yy29;
    }
yy31:
    yych = *++YYCURSOR;
    switch (yych) {
    case 0xA0:    goto yy47;
    case 0xA1:    goto yy45;
    case 0xA2:    goto yy51;
    case 0xA3:    goto yy49;
    case 0xA4:    goto yy35;
    case 0xA5:    goto yy37;
    case 0xA6:    goto yy33;
    case 0xA9:    goto yy43;
    case 0xAB:    goto yy41;
    case 0xAE:    goto yy59;
    case 0xB0:    goto yy57;
    case 0xBB:    goto yy39;
    case 0xBD:    goto yy55;
    case 0xBF:    goto yy53;
    default:    goto yy29;
    }
yy32:
    yych = *++YYCURSOR;
    goto yy29;
yy33:
    ++YYCURSOR;
    { /*BROKEN_BAR*/ return 0x1337; }
yy35:
    ++YYCURSOR;
    { /*CURRENCY_SIGN*/ return 0x1336; }
yy37:
    ++YYCURSOR;
    { /*YEN_SIGN*/ return 0x1335; }
yy39:
    ++YYCURSOR;
    { /*RIGHT_POINTING_DOUBLE_ANGLE_QUOTATION_MARK*/ return 0x123F; }
yy41:
    ++YYCURSOR;
    { /*LEFT_POINTING_DOUBLE_ANGLE_QUOTATION_MARK*/ return 0x123E; }
yy43:
    ++YYCURSOR;
    { /*COPYRIGHT_SIGN*/ return 0x122B; }
yy45:
    ++YYCURSOR;
    { /*INVERTED_EXCLAMATION_MARK*/ return 0x1227; }
yy47:
    ++YYCURSOR;
    { /*NO_BREAK_SPACE*/ return 0x1139; }
yy49:
    ++YYCURSOR;
    { /*POUND_SIGN*/ return 0x1136; }
yy51:
    ++YYCURSOR;
    { /*CENT_SIGN*/ return 0x1135; }
yy53:
    ++YYCURSOR;
    { /*INVERTED_QUESTION_MARK*/ return 0x1133; }
yy55:
    ++YYCURSOR;
    { /*VULGAR_FRACTION_ONE_HALF*/ return 0x1132; }
yy57:
    ++YYCURSOR;
    { /*DEGREE_SIGN*/ return 0x1131; }
yy59:
    ++YYCURSOR;
    { /*REGISTERED_SIGN*/ return 0x1130; }
yy61:
    yych = *++YYCURSOR;
    switch (yych) {
    case 0x8C:    goto yy87;
    case 0x90:    goto yy89;
    case 0x94:    goto yy91;
    case 0x98:    goto yy93;
    default:    goto yy62;
    }
yy62:
    YYCURSOR = YYMARKER;
    goto yy29;
yy63:
    yych = *++YYCURSOR;
    switch (yych) {
    case 0x94:    goto yy79;
    case 0x98:    goto yy75;
    case 0x99:    goto yy77;
    case 0x9C:    goto yy83;
    case 0x9D:    goto yy85;
    case 0xA2:    goto yy81;
    default:    goto yy62;
    }
yy64:
    yych = *++YYCURSOR;
    if (yych == 0xA0) goto yy73;
    if (yych == 0xA2) goto yy71;
    goto yy62;
yy65:
    yych = *++YYCURSOR;
    if (yych == 0xAA) goto yy69;
    goto yy62;
yy66:
    yych = *++YYCURSOR;
    if (yych != 0x88) goto yy62;
    ++YYCURSOR;
    { /*FULL_BLOCK*/ return 0x7F00; }
yy69:
    ++YYCURSOR;
    { /*EIGHTH_NOTE*/ return 0x1137; }
yy71:
    ++YYCURSOR;
    { /*TRADE_MARK_SIGN*/ return 0x1134; }
yy73:
    ++YYCURSOR;
    { /*SERVICE_MARK*/ return 0x122C; }
yy75:
    ++YYCURSOR;
    { /*LEFT_SINGLE_QUOTATION_MARK*/ return 0x1226; }
yy77:
    ++YYCURSOR;
    { /*RIGHT_SINGLE_QUOTATION_MARK -> APOSTROPHE*/ return 0x2700; }
yy79:
    ++YYCURSOR;
    { /*EM_DASH*/ return 0x122A; }
yy81:
    ++YYCURSOR;
    { /*BULLET*/ return 0x122D; }
yy83:
    ++YYCURSOR;
    { /*LEFT_DOUBLE_QUOTATION_MARK*/ return 0x122E; }
yy85:
    ++YYCURSOR;
    { /*RIGHT_DOUBLE_QUOTATION_MARK*/ return 0x122F; }
yy87:
    ++YYCURSOR;
    { /*EIA608_CHAR_BOX_DRAWINGS_LIGHT_DOWN_AND_RIGHT*/ return 0x133C; }
yy89:
    ++YYCURSOR;
    { /*EIA608_CHAR_BOX_DRAWINGS_LIGHT_DOWN_AND_LEFT*/ return 0x133D; }
yy91:
    ++YYCURSOR;
    { /*EIA608_CHAR_BOX_DRAWINGS_LIGHT_UP_AND_RIGHT*/ return 0x133E; }
yy93:
    ++YYCURSOR;
    { /*EIA608_CHAR_BOX_DRAWINGS_LIGHT_UP_AND_LEFT*/ return 0x133F; }
yy95:
    ++YYCURSOR;
    { /*LATIN_SMALL_LETTER_O_WITH_STROKE*/ return 0x133B; }
yy97:
    ++YYCURSOR;
    { /*LATIN_CAPITAL_LETTER_O_WITH_STROKE*/ return 0x133A; }
yy99:
    ++YYCURSOR;
    { /*LATIN_SMALL_LETTER_A_WITH_RING_ABOVE*/ return 0x1339; }
yy101:
    ++YYCURSOR;
    { /*LATIN_CAPITAL_LETTER_A_WITH_RING_ABOVE*/ return 0x1338; }
yy103:
    ++YYCURSOR;
    { /*LATIN_SMALL_LETTER_SHARP_S*/ return 0x1334; }
yy105:
    ++YYCURSOR;
    { /*LATIN_SMALL_LETTER_O_WITH_DIAERESIS*/ return 0x1333; }
yy107:
    ++YYCURSOR;
    { /*LATIN_CAPITAL_LETTER_O_WITH_DIAERESIS*/ return 0x1332; }
yy109:
    ++YYCURSOR;
    { /*LATIN_SMALL_LETTER_A_WITH_DIAERESIS*/ return 0x1331; }
yy111:
    ++YYCURSOR;
    { /*LATIN_CAPITAL_LETTER_A_WITH_DIAERESIS*/ return 0x1330; }
yy113:
    ++YYCURSOR;
    { /*LATIN_SMALL_LETTER_O_WITH_TILDE*/ return 0x1328; }
yy115:
    ++YYCURSOR;
    { /*LATIN_CAPITAL_LETTER_O_WITH_TILDE*/ return 0x1327; }
yy117:
    ++YYCURSOR;
    { /*LATIN_SMALL_LETTER_O_WITH_GRAVE*/ return 0x1326; }
yy119:
    ++YYCURSOR;
    { /*LATIN_CAPITAL_LETTER_O_WITH_GRAVE*/ return 0x1325; }
yy121:
    ++YYCURSOR;
    { /*LATIN_SMALL_LETTER_I_WITH_GRAVE*/ return 0x1324; }
yy123:
    ++YYCURSOR;
    { /*LATIN_CAPITAL_LETTER_I_WITH_GRAVE*/ return 0x1323; }
yy125:
    ++YYCURSOR;
    { /*LATIN_CAPITAL_LETTER_I_WITH_ACUTE*/ return 0x1322; }
yy127:
    ++YYCURSOR;
    { /*LATIN_SMALL_LETTER_A_WITH_TILDE*/ return 0x1321; }
yy129:
    ++YYCURSOR;
    { /*LATIN_CAPITAL_LETTER_A_WITH_TILDE*/ return 0x1320; }
yy131:
    ++YYCURSOR;
    { /*LATIN_CAPITAL_LETTER_U_WITH_CIRCUMFLEX*/ return 0x123D; }
yy133:
    ++YYCURSOR;
    { /*LATIN_SMALL_LETTER_U_WITH_GRAVE*/ return 0x123C; }
yy135:
    ++YYCURSOR;
    { /*LATIN_CAPITAL_LETTER_U_WITH_GRAVE*/ return 0x123B; }
yy137:
    ++YYCURSOR;
    { /*LATIN_CAPITAL_LETTER_O_WITH_CIRCUMFLEX*/ return 0x123A; }
yy139:
    ++YYCURSOR;
    { /*LATIN_SMALL_LETTER_I_WITH_DIAERESIS*/ return 0x1239; }
yy141:
    ++YYCURSOR;
    { /*LATIN_CAPITAL_LETTER_I_WITH_DIAERESIS*/ return 0x1238; }
yy143:
    ++YYCURSOR;
    { /*LATIN_CAPITAL_LETTER_I_WITH_CIRCUMFLEX*/ return 0x1237; }
yy145:
    ++YYCURSOR;
    { /*LATIN_SMALL_LETTER_E_WITH_DIAERESIS*/ return 0x1236; }
yy147:
    ++YYCURSOR;
    { /*LATIN_CAPITAL_LETTER_E_WITH_DIAERESIS*/ return 0x1235; }
yy149:
    ++YYCURSOR;
    { /*LATIN_CAPITAL_LETTER_E_WITH_CIRCUMFLEX*/ return 0x1234; }
yy151:
    ++YYCURSOR;
    { /*LATIN_CAPITAL_LETTER_E_WITH_GRAVE*/ return 0x1233; }
yy153:
    ++YYCURSOR;
    { /*LATIN_CAPITAL_LETTER_C_WITH_CEDILLA*/ return 0x1232; }
yy155:
    ++YYCURSOR;
    { /*LATIN_CAPITAL_LETTER_A_WITH_CIRCUMFLEX*/ return 0x1231; }
yy157:
    ++YYCURSOR;
    { /*LATIN_CAPITAL_LETTER_A_WITH_GRAVE*/ return 0x1230; }
yy159:
    ++YYCURSOR;
    { /*LATIN_SMALL_LETTER_U_WITH_DIAERESIS*/ return 0x1225; }
yy161:
    ++YYCURSOR;
    { /*LATIN_CAPITAL_LETTER_U_WITH_DIAERESIS*/ return 0x1224; }
yy163:
    ++YYCURSOR;
    { /*LATIN_CAPITAL_LETTER_U_WITH_ACUTE*/ return 0x1223; }
yy165:
    ++YYCURSOR;
    { /*LATIN_CAPITAL_LETTER_O_WITH_ACUTE*/ return 0x1222; }
yy167:
    ++YYCURSOR;
    { /*LATIN_CAPITAL_LETTER_E_WITH_ACUTE*/ return 0x1221; }
yy169:
    ++YYCURSOR;
    { /*LATIN_CAPITAL_LETTER_A_WITH_ACUTE*/ return 0x1220; }
yy171:
    ++YYCURSOR;
    { /*LATIN_SMALL_LETTER_U_WITH_CIRCUMFLEX*/ return 0x113F; }
yy173:
    ++YYCURSOR;
    { /*LATIN_SMALL_LETTER_O_WITH_CIRCUMFLEX*/ return 0x113E; }
yy175:
    ++YYCURSOR;
    { /*LATIN_SMALL_LETTER_I_WITH_CIRCUMFLEX*/ return 0x113D; }
yy177:
    ++YYCURSOR;
    { /*LATIN_SMALL_LETTER_E_WITH_CIRCUMFLEX*/ return 0x113C; }
yy179:
    ++YYCURSOR;
    { /*LATIN_SMALL_LETTER_A_WITH_CIRCUMFLEX*/ return 0x113B; }
yy181:
    ++YYCURSOR;
    { /*LATIN_SMALL_LETTER_E_WITH_GRAVE*/ return 0x113A; }
yy183:
    ++YYCURSOR;
    { /*LATIN_SMALL_LETTER_A_WITH_GRAVE*/ return 0x1138; }
yy185:
    ++YYCURSOR;
    { /*LATIN_SMALL_LETTER_N_WITH_TILDE*/ return 0x7E00; }
yy187:
    ++YYCURSOR;
    { /*LATIN_CAPITAL_LETTER_N_WITH_TILDE*/ return 0x7D00; }
yy189:
    ++YYCURSOR;
    { /*DIVISION_SIGN*/ return 0x7C00; }
yy191:
    ++YYCURSOR;
    { /*LATIN_SMALL_LETTER_C_WITH_CEDILLA*/ return 0x7B00; }
yy193:
    ++YYCURSOR;
    { /*LATIN_SMALL_LETTER_U_WITH_ACUTE*/ return 0x6000; }
yy195:
    ++YYCURSOR;
    { /*LATIN_SMALL_LETTER_O_WITH_ACUTE*/ return 0x5F00; }
yy197:
    ++YYCURSOR;
    { /*LATIN_SMALL_LETTER_I_WITH_ACUTE*/ return 0x5E00; }
yy199:
    ++YYCURSOR;
    { /*LATIN_SMALL_LETTER_E_WITH_ACUTE*/ return 0x5C00; }
yy201:
    ++YYCURSOR;
    { /*LATIN_SMALL_LETTER_A_WITH_ACUTE*/ return 0x2A00; }
}

}
