/* This file is automatically generated by Lemon from input grammar
** source file "src/core/userdict_parser.g". */
/*
** 2000-05-29
**
** The author disclaims copyright to this source code.  In place of
** a legal notice, here is a blessing:
**
**    May you do good and not evil.
**    May you find forgiveness for yourself and forgive others.
**    May you share freely, never taking more than you give.
**
*************************************************************************
** Driver template for the LEMON parser generator.
**
** The "lemon" program processes an LALR(1) input grammar file, then uses
** this template to construct a parser.  The "lemon" program inserts text
** at each "%%" line.  Also, any "P-a-r-s-e" identifer prefix (without the
** interstitial "-" characters) contained in this template is changed into
** the value of the %name directive from the grammar.  Otherwise, the content
** of this template is copied straight through into the generate parser
** source file.
**
** The following is the concatenation of all %include directives from the
** input grammar file:
*/
/************ Begin %include sections from the grammar ************************/
#line 16 "src/core/userdict_parser.g"
#include "core/userdict.hpp"
#line 31 "src/core/userdict_parser.c"
/**************** End of %include directives **********************************/
/* These constants specify the various numeric values for terminal symbols.
***************** Begin token definitions *************************************/
#ifndef UDTK_NEWLINE
#define UDTK_NEWLINE                         1
#define UDTK_EQUALS                          2
#define UDTK_SPACE                           3
#define UDTK_STAR                            4
#define UDTK_AND                             5
#define UDTK_LPAREN                          6
#define UDTK_RPAREN                          7
#define UDTK_LBRACE                          8
#define UDTK_RBRACE                          9
#define UDTK_COMMA                          10
#define UDTK_NATIVE_LETTERS                 11
#define UDTK_ENGLISH_LETTERS                12
#define UDTK_SYM                            13
#define UDTK_PLUS                           14
#define UDTK_STRESSED_SYL_NUMBER            15
#define UDTK_UNSTRESSED                     16
#define UDTK_INITIALISM                     17
#define UDTK_FOREIGN                        18
#define UDTK_NATIVE                         19
#endif
/**************** End token definitions ***************************************/

/* The next sections is a series of control #defines.
** various aspects of the generated parser.
**    YYCODETYPE         is the data type used to store the integer codes
**                       that represent terminal and non-terminal symbols.
**                       "unsigned char" is used if there are fewer than
**                       256 symbols.  Larger types otherwise.
**    YYNOCODE           is a number of type YYCODETYPE that is not used for
**                       any terminal or nonterminal symbol.
**    YYFALLBACK         If defined, this indicates that one or more tokens
**                       (also known as: "terminal symbols") have fall-back
**                       values which should be used if the original symbol
**                       would not parse.  This permits keywords to sometimes
**                       be used as identifiers, for example.
**    YYACTIONTYPE       is the data type used for "action codes" - numbers
**                       that indicate what to do in response to the next
**                       token.
**    userdictParseTOKENTYPE     is the data type used for minor type for terminal
**                       symbols.  Background: A "minor type" is a semantic
**                       value associated with a terminal or non-terminal
**                       symbols.  For example, for an "ID" terminal symbol,
**                       the minor type might be the name of the identifier.
**                       Each non-terminal can have a different minor type.
**                       Terminal symbols all have the same minor type, though.
**                       This macros defines the minor type for terminal 
**                       symbols.
**    YYMINORTYPE        is the data type used for all minor types.
**                       This is typically a union of many types, one of
**                       which is userdictParseTOKENTYPE.  The entry in the union
**                       for terminal symbols is called "yy0".
**    YYSTACKDEPTH       is the maximum depth of the parser's stack.  If
**                       zero the stack is dynamically sized using realloc()
**    userdictParseARG_SDECL     A static variable declaration for the %extra_argument
**    userdictParseARG_PDECL     A parameter declaration for the %extra_argument
**    userdictParseARG_PARAM     Code to pass %extra_argument as a subroutine parameter
**    userdictParseARG_STORE     Code to store %extra_argument into yypParser
**    userdictParseARG_FETCH     Code to extract %extra_argument from yypParser
**    userdictParseCTX_*         As userdictParseARG_ except for %extra_context
**    YYERRORSYMBOL      is the code number of the error symbol.  If not
**                       defined, then do no error processing.
**    YYNSTATE           the combined number of states.
**    YYNRULE            the number of rules in the grammar
**    YYNTOKEN           Number of terminal symbols
**    YY_MAX_SHIFT       Maximum value for shift actions
**    YY_MIN_SHIFTREDUCE Minimum value for shift-reduce actions
**    YY_MAX_SHIFTREDUCE Maximum value for shift-reduce actions
**    YY_ERROR_ACTION    The yy_action[] code for syntax error
**    YY_ACCEPT_ACTION   The yy_action[] code for accept
**    YY_NO_ACTION       The yy_action[] code for no-op
**    YY_MIN_REDUCE      Minimum value for reduce actions
**    YY_MAX_REDUCE      Maximum value for reduce actions
*/
#ifndef INTERFACE
# define INTERFACE 1
#endif
/************* Begin control #defines *****************************************/
#define YYCODETYPE unsigned char
#define YYNOCODE 59
#define YYACTIONTYPE unsigned char
#define userdictParseTOKENTYPE RHVoice::userdict::token*
typedef union {
  int yyinit;
  userdictParseTOKENTYPE yy0;
  RHVoice::userdict::ruleset* yy22;
} YYMINORTYPE;
#ifndef YYSTACKDEPTH
#define YYSTACKDEPTH 100
#endif
#define userdictParseARG_SDECL RHVoice::userdict::parse_state* ps;
#define userdictParseARG_PDECL ,RHVoice::userdict::parse_state* ps
#define userdictParseARG_PARAM ,ps
#define userdictParseARG_FETCH RHVoice::userdict::parse_state* ps=yypParser->ps;
#define userdictParseARG_STORE yypParser->ps=ps;
#define userdictParseCTX_SDECL
#define userdictParseCTX_PDECL
#define userdictParseCTX_PARAM
#define userdictParseCTX_FETCH
#define userdictParseCTX_STORE
#define YYNSTATE             39
#define YYNRULE              72
#define YYNRULE_WITH_ACTION  69
#define YYNTOKEN             20
#define YY_MAX_SHIFT         38
#define YY_MIN_SHIFTREDUCE   93
#define YY_MAX_SHIFTREDUCE   164
#define YY_ERROR_ACTION      165
#define YY_ACCEPT_ACTION     166
#define YY_NO_ACTION         167
#define YY_MIN_REDUCE        168
#define YY_MAX_REDUCE        239
/************* End control #defines *******************************************/
#define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))

/* Define the yytestcase() macro to be a no-op if is not already defined
** otherwise.
**
** Applications can choose to define yytestcase() in the %include section
** to a macro that can assist in verifying code coverage.  For production
** code the yytestcase() macro should be turned off.  But it is useful
** for testing.
*/
#ifndef yytestcase
# define yytestcase(X)
#endif


