home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / bsd_srcs / usr.bin / groff / eqn / grot / eqn.tab.c next >
Encoding:
C/C++ Source or Header  |  1991-04-30  |  34.9 KB  |  1,223 lines

  1.  
  2. /*  A Bison parser, made from eqn.y  */
  3.  
  4. #define    OVER    258
  5. #define    SMALLOVER    259
  6. #define    SQRT    260
  7. #define    SUB    261
  8. #define    SUP    262
  9. #define    LPILE    263
  10. #define    RPILE    264
  11. #define    CPILE    265
  12. #define    PILE    266
  13. #define    LEFT    267
  14. #define    RIGHT    268
  15. #define    TO    269
  16. #define    FROM    270
  17. #define    SIZE    271
  18. #define    FONT    272
  19. #define    ROMAN    273
  20. #define    BOLD    274
  21. #define    ITALIC    275
  22. #define    FAT    276
  23. #define    ACCENT    277
  24. #define    BAR    278
  25. #define    UNDER    279
  26. #define    ABOVE    280
  27. #define    TEXT    281
  28. #define    QUOTED_TEXT    282
  29. #define    FWD    283
  30. #define    BACK    284
  31. #define    DOWN    285
  32. #define    UP    286
  33. #define    MATRIX    287
  34. #define    COL    288
  35. #define    LCOL    289
  36. #define    RCOL    290
  37. #define    CCOL    291
  38. #define    MARK    292
  39. #define    LINEUP    293
  40. #define    TYPE    294
  41. #define    VCENTER    295
  42. #define    PRIME    296
  43. #define    SPLIT    297
  44. #define    NOSPLIT    298
  45. #define    UACCENT    299
  46. #define    SPACE    300
  47. #define    GFONT    301
  48. #define    GSIZE    302
  49. #define    DEFINE    303
  50. #define    NDEFINE    304
  51. #define    TDEFINE    305
  52. #define    SDEFINE    306
  53. #define    UNDEF    307
  54. #define    IFDEF    308
  55. #define    INCLUDE    309
  56. #define    DELIM    310
  57. #define    CHARTYPE    311
  58. #define    SET    312
  59. #define    GRFONT    313
  60. #define    GBFONT    314
  61.  
  62. #line 19 "eqn.y"
  63.  
  64. #include <stdio.h>
  65. #include <string.h>
  66. #include <stdlib.h>
  67.  
  68. #include "box.h"
  69. extern int non_empty_flag;
  70. char *strsave(const char *);
  71. #define YYDEBUG 1
  72. int yylex();
  73. void yyerror(const char *);
  74.  
  75. #line 32 "eqn.y"
  76. typedef union {
  77.     char *str;
  78.     box *b;
  79.     pile_box *pb;
  80.     matrix_box *mb;
  81.     int n;
  82.     column *col;
  83. } YYSTYPE;
  84.  
  85. #ifndef YYLTYPE
  86. typedef
  87.   struct yyltype
  88.     {
  89.       int timestamp;
  90.       int first_line;
  91.       int first_column;
  92.       int last_line;
  93.       int last_column;
  94.       char *text;
  95.    }
  96.   yyltype;
  97.  
  98. #define YYLTYPE yyltype
  99. #endif
  100.  
  101. #include <stdio.h>
  102.  
  103. #ifndef __STDC__
  104. #define const
  105. #endif
  106.  
  107.  
  108.  
  109. #define    YYFINAL        139
  110. #define    YYFLAG        -32768
  111. #define    YYNTBASE    65
  112.  
  113. #define YYTRANSLATE(x) ((unsigned)(x) <= 314 ? yytranslate[x] : 82)
  114.  
  115. static const char yytranslate[] = {     0,
  116.      2,     2,     2,     2,     2,     2,     2,     2,    62,     2,
  117.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  118.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  119.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  120.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  121.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  122.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  123.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  124.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  125.      2,     2,     2,    60,     2,     2,     2,     2,     2,     2,
  126.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  127.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  128.      2,     2,    63,     2,    64,    61,     2,     2,     2,     2,
  129.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  130.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  131.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  132.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  133.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  134.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  135.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  136.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  137.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  138.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  139.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  140.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  141.      2,     2,     2,     2,     2,     1,     2,     3,     4,     5,
  142.      6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
  143.     16,    17,    18,    19,    20,    21,    22,    23,    24,    25,
  144.     26,    27,    28,    29,    30,    31,    32,    33,    34,    35,
  145.     36,    37,    38,    39,    40,    41,    42,    43,    44,    45,
  146.     46,    47,    48,    49,    50,    51,    52,    53,    54,    55,
  147.     56,    57,    58,    59
  148. };
  149.  
  150. #if YYDEBUG != 0
  151. static const short yyrline[] = { 0,
  152.    122,   124,   128,   131,   141,   144,   146,   150,   153,   155,
  153.    157,   159,   163,   166,   168,   170,   174,   177,   181,   184,
  154.    186,   190,   193,   195,   197,   199,   201,   203,   205,   207,
  155.    209,   211,   213,   215,   217,   219,   221,   223,   225,   227,
  156.    229,   231,   233,   235,   237,   239,   241,   243,   245,   247,
  157.    249,   251,   253,   257,   267,   270,   274,   277,   281,   284,
  158.    288,   291,   295,   298,   302,   305,   307,   309,   313,   315,
  159.    319,   322,   324
  160. };
  161.  
  162. static const char * const yytname[] = {     0,
  163. "error","$illegal.","OVER","SMALLOVER","SQRT","SUB","SUP","LPILE","RPILE","CPILE",
  164. "PILE","LEFT","RIGHT","TO","FROM","SIZE","FONT","ROMAN","BOLD","ITALIC",
  165. "FAT","ACCENT","BAR","UNDER","ABOVE","TEXT","QUOTED_TEXT","FWD","BACK","DOWN",
  166. "UP","MATRIX","COL","LCOL","RCOL","CCOL","MARK","LINEUP","TYPE","VCENTER",
  167. "PRIME","SPLIT","NOSPLIT","UACCENT","SPACE","GFONT","GSIZE","DEFINE","NDEFINE","TDEFINE",
  168. "SDEFINE","UNDEF","IFDEF","INCLUDE","DELIM","CHARTYPE","SET","GRFONT","GBFONT","'^'",
  169. "'~'","'\\t'","'{'","'}'","top"
  170. };
  171. #endif
  172.  
  173. static const short yyr1[] = {     0,
  174.     65,    65,    66,    66,    67,    67,    67,    68,    68,    68,
  175.     68,    68,    69,    69,    69,    69,    70,    70,    71,    71,
  176.     71,    72,    72,    72,    72,    72,    72,    72,    72,    72,
  177.     72,    72,    72,    72,    72,    72,    72,    72,    72,    72,
  178.     72,    72,    72,    72,    72,    72,    72,    72,    72,    72,
  179.     72,    72,    72,    73,    74,    74,    75,    75,    76,    76,
  180.     77,    77,    78,    78,    79,    79,    79,    79,    80,    80,
  181.     81,    81,    81
  182. };
  183.  
  184. static const short yyr2[] = {     0,
  185.      0,     1,     1,     2,     1,     2,     2,     1,     3,     3,
  186.      5,     5,     1,     2,     3,     3,     1,     3,     1,     3,
  187.      5,     1,     1,     2,     2,     1,     1,     1,     3,     2,
  188.      2,     2,     2,     4,     5,     3,     2,     2,     2,     3,
  189.      3,     2,     2,     2,     2,     3,     3,     3,     3,     3,
  190.      3,     3,     2,     1,     1,     3,     3,     4,     1,     2,
  191.      1,     3,     3,     4,     2,     2,     2,     2,     1,     1,
  192.      1,     1,     1
  193. };
  194.  
  195. static const short yydefact[] = {     1,
  196.      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  197.      0,     0,    22,    23,     0,     0,     0,     0,     0,     0,
  198.      0,     0,     0,     0,     0,    26,    27,    28,     0,     2,
  199.      3,     5,     8,    13,    17,    19,    14,    69,    70,     0,
  200.      0,    31,    54,    32,    33,    30,    72,    73,    71,     0,
  201.      0,     0,    42,    43,    44,    45,     0,     0,     0,     0,
  202.      0,     6,     7,     0,    53,    24,    25,     0,     4,     0,
  203.      0,     0,     0,     0,     0,     0,    37,    38,    39,     0,
  204.     55,     0,     0,    36,    47,    46,    48,    49,    51,    50,
  205.      0,     0,     0,     0,     0,    59,    52,    29,    15,    16,
  206.      9,    10,    20,    19,    18,    40,    41,     0,    57,     0,
  207.      0,     0,     0,    65,    66,    67,    68,    34,    60,     0,
  208.      0,     0,    56,    58,    35,    61,     0,     0,    11,    12,
  209.     21,     0,    63,     0,    62,    64,     0,     0,     0
  210. };
  211.  
  212. static const short yydefgoto[] = {   137,
  213.     81,    31,    32,    33,    34,    35,    36,    41,    82,    42,
  214.     95,   127,   114,    96,    43,    50
  215. };
  216.  
  217. static const short yypact[] = {   259,
  218.    318,     1,     1,     1,     1,     4,    70,    70,   356,   356,
  219.    356,   356,-32768,-32768,    70,    70,    70,    70,   -46,   259,
  220.    259,    70,   356,     9,    22,-32768,-32768,-32768,   259,   259,
  221. -32768,-32768,    20,-32768,-32768,    15,-32768,-32768,-32768,   259,
  222.    -44,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,   259,
  223.    356,   356,    58,    58,    58,    58,   356,   356,   356,   356,
  224.     11,-32768,-32768,   356,    58,-32768,-32768,   140,-32768,   318,
  225.    318,   318,   318,   356,   356,   356,-32768,-32768,-32768,   356,
  226.    259,   -12,   259,   200,    58,    58,    58,    58,    58,    58,
  227.      6,     6,     6,     6,     7,-32768,    58,-32768,-32768,-32768,
  228. -32768,    91,-32768,   383,-32768,-32768,-32768,   259,-32768,   -11,
  229.      4,   259,   -38,-32768,-32768,-32768,-32768,-32768,-32768,   318,
  230.    318,   356,   259,-32768,-32768,   259,   -10,   259,-32768,-32768,
  231. -32768,   259,-32768,    -7,   259,-32768,    26,    51,-32768
  232. };
  233.  
  234. static const short yypgoto[] = {-32768,
  235.      0,   -19,   -60,     2,   -59,   -16,    67,    -8,   -28,    84,
  236. -32768,   -62,    -1,   -25,    -2,   -37
  237. };
  238.  
  239.  
  240. #define    YYLAST        427
  241.  
  242.  
  243. static const short yytable[] = {    30,
  244.     62,    63,    37,    49,    51,    52,    57,    58,    59,    60,
  245.     69,   101,   108,   108,   132,   105,    61,   132,    83,    64,
  246.     74,    75,    70,    71,   128,   138,    38,    39,    68,    38,
  247.     39,    38,    39,    72,    73,    66,    76,    77,    78,    91,
  248.     92,    93,    94,    91,    92,    93,    94,    67,    69,    84,
  249.    139,   109,   124,   133,   110,    79,   136,   103,    80,   129,
  250.    130,    69,   131,    40,    69,   134,    47,    48,   112,   119,
  251.    118,    99,   100,   125,   102,    53,    54,    55,    56,    76,
  252.     77,    78,   113,   113,   113,   113,    44,    45,    46,    65,
  253.    115,   116,   117,    70,    71,    38,    39,     0,    79,     0,
  254.      0,    80,     0,    69,   120,   121,    69,   123,    49,     0,
  255.      0,   126,     0,     0,     0,    69,     0,    85,    86,     0,
  256.      0,     0,     0,    87,    88,    89,    90,   126,     0,     0,
  257.     97,   135,     0,     0,     0,     0,     0,     0,     0,     0,
  258.    104,     0,   106,     0,     1,     0,   107,     2,     3,     4,
  259.      5,     6,     0,     0,     0,     7,     8,     9,    10,    11,
  260.     12,     0,     0,     0,     0,    13,    14,    15,    16,    17,
  261.     18,    19,     0,     0,     0,     0,    20,    21,    22,    23,
  262.      0,    24,    25,     0,     0,     0,     0,     0,     0,     0,
  263.      0,     0,     0,     0,     0,     0,     0,     0,     0,    26,
  264.     27,    28,    29,    98,     1,     0,     0,     2,     3,     4,
  265.      5,     6,   111,     0,     0,     7,     8,     9,    10,    11,
  266.     12,     0,     0,     0,     0,    13,    14,    15,    16,    17,
  267.     18,    19,     0,     0,     0,     0,    20,    21,    22,    23,
  268.      0,    24,    25,     0,     0,     0,     0,     0,     0,     0,
  269.      0,     0,     0,     0,     0,     0,     0,     0,     0,    26,
  270.     27,    28,    29,     1,     0,     0,     2,     3,     4,     5,
  271.      6,     0,     0,     0,     7,     8,     9,    10,    11,    12,
  272.      0,     0,     0,     0,    13,    14,    15,    16,    17,    18,
  273.     19,     0,     0,     0,     0,    20,    21,    22,    23,     0,
  274.     24,    25,     0,     0,     0,     0,     0,     0,     0,     0,
  275.      0,     0,     0,     0,     0,     0,     0,     0,    26,    27,
  276.     28,    29,     1,     0,     0,     2,     3,     4,     5,     6,
  277.      0,     0,     0,     7,     8,     9,    10,    11,    12,     0,
  278.      0,     0,     0,    13,    14,    15,    16,    17,    18,    19,
  279.      0,     0,     0,     0,     0,     0,    22,    23,     0,    24,
  280.     25,     0,     0,     2,     3,     4,     5,     6,     0,     0,
  281.      0,     7,     8,     9,    10,    11,    12,    26,    27,    28,
  282.     29,    13,    14,    15,    16,    17,    18,    19,    74,   122,
  283.      0,     0,     0,     0,    22,    23,     0,    24,    25,     0,
  284.      0,     0,     0,     0,    76,    77,    78,     0,     0,     0,
  285.      0,     0,     0,     0,     0,    26,    27,    28,    29,     0,
  286.      0,     0,     0,    79,     0,     0,    80
  287. };
  288.  
  289. static const short yycheck[] = {     0,
  290.     20,    21,     1,     6,     7,     8,    15,    16,    17,    18,
  291.     30,    72,    25,    25,    25,    75,    63,    25,    63,    22,
  292.      6,     7,     3,     4,    63,     0,    26,    27,    29,    26,
  293.     27,    26,    27,    14,    15,    27,    22,    23,    24,    33,
  294.     34,    35,    36,    33,    34,    35,    36,    26,    68,    50,
  295.      0,    64,    64,    64,    83,    41,    64,    74,    44,   120,
  296.    121,    81,   122,    63,    84,   128,    63,    64,    63,    95,
  297.     64,    70,    71,   111,    73,     9,    10,    11,    12,    22,
  298.     23,    24,    91,    92,    93,    94,     3,     4,     5,    23,
  299.     92,    93,    94,     3,     4,    26,    27,    -1,    41,    -1,
  300.     -1,    44,    -1,   123,    14,    15,   126,   108,   111,    -1,
  301.     -1,   112,    -1,    -1,    -1,   135,    -1,    51,    52,    -1,
  302.     -1,    -1,    -1,    57,    58,    59,    60,   128,    -1,    -1,
  303.     64,   132,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
  304.     74,    -1,    76,    -1,     5,    -1,    80,     8,     9,    10,
  305.     11,    12,    -1,    -1,    -1,    16,    17,    18,    19,    20,
  306.     21,    -1,    -1,    -1,    -1,    26,    27,    28,    29,    30,
  307.     31,    32,    -1,    -1,    -1,    -1,    37,    38,    39,    40,
  308.     -1,    42,    43,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
  309.     -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    60,
  310.     61,    62,    63,    64,     5,    -1,    -1,     8,     9,    10,
  311.     11,    12,    13,    -1,    -1,    16,    17,    18,    19,    20,
  312.     21,    -1,    -1,    -1,    -1,    26,    27,    28,    29,    30,
  313.     31,    32,    -1,    -1,    -1,    -1,    37,    38,    39,    40,
  314.     -1,    42,    43,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
  315.     -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    60,
  316.     61,    62,    63,     5,    -1,    -1,     8,     9,    10,    11,
  317.     12,    -1,    -1,    -1,    16,    17,    18,    19,    20,    21,
  318.     -1,    -1,    -1,    -1,    26,    27,    28,    29,    30,    31,
  319.     32,    -1,    -1,    -1,    -1,    37,    38,    39,    40,    -1,
  320.     42,    43,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
  321.     -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    60,    61,
  322.     62,    63,     5,    -1,    -1,     8,     9,    10,    11,    12,
  323.     -1,    -1,    -1,    16,    17,    18,    19,    20,    21,    -1,
  324.     -1,    -1,    -1,    26,    27,    28,    29,    30,    31,    32,
  325.     -1,    -1,    -1,    -1,    -1,    -1,    39,    40,    -1,    42,
  326.     43,    -1,    -1,     8,     9,    10,    11,    12,    -1,    -1,
  327.     -1,    16,    17,    18,    19,    20,    21,    60,    61,    62,
  328.     63,    26,    27,    28,    29,    30,    31,    32,     6,     7,
  329.     -1,    -1,    -1,    -1,    39,    40,    -1,    42,    43,    -1,
  330.     -1,    -1,    -1,    -1,    22,    23,    24,    -1,    -1,    -1,
  331.     -1,    -1,    -1,    -1,    -1,    60,    61,    62,    63,    -1,
  332.     -1,    -1,    -1,    41,    -1,    -1,    44
  333. };
  334. #define YYPURE 1
  335.  
  336. /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
  337. #line 3 "/usr/local/lib/bison.simple"
  338.  
  339. /* Skeleton output parser for bison,
  340.    Copyright (C) 1984, 1989, 1990 Bob Corbett and Richard Stallman
  341.  
  342.    This program is free software; you can redistribute it and/or modify
  343.    it under the terms of the GNU General Public License as published by
  344.    the Free Software Foundation; either version 1, or (at your option)
  345.    any later version.
  346.  
  347.    This program is distributed in the hope that it will be useful,
  348.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  349.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  350.    GNU General Public License for more details.
  351.  
  352.    You should have received a copy of the GNU General Public License
  353.    along with this program; if not, write to the Free Software
  354.    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  355.  
  356.  
  357. #ifdef __GNUC__
  358. #ifndef alloca
  359. #define alloca __builtin_alloca
  360. #endif /* Not alloca. */
  361. #else /* Not GNU C.  */
  362. #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__)
  363. #include <alloca.h>
  364. #endif /* Sparc.  */
  365. #endif /* Not GNU C.  */
  366.  
  367. /* This is the parser code that is written into each bison parser
  368.   when the %semantic_parser declaration is not specified in the grammar.
  369.   It was written by Richard Stallman by simplifying the hairy parser
  370.   used when %semantic_parser is specified.  */
  371.  
  372. /* Note: there must be only one dollar sign in this file.
  373.    It is replaced by the list of actions, each action
  374.    as one case of the switch.  */
  375.  
  376. #define yyerrok        (yyerrstatus = 0)
  377. #define yyclearin    (yychar = YYEMPTY)
  378. #define YYEMPTY        -2
  379. #define YYEOF        0
  380. #define YYACCEPT    return(0)
  381. #define YYABORT     return(1)
  382. #define YYERROR        goto yyerrlab1
  383. /* Like YYERROR except do call yyerror.
  384.    This remains here temporarily to ease the
  385.    transition to the new meaning of YYERROR, for GCC.
  386.    Once GCC version 2 has supplanted version 1, this can go.  */
  387. #define YYFAIL        goto yyerrlab
  388. #define YYRECOVERING()  (!!yyerrstatus)
  389. #define YYBACKUP(token, value) \
  390. do                                \
  391.   if (yychar == YYEMPTY && yylen == 1)                \
  392.     { yychar = (token), yylval = (value);            \
  393.       yychar1 = YYTRANSLATE (yychar);                \
  394.       YYPOPSTACK;                        \
  395.       goto yybackup;                        \
  396.     }                                \
  397.   else                                \
  398.     { yyerror ("syntax error: cannot back up"); YYERROR; }    \
  399. while (0)
  400.  
  401. #define YYTERROR    1
  402. #define YYERRCODE    256
  403.  
  404. #ifndef YYIMPURE
  405. #define YYLEX        yylex()
  406. #endif
  407.  
  408. #ifndef YYPURE
  409. #define YYLEX        yylex(&yylval, &yylloc)
  410. #endif
  411.  
  412. /* If nonreentrant, generate the variables here */
  413.  
  414. #ifndef YYIMPURE
  415.  
  416. int    yychar;            /*  the lookahead symbol        */
  417. YYSTYPE    yylval;            /*  the semantic value of the        */
  418.                 /*  lookahead symbol            */
  419.  
  420. #ifdef YYLSP_NEEDED
  421. YYLTYPE yylloc;            /*  location data for the lookahead    */
  422.                 /*  symbol                */
  423. #endif
  424.  
  425. int yynerrs;            /*  number of parse errors so far       */
  426. #endif  /* YYIMPURE */
  427.  
  428. #if YYDEBUG != 0
  429. int yydebug;            /*  nonzero means print parse trace    */
  430. /* Since this is uninitialized, it does not stop multiple parsers
  431.    from coexisting.  */
  432. #endif
  433.  
  434. /*  YYINITDEPTH indicates the initial size of the parser's stacks    */
  435.  
  436. #ifndef    YYINITDEPTH
  437. #define YYINITDEPTH 200
  438. #endif
  439.  
  440. /*  YYMAXDEPTH is the maximum size the stacks can grow to
  441.     (effective only if the built-in stack extension method is used).  */
  442.  
  443. #if YYMAXDEPTH == 0
  444. #undef YYMAXDEPTH
  445. #endif
  446.  
  447. #ifndef YYMAXDEPTH
  448. #define YYMAXDEPTH 10000
  449. #endif
  450.  
  451. /* This is the most reliable way to avoid incompatibilities
  452.    in available built-in functions on various systems.  */
  453. static void
  454. #ifdef __cplusplus
  455. __yy_bcopy (char *from, char *to, int count)
  456. #else
  457. __yy_bcopy (from, to, count)
  458.      char *from;
  459.      char *to;
  460.      int count;
  461. #endif
  462. {
  463.   register char *f = from;
  464.   register char *t = to;
  465.   register int i = count;
  466.  
  467.   while (i-- > 0)
  468.     *t++ = *f++;
  469. }
  470.  
  471. #line 137 "/usr/local/lib/bison.simple"
  472. int
  473. yyparse()
  474. {
  475.   register int yystate;
  476.   register int yyn;
  477.   register short *yyssp;
  478.   register YYSTYPE *yyvsp;
  479.   int yyerrstatus;    /*  number of tokens to shift before error messages enabled */
  480.   int yychar1;        /*  lookahead token as an internal (translated) token number */
  481.  
  482.   short    yyssa[YYINITDEPTH];    /*  the state stack            */
  483.   YYSTYPE yyvsa[YYINITDEPTH];    /*  the semantic value stack        */
  484.  
  485.   short *yyss = yyssa;        /*  refer to the stacks thru separate pointers */
  486.   YYSTYPE *yyvs = yyvsa;    /*  to allow yyoverflow to reallocate them elsewhere */
  487.  
  488. #ifdef YYLSP_NEEDED
  489.   YYLTYPE *yyls = yylsa;
  490.   YYLTYPE *yylsp;
  491.   YYLTYPE yylsa[YYINITDEPTH];    /*  the location stack            */
  492.  
  493. #define YYPOPSTACK   (yyvsp--, yysp--, yylsp--)
  494. #else
  495. #define YYPOPSTACK   (yyvsp--, yysp--)
  496. #endif
  497.  
  498.   int yystacksize = YYINITDEPTH;
  499.  
  500. #ifndef YYPURE
  501.   int yychar;
  502.   YYSTYPE yylval;
  503.   int yynerrs;
  504. #ifdef YYLSP_NEEDED
  505.   YYLTYPE yylloc;
  506. #endif
  507. #endif
  508.  
  509.   YYSTYPE yyval;        /*  the variable used to return        */
  510.                 /*  semantic values from the action    */
  511.                 /*  routines                */
  512.  
  513.   int yylen;
  514.  
  515. #if YYDEBUG != 0
  516.   if (yydebug)
  517.     fprintf(stderr, "Starting parse\n");
  518. #endif
  519.  
  520.   yystate = 0;
  521.   yyerrstatus = 0;
  522.   yynerrs = 0;
  523.   yychar = YYEMPTY;        /* Cause a token to be read.  */
  524.  
  525.   /* Initialize stack pointers.
  526.      Waste one element of value and location stack
  527.      so that they stay on the same level as the state stack.  */
  528.  
  529.   yyssp = yyss - 1;
  530.   yyvsp = yyvs;
  531. #ifdef YYLSP_NEEDED
  532.   yylsp = yyls;
  533. #endif
  534.  
  535. /* Push a new state, which is found in  yystate  .  */
  536. /* In all cases, when you get here, the value and location stacks
  537.    have just been pushed. so pushing a state here evens the stacks.  */
  538. yynewstate:
  539.  
  540.   *++yyssp = yystate;
  541.  
  542.   if (yyssp >= yyss + yystacksize - 1)
  543.     {
  544.       /* Give user a chance to reallocate the stack */
  545.       /* Use copies of these so that the &'s don't force the real ones into memory. */
  546.       YYSTYPE *yyvs1 = yyvs;
  547.       short *yyss1 = yyss;
  548. #ifdef YYLSP_NEEDED
  549.       YYLTYPE *yyls1 = yyls;
  550. #endif
  551.  
  552.       /* Get the current used size of the three stacks, in elements.  */
  553.       int size = yyssp - yyss + 1;
  554.  
  555. #ifdef yyoverflow
  556.       /* Each stack pointer address is followed by the size of
  557.      the data in use in that stack, in bytes.  */
  558.       yyoverflow("parser stack overflow",
  559.          &yyss1, size * sizeof (*yyssp),
  560.          &yyvs1, size * sizeof (*yyvsp),
  561. #ifdef YYLSP_NEEDED
  562.          &yyls1, size * sizeof (*yylsp),
  563. #endif
  564.          &yystacksize);
  565.  
  566.       yyss = yyss1; yyvs = yyvs1;
  567. #ifdef YYLSP_NEEDED
  568.       yyls = yyls1;
  569. #endif
  570. #else /* no yyoverflow */
  571.       /* Extend the stack our own way.  */
  572.       if (yystacksize >= YYMAXDEPTH)
  573.     {
  574.       yyerror("parser stack overflow");
  575.       return 2;
  576.     }
  577.       yystacksize *= 2;
  578.       if (yystacksize > YYMAXDEPTH)
  579.     yystacksize = YYMAXDEPTH;
  580.       yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
  581.       __yy_bcopy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp));
  582.       yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
  583.       __yy_bcopy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp));
  584. #ifdef YYLSP_NEEDED
  585.       yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp));
  586.       __yy_bcopy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp));
  587. #endif
  588. #endif /* no yyoverflow */
  589.  
  590.       yyssp = yyss + size - 1;
  591.       yyvsp = yyvs + size - 1;
  592. #ifdef YYLSP_NEEDED
  593.       yylsp = yyls + size - 1;
  594. #endif
  595.  
  596. #if YYDEBUG != 0
  597.       if (yydebug)
  598.     fprintf(stderr, "Stack size increased to %d\n", yystacksize);
  599. #endif
  600.  
  601.       if (yyssp >= yyss + yystacksize - 1)
  602.     YYABORT;
  603.     }
  604.  
  605. #if YYDEBUG != 0
  606.   if (yydebug)
  607.     fprintf(stderr, "Entering state %d\n", yystate);
  608. #endif
  609.  
  610.  yybackup:
  611.  
  612. /* Do appropriate processing given the current state.  */
  613. /* Read a lookahead token if we need one and don't already have one.  */
  614. /* yyresume: */
  615.  
  616.   /* First try to decide what to do without reference to lookahead token.  */
  617.  
  618.   yyn = yypact[yystate];
  619.   if (yyn == YYFLAG)
  620.     goto yydefault;
  621.  
  622.   /* Not known => get a lookahead token if don't already have one.  */
  623.  
  624.   /* yychar is either YYEMPTY or YYEOF
  625.      or a valid token in external form.  */
  626.  
  627.   if (yychar == YYEMPTY)
  628.     {
  629. #if YYDEBUG != 0
  630.       if (yydebug)
  631.     fprintf(stderr, "Reading a token: ");
  632. #endif
  633.       yychar = YYLEX;
  634.     }
  635.  
  636.   /* Convert token to internal form (in yychar1) for indexing tables with */
  637.  
  638.   if (yychar <= 0)        /* This means end of input. */
  639.     {
  640.       yychar1 = 0;
  641.       yychar = YYEOF;        /* Don't call YYLEX any more */
  642.  
  643. #if YYDEBUG != 0
  644.       if (yydebug)
  645.     fprintf(stderr, "Now at end of input.\n");
  646. #endif
  647.     }
  648.   else
  649.     {
  650.       yychar1 = YYTRANSLATE(yychar);
  651.  
  652. #if YYDEBUG != 0
  653.       if (yydebug)
  654.     fprintf(stderr, "Next token is %d (%s)\n", yychar, yytname[yychar1]);
  655. #endif
  656.     }
  657.  
  658.   yyn += yychar1;
  659.   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
  660.     goto yydefault;
  661.  
  662.   yyn = yytable[yyn];
  663.  
  664.   /* yyn is what to do for this token type in this state.
  665.      Negative => reduce, -yyn is rule number.
  666.      Positive => shift, yyn is new state.
  667.        New state is final state => don't bother to shift,
  668.        just return success.
  669.      0, or most negative number => error.  */
  670.  
  671.   if (yyn < 0)
  672.     {
  673.       if (yyn == YYFLAG)
  674.     goto yyerrlab;
  675.       yyn = -yyn;
  676.       goto yyreduce;
  677.     }
  678.   else if (yyn == 0)
  679.     goto yyerrlab;
  680.  
  681.   if (yyn == YYFINAL)
  682.     YYACCEPT;
  683.  
  684.   /* Shift the lookahead token.  */
  685.  
  686. #if YYDEBUG != 0
  687.   if (yydebug)
  688.     fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
  689. #endif
  690.  
  691.   /* Discard the token being shifted unless it is eof.  */
  692.   if (yychar != YYEOF)
  693.     yychar = YYEMPTY;
  694.  
  695.   *++yyvsp = yylval;
  696. #ifdef YYLSP_NEEDED
  697.   *++yylsp = yylloc;
  698. #endif
  699.  
  700.   /* count tokens shifted since error; after three, turn off error status.  */
  701.   if (yyerrstatus) yyerrstatus--;
  702.  
  703.   yystate = yyn;
  704.   goto yynewstate;
  705.  
  706. /* Do the default action for the current state.  */
  707. yydefault:
  708.  
  709.   yyn = yydefact[yystate];
  710.   if (yyn == 0)
  711.     goto yyerrlab;
  712.  
  713. /* Do a reduction.  yyn is the number of a rule to reduce with.  */
  714. yyreduce:
  715.   yylen = yyr2[yyn];
  716.   yyval = yyvsp[1-yylen]; /* implement default value of the action */
  717.  
  718. #if YYDEBUG != 0
  719.   if (yydebug)
  720.     {
  721.       if (yylen == 1)
  722.     fprintf (stderr, "Reducing 1 value via rule %d (line %d), ",
  723.          yyn, yyrline[yyn]);
  724.       else
  725.     fprintf (stderr, "Reducing %d values via rule %d (line %d), ",
  726.          yylen, yyn, yyrline[yyn]);
  727.     }
  728. #endif
  729.  
  730.  
  731.   switch (yyn) {
  732.  
  733. case 2:
  734. #line 125 "eqn.y"
  735. { yyvsp[0].b->top_level(); non_empty_flag = 1; ;
  736.     break;}
  737. case 3:
  738. #line 130 "eqn.y"
  739. { yyval.b = yyvsp[0].b; ;
  740.     break;}
  741. case 4:
  742. #line 132 "eqn.y"
  743. {
  744.           list_box *lb = yyvsp[-1].b->to_list_box();
  745.           if (!lb)
  746.             lb = new list_box(yyvsp[-1].b);
  747.           lb->append(yyvsp[0].b);
  748.           yyval.b = lb;
  749.         ;
  750.     break;}
  751. case 5:
  752. #line 143 "eqn.y"
  753. { yyval.b = yyvsp[0].b; ;
  754.     break;}
  755. case 6:
  756. #line 145 "eqn.y"
  757. { yyval.b = make_mark_box(yyvsp[0].b); ;
  758.     break;}
  759. case 7:
  760. #line 147 "eqn.y"
  761. { yyval.b = make_lineup_box(yyvsp[0].b); ;
  762.     break;}
  763. case 8:
  764. #line 152 "eqn.y"
  765. { yyval.b = yyvsp[0].b; ;
  766.     break;}
  767. case 9:
  768. #line 154 "eqn.y"
  769. { yyval.b = make_limit_box(yyvsp[-2].b, 0, yyvsp[0].b); ;
  770.     break;}
  771. case 10:
  772. #line 156 "eqn.y"
  773. { yyval.b = make_limit_box(yyvsp[-2].b, yyvsp[0].b, 0); ;
  774.     break;}
  775. case 11:
  776. #line 158 "eqn.y"
  777. { yyval.b = make_limit_box(yyvsp[-4].b, yyvsp[-2].b, yyvsp[0].b); ;
  778.     break;}
  779. case 12:
  780. #line 160 "eqn.y"
  781. { yyval.b = make_limit_box(yyvsp[-4].b, make_limit_box(yyvsp[-2].b, yyvsp[0].b, 0), 0); ;
  782.     break;}
  783. case 13:
  784. #line 165 "eqn.y"
  785. { yyval.b = yyvsp[0].b; ;
  786.     break;}
  787. case 14:
  788. #line 167 "eqn.y"
  789. { yyval.b = make_sqrt_box(yyvsp[0].b); ;
  790.     break;}
  791. case 15:
  792. #line 169 "eqn.y"
  793. { yyval.b = make_over_box(yyvsp[-2].b, yyvsp[0].b); ;
  794.     break;}
  795. case 16:
  796. #line 171 "eqn.y"
  797. { yyval.b = make_small_over_box(yyvsp[-2].b, yyvsp[0].b); ;
  798.     break;}
  799. case 17:
  800. #line 176 "eqn.y"
  801. { yyval.b = yyvsp[0].b; ;
  802.     break;}
  803. case 18:
  804. #line 178 "eqn.y"
  805. { yyval.b = make_script_box(yyvsp[-2].b, 0, yyvsp[0].b); ;
  806.     break;}
  807. case 19:
  808. #line 183 "eqn.y"
  809. { yyval.b = yyvsp[0].b; ;
  810.     break;}
  811. case 20:
  812. #line 185 "eqn.y"
  813. { yyval.b = make_script_box(yyvsp[-2].b, yyvsp[0].b, 0); ;
  814.     break;}
  815. case 21:
  816. #line 187 "eqn.y"
  817. { yyval.b = make_script_box(yyvsp[-4].b, yyvsp[-2].b, yyvsp[0].b); ;
  818.     break;}
  819. case 22:
  820. #line 192 "eqn.y"
  821. { yyval.b = split_text(yyvsp[0].str); ;
  822.     break;}
  823. case 23:
  824. #line 194 "eqn.y"
  825. { yyval.b = new quoted_text_box(yyvsp[0].str); ;
  826.     break;}
  827. case 24:
  828. #line 196 "eqn.y"
  829. { yyval.b = split_text(yyvsp[0].str); ;
  830.     break;}
  831. case 25:
  832. #line 198 "eqn.y"
  833. { yyval.b = new quoted_text_box(yyvsp[0].str); ;
  834.     break;}
  835. case 26:
  836. #line 200 "eqn.y"
  837. { yyval.b = new half_space_box; ;
  838.     break;}
  839. case 27:
  840. #line 202 "eqn.y"
  841. { yyval.b = new space_box; ;
  842.     break;}
  843. case 28:
  844. #line 204 "eqn.y"
  845. { yyval.b = new tab_box; ;
  846.     break;}
  847. case 29:
  848. #line 206 "eqn.y"
  849. { yyval.b = yyvsp[-1].b; ;
  850.     break;}
  851. case 30:
  852. #line 208 "eqn.y"
  853. { yyvsp[0].pb->set_alignment(CENTER_ALIGN); yyval.b = yyvsp[0].pb; ;
  854.     break;}
  855. case 31:
  856. #line 210 "eqn.y"
  857. { yyvsp[0].pb->set_alignment(LEFT_ALIGN); yyval.b = yyvsp[0].pb; ;
  858.     break;}
  859. case 32:
  860. #line 212 "eqn.y"
  861. { yyvsp[0].pb->set_alignment(RIGHT_ALIGN); yyval.b = yyvsp[0].pb; ;
  862.     break;}
  863. case 33:
  864. #line 214 "eqn.y"
  865. { yyvsp[0].pb->set_alignment(CENTER_ALIGN); yyval.b = yyvsp[0].pb; ;
  866.     break;}
  867. case 34:
  868. #line 216 "eqn.y"
  869. { yyval.b = yyvsp[-1].mb; ;
  870.     break;}
  871. case 35:
  872. #line 218 "eqn.y"
  873. { yyval.b = make_delim_box(yyvsp[-3].str, yyvsp[-2].b, yyvsp[0].str); ;
  874.     break;}
  875. case 36:
  876. #line 220 "eqn.y"
  877. { yyval.b = make_delim_box(yyvsp[-1].str, yyvsp[0].b, 0); ;
  878.     break;}
  879. case 37:
  880. #line 222 "eqn.y"
  881. { yyval.b = make_overline_box(yyvsp[-1].b); ;
  882.     break;}
  883. case 38:
  884. #line 224 "eqn.y"
  885. { yyval.b = make_underline_box(yyvsp[-1].b); ;
  886.     break;}
  887. case 39:
  888. #line 226 "eqn.y"
  889. { yyval.b = make_prime_box(yyvsp[-1].b); ;
  890.     break;}
  891. case 40:
  892. #line 228 "eqn.y"
  893. { yyval.b = make_accent_box(yyvsp[-2].b, yyvsp[0].b); ;
  894.     break;}
  895. case 41:
  896. #line 230 "eqn.y"
  897. { yyval.b = make_uaccent_box(yyvsp[-2].b, yyvsp[0].b); ;
  898.     break;}
  899. case 42:
  900. #line 232 "eqn.y"
  901. { yyval.b = new font_box(strsave(get_grfont()), yyvsp[0].b); ;
  902.     break;}
  903. case 43:
  904. #line 234 "eqn.y"
  905. { yyval.b = new font_box(strsave(get_gbfont()), yyvsp[0].b); ;
  906.     break;}
  907. case 44:
  908. #line 236 "eqn.y"
  909. { yyval.b = new font_box(strsave(get_gfont()), yyvsp[0].b); ;
  910.     break;}
  911. case 45:
  912. #line 238 "eqn.y"
  913. { yyval.b = new fat_box(yyvsp[0].b); ;
  914.     break;}
  915. case 46:
  916. #line 240 "eqn.y"
  917. { yyval.b = new font_box(yyvsp[-1].str, yyvsp[0].b); ;
  918.     break;}
  919. case 47:
  920. #line 242 "eqn.y"
  921. { yyval.b = new size_box(yyvsp[-1].str, yyvsp[0].b); ;
  922.     break;}
  923. case 48:
  924. #line 244 "eqn.y"
  925. { yyval.b = new hmotion_box(yyvsp[-1].n, yyvsp[0].b); ;
  926.     break;}
  927. case 49:
  928. #line 246 "eqn.y"
  929. { yyval.b = new hmotion_box(-yyvsp[-1].n, yyvsp[0].b); ;
  930.     break;}
  931. case 50:
  932. #line 248 "eqn.y"
  933. { yyval.b = new vmotion_box(yyvsp[-1].n, yyvsp[0].b); ;
  934.     break;}
  935. case 51:
  936. #line 250 "eqn.y"
  937. { yyval.b = new vmotion_box(-yyvsp[-1].n, yyvsp[0].b); ;
  938.     break;}
  939. case 52:
  940. #line 252 "eqn.y"
  941. { yyvsp[0].b->set_spacing_type(yyvsp[-1].str); yyval.b = yyvsp[0].b; ;
  942.     break;}
  943. case 53:
  944. #line 254 "eqn.y"
  945. { yyval.b = new vcenter_box(yyvsp[0].b); ;
  946.     break;}
  947. case 54:
  948. #line 259 "eqn.y"
  949. {
  950.           int n;
  951.           if (sscanf(yyvsp[0].str, "%d", &n) == 1)
  952.             yyval.n = n;
  953.           delete yyvsp[0].str;
  954.         ;
  955.     break;}
  956. case 55:
  957. #line 269 "eqn.y"
  958. { yyval.pb = new pile_box(yyvsp[0].b); ;
  959.     break;}
  960. case 56:
  961. #line 271 "eqn.y"
  962. { yyvsp[-2].pb->append(yyvsp[0].b); yyval.pb = yyvsp[-2].pb; ;
  963.     break;}
  964. case 57:
  965. #line 276 "eqn.y"
  966. { yyval.pb = yyvsp[-1].pb; ;
  967.     break;}
  968. case 58:
  969. #line 278 "eqn.y"
  970. { yyvsp[-1].pb->set_space(yyvsp[-3].n); yyval.pb = yyvsp[-1].pb; ;
  971.     break;}
  972. case 59:
  973. #line 283 "eqn.y"
  974. { yyval.mb = new matrix_box(yyvsp[0].col); ;
  975.     break;}
  976. case 60:
  977. #line 285 "eqn.y"
  978. { yyvsp[-1].mb->append(yyvsp[0].col); yyval.mb = yyvsp[-1].mb; ;
  979.     break;}
  980. case 61:
  981. #line 290 "eqn.y"
  982. { yyval.col = new column(yyvsp[0].b); ;
  983.     break;}
  984. case 62:
  985. #line 292 "eqn.y"
  986. { yyvsp[-2].col->append(yyvsp[0].b); yyval.col = yyvsp[-2].col; ;
  987.     break;}
  988. case 63:
  989. #line 297 "eqn.y"
  990. { yyval.col = yyvsp[-1].col; ;
  991.     break;}
  992. case 64:
  993. #line 299 "eqn.y"
  994. { yyvsp[-1].col->set_space(yyvsp[-3].n); yyval.col = yyvsp[-1].col; ;
  995.     break;}
  996. case 65:
  997. #line 304 "eqn.y"
  998. { yyvsp[0].col->set_alignment(CENTER_ALIGN); yyval.col = yyvsp[0].col; ;
  999.     break;}
  1000. case 66:
  1001. #line 306 "eqn.y"
  1002. { yyvsp[0].col->set_alignment(LEFT_ALIGN); yyval.col = yyvsp[0].col; ;
  1003.     break;}
  1004. case 67:
  1005. #line 308 "eqn.y"
  1006. { yyvsp[0].col->set_alignment(RIGHT_ALIGN); yyval.col = yyvsp[0].col; ;
  1007.     break;}
  1008. case 68:
  1009. #line 310 "eqn.y"
  1010. { yyvsp[0].col->set_alignment(CENTER_ALIGN); yyval.col = yyvsp[0].col; ;
  1011.     break;}
  1012. case 69:
  1013. #line 314 "eqn.y"
  1014. { yyval.str = yyvsp[0].str; ;
  1015.     break;}
  1016. case 70:
  1017. #line 316 "eqn.y"
  1018. { yyval.str = yyvsp[0].str; ;
  1019.     break;}
  1020. case 71:
  1021. #line 321 "eqn.y"
  1022. { yyval.str = yyvsp[0].str; ;
  1023.     break;}
  1024. case 72:
  1025. #line 323 "eqn.y"
  1026. { yyval.str = strsave("{"); ;
  1027.     break;}
  1028. case 73:
  1029. #line 325 "eqn.y"
  1030. { yyval.str = strsave("}"); ;
  1031.     break;}
  1032. }
  1033.    /* the action file gets copied in in place of this dollarsign */
  1034. #line 362 "/usr/local/lib/bison.simple"
  1035.  
  1036.   yyvsp -= yylen;
  1037.   yyssp -= yylen;
  1038. #ifdef YYLSP_NEEDED
  1039.   yylsp -= yylen;
  1040. #endif
  1041.  
  1042. #if YYDEBUG != 0
  1043.   if (yydebug)
  1044.     {
  1045.       short *ssp1 = yyss - 1;
  1046.       fprintf (stderr, "state stack now");
  1047.       while (ssp1 != yyssp)
  1048.     fprintf (stderr, " %d", *++ssp1);
  1049.       fprintf (stderr, "\n");
  1050.     }
  1051. #endif
  1052.  
  1053.   *++yyvsp = yyval;
  1054.  
  1055. #ifdef YYLSP_NEEDED
  1056.   yylsp++;
  1057.   if (yylen == 0)
  1058.     {
  1059.       yylsp->first_line = yylloc.first_line;
  1060.       yylsp->first_column = yylloc.first_column;
  1061.       yylsp->last_line = (yylsp-1)->last_line;
  1062.       yylsp->last_column = (yylsp-1)->last_column;
  1063.       yylsp->text = 0;
  1064.     }
  1065.   else
  1066.     {
  1067.       yylsp->last_line = (yylsp+yylen-1)->last_line;
  1068.       yylsp->last_column = (yylsp+yylen-1)->last_column;
  1069.     }
  1070. #endif
  1071.  
  1072.   /* Now "shift" the result of the reduction.
  1073.      Determine what state that goes to,
  1074.      based on the state we popped back to
  1075.      and the rule number reduced by.  */
  1076.  
  1077.   yyn = yyr1[yyn];
  1078.  
  1079.   yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
  1080.   if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
  1081.     yystate = yytable[yystate];
  1082.   else
  1083.     yystate = yydefgoto[yyn - YYNTBASE];
  1084.  
  1085.   goto yynewstate;
  1086.  
  1087. yyerrlab:   /* here on detecting error */
  1088.  
  1089.   if (! yyerrstatus)
  1090.     /* If not already recovering from an error, report this error.  */
  1091.     {
  1092.       ++yynerrs;
  1093.  
  1094. #ifdef YYERROR_VERBOSE
  1095.       yyn = yypact[yystate];
  1096.  
  1097.       if (yyn > YYFLAG && yyn < YYLAST)
  1098.     {
  1099.       int size = 0;
  1100.       char *msg;
  1101.       int x, count;
  1102.  
  1103.       count = 0;
  1104.       for (x = 0; x < (sizeof(yytname) / sizeof(char *)); x++)
  1105.         if (yycheck[x + yyn] == x)
  1106.           size += strlen(yytname[x]) + 15, count++;
  1107.       msg = (char *) xmalloc(size + 15);
  1108.       strcpy(msg, "parse error");
  1109.  
  1110.       if (count < 5)
  1111.         {
  1112.           count = 0;
  1113.           for (x = 0; x < (sizeof(yytname) / sizeof(char *)); x++)
  1114.         if (yycheck[x + yyn] == x)
  1115.           {
  1116.             strcat(msg, count == 0 ? ", expecting `" : " or `");
  1117.             strcat(msg, yytname[x]);
  1118.             strcat(msg, "'");
  1119.             count++;
  1120.           }
  1121.         }
  1122.       yyerror(msg);
  1123.       free(msg);
  1124.     }
  1125.       else
  1126. #endif /* YYERROR_VERBOSE */
  1127.     yyerror("parse error");
  1128.     }
  1129.  
  1130. yyerrlab1:   /* here on error raised explicitly by an action */
  1131.  
  1132.   if (yyerrstatus == 3)
  1133.     {
  1134.       /* if just tried and failed to reuse lookahead token after an error, discard it.  */
  1135.  
  1136.       /* return failure if at end of input */
  1137.       if (yychar == YYEOF)
  1138.     YYABORT;
  1139.  
  1140. #if YYDEBUG != 0
  1141.       if (yydebug)
  1142.     fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
  1143. #endif
  1144.  
  1145.       yychar = YYEMPTY;
  1146.     }
  1147.  
  1148.   /* Else will try to reuse lookahead token
  1149.      after shifting the error token.  */
  1150.  
  1151.   yyerrstatus = 3;        /* Each real token shifted decrements this */
  1152.  
  1153.   goto yyerrhandle;
  1154.  
  1155. yyerrdefault:  /* current state does not do anything special for the error token. */
  1156.  
  1157. #if 0
  1158.   /* This is wrong; only states that explicitly want error tokens
  1159.      should shift them.  */
  1160.   yyn = yydefact[yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
  1161.   if (yyn) goto yydefault;
  1162. #endif
  1163.  
  1164. yyerrpop:   /* pop the current state because it cannot handle the error token */
  1165.  
  1166.   if (yyssp == yyss) YYABORT;
  1167.   yyvsp--;
  1168.   yystate = *--yyssp;
  1169. #ifdef YYLSP_NEEDED
  1170.   yylsp--;
  1171. #endif
  1172.  
  1173. #if YYDEBUG != 0
  1174.   if (yydebug)
  1175.     {
  1176.       short *ssp1 = yyss - 1;
  1177.       fprintf (stderr, "Error: state stack now");
  1178.       while (ssp1 != yyssp)
  1179.     fprintf (stderr, " %d", *++ssp1);
  1180.       fprintf (stderr, "\n");
  1181.     }
  1182. #endif
  1183.  
  1184. yyerrhandle:
  1185.  
  1186.   yyn = yypact[yystate];
  1187.   if (yyn == YYFLAG)
  1188.     goto yyerrdefault;
  1189.  
  1190.   yyn += YYTERROR;
  1191.   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
  1192.     goto yyerrdefault;
  1193.  
  1194.   yyn = yytable[yyn];
  1195.   if (yyn < 0)
  1196.     {
  1197.       if (yyn == YYFLAG)
  1198.     goto yyerrpop;
  1199.       yyn = -yyn;
  1200.       goto yyreduce;
  1201.     }
  1202.   else if (yyn == 0)
  1203.     goto yyerrpop;
  1204.  
  1205.   if (yyn == YYFINAL)
  1206.     YYACCEPT;
  1207.  
  1208. #if YYDEBUG != 0
  1209.   if (yydebug)
  1210.     fprintf(stderr, "Shifting error token, ");
  1211. #endif
  1212.  
  1213.   *++yyvsp = yylval;
  1214. #ifdef YYLSP_NEEDED
  1215.   *++yylsp = yylloc;
  1216. #endif
  1217.  
  1218.   yystate = yyn;
  1219.   goto yynewstate;
  1220. }
  1221. #line 328 "eqn.y"
  1222.  
  1223.