/* A Bison parser, made by GNU Bison 1.875c.  */

/* Skeleton parser for Yacc-like parsing with Bison,
   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.

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

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

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.  */

/* As a special exception, when this file is copied by Bison into a
   Bison output file, you may use that output file without restriction.
   This special exception was added by the Free Software Foundation
   in version 1.24 of Bison.  */

/* Written by Richard Stallman by simplifying the original so called
   ``semantic'' parser.  */

/* All symbols defined below should begin with yy or YY, to avoid
   infringing on user name space.  This should be done even for local
   variables, as they might otherwise be expanded by user macros.
   There are some unavoidable exceptions within include files to
   define necessary library symbols; they are noted "INFRINGES ON
   USER NAME SPACE" below.  */

/* Identify Bison output.  */
#define YYBISON 1

/* Skeleton name.  */
#define YYSKELETON_NAME "yacc.c"

/* Pure parsers.  */
#define YYPURE 0

/* Using locations.  */
#define YYLSP_NEEDED 0

/* If NAME_PREFIX is specified substitute the variables and functions
   names.  */
#define yyparse itex2MML_yyparse
#define yylex   itex2MML_yylex
#define yyerror itex2MML_yyerror
#define yylval  itex2MML_yylval
#define yychar  itex2MML_yychar
#define yydebug itex2MML_yydebug
#define yynerrs itex2MML_yynerrs


/* Tokens.  */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
   /* Put the tokens into the symbol table, so that GDB and other debuggers
      know about them.  */
   enum yytokentype {
     CHAR = 258,
     STARTMATH = 259,
     STARTDMATH = 260,
     ENDMATH = 261,
     MI = 262,
     MIB = 263,
     MN = 264,
     MO = 265,
     PLUS = 266,
     SUP = 267,
     SUB = 268,
     MROWOPEN = 269,
     MROWCLOSE = 270,
     LEFT = 271,
     RIGHT = 272,
     FRAC = 273,
     MATHOP = 274,
     MOP = 275,
     MOL = 276,
     PERIODDELIM = 277,
     OTHERDELIM = 278,
     LEFTDELIM = 279,
     RIGHTDELIM = 280,
     MOS = 281,
     MOB = 282,
     SQRT = 283,
     ROOT = 284,
     BINOM = 285,
     UNDER = 286,
     OVER = 287,
     OVERBRACE = 288,
     UNDERBRACE = 289,
     UNDEROVER = 290,
     TENSOR = 291,
     MULTI = 292,
     ARRAY = 293,
     COLSEP = 294,
     ROWSEP = 295,
     ARRAYOPTS = 296,
     COLLAYOUT = 297,
     COLALIGN = 298,
     ROWALIGN = 299,
     ALIGN = 300,
     EQROWS = 301,
     EQCOLS = 302,
     ROWLINES = 303,
     COLLINES = 304,
     FRAME = 305,
     PADDING = 306,
     ATTRLIST = 307,
     ITALICS = 308,
     BOLD = 309,
     RM = 310,
     BB = 311,
     ST = 312,
     END = 313,
     BBLOWERCHAR = 314,
     BBUPPERCHAR = 315,
     CALCHAR = 316,
     FRAKCHAR = 317,
     CAL = 318,
     FRAK = 319,
     ROWOPTS = 320,
     TEXTSIZE = 321,
     SCSIZE = 322,
     SCSCSIZE = 323,
     DISPLAY = 324,
     TEXTSTY = 325,
     TEXTBOX = 326,
     TEXTSTRING = 327,
     CELLOPTS = 328,
     ROWSPAN = 329,
     COLSPAN = 330,
     THINSPACE = 331,
     MEDSPACE = 332,
     THICKSPACE = 333,
     QUAD = 334,
     QQUAD = 335,
     NEGSPACE = 336,
     PHANTOM = 337,
     HREF = 338,
     UNKNOWNCHAR = 339,
     EMPTYMROW = 340,
     STATLINE = 341,
     TOGGLE = 342,
     FGHIGHLIGHT = 343,
     BGHIGHLIGHT = 344,
     SPACE = 345,
     INTONE = 346,
     INTTWO = 347,
     INTTHREE = 348,
     BAR = 349,
     VEC = 350,
     HAT = 351,
     CHECK = 352,
     TILDE = 353,
     DOT = 354,
     DDOT = 355,
     UNARYMINUS = 356,
     UNARYPLUS = 357,
     TEXOVER = 358
   };
#endif
#define CHAR 258
#define STARTMATH 259
#define STARTDMATH 260
#define ENDMATH 261
#define MI 262
#define MIB 263
#define MN 264
#define MO 265
#define PLUS 266
#define SUP 267
#define SUB 268
#define MROWOPEN 269
#define MROWCLOSE 270
#define LEFT 271
#define RIGHT 272
#define FRAC 273
#define MATHOP 274
#define MOP 275
#define MOL 276
#define PERIODDELIM 277
#define OTHERDELIM 278
#define LEFTDELIM 279
#define RIGHTDELIM 280
#define MOS 281
#define MOB 282
#define SQRT 283
#define ROOT 284
#define BINOM 285
#define UNDER 286
#define OVER 287
#define OVERBRACE 288
#define UNDERBRACE 289
#define UNDEROVER 290
#define TENSOR 291
#define MULTI 292
#define ARRAY 293
#define COLSEP 294
#define ROWSEP 295
#define ARRAYOPTS 296
#define COLLAYOUT 297
#define COLALIGN 298
#define ROWALIGN 299
#define ALIGN 300
#define EQROWS 301
#define EQCOLS 302
#define ROWLINES 303
#define COLLINES 304
#define FRAME 305
#define PADDING 306
#define ATTRLIST 307
#define ITALICS 308
#define BOLD 309
#define RM 310
#define BB 311
#define ST 312
#define END 313
#define BBLOWERCHAR 314
#define BBUPPERCHAR 315
#define CALCHAR 316
#define FRAKCHAR 317
#define CAL 318
#define FRAK 319
#define ROWOPTS 320
#define TEXTSIZE 321
#define SCSIZE 322
#define SCSCSIZE 323
#define DISPLAY 324
#define TEXTSTY 325
#define TEXTBOX 326
#define TEXTSTRING 327
#define CELLOPTS 328
#define ROWSPAN 329
#define COLSPAN 330
#define THINSPACE 331
#define MEDSPACE 332
#define THICKSPACE 333
#define QUAD 334
#define QQUAD 335
#define NEGSPACE 336
#define PHANTOM 337
#define HREF 338
#define UNKNOWNCHAR 339
#define EMPTYMROW 340
#define STATLINE 341
#define TOGGLE 342
#define FGHIGHLIGHT 343
#define BGHIGHLIGHT 344
#define SPACE 345
#define INTONE 346
#define INTTWO 347
#define INTTHREE 348
#define BAR 349
#define VEC 350
#define HAT 351
#define CHECK 352
#define TILDE 353
#define DOT 354
#define DDOT 355
#define UNARYMINUS 356
#define UNARYPLUS 357
#define TEXOVER 358




/* Copy the first part of user declarations.  */
#line 1 "itex2MML.y"

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

#include "itex2MML.h"

#define YYSTYPE char *
#define YYPARSE_PARAM_TYPE char **
#define YYPARSE_PARAM ret_str

#define yytext itex2MML_yytext

 extern int yylex ();

 extern char * yytext;

 static void itex2MML_default_error (const char * msg)
   {
     if (msg)
       fprintf(stderr, "Line: %d Error: %s\n", itex2MML_lineno, msg);
   }

 void (*itex2MML_error) (const char * msg) = itex2MML_default_error;

 static void yyerror (char * s)
   {
     char * msg = itex2MML_copy3 (s, " at token ", yytext);
     if (itex2MML_error)
       (*itex2MML_error) (msg);
     itex2MML_free_string (msg);
   }

 /* Note: If length is 0, then buffer is treated like a string; otherwise only length bytes are written.
  */
 static void itex2MML_default_write (const char * buffer, unsigned long length)
   {
     if (buffer)
       {
	 if (length)
	   fwrite (buffer, 1, length, stdout);
	 else
	   fputs (buffer, stdout);
       }
   }

 void (*itex2MML_write) (const char * buffer, unsigned long length) = itex2MML_default_write;

 static void itex2MML_default_write_mathml (const char * mathml)
   {
     if (itex2MML_write)
       (*itex2MML_write) (mathml, 0);
   }

 void (*itex2MML_write_mathml) (const char * mathml) = itex2MML_default_write_mathml;

 char * itex2MML_empty_string = "";

 /* Create a copy of a string, adding space for extra chars
  */
 char * itex2MML_copy_string_extra (const char * str, unsigned extra)
   {
     char * copy = malloc(extra + (str ? strlen (str) : 0) + 1);
     if (copy)
       {
	 if (str)
	   strcpy(copy, str);
	 else
	   copy[0] = 0;
       }
     return copy ? copy : itex2MML_empty_string;
   }

 /* Create a copy of a string, appending two strings
  */
 char * itex2MML_copy3 (const char * first, const char * second, const char * third)
   {
     int  first_length =  first ? strlen( first) : 0;
     int second_length = second ? strlen(second) : 0;
     int  third_length =  third ? strlen( third) : 0;

     char * copy = malloc(first_length + second_length + third_length + 1);

     if (copy)
       {
	 if (first)
	   strcpy(copy, first);
	 else
	   copy[0] = 0;

	 if (second) strcat(copy, second);
	 if ( third) strcat(copy,  third);
       }
     return copy ? copy : itex2MML_empty_string;
   }

 /* Create a copy of a string, appending a second string
  */
 char * itex2MML_copy2 (const char * first, const char * second)
   {
     return itex2MML_copy3(first, second, 0);
   }

 /* Create a copy of a string
  */
 char * itex2MML_copy_string (const char * str)
   {
     return itex2MML_copy3(str, 0, 0);
   }

 /* Create a copy of a string, escaping unsafe characters for XML
  */
 char * itex2MML_copy_escaped (const char * str)
   {
     unsigned long length = 0;

     const char * ptr1 = str;

     char * ptr2 = 0;
     char * copy = 0;

     if ( str == 0) return itex2MML_empty_string;
     if (*str == 0) return itex2MML_empty_string;

     while (*ptr1)
       {
	 switch (*ptr1)
	   {
	   case '<':  /* &lt;   */
	   case '>':  /* &gt;   */
	     length += 4;
	     break;
	   case '&':  /* &amp;  */
	     length += 5;
	     break;
	   case '\'': /* &apos; */
	   case '"':  /* &quot; */
	   case '-':  /* &#x2d; */
	     length += 6;
	     break;
	   default:
	     length += 1;
	     break;
	   }
	 ++ptr1;
       }

     copy = malloc (length + 1);

     if (copy)
       {
	 ptr1 = str;
	 ptr2 = copy;

	 while (*ptr1)
	   {
	     switch (*ptr1)
	       {
	       case '<':
		 strcpy (ptr2, "&lt;");
		 ptr2 += 4;
		 break;
	       case '>':
		 strcpy (ptr2, "&gt;");
		 ptr2 += 4;
		 break;
	       case '&':  /* &amp;  */
		 strcpy (ptr2, "&amp;");
		 ptr2 += 5;
		 break;
	       case '\'': /* &apos; */
		 strcpy (ptr2, "&apos;");
		 ptr2 += 6;
		 break;
	       case '"':  /* &quot; */
		 strcpy (ptr2, "&quot;");
		 ptr2 += 6;
		 break;
	       case '-':  /* &#x2d; */
		 strcpy (ptr2, "&#x2d;");
		 ptr2 += 6;
		 break;
	       default:
		 *ptr2++ = *ptr1;
		 break;
	       }
	     ++ptr1;
	   }
	 *ptr2 = 0;
       }
     return copy ? copy : itex2MML_empty_string;
   }

 void itex2MML_free_string (char * str)
   {
     if (str && str != itex2MML_empty_string)
       free(str);
   }



/* Enabling traces.  */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif

/* Enabling verbose error messages.  */
#ifdef YYERROR_VERBOSE
# undef YYERROR_VERBOSE
# define YYERROR_VERBOSE 1
#else
# define YYERROR_VERBOSE 0
#endif

#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
typedef int YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif



/* Copy the second part of user declarations.  */


/* Line 214 of yacc.c.  */
#line 503 "y.tab.c"

#if ! defined (yyoverflow) || YYERROR_VERBOSE

# ifndef YYFREE
#  define YYFREE free
# endif
# ifndef YYMALLOC
#  define YYMALLOC malloc
# endif

/* The parser invokes alloca or malloc; define the necessary symbols.  */

# ifdef YYSTACK_USE_ALLOCA
#  if YYSTACK_USE_ALLOCA
#   define YYSTACK_ALLOC alloca
#  endif
# else
#  if defined (alloca) || defined (_ALLOCA_H)
#   define YYSTACK_ALLOC alloca
#  else
#   ifdef __GNUC__
#    define YYSTACK_ALLOC __builtin_alloca
#   endif
#  endif
# endif

# ifdef YYSTACK_ALLOC
   /* Pacify GCC's `empty if-body' warning. */
#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
# else
#  if defined (__STDC__) || defined (__cplusplus)
#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
#   define YYSIZE_T size_t
#  endif
#  define YYSTACK_ALLOC YYMALLOC
#  define YYSTACK_FREE YYFREE
# endif
#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */


#if (! defined (yyoverflow) \
     && (! defined (__cplusplus) \
	 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))

/* A type that is properly aligned for any stack member.  */
union yyalloc
{
  short yyss;
  YYSTYPE yyvs;
  };

/* The size of the maximum gap between one aligned stack and the next.  */
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)

/* The size of an array large to enough to hold all stacks, each with
   N elements.  */
# define YYSTACK_BYTES(N) \
     ((N) * (sizeof (short) + sizeof (YYSTYPE))				\
      + YYSTACK_GAP_MAXIMUM)

/* Copy COUNT objects from FROM to TO.  The source and destination do
   not overlap.  */
# ifndef YYCOPY
#  if defined (__GNUC__) && 1 < __GNUC__
#   define YYCOPY(To, From, Count) \
      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
#  else
#   define YYCOPY(To, From, Count)		\
      do					\
	{					\
	  register YYSIZE_T yyi;		\
	  for (yyi = 0; yyi < (Count); yyi++)	\
	    (To)[yyi] = (From)[yyi];		\
	}					\
      while (0)
#  endif
# endif

/* Relocate STACK from its old location to the new one.  The
   local variables YYSIZE and YYSTACKSIZE give the old and new number of
   elements in the stack, and YYPTR gives the new location of the
   stack.  Advance YYPTR to a properly aligned location for the next
   stack.  */
# define YYSTACK_RELOCATE(Stack)					\
    do									\
      {									\
	YYSIZE_T yynewbytes;						\
	YYCOPY (&yyptr->Stack, Stack, yysize);				\
	Stack = &yyptr->Stack;						\
	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
	yyptr += yynewbytes / sizeof (*yyptr);				\
      }									\
    while (0)

#endif

#if defined (__STDC__) || defined (__cplusplus)
   typedef signed char yysigned_char;
#else
   typedef short yysigned_char;
#endif

/* YYFINAL -- State number of the termination state. */
#define YYFINAL  134
/* YYLAST -- Last index in YYTABLE.  */
#define YYLAST   1627

/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS  104
/* YYNNTS -- Number of nonterminals. */
#define YYNNTS  95
/* YYNRULES -- Number of rules. */
#define YYNRULES  215
/* YYNRULES -- Number of states. */
#define YYNSTATES  350

/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
#define YYUNDEFTOK  2
#define YYMAXUTOK   358