/* Next are the tables used to determine what action to take based on the
** current state and lookahead token.  These tables are used to implement
** functions that take a state number and lookahead value and return an
** action integer.  
**
** Suppose the action integer is N.  Then the action is determined as
** follows
**
**   0 <= N <= YY_MAX_SHIFT             Shift N.  That is, push the lookahead
**                                      token onto the stack and goto state N.
**
**   N between YY_MIN_SHIFTREDUCE       Shift to an arbitrary state then
**     and YY_MAX_SHIFTREDUCE           reduce by rule N-YY_MIN_SHIFTREDUCE.
**
**   N == YY_ERROR_ACTION               A syntax error has occurred.
**
**   N == YY_ACCEPT_ACTION              The parser accepts its input.
**
**   N == YY_NO_ACTION                  No such action.  Denotes unused
**                                      slots in the yy_action[] table.
**
**   N between YY_MIN_REDUCE            Reduce by rule N-YY_MIN_REDUCE
**     and YY_MAX_REDUCE
**
** The action table is constructed as a single large table named yy_action[].
** Given state S and lookahead X, the action is computed as either:
**
**    (A)   N = yy_action[ yy_shift_ofst[S] + X ]
**    (B)   N = yy_default[S]
**
** The (A) formula is preferred.  The B formula is used instead if
** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X.
**
** The formulas above are for computing the action when the lookahead is
** a terminal symbol.  If the lookahead is a non-terminal (as occurs after
** a reduce action) then the yy_reduce_ofst[] array is used in place of
** the yy_shift_ofst[] array.
**
** The following are the tables generated in this section:
**
**  yy_action[]        A single table containing all actions.
**  yy_lookahead[]     A table containing the lookahead for each entry in
**                     yy_action.  Used to detect hash collisions.
**  yy_shift_ofst[]    For each state, the offset into yy_action for
**                     shifting terminals.
**  yy_reduce_ofst[]   For each state, the offset into yy_action for
**                     shifting non-terminals after a reduce.
**  yy_default[]       Default action for each state.
**
*********** Begin parsing tables **********************************************/
#define YY_ACTTAB_COUNT (204)
static const YYACTIONTYPE yy_action[] = {
 /*     0 */   184,  186,  183,  206,   25,  200,   14,  204,  205,    7,
 /*    10 */    34,  206,  148,  149,  171,  187,  205,   15,  220,  164,
 /*    20 */   188,  231,   24,  192,   23,   22,  197,  221,   17,  222,
 /*    30 */     7,    3,  102,   31,   30,   18,  154,  230,  174,   35,
 /*    40 */   182,    1,  185,  186,   38,  169,  170,  206,    2,  199,
 /*    50 */    14,  204,  205,  206,    4,  206,   29,  187,  205,  203,
 /*    60 */   205,   33,  188,  213,  157,  173,   35,  182,    1,  185,
 /*    70 */   186,   20,  151,  152,  231,   21,  217,  159,  218,  153,
 /*    80 */   206,  166,  154,   36,  187,  205,  100,  196,   33,  188,
 /*    90 */   160,   17,  195,    7,    8,  150,  148,  149,  219,  154,
 /*   100 */   157,  158,  159,  160,  161,  157,  158,  221,  160,  222,
 /*   110 */   123,   12,   10,    9,   27,  172,   28,   26,   11,   16,
 /*   120 */   220,    5,  181,    1,  185,  186,   19,  227,  226,  221,
 /*   130 */     6,  222,   13,  237,  168,  206,   37,  167,  167,  187,
 /*   140 */   205,  167,  167,  114,  188,  167,  167,  153,   32,  167,
 /*   150 */   154,  210,   11,   16,  220,  212,   11,   16,  220,  211,
 /*   160 */    11,   16,  220,  221,  167,  222,  167,  221,  167,  222,
 /*   170 */   167,  221,  167,  222,  167,  167,  209,   11,   16,  220,
 /*   180 */   167,  167,  167,  167,  167,  167,  167,  167,  221,  167,
 /*   190 */   222,  167,  167,  167,  167,   17,  167,    7,  167,  167,
 /*   200 */   148,  149,  167,  154,
};
static const YYCODETYPE yy_lookahead[] = {
 /*     0 */    30,   31,   32,   41,   42,   43,   44,   45,   46,    8,
 /*    10 */    49,   41,   11,   12,   25,   45,   46,   38,   39,    3,
 /*    20 */    50,   51,   52,   53,   54,   55,   56,   48,    6,   50,
 /*    30 */     8,    3,    4,   11,   12,   23,   14,   51,   26,   27,
 /*    40 */    28,   29,   30,   31,   20,   21,   22,   41,   24,   43,
 /*    50 */    44,   45,   46,   41,   58,   41,   58,   45,   46,   45,
 /*    60 */    46,   49,   50,   40,   15,   26,   27,   28,   29,   30,
 /*    70 */    31,   47,   11,   12,   51,   52,   53,   17,   55,   11,
 /*    80 */    41,   57,   14,    1,   45,   46,    4,   54,   49,   50,
 /*    90 */    18,    6,   55,    8,    3,   13,   11,   12,   39,   14,
 /*   100 */    15,   16,   17,   18,   19,   15,   16,   48,   18,   50,
 /*   110 */     9,   10,    5,    3,   33,   34,   35,   36,   37,   38,
 /*   120 */    39,    5,   28,   29,   30,   31,    2,    2,    2,   48,
 /*   130 */     2,   50,    2,    0,    0,   41,    1,   59,   59,   45,
 /*   140 */    46,   59,   59,    7,   50,   59,   59,   11,   33,   59,
 /*   150 */    14,   36,   37,   38,   39,   36,   37,   38,   39,   36,
 /*   160 */    37,   38,   39,   48,   59,   50,   59,   48,   59,   50,
 /*   170 */    59,   48,   59,   50,   59,   59,   36,   37,   38,   39,
 /*   180 */    59,   59,   59,   59,   59,   59,   59,   59,   48,   59,
 /*   190 */    50,   59,   59,   59,   59,    6,   59,    8,   59,   59,
 /*   200 */    11,   12,   59,   14,   59,   59,   59,   59,   59,   59,
 /*   210 */    59,   59,   59,   59,   59,   59,   20,   20,   20,   20,
 /*   220 */    20,   20,   20,   20,
};
#define YY_SHIFT_COUNT    (38)
#define YY_SHIFT_MIN      (0)
#define YY_SHIFT_MAX      (189)
static const unsigned char yy_shift_ofst[] = {
 /*     0 */    82,   85,   22,   22,   68,  189,   68,    1,   68,   68,
 /*    10 */    68,   90,    1,   68,    1,  136,   68,   61,   28,   16,
 /*    20 */    16,   49,   60,   72,   49,  101,   91,  107,  110,  124,
 /*    30 */   125,  126,  107,  128,  130,  116,  133,  134,  135,
};
#define YY_REDUCE_COUNT (24)
#define YY_REDUCE_MIN   (-39)
#define YY_REDUCE_MAX   (140)
static const short yy_reduce_ofst[] = {
 /*     0 */    24,  -30,   12,   39,   81,   94,  115,  -38,  119,  123,
 /*    10 */   140,   23,    6,  -21,   14,   59,   59,  -39,  -11,   -4,
 /*    20 */    -2,  -14,   33,   37,  -14,
};
static const YYACTIONTYPE yy_default[] = {
 /*     0 */   176,  190,  165,  165,  165,  165,  165,  202,  165,  165,
 /*    10 */   165,  215,  202,  165,  201,  165,  214,  165,  178,  238,
 /*    20 */   238,  216,  194,  193,  191,  165,  210,  208,  207,  165,
 /*    30 */   224,  223,  180,  165,  165,  179,  165,  165,  165,
};
/********** End of lemon-generated parsing tables *****************************/

/* The next table maps tokens (terminal symbols) into fallback tokens.  
** If a construct like the following:
** 
**      %fallback ID X Y Z.
**
** appears in the grammar, then ID becomes a fallback token for X, Y,
** and Z.  Whenever one of the tokens X, Y, or Z is input to the parser
** but it does not parse, the type of the token is changed to ID and
** the parse is retried before an error is thrown.
**
** This feature can be used, for example, to cause some keywords in a language
** to revert to identifiers if they keyword does not apply in the context where
** it appears.
*/
#ifdef YYFALLBACK
static const YYCODETYPE yyFallback[] = {
};
#endif /* YYFALLBACK */

/* The following structure represents a single element of the
** parser's stack.  Information stored includes:
**
**   +  The state number for the parser at this level of the stack.
**
**   +  The value of the token stored at this level of the stack.
**      (In other words, the "major" token.)
**
**   +  The semantic value stored at this level of the stack.  This is
**      the information used by the action routines in the grammar.
**      It is sometimes called the "minor" token.
**
** After the "shift" half of a SHIFTREDUCE action, the stateno field
** actually contains the reduce action for the second half of the
** SHIFTREDUCE.
*/
struct yyStackEntry {
  YYACTIONTYPE stateno;  /* The state-number, or reduce action in SHIFTREDUCE */
  YYCODETYPE major;      /* The major token value.  This is the code
                         ** number for the token at this stack level */
  YYMINORTYPE minor;     /* The user-supplied minor token value.  This
                         ** is the value of the token  */
};
typedef struct yyStackEntry yyStackEntry;

/* The state of the parser is completely contained in an instance of
** the following structure */
struct yyParser {
  yyStackEntry *yytos;          /* Pointer to top element of the stack */
#ifdef YYTRACKMAXSTACKDEPTH
  int yyhwm;                    /* High-water mark of the stack */
#endif
#ifndef YYNOERRORRECOVERY
  int yyerrcnt;                 /* Shifts left before out of the error */
#endif
  userdictParseARG_SDECL                /* A place to hold %extra_argument */
  userdictParseCTX_SDECL                /* A place to hold %extra_context */
#if YYSTACKDEPTH<=0
  int yystksz;                  /* Current side of the stack */
  yyStackEntry *yystack;        /* The parser's stack */
  yyStackEntry yystk0;          /* First stack entry */
#else
  yyStackEntry yystack[YYSTACKDEPTH];  /* The parser's stack */
  yyStackEntry *yystackEnd;            /* Last entry in the stack */
#endif
};
typedef struct yyParser yyParser;

#include <assert.h>
#ifndef NDEBUG
#include <stdio.h>
static FILE *yyTraceFILE = 0;
static char *yyTracePrompt = 0;
#endif /* NDEBUG */

#ifndef NDEBUG
/* 
** Turn parser tracing on by giving a stream to which to write the trace
** and a prompt to preface each trace message.  Tracing is turned off
** by making either argument NULL 
**
** Inputs:
** <ul>
** <li> A FILE* to which trace output should be written.
**      If NULL, then tracing is turned off.
** <li> A prefix string written at the beginning of every
**      line of trace output.  If NULL, then tracing is
**      turned off.
** </ul>
**
** Outputs:
** None.
*/
void userdictParseTrace(FILE *TraceFILE, char *zTracePrompt){
  yyTraceFILE = TraceFILE;
  yyTracePrompt = zTracePrompt;
  if( yyTraceFILE==0 ) yyTracePrompt = 0;
  else if( yyTracePrompt==0 ) yyTraceFILE = 0;
}
#endif /* NDEBUG */

#if defined(YYCOVERAGE) || !defined(NDEBUG)
/* For tracing shifts, the names of all terminals and nonterminals
** are required.  The following table supplies these names */
static const char *const yyTokenName[] = { 
  /*    0 */ "$",
  /*    1 */ "NEWLINE",
  /*    2 */ "EQUALS",
  /*    3 */ "SPACE",
  /*    4 */ "STAR",
  /*    5 */ "AND",
  /*    6 */ "LPAREN",
  /*    7 */ "RPAREN",
  /*    8 */ "LBRACE",
  /*    9 */ "RBRACE",
  /*   10 */ "COMMA",
  /*   11 */ "NATIVE_LETTERS",
  /*   12 */ "ENGLISH_LETTERS",
  /*   13 */ "SYM",
  /*   14 */ "PLUS",
  /*   15 */ "STRESSED_SYL_NUMBER",
  /*   16 */ "UNSTRESSED",
  /*   17 */ "INITIALISM",
  /*   18 */ "FOREIGN",
  /*   19 */ "NATIVE",
  /*   20 */ "rule",
  /*   21 */ "collocation_rule",
  /*   22 */ "symbol_rule",
  /*   23 */ "tokens",
  /*   24 */ "prefix",
  /*   25 */ "suffix",
  /*   26 */ "token",
  /*   27 */ "words",
  /*   28 */ "word",
  /*   29 */ "inline_rewrites",
  /*   30 */ "inline_rewrite",
  /*   31 */ "inline_replacement",
  /*   32 */ "word_flags",
  /*   33 */ "token_pron",
  /*   34 */ "symbol_pron",
  /*   35 */ "spaced_symbol_pron",
  /*   36 */ "word_pron",
  /*   37 */ "pron_repr",
  /*   38 */ "text_pron_repr",
  /*   39 */ "text_pron_repr_atom",
  /*   40 */ "word_pron_flags",
  /*   41 */ "set",
  /*   42 */ "set_elements",
  /*   43 */ "set_element",
  /*   44 */ "pattern",
  /*   45 */ "subpattern",
  /*   46 */ "substring",
  /*   47 */ "symbol",
  /*   48 */ "insertion",
  /*   49 */ "deletion",
  /*   50 */ "stress_mark",
  /*   51 */ "stressed_syl_number",
  /*   52 */ "stressed_syl_numbers",
  /*   53 */ "unstressed_flag",
  /*   54 */ "initialism_flag",
  /*   55 */ "foreign_flag",
  /*   56 */ "native_flag",
  /*   57 */ "line",
  /*   58 */ "space",
};
#endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */

