home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / gnu / groff-1.09-src.lha / src / amiga / groff-1.09 / eqn / eqn.cc < prev    next >
C/C++ Source or Header  |  1994-02-21  |  42KB  |  1,343 lines

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