#define YYTRANSLATE(YYX) 						\
  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)

/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
static const unsigned char yytranslate[] =
{
       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
      25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
      35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
      45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
      55,    56,    57,    58,    59,    60,    61,    62,    63,    64,
      65,    66,    67,    68,    69,    70,    71,    72,    73,    74,
      75,    76,    77,    78,    79,    80,    81,    82,    83,    84,
      85,    86,    87,    88,    89,    90,    91,    92,    93,    94,
      95,    96,    97,    98,    99,   100,   101,   102,   103
};

#if YYDEBUG
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
   YYRHS.  */
static const unsigned short yyprhs[] =
{
       0,     0,     3,     5,     6,     8,    10,    13,    16,    18,
      21,    24,    28,    32,    34,    37,    39,    45,    49,    55,
      59,    65,    69,    75,    79,    85,    91,    95,    99,   102,
     105,   107,   109,   111,   113,   115,   117,   119,   121,   123,
     125,   127,   129,   131,   133,   135,   137,   139,   141,   143,
     145,   147,   149,   151,   153,   155,   157,   159,   161,   163,
     165,   167,   169,   171,   173,   175,   177,   179,   181,   183,
     185,   187,   189,   191,   193,   195,   197,   199,   201,   203,
     205,   207,   209,   213,   217,   219,   222,   225,   228,   231,
     234,   237,   239,   241,   243,   245,   247,   249,   251,   253,
     255,   257,   259,   261,   263,   265,   267,   269,   272,   274,
     285,   289,   295,   299,   303,   306,   309,   312,   315,   318,
     321,   324,   327,   330,   335,   337,   340,   342,   344,   349,
     351,   354,   356,   361,   363,   366,   368,   370,   372,   374,
     376,   378,   380,   383,   387,   393,   398,   402,   411,   413,
     416,   421,   424,   427,   431,   435,   439,   442,   445,   448,
     451,   454,   457,   460,   463,   466,   469,   473,   477,   481,
     486,   491,   500,   502,   505,   507,   509,   511,   513,   515,
     517,   519,   521,   523,   525,   528,   531,   534,   537,   540,
     543,   546,   549,   552,   555,   557,   561,   563,   565,   567,
     571,   577,   579,   582,   584,   586,   587,   589,   595,   597,
     600,   602,   604,   606,   608,   611
};

/* YYRHS -- A `-1'-separated list of the rules' RHS. */
static const short yyrhs[] =
{
     105,     0,    -1,   106,    -1,    -1,   107,    -1,   108,    -1,
     106,   107,    -1,   106,   108,    -1,     3,    -1,     4,     6,
      -1,     5,     6,    -1,     4,   109,     6,    -1,     5,   109,
       6,    -1,   110,    -1,   109,   110,    -1,   159,    -1,   120,
      13,   111,    12,   111,    -1,   120,    13,   111,    -1,   120,
      12,   111,    13,   111,    -1,   120,    12,   111,    -1,   118,
      13,   111,    12,   111,    -1,   118,    13,   111,    -1,   118,
      12,   111,    13,   111,    -1,   118,    12,   111,    -1,   111,
      13,   111,    12,   111,    -1,   111,    12,   111,    13,   111,
      -1,   111,    13,   111,    -1,   111,    12,   111,    -1,    13,
     111,    -1,    12,   111,    -1,   111,    -1,   175,    -1,   115,
      -1,   116,    -1,   118,    -1,   117,    -1,   119,    -1,   121,
      -1,   154,    -1,   155,    -1,   158,    -1,   160,    -1,   170,
      -1,   171,    -1,   172,    -1,   173,    -1,   163,    -1,   164,
      -1,   169,    -1,   165,    -1,   166,    -1,   168,    -1,   167,
      -1,   162,    -1,   161,    -1,   174,    -1,   122,    -1,   129,
      -1,   130,    -1,   131,    -1,   132,    -1,   133,    -1,   134,
      -1,   135,    -1,   136,    -1,   137,    -1,   140,    -1,   143,
      -1,   123,    -1,   128,    -1,   146,    -1,   147,    -1,   148,
      -1,   149,    -1,   150,    -1,   151,    -1,   152,    -1,   153,
      -1,   124,    -1,   125,    -1,   126,    -1,   127,    -1,    14,
     109,    15,    -1,   112,   109,   113,    -1,   114,    -1,    16,
      24,    -1,    16,    23,    -1,    16,    22,    -1,    17,    25,
      -1,    17,    23,    -1,    17,    22,    -1,    84,    -1,   101,
      -1,   102,    -1,     7,    -1,     8,    -1,     9,    -1,    27,
      -1,   120,    -1,    10,    -1,    21,    -1,    25,    -1,    24,
      -1,    23,    -1,    22,    -1,    26,    -1,    20,    -1,    19,
      72,    -1,    85,    -1,    90,    57,    91,    58,    57,    92,
      58,    57,    93,    58,    -1,    86,    72,   111,    -1,    87,
     111,   111,   111,   111,    -1,    88,    52,   111,    -1,    89,
      52,   111,    -1,    71,    72,    -1,    69,   111,    -1,    70,
     111,    -1,    66,   111,    -1,    67,   111,    -1,    68,   111,
      -1,    53,   111,    -1,    54,   111,    -1,    55,   111,    -1,
      56,    57,   138,    58,    -1,   139,    -1,   138,   139,    -1,
      59,    -1,    60,    -1,    64,    57,   141,    58,    -1,   142,
      -1,   141,   142,    -1,    62,    -1,    63,    57,   144,    58,
      -1,   145,    -1,   144,   145,    -1,    61,    -1,    76,    -1,
      77,    -1,    78,    -1,    79,    -1,    80,    -1,    81,    -1,
      82,   111,    -1,    83,    72,   111,    -1,    36,   111,    14,
     156,    15,    -1,    36,   111,   156,    15,    -1,    36,   111,
     156,    -1,    37,    14,   156,    15,   111,    14,   156,    15,
      -1,   157,    -1,   156,   157,    -1,    13,   111,    12,   111,
      -1,    13,   111,    -1,    12,   111,    -1,    18,   111,   111,
      -1,   109,   103,   109,    -1,    30,   111,   111,    -1,    34,
     111,    -1,    33,   111,    -1,    94,   111,    -1,    95,   111,
      -1,    99,   111,    -1,   100,   111,    -1,    98,   111,    -1,
      97,   111,    -1,    96,   111,    -1,    28,   111,    -1,    29,
     111,   111,    -1,    31,   111,   111,    -1,    32,   111,   111,
      -1,    35,   111,   111,   111,    -1,    38,    14,   188,    15,
      -1,    38,    14,    41,    14,   176,    15,   188,    15,    -1,
     177,    -1,   176,   177,    -1,   178,    -1,   179,    -1,   180,
      -1,   181,    -1,   182,    -1,   183,    -1,   184,    -1,   185,
      -1,   186,    -1,   187,    -1,    42,    52,    -1,    43,    52,
      -1,    44,    52,    -1,    45,    52,    -1,    46,    52,    -1,
      47,    52,    -1,    48,    52,    -1,    49,    52,    -1,    50,
      52,    -1,    51,    52,    -1,   189,    -1,   188,    40,   189,
      -1,   190,    -1,   191,    -1,   194,    -1,   190,    39,   194,
      -1,    65,    14,   192,    15,   190,    -1,   193,    -1,   192,
     193,    -1,   179,    -1,   180,    -1,    -1,   109,    -1,    73,
      14,   195,    15,   109,    -1,   196,    -1,   195,   196,    -1,
     179,    -1,   180,    -1,   197,    -1,   198,    -1,    74,    52,
      -1,    75,    52,    -1
};

/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
static const unsigned short yyrline[] =
{
       0,   210,   210,   213,   214,   215,   216,   217,   219,   221,
     222,   223,   236,   250,   254,   259,   261,   280,   294,   313,
     327,   346,   360,   379,   393,   403,   413,   420,   427,   431,
     435,   440,   441,   442,   443,   444,   448,   452,   453,   454,
     455,   456,   457,   458,   459,   460,   461,   462,   463,   464,
     465,   466,   467,   468,   469,   470,   471,   472,   473,   474,
     475,   476,   477,   478,   479,   480,   481,   482,   483,   484,
     485,   486,   487,   488,   489,   490,   491,   492,   493,   494,
     495,   496,   497,   501,   509,   511,   516,   521,   527,   531,
     535,   540,   544,   548,   552,   554,   560,   562,   568,   569,
     574,   579,   583,   588,   592,   596,   601,   606,   612,   616,
     627,   635,   645,   653,   661,   666,   671,   676,   681,   686,
     691,   696,   701,   706,   711,   715,   721,   725,   730,   735,
     739,   745,   750,   755,   759,   765,   770,   774,   778,   782,
     786,   790,   794,   799,   807,   814,   821,   829,   840,   844,
     850,   855,   859,   864,   872,   880,   888,   893,   898,   903,
     908,   913,   918,   923,   928,   933,   938,   946,   954,   962,
     971,   975,   983,   987,   993,   997,  1001,  1005,  1009,  1013,
    1017,  1021,  1025,  1029,  1034,  1039,  1044,  1049,  1054,  1059,
    1064,  1069,  1074,  1079,  1086,  1090,  1096,  1100,  1105,  1109,
    1115,  1123,  1127,  1133,  1137,  1142,  1145,  1149,  1157,  1161,
    1167,  1171,  1175,  1179,  1184,  1189
};
#endif

#if YYDEBUG || YYERROR_VERBOSE
/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
   First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] =
{
  "$end", "error", "$undefined", "CHAR", "STARTMATH", "STARTDMATH",
  "ENDMATH", "MI", "MIB", "MN", "MO", "PLUS", "SUP", "SUB", "MROWOPEN",
  "MROWCLOSE", "LEFT", "RIGHT", "FRAC", "MATHOP", "MOP", "MOL",
  "PERIODDELIM", "OTHERDELIM", "LEFTDELIM", "RIGHTDELIM", "MOS", "MOB",
  "SQRT", "ROOT", "BINOM", "UNDER", "OVER", "OVERBRACE", "UNDERBRACE",
  "UNDEROVER", "TENSOR", "MULTI", "ARRAY", "COLSEP", "ROWSEP", "ARRAYOPTS",
  "COLLAYOUT", "COLALIGN", "ROWALIGN", "ALIGN", "EQROWS", "EQCOLS",
  "ROWLINES", "COLLINES", "FRAME", "PADDING", "ATTRLIST", "ITALICS",
  "BOLD", "RM", "BB", "ST", "END", "BBLOWERCHAR", "BBUPPERCHAR", "CALCHAR",
  "FRAKCHAR", "CAL", "FRAK", "ROWOPTS", "TEXTSIZE", "SCSIZE", "SCSCSIZE",
  "DISPLAY", "TEXTSTY", "TEXTBOX", "TEXTSTRING", "CELLOPTS", "ROWSPAN",
  "COLSPAN", "THINSPACE", "MEDSPACE", "THICKSPACE", "QUAD", "QQUAD",
  "NEGSPACE", "PHANTOM", "HREF", "UNKNOWNCHAR", "EMPTYMROW", "STATLINE",
  "TOGGLE", "FGHIGHLIGHT", "BGHIGHLIGHT", "SPACE", "INTONE", "INTTWO",
  "INTTHREE", "BAR", "VEC", "HAT", "CHECK", "TILDE", "DOT", "DDOT",
  "UNARYMINUS", "UNARYPLUS", "TEXOVER", "$accept", "doc", "xmlmmlTermList",
  "char", "expression", "compoundTermList", "compoundTerm", "closedTerm",
  "left", "right", "unrecognized", "unaryminus", "unaryplus", "mi", "mib",
  "mn", "mob", "mo", "emptymrow", "space", "statusline", "toggle",
  "fghighlight", "bghighlight", "textstring", "displaystyle", "textstyle",
  "textsize", "scriptsize", "scriptscriptsize", "italics", "bold", "roman",
  "bbold", "bbletters", "bbletter", "frak", "frakletters", "frakletter",
  "cal", "calletters", "calletter", "thinspace", "medspace", "thickspace",
  "quad", "qquad", "negspace", "phantom", "href", "tensor", "multi",
  "subsupList", "subsupTerm", "mfrac", "texover", "binom", "munderbrace",
  "moverbrace", "bar", "vec", "dot", "ddot", "tilde", "check", "hat",
  "msqrt", "mroot", "munder", "mover", "munderover", "array", "arrayopts",
  "anarrayopt", "collayout", "colalign", "rowalign", "align", "eqrows",
  "eqcols", "rowlines", "collines", "frame", "padding", "tableRowList",
  "tableRow", "simpleTableRow", "optsTableRow", "rowopts", "arowopt",
  "tableCell", "cellopts", "acellopt", "rowspan", "colspan", 0
};
#endif

# ifdef YYPRINT
/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
   token YYLEX-NUM.  */
static const unsigned short yytoknum[] =
{
       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
     275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
     295,   296,   297,   298,   299,   300,   301,   302,   303,   304,
     305,   306,   307,   308,   309,   310,   311,   312,   313,   314,
     315,   316,   317,   318,   319,   320,   321,   322,   323,   324,
     325,   326,   327,   328,   329,   330,   331,   332,   333,   334,
     335,   336,   337,   338,   339,   340,   341,   342,   343,   344,
     345,   346,   347,   348,   349,   350,   351,   352,   353,   354,
     355,   356,   357,   358
};
# endif

/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
static const unsigned char yyr1[] =
{
       0,   104,   105,   106,   106,   106,   106,   106,   107,   108,
     108,   108,   108,   109,   109,   109,   110,   110,   110,   110,
     110,   110,   110,   110,   110,   110,   110,   110,   110,   110,
     110,   111,   111,   111,   111,   111,   111,   111,   111,   111,
     111,   111,   111,   111,   111,   111,   111,   111,   111,   111,
     111,   111,   111,   111,   111,   111,   111,   111,   111,   111,
     111,   111,   111,   111,   111,   111,   111,   111,   111,   111,
     111,   111,   111,   111,   111,   111,   111,   111,   111,   111,
     111,   111,   111,   111,   111,   112,   112,   112,   113,   113,
     113,   114,   115,   116,   117,   118,   119,   120,   121,   121,
     121,   121,   121,   121,   121,   121,   121,   121,   122,   123,
     124,   125,   126,   127,   128,   129,   130,   131,   132,   133,
     134,   135,   136,   137,   138,   138,   139,   139,   140,   141,
     141,   142,   143,   144,   144,   145,   146,   147,   148,   149,
     150,   151,   152,   153,   154,   154,   154,   155,   156,   156,
     157,   157,   157,   158,   159,   160,   161,   162,   163,   164,
     165,   166,   167,   168,   169,   170,   171,   172,   173,   174,
     175,   175,   176,   176,   177,   177,   177,   177,   177,   177,
     177,   177,   177,   177,   178,   179,   180,   181,   182,   183,
     184,   185,   186,   187,   188,   188,   189,   189,   190,   190,
     191,   192,   192,   193,   193,   194,   194,   194,   195,   195,
     196,   196,   196,   196,   197,   198
};