#ifndef NDEBUG
/* For tracing reduce actions, the names of all rules are required.
*/
static const char *const yyRuleName[] = {
 /*   0 */ "line ::= rule NEWLINE",
 /*   1 */ "rule ::= collocation_rule",
 /*   2 */ "rule ::= symbol_rule",
 /*   3 */ "collocation_rule ::= prefix tokens suffix",
 /*   4 */ "symbol_rule ::= symbol space EQUALS space symbol_pron",
 /*   5 */ "tokens ::= tokens SPACE token",
 /*   6 */ "tokens ::= token",
 /*   7 */ "prefix ::= STAR",
 /*   8 */ "prefix ::=",
 /*   9 */ "suffix ::= STAR",
 /*  10 */ "suffix ::=",
 /*  11 */ "token ::= words",
 /*  12 */ "token ::= deletion EQUALS token_pron",
 /*  13 */ "words ::= words AND word",
 /*  14 */ "words ::= word",
 /*  15 */ "word ::= inline_rewrites word_flags",
 /*  16 */ "inline_rewrites ::= inline_rewrites inline_rewrite",
 /*  17 */ "inline_rewrites ::= inline_rewrite",
 /*  18 */ "inline_rewrite ::= inline_replacement",
 /*  19 */ "inline_rewrite ::= subpattern",
 /*  20 */ "inline_rewrite ::= stress_mark",
 /*  21 */ "inline_replacement ::= LPAREN deletion EQUALS text_pron_repr RPAREN",
 /*  22 */ "word_flags ::=",
 /*  23 */ "word_flags ::= stressed_syl_numbers",
 /*  24 */ "word_flags ::= unstressed_flag",
 /*  25 */ "word_flags ::= initialism_flag",
 /*  26 */ "word_flags ::= foreign_flag",
 /*  27 */ "word_flags ::= initialism_flag foreign_flag",
 /*  28 */ "word_flags ::= foreign_flag initialism_flag",
 /*  29 */ "word_flags ::= native_flag",
 /*  30 */ "set ::= LBRACE set_elements RBRACE",
 /*  31 */ "set_elements ::= set_elements COMMA set_element",
 /*  32 */ "set_elements ::= set_element",
 /*  33 */ "set_element ::= pattern",
 /*  34 */ "set_element ::=",
 /*  35 */ "pattern ::= pattern subpattern",
 /*  36 */ "pattern ::= subpattern",
 /*  37 */ "subpattern ::= substring",
 /*  38 */ "subpattern ::= set",
 /*  39 */ "symbol_pron ::= spaced_symbol_pron",
 /*  40 */ "symbol_pron ::= token_pron",
 /*  41 */ "token_pron ::= token_pron AND word_pron",
 /*  42 */ "token_pron ::= word_pron",
 /*  43 */ "spaced_symbol_pron ::= spaced_symbol_pron SPACE word_pron",
 /*  44 */ "spaced_symbol_pron ::= word_pron SPACE word_pron",
 /*  45 */ "word_pron ::= pron_repr word_pron_flags",
 /*  46 */ "pron_repr ::= text_pron_repr",
 /*  47 */ "word_pron_flags ::=",
 /*  48 */ "word_pron_flags ::= stressed_syl_numbers",
 /*  49 */ "word_pron_flags ::= unstressed_flag",
 /*  50 */ "word_pron_flags ::= foreign_flag",
 /*  51 */ "text_pron_repr ::= text_pron_repr text_pron_repr_atom",
 /*  52 */ "text_pron_repr ::= text_pron_repr_atom",
 /*  53 */ "text_pron_repr_atom ::= insertion",
 /*  54 */ "text_pron_repr_atom ::= stress_mark",
 /*  55 */ "substring ::= NATIVE_LETTERS",
 /*  56 */ "substring ::= ENGLISH_LETTERS",
 /*  57 */ "symbol ::= SYM",
 /*  58 */ "deletion ::= NATIVE_LETTERS",
 /*  59 */ "deletion ::= ENGLISH_LETTERS",
 /*  60 */ "insertion ::= NATIVE_LETTERS",
 /*  61 */ "stress_mark ::= PLUS",
 /*  62 */ "stressed_syl_numbers ::= stressed_syl_numbers stressed_syl_number",
 /*  63 */ "stressed_syl_numbers ::= stressed_syl_number",
 /*  64 */ "stressed_syl_number ::= STRESSED_SYL_NUMBER",
 /*  65 */ "unstressed_flag ::= UNSTRESSED",
 /*  66 */ "initialism_flag ::= INITIALISM",
 /*  67 */ "foreign_flag ::= FOREIGN",
 /*  68 */ "native_flag ::= NATIVE",
 /*  69 */ "line ::= NEWLINE",
 /*  70 */ "space ::=",
 /*  71 */ "space ::= SPACE",
};
#endif /* NDEBUG */


#if YYSTACKDEPTH<=0
/*
** Try to increase the size of the parser stack.  Return the number
** of errors.  Return 0 on success.
*/
static int yyGrowStack(yyParser *p){
  int newSize;
  int idx;
  yyStackEntry *pNew;

  newSize = p->yystksz*2 + 100;
  idx = p->yytos ? (int)(p->yytos - p->yystack) : 0;
  if( p->yystack==&p->yystk0 ){
    pNew = malloc(newSize*sizeof(pNew[0]));
    if( pNew ) pNew[0] = p->yystk0;
  }else{
    pNew = realloc(p->yystack, newSize*sizeof(pNew[0]));
  }
  if( pNew ){
    p->yystack = pNew;
    p->yytos = &p->yystack[idx];
#ifndef NDEBUG
    if( yyTraceFILE ){
      fprintf(yyTraceFILE,"%sStack grows from %d to %d entries.\n",
              yyTracePrompt, p->yystksz, newSize);
    }
#endif
    p->yystksz = newSize;
  }
  return pNew==0; 
}
#endif

/* Datatype of the argument to the memory allocated passed as the
** second argument to userdictParseAlloc() below.  This can be changed by
** putting an appropriate #define in the %include section of the input
** grammar.
*/
#ifndef YYMALLOCARGTYPE
# define YYMALLOCARGTYPE size_t
#endif

/* Initialize a new parser that has already been allocated.
*/
void userdictParseInit(void *yypRawParser userdictParseCTX_PDECL){
  yyParser *yypParser = (yyParser*)yypRawParser;
  userdictParseCTX_STORE
#ifdef YYTRACKMAXSTACKDEPTH
  yypParser->yyhwm = 0;
#endif
#if YYSTACKDEPTH<=0
  yypParser->yytos = NULL;
  yypParser->yystack = NULL;
  yypParser->yystksz = 0;
  if( yyGrowStack(yypParser) ){
    yypParser->yystack = &yypParser->yystk0;
    yypParser->yystksz = 1;
  }
#endif
#ifndef YYNOERRORRECOVERY
  yypParser->yyerrcnt = -1;
#endif
  yypParser->yytos = yypParser->yystack;
  yypParser->yystack[0].stateno = 0;
  yypParser->yystack[0].major = 0;
#if YYSTACKDEPTH>0
  yypParser->yystackEnd = &yypParser->yystack[YYSTACKDEPTH-1];
#endif
}

#ifndef userdictParse_ENGINEALWAYSONSTACK
/* 
** This function allocates a new parser.
** The only argument is a pointer to a function which works like
** malloc.
**
** Inputs:
** A pointer to the function used to allocate memory.
**
** Outputs:
** A pointer to a parser.  This pointer is used in subsequent calls
** to userdictParse and userdictParseFree.
*/
void *userdictParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE) userdictParseCTX_PDECL){
  yyParser *yypParser;
  yypParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) );
  if( yypParser ){
    userdictParseCTX_STORE
    userdictParseInit(yypParser userdictParseCTX_PARAM);
  }
  return (void*)yypParser;
}
#endif /* userdictParse_ENGINEALWAYSONSTACK */


/* The following function deletes the "minor type" or semantic value
** associated with a symbol.  The symbol can be either a terminal
** or nonterminal. "yymajor" is the symbol code, and "yypminor" is
** a pointer to the value to be deleted.  The code used to do the 
** deletions is derived from the %destructor and/or %token_destructor
** directives of the input grammar.
*/
static void yy_destructor(
  yyParser *yypParser,    /* The parser */
  YYCODETYPE yymajor,     /* Type code for object to destroy */
  YYMINORTYPE *yypminor   /* The object to be destroyed */
){
  userdictParseARG_FETCH
  userdictParseCTX_FETCH
  switch( yymajor ){
    /* Here is inserted the actions which take place when a
    ** terminal or non-terminal is destroyed.  This can happen
    ** when the symbol is popped from the stack during a
    ** reduce or during error processing or when a parser is 
    ** being destroyed before it is finished parsing.
    **
    ** Note: during a reduce, the only symbols destroyed are those
    ** which appear on the RHS of the rule, but which are *not* used
    ** inside the C code.
    */
/********* Begin destructor definitions ***************************************/
      /* TERMINAL Destructor */
    case 1: /* NEWLINE */
    case 2: /* EQUALS */
    case 3: /* SPACE */
    case 4: /* STAR */
    case 5: /* AND */
    case 6: /* LPAREN */
    case 7: /* RPAREN */
    case 8: /* LBRACE */
    case 9: /* RBRACE */
    case 10: /* COMMA */
    case 11: /* NATIVE_LETTERS */
    case 12: /* ENGLISH_LETTERS */
    case 13: /* SYM */
    case 14: /* PLUS */
    case 15: /* STRESSED_SYL_NUMBER */
    case 16: /* UNSTRESSED */
    case 17: /* INITIALISM */
    case 18: /* FOREIGN */
    case 19: /* NATIVE */
{
#line 24 "src/core/userdict_parser.g"
delete (yypminor->yy0);
#line 676 "src/core/userdict_parser.c"
}
      break;
    case 20: /* rule */
    case 21: /* collocation_rule */
    case 22: /* symbol_rule */
    case 23: /* tokens */
    case 24: /* prefix */
    case 25: /* suffix */
    case 26: /* token */
    case 27: /* words */
    case 28: /* word */
    case 29: /* inline_rewrites */
    case 30: /* inline_rewrite */
    case 31: /* inline_replacement */
    case 32: /* word_flags */
    case 33: /* token_pron */
    case 34: /* symbol_pron */
    case 35: /* spaced_symbol_pron */
    case 36: /* word_pron */
    case 37: /* pron_repr */
    case 38: /* text_pron_repr */
    case 39: /* text_pron_repr_atom */
    case 40: /* word_pron_flags */
    case 41: /* set */
    case 42: /* set_elements */
    case 43: /* set_element */
    case 44: /* pattern */
    case 45: /* subpattern */
    case 46: /* substring */
    case 47: /* symbol */
    case 48: /* insertion */
    case 49: /* deletion */
    case 50: /* stress_mark */
    case 51: /* stressed_syl_number */
    case 52: /* stressed_syl_numbers */
    case 53: /* unstressed_flag */
    case 54: /* initialism_flag */
    case 55: /* foreign_flag */
    case 56: /* native_flag */
{
#line 27 "src/core/userdict_parser.g"
delete (yypminor->yy22);
#line 719 "src/core/userdict_parser.c"
}
      break;
/********* End destructor definitions *****************************************/
    default:  break;   /* If no destructor action specified: do nothing */
  }
}