/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
static const unsigned char yyr2[] =
{
       0,     2,     1,     0,     1,     1,     2,     2,     1,     2,
       2,     3,     3,     1,     2,     1,     5,     3,     5,     3,
       5,     3,     5,     3,     5,     5,     3,     3,     2,     2,
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       1,     1,     3,     3,     1,     2,     2,     2,     2,     2,
       2,     1,     1,     1,     1,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     1,     1,     1,     2,     1,    10,
       3,     5,     3,     3,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     4,     1,     2,     1,     1,     4,     1,
       2,     1,     4,     1,     2,     1,     1,     1,     1,     1,
       1,     1,     2,     3,     5,     4,     3,     8,     1,     2,
       4,     2,     2,     3,     3,     3,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     3,     3,     3,     4,
       4,     8,     1,     2,     1,     1,     1,     1,     1,     1,
       1,     1,     1,     1,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     1,     3,     1,     1,     1,     3,
       5,     1,     2,     1,     1,     0,     1,     5,     1,     2,
       1,     1,     1,     1,     2,     2
};

/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
   means the default is an error.  */
static const unsigned char yydefact[] =
{
       3,     8,     0,     0,     0,     2,     4,     5,     9,    94,
      95,    96,    99,     0,     0,     0,     0,     0,     0,   106,
     100,   104,   103,   102,   101,   105,    97,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     136,   137,   138,   139,   140,   141,     0,     0,    91,   108,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,    92,    93,     0,    13,    30,     0,    84,    32,
      33,    35,    34,    36,    98,    37,    56,    68,    78,    79,
      80,    81,    69,    57,    58,    59,    60,    61,    62,    63,
      64,    65,    66,    67,    70,    71,    72,    73,    74,    75,
      76,    77,    38,    39,    40,    15,    41,    54,    53,    46,
      47,    49,    50,    52,    51,    48,    42,    43,    44,    45,
      55,    31,    10,     0,     1,     6,     7,    29,    34,    98,
      28,     0,    87,    86,    85,     0,   107,   165,     0,     0,
       0,     0,   157,   156,     0,     0,     0,   205,   120,   121,
     122,     0,     0,     0,   117,   118,   119,   115,   116,   114,
     142,     0,     0,     0,     0,     0,     0,   158,   159,   164,
     163,   162,   160,   161,    11,     0,    14,     0,     0,     0,
       0,     0,     0,     0,    12,    82,   153,   166,   155,   167,
     168,     0,     0,     0,     0,   146,   148,     0,     0,     0,
       0,   206,     0,   194,   196,   197,   198,   126,   127,     0,
     124,   135,     0,   133,   131,     0,   129,   143,   110,     0,
     112,   113,     0,   154,    27,    26,     0,    83,    23,    21,
      19,    17,   169,   152,   151,     0,   145,   149,     0,     0,
       0,     0,   170,   205,   205,   123,   125,   132,   134,   128,
     130,     0,     0,     0,     0,    90,    89,    88,     0,     0,
       0,     0,     0,   144,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,   172,   174,   175,   176,
     177,   178,   179,   180,   181,   182,   183,   203,   204,     0,
     201,     0,     0,   210,   211,     0,   208,   212,   213,   195,
     199,   111,     0,    25,    24,    22,    20,    18,    16,   150,
       0,   184,   185,   186,   187,   188,   189,   190,   191,   192,
     193,   205,   173,   205,   202,   214,   215,     0,   209,     0,
       0,     0,   200,   207,     0,   147,   171,     0,     0,   109
};

/* YYDEFGOTO[NTERM-NUM]. */
static const short yydefgoto[] =
{
      -1,     4,     5,     6,     7,   211,    75,    76,    77,   237,
      78,    79,    80,    81,   138,    83,   139,    85,    86,    87,
      88,    89,    90,    91,    92,    93,    94,    95,    96,    97,
      98,    99,   100,   101,   219,   220,   102,   225,   226,   103,
     222,   223,   104,   105,   106,   107,   108,   109,   110,   111,
     112,   113,   205,   206,   114,   115,   116,   117,   118,   119,
     120,   121,   122,   123,   124,   125,   126,   127,   128,   129,
     130,   131,   285,   286,   287,   288,   289,   290,   291,   292,
     293,   294,   295,   296,   212,   213,   214,   215,   299,   300,
     216,   305,   306,   307,   308
};

/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
   STATE-NUM.  */
#define YYPACT_NINF -237
static const short yypact[] =
{
      96,  -237,   851,   948,    22,    96,  -237,  -237,  -237,  -237,
    -237,  -237,  -237,  1525,  1525,  1429,    80,  1525,   -55,  -237,
    -237,  -237,  -237,  -237,  -237,  -237,  -237,  1525,  1525,  1525,
    1525,  1525,  1525,  1525,  1525,  1525,    19,    35,  1525,  1525,
    1525,   -30,     8,    36,  1525,  1525,  1525,  1525,  1525,   -14,
    -237,  -237,  -237,  -237,  -237,  -237,  1525,   -12,  -237,  -237,
       2,  1525,    45,    65,    66,  1525,  1525,  1525,  1525,  1525,
    1525,  1525,  -237,  -237,   461,  -237,    58,  1429,  -237,  -237,
    -237,  -237,    99,  -237,   101,  -237,  -237,  -237,  -237,  -237,
    -237,  -237,  -237,  -237,  -237,  -237,  -237,  -237,  -237,  -237,
    -237,  -237,  -237,  -237,  -237,  -237,  -237,  -237,  -237,  -237,
    -237,  -237,  -237,  -237,  -237,  -237,  -237,  -237,  -237,  -237,
    -237,  -237,  -237,  -237,  -237,  -237,  -237,  -237,  -237,  -237,
    -237,  -237,  -237,   559,  -237,  -237,  -237,  -237,  -237,  -237,
    -237,   656,  -237,  -237,  -237,  1525,  -237,  -237,  1525,  1525,
    1525,  1525,  -237,  -237,  1525,    93,   103,  1141,  -237,  -237,
    -237,    59,    61,    63,  -237,  -237,  -237,  -237,  -237,  -237,
    -237,  1525,  1525,  1525,  1525,  1525,    37,  -237,  -237,  -237,
    -237,  -237,  -237,  -237,  -237,  1429,  -237,  1525,  1525,   753,
    1525,  1525,  1525,  1525,  -237,  -237,  -237,  -237,  -237,  -237,
    -237,  1525,  1525,  1525,   103,    17,  -237,    44,   112,   113,
     115,  1044,    -3,  -237,    91,  -237,  -237,  -237,  -237,    50,
    -237,  -237,   -27,  -237,  -237,   -39,  -237,  -237,  -237,  1525,
    -237,  -237,    74,  1429,   120,   122,    69,  -237,   124,   123,
     125,   128,  -237,  -237,   129,    49,  -237,  -237,  1525,    39,
      77,   -23,  -237,  1237,  1333,  -237,  -237,  -237,  -237,  -237,
    -237,  1525,    85,  1525,  1525,  -237,  -237,  -237,  1525,  1525,
    1525,  1525,  1525,  -237,   131,    95,    97,    98,   100,   102,
     104,   105,   106,   107,   109,    -4,  -237,  -237,  -237,  -237,
    -237,  -237,  -237,  -237,  -237,  -237,  -237,  -237,  -237,    11,
    -237,   110,   111,  -237,  -237,    -8,  -237,  -237,  -237,  -237,
    -237,  -237,    56,  -237,  -237,  -237,  -237,  -237,  -237,  -237,
     103,  -237,  -237,  -237,  -237,  -237,  -237,  -237,  -237,  -237,
    -237,  1237,  -237,  1333,  -237,  -237,  -237,  1429,  -237,   114,
      83,    13,    91,  1044,    94,  -237,  -237,    60,   116,  -237
};

/* YYPGOTO[NTERM-NUM].  */
static const short yypgoto[] =
{
    -237,  -237,  -237,   159,   160,     1,   -65,   194,  -237,  -237,
    -237,  -237,  -237,  -237,    -2,  -237,     3,  -237,  -237,  -237,
    -237,  -237,  -237,  -237,  -237,  -237,  -237,  -237,  -237,  -237,
    -237,  -237,  -237,  -237,  -237,   -52,  -237,  -237,   -56,  -237,
    -237,   -51,  -237,  -237,  -237,  -237,  -237,  -237,  -237,  -237,
    -237,  -237,  -154,  -197,  -237,  -237,  -237,  -237,  -237,  -237,
    -237,  -237,  -237,  -237,  -237,  -237,  -237,  -237,  -237,  -237,
    -237,  -237,  -237,  -115,  -237,  -236,  -226,  -237,  -237,  -237,
    -237,  -237,  -237,  -237,  -158,   -78,  -157,  -237,  -237,  -122,
     -76,  -237,  -126,  -237,  -237
};

/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
   positive, shift that token.  If negative, reduce the rule which
   number is the opposite.  If zero, do what YYDEFACT says.
   If YYTABLE_NINF, syntax error.  */
#define YYTABLE_NINF -1
static const unsigned short yytable[] =
{
      82,    82,   207,    74,   133,    84,    84,   337,   247,   186,
     247,   331,   252,    82,   297,   303,   141,   146,    84,   259,
     276,   277,   134,   224,   298,   304,   333,   161,   346,   202,
     203,   257,   246,   156,   221,   276,   277,   253,   275,   276,
     277,   278,   279,   280,   281,   282,   283,   284,   247,   157,
     245,   301,   302,   253,   276,   277,   202,   203,   169,   248,
     171,   202,   203,   297,   273,   162,   301,   302,   186,   303,
     187,   188,    82,   298,   172,    82,   186,    84,   189,   304,
      84,   275,   276,   277,   278,   279,   280,   281,   282,   283,
     284,   265,   266,   163,   267,   202,   203,   174,   345,     1,
       2,     3,   142,   143,   144,   202,   203,   204,   255,   217,
     218,   190,   191,   192,   193,   202,   203,   175,   217,   218,
     276,   277,   221,   176,   186,   224,   249,   250,   232,   251,
     254,    82,   262,   263,   264,   269,    84,   268,   270,    82,
     271,   272,   312,   247,    84,   320,   186,   321,   339,   322,
     323,   347,   324,   348,   325,    82,   326,   327,   328,   329,
      84,   330,   335,   336,   135,   136,   340,   256,   186,   260,
     332,   258,   344,   341,   349,   309,   342,   334,   310,   338,
       0,     0,     0,    82,     0,     0,   233,    82,    84,     0,
       0,     0,    84,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,   137,   140,    82,
       0,   145,     0,     0,    84,     0,     0,     0,     0,     0,
       0,   147,   148,   149,   150,   151,   152,   153,   154,   155,
       0,    82,   158,   159,   160,     0,    84,     0,   164,   165,
     166,   167,   168,     0,     0,     0,     0,     0,     0,     0,
     170,    82,    82,     0,     0,   173,    84,    84,     0,   177,
     178,   179,   180,   181,   182,   183,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,   186,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,    82,
       0,    82,     0,     0,    84,    82,    84,     0,   343,   196,
      84,    82,   197,   198,   199,   200,    84,     0,   201,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,   227,   228,   229,   230,   231,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,   234,   235,     0,   238,   239,   240,   241,     0,     0,
       0,     0,     0,     0,     0,   242,   243,   244,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,   261,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,   274,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,   311,     0,   313,   314,     0,
       0,     0,   315,   316,   317,   318,   319,   184,     9,    10,
      11,    12,     0,    13,    14,    15,     0,    16,     0,    17,
      18,    19,    20,    21,    22,    23,    24,    25,    26,    27,
      28,    29,    30,    31,    32,    33,    34,    35,    36,    37,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,    38,    39,    40,    41,     0,     0,
       0,     0,     0,     0,    42,    43,     0,    44,    45,    46,
      47,    48,    49,     0,     0,     0,     0,    50,    51,    52,
      53,    54,    55,    56,    57,    58,    59,    60,    61,    62,
      63,    64,     0,     0,     0,    65,    66,    67,    68,    69,
      70,    71,    72,    73,   185,   194,     9,    10,    11,    12,
       0,    13,    14,    15,     0,    16,     0,    17,    18,    19,
      20,    21,    22,    23,    24,    25,    26,    27,    28,    29,
      30,    31,    32,    33,    34,    35,    36,    37,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,    38,    39,    40,    41,     0,     0,     0,     0,
       0,     0,    42,    43,     0,    44,    45,    46,    47,    48,
      49,     0,     0,     0,     0,    50,    51,    52,    53,    54,
      55,    56,    57,    58,    59,    60,    61,    62,    63,    64,
       0,     0,     0,    65,    66,    67,    68,    69,    70,    71,
      72,    73,   185,     9,    10,    11,    12,     0,    13,    14,
      15,   195,    16,     0,    17,    18,    19,    20,    21,    22,
      23,    24,    25,    26,    27,    28,    29,    30,    31,    32,
      33,    34,    35,    36,    37,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,    38,
      39,    40,    41,     0,     0,     0,     0,     0,     0,    42,
      43,     0,    44,    45,    46,    47,    48,    49,     0,     0,
       0,     0,    50,    51,    52,    53,    54,    55,    56,    57,
      58,    59,    60,    61,    62,    63,    64,     0,     0,     0,
      65,    66,    67,    68,    69,    70,    71,    72,    73,   185,
       9,    10,    11,    12,     0,    13,    14,    15,     0,    16,
     236,    17,    18,    19,    20,    21,    22,    23,    24,    25,
      26,    27,    28,    29,    30,    31,    32,    33,    34,    35,
      36,    37,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,    38,    39,    40,    41,
       0,     0,     0,     0,     0,     0,    42,    43,     0,    44,
      45,    46,    47,    48,    49,     0,     0,     0,     0,    50,
      51,    52,    53,    54,    55,    56,    57,    58,    59,    60,
      61,    62,    63,    64,     0,     0,     0,    65,    66,    67,
      68,    69,    70,    71,    72,    73,   185,     8,     9,    10,
      11,    12,     0,    13,    14,    15,     0,    16,     0,    17,
      18,    19,    20,    21,    22,    23,    24,    25,    26,    27,
      28,    29,    30,    31,    32,    33,    34,    35,    36,    37,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,    38,    39,    40,    41,     0,     0,
       0,     0,     0,     0,    42,    43,     0,    44,    45,    46,
      47,    48,    49,     0,     0,     0,     0,    50,    51,    52,
      53,    54,    55,    56,    57,    58,    59,    60,    61,    62,
      63,    64,     0,     0,     0,    65,    66,    67,    68,    69,
      70,    71,    72,    73,   132,     9,    10,    11,    12,     0,
      13,    14,    15,     0,    16,     0,    17,    18,    19,    20,
      21,    22,    23,    24,    25,    26,    27,    28,    29,    30,
      31,    32,    33,    34,    35,    36,    37,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,    38,    39,    40,    41,     0,     0,     0,     0,     0,
       0,    42,    43,     0,    44,    45,    46,    47,    48,    49,
       0,     0,     0,     0,    50,    51,    52,    53,    54,    55,
      56,    57,    58,    59,    60,    61,    62,    63,    64,     0,
       0,     0,    65,    66,    67,    68,    69,    70,    71,    72,
      73,     9,    10,    11,    12,     0,    13,    14,    15,     0,
      16,     0,    17,    18,    19,    20,    21,    22,    23,    24,
      25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
      35,    36,    37,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,    38,    39,    40,
      41,     0,     0,     0,     0,     0,     0,    42,    43,     0,
      44,    45,    46,    47,    48,    49,     0,     0,     0,     0,
      50,    51,    52,    53,    54,    55,    56,    57,    58,    59,
      60,    61,    62,    63,    64,     0,     0,     0,    65,    66,
      67,    68,    69,    70,    71,    72,    73,   185,     9,    10,
      11,    12,     0,    13,    14,    15,     0,    16,     0,    17,
      18,    19,    20,    21,    22,    23,    24,    25,    26,    27,
      28,    29,    30,    31,    32,    33,    34,    35,    36,    37,
       0,     0,   208,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,    38,    39,    40,    41,     0,     0,
       0,     0,     0,     0,    42,    43,   209,    44,    45,    46,
      47,    48,    49,     0,   210,     0,     0,    50,    51,    52,
      53,    54,    55,    56,    57,    58,    59,    60,    61,    62,
      63,    64,     0,     0,     0,    65,    66,    67,    68,    69,
      70,    71,    72,    73,     9,    10,    11,    12,     0,    13,
      14,    15,     0,    16,     0,    17,    18,    19,    20,    21,
      22,    23,    24,    25,    26,    27,    28,    29,    30,    31,
      32,    33,    34,    35,    36,    37,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
      38,    39,    40,    41,     0,     0,     0,     0,     0,     0,
      42,    43,   209,    44,    45,    46,    47,    48,    49,     0,
     210,     0,     0,    50,    51,    52,    53,    54,    55,    56,
      57,    58,    59,    60,    61,    62,    63,    64,     0,     0,
       0,    65,    66,    67,    68,    69,    70,    71,    72,    73,
       9,    10,    11,    12,     0,    13,    14,    15,     0,    16,
       0,    17,    18,    19,    20,    21,    22,    23,    24,    25,
      26,    27,    28,    29,    30,    31,    32,    33,    34,    35,
      36,    37,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,    38,    39,    40,    41,
       0,     0,     0,     0,     0,     0,    42,    43,     0,    44,
      45,    46,    47,    48,    49,     0,   210,     0,     0,    50,
      51,    52,    53,    54,    55,    56,    57,    58,    59,    60,
      61,    62,    63,    64,     0,     0,     0,    65,    66,    67,
      68,    69,    70,    71,    72,    73,     9,    10,    11,    12,
       0,    13,    14,    15,     0,    16,     0,    17,    18,    19,
      20,    21,    22,    23,    24,    25,    26,    27,    28,    29,
      30,    31,    32,    33,    34,    35,    36,    37,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,    38,    39,    40,    41,     0,     0,     0,     0,
       0,     0,    42,    43,     0,    44,    45,    46,    47,    48,
      49,     0,     0,     0,     0,    50,    51,    52,    53,    54,
      55,    56,    57,    58,    59,    60,    61,    62,    63,    64,
       0,     0,     0,    65,    66,    67,    68,    69,    70,    71,
      72,    73,     9,    10,    11,    12,     0,     0,     0,    15,
       0,    16,     0,    17,    18,    19,    20,    21,    22,    23,
      24,    25,    26,    27,    28,    29,    30,    31,    32,    33,
      34,    35,    36,    37,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,    38,    39,
      40,    41,     0,     0,     0,     0,     0,     0,    42,    43,
       0,    44,    45,    46,    47,    48,    49,     0,     0,     0,
       0,    50,    51,    52,    53,    54,    55,    56,    57,    58,
      59,    60,    61,    62,    63,    64,     0,     0,     0,    65,
      66,    67,    68,    69,    70,    71,    72,    73
};

static const short yycheck[] =
{
       2,     3,   156,     2,     3,     2,     3,    15,   205,    74,
     207,    15,    15,    15,   250,   251,    15,    72,    15,    58,
      43,    44,     0,    62,   250,   251,    15,    57,    15,    12,
      13,    58,    15,    14,    61,    43,    44,    40,    42,    43,
      44,    45,    46,    47,    48,    49,    50,    51,   245,    14,
     204,    74,    75,    40,    43,    44,    12,    13,    72,    15,
      72,    12,    13,   299,    15,    57,    74,    75,   133,   305,
      12,    13,    74,   299,    72,    77,   141,    74,    77,   305,
      77,    42,    43,    44,    45,    46,    47,    48,    49,    50,
      51,    22,    23,    57,    25,    12,    13,    52,    15,     3,
       4,     5,    22,    23,    24,    12,    13,    14,    58,    59,
      60,    12,    13,    12,    13,    12,    13,    52,    59,    60,
      43,    44,    61,    57,   189,    62,    14,    14,    91,    14,
      39,   133,    58,    13,    12,    12,   133,    13,    13,   141,
      12,    12,    57,   340,   141,    14,   211,    52,    92,    52,
      52,    57,    52,    93,    52,   157,    52,    52,    52,    52,
     157,    52,    52,    52,     5,     5,   320,   219,   233,   225,
     285,   222,    58,   331,    58,   253,   333,   299,   254,   305,
      -1,    -1,    -1,   185,    -1,    -1,   185,   189,   185,    -1,
      -1,    -1,   189,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    13,    14,   211,
      -1,    17,    -1,    -1,   211,    -1,    -1,    -1,    -1,    -1,
      -1,    27,    28,    29,    30,    31,    32,    33,    34,    35,
      -1,   233,    38,    39,    40,    -1,   233,    -1,    44,    45,
      46,    47,    48,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      56,   253,   254,    -1,    -1,    61,   253,   254,    -1,    65,
      66,    67,    68,    69,    70,    71,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   343,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   331,
      -1,   333,    -1,    -1,   331,   337,   333,    -1,   337,   145,
     337,   343,   148,   149,   150,   151,   343,    -1,   154,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,   171,   172,   173,   174,   175,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,   187,   188,    -1,   190,   191,   192,   193,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,   201,   202,   203,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,   229,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,   248,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,   261,    -1,   263,   264,    -1,
      -1,    -1,   268,   269,   270,   271,   272,     6,     7,     8,
       9,    10,    -1,    12,    13,    14,    -1,    16,    -1,    18,
      19,    20,    21,    22,    23,    24,    25,    26,    27,    28,
      29,    30,    31,    32,    33,    34,    35,    36,    37,    38,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    53,    54,    55,    56,    -1,    -1,
      -1,    -1,    -1,    -1,    63,    64,    -1,    66,    67,    68,
      69,    70,    71,    -1,    -1,    -1,    -1,    76,    77,    78,
      79,    80,    81,    82,    83,    84,    85,    86,    87,    88,
      89,    90,    -1,    -1,    -1,    94,    95,    96,    97,    98,
      99,   100,   101,   102,   103,     6,     7,     8,     9,    10,
      -1,    12,    13,    14,    -1,    16,    -1,    18,    19,    20,
      21,    22,    23,    24,    25,    26,    27,    28,    29,    30,
      31,    32,    33,    34,    35,    36,    37,    38,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    53,    54,    55,    56,    -1,    -1,    -1,    -1,
      -1,    -1,    63,    64,    -1,    66,    67,    68,    69,    70,
      71,    -1,    -1,    -1,    -1,    76,    77,    78,    79,    80,
      81,    82,    83,    84,    85,    86,    87,    88,    89,    90,
      -1,    -1,    -1,    94,    95,    96,    97,    98,    99,   100,
     101,   102,   103,     7,     8,     9,    10,    -1,    12,    13,
      14,    15,    16,    -1,    18,    19,    20,    21,    22,    23,
      24,    25,    26,    27,    28,    29,    30,    31,    32,    33,
      34,    35,    36,    37,    38,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    53,
      54,    55,    56,    -1,    -1,    -1,    -1,    -1,    -1,    63,
      64,    -1,    66,    67,    68,    69,    70,    71,    -1,    -1,
      -1,    -1,    76,    77,    78,    79,    80,    81,    82,    83,
      84,    85,    86,    87,    88,    89,    90,    -1,    -1,    -1,
      94,    95,    96,    97,    98,    99,   100,   101,   102,   103,
       7,     8,     9,    10,    -1,    12,    13,    14,    -1,    16,
      17,    18,    19,    20,    21,    22,    23,    24,    25,    26,
      27,    28,    29,    30,    31,    32,    33,    34,    35,    36,
      37,    38,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    53,    54,    55,    56,
      -1,    -1,    -1,    -1,    -1,    -1,    63,    64,    -1,    66,
      67,    68,    69,    70,    71,    -1,    -1,    -1,    -1,    76,
      77,    78,    79,    80,    81,    82,    83,    84,    85,    86,
      87,    88,    89,    90,    -1,    -1,    -1,    94,    95,    96,
      97,    98,    99,   100,   101,   102,   103,     6,     7,     8,
       9,    10,    -1,    12,    13,    14,    -1,    16,    -1,    18,
      19,    20,    21,    22,    23,    24,    25,    26,    27,    28,
      29,    30,    31,    32,    33,    34,    35,    36,    37,    38,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    53,    54,    55,    56,    -1,    -1,
      -1,    -1,    -1,    -1,    63,    64,    -1,    66,    67,    68,
      69,    70,    71,    -1,    -1,    -1,    -1,    76,    77,    78,
      79,    80,    81,    82,    83,    84,    85,    86,    87,    88,
      89,    90,    -1,    -1,    -1,    94,    95,    96,    97,    98,
      99,   100,   101,   102,     6,     7,     8,     9,    10,    -1,
      12,    13,    14,    -1,    16,    -1,    18,    19,    20,    21,
      22,    23,    24,    25,    26,    27,    28,    29,    30,    31,
      32,    33,    34,    35,    36,    37,    38,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    53,    54,    55,    56,    -1,    -1,    -1,    -1,    -1,
      -1,    63,    64,    -1,    66,    67,    68,    69,    70,    71,
      -1,    -1,    -1,    -1,    76,    77,    78,    79,    80,    81,
      82,    83,    84,    85,    86,    87,    88,    89,    90,    -1,
      -1,    -1,    94,    95,    96,    97,    98,    99,   100,   101,
     102,     7,     8,     9,    10,    -1,    12,    13,    14,    -1,
      16,    -1,    18,    19,    20,    21,    22,    23,    24,    25,
      26,    27,    28,    29,    30,    31,    32,    33,    34,    35,
      36,    37,    38,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    53,    54,    55,
      56,    -1,    -1,    -1,    -1,    -1,    -1,    63,    64,    -1,
      66,    67,    68,    69,    70,    71,    -1,    -1,    -1,    -1,
      76,    77,    78,    79,    80,    81,    82,    83,    84,    85,
      86,    87,    88,    89,    90,    -1,    -1,    -1,    94,    95,
      96,    97,    98,    99,   100,   101,   102,   103,     7,     8,
       9,    10,    -1,    12,    13,    14,    -1,    16,    -1,    18,
      19,    20,    21,    22,    23,    24,    25,    26,    27,    28,
      29,    30,    31,    32,    33,    34,    35,    36,    37,    38,
      -1,    -1,    41,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    53,    54,    55,    56,    -1,    -1,
      -1,    -1,    -1,    -1,    63,    64,    65,    66,    67,    68,
      69,    70,    71,    -1,    73,    -1,    -1,    76,    77,    78,
      79,    80,    81,    82,    83,    84,    85,    86,    87,    88,
      89,    90,    -1,    -1,    -1,    94,    95,    96,    97,    98,
      99,   100,   101,   102,     7,     8,     9,    10,    -1,    12,
      13,    14,    -1,    16,    -1,    18,    19,    20,    21,    22,
      23,    24,    25,    26,    27,    28,    29,    30,    31,    32,
      33,    34,    35,    36,    37,    38,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      53,    54,    55,    56,    -1,    -1,    -1,    -1,    -1,    -1,
      63,    64,    65,    66,    67,    68,    69,    70,    71,    -1,
      73,    -1,    -1,    76,    77,    78,    79,    80,    81,    82,
      83,    84,    85,    86,    87,    88,    89,    90,    -1,    -1,
      -1,    94,    95,    96,    97,    98,    99,   100,   101,   102,
       7,     8,     9,    10,    -1,    12,    13,    14,    -1,    16,
      -1,    18,    19,    20,    21,    22,    23,    24,    25,    26,
      27,    28,    29,    30,    31,    32,    33,    34,    35,    36,
      37,    38,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    53,    54,    55,    56,
      -1,    -1,    -1,    -1,    -1,    -1,    63,    64,    -1,    66,
      67,    68,    69,    70,    71,    -1,    73,    -1,    -1,    76,
      77,    78,    79,    80,    81,    82,    83,    84,    85,    86,
      87,    88,    89,    90,    -1,    -1,    -1,    94,    95,    96,
      97,    98,    99,   100,   101,   102,     7,     8,     9,    10,
      -1,    12,    13,    14,    -1,    16,    -1,    18,    19,    20,
      21,    22,    23,    24,    25,    26,    27,    28,    29,    30,
      31,    32,    33,    34,    35,    36,    37,    38,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    53,    54,    55,    56,    -1,    -1,    -1,    -1,
      -1,    -1,    63,    64,    -1,    66,    67,    68,    69,    70,
      71,    -1,    -1,    -1,    -1,    76,    77,    78,    79,    80,
      81,    82,    83,    84,    85,    86,    87,    88,    89,    90,
      -1,    -1,    -1,    94,    95,    96,    97,    98,    99,   100,
     101,   102,     7,     8,     9,    10,    -1,    -1,    -1,    14,
      -1,    16,    -1,    18,    19,    20,    21,    22,    23,    24,
      25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
      35,    36,    37,    38,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    53,    54,
      55,    56,    -1,    -1,    -1,    -1,    -1,    -1,    63,    64,
      -1,    66,    67,    68,    69,    70,    71,    -1,    -1,    -1,
      -1,    76,    77,    78,    79,    80,    81,    82,    83,    84,
      85,    86,    87,    88,    89,    90,    -1,    -1,    -1,    94,
      95,    96,    97,    98,    99,   100,   101,   102
};

/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
   symbol of state STATE-NUM.  */
static const unsigned char yystos[] =
{
       0,     3,     4,     5,   105,   106,   107,   108,     6,     7,
       8,     9,    10,    12,    13,    14,    16,    18,    19,    20,
      21,    22,    23,    24,    25,    26,    27,    28,    29,    30,
      31,    32,    33,    34,    35,    36,    37,    38,    53,    54,
      55,    56,    63,    64,    66,    67,    68,    69,    70,    71,
      76,    77,    78,    79,    80,    81,    82,    83,    84,    85,
      86,    87,    88,    89,    90,    94,    95,    96,    97,    98,
      99,   100,   101,   102,   109,   110,   111,   112,   114,   115,
     116,   117,   118,   119,   120,   121,   122,   123,   124,   125,
     126,   127,   128,   129,   130,   131,   132,   133,   134,   135,
     136,   137,   140,   143,   146,   147,   148,   149,   150,   151,
     152,   153,   154,   155,   158,   159,   160,   161,   162,   163,
     164,   165,   166,   167,   168,   169,   170,   171,   172,   173,
     174,   175,     6,   109,     0,   107,   108,   111,   118,   120,
     111,   109,    22,    23,    24,   111,    72,   111,   111,   111,
     111,   111,   111,   111,   111,   111,    14,    14,   111,   111,
     111,    57,    57,    57,   111,   111,   111,   111,   111,    72,
     111,    72,    72,   111,    52,    52,    57,   111,   111,   111,
     111,   111,   111,   111,     6,   103,   110,    12,    13,   109,
      12,    13,    12,    13,     6,    15,   111,   111,   111,   111,
     111,   111,    12,    13,    14,   156,   157,   156,    41,    65,
      73,   109,   188,   189,   190,   191,   194,    59,    60,   138,
     139,    61,   144,   145,    62,   141,   142,   111,   111,   111,
     111,   111,    91,   109,   111,   111,    17,   113,   111,   111,
     111,   111,   111,   111,   111,   156,    15,   157,    15,    14,
      14,    14,    15,    40,    39,    58,   139,    58,   145,    58,
     142,   111,    58,    13,    12,    22,    23,    25,    13,    12,
      13,    12,    12,    15,   111,    42,    43,    44,    45,    46,
      47,    48,    49,    50,    51,   176,   177,   178,   179,   180,
     181,   182,   183,   184,   185,   186,   187,   179,   180,   192,
     193,    74,    75,   179,   180,   195,   196,   197,   198,   189,
     194,   111,    57,   111,   111,   111,   111,   111,   111,   111,
      14,    52,    52,    52,    52,    52,    52,    52,    52,    52,
      52,    15,   177,    15,   193,    52,    52,    15,   196,    92,
     156,   188,   190,   109,    58,    15,    15,    57,    93,    58
};