/*
** Pop the parser's stack once.
**
** If there is a destructor routine associated with the token which
** is popped from the stack, then call it.
*/
static void yy_pop_parser_stack(yyParser *pParser){
  yyStackEntry *yytos;
  assert( pParser->yytos!=0 );
  assert( pParser->yytos > pParser->yystack );
  yytos = pParser->yytos--;
#ifndef NDEBUG
  if( yyTraceFILE ){
    fprintf(yyTraceFILE,"%sPopping %s\n",
      yyTracePrompt,
      yyTokenName[yytos->major]);
  }
#endif
  yy_destructor(pParser, yytos->major, &yytos->minor);
}

/*
** Clear all secondary memory allocations from the parser
*/
void userdictParseFinalize(void *p){
  yyParser *pParser = (yyParser*)p;
  while( pParser->yytos>pParser->yystack ) yy_pop_parser_stack(pParser);
#if YYSTACKDEPTH<=0
  if( pParser->yystack!=&pParser->yystk0 ) free(pParser->yystack);
#endif
}

#ifndef userdictParse_ENGINEALWAYSONSTACK
/* 
** Deallocate and destroy a parser.  Destructors are called for
** all stack elements before shutting the parser down.
**
** If the YYPARSEFREENEVERNULL macro exists (for example because it
** is defined in a %include section of the input grammar) then it is
** assumed that the input pointer is never NULL.
*/
void userdictParseFree(
  void *p,                    /* The parser to be deleted */
  void (*freeProc)(void*)     /* Function used to reclaim memory */
){
#ifndef YYPARSEFREENEVERNULL
  if( p==0 ) return;
#endif
  userdictParseFinalize(p);
  (*freeProc)(p);
}
#endif /* userdictParse_ENGINEALWAYSONSTACK */

/*
** Return the peak depth of the stack for a parser.
*/
#ifdef YYTRACKMAXSTACKDEPTH
int userdictParseStackPeak(void *p){
  yyParser *pParser = (yyParser*)p;
  return pParser->yyhwm;
}
#endif

/* This array of booleans keeps track of the parser statement
** coverage.  The element yycoverage[X][Y] is set when the parser
** is in state X and has a lookahead token Y.  In a well-tested
** systems, every element of this matrix should end up being set.
*/
#if defined(YYCOVERAGE)
static unsigned char yycoverage[YYNSTATE][YYNTOKEN];
#endif

/*
** Write into out a description of every state/lookahead combination that
**
**   (1)  has not been used by the parser, and
**   (2)  is not a syntax error.
**
** Return the number of missed state/lookahead combinations.
*/
#if defined(YYCOVERAGE)
int userdictParseCoverage(FILE *out){
  int stateno, iLookAhead, i;
  int nMissed = 0;
  for(stateno=0; stateno<YYNSTATE; stateno++){
    i = yy_shift_ofst[stateno];
    for(iLookAhead=0; iLookAhead<YYNTOKEN; iLookAhead++){
      if( yy_lookahead[i+iLookAhead]!=iLookAhead ) continue;
      if( yycoverage[stateno][iLookAhead]==0 ) nMissed++;
      if( out ){
        fprintf(out,"State %d lookahead %s %s\n", stateno,
                yyTokenName[iLookAhead],
                yycoverage[stateno][iLookAhead] ? "ok" : "missed");
      }
    }
  }
  return nMissed;
}
#endif

/*
** Find the appropriate action for a parser given the terminal
** look-ahead token iLookAhead.
*/
static YYACTIONTYPE yy_find_shift_action(
  YYCODETYPE iLookAhead,    /* The look-ahead token */
  YYACTIONTYPE stateno      /* Current state number */
){
  int i;

  if( stateno>YY_MAX_SHIFT ) return stateno;
  assert( stateno <= YY_SHIFT_COUNT );
#if defined(YYCOVERAGE)
  yycoverage[stateno][iLookAhead] = 1;
#endif
  do{
    i = yy_shift_ofst[stateno];
    assert( i>=0 );
    assert( i<=YY_ACTTAB_COUNT );
    assert( i+YYNTOKEN<=(int)YY_NLOOKAHEAD );
    assert( iLookAhead!=YYNOCODE );
    assert( iLookAhead < YYNTOKEN );
    i += iLookAhead;
    assert( i<(int)YY_NLOOKAHEAD );
    if( yy_lookahead[i]!=iLookAhead ){
#ifdef YYFALLBACK
      YYCODETYPE iFallback;            /* Fallback token */
      assert( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0]) );
      iFallback = yyFallback[iLookAhead];
      if( iFallback!=0 ){
#ifndef NDEBUG
        if( yyTraceFILE ){
          fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n",
             yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]);
        }
#endif
        assert( yyFallback[iFallback]==0 ); /* Fallback loop must terminate */
        iLookAhead = iFallback;
        continue;
      }
#endif
#ifdef YYWILDCARD
      {
        int j = i - iLookAhead + YYWILDCARD;
        assert( j<(int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])) );
        if( yy_lookahead[j]==YYWILDCARD && iLookAhead>0 ){
#ifndef NDEBUG
          if( yyTraceFILE ){
            fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n",
               yyTracePrompt, yyTokenName[iLookAhead],
               yyTokenName[YYWILDCARD]);
          }
#endif /* NDEBUG */
          return yy_action[j];
        }
      }
#endif /* YYWILDCARD */
      return yy_default[stateno];
    }else{
      assert( i>=0 && i<(int)(sizeof(yy_action)/sizeof(yy_action[0])) );
      return yy_action[i];
    }
  }while(1);
}

/*
** Find the appropriate action for a parser given the non-terminal
** look-ahead token iLookAhead.
*/
static YYACTIONTYPE yy_find_reduce_action(
  YYACTIONTYPE stateno,     /* Current state number */
  YYCODETYPE iLookAhead     /* The look-ahead token */
){
  int i;
#ifdef YYERRORSYMBOL
  if( stateno>YY_REDUCE_COUNT ){
    return yy_default[stateno];
  }
#else
  assert( stateno<=YY_REDUCE_COUNT );
#endif
  i = yy_reduce_ofst[stateno];
  assert( iLookAhead!=YYNOCODE );
  i += iLookAhead;
#ifdef YYERRORSYMBOL
  if( i<0 || i>=YY_ACTTAB_COUNT || yy_lookahead[i]!=iLookAhead ){
    return yy_default[stateno];
  }
#else
  assert( i>=0 && i<YY_ACTTAB_COUNT );
  assert( yy_lookahead[i]==iLookAhead );
#endif
  return yy_action[i];
}

/*
** The following routine is called if the stack overflows.
*/
static void yyStackOverflow(yyParser *yypParser){
   userdictParseARG_FETCH
   userdictParseCTX_FETCH
#ifndef NDEBUG
   if( yyTraceFILE ){
     fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt);
   }
#endif
   while( yypParser->yytos>yypParser->yystack ) yy_pop_parser_stack(yypParser);
   /* Here code is inserted which will execute if the parser
   ** stack every overflows */
/******** Begin %stack_overflow code ******************************************/
/******** End %stack_overflow code ********************************************/
   userdictParseARG_STORE /* Suppress warning about unused %extra_argument var */
   userdictParseCTX_STORE
}

/*
** Print tracing information for a SHIFT action
*/
#ifndef NDEBUG
static void yyTraceShift(yyParser *yypParser, int yyNewState, const char *zTag){
  if( yyTraceFILE ){
    if( yyNewState<YYNSTATE ){
      fprintf(yyTraceFILE,"%s%s '%s', go to state %d\n",
         yyTracePrompt, zTag, yyTokenName[yypParser->yytos->major],
         yyNewState);
    }else{
      fprintf(yyTraceFILE,"%s%s '%s', pending reduce %d\n",
         yyTracePrompt, zTag, yyTokenName[yypParser->yytos->major],
         yyNewState - YY_MIN_REDUCE);
    }
  }
}
#else
# define yyTraceShift(X,Y,Z)
#endif

/*
** Perform a shift action.
*/
static void yy_shift(
  yyParser *yypParser,          /* The parser to be shifted */
  YYACTIONTYPE yyNewState,      /* The new state to shift in */
  YYCODETYPE yyMajor,           /* The major token to shift in */
  userdictParseTOKENTYPE yyMinor        /* The minor token to shift in */
){
  yyStackEntry *yytos;
  yypParser->yytos++;
#ifdef YYTRACKMAXSTACKDEPTH
  if( (int)(yypParser->yytos - yypParser->yystack)>yypParser->yyhwm ){
    yypParser->yyhwm++;
    assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack) );
  }
#endif
#if YYSTACKDEPTH>0 
  if( yypParser->yytos>yypParser->yystackEnd ){
    yypParser->yytos--;
    yyStackOverflow(yypParser);
    return;
  }