#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
# define YYSIZE_T __SIZE_TYPE__
#endif
#if ! defined (YYSIZE_T) && defined (size_t)
# define YYSIZE_T size_t
#endif
#if ! defined (YYSIZE_T)
# if defined (__STDC__) || defined (__cplusplus)
#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
#  define YYSIZE_T size_t
# endif
#endif
#if ! defined (YYSIZE_T)
# define YYSIZE_T unsigned int
#endif

#define yyerrok		(yyerrstatus = 0)
#define yyclearin	(yychar = YYEMPTY)
#define YYEMPTY		(-2)
#define YYEOF		0

#define YYACCEPT	goto yyacceptlab
#define YYABORT		goto yyabortlab
#define YYERROR		goto yyerrorlab


/* Like YYERROR except do call yyerror.  This remains here temporarily
   to ease the transition to the new meaning of YYERROR, for GCC.
   Once GCC version 2 has supplanted version 1, this can go.  */

#define YYFAIL		goto yyerrlab

#define YYRECOVERING()  (!!yyerrstatus)

#define YYBACKUP(Token, Value)					\
do								\
  if (yychar == YYEMPTY && yylen == 1)				\
    {								\
      yychar = (Token);						\
      yylval = (Value);						\
      yytoken = YYTRANSLATE (yychar);				\
      YYPOPSTACK;						\
      goto yybackup;						\
    }								\
  else								\
    { 								\
      yyerror ("syntax error: cannot back up");\
      YYERROR;							\
    }								\
while (0)

#define YYTERROR	1
#define YYERRCODE	256

/* YYLLOC_DEFAULT -- Compute the default location (before the actions
   are run).  */

#ifndef YYLLOC_DEFAULT
# define YYLLOC_DEFAULT(Current, Rhs, N)		\
   ((Current).first_line   = (Rhs)[1].first_line,	\
    (Current).first_column = (Rhs)[1].first_column,	\
    (Current).last_line    = (Rhs)[N].last_line,	\
    (Current).last_column  = (Rhs)[N].last_column)
#endif

/* YYLEX -- calling `yylex' with the right arguments.  */

#ifdef YYLEX_PARAM
# define YYLEX yylex (YYLEX_PARAM)
#else
# define YYLEX yylex ()
#endif

/* Enable debugging if requested.  */
#if YYDEBUG

# ifndef YYFPRINTF
#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
#  define YYFPRINTF fprintf
# endif

# define YYDPRINTF(Args)			\
do {						\
  if (yydebug)					\
    YYFPRINTF Args;				\
} while (0)

# define YYDSYMPRINT(Args)			\
do {						\
  if (yydebug)					\
    yysymprint Args;				\
} while (0)

# define YYDSYMPRINTF(Title, Token, Value, Location)		\
do {								\
  if (yydebug)							\
    {								\
      YYFPRINTF (stderr, "%s ", Title);				\
      yysymprint (stderr, 					\
                  Token, Value);	\
      YYFPRINTF (stderr, "\n");					\
    }								\
} while (0)

/*------------------------------------------------------------------.
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
| TOP (included).                                                   |
`------------------------------------------------------------------*/

#if defined (__STDC__) || defined (__cplusplus)
static void
yy_stack_print (short *bottom, short *top)
#else
static void
yy_stack_print (bottom, top)
    short *bottom;
    short *top;
#endif
{
  YYFPRINTF (stderr, "Stack now");
  for (/* Nothing. */; bottom <= top; ++bottom)
    YYFPRINTF (stderr, " %d", *bottom);
  YYFPRINTF (stderr, "\n");
}

# define YY_STACK_PRINT(Bottom, Top)				\
do {								\
  if (yydebug)							\
    yy_stack_print ((Bottom), (Top));				\
} while (0)


/*------------------------------------------------.
| Report that the YYRULE is going to be reduced.  |
`------------------------------------------------*/

#if defined (__STDC__) || defined (__cplusplus)
static void
yy_reduce_print (int yyrule)
#else
static void
yy_reduce_print (yyrule)
    int yyrule;
#endif
{
  int yyi;
  unsigned int yylno = yyrline[yyrule];
  YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
             yyrule - 1, yylno);
  /* Print the symbols being reduced, and their result.  */
  for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
    YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
  YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
}

# define YY_REDUCE_PRINT(Rule)		\
do {					\
  if (yydebug)				\
    yy_reduce_print (Rule);		\
} while (0)

/* Nonzero means print parse trace.  It is left uninitialized so that
   multiple parsers can coexist.  */
int yydebug;
#else /* !YYDEBUG */
# define YYDPRINTF(Args)
# define YYDSYMPRINT(Args)
# define YYDSYMPRINTF(Title, Token, Value, Location)
# define YY_STACK_PRINT(Bottom, Top)
# define YY_REDUCE_PRINT(Rule)
#endif /* !YYDEBUG */


/* YYINITDEPTH -- initial size of the parser's stacks.  */
#ifndef	YYINITDEPTH
# define YYINITDEPTH 200
#endif

/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
   if the built-in stack extension method is used).

   Do not make this value too large; the results are undefined if
   SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
   evaluated with infinite-precision integer arithmetic.  */

#if defined (YYMAXDEPTH) && YYMAXDEPTH == 0
# undef YYMAXDEPTH
#endif

#ifndef YYMAXDEPTH
# define YYMAXDEPTH 10000
#endif



#if YYERROR_VERBOSE

# ifndef yystrlen
#  if defined (__GLIBC__) && defined (_STRING_H)
#   define yystrlen strlen
#  else
/* Return the length of YYSTR.  */
static YYSIZE_T
#   if defined (__STDC__) || defined (__cplusplus)
yystrlen (const char *yystr)
#   else
yystrlen (yystr)
     const char *yystr;
#   endif
{
  register const char *yys = yystr;

  while (*yys++ != '\0')
    continue;

  return yys - yystr - 1;
}
#  endif
# endif

# ifndef yystpcpy
#  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
#   define yystpcpy stpcpy
#  else
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
   YYDEST.  */
static char *
#   if defined (__STDC__) || defined (__cplusplus)
yystpcpy (char *yydest, const char *yysrc)
#   else
yystpcpy (yydest, yysrc)
     char *yydest;
     const char *yysrc;
#   endif
{
  register char *yyd = yydest;
  register const char *yys = yysrc;

  while ((*yyd++ = *yys++) != '\0')
    continue;

  return yyd - 1;
}
#  endif
# endif

#endif /* !YYERROR_VERBOSE */



#if YYDEBUG
/*--------------------------------.
| Print this symbol on YYOUTPUT.  |
`--------------------------------*/

#if defined (__STDC__) || defined (__cplusplus)
static void
yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
#else
static void
yysymprint (yyoutput, yytype, yyvaluep)
    FILE *yyoutput;
    int yytype;
    YYSTYPE *yyvaluep;
#endif
{
  /* Pacify ``unused variable'' warnings.  */
  (void) yyvaluep;

  if (yytype < YYNTOKENS)
    {
      YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
# ifdef YYPRINT
      YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
# endif
    }
  else
    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);

  switch (yytype)
    {
      default:
        break;
    }
  YYFPRINTF (yyoutput, ")");
}

#endif /* ! YYDEBUG */
/*-----------------------------------------------.
| Release the memory associated to this symbol.  |
`-----------------------------------------------*/

#if defined (__STDC__) || defined (__cplusplus)
static void
yydestruct (int yytype, YYSTYPE *yyvaluep)
#else
static void
yydestruct (yytype, yyvaluep)
    int yytype;
    YYSTYPE *yyvaluep;
#endif
{
  /* Pacify ``unused variable'' warnings.  */
  (void) yyvaluep;

  switch (yytype)
    {

      default:
        break;
    }
}


/* Prevent warnings from -Wmissing-prototypes.  */

#ifdef YYPARSE_PARAM
# if defined (__STDC__) || defined (__cplusplus)
int yyparse (void *YYPARSE_PARAM);
# else
int yyparse ();
# endif
#else /* ! YYPARSE_PARAM */
#if defined (__STDC__) || defined (__cplusplus)
int yyparse (void);
#else
int yyparse ();
#endif
#endif /* ! YYPARSE_PARAM */



/* The lookahead symbol.  */
int yychar;

/* The semantic value of the lookahead symbol.  */
YYSTYPE yylval;

/* Number of syntax errors so far.  */
int yynerrs;



/*----------.
| yyparse.  |
`----------*/

#ifdef YYPARSE_PARAM
# if defined (__STDC__) || defined (__cplusplus)
int yyparse (void *YYPARSE_PARAM)
# else
int yyparse (YYPARSE_PARAM)
  void *YYPARSE_PARAM;
# endif
#else /* ! YYPARSE_PARAM */
#if defined (__STDC__) || defined (__cplusplus)
int
yyparse (void)
#else
int
yyparse ()

#endif
#endif
{
  
  register int yystate;
  register int yyn;
  int yyresult;
  /* Number of tokens to shift before error messages enabled.  */
  int yyerrstatus;
  /* Lookahead token as an internal (translated) token number.  */
  int yytoken = 0;

  /* Three stacks and their tools:
     `yyss': related to states,
     `yyvs': related to semantic values,
     `yyls': related to locations.

     Refer to the stacks thru separate pointers, to allow yyoverflow
     to reallocate them elsewhere.  */

  /* The state stack.  */
  short	yyssa[YYINITDEPTH];
  short *yyss = yyssa;
  register short *yyssp;

  /* The semantic value stack.  */
  YYSTYPE yyvsa[YYINITDEPTH];
  YYSTYPE *yyvs = yyvsa;
  register YYSTYPE *yyvsp;



#define YYPOPSTACK   (yyvsp--, yyssp--)

  YYSIZE_T yystacksize = YYINITDEPTH;

  /* The variables used to return semantic value and location from the
     action routines.  */
  YYSTYPE yyval;


  /* When reducing, the number of symbols on the RHS of the reduced
     rule.  */
  int yylen;

  YYDPRINTF ((stderr, "Starting parse\n"));

  yystate = 0;
  yyerrstatus = 0;
  yynerrs = 0;
  yychar = YYEMPTY;		/* Cause a token to be read.  */

  /* Initialize stack pointers.
     Waste one element of value and location stack
     so that they stay on the same level as the state stack.
     The wasted elements are never initialized.  */

  yyssp = yyss;
  yyvsp = yyvs;

  goto yysetstate;

/*------------------------------------------------------------.
| yynewstate -- Push a new state, which is found in yystate.  |
`------------------------------------------------------------*/
 yynewstate:
  /* In all cases, when you get here, the value and location stacks
     have just been pushed. so pushing a state here evens the stacks.
     */
  yyssp++;

 yysetstate:
  *yyssp = yystate;

  if (yyss + yystacksize - 1 <= yyssp)
    {
      /* Get the current used size of the three stacks, in elements.  */
      YYSIZE_T yysize = yyssp - yyss + 1;

#ifdef yyoverflow
      {
	/* Give user a chance to reallocate the stack. Use copies of
	   these so that the &'s don't force the real ones into
	   memory.  */
	YYSTYPE *yyvs1 = yyvs;
	short *yyss1 = yyss;


	/* Each stack pointer address is followed by the size of the
	   data in use in that stack, in bytes.  This used to be a
	   conditional around just the two extra args, but that might
	   be undefined if yyoverflow is a macro.  */
	yyoverflow ("parser stack overflow",
		    &yyss1, yysize * sizeof (*yyssp),
		    &yyvs1, yysize * sizeof (*yyvsp),

		    &yystacksize);

	yyss = yyss1;
	yyvs = yyvs1;
      }
#else /* no yyoverflow */
# ifndef YYSTACK_RELOCATE
      goto yyoverflowlab;
# else
      /* Extend the stack our own way.  */
      if (YYMAXDEPTH <= yystacksize)
	goto yyoverflowlab;
      yystacksize *= 2;
      if (YYMAXDEPTH < yystacksize)
	yystacksize = YYMAXDEPTH;

      {
	short *yyss1 = yyss;
	union yyalloc *yyptr =
	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
	if (! yyptr)
	  goto yyoverflowlab;
	YYSTACK_RELOCATE (yyss);
	YYSTACK_RELOCATE (yyvs);

#  undef YYSTACK_RELOCATE
	if (yyss1 != yyssa)
	  YYSTACK_FREE (yyss1);
      }
# endif
#endif /* no yyoverflow */

      yyssp = yyss + yysize - 1;
      yyvsp = yyvs + yysize - 1;


      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
		  (unsigned long int) yystacksize));

      if (yyss + yystacksize - 1 <= yyssp)
	YYABORT;
    }

  YYDPRINTF ((stderr, "Entering state %d\n", yystate));

  goto yybackup;

/*-----------.
| yybackup.  |
`-----------*/
yybackup:

/* Do appropriate processing given the current state.  */
/* Read a lookahead token if we need one and don't already have one.  */
/* yyresume: */

  /* First try to decide what to do without reference to lookahead token.  */

  yyn = yypact[yystate];
  if (yyn == YYPACT_NINF)
    goto yydefault;

  /* Not known => get a lookahead token if don't already have one.  */

  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
  if (yychar == YYEMPTY)
    {
      YYDPRINTF ((stderr, "Reading a token: "));
      yychar = YYLEX;
    }

  if (yychar <= YYEOF)
    {
      yychar = yytoken = YYEOF;
      YYDPRINTF ((stderr, "Now at end of input.\n"));
    }
  else
    {
      yytoken = YYTRANSLATE (yychar);
      YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
    }

  /* If the proper action on seeing token YYTOKEN is to reduce or to
     detect an error, take that action.  */
  yyn += yytoken;
  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
    goto yydefault;
  yyn = yytable[yyn];
  if (yyn <= 0)
    {
      if (yyn == 0 || yyn == YYTABLE_NINF)
	goto yyerrlab;
      yyn = -yyn;
      goto yyreduce;
    }

  if (yyn == YYFINAL)
    YYACCEPT;

  /* Shift the lookahead token.  */
  YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));

  /* Discard the token being shifted unless it is eof.  */
  if (yychar != YYEOF)
    yychar = YYEMPTY;

  *++yyvsp = yylval;


  /* Count tokens shifted since error; after three, turn off error
     status.  */
  if (yyerrstatus)
    yyerrstatus--;

  yystate = yyn;
  goto yynewstate;


/*-----------------------------------------------------------.
| yydefault -- do the default action for the current state.  |
`-----------------------------------------------------------*/
yydefault:
  yyn = yydefact[yystate];
  if (yyn == 0)
    goto yyerrlab;
  goto yyreduce;


/*-----------------------------.
| yyreduce -- Do a reduction.  |
`-----------------------------*/
yyreduce:
  /* yyn is the number of a rule to reduce with.  */
  yylen = yyr2[yyn];

  /* If YYLEN is nonzero, implement the default value of the action:
     `$$ = $1'.

     Otherwise, the following line sets YYVAL to garbage.
     This behavior is undocumented and Bison
     users should not rely upon it.  Assigning to YYVAL
     unconditionally makes the parser a bit smaller, and it avoids a
     GCC warning that YYVAL may be used uninitialized.  */
  yyval = yyvsp[1-yylen];


  YY_REDUCE_PRINT (yyn);
  switch (yyn)
    {
        case 2:
#line 210 "itex2MML.y"
    {/* all processing done in body*/}
    break;

  case 3:
#line 213 "itex2MML.y"
    {/* nothing - do nothing*/}
    break;

  case 4:
#line 214 "itex2MML.y"
    {/* proc done in body*/}
    break;

  case 5:
#line 215 "itex2MML.y"
    {/* all proc. in body*/}
    break;

  case 6:
#line 216 "itex2MML.y"
    {/* all proc. in body*/}
    break;

  case 7:
#line 217 "itex2MML.y"
    {/* all proc. in body*/}
    break;

  case 8:
#line 219 "itex2MML.y"
    {printf("%s", yyvsp[0]);}
    break;

  case 9:
#line 221 "itex2MML.y"
    {/* empty math group - ignore*/}
    break;

  case 10:
#line 222 "itex2MML.y"
    {/* ditto */}
    break;

  case 11:
#line 223 "itex2MML.y"
    {
  char ** r = (char **) ret_str;
  char * s = itex2MML_copy3("<math xmlns='http://www.w3.org/1998/Math/MathML' display='inline'>", yyvsp[-1], "</math>");
  itex2MML_free_string(yyvsp[-1]);
  if (r) {
    (*r) = (s == itex2MML_empty_string) ? 0 : s;
  }
  else {
    if (itex2MML_write_mathml)
      (*itex2MML_write_mathml) (s);
    itex2MML_free_string(s);
  }
}
    break;

  case 12:
#line 236 "itex2MML.y"
    {
  char ** r = (char **) ret_str;
  char * s = itex2MML_copy3("<math xmlns='http://www.w3.org/1998/Math/MathML' display='block'>", yyvsp[-1], "</math>");
  itex2MML_free_string(yyvsp[-1]);
  if (r) {
    (*r) = (s == itex2MML_empty_string) ? 0 : s;
  }
  else {
    if (itex2MML_write_mathml)
      (*itex2MML_write_mathml) (s);
    itex2MML_free_string(s);
  }
}
    break;

  case 13:
#line 250 "itex2MML.y"
    {
  yyval = itex2MML_copy_string(yyvsp[0]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 14:
#line 254 "itex2MML.y"
    {
  yyval = itex2MML_copy2(yyvsp[-1], yyvsp[0]);
  itex2MML_free_string(yyvsp[-1]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 16:
#line 261 "itex2MML.y"
    {
  if (itex2MML_displaymode == 1) {
    char * s1 = itex2MML_copy3("<munderover>", yyvsp[-4], " ");
    char * s2 = itex2MML_copy3(yyvsp[-2], " ", yyvsp[0]);
    yyval = itex2MML_copy3(s1, s2, "</munderover>");
    itex2MML_free_string(s1);
    itex2MML_free_string(s2);
  }
  else {
    char * s1 = itex2MML_copy3("<msubsup>", yyvsp[-4], " ");
    char * s2 = itex2MML_copy3(yyvsp[-2], " ", yyvsp[0]);
    yyval = itex2MML_copy3(s1, s2, "</msubsup>");
    itex2MML_free_string(s1);
    itex2MML_free_string(s2);
  }
  itex2MML_free_string(yyvsp[-4]);
  itex2MML_free_string(yyvsp[-2]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 17:
#line 280 "itex2MML.y"
    {
  if (itex2MML_displaymode == 1) {
    char * s1 = itex2MML_copy3("<munder>", yyvsp[-2], " ");
    yyval = itex2MML_copy3(s1, yyvsp[0], "</munder>");
    itex2MML_free_string(s1);
  }
  else {
    char * s1 = itex2MML_copy3("<msub>", yyvsp[-2], " ");
    yyval = itex2MML_copy3(s1, yyvsp[0], "</msub>");
    itex2MML_free_string(s1);
  }
  itex2MML_free_string(yyvsp[-2]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 18:
#line 294 "itex2MML.y"
    {
  if (itex2MML_displaymode == 1) {
    char * s1 = itex2MML_copy3("<munderover>", yyvsp[-4], " ");
    char * s2 = itex2MML_copy3(yyvsp[0], " ", yyvsp[-2]);
    yyval = itex2MML_copy3(s1, s2, "</munderover>");
    itex2MML_free_string(s1);
    itex2MML_free_string(s2);
  }
  else {
    char * s1 = itex2MML_copy3("<msubsup>", yyvsp[-4], " ");
    char * s2 = itex2MML_copy3(yyvsp[0], " ", yyvsp[-2]);
    yyval = itex2MML_copy3(s1, s2, "</msubsup>");
    itex2MML_free_string(s1);
    itex2MML_free_string(s2);
  }
  itex2MML_free_string(yyvsp[-4]);
  itex2MML_free_string(yyvsp[-2]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 19:
#line 313 "itex2MML.y"
    {
  if (itex2MML_displaymode == 1) {
    char * s1 = itex2MML_copy3("<mover>", yyvsp[-2], " ");
    yyval = itex2MML_copy3(s1, yyvsp[0], "</mover>");
    itex2MML_free_string(s1);
  }
  else {
    char * s1 = itex2MML_copy3("<msup>", yyvsp[-2], " ");
    yyval = itex2MML_copy3(s1, yyvsp[0], "</msup>");
    itex2MML_free_string(s1);
  }
  itex2MML_free_string(yyvsp[-2]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 20:
#line 327 "itex2MML.y"
    {
  if (itex2MML_displaymode == 1) {
    char * s1 = itex2MML_copy3("<munderover>", yyvsp[-4], " ");
    char * s2 = itex2MML_copy3(yyvsp[-2], " ", yyvsp[0]);
    yyval = itex2MML_copy3(s1, s2, "</munderover>");
    itex2MML_free_string(s1);
    itex2MML_free_string(s2);
  }
  else {
    char * s1 = itex2MML_copy3("<msubsup>", yyvsp[-4], " ");
    char * s2 = itex2MML_copy3(yyvsp[-2], " ", yyvsp[0]);
    yyval = itex2MML_copy3(s1, s2, "</msubsup>");
    itex2MML_free_string(s1);
    itex2MML_free_string(s2);
  }
  itex2MML_free_string(yyvsp[-4]);
  itex2MML_free_string(yyvsp[-2]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 21:
#line 346 "itex2MML.y"
    {
  if (itex2MML_displaymode == 1) {
    char * s1 = itex2MML_copy3("<munder>", yyvsp[-2], " ");
    yyval = itex2MML_copy3(s1, yyvsp[0], "</munder>");
    itex2MML_free_string(s1);
  }
  else {
    char * s1 = itex2MML_copy3("<msub>", yyvsp[-2], " ");
    yyval = itex2MML_copy3(s1, yyvsp[0], "</msub>");
    itex2MML_free_string(s1);
  }
  itex2MML_free_string(yyvsp[-2]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 22:
#line 360 "itex2MML.y"
    {
  if (itex2MML_displaymode == 1) {
    char * s1 = itex2MML_copy3("<munderover>", yyvsp[-4], " ");
    char * s2 = itex2MML_copy3(yyvsp[0], " ", yyvsp[-2]);
    yyval = itex2MML_copy3(s1, s2, "</munderover>");
    itex2MML_free_string(s1);
    itex2MML_free_string(s2);
  }
  else {
    char * s1 = itex2MML_copy3("<msubsup>", yyvsp[-4], " ");
    char * s2 = itex2MML_copy3(yyvsp[0], " ", yyvsp[-2]);
    yyval = itex2MML_copy3(s1, s2, "</msubsup>");
    itex2MML_free_string(s1);
    itex2MML_free_string(s2);
  }
  itex2MML_free_string(yyvsp[-4]);
  itex2MML_free_string(yyvsp[-2]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 23:
#line 379 "itex2MML.y"
    {
  if (itex2MML_displaymode == 1) {
    char * s1 = itex2MML_copy3("<mover>", yyvsp[-2], " ");
    yyval = itex2MML_copy3(s1, yyvsp[0], "</mover>");
    itex2MML_free_string(s1);
  }
  else {
    char * s1 = itex2MML_copy3("<msup>", yyvsp[-2], " ");
    yyval = itex2MML_copy3(s1, yyvsp[0], "</msup>");
    itex2MML_free_string(s1);
  }
  itex2MML_free_string(yyvsp[-2]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 24:
#line 393 "itex2MML.y"
    {
  char * s1 = itex2MML_copy3("<msubsup>", yyvsp[-4], " ");
  char * s2 = itex2MML_copy3(yyvsp[-2], " ", yyvsp[0]);
  yyval = itex2MML_copy3(s1, s2, "</msubsup>");
  itex2MML_free_string(s1);
  itex2MML_free_string(s2);
  itex2MML_free_string(yyvsp[-4]);
  itex2MML_free_string(yyvsp[-2]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 25:
#line 403 "itex2MML.y"
    {
  char * s1 = itex2MML_copy3("<msubsup>", yyvsp[-4], " ");
  char * s2 = itex2MML_copy3(yyvsp[0], " ", yyvsp[-2]);
  yyval = itex2MML_copy3(s1, s2, "</msubsup>");
  itex2MML_free_string(s1);
  itex2MML_free_string(s2);
  itex2MML_free_string(yyvsp[-4]);
  itex2MML_free_string(yyvsp[-2]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 26:
#line 413 "itex2MML.y"
    {
  char * s1 = itex2MML_copy3("<msub>", yyvsp[-2], " ");
  yyval = itex2MML_copy3(s1, yyvsp[0], "</msub>");
  itex2MML_free_string(s1);
  itex2MML_free_string(yyvsp[-2]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 27:
#line 420 "itex2MML.y"
    {
  char * s1 = itex2MML_copy3("<msup>", yyvsp[-2], " ");
  yyval = itex2MML_copy3(s1, yyvsp[0], "</msup>");
  itex2MML_free_string(s1);
  itex2MML_free_string(yyvsp[-2]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 28:
#line 427 "itex2MML.y"
    {
  yyval = itex2MML_copy3("<msub><mo></mo>", yyvsp[0], "</msub>");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 29:
#line 431 "itex2MML.y"
    {
  yyval = itex2MML_copy3("<msup><mo></mo>", yyvsp[0], "</msup>");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 30:
#line 435 "itex2MML.y"
    {
  yyval = itex2MML_copy_string(yyvsp[0]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 35:
#line 444 "itex2MML.y"
    {
  yyval = itex2MML_copy3("<mi>", yyvsp[0], "</mi>");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 36:
#line 448 "itex2MML.y"
    {
  yyval = itex2MML_copy3("<mn>", yyvsp[0], "</mn>");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 82:
#line 497 "itex2MML.y"
    {
  yyval = itex2MML_copy3("<mrow>", yyvsp[-1], "</mrow>");
  itex2MML_free_string(yyvsp[-1]);
}
    break;

  case 83:
#line 501 "itex2MML.y"
    {
  char * s1 = itex2MML_copy3("<mrow>", yyvsp[-2], yyvsp[-1]);
  yyval = itex2MML_copy3(s1, yyvsp[0], "</mrow>");
  itex2MML_free_string(s1);
  itex2MML_free_string(yyvsp[-2]);
  itex2MML_free_string(yyvsp[-1]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 85:
#line 511 "itex2MML.y"
    {
  itex2MML_rowposn = 2;
  yyval = itex2MML_copy3("<mo>", yyvsp[0], "</mo>");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 86:
#line 516 "itex2MML.y"
    {
  itex2MML_rowposn = 2;
  yyval = itex2MML_copy3("<mo>", yyvsp[0], "</mo>");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 87:
#line 521 "itex2MML.y"
    {
  itex2MML_rowposn = 2;
  yyval = itex2MML_copy_string("");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 88:
#line 527 "itex2MML.y"
    {
  yyval = itex2MML_copy3("<mo>", yyvsp[0], "</mo>");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 89:
#line 531 "itex2MML.y"
    {
  yyval = itex2MML_copy3("<mo>", yyvsp[0], "</mo>");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 90:
#line 535 "itex2MML.y"
    {
  yyval = itex2MML_copy_string("");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 91:
#line 540 "itex2MML.y"
    {
  yyval = itex2MML_copy_string("<merror><mtext>Unknown character</mtext></merror>");
}
    break;

  case 92:
#line 544 "itex2MML.y"
    {
  yyval = itex2MML_copy_string("<mo lspace=\"verythinmathspace\" rspace=\"0em\">&minus;</mo>");
}
    break;

  case 93:
#line 548 "itex2MML.y"
    {
  yyval = itex2MML_copy_string("<mo lspace=\"verythinmathspace\" rspace=\"0em\">+</mo>");
}
    break;

  case 95:
#line 554 "itex2MML.y"
    {
  itex2MML_rowposn=2;
  yyval = itex2MML_copy3("<mi>", yyvsp[0], "</mi>");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 97:
#line 562 "itex2MML.y"
    {
  itex2MML_rowposn = 2;
  yyval = itex2MML_copy3("<mo lspace=\"thinmathspace\" rspace=\"thinmathspace\">", yyvsp[0], "</mo>");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 99:
#line 569 "itex2MML.y"
    {
  itex2MML_rowposn = 2;
  yyval = itex2MML_copy3("<mo>", yyvsp[0], "</mo>");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 100:
#line 574 "itex2MML.y"
    {
  itex2MML_rowposn = 2;
  yyval = itex2MML_copy3("<mo>", yyvsp[0], "</mo>");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 101:
#line 579 "itex2MML.y"
    {
  yyval = itex2MML_copy3("<mo stretchy=\"false\">", yyvsp[0], "</mo>");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 102:
#line 583 "itex2MML.y"
    {
  itex2MML_rowposn = 2;
  yyval = itex2MML_copy3("<mo stretchy=\"false\">", yyvsp[0], "</mo>");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 103:
#line 588 "itex2MML.y"
    {
  yyval = itex2MML_copy3("<mo>", yyvsp[0], "</mo>");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 104:
#line 592 "itex2MML.y"
    {
  yyval = itex2MML_copy3("<mo>", yyvsp[0], "</mo>");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 105:
#line 596 "itex2MML.y"
    {
  itex2MML_rowposn=2;
  yyval = itex2MML_copy3("<mo lspace=\"mediummathspace\" rspace=\"mediummathspace\">", yyvsp[0], "</mo>");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 106:
#line 601 "itex2MML.y"
    {
  itex2MML_rowposn = 2;
  yyval = itex2MML_copy3("<mo lspace=\"0em\" rspace=\"thinmathspace\">", yyvsp[0], "</mo>");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 107:
#line 606 "itex2MML.y"
    {
  itex2MML_rowposn = 2;
  yyval = itex2MML_copy3("<mo lspace=\"0em\" rspace=\"thinmathspace\">", yyvsp[0], "</mo>");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 108:
#line 612 "itex2MML.y"
    {
  yyval = itex2MML_copy_string("<mrow></mrow>");
}
    break;

  case 109:
#line 616 "itex2MML.y"
    {
  char * s1 = itex2MML_copy3("<mspace height=\"", yyvsp[-7], "ex\" depth=\"");
  char * s2 = itex2MML_copy3(yyvsp[-4], "ex\" width=\"", yyvsp[-1]);
  yyval = itex2MML_copy3(s1, s2, "em\"/>");
  itex2MML_free_string(s1);
  itex2MML_free_string(s2);
  itex2MML_free_string(yyvsp[-7]);
  itex2MML_free_string(yyvsp[-4]);
  itex2MML_free_string(yyvsp[-1]);
}
    break;

  case 110:
#line 627 "itex2MML.y"
    {
  char * s1 = itex2MML_copy3("<maction actiontype=\"statusline\">", yyvsp[0], "<mtext>");
  yyval = itex2MML_copy3(s1, yyvsp[-1], "</mtext></maction>");
  itex2MML_free_string(s1);
  itex2MML_free_string(yyvsp[-1]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 111:
#line 635 "itex2MML.y"
    {
  char * s1 = itex2MML_copy3("<maction actiontype=\"toggle\" selection=\"2\">", yyvsp[-3], " ");
  yyval = itex2MML_copy3(s1, yyvsp[-2], "</maction>");
  itex2MML_free_string(s1);
  itex2MML_free_string(yyvsp[-3]);
  itex2MML_free_string(yyvsp[-2]);
  itex2MML_free_string(yyvsp[-1]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 112:
#line 645 "itex2MML.y"
    {
  char * s1 = itex2MML_copy3("<maction actiontype=\"highlight\" other='color=", yyvsp[-1], "'>");
  yyval = itex2MML_copy3(s1, yyvsp[0], "</maction>");
  itex2MML_free_string(s1);
  itex2MML_free_string(yyvsp[-1]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 113:
#line 653 "itex2MML.y"
    {
  char * s1 = itex2MML_copy3("<maction actiontype=\"highlight\" other='background=", yyvsp[-1], "'>");
  yyval = itex2MML_copy3(s1, yyvsp[0], "</maction>");
  itex2MML_free_string(s1);
  itex2MML_free_string(yyvsp[-1]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 114:
#line 661 "itex2MML.y"
    {
  yyval = itex2MML_copy3("<mtext>", yyvsp[0], "</mtext>");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 115:
#line 666 "itex2MML.y"
    {
  yyval = itex2MML_copy3("<mstyle displaystyle=\"true\">", yyvsp[0], "</mstyle>");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 116:
#line 671 "itex2MML.y"
    {
  yyval = itex2MML_copy3("<mstyle displaystyle=\"false\">", yyvsp[0], "</mstyle>");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 117:
#line 676 "itex2MML.y"
    {
  yyval = itex2MML_copy3("<mstyle scriptlevel=\"0\">", yyvsp[0], "</mstyle>");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 118:
#line 681 "itex2MML.y"
    {
  yyval = itex2MML_copy3("<mstyle scriptlevel=\"1\">", yyvsp[0], "</mstyle>");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 119:
#line 686 "itex2MML.y"
    {
  yyval = itex2MML_copy3("<mstyle scriptlevel=\"2\">", yyvsp[0], "</mstyle>");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 120:
#line 691 "itex2MML.y"
    {
  yyval = itex2MML_copy3("<mstyle fontstyle=\"italic\">", yyvsp[0], "</mstyle>");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 121:
#line 696 "itex2MML.y"
    {
  yyval = itex2MML_copy3("<mstyle fontweight=\"bold\">", yyvsp[0], "</mstyle>");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 122:
#line 701 "itex2MML.y"
    {
  yyval = itex2MML_copy3("<mstyle fontstyle=\"normal\" fontweight=\"normal\">", yyvsp[0], "</mstyle>");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 123:
#line 706 "itex2MML.y"
    {
  yyval = itex2MML_copy3("<mi>", yyvsp[-1], "</mi>");
  itex2MML_free_string(yyvsp[-1]);
}
    break;

  case 124:
#line 711 "itex2MML.y"
    {
  yyval = itex2MML_copy_string(yyvsp[0]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 125:
#line 715 "itex2MML.y"
    {
  yyval = itex2MML_copy2(yyvsp[-1], yyvsp[0]);
  itex2MML_free_string(yyvsp[-1]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 126:
#line 721 "itex2MML.y"
    {
  yyval = itex2MML_copy_string(yyvsp[0]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 127:
#line 725 "itex2MML.y"
    {
  yyval = itex2MML_copy3("&", yyvsp[0], "opf;");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 128:
#line 730 "itex2MML.y"
    {
  yyval = itex2MML_copy3("<mi>", yyvsp[-1], "</mi>");
  itex2MML_free_string(yyvsp[-1]);
}
    break;

  case 129:
#line 735 "itex2MML.y"
    {
  yyval = itex2MML_copy_string(yyvsp[0]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 130:
#line 739 "itex2MML.y"
    {
  yyval = itex2MML_copy2(yyvsp[-1], yyvsp[0]);
  itex2MML_free_string(yyvsp[-1]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 131:
#line 745 "itex2MML.y"
    {
  yyval = itex2MML_copy3("&", yyvsp[0], "fr;");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 132:
#line 750 "itex2MML.y"
    {
  yyval = itex2MML_copy3("<mi>", yyvsp[-1], "</mi>");
  itex2MML_free_string(yyvsp[-1]);
}
    break;

  case 133:
#line 755 "itex2MML.y"
    {
  yyval = itex2MML_copy_string(yyvsp[0]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 134:
#line 759 "itex2MML.y"
    {
  yyval = itex2MML_copy2(yyvsp[-1], yyvsp[0]);
  itex2MML_free_string(yyvsp[-1]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 135:
#line 765 "itex2MML.y"
    {
  yyval = itex2MML_copy3("&", yyvsp[0], "scr;");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 136:
#line 770 "itex2MML.y"
    {
  yyval = itex2MML_copy_string("<mspace width=\"thinmathspace\"/>");
}
    break;

  case 137:
#line 774 "itex2MML.y"
    {
  yyval = itex2MML_copy_string("<mspace width=\"mediummathspace\"/>");
}
    break;

  case 138:
#line 778 "itex2MML.y"
    {
  yyval = itex2MML_copy_string("<mspace width=\"thickmathspace\"/>");
}
    break;

  case 139:
#line 782 "itex2MML.y"
    {
  yyval = itex2MML_copy_string("<mspace width=\"1em\"/>");
}
    break;

  case 140:
#line 786 "itex2MML.y"
    {
  yyval = itex2MML_copy_string("<mspace width=\"2em\"/>");
}
    break;

  case 141:
#line 790 "itex2MML.y"
    {
  yyval = itex2MML_copy_string("<mspace width=\"-0.1667 em\"/>");
}
    break;

  case 142:
#line 794 "itex2MML.y"
    {
  yyval = itex2MML_copy3("<mphantom>", yyvsp[0], "</mphantom>");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 143:
#line 799 "itex2MML.y"
    {
  char * s1 = itex2MML_copy3("<mrow xlink:type=\"simple\" xlink:show=\"replace\" xlink:href=\"", yyvsp[-1], "\">");
  yyval = itex2MML_copy3(s1, yyvsp[0], "</mrow>");
  itex2MML_free_string(s1);
  itex2MML_free_string(yyvsp[-1]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 144:
#line 807 "itex2MML.y"
    {
  char * s1 = itex2MML_copy3("<mmultiscripts>", yyvsp[-3], yyvsp[-1]);
  yyval = itex2MML_copy2(s1, "</mmultiscripts>");
  itex2MML_free_string(s1);
  itex2MML_free_string(yyvsp[-3]);
  itex2MML_free_string(yyvsp[-1]);
}
    break;

  case 145:
#line 814 "itex2MML.y"
    {
  char * s1 = itex2MML_copy3("<mmultiscripts>", yyvsp[-2], yyvsp[-1]);
  yyval = itex2MML_copy2(s1, "</mmultiscripts>");
  itex2MML_free_string(s1);
  itex2MML_free_string(yyvsp[-2]);
  itex2MML_free_string(yyvsp[-1]);
}
    break;

  case 146:
#line 821 "itex2MML.y"
    {
  char * s1 = itex2MML_copy3("<mmultiscripts>", yyvsp[-1], yyvsp[0]);
  yyval = itex2MML_copy2(s1, "</mmultiscripts>");
  itex2MML_free_string(s1);
  itex2MML_free_string(yyvsp[-1]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 147:
#line 829 "itex2MML.y"
    {
  char * s1 = itex2MML_copy3("<mmultiscripts>", yyvsp[-3], yyvsp[-1]);
  char * s2 = itex2MML_copy3("<mprescripts/>", yyvsp[-5], "</mmultiscripts>");
  yyval = itex2MML_copy2(s1, s2);
  itex2MML_free_string(s1);
  itex2MML_free_string(s2);
  itex2MML_free_string(yyvsp[-5]);
  itex2MML_free_string(yyvsp[-3]);
  itex2MML_free_string(yyvsp[-1]);
}
    break;

  case 148:
#line 840 "itex2MML.y"
    {
  yyval = itex2MML_copy_string(yyvsp[0]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 149:
#line 844 "itex2MML.y"
    {
  yyval = itex2MML_copy3(yyvsp[-1], " ", yyvsp[0]);
  itex2MML_free_string(yyvsp[-1]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 150:
#line 850 "itex2MML.y"
    {
  yyval = itex2MML_copy3(yyvsp[-2], " ", yyvsp[0]);
  itex2MML_free_string(yyvsp[-2]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 151:
#line 855 "itex2MML.y"
    {
  yyval = itex2MML_copy2(yyvsp[0], " <none/>");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 152:
#line 859 "itex2MML.y"
    {
  yyval = itex2MML_copy2("<none/> ", yyvsp[0]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 153:
#line 864 "itex2MML.y"
    {
  char * s1 = itex2MML_copy3("<mfrac>", yyvsp[-1], yyvsp[0]);
  yyval = itex2MML_copy2(s1, "</mfrac>");
  itex2MML_free_string(s1);
  itex2MML_free_string(yyvsp[-1]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 154:
#line 872 "itex2MML.y"
    {
  char * s1 = itex2MML_copy3("<mfrac><mrow>", yyvsp[-2], "</mrow><mrow>");
  yyval = itex2MML_copy3(s1, yyvsp[0], "</mrow></mfrac>");
  itex2MML_free_string(s1);
  itex2MML_free_string(yyvsp[-2]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 155:
#line 880 "itex2MML.y"
    {
  char * s1 = itex2MML_copy3("<mfrac linethickness=\"0\">", yyvsp[-1], yyvsp[0]);
  yyval = itex2MML_copy2(s1, "</mfrac>");
  itex2MML_free_string(s1);
  itex2MML_free_string(yyvsp[-1]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 156:
#line 888 "itex2MML.y"
    {
  yyval = itex2MML_copy3("<munder>", yyvsp[0], "<mo>&UnderBrace;</mo></munder>");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 157:
#line 893 "itex2MML.y"
    {
  yyval = itex2MML_copy3("<mover>", yyvsp[0], "<mo>&OverBrace;</mo></mover>");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 158:
#line 898 "itex2MML.y"
    {
  yyval = itex2MML_copy3("<mover>", yyvsp[0], "<mo>&OverBar;</mo></mover>");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 159:
#line 903 "itex2MML.y"
    {
  yyval = itex2MML_copy3("<mover>", yyvsp[0], "<mo>&RightVector;</mo></mover>");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 160:
#line 908 "itex2MML.y"
    {
  yyval = itex2MML_copy3("<mover>", yyvsp[0], "<mo>&dot;</mo></mover>");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 161:
#line 913 "itex2MML.y"
    {
  yyval = itex2MML_copy3("<mover>", yyvsp[0], "<mo>&Dot;</mo></mover>");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 162:
#line 918 "itex2MML.y"
    {
  yyval = itex2MML_copy3("<mover>", yyvsp[0], "<mo>&tilde;</mo></mover>");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 163:
#line 923 "itex2MML.y"
    {
  yyval = itex2MML_copy3("<mover>", yyvsp[0], "<mo>&macr;</mo></mover>");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 164:
#line 928 "itex2MML.y"
    {
  yyval = itex2MML_copy3("<mover>", yyvsp[0], "<mo>&Hat;</mo></mover>");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 165:
#line 933 "itex2MML.y"
    {
  yyval = itex2MML_copy3("<msqrt>", yyvsp[0], "</msqrt>");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 166:
#line 938 "itex2MML.y"
    {
  char * s1 = itex2MML_copy3("<mroot>", yyvsp[0], yyvsp[-1]);
  yyval = itex2MML_copy2(s1, "</mroot>");
  itex2MML_free_string(s1);
  itex2MML_free_string(yyvsp[-1]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 167:
#line 946 "itex2MML.y"
    {
  char * s1 = itex2MML_copy3("<munder>", yyvsp[0], yyvsp[-1]);
  yyval = itex2MML_copy2(s1, "</munder>");
  itex2MML_free_string(s1);
  itex2MML_free_string(yyvsp[-1]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 168:
#line 954 "itex2MML.y"
    {
  char * s1 = itex2MML_copy3("<mover>", yyvsp[0], yyvsp[-1]);
  yyval = itex2MML_copy2(s1, "</mover>");
  itex2MML_free_string(s1);
  itex2MML_free_string(yyvsp[-1]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 169:
#line 962 "itex2MML.y"
    {
  char * s1 = itex2MML_copy3("<munderover>", yyvsp[0], yyvsp[-2]);
  yyval = itex2MML_copy3(s1, yyvsp[-1], "</munderover>");
  itex2MML_free_string(s1);
  itex2MML_free_string(yyvsp[-2]);
  itex2MML_free_string(yyvsp[-1]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 170:
#line 971 "itex2MML.y"
    {
  yyval = itex2MML_copy3("<mrow><mtable>", yyvsp[-1], "</mtable></mrow>");
  itex2MML_free_string(yyvsp[-1]);
}
    break;

  case 171:
#line 975 "itex2MML.y"
    {
  char * s1 = itex2MML_copy3("<mrow><mtable ", yyvsp[-3], ">");
  yyval = itex2MML_copy3(s1, yyvsp[-1], "</mtable></mrow>");
  itex2MML_free_string(s1);
  itex2MML_free_string(yyvsp[-3]);
  itex2MML_free_string(yyvsp[-1]);
}
    break;

  case 172:
#line 983 "itex2MML.y"
    {
  yyval = itex2MML_copy_string(yyvsp[0]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 173:
#line 987 "itex2MML.y"
    {
  yyval = itex2MML_copy3(yyvsp[-1], " ", yyvsp[0]);
  itex2MML_free_string(yyvsp[-1]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 174:
#line 993 "itex2MML.y"
    {
  yyval = itex2MML_copy_string(yyvsp[0]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 175:
#line 997 "itex2MML.y"
    {
  yyval = itex2MML_copy_string(yyvsp[0]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 176:
#line 1001 "itex2MML.y"
    {
  yyval = itex2MML_copy_string(yyvsp[0]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 177:
#line 1005 "itex2MML.y"
    {
  yyval = itex2MML_copy_string(yyvsp[0]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 178:
#line 1009 "itex2MML.y"
    {
  yyval = itex2MML_copy_string(yyvsp[0]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 179:
#line 1013 "itex2MML.y"
    {
  yyval = itex2MML_copy_string(yyvsp[0]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 180:
#line 1017 "itex2MML.y"
    {
  yyval = itex2MML_copy_string(yyvsp[0]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 181:
#line 1021 "itex2MML.y"
    {
  yyval = itex2MML_copy_string(yyvsp[0]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 182:
#line 1025 "itex2MML.y"
    {
  yyval = itex2MML_copy_string(yyvsp[0]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 183:
#line 1029 "itex2MML.y"
    {
  yyval = itex2MML_copy_string(yyvsp[0]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 184:
#line 1034 "itex2MML.y"
    {
  yyval = itex2MML_copy2("columnalign=", yyvsp[0]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 185:
#line 1039 "itex2MML.y"
    {
  yyval = itex2MML_copy2("columnalign=", yyvsp[0]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 186:
#line 1044 "itex2MML.y"
    {
  yyval = itex2MML_copy2("rowalign=", yyvsp[0]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 187:
#line 1049 "itex2MML.y"
    {
  yyval = itex2MML_copy2("align=", yyvsp[0]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 188:
#line 1054 "itex2MML.y"
    {
  yyval = itex2MML_copy2("equalrows=", yyvsp[0]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 189:
#line 1059 "itex2MML.y"
    {
  yyval = itex2MML_copy2("equalcolumns=", yyvsp[0]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 190:
#line 1064 "itex2MML.y"
    {
  yyval = itex2MML_copy2("rowlines=", yyvsp[0]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 191:
#line 1069 "itex2MML.y"
    {
  yyval = itex2MML_copy2("columnlines=", yyvsp[0]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 192:
#line 1074 "itex2MML.y"
    {
  yyval = itex2MML_copy2("frame=", yyvsp[0]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 193:
#line 1079 "itex2MML.y"
    {
  char * s1 = itex2MML_copy3("rowspacing=", yyvsp[0], " columnspacing=");
  yyval = itex2MML_copy2(s1, yyvsp[0]);
  itex2MML_free_string(s1);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 194:
#line 1086 "itex2MML.y"
    {
  yyval = itex2MML_copy_string(yyvsp[0]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 195:
#line 1090 "itex2MML.y"
    {
  yyval = itex2MML_copy3(yyvsp[-2], " ", yyvsp[0]);
  itex2MML_free_string(yyvsp[-2]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 196:
#line 1096 "itex2MML.y"
    {
  yyval = itex2MML_copy3("<mtr>", yyvsp[0], "</mtr>");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 197:
#line 1100 "itex2MML.y"
    {
  yyval = itex2MML_copy_string(yyvsp[0]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 198:
#line 1105 "itex2MML.y"
    {
  yyval = itex2MML_copy_string(yyvsp[0]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 199:
#line 1109 "itex2MML.y"
    {
  yyval = itex2MML_copy3(yyvsp[-2], " ", yyvsp[0]);
  itex2MML_free_string(yyvsp[-2]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 200:
#line 1115 "itex2MML.y"
    {
  char * s1 = itex2MML_copy3("<mtr ", yyvsp[-2], ">");
  yyval = itex2MML_copy3(s1, yyvsp[0], "</mtr>");
  itex2MML_free_string(s1);
  itex2MML_free_string(yyvsp[-2]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 201:
#line 1123 "itex2MML.y"
    {
  yyval = itex2MML_copy_string(yyvsp[0]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 202:
#line 1127 "itex2MML.y"
    {
  yyval = itex2MML_copy3(yyvsp[-1], " ", yyvsp[0]);
  itex2MML_free_string(yyvsp[-1]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 203:
#line 1133 "itex2MML.y"
    {
  yyval = itex2MML_copy_string(yyvsp[0]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 204:
#line 1137 "itex2MML.y"
    {
  yyval = itex2MML_copy_string(yyvsp[0]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 205:
#line 1142 "itex2MML.y"
    {
  yyval = itex2MML_copy_string("<mtd></mtd>");
}
    break;

  case 206:
#line 1145 "itex2MML.y"
    {
  yyval = itex2MML_copy3("<mtd>", yyvsp[0], "</mtd>");
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 207:
#line 1149 "itex2MML.y"
    {
  char * s1 = itex2MML_copy3("<mtd ", yyvsp[-2], ">");
  yyval = itex2MML_copy3(s1, yyvsp[0], "</mtd>");
  itex2MML_free_string(s1);
  itex2MML_free_string(yyvsp[-2]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 208:
#line 1157 "itex2MML.y"
    {
  yyval = itex2MML_copy_string(yyvsp[0]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 209:
#line 1161 "itex2MML.y"
    {
  yyval = itex2MML_copy3(yyvsp[-1], " ", yyvsp[0]);
  itex2MML_free_string(yyvsp[-1]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 210:
#line 1167 "itex2MML.y"
    {
  yyval = itex2MML_copy_string(yyvsp[0]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 211:
#line 1171 "itex2MML.y"
    {
  yyval = itex2MML_copy_string(yyvsp[0]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 212:
#line 1175 "itex2MML.y"
    {
  yyval = itex2MML_copy_string(yyvsp[0]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 213:
#line 1179 "itex2MML.y"
    {
  yyval = itex2MML_copy_string(yyvsp[0]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 214:
#line 1184 "itex2MML.y"
    {
  yyval = itex2MML_copy2("rowspan=", yyvsp[0]);
  itex2MML_free_string(yyvsp[0]);
}
    break;

  case 215:
#line 1189 "itex2MML.y"
    {
  yyval = itex2MML_copy2("colspan=", yyvsp[0]);
  itex2MML_free_string(yyvsp[0]);
}
    break;


    }

/* Line 1000 of yacc.c.  */
#line 3484 "y.tab.c"

  yyvsp -= yylen;
  yyssp -= yylen;


  YY_STACK_PRINT (yyss, yyssp);

  *++yyvsp = yyval;


  /* Now `shift' the result of the reduction.  Determine what state
     that goes to, based on the state we popped back to and the rule
     number reduced by.  */

  yyn = yyr1[yyn];

  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
    yystate = yytable[yystate];
  else
    yystate = yydefgoto[yyn - YYNTOKENS];

  goto yynewstate;


/*------------------------------------.
| yyerrlab -- here on detecting error |
`------------------------------------*/
yyerrlab:
  /* If not already recovering from an error, report this error.  */
  if (!yyerrstatus)
    {
      ++yynerrs;
#if YYERROR_VERBOSE
      yyn = yypact[yystate];

      if (YYPACT_NINF < yyn && yyn < YYLAST)
	{
	  YYSIZE_T yysize = 0;
	  int yytype = YYTRANSLATE (yychar);
	  const char* yyprefix;
	  char *yymsg;
	  int yyx;

	  /* Start YYX at -YYN if negative to avoid negative indexes in
	     YYCHECK.  */
	  int yyxbegin = yyn < 0 ? -yyn : 0;

	  /* Stay within bounds of both yycheck and yytname.  */
	  int yychecklim = YYLAST - yyn;
	  int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
	  int yycount = 0;

	  yyprefix = ", expecting ";
	  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
	    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
	      {
		yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
		yycount += 1;
		if (yycount == 5)
		  {
		    yysize = 0;
		    break;
		  }
	      }
	  yysize += (sizeof ("syntax error, unexpected ")
		     + yystrlen (yytname[yytype]));
	  yymsg = (char *) YYSTACK_ALLOC (yysize);
	  if (yymsg != 0)
	    {
	      char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
	      yyp = yystpcpy (yyp, yytname[yytype]);

	      if (yycount < 5)
		{
		  yyprefix = ", expecting ";
		  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
		    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
		      {
			yyp = yystpcpy (yyp, yyprefix);
			yyp = yystpcpy (yyp, yytname[yyx]);
			yyprefix = " or ";
		      }
		}
	      yyerror (yymsg);
	      YYSTACK_FREE (yymsg);
	    }
	  else
	    yyerror ("syntax error; also virtual memory exhausted");
	}
      else
#endif /* YYERROR_VERBOSE */
	yyerror ("syntax error");
    }



  if (yyerrstatus == 3)
    {
      /* If just tried and failed to reuse lookahead token after an
	 error, discard it.  */

      if (yychar <= YYEOF)
        {
          /* If at end of input, pop the error token,
	     then the rest of the stack, then return failure.  */
	  if (yychar == YYEOF)
	     for (;;)
	       {
		 YYPOPSTACK;
		 if (yyssp == yyss)
		   YYABORT;
		 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
		 yydestruct (yystos[*yyssp], yyvsp);
	       }
        }
      else
	{
	  YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
	  yydestruct (yytoken, &yylval);
	  yychar = YYEMPTY;

	}
    }

  /* Else will try to reuse lookahead token after shifting the error
     token.  */
  goto yyerrlab1;


/*---------------------------------------------------.
| yyerrorlab -- error raised explicitly by YYERROR.  |
`---------------------------------------------------*/
yyerrorlab:

#ifdef __GNUC__
  /* Pacify GCC when the user code never invokes YYERROR and the label
     yyerrorlab therefore never appears in user code.  */
  if (0)
     goto yyerrorlab;
#endif

  yyvsp -= yylen;
  yyssp -= yylen;
  yystate = *yyssp;
  goto yyerrlab1;


/*-------------------------------------------------------------.
| yyerrlab1 -- common code for both syntax error and YYERROR.  |
`-------------------------------------------------------------*/
yyerrlab1:
  yyerrstatus = 3;	/* Each real token shifted decrements this.  */

  for (;;)
    {
      yyn = yypact[yystate];
      if (yyn != YYPACT_NINF)
	{
	  yyn += YYTERROR;
	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
	    {
	      yyn = yytable[yyn];
	      if (0 < yyn)
		break;
	    }
	}

      /* Pop the current state because it cannot handle the error token.  */
      if (yyssp == yyss)
	YYABORT;

      YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
      yydestruct (yystos[yystate], yyvsp);
      YYPOPSTACK;
      yystate = *yyssp;
      YY_STACK_PRINT (yyss, yyssp);
    }

  if (yyn == YYFINAL)
    YYACCEPT;

  YYDPRINTF ((stderr, "Shifting error token, "));

  *++yyvsp = yylval;


  yystate = yyn;
  goto yynewstate;


/*-------------------------------------.
| yyacceptlab -- YYACCEPT comes here.  |
`-------------------------------------*/
yyacceptlab:
  yyresult = 0;
  goto yyreturn;

/*-----------------------------------.
| yyabortlab -- YYABORT comes here.  |
`-----------------------------------*/
yyabortlab:
  yyresult = 1;
  goto yyreturn;

#ifndef yyoverflow
/*----------------------------------------------.
| yyoverflowlab -- parser overflow comes here.  |
`----------------------------------------------*/
yyoverflowlab:
  yyerror ("parser stack overflow");
  yyresult = 2;
  /* Fall through.  */
#endif

yyreturn:
#ifndef yyoverflow
  if (yyss != yyssa)
    YYSTACK_FREE (yyss);
#endif
  return yyresult;
}


#line 1194 "itex2MML.y"


char * itex2MML_parse (const char * buffer, unsigned long length)
{
  char * mathml = 0;

  int result;

  itex2MML_setup (buffer, length);
  itex2MML_restart ();

  result = itex2MML_yyparse (&mathml);

  if (result && mathml) /* shouldn't happen? */
    {
      itex2MML_free_string (mathml);
      mathml = 0;
    }
  return mathml;
}

int itex2MML_filter (const char * buffer, unsigned long length)
{
  itex2MML_setup (buffer, length);
  itex2MML_restart ();

  return itex2MML_yyparse (0);
}

#define ITEX_DELIMITER_DOLLAR 0
#define ITEX_DELIMITER_DOUBLE 1
#define ITEX_DELIMITER_SQUARE 2

static char * itex2MML_last_error = 0;

static void itex2MML_keep_error (const char * msg)
{
  if (itex2MML_last_error)
    {
      itex2MML_free_string (itex2MML_last_error);
      itex2MML_last_error = 0;
    }
  itex2MML_last_error = itex2MML_copy_escaped (msg);
}

int itex2MML_html_filter (const char * buffer, unsigned long length)
{
  int result = 0;

  int type = 0;
  int skip = 0;
  int match = 0;

  const char * ptr1 = buffer;
  const char * ptr2 = 0;

  const char * end = buffer + length;

  char * mathml = 0;

  void (*save_error_fn) (const char * msg) = itex2MML_error;

  itex2MML_error = itex2MML_keep_error;

 _until_math:
  ptr2 = ptr1;

  while (ptr2 < end)
    {
      if (*ptr2 == '$') break;
      if ((*ptr2 == '\\') && (ptr2 + 1 < end))
	{
	  if (*(ptr2+1) == '[') break;
	}
      ++ptr2;
    }
  if (itex2MML_write)
    (*itex2MML_write) (ptr1, ptr2 - ptr1);

  if (ptr2 == end) goto _finish;

 _until_html:
  ptr1 = ptr2;

  if (ptr2 + 1 < end)
    {
      if ((*ptr2 == '\\') && (*(ptr2+1) == '['))
	{
	  type = ITEX_DELIMITER_SQUARE;
	  ptr2 += 2;
	}
      else if ((*ptr2 == '$') && (*(ptr2+1) == '$'))
	{
	  type = ITEX_DELIMITER_DOUBLE;
	  ptr2 += 2;
	}
      else
	{
	  type = ITEX_DELIMITER_DOLLAR;
	  ptr2 += 2;
	}
    }
  else goto _finish;

  skip = 0;
  match = 0;

  while (ptr2 < end)
    {
      switch (*ptr2)
	{
	case '<':
	case '>':
	  skip = 1;
	  break;

	case '\\':
	  if (ptr2 + 1 < end)
	    {
	      if (*(ptr2 + 1) == '[')
		{
		  skip = 1;
		}
	      else if (*(ptr2 + 1) == ']')
		{
		  if (type == ITEX_DELIMITER_SQUARE)
		    {
		      ptr2 += 2;
		      match = 1;
		    }
		  else
		    {
		      skip = 1;
		    }
		}
	    }
	  break;

	case '$':
	  if (type == ITEX_DELIMITER_SQUARE)
	    {
	      skip = 1;
	    }
	  else if (ptr2 + 1 < end)
	    {
	      if (*(ptr2 + 1) == '$')
		{
		  if (type == ITEX_DELIMITER_DOLLAR)
		    {
		      ptr2++;
		      match = 1;
		    }
		  else
		    {
		      ptr2 += 2;
		      match = 1;
		    }
		}
	      else
		{
		  if (type == ITEX_DELIMITER_DOLLAR)
		    {
		      ptr2++;
		      match = 1;
		    }
		  else
		    {
		      skip = 1;
		    }
		}
	    }
	  else
	    {
	      if (type == ITEX_DELIMITER_DOLLAR)
		{
		  ptr2++;
		  match = 1;
		}
	      else
		{
		  skip = 1;
		}
	    }
	  break;

	default:
	  break;
	}
      if (skip || match) break;

      ++ptr2;
    }
  if (skip)
    {
      if (type == ITEX_DELIMITER_DOLLAR)
	{
	  if (itex2MML_write)
	    (*itex2MML_write) (ptr1, 1);
	  ptr1++;
	}
      else
	{
	  if (itex2MML_write)
	    (*itex2MML_write) (ptr1, 2);
	  ptr1 += 2;
	}
      goto _until_math;
    }
  if (match)
    {
      mathml = itex2MML_parse (ptr1, ptr2 - ptr1);

      if (mathml)
	{
	  if (itex2MML_write_mathml)
	    (*itex2MML_write_mathml) (mathml);
	  itex2MML_free_string (mathml);
	  mathml = 0;
	}
      else
	{
	  ++result;
	  if (itex2MML_write)
	    {
	      if (type == ITEX_DELIMITER_DOLLAR)
		(*itex2MML_write) ("<math xmlns='http://www.w3.org/1998/Math/MathML' display='inline'><merror><mtext>", 0);
	      else
		(*itex2MML_write) ("<math xmlns='http://www.w3.org/1998/Math/MathML' display='block'><merror><mtext>", 0);

	      (*itex2MML_write) (itex2MML_last_error, 0);
	      (*itex2MML_write) ("</mtext></merror></math>", 0);
	    }
	}
      ptr1 = ptr2;

      goto _until_math;
    }
  if (itex2MML_write)
    (*itex2MML_write) (ptr1, ptr2 - ptr1);

 _finish:
  if (itex2MML_last_error)
    {
      itex2MML_free_string (itex2MML_last_error);
      itex2MML_last_error = 0;
    }
  itex2MML_error = save_error_fn;

  return result;
}