#else
  if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz] ){
    if( yyGrowStack(yypParser) ){
      yypParser->yytos--;
      yyStackOverflow(yypParser);
      return;
    }
  }
#endif
  if( yyNewState > YY_MAX_SHIFT ){
    yyNewState += YY_MIN_REDUCE - YY_MIN_SHIFTREDUCE;
  }
  yytos = yypParser->yytos;
  yytos->stateno = yyNewState;
  yytos->major = yyMajor;
  yytos->minor.yy0 = yyMinor;
  yyTraceShift(yypParser, yyNewState, "Shift");
}

/* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side
** of that rule */
static const YYCODETYPE yyRuleInfoLhs[] = {
    57,  /* (0) line ::= rule NEWLINE */
    20,  /* (1) rule ::= collocation_rule */
    20,  /* (2) rule ::= symbol_rule */
    21,  /* (3) collocation_rule ::= prefix tokens suffix */
    22,  /* (4) symbol_rule ::= symbol space EQUALS space symbol_pron */
    23,  /* (5) tokens ::= tokens SPACE token */
    23,  /* (6) tokens ::= token */
    24,  /* (7) prefix ::= STAR */
    24,  /* (8) prefix ::= */
    25,  /* (9) suffix ::= STAR */
    25,  /* (10) suffix ::= */
    26,  /* (11) token ::= words */
    26,  /* (12) token ::= deletion EQUALS token_pron */
    27,  /* (13) words ::= words AND word */
    27,  /* (14) words ::= word */
    28,  /* (15) word ::= inline_rewrites word_flags */
    29,  /* (16) inline_rewrites ::= inline_rewrites inline_rewrite */
    29,  /* (17) inline_rewrites ::= inline_rewrite */
    30,  /* (18) inline_rewrite ::= inline_replacement */
    30,  /* (19) inline_rewrite ::= subpattern */
    30,  /* (20) inline_rewrite ::= stress_mark */
    31,  /* (21) inline_replacement ::= LPAREN deletion EQUALS text_pron_repr RPAREN */
    32,  /* (22) word_flags ::= */
    32,  /* (23) word_flags ::= stressed_syl_numbers */
    32,  /* (24) word_flags ::= unstressed_flag */
    32,  /* (25) word_flags ::= initialism_flag */
    32,  /* (26) word_flags ::= foreign_flag */
    32,  /* (27) word_flags ::= initialism_flag foreign_flag */
    32,  /* (28) word_flags ::= foreign_flag initialism_flag */
    32,  /* (29) word_flags ::= native_flag */
    41,  /* (30) set ::= LBRACE set_elements RBRACE */
    42,  /* (31) set_elements ::= set_elements COMMA set_element */
    42,  /* (32) set_elements ::= set_element */
    43,  /* (33) set_element ::= pattern */
    43,  /* (34) set_element ::= */
    44,  /* (35) pattern ::= pattern subpattern */
    44,  /* (36) pattern ::= subpattern */
    45,  /* (37) subpattern ::= substring */
    45,  /* (38) subpattern ::= set */
    34,  /* (39) symbol_pron ::= spaced_symbol_pron */
    34,  /* (40) symbol_pron ::= token_pron */
    33,  /* (41) token_pron ::= token_pron AND word_pron */
    33,  /* (42) token_pron ::= word_pron */
    35,  /* (43) spaced_symbol_pron ::= spaced_symbol_pron SPACE word_pron */
    35,  /* (44) spaced_symbol_pron ::= word_pron SPACE word_pron */
    36,  /* (45) word_pron ::= pron_repr word_pron_flags */
    37,  /* (46) pron_repr ::= text_pron_repr */
    40,  /* (47) word_pron_flags ::= */
    40,  /* (48) word_pron_flags ::= stressed_syl_numbers */
    40,  /* (49) word_pron_flags ::= unstressed_flag */
    40,  /* (50) word_pron_flags ::= foreign_flag */
    38,  /* (51) text_pron_repr ::= text_pron_repr text_pron_repr_atom */
    38,  /* (52) text_pron_repr ::= text_pron_repr_atom */
    39,  /* (53) text_pron_repr_atom ::= insertion */
    39,  /* (54) text_pron_repr_atom ::= stress_mark */
    46,  /* (55) substring ::= NATIVE_LETTERS */
    46,  /* (56) substring ::= ENGLISH_LETTERS */
    47,  /* (57) symbol ::= SYM */
    49,  /* (58) deletion ::= NATIVE_LETTERS */
    49,  /* (59) deletion ::= ENGLISH_LETTERS */
    48,  /* (60) insertion ::= NATIVE_LETTERS */
    50,  /* (61) stress_mark ::= PLUS */
    52,  /* (62) stressed_syl_numbers ::= stressed_syl_numbers stressed_syl_number */
    52,  /* (63) stressed_syl_numbers ::= stressed_syl_number */
    51,  /* (64) stressed_syl_number ::= STRESSED_SYL_NUMBER */
    53,  /* (65) unstressed_flag ::= UNSTRESSED */
    54,  /* (66) initialism_flag ::= INITIALISM */
    55,  /* (67) foreign_flag ::= FOREIGN */
    56,  /* (68) native_flag ::= NATIVE */
    57,  /* (69) line ::= NEWLINE */
    58,  /* (70) space ::= */
    58,  /* (71) space ::= SPACE */
};

/* For rule J, yyRuleInfoNRhs[J] contains the negative of the number
** of symbols on the right-hand side of that rule. */
static const signed char yyRuleInfoNRhs[] = {
   -2,  /* (0) line ::= rule NEWLINE */
   -1,  /* (1) rule ::= collocation_rule */
   -1,  /* (2) rule ::= symbol_rule */
   -3,  /* (3) collocation_rule ::= prefix tokens suffix */
   -5,  /* (4) symbol_rule ::= symbol space EQUALS space symbol_pron */
   -3,  /* (5) tokens ::= tokens SPACE token */
   -1,  /* (6) tokens ::= token */
   -1,  /* (7) prefix ::= STAR */
    0,  /* (8) prefix ::= */
   -1,  /* (9) suffix ::= STAR */
    0,  /* (10) suffix ::= */
   -1,  /* (11) token ::= words */
   -3,  /* (12) token ::= deletion EQUALS token_pron */
   -3,  /* (13) words ::= words AND word */
   -1,  /* (14) words ::= word */
   -2,  /* (15) word ::= inline_rewrites word_flags */
   -2,  /* (16) inline_rewrites ::= inline_rewrites inline_rewrite */
   -1,  /* (17) inline_rewrites ::= inline_rewrite */
   -1,  /* (18) inline_rewrite ::= inline_replacement */
   -1,  /* (19) inline_rewrite ::= subpattern */
   -1,  /* (20) inline_rewrite ::= stress_mark */
   -5,  /* (21) inline_replacement ::= LPAREN deletion EQUALS text_pron_repr RPAREN */
    0,  /* (22) word_flags ::= */
   -1,  /* (23) word_flags ::= stressed_syl_numbers */
   -1,  /* (24) word_flags ::= unstressed_flag */
   -1,  /* (25) word_flags ::= initialism_flag */
   -1,  /* (26) word_flags ::= foreign_flag */
   -2,  /* (27) word_flags ::= initialism_flag foreign_flag */
   -2,  /* (28) word_flags ::= foreign_flag initialism_flag */
   -1,  /* (29) word_flags ::= native_flag */
   -3,  /* (30) set ::= LBRACE set_elements RBRACE */
   -3,  /* (31) set_elements ::= set_elements COMMA set_element */
   -1,  /* (32) set_elements ::= set_element */
   -1,  /* (33) set_element ::= pattern */
    0,  /* (34) set_element ::= */
   -2,  /* (35) pattern ::= pattern subpattern */
   -1,  /* (36) pattern ::= subpattern */
   -1,  /* (37) subpattern ::= substring */
   -1,  /* (38) subpattern ::= set */
   -1,  /* (39) symbol_pron ::= spaced_symbol_pron */
   -1,  /* (40) symbol_pron ::= token_pron */
   -3,  /* (41) token_pron ::= token_pron AND word_pron */
   -1,  /* (42) token_pron ::= word_pron */
   -3,  /* (43) spaced_symbol_pron ::= spaced_symbol_pron SPACE word_pron */
   -3,  /* (44) spaced_symbol_pron ::= word_pron SPACE word_pron */
   -2,  /* (45) word_pron ::= pron_repr word_pron_flags */
   -1,  /* (46) pron_repr ::= text_pron_repr */
    0,  /* (47) word_pron_flags ::= */
   -1,  /* (48) word_pron_flags ::= stressed_syl_numbers */
   -1,  /* (49) word_pron_flags ::= unstressed_flag */
   -1,  /* (50) word_pron_flags ::= foreign_flag */
   -2,  /* (51) text_pron_repr ::= text_pron_repr text_pron_repr_atom */
   -1,  /* (52) text_pron_repr ::= text_pron_repr_atom */
   -1,  /* (53) text_pron_repr_atom ::= insertion */
   -1,  /* (54) text_pron_repr_atom ::= stress_mark */
   -1,  /* (55) substring ::= NATIVE_LETTERS */
   -1,  /* (56) substring ::= ENGLISH_LETTERS */
   -1,  /* (57) symbol ::= SYM */
   -1,  /* (58) deletion ::= NATIVE_LETTERS */
   -1,  /* (59) deletion ::= ENGLISH_LETTERS */
   -1,  /* (60) insertion ::= NATIVE_LETTERS */
   -1,  /* (61) stress_mark ::= PLUS */
   -2,  /* (62) stressed_syl_numbers ::= stressed_syl_numbers stressed_syl_number */
   -1,  /* (63) stressed_syl_numbers ::= stressed_syl_number */
   -1,  /* (64) stressed_syl_number ::= STRESSED_SYL_NUMBER */
   -1,  /* (65) unstressed_flag ::= UNSTRESSED */
   -1,  /* (66) initialism_flag ::= INITIALISM */
   -1,  /* (67) foreign_flag ::= FOREIGN */
   -1,  /* (68) native_flag ::= NATIVE */
   -1,  /* (69) line ::= NEWLINE */
    0,  /* (70) space ::= */
   -1,  /* (71) space ::= SPACE */
};

static void yy_accept(yyParser*);  /* Forward Declaration */

/*
** Perform a reduce action and the shift that must immediately
** follow the reduce.
**
** The yyLookahead and yyLookaheadToken parameters provide reduce actions
** access to the lookahead token (if any).  The yyLookahead will be YYNOCODE
** if the lookahead token has already been consumed.  As this procedure is
** only called from one place, optimizing compilers will in-line it, which
** means that the extra parameters have no performance impact.
*/
static YYACTIONTYPE yy_reduce(
  yyParser *yypParser,         /* The parser */
  unsigned int yyruleno,       /* Number of the rule by which to reduce */
  int yyLookahead,             /* Lookahead token, or YYNOCODE if none */
  userdictParseTOKENTYPE yyLookaheadToken  /* Value of the lookahead token */
  userdictParseCTX_PDECL                   /* %extra_context */
){
  int yygoto;                     /* The next state */
  YYACTIONTYPE yyact;             /* The next action */
  yyStackEntry *yymsp;            /* The top of the parser's stack */
  int yysize;                     /* Amount to pop the stack */
  userdictParseARG_FETCH
  (void)yyLookahead;
  (void)yyLookaheadToken;
  yymsp = yypParser->yytos;

  switch( yyruleno ){
  /* Beginning here are the reduction cases.  A typical example
  ** follows:
  **   case 0:
  **  #line <lineno> <grammarfile>
  **     { ... }           // User supplied code
  **  #line <lineno> <thisfile>
  **     break;
  */
/********** Begin reduce actions **********************************************/
        YYMINORTYPE yylhsminor;
      case 0: /* line ::= rule NEWLINE */
#line 106 "src/core/userdict_parser.g"
{
  if(!ps->error) ps->result->extend(yymsp[-1].minor.yy22);
  delete yymsp[-1].minor.yy22;
}
#line 1204 "src/core/userdict_parser.c"
  yy_destructor(yypParser,1,&yymsp[0].minor);
        break;
      case 1: /* rule ::= collocation_rule */
      case 2: /* rule ::= symbol_rule */ yytestcase(yyruleno==2);
      case 6: /* tokens ::= token */ yytestcase(yyruleno==6);
      case 11: /* token ::= words */ yytestcase(yyruleno==11);
      case 14: /* words ::= word */ yytestcase(yyruleno==14);
      case 17: /* inline_rewrites ::= inline_rewrite */ yytestcase(yyruleno==17);
      case 18: /* inline_rewrite ::= inline_replacement */ yytestcase(yyruleno==18);
      case 19: /* inline_rewrite ::= subpattern */ yytestcase(yyruleno==19);
      case 20: /* inline_rewrite ::= stress_mark */ yytestcase(yyruleno==20);
      case 23: /* word_flags ::= stressed_syl_numbers */ yytestcase(yyruleno==23);
      case 24: /* word_flags ::= unstressed_flag */ yytestcase(yyruleno==24);
      case 25: /* word_flags ::= initialism_flag */ yytestcase(yyruleno==25);
      case 26: /* word_flags ::= foreign_flag */ yytestcase(yyruleno==26);
      case 29: /* word_flags ::= native_flag */ yytestcase(yyruleno==29);
      case 32: /* set_elements ::= set_element */ yytestcase(yyruleno==32);
      case 33: /* set_element ::= pattern */ yytestcase(yyruleno==33);
      case 36: /* pattern ::= subpattern */ yytestcase(yyruleno==36);
      case 37: /* subpattern ::= substring */ yytestcase(yyruleno==37);
      case 38: /* subpattern ::= set */ yytestcase(yyruleno==38);
      case 39: /* symbol_pron ::= spaced_symbol_pron */ yytestcase(yyruleno==39);
      case 40: /* symbol_pron ::= token_pron */ yytestcase(yyruleno==40);
      case 42: /* token_pron ::= word_pron */ yytestcase(yyruleno==42);
      case 46: /* pron_repr ::= text_pron_repr */ yytestcase(yyruleno==46);
      case 48: /* word_pron_flags ::= stressed_syl_numbers */ yytestcase(yyruleno==48);
      case 49: /* word_pron_flags ::= unstressed_flag */ yytestcase(yyruleno==49);
      case 50: /* word_pron_flags ::= foreign_flag */ yytestcase(yyruleno==50);
      case 52: /* text_pron_repr ::= text_pron_repr_atom */ yytestcase(yyruleno==52);
      case 53: /* text_pron_repr_atom ::= insertion */ yytestcase(yyruleno==53);
      case 54: /* text_pron_repr_atom ::= stress_mark */ yytestcase(yyruleno==54);
      case 63: /* stressed_syl_numbers ::= stressed_syl_number */ yytestcase(yyruleno==63);
#line 114 "src/core/userdict_parser.g"
{
  yylhsminor.yy22=yymsp[0].minor.yy22;
}
#line 1241 "src/core/userdict_parser.c"
  yymsp[0].minor.yy22 = yylhsminor.yy22;
        break;
      case 3: /* collocation_rule ::= prefix tokens suffix */
#line 124 "src/core/userdict_parser.g"
{
  yylhsminor.yy22=yymsp[-2].minor.yy22;
  yylhsminor.yy22->append(yymsp[-1].minor.yy22);
  yylhsminor.yy22->append(yymsp[0].minor.yy22);
  delete yymsp[-1].minor.yy22;
  delete yymsp[0].minor.yy22;
}
#line 1253 "src/core/userdict_parser.c"
  yymsp[-2].minor.yy22 = yylhsminor.yy22;
        break;
      case 4: /* symbol_rule ::= symbol space EQUALS space symbol_pron */
#line 133 "src/core/userdict_parser.g"
{
  yylhsminor.yy22=RHVoice::userdict::ruleset::create<RHVoice::userdict::start_of_token>();
  yylhsminor.yy22->append(yymsp[-4].minor.yy22);
  yylhsminor.yy22->append(yymsp[0].minor.yy22);
  yylhsminor.yy22->append<RHVoice::userdict::end_of_token>();
  delete yymsp[-4].minor.yy22;
  delete yymsp[0].minor.yy22;
}
#line 1266 "src/core/userdict_parser.c"
  yy_destructor(yypParser,2,&yymsp[-2].minor);
  yymsp[-4].minor.yy22 = yylhsminor.yy22;
        break;
      case 5: /* tokens ::= tokens SPACE token */
#line 143 "src/core/userdict_parser.g"
{
  yylhsminor.yy22=yymsp[-2].minor.yy22;
  yylhsminor.yy22->append<RHVoice::userdict::end_of_token>();
  yylhsminor.yy22->append<RHVoice::userdict::start_of_token>();
  yylhsminor.yy22->append(yymsp[0].minor.yy22);
  delete yymsp[0].minor.yy22;
}
#line 1279 "src/core/userdict_parser.c"
  yy_destructor(yypParser,3,&yymsp[-1].minor);
  yymsp[-2].minor.yy22 = yylhsminor.yy22;
        break;
      case 7: /* prefix ::= STAR */
      case 9: /* suffix ::= STAR */ yytestcase(yyruleno==9);
{  yy_destructor(yypParser,4,&yymsp[0].minor);
#line 157 "src/core/userdict_parser.g"
{
  yymsp[0].minor.yy22=new RHVoice::userdict::ruleset;
}
#line 1290 "src/core/userdict_parser.c"
}
        break;
      case 8: /* prefix ::= */
#line 162 "src/core/userdict_parser.g"
{
  yymsp[1].minor.yy22=RHVoice::userdict::ruleset::create<RHVoice::userdict::start_of_token>();
}
#line 1298 "src/core/userdict_parser.c"
        break;
      case 10: /* suffix ::= */
#line 172 "src/core/userdict_parser.g"
{
  yymsp[1].minor.yy22=RHVoice::userdict::ruleset::create<RHVoice::userdict::end_of_token>();
}
#line 1305 "src/core/userdict_parser.c"
        break;
      case 12: /* token ::= deletion EQUALS token_pron */
#line 182 "src/core/userdict_parser.g"
{
  yylhsminor.yy22=yymsp[-2].minor.yy22;
  yylhsminor.yy22->append(yymsp[0].minor.yy22);
  delete yymsp[0].minor.yy22;
}
#line 1314 "src/core/userdict_parser.c"
  yy_destructor(yypParser,2,&yymsp[-1].minor);
  yymsp[-2].minor.yy22 = yylhsminor.yy22;
        break;
      case 13: /* words ::= words AND word */
      case 41: /* token_pron ::= token_pron AND word_pron */ yytestcase(yyruleno==41);
#line 189 "src/core/userdict_parser.g"
{
  yylhsminor.yy22=yymsp[-2].minor.yy22;
  yylhsminor.yy22->append<RHVoice::userdict::word_break>();
  yylhsminor.yy22->append(yymsp[0].minor.yy22);
  delete yymsp[0].minor.yy22;
}
#line 1327 "src/core/userdict_parser.c"
  yy_destructor(yypParser,5,&yymsp[-1].minor);
  yymsp[-2].minor.yy22 = yylhsminor.yy22;
        break;
      case 15: /* word ::= inline_rewrites word_flags */
      case 16: /* inline_rewrites ::= inline_rewrites inline_rewrite */ yytestcase(yyruleno==16);
      case 27: /* word_flags ::= initialism_flag foreign_flag */ yytestcase(yyruleno==27);
      case 28: /* word_flags ::= foreign_flag initialism_flag */ yytestcase(yyruleno==28);
      case 35: /* pattern ::= pattern subpattern */ yytestcase(yyruleno==35);
      case 45: /* word_pron ::= pron_repr word_pron_flags */ yytestcase(yyruleno==45);
      case 51: /* text_pron_repr ::= text_pron_repr text_pron_repr_atom */ yytestcase(yyruleno==51);
      case 62: /* stressed_syl_numbers ::= stressed_syl_numbers stressed_syl_number */ yytestcase(yyruleno==62);
#line 202 "src/core/userdict_parser.g"
{
  yylhsminor.yy22=yymsp[-1].minor.yy22;
  yylhsminor.yy22->append(yymsp[0].minor.yy22);
  delete yymsp[0].minor.yy22;
}
#line 1345 "src/core/userdict_parser.c"
  yymsp[-1].minor.yy22 = yylhsminor.yy22;
        break;
      case 21: /* inline_replacement ::= LPAREN deletion EQUALS text_pron_repr RPAREN */
{  yy_destructor(yypParser,6,&yymsp[-4].minor);
#line 236 "src/core/userdict_parser.g"
{
  yymsp[-4].minor.yy22=yymsp[-3].minor.yy22;
  yymsp[-4].minor.yy22->append(yymsp[-1].minor.yy22);
  delete yymsp[-1].minor.yy22;
}
#line 1356 "src/core/userdict_parser.c"
  yy_destructor(yypParser,2,&yymsp[-2].minor);
  yy_destructor(yypParser,7,&yymsp[0].minor);
}
        break;
      case 22: /* word_flags ::= */
#line 243 "src/core/userdict_parser.g"
{
  yymsp[1].minor.yy22=new RHVoice::userdict::ruleset;
}
#line 1366 "src/core/userdict_parser.c"
        break;
      case 30: /* set ::= LBRACE set_elements RBRACE */
{  yy_destructor(yypParser,8,&yymsp[-2].minor);
#line 287 "src/core/userdict_parser.g"
{
  yymsp[-2].minor.yy22=yymsp[-1].minor.yy22;
}
#line 1374 "src/core/userdict_parser.c"
  yy_destructor(yypParser,9,&yymsp[0].minor);
}
        break;
      case 31: /* set_elements ::= set_elements COMMA set_element */
#line 292 "src/core/userdict_parser.g"
{
  yylhsminor.yy22=yymsp[-2].minor.yy22;
  yylhsminor.yy22->extend(yymsp[0].minor.yy22);
  delete yymsp[0].minor.yy22;
}
#line 1385 "src/core/userdict_parser.c"
  yy_destructor(yypParser,10,&yymsp[-1].minor);
  yymsp[-2].minor.yy22 = yylhsminor.yy22;
        break;
      case 34: /* set_element ::= */
#line 309 "src/core/userdict_parser.g"
{
  yymsp[1].minor.yy22=RHVoice::userdict::ruleset::create<RHVoice::userdict::empty_string>();
}
#line 1394 "src/core/userdict_parser.c"
        break;
      case 43: /* spaced_symbol_pron ::= spaced_symbol_pron SPACE word_pron */
      case 44: /* spaced_symbol_pron ::= word_pron SPACE word_pron */ yytestcase(yyruleno==44);
#line 359 "src/core/userdict_parser.g"
{
  yylhsminor.yy22=yymsp[-2].minor.yy22;
  yylhsminor.yy22->append<RHVoice::userdict::word_break>();
  yylhsminor.yy22->append(yymsp[0].minor.yy22);
  delete yymsp[0].minor.yy22;
}
#line 1405 "src/core/userdict_parser.c"
  yy_destructor(yypParser,3,&yymsp[-1].minor);
  yymsp[-2].minor.yy22 = yylhsminor.yy22;
        break;
      case 47: /* word_pron_flags ::= */
#line 387 "src/core/userdict_parser.g"
{
  yymsp[1].minor.yy22= new RHVoice::userdict::ruleset;
}
#line 1414 "src/core/userdict_parser.c"
        break;
      case 55: /* substring ::= NATIVE_LETTERS */
      case 56: /* substring ::= ENGLISH_LETTERS */ yytestcase(yyruleno==56);
#line 430 "src/core/userdict_parser.g"
{
  yylhsminor.yy22=RHVoice::userdict::ruleset::create<RHVoice::userdict::substring>(yymsp[0].minor.yy0);
  delete yymsp[0].minor.yy0;
}
#line 1423 "src/core/userdict_parser.c"
  yymsp[0].minor.yy22 = yylhsminor.yy22;
        break;
      case 57: /* symbol ::= SYM */
#line 442 "src/core/userdict_parser.g"
{
  yylhsminor.yy22=RHVoice::userdict::ruleset::create<RHVoice::userdict::symbol>(yymsp[0].minor.yy0);
  delete yymsp[0].minor.yy0;
}
#line 1432 "src/core/userdict_parser.c"
  yymsp[0].minor.yy22 = yylhsminor.yy22;
        break;
      case 58: /* deletion ::= NATIVE_LETTERS */
      case 59: /* deletion ::= ENGLISH_LETTERS */ yytestcase(yyruleno==59);
#line 448 "src/core/userdict_parser.g"
{
  yylhsminor.yy22=RHVoice::userdict::ruleset::create<RHVoice::userdict::deletion>(yymsp[0].minor.yy0);
  delete yymsp[0].minor.yy0;
}
#line 1442 "src/core/userdict_parser.c"
  yymsp[0].minor.yy22 = yylhsminor.yy22;
        break;
      case 60: /* insertion ::= NATIVE_LETTERS */
#line 460 "src/core/userdict_parser.g"
{
  yylhsminor.yy22=RHVoice::userdict::ruleset::create<RHVoice::userdict::insertion>(yymsp[0].minor.yy0);
  delete yymsp[0].minor.yy0;
}
#line 1451 "src/core/userdict_parser.c"
  yymsp[0].minor.yy22 = yylhsminor.yy22;
        break;
      case 61: /* stress_mark ::= PLUS */
{  yy_destructor(yypParser,14,&yymsp[0].minor);
#line 466 "src/core/userdict_parser.g"
{
  yymsp[0].minor.yy22=RHVoice::userdict::ruleset::create<RHVoice::userdict::stress_mark>();
}
#line 1460 "src/core/userdict_parser.c"
}
        break;
      case 64: /* stressed_syl_number ::= STRESSED_SYL_NUMBER */
#line 483 "src/core/userdict_parser.g"
{
  yylhsminor.yy22=RHVoice::userdict::ruleset::create<RHVoice::userdict::stressed_syl_number>(yymsp[0].minor.yy0);
  delete yymsp[0].minor.yy0;
}
#line 1469 "src/core/userdict_parser.c"
  yymsp[0].minor.yy22 = yylhsminor.yy22;
        break;
      case 65: /* unstressed_flag ::= UNSTRESSED */
{  yy_destructor(yypParser,16,&yymsp[0].minor);
#line 489 "src/core/userdict_parser.g"
{
  yymsp[0].minor.yy22=RHVoice::userdict::ruleset::create<RHVoice::userdict::unstressed_flag>();
}
#line 1478 "src/core/userdict_parser.c"
}
        break;
      case 66: /* initialism_flag ::= INITIALISM */
{  yy_destructor(yypParser,17,&yymsp[0].minor);
#line 494 "src/core/userdict_parser.g"
{
  yymsp[0].minor.yy22=RHVoice::userdict::ruleset::create<RHVoice::userdict::initialism_flag>();
}
#line 1487 "src/core/userdict_parser.c"
}
        break;
      case 67: /* foreign_flag ::= FOREIGN */
{  yy_destructor(yypParser,18,&yymsp[0].minor);
#line 499 "src/core/userdict_parser.g"
{
  yymsp[0].minor.yy22=RHVoice::userdict::ruleset::create<RHVoice::userdict::foreign_flag>();
}
#line 1496 "src/core/userdict_parser.c"
}
        break;
      case 68: /* native_flag ::= NATIVE */
{  yy_destructor(yypParser,19,&yymsp[0].minor);
#line 504 "src/core/userdict_parser.g"
{
  yymsp[0].minor.yy22=RHVoice::userdict::ruleset::create<RHVoice::userdict::native_flag>();
}
#line 1505 "src/core/userdict_parser.c"
}
        break;
      case 69: /* line ::= NEWLINE */
{  yy_destructor(yypParser,1,&yymsp[0].minor);
#line 111 "src/core/userdict_parser.g"
{
}
#line 1513 "src/core/userdict_parser.c"
}
        break;
      case 71: /* space ::= SPACE */
{  yy_destructor(yypParser,3,&yymsp[0].minor);
#line 508 "src/core/userdict_parser.g"
{
}
#line 1521 "src/core/userdict_parser.c"
}
        break;
      default:
      /* (70) space ::= */ yytestcase(yyruleno==70);
        break;
/********** End reduce actions ************************************************/
  };
  assert( yyruleno<sizeof(yyRuleInfoLhs)/sizeof(yyRuleInfoLhs[0]) );
  yygoto = yyRuleInfoLhs[yyruleno];
  yysize = yyRuleInfoNRhs[yyruleno];
  yyact = yy_find_reduce_action(yymsp[yysize].stateno,(YYCODETYPE)yygoto);

  /* There are no SHIFTREDUCE actions on nonterminals because the table
  ** generator has simplified them to pure REDUCE actions. */
  assert( !(yyact>YY_MAX_SHIFT && yyact<=YY_MAX_SHIFTREDUCE) );

  /* It is not possible for a REDUCE to be followed by an error */
  assert( yyact!=YY_ERROR_ACTION );

  yymsp += yysize+1;
  yypParser->yytos = yymsp;
  yymsp->stateno = (YYACTIONTYPE)yyact;
  yymsp->major = (YYCODETYPE)yygoto;
  yyTraceShift(yypParser, yyact, "... then shift");
  return yyact;
}

/*
** The following code executes when the parse fails
*/
#ifndef YYNOERRORRECOVERY
static void yy_parse_failed(
  yyParser *yypParser           /* The parser */
){
  userdictParseARG_FETCH
  userdictParseCTX_FETCH
#ifndef NDEBUG
  if( yyTraceFILE ){
    fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt);
  }
#endif
  while( yypParser->yytos>yypParser->yystack ) yy_pop_parser_stack(yypParser);
  /* Here code is inserted which will be executed whenever the
  ** parser fails */
/************ Begin %parse_failure code ***************************************/
/************ End %parse_failure code *****************************************/
  userdictParseARG_STORE /* Suppress warning about unused %extra_argument variable */
  userdictParseCTX_STORE
}
#endif /* YYNOERRORRECOVERY */

/*
** The following code executes when a syntax error first occurs.
*/
static void yy_syntax_error(
  yyParser *yypParser,           /* The parser */
  int yymajor,                   /* The major type of the error token */
  userdictParseTOKENTYPE yyminor         /* The minor type of the error token */
){
  userdictParseARG_FETCH
  userdictParseCTX_FETCH
#define TOKEN yyminor
/************ Begin %syntax_error code ****************************************/
#line 103 "src/core/userdict_parser.g"
ps->error=true;
#line 1587 "src/core/userdict_parser.c"
/************ End %syntax_error code ******************************************/
  userdictParseARG_STORE /* Suppress warning about unused %extra_argument variable */
  userdictParseCTX_STORE
}

/*
** The following is executed when the parser accepts
*/
static void yy_accept(
  yyParser *yypParser           /* The parser */
){
  userdictParseARG_FETCH
  userdictParseCTX_FETCH
#ifndef NDEBUG
  if( yyTraceFILE ){
    fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt);
  }
#endif
#ifndef YYNOERRORRECOVERY
  yypParser->yyerrcnt = -1;
#endif
  assert( yypParser->yytos==yypParser->yystack );
  /* Here code is inserted which will be executed whenever the
  ** parser accepts */
/*********** Begin %parse_accept code *****************************************/
/*********** End %parse_accept code *******************************************/
  userdictParseARG_STORE /* Suppress warning about unused %extra_argument variable */
  userdictParseCTX_STORE
}

/* The main parser program.
** The first argument is a pointer to a structure obtained from
** "userdictParseAlloc" which describes the current state of the parser.
** The second argument is the major token number.  The third is
** the minor token.  The fourth optional argument is whatever the
** user wants (and specified in the grammar) and is available for
** use by the action routines.
**
** Inputs:
** <ul>
** <li> A pointer to the parser (an opaque structure.)
** <li> The major token number.
** <li> The minor token number.
** <li> An option argument of a grammar-specified type.
** </ul>
**
** Outputs:
** None.
*/
void userdictParse(
  void *yyp,                   /* The parser */
  int yymajor,                 /* The major token code number */
  userdictParseTOKENTYPE yyminor       /* The value for the token */
  userdictParseARG_PDECL               /* Optional %extra_argument parameter */
){
  YYMINORTYPE yyminorunion;
  YYACTIONTYPE yyact;   /* The parser action. */
#if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY)
  int yyendofinput;     /* True if we are at the end of input */
#endif
#ifdef YYERRORSYMBOL
  int yyerrorhit = 0;   /* True if yymajor has invoked an error */
#endif
  yyParser *yypParser = (yyParser*)yyp;  /* The parser */
  userdictParseCTX_FETCH
  userdictParseARG_STORE

  assert( yypParser->yytos!=0 );
#if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY)
  yyendofinput = (yymajor==0);
#endif

  yyact = yypParser->yytos->stateno;
#ifndef NDEBUG
  if( yyTraceFILE ){
    if( yyact < YY_MIN_REDUCE ){
      fprintf(yyTraceFILE,"%sInput '%s' in state %d\n",
              yyTracePrompt,yyTokenName[yymajor],yyact);
    }else{
      fprintf(yyTraceFILE,"%sInput '%s' with pending reduce %d\n",
              yyTracePrompt,yyTokenName[yymajor],yyact-YY_MIN_REDUCE);
    }
  }
#endif

  while(1){ /* Exit by "break" */
    assert( yypParser->yytos>=yypParser->yystack );
    assert( yyact==yypParser->yytos->stateno );
    yyact = yy_find_shift_action((YYCODETYPE)yymajor,yyact);
    if( yyact >= YY_MIN_REDUCE ){
      unsigned int yyruleno = yyact - YY_MIN_REDUCE; /* Reduce by this rule */
#ifndef NDEBUG
      assert( yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) );
      if( yyTraceFILE ){
        int yysize = yyRuleInfoNRhs[yyruleno];
        if( yysize ){
          fprintf(yyTraceFILE, "%sReduce %d [%s]%s, pop back to state %d.\n",
            yyTracePrompt,
            yyruleno, yyRuleName[yyruleno],
            yyruleno<YYNRULE_WITH_ACTION ? "" : " without external action",
            yypParser->yytos[yysize].stateno);
        }else{
          fprintf(yyTraceFILE, "%sReduce %d [%s]%s.\n",
            yyTracePrompt, yyruleno, yyRuleName[yyruleno],
            yyruleno<YYNRULE_WITH_ACTION ? "" : " without external action");
        }
      }
#endif /* NDEBUG */

      /* Check that the stack is large enough to grow by a single entry
      ** if the RHS of the rule is empty.  This ensures that there is room
      ** enough on the stack to push the LHS value */
      if( yyRuleInfoNRhs[yyruleno]==0 ){
#ifdef YYTRACKMAXSTACKDEPTH
        if( (int)(yypParser->yytos - yypParser->yystack)>yypParser->yyhwm ){
          yypParser->yyhwm++;
          assert( yypParser->yyhwm ==
                  (int)(yypParser->yytos - yypParser->yystack));
        }
#endif
#if YYSTACKDEPTH>0 
        if( yypParser->yytos>=yypParser->yystackEnd ){
          yyStackOverflow(yypParser);
          break;
        }
#else
        if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz-1] ){
          if( yyGrowStack(yypParser) ){
            yyStackOverflow(yypParser);
            break;
          }
        }
#endif
      }
      yyact = yy_reduce(yypParser,yyruleno,yymajor,yyminor userdictParseCTX_PARAM);
    }else if( yyact <= YY_MAX_SHIFTREDUCE ){
      yy_shift(yypParser,yyact,(YYCODETYPE)yymajor,yyminor);
#ifndef YYNOERRORRECOVERY
      yypParser->yyerrcnt--;
#endif
      break;
    }else if( yyact==YY_ACCEPT_ACTION ){
      yypParser->yytos--;
      yy_accept(yypParser);
      return;
    }else{
      assert( yyact == YY_ERROR_ACTION );
      yyminorunion.yy0 = yyminor;
#ifdef YYERRORSYMBOL
      int yymx;
#endif
#ifndef NDEBUG
      if( yyTraceFILE ){
        fprintf(yyTraceFILE,"%sSyntax Error!\n",yyTracePrompt);
      }
#endif
#ifdef YYERRORSYMBOL
      /* A syntax error has occurred.
      ** The response to an error depends upon whether or not the
      ** grammar defines an error token "ERROR".  
      **
      ** This is what we do if the grammar does define ERROR:
      **
      **  * Call the %syntax_error function.
      **
      **  * Begin popping the stack until we enter a state where
      **    it is legal to shift the error symbol, then shift
      **    the error symbol.
      **
      **  * Set the error count to three.
      **
      **  * Begin accepting and shifting new tokens.  No new error
      **    processing will occur until three tokens have been
      **    shifted successfully.
      **
      */
      if( yypParser->yyerrcnt<0 ){
        yy_syntax_error(yypParser,yymajor,yyminor);
      }
      yymx = yypParser->yytos->major;
      if( yymx==YYERRORSYMBOL || yyerrorhit ){
#ifndef NDEBUG
        if( yyTraceFILE ){
          fprintf(yyTraceFILE,"%sDiscard input token %s\n",
             yyTracePrompt,yyTokenName[yymajor]);
        }
#endif
        yy_destructor(yypParser, (YYCODETYPE)yymajor, &yyminorunion);
        yymajor = YYNOCODE;
      }else{
        while( yypParser->yytos > yypParser->yystack ){
          yyact = yy_find_reduce_action(yypParser->yytos->stateno,
                                        YYERRORSYMBOL);
          if( yyact<=YY_MAX_SHIFTREDUCE ) break;
          yy_pop_parser_stack(yypParser);
        }
        if( yypParser->yytos <= yypParser->yystack || yymajor==0 ){
          yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
          yy_parse_failed(yypParser);
#ifndef YYNOERRORRECOVERY
          yypParser->yyerrcnt = -1;
#endif
          yymajor = YYNOCODE;
        }else if( yymx!=YYERRORSYMBOL ){
          yy_shift(yypParser,yyact,YYERRORSYMBOL,yyminor);
        }
      }
      yypParser->yyerrcnt = 3;
      yyerrorhit = 1;
      if( yymajor==YYNOCODE ) break;
      yyact = yypParser->yytos->stateno;
#elif defined(YYNOERRORRECOVERY)
      /* If the YYNOERRORRECOVERY macro is defined, then do not attempt to
      ** do any kind of error recovery.  Instead, simply invoke the syntax
      ** error routine and continue going as if nothing had happened.
      **
      ** Applications can set this macro (for example inside %include) if
      ** they intend to abandon the parse upon the first syntax error seen.
      */
      yy_syntax_error(yypParser,yymajor, yyminor);
      yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
      break;
#else  /* YYERRORSYMBOL is not defined */
      /* This is what we do if the grammar does not define ERROR:
      **
      **  * Report an error message, and throw away the input token.
      **
      **  * If the input token is $, then fail the parse.
      **
      ** As before, subsequent error messages are suppressed until
      ** three input tokens have been successfully shifted.
      */
      if( yypParser->yyerrcnt<=0 ){
        yy_syntax_error(yypParser,yymajor, yyminor);
      }
      yypParser->yyerrcnt = 3;
      yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
      if( yyendofinput ){
        yy_parse_failed(yypParser);
#ifndef YYNOERRORRECOVERY
        yypParser->yyerrcnt = -1;
#endif
      }
      break;
#endif
    }
  }
#ifndef NDEBUG
  if( yyTraceFILE ){
    yyStackEntry *i;
    char cDiv = '[';
    fprintf(yyTraceFILE,"%sReturn. Stack=",yyTracePrompt);
    for(i=&yypParser->yystack[1]; i<=yypParser->yytos; i++){
      fprintf(yyTraceFILE,"%c%s", cDiv, yyTokenName[i->major]);
      cDiv = ' ';
    }
    fprintf(yyTraceFILE,"]\n");
  }
#endif
  return;
}

/*
** Return the fallback token corresponding to canonical token iToken, or
** 0 if iToken has no fallback.
*/
int userdictParseFallback(int iToken){
#ifdef YYFALLBACK
  assert( iToken<(int)(sizeof(yyFallback)/sizeof(yyFallback[0])) );
  return yyFallback[iToken];
#else
  (void)iToken;
  return 0;
#endif
}
