home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / gnu / djgpp / src / flex-238 / parse.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-30  |  40.6 KB  |  1,576 lines

  1.  
  2. /*  A Bison parser, made from parse.y with Bison version GNU Bison version 1.21
  3.   */
  4.  
  5. #define YYBISON 1  /* Identify Bison output.  */
  6.  
  7. #define    CHAR    258
  8. #define    NUMBER    259
  9. #define    SECTEND    260
  10. #define    SCDECL    261
  11. #define    XSCDECL    262
  12. #define    WHITESPACE    263
  13. #define    NAME    264
  14. #define    PREVCCL    265
  15. #define    EOF_OP    266
  16.  
  17. #line 6 "parse.y"
  18.  
  19. /*-
  20.  * Copyright (c) 1990 The Regents of the University of California.
  21.  * All rights reserved.
  22.  *
  23.  * This code is derived from software contributed to Berkeley by
  24.  * Vern Paxson.
  25.  * 
  26.  * The United States Government has rights in this work pursuant
  27.  * to contract no. DE-AC03-76SF00098 between the United States
  28.  * Department of Energy and the University of California.
  29.  *
  30.  * Redistribution and use in source and binary forms are permitted provided
  31.  * that: (1) source distributions retain this entire copyright notice and
  32.  * comment, and (2) distributions including binaries display the following
  33.  * acknowledgement:  ``This product includes software developed by the
  34.  * University of California, Berkeley and its contributors'' in the
  35.  * documentation or other materials provided with the distribution and in
  36.  * all advertising materials mentioning features or use of this software.
  37.  * Neither the name of the University nor the names of its contributors may
  38.  * be used to endorse or promote products derived from this software without
  39.  * specific prior written permission.
  40.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  41.  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  42.  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  43.  */
  44.  
  45. #ifndef lint
  46. static char rcsid[] =
  47.     "@(#) $Header: /usr/fsys/odin/a/vern/flex/RCS/parse.y,v 2.7 90/06/27 23:48:31 vern Exp $ (LBL)";
  48. #endif
  49.  
  50. #include "flexdef.h"
  51.  
  52. int pat, scnum, eps, headcnt, trailcnt, anyccl, lastchar, i, actvp, rulelen;
  53. int trlcontxt, xcluflg, cclsorted, varlength, variable_trail_rule;
  54. Char clower();
  55. void build_eof_action();
  56. void yyerror();
  57.  
  58. static int madeany = false;  /* whether we've made the '.' character class */
  59. int previous_continued_action;    /* whether the previous rule's action was '|' */
  60.  
  61.  
  62. #ifndef YYLTYPE
  63. typedef
  64.   struct yyltype
  65.     {
  66.       int timestamp;
  67.       int first_line;
  68.       int first_column;
  69.       int last_line;
  70.       int last_column;
  71.       char *text;
  72.    }
  73.   yyltype;
  74.  
  75. #define YYLTYPE yyltype
  76. #endif
  77.  
  78. #ifndef YYSTYPE
  79. #define YYSTYPE int
  80. #endif
  81. #include <stdio.h>
  82.  
  83. #ifndef __cplusplus
  84. #ifndef __STDC__
  85. #define const
  86. #endif
  87. #endif
  88.  
  89.  
  90.  
  91. #define    YYFINAL        81
  92. #define    YYFLAG        -32768
  93. #define    YYNTBASE    32
  94.  
  95. #define YYTRANSLATE(x) ((unsigned)(x) <= 266 ? yytranslate[x] : 51)
  96.  
  97. static const char yytranslate[] = {     0,
  98.      2,     2,     2,     2,     2,     2,     2,     2,     2,    12,
  99.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  100.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  101.      2,     2,     2,    26,     2,    17,     2,     2,     2,    27,
  102.     28,    20,    21,    16,    31,    25,    19,     2,     2,     2,
  103.      2,     2,     2,     2,     2,     2,     2,     2,     2,    14,
  104.      2,    15,    22,     2,     2,     2,     2,     2,     2,     2,
  105.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  106.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  107.     29,     2,    30,    13,     2,     2,     2,     2,     2,     2,
  108.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  109.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  110.      2,     2,    23,    18,    24,     2,     2,     2,     2,     2,
  111.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  112.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  113.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  114.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  115.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  116.      2,     2,     2,     2,     2,     2,     2,     2,     2,     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,     1,     2,     3,     4,     5,
  124.      6,     7,     8,     9,    10,    11
  125. };
  126.  
  127. #if YYDEBUG != 0
  128. static const short yyprhs[] = {     0,
  129.      0,     6,     7,    13,    14,    17,    19,    21,    23,    27,
  130.     29,    31,    36,    37,    38,    42,    45,    48,    50,    53,
  131.     55,    57,    61,    65,    67,    69,    72,    76,    79,    81,
  132.     85,    87,    90,    93,    95,    98,   101,   104,   111,   117,
  133.    122,   124,   126,   128,   132,   136,   138,   142,   147,   152,
  134.    155,   156,   159
  135. };
  136.  
  137. static const short yyrhs[] = {    33,
  138.     34,    35,    38,    39,     0,     0,    34,    36,     8,    37,
  139.     12,     0,     0,     1,    12,     0,     5,     0,     6,     0,
  140.      7,     0,    37,     8,     9,     0,     9,     0,     1,     0,
  141.     38,    39,    40,    12,     0,     0,     0,    41,    13,    43,
  142.      0,    41,    43,     0,    13,    43,     0,    43,     0,    41,
  143.     11,     0,    11,     0,     1,     0,    14,    42,    15,     0,
  144.     42,    16,     9,     0,     9,     0,     1,     0,    45,    44,
  145.      0,    45,    44,    17,     0,    44,    17,     0,    44,     0,
  146.     44,    18,    46,     0,    46,     0,    44,    19,     0,    46,
  147.     47,     0,    47,     0,    47,    20,     0,    47,    21,     0,
  148.     47,    22,     0,    47,    23,     4,    16,     4,    24,     0,
  149.     47,    23,     4,    16,    24,     0,    47,    23,     4,    24,
  150.      0,    25,     0,    48,     0,    10,     0,    26,    50,    26,
  151.      0,    27,    44,    28,     0,     3,     0,    29,    49,    30,
  152.      0,    29,    13,    49,    30,     0,    49,     3,    31,     3,
  153.      0,    49,     3,     0,     0,    50,     3,     0,     0
  154. };
  155.  
  156. #endif
  157.  
  158. #if YYDEBUG != 0
  159. static const short yyrline[] = { 0,
  160.     52,    76,    85,    86,    87,    91,    94,   104,   108,   111,
  161.    114,   118,   119,   122,   133,   153,   164,   188,   199,   202,
  162.    221,   225,   228,   238,   247,   251,   308,   311,   363,   379,
  163.    385,   390,   415,   423,   427,   434,   441,   448,   474,   488,
  164.    506,   528,   545,   552,   555,   558,   569,   572,   586,   614,
  165.    626,   634,   645
  166. };
  167.  
  168. static const char * const yytname[] = {   "$","error","$illegal.","CHAR","NUMBER",
  169. "SECTEND","SCDECL","XSCDECL","WHITESPACE","NAME","PREVCCL","EOF_OP","'\\n'",
  170. "'^'","'<'","'>'","','","'$'","'|'","'/'","'*'","'+'","'?'","'{'","'}'","'.'",
  171. "'\"'","'('","')'","'['","']'","'-'","goal","initlex","sect1","sect1end","startconddecl",
  172. "namelist1","sect2","initforrule","flexrule","scon","namelist2","rule","re",
  173. "re2","series","singleton","fullccl","ccl","string",""
  174. };
  175. #endif
  176.  
  177. static const short yyr1[] = {     0,
  178.     32,    33,    34,    34,    34,    35,    36,    36,    37,    37,
  179.     37,    38,    38,    39,    40,    40,    40,    40,    40,    40,
  180.     40,    41,    42,    42,    42,    43,    43,    43,    43,    44,
  181.     44,    45,    46,    46,    47,    47,    47,    47,    47,    47,
  182.     47,    47,    47,    47,    47,    47,    48,    48,    49,    49,
  183.     49,    50,    50
  184. };
  185.  
  186. static const short yyr2[] = {     0,
  187.      5,     0,     5,     0,     2,     1,     1,     1,     3,     1,
  188.      1,     4,     0,     0,     3,     2,     2,     1,     2,     1,
  189.      1,     3,     3,     1,     1,     2,     3,     2,     1,     3,
  190.      1,     2,     2,     1,     2,     2,     2,     6,     5,     4,
  191.      1,     1,     1,     3,     3,     1,     3,     4,     4,     2,
  192.      0,     2,     0
  193. };
  194.  
  195. static const short yydefact[] = {     2,
  196.      0,     0,     0,     5,     6,     7,     8,    13,     0,    14,
  197.      0,     0,    11,    10,     0,    21,    46,    43,    20,     0,
  198.      0,    41,    53,     0,    51,     0,     0,    18,    29,     0,
  199.     31,    34,    42,     0,     3,    17,    25,    24,     0,     0,
  200.      0,    51,     0,    12,    19,     0,    16,    28,     0,    32,
  201.     26,    33,    35,    36,    37,     0,     9,    22,     0,    52,
  202.     44,    45,     0,    50,    47,    15,    30,    27,     0,    23,
  203.     48,     0,     0,    40,    49,     0,    39,    38,     0,     0,
  204.      0
  205. };
  206.  
  207. static const short yydefgoto[] = {    79,
  208.      1,     3,     8,     9,    15,    10,    12,    26,    27,    39,
  209.     28,    29,    30,    31,    32,    33,    43,    40
  210. };
  211.  
  212. static const short yypact[] = {-32768,
  213.     55,    -2,    63,-32768,-32768,-32768,-32768,-32768,    16,-32768,
  214.     12,     1,-32768,-32768,    51,-32768,-32768,-32768,-32768,    19,
  215.     33,-32768,-32768,    19,    -6,     8,    28,-32768,    54,    19,
  216.     19,    44,-32768,    38,-32768,-32768,-32768,-32768,    34,    14,
  217.    -10,-32768,     2,-32768,-32768,    19,-32768,-32768,    19,-32768,
  218.     57,    44,-32768,-32768,-32768,    48,-32768,-32768,    49,-32768,
  219. -32768,-32768,     3,     6,-32768,-32768,    19,-32768,    27,-32768,
  220. -32768,    73,    -1,-32768,-32768,    53,-32768,-32768,    78,    79,
  221. -32768
  222. };
  223.  
  224. static const short yypgoto[] = {-32768,
  225. -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
  226.    -11,    -5,-32768,    31,   -31,-32768,    39,-32768
  227. };
  228.  
  229.  
  230. #define    YYLAST        81
  231.  
  232.  
  233. static const short yytable[] = {    52,
  234.     -1,    16,    76,    17,    64,    64,    42,    49,    36,     4,
  235.     18,    19,    13,    20,    21,    47,    60,    62,    41,    44,
  236.     14,    17,    77,    11,    51,    22,    23,    24,    18,    25,
  237.     17,    65,    71,    37,    66,    52,    72,    18,    45,    61,
  238.     46,    38,    73,    22,    23,    24,    57,    25,    58,    59,
  239.     74,    69,    22,    23,    24,     2,    25,    70,    34,    -4,
  240.     -4,    -4,    35,    53,    54,    55,    56,     5,     6,     7,
  241.     48,    49,    50,    68,    49,    75,    78,    80,    81,    67,
  242.     63
  243. };
  244.  
  245. static const short yycheck[] = {    31,
  246.      0,     1,     4,     3,     3,     3,    13,    18,    20,    12,
  247.     10,    11,     1,    13,    14,    27,     3,    28,    24,    12,
  248.      9,     3,    24,     8,    30,    25,    26,    27,    10,    29,
  249.      3,    30,    30,     1,    46,    67,    31,    10,    11,    26,
  250.     13,     9,    16,    25,    26,    27,     9,    29,    15,    16,
  251.     24,     4,    25,    26,    27,     1,    29,     9,     8,     5,
  252.      6,     7,    12,    20,    21,    22,    23,     5,     6,     7,
  253.     17,    18,    19,    17,    18,     3,    24,     0,     0,    49,
  254.     42
  255. };
  256. /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
  257. #line 3 "bison.simple"
  258.  
  259. /* Skeleton output parser for bison,
  260.    Copyright (C) 1984, 1989, 1990 Bob Corbett and Richard Stallman
  261.  
  262.    This program is free software; you can redistribute it and/or modify
  263.    it under the terms of the GNU General Public License as published by
  264.    the Free Software Foundation; either version 1, or (at your option)
  265.    any later version.
  266.  
  267.    This program is distributed in the hope that it will be useful,
  268.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  269.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  270.    GNU General Public License for more details.
  271.  
  272.    You should have received a copy of the GNU General Public License
  273.    along with this program; if not, write to the Free Software
  274.    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  275.  
  276.  
  277. #ifndef alloca
  278. #ifdef __GNUC__
  279. #define alloca __builtin_alloca
  280. #else /* not GNU C.  */
  281. #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__)
  282. #include <alloca.h>
  283. #else /* not sparc */
  284. #if defined (MSDOS) && !defined (__TURBOC__)
  285. #include <malloc.h>
  286. #else /* not MSDOS, or __TURBOC__ */
  287. #if defined(_AIX)
  288. #include <malloc.h>
  289.  #pragma alloca
  290. #endif /* not _AIX */
  291. #endif /* not MSDOS, or __TURBOC__ */
  292. #endif /* not sparc.  */
  293. #endif /* not GNU C.  */
  294. #endif /* alloca not defined.  */
  295.  
  296. /* This is the parser code that is written into each bison parser
  297.   when the %semantic_parser declaration is not specified in the grammar.
  298.   It was written by Richard Stallman by simplifying the hairy parser
  299.   used when %semantic_parser is specified.  */
  300.  
  301. /* Note: there must be only one dollar sign in this file.
  302.    It is replaced by the list of actions, each action
  303.    as one case of the switch.  */
  304.  
  305. #define yyerrok        (yyerrstatus = 0)
  306. #define yyclearin    (yychar = YYEMPTY)
  307. #define YYEMPTY        -2
  308. #define YYEOF        0
  309. #define YYACCEPT    return(0)
  310. #define YYABORT     return(1)
  311. #define YYERROR        goto yyerrlab1
  312. /* Like YYERROR except do call yyerror.
  313.    This remains here temporarily to ease the
  314.    transition to the new meaning of YYERROR, for GCC.
  315.    Once GCC version 2 has supplanted version 1, this can go.  */
  316. #define YYFAIL        goto yyerrlab
  317. #define YYRECOVERING()  (!!yyerrstatus)
  318. #define YYBACKUP(token, value) \
  319. do                                \
  320.   if (yychar == YYEMPTY && yylen == 1)                \
  321.     { yychar = (token), yylval = (value);            \
  322.       yychar1 = YYTRANSLATE (yychar);                \
  323.       YYPOPSTACK;                        \
  324.       goto yybackup;                        \
  325.     }                                \
  326.   else                                \
  327.     { yyerror ("syntax error: cannot back up"); YYERROR; }    \
  328. while (0)
  329.  
  330. #define YYTERROR    1
  331. #define YYERRCODE    256
  332.  
  333. #ifndef YYPURE
  334. #define YYLEX        yylex()
  335. #endif
  336.  
  337. #ifdef YYPURE
  338. #ifdef YYLSP_NEEDED
  339. #define YYLEX        yylex(&yylval, &yylloc)
  340. #else
  341. #define YYLEX        yylex(&yylval)
  342. #endif
  343. #endif
  344.  
  345. /* If nonreentrant, generate the variables here */
  346.  
  347. #ifndef YYPURE
  348.  
  349. int    yychar;            /*  the lookahead symbol        */
  350. YYSTYPE    yylval;            /*  the semantic value of the        */
  351.                 /*  lookahead symbol            */
  352.  
  353. #ifdef YYLSP_NEEDED
  354. YYLTYPE yylloc;            /*  location data for the lookahead    */
  355.                 /*  symbol                */
  356. #endif
  357.  
  358. int yynerrs;            /*  number of parse errors so far       */
  359. #endif  /* not YYPURE */
  360.  
  361. #if YYDEBUG != 0
  362. int yydebug;            /*  nonzero means print parse trace    */
  363. /* Since this is uninitialized, it does not stop multiple parsers
  364.    from coexisting.  */
  365. #endif
  366.  
  367. /*  YYINITDEPTH indicates the initial size of the parser's stacks    */
  368.  
  369. #ifndef    YYINITDEPTH
  370. #define YYINITDEPTH 200
  371. #endif
  372.  
  373. /*  YYMAXDEPTH is the maximum size the stacks can grow to
  374.     (effective only if the built-in stack extension method is used).  */
  375.  
  376. #if YYMAXDEPTH == 0
  377. #undef YYMAXDEPTH
  378. #endif
  379.  
  380. #ifndef YYMAXDEPTH
  381. #define YYMAXDEPTH 10000
  382. #endif
  383.  
  384. #if __GNUC__ > 1        /* GNU C and GNU C++ define this.  */
  385. #define __yy_bcopy(FROM,TO,COUNT)    __builtin_memcpy(TO,FROM,COUNT)
  386. #else                /* not GNU C or C++ */
  387. #ifndef __cplusplus
  388.  
  389. /* This is the most reliable way to avoid incompatibilities
  390.    in available built-in functions on various systems.  */
  391. static void
  392. __yy_bcopy (from, to, count)
  393.      char *from;
  394.      char *to;
  395.      int count;
  396. {
  397.   register char *f = from;
  398.   register char *t = to;
  399.   register int i = count;
  400.  
  401.   while (i-- > 0)
  402.     *t++ = *f++;
  403. }
  404.  
  405. #else /* __cplusplus */
  406.  
  407. /* This is the most reliable way to avoid incompatibilities
  408.    in available built-in functions on various systems.  */
  409. static void
  410. __yy_bcopy (char *from, char *to, int count)
  411. {
  412.   register char *f = from;
  413.   register char *t = to;
  414.   register int i = count;
  415.  
  416.   while (i-- > 0)
  417.     *t++ = *f++;
  418. }
  419.  
  420. #endif
  421. #endif
  422.  
  423. #line 169 "bison.simple"
  424. int
  425. yyparse()
  426. {
  427.   register int yystate;
  428.   register int yyn;
  429.   register short *yyssp;
  430.   register YYSTYPE *yyvsp;
  431.   int yyerrstatus;    /*  number of tokens to shift before error messages enabled */
  432.   int yychar1;        /*  lookahead token as an internal (translated) token number */
  433.  
  434.   short    yyssa[YYINITDEPTH];    /*  the state stack            */
  435.   YYSTYPE yyvsa[YYINITDEPTH];    /*  the semantic value stack        */
  436.  
  437.   short *yyss = yyssa;        /*  refer to the stacks thru separate pointers */
  438.   YYSTYPE *yyvs = yyvsa;    /*  to allow yyoverflow to reallocate them elsewhere */
  439.  
  440. #ifdef YYLSP_NEEDED
  441.   YYLTYPE yylsa[YYINITDEPTH];    /*  the location stack            */
  442.   YYLTYPE *yyls = yylsa;
  443.   YYLTYPE *yylsp;
  444.  
  445. #define YYPOPSTACK   (yyvsp--, yysp--, yylsp--)
  446. #else
  447. #define YYPOPSTACK   (yyvsp--, yysp--)
  448. #endif
  449.  
  450.   int yystacksize = YYINITDEPTH;
  451.  
  452. #ifdef YYPURE
  453.   int yychar;
  454.   YYSTYPE yylval;
  455.   int yynerrs;
  456. #ifdef YYLSP_NEEDED
  457.   YYLTYPE yylloc;
  458. #endif
  459. #endif
  460.  
  461.   YYSTYPE yyval;        /*  the variable used to return        */
  462.                 /*  semantic values from the action    */
  463.                 /*  routines                */
  464.  
  465.   int yylen;
  466.  
  467. #if YYDEBUG != 0
  468.   if (yydebug)
  469.     fprintf(stderr, "Starting parse\n");
  470. #endif
  471.  
  472.   yystate = 0;
  473.   yyerrstatus = 0;
  474.   yynerrs = 0;
  475.   yychar = YYEMPTY;        /* Cause a token to be read.  */
  476.  
  477.   /* Initialize stack pointers.
  478.      Waste one element of value and location stack
  479.      so that they stay on the same level as the state stack.  */
  480.  
  481.   yyssp = yyss - 1;
  482.   yyvsp = yyvs;
  483. #ifdef YYLSP_NEEDED
  484.   yylsp = yyls;
  485. #endif
  486.  
  487. /* Push a new state, which is found in  yystate  .  */
  488. /* In all cases, when you get here, the value and location stacks
  489.    have just been pushed. so pushing a state here evens the stacks.  */
  490. yynewstate:
  491.  
  492.   *++yyssp = yystate;
  493.  
  494.   if (yyssp >= yyss + yystacksize - 1)
  495.     {
  496.       /* Give user a chance to reallocate the stack */
  497.       /* Use copies of these so that the &'s don't force the real ones into memory. */
  498.       YYSTYPE *yyvs1 = yyvs;
  499.       short *yyss1 = yyss;
  500. #ifdef YYLSP_NEEDED
  501.       YYLTYPE *yyls1 = yyls;
  502. #endif
  503.  
  504.       /* Get the current used size of the three stacks, in elements.  */
  505.       int size = yyssp - yyss + 1;
  506.  
  507. #ifdef yyoverflow
  508.       /* Each stack pointer address is followed by the size of
  509.      the data in use in that stack, in bytes.  */
  510.       yyoverflow("parser stack overflow",
  511.          &yyss1, size * sizeof (*yyssp),
  512.          &yyvs1, size * sizeof (*yyvsp),
  513. #ifdef YYLSP_NEEDED
  514.          &yyls1, size * sizeof (*yylsp),
  515. #endif
  516.          &yystacksize);
  517.  
  518.       yyss = yyss1; yyvs = yyvs1;
  519. #ifdef YYLSP_NEEDED
  520.       yyls = yyls1;
  521. #endif
  522. #else /* no yyoverflow */
  523.       /* Extend the stack our own way.  */
  524.       if (yystacksize >= YYMAXDEPTH)
  525.     {
  526.       yyerror("parser stack overflow");
  527.       return 2;
  528.     }
  529.       yystacksize *= 2;
  530.       if (yystacksize > YYMAXDEPTH)
  531.     yystacksize = YYMAXDEPTH;
  532.       yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
  533.       __yy_bcopy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp));
  534.       yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
  535.       __yy_bcopy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp));
  536. #ifdef YYLSP_NEEDED
  537.       yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp));
  538.       __yy_bcopy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp));
  539. #endif
  540. #endif /* no yyoverflow */
  541.  
  542.       yyssp = yyss + size - 1;
  543.       yyvsp = yyvs + size - 1;
  544. #ifdef YYLSP_NEEDED
  545.       yylsp = yyls + size - 1;
  546. #endif
  547.  
  548. #if YYDEBUG != 0
  549.       if (yydebug)
  550.     fprintf(stderr, "Stack size increased to %d\n", yystacksize);
  551. #endif
  552.  
  553.       if (yyssp >= yyss + yystacksize - 1)
  554.     YYABORT;
  555.     }
  556.  
  557. #if YYDEBUG != 0
  558.   if (yydebug)
  559.     fprintf(stderr, "Entering state %d\n", yystate);
  560. #endif
  561.  
  562.  yybackup:
  563.  
  564. /* Do appropriate processing given the current state.  */
  565. /* Read a lookahead token if we need one and don't already have one.  */
  566. /* yyresume: */
  567.  
  568.   /* First try to decide what to do without reference to lookahead token.  */
  569.  
  570.   yyn = yypact[yystate];
  571.   if (yyn == YYFLAG)
  572.     goto yydefault;
  573.  
  574.   /* Not known => get a lookahead token if don't already have one.  */
  575.  
  576.   /* yychar is either YYEMPTY or YYEOF
  577.      or a valid token in external form.  */
  578.  
  579.   if (yychar == YYEMPTY)
  580.     {
  581. #if YYDEBUG != 0
  582.       if (yydebug)
  583.     fprintf(stderr, "Reading a token: ");
  584. #endif
  585.       yychar = YYLEX;
  586.     }
  587.  
  588.   /* Convert token to internal form (in yychar1) for indexing tables with */
  589.  
  590.   if (yychar <= 0)        /* This means end of input. */
  591.     {
  592.       yychar1 = 0;
  593.       yychar = YYEOF;        /* Don't call YYLEX any more */
  594.  
  595. #if YYDEBUG != 0
  596.       if (yydebug)
  597.     fprintf(stderr, "Now at end of input.\n");
  598. #endif
  599.     }
  600.   else
  601.     {
  602.       yychar1 = YYTRANSLATE(yychar);
  603.  
  604. #if YYDEBUG != 0
  605.       if (yydebug)
  606.     {
  607.       fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
  608.       /* Give the individual parser a way to print the precise meaning
  609.          of a token, for further debugging info.  */
  610. #ifdef YYPRINT
  611.       YYPRINT (stderr, yychar, yylval);
  612. #endif
  613.       fprintf (stderr, ")\n");
  614.     }
  615. #endif
  616.     }
  617.  
  618.   yyn += yychar1;
  619.   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
  620.     goto yydefault;
  621.  
  622.   yyn = yytable[yyn];
  623.  
  624.   /* yyn is what to do for this token type in this state.
  625.      Negative => reduce, -yyn is rule number.
  626.      Positive => shift, yyn is new state.
  627.        New state is final state => don't bother to shift,
  628.        just return success.
  629.      0, or most negative number => error.  */
  630.  
  631.   if (yyn < 0)
  632.     {
  633.       if (yyn == YYFLAG)
  634.     goto yyerrlab;
  635.       yyn = -yyn;
  636.       goto yyreduce;
  637.     }
  638.   else if (yyn == 0)
  639.     goto yyerrlab;
  640.  
  641.   if (yyn == YYFINAL)
  642.     YYACCEPT;
  643.  
  644.   /* Shift the lookahead token.  */
  645.  
  646. #if YYDEBUG != 0
  647.   if (yydebug)
  648.     fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
  649. #endif
  650.  
  651.   /* Discard the token being shifted unless it is eof.  */
  652.   if (yychar != YYEOF)
  653.     yychar = YYEMPTY;
  654.  
  655.   *++yyvsp = yylval;
  656. #ifdef YYLSP_NEEDED
  657.   *++yylsp = yylloc;
  658. #endif
  659.  
  660.   /* count tokens shifted since error; after three, turn off error status.  */
  661.   if (yyerrstatus) yyerrstatus--;
  662.  
  663.   yystate = yyn;
  664.   goto yynewstate;
  665.  
  666. /* Do the default action for the current state.  */
  667. yydefault:
  668.  
  669.   yyn = yydefact[yystate];
  670.   if (yyn == 0)
  671.     goto yyerrlab;
  672.  
  673. /* Do a reduction.  yyn is the number of a rule to reduce with.  */
  674. yyreduce:
  675.   yylen = yyr2[yyn];
  676.   yyval = yyvsp[1-yylen]; /* implement default value of the action */
  677.  
  678. #if YYDEBUG != 0
  679.   if (yydebug)
  680.     {
  681.       int i;
  682.  
  683.       fprintf (stderr, "Reducing via rule %d (line %d), ",
  684.            yyn, yyrline[yyn]);
  685.  
  686.       /* Print the symboles being reduced, and their result.  */
  687.       for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
  688.     fprintf (stderr, "%s ", yytname[yyrhs[i]]);
  689.       fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
  690.     }
  691. #endif
  692.  
  693.  
  694.   switch (yyn) {
  695.  
  696. case 1:
  697. #line 53 "parse.y"
  698. { /* add default rule */
  699.             int def_rule;
  700.  
  701.             pat = cclinit();
  702.             cclnegate( pat );
  703.  
  704.             def_rule = mkstate( -pat );
  705.  
  706.             finish_rule( def_rule, false, 0, 0 );
  707.  
  708.             for ( i = 1; i <= lastsc; ++i )
  709.                 scset[i] = mkbranch( scset[i], def_rule );
  710.  
  711.             if ( spprdflt )
  712.                 fputs( "YY_FATAL_ERROR( \"flex scanner jammed\" )",
  713.                    temp_action_file );
  714.             else
  715.                 fputs( "ECHO", temp_action_file );
  716.  
  717.             fputs( ";\n\tYY_BREAK\n", temp_action_file );
  718.             ;
  719.     break;}
  720. case 2:
  721. #line 77 "parse.y"
  722. {
  723.             /* initialize for processing rules */
  724.  
  725.             /* create default DFA start condition */
  726.             scinstal( "INITIAL", false );
  727.             ;
  728.     break;}
  729. case 5:
  730. #line 88 "parse.y"
  731. { synerr( "unknown error processing section 1" ); ;
  732.     break;}
  733. case 7:
  734. #line 95 "parse.y"
  735. {
  736.             /* these productions are separate from the s1object
  737.              * rule because the semantics must be done before
  738.              * we parse the remainder of an s1object
  739.              */
  740.  
  741.             xcluflg = false;
  742.             ;
  743.     break;}
  744. case 8:
  745. #line 105 "parse.y"
  746. { xcluflg = true; ;
  747.     break;}
  748. case 9:
  749. #line 109 "parse.y"
  750. { scinstal( nmstr, xcluflg ); ;
  751.     break;}
  752. case 10:
  753. #line 112 "parse.y"
  754. { scinstal( nmstr, xcluflg ); ;
  755.     break;}
  756. case 11:
  757. #line 115 "parse.y"
  758. { synerr( "bad start condition list" ); ;
  759.     break;}
  760. case 14:
  761. #line 123 "parse.y"
  762. {
  763.             /* initialize for a parse of one rule */
  764.             trlcontxt = variable_trail_rule = varlength = false;
  765.             trailcnt = headcnt = rulelen = 0;
  766.             current_state_type = STATE_NORMAL;
  767.             previous_continued_action = continued_action;
  768.             new_rule();
  769.             ;
  770.     break;}
  771. case 15:
  772. #line 134 "parse.y"
  773. {
  774.             pat = yyvsp[0];
  775.             finish_rule( pat, variable_trail_rule,
  776.                      headcnt, trailcnt );
  777.  
  778.             for ( i = 1; i <= actvp; ++i )
  779.                 scbol[actvsc[i]] =
  780.                 mkbranch( scbol[actvsc[i]], pat );
  781.  
  782.             if ( ! bol_needed )
  783.                 {
  784.                 bol_needed = true;
  785.  
  786.                 if ( performance_report )
  787.                 pinpoint_message( 
  788.                 "'^' operator results in sub-optimal performance" );
  789.                 }
  790.             ;
  791.     break;}
  792. case 16:
  793. #line 154 "parse.y"
  794. {
  795.             pat = yyvsp[0];
  796.             finish_rule( pat, variable_trail_rule,
  797.                      headcnt, trailcnt );
  798.  
  799.             for ( i = 1; i <= actvp; ++i )
  800.                 scset[actvsc[i]] =
  801.                 mkbranch( scset[actvsc[i]], pat );
  802.             ;
  803.     break;}
  804. case 17:
  805. #line 165 "parse.y"
  806. {
  807.             pat = yyvsp[0];
  808.             finish_rule( pat, variable_trail_rule,
  809.                      headcnt, trailcnt );
  810.  
  811.             /* add to all non-exclusive start conditions,
  812.              * including the default (0) start condition
  813.              */
  814.  
  815.             for ( i = 1; i <= lastsc; ++i )
  816.                 if ( ! scxclu[i] )
  817.                 scbol[i] = mkbranch( scbol[i], pat );
  818.  
  819.             if ( ! bol_needed )
  820.                 {
  821.                 bol_needed = true;
  822.  
  823.                 if ( performance_report )
  824.                 pinpoint_message(
  825.                 "'^' operator results in sub-optimal performance" );
  826.                 }
  827.             ;
  828.     break;}
  829. case 18:
  830. #line 189 "parse.y"
  831. {
  832.             pat = yyvsp[0];
  833.             finish_rule( pat, variable_trail_rule,
  834.                      headcnt, trailcnt );
  835.  
  836.             for ( i = 1; i <= lastsc; ++i )
  837.                 if ( ! scxclu[i] )
  838.                 scset[i] = mkbranch( scset[i], pat );
  839.             ;
  840.     break;}
  841. case 19:
  842. #line 200 "parse.y"
  843. { build_eof_action(); ;
  844.     break;}
  845. case 20:
  846. #line 203 "parse.y"
  847. {
  848.             /* this EOF applies to all start conditions
  849.              * which don't already have EOF actions
  850.              */
  851.             actvp = 0;
  852.  
  853.             for ( i = 1; i <= lastsc; ++i )
  854.                 if ( ! sceof[i] )
  855.                 actvsc[++actvp] = i;
  856.  
  857.             if ( actvp == 0 )
  858.                 pinpoint_message(
  859.         "warning - all start conditions already have <<EOF>> rules" );
  860.  
  861.             else
  862.                 build_eof_action();
  863.             ;
  864.     break;}
  865. case 21:
  866. #line 222 "parse.y"
  867. { synerr( "unrecognized rule" ); ;
  868.     break;}
  869. case 23:
  870. #line 229 "parse.y"
  871. {
  872.             if ( (scnum = sclookup( nmstr )) == 0 )
  873.                 format_pinpoint_message(
  874.                 "undeclared start condition %s", nmstr );
  875.  
  876.             else
  877.                 actvsc[++actvp] = scnum;
  878.             ;
  879.     break;}
  880. case 24:
  881. #line 239 "parse.y"
  882. {
  883.             if ( (scnum = sclookup( nmstr )) == 0 )
  884.                 format_pinpoint_message(
  885.                 "undeclared start condition %s", nmstr );
  886.             else
  887.                 actvsc[actvp = 1] = scnum;
  888.             ;
  889.     break;}
  890. case 25:
  891. #line 248 "parse.y"
  892. { synerr( "bad start condition list" ); ;
  893.     break;}
  894. case 26:
  895. #line 252 "parse.y"
  896. {
  897.             if ( transchar[lastst[yyvsp[0]]] != SYM_EPSILON )
  898.                 /* provide final transition \now/ so it
  899.                  * will be marked as a trailing context
  900.                  * state
  901.                  */
  902.                 yyvsp[0] = link_machines( yyvsp[0], mkstate( SYM_EPSILON ) );
  903.  
  904.             mark_beginning_as_normal( yyvsp[0] );
  905.             current_state_type = STATE_NORMAL;
  906.  
  907.             if ( previous_continued_action )
  908.                 {
  909.                 /* we need to treat this as variable trailing
  910.                  * context so that the backup does not happen
  911.                  * in the action but before the action switch
  912.                  * statement.  If the backup happens in the
  913.                  * action, then the rules "falling into" this
  914.                  * one's action will *also* do the backup,
  915.                  * erroneously.
  916.                  */
  917.                 if ( ! varlength || headcnt != 0 )
  918.                 {
  919.                 fprintf( stderr,
  920.     "%s: warning - trailing context rule at line %d made variable because\n",
  921.                      program_name, linenum );
  922.                 fprintf( stderr,
  923.                      "      of preceding '|' action\n" );
  924.                 }
  925.  
  926.                 /* mark as variable */
  927.                 varlength = true;
  928.                 headcnt = 0;
  929.                 }
  930.  
  931.             if ( varlength && headcnt == 0 )
  932.                 { /* variable trailing context rule */
  933.                 /* mark the first part of the rule as the accepting
  934.                  * "head" part of a trailing context rule
  935.                  */
  936.                 /* by the way, we didn't do this at the beginning
  937.                  * of this production because back then
  938.                  * current_state_type was set up for a trail
  939.                  * rule, and add_accept() can create a new
  940.                  * state ...
  941.                  */
  942.                 add_accept( yyvsp[-1], num_rules | YY_TRAILING_HEAD_MASK );
  943.                 variable_trail_rule = true;
  944.                 }
  945.             
  946.             else
  947.                 trailcnt = rulelen;
  948.  
  949.             yyval = link_machines( yyvsp[-1], yyvsp[0] );
  950.             ;
  951.     break;}
  952. case 27:
  953. #line 309 "parse.y"
  954. { synerr( "trailing context used twice" ); ;
  955.     break;}
  956. case 28:
  957. #line 312 "parse.y"
  958. {
  959.             if ( trlcontxt )
  960.                 {
  961.                 synerr( "trailing context used twice" );
  962.                 yyval = mkstate( SYM_EPSILON );
  963.                 }
  964.  
  965.             else if ( previous_continued_action )
  966.                 {
  967.                 /* see the comment in the rule for "re2 re"
  968.                  * above
  969.                  */
  970.                 if ( ! varlength || headcnt != 0 )
  971.                 {
  972.                 fprintf( stderr,
  973.     "%s: warning - trailing context rule at line %d made variable because\n",
  974.                      program_name, linenum );
  975.                 fprintf( stderr,
  976.                      "      of preceding '|' action\n" );
  977.                 }
  978.  
  979.                 /* mark as variable */
  980.                 varlength = true;
  981.                 headcnt = 0;
  982.                 }
  983.  
  984.             if ( varlength && headcnt == 0 )
  985.                 {
  986.                 /* again, see the comment in the rule for "re2 re"
  987.                  * above
  988.                  */
  989.                 add_accept( yyvsp[-1], num_rules | YY_TRAILING_HEAD_MASK );
  990.                 variable_trail_rule = true;
  991.                 }
  992.  
  993.             else
  994.                 {
  995.                 if ( ! varlength )
  996.                 headcnt = rulelen;
  997.  
  998.                 ++rulelen;
  999.                 trailcnt = 1;
  1000.                 }
  1001.  
  1002.             trlcontxt = true;
  1003.  
  1004.             eps = mkstate( SYM_EPSILON );
  1005.             yyval = link_machines( yyvsp[-1],
  1006.                  link_machines( eps, mkstate( '\n' ) ) );
  1007.             ;
  1008.     break;}
  1009. case 29:
  1010. #line 364 "parse.y"
  1011. {
  1012.                 yyval = yyvsp[0];
  1013.  
  1014.             if ( trlcontxt )
  1015.                 {
  1016.                 if ( varlength && headcnt == 0 )
  1017.                 /* both head and trail are variable-length */
  1018.                 variable_trail_rule = true;
  1019.                 else
  1020.                 trailcnt = rulelen;
  1021.                 }
  1022.                 ;
  1023.     break;}
  1024. case 30:
  1025. #line 380 "parse.y"
  1026. {
  1027.             varlength = true;
  1028.             yyval = mkor( yyvsp[-2], yyvsp[0] );
  1029.             ;
  1030.     break;}
  1031. case 31:
  1032. #line 386 "parse.y"
  1033. { yyval = yyvsp[0]; ;
  1034.     break;}
  1035. case 32:
  1036. #line 391 "parse.y"
  1037. {
  1038.             /* this rule is written separately so
  1039.              * the reduction will occur before the trailing
  1040.              * series is parsed
  1041.              */
  1042.  
  1043.             if ( trlcontxt )
  1044.                 synerr( "trailing context used twice" );
  1045.             else
  1046.                 trlcontxt = true;
  1047.  
  1048.             if ( varlength )
  1049.                 /* we hope the trailing context is fixed-length */
  1050.                 varlength = false;
  1051.             else
  1052.                 headcnt = rulelen;
  1053.  
  1054.             rulelen = 0;
  1055.  
  1056.             current_state_type = STATE_TRAILING_CONTEXT;
  1057.             yyval = yyvsp[-1];
  1058.             ;
  1059.     break;}
  1060. case 33:
  1061. #line 416 "parse.y"
  1062. {
  1063.             /* this is where concatenation of adjacent patterns
  1064.              * gets done
  1065.              */
  1066.             yyval = link_machines( yyvsp[-1], yyvsp[0] );
  1067.             ;
  1068.     break;}
  1069. case 34:
  1070. #line 424 "parse.y"
  1071. { yyval = yyvsp[0]; ;
  1072.     break;}
  1073. case 35:
  1074. #line 428 "parse.y"
  1075. {
  1076.             varlength = true;
  1077.  
  1078.             yyval = mkclos( yyvsp[-1] );
  1079.             ;
  1080.     break;}
  1081. case 36:
  1082. #line 435 "parse.y"
  1083. {
  1084.             varlength = true;
  1085.  
  1086.             yyval = mkposcl( yyvsp[-1] );
  1087.             ;
  1088.     break;}
  1089. case 37:
  1090. #line 442 "parse.y"
  1091. {
  1092.             varlength = true;
  1093.  
  1094.             yyval = mkopt( yyvsp[-1] );
  1095.             ;
  1096.     break;}
  1097. case 38:
  1098. #line 449 "parse.y"
  1099. {
  1100.             varlength = true;
  1101.  
  1102.             if ( yyvsp[-3] > yyvsp[-1] || yyvsp[-3] < 0 )
  1103.                 {
  1104.                 synerr( "bad iteration values" );
  1105.                 yyval = yyvsp[-5];
  1106.                 }
  1107.             else
  1108.                 {
  1109.                 if ( yyvsp[-3] == 0 )
  1110.                 {
  1111.                 if ( yyvsp[-1] <= 0 )
  1112.                     {
  1113.                     synerr( "bad iteration values" );
  1114.                     yyval = yyvsp[-5];
  1115.                     }
  1116.                 else
  1117.                     yyval = mkopt( mkrep( yyvsp[-5], 1, yyvsp[-1] ) );
  1118.                 }
  1119.                 else
  1120.                 yyval = mkrep( yyvsp[-5], yyvsp[-3], yyvsp[-1] );
  1121.                 }
  1122.             ;
  1123.     break;}
  1124. case 39:
  1125. #line 475 "parse.y"
  1126. {
  1127.             varlength = true;
  1128.  
  1129.             if ( yyvsp[-2] <= 0 )
  1130.                 {
  1131.                 synerr( "iteration value must be positive" );
  1132.                 yyval = yyvsp[-4];
  1133.                 }
  1134.  
  1135.             else
  1136.                 yyval = mkrep( yyvsp[-4], yyvsp[-2], INFINITY );
  1137.             ;
  1138.     break;}
  1139. case 40:
  1140. #line 489 "parse.y"
  1141. {
  1142.             /* the singleton could be something like "(foo)",
  1143.              * in which case we have no idea what its length
  1144.              * is, so we punt here.
  1145.              */
  1146.             varlength = true;
  1147.  
  1148.             if ( yyvsp[-1] <= 0 )
  1149.                 {
  1150.                 synerr( "iteration value must be positive" );
  1151.                 yyval = yyvsp[-3];
  1152.                 }
  1153.  
  1154.             else
  1155.                 yyval = link_machines( yyvsp[-3], copysingl( yyvsp[-3], yyvsp[-1] - 1 ) );
  1156.             ;
  1157.     break;}
  1158. case 41:
  1159. #line 507 "parse.y"
  1160. {
  1161.             if ( ! madeany )
  1162.                 {
  1163.                 /* create the '.' character class */
  1164.                 anyccl = cclinit();
  1165.                 ccladd( anyccl, '\n' );
  1166.                 cclnegate( anyccl );
  1167.  
  1168.                 if ( useecs )
  1169.                 mkeccl( ccltbl + cclmap[anyccl],
  1170.                     ccllen[anyccl], nextecm,
  1171.                     ecgroup, csize, csize );
  1172.  
  1173.                 madeany = true;
  1174.                 }
  1175.  
  1176.             ++rulelen;
  1177.  
  1178.             yyval = mkstate( -anyccl );
  1179.             ;
  1180.     break;}
  1181. case 42:
  1182. #line 529 "parse.y"
  1183. {
  1184.             if ( ! cclsorted )
  1185.                 /* sort characters for fast searching.  We use a
  1186.                  * shell sort since this list could be large.
  1187.                  */
  1188.                 cshell( ccltbl + cclmap[yyvsp[0]], ccllen[yyvsp[0]], true );
  1189.  
  1190.             if ( useecs )
  1191.                 mkeccl( ccltbl + cclmap[yyvsp[0]], ccllen[yyvsp[0]],
  1192.                     nextecm, ecgroup, csize, csize );
  1193.  
  1194.             ++rulelen;
  1195.  
  1196.             yyval = mkstate( -yyvsp[0] );
  1197.             ;
  1198.     break;}
  1199. case 43:
  1200. #line 546 "parse.y"
  1201. {
  1202.             ++rulelen;
  1203.  
  1204.             yyval = mkstate( -yyvsp[0] );
  1205.             ;
  1206.     break;}
  1207. case 44:
  1208. #line 553 "parse.y"
  1209. { yyval = yyvsp[-1]; ;
  1210.     break;}
  1211. case 45:
  1212. #line 556 "parse.y"
  1213. { yyval = yyvsp[-1]; ;
  1214.     break;}
  1215. case 46:
  1216. #line 559 "parse.y"
  1217. {
  1218.             ++rulelen;
  1219.  
  1220.             if ( caseins && yyvsp[0] >= 'A' && yyvsp[0] <= 'Z' )
  1221.                 yyvsp[0] = clower( yyvsp[0] );
  1222.  
  1223.             yyval = mkstate( yyvsp[0] );
  1224.             ;
  1225.     break;}
  1226. case 47:
  1227. #line 570 "parse.y"
  1228. { yyval = yyvsp[-1]; ;
  1229.     break;}
  1230. case 48:
  1231. #line 573 "parse.y"
  1232. {
  1233.             /* *Sigh* - to be compatible Unix lex, negated ccls
  1234.              * match newlines
  1235.              */
  1236. #ifdef NOTDEF
  1237.             ccladd( yyvsp[-1], '\n' ); /* negated ccls don't match '\n' */
  1238.             cclsorted = false; /* because we added the newline */
  1239. #endif
  1240.             cclnegate( yyvsp[-1] );
  1241.             yyval = yyvsp[-1];
  1242.             ;
  1243.     break;}
  1244. case 49:
  1245. #line 587 "parse.y"
  1246. {
  1247.             if ( yyvsp[-2] > yyvsp[0] )
  1248.                 synerr( "negative range in character class" );
  1249.  
  1250.             else
  1251.                 {
  1252.                 if ( caseins )
  1253.                 {
  1254.                 if ( yyvsp[-2] >= 'A' && yyvsp[-2] <= 'Z' )
  1255.                     yyvsp[-2] = clower( yyvsp[-2] );
  1256.                 if ( yyvsp[0] >= 'A' && yyvsp[0] <= 'Z' )
  1257.                     yyvsp[0] = clower( yyvsp[0] );
  1258.                 }
  1259.  
  1260.                 for ( i = yyvsp[-2]; i <= yyvsp[0]; ++i )
  1261.                     ccladd( yyvsp[-3], i );
  1262.  
  1263.                 /* keep track if this ccl is staying in alphabetical
  1264.                  * order
  1265.                  */
  1266.                 cclsorted = cclsorted && (yyvsp[-2] > lastchar);
  1267.                 lastchar = yyvsp[0];
  1268.                 }
  1269.  
  1270.             yyval = yyvsp[-3];
  1271.             ;
  1272.     break;}
  1273. case 50:
  1274. #line 615 "parse.y"
  1275. {
  1276.             if ( caseins )
  1277.                 if ( yyvsp[0] >= 'A' && yyvsp[0] <= 'Z' )
  1278.                 yyvsp[0] = clower( yyvsp[0] );
  1279.  
  1280.             ccladd( yyvsp[-1], yyvsp[0] );
  1281.             cclsorted = cclsorted && (yyvsp[0] > lastchar);
  1282.             lastchar = yyvsp[0];
  1283.             yyval = yyvsp[-1];
  1284.             ;
  1285.     break;}
  1286. case 51:
  1287. #line 627 "parse.y"
  1288. {
  1289.             cclsorted = true;
  1290.             lastchar = 0;
  1291.             yyval = cclinit();
  1292.             ;
  1293.     break;}
  1294. case 52:
  1295. #line 635 "parse.y"
  1296. {
  1297.             if ( caseins )
  1298.                 if ( yyvsp[0] >= 'A' && yyvsp[0] <= 'Z' )
  1299.                 yyvsp[0] = clower( yyvsp[0] );
  1300.  
  1301.             ++rulelen;
  1302.  
  1303.             yyval = link_machines( yyvsp[-1], mkstate( yyvsp[0] ) );
  1304.             ;
  1305.     break;}
  1306. case 53:
  1307. #line 646 "parse.y"
  1308. { yyval = mkstate( SYM_EPSILON ); ;
  1309.     break;}
  1310. }
  1311.    /* the action file gets copied in in place of this dollarsign */
  1312. #line 440 "bison.simple"
  1313.  
  1314.   yyvsp -= yylen;
  1315.   yyssp -= yylen;
  1316. #ifdef YYLSP_NEEDED
  1317.   yylsp -= yylen;
  1318. #endif
  1319.  
  1320. #if YYDEBUG != 0
  1321.   if (yydebug)
  1322.     {
  1323.       short *ssp1 = yyss - 1;
  1324.       fprintf (stderr, "state stack now");
  1325.       while (ssp1 != yyssp)
  1326.     fprintf (stderr, " %d", *++ssp1);
  1327.       fprintf (stderr, "\n");
  1328.     }
  1329. #endif
  1330.  
  1331.   *++yyvsp = yyval;
  1332.  
  1333. #ifdef YYLSP_NEEDED
  1334.   yylsp++;
  1335.   if (yylen == 0)
  1336.     {
  1337.       yylsp->first_line = yylloc.first_line;
  1338.       yylsp->first_column = yylloc.first_column;
  1339.       yylsp->last_line = (yylsp-1)->last_line;
  1340.       yylsp->last_column = (yylsp-1)->last_column;
  1341.       yylsp->text = 0;
  1342.     }
  1343.   else
  1344.     {
  1345.       yylsp->last_line = (yylsp+yylen-1)->last_line;
  1346.       yylsp->last_column = (yylsp+yylen-1)->last_column;
  1347.     }
  1348. #endif
  1349.  
  1350.   /* Now "shift" the result of the reduction.
  1351.      Determine what state that goes to,
  1352.      based on the state we popped back to
  1353.      and the rule number reduced by.  */
  1354.  
  1355.   yyn = yyr1[yyn];
  1356.  
  1357.   yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
  1358.   if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
  1359.     yystate = yytable[yystate];
  1360.   else
  1361.     yystate = yydefgoto[yyn - YYNTBASE];
  1362.  
  1363.   goto yynewstate;
  1364.  
  1365. yyerrlab:   /* here on detecting error */
  1366.  
  1367.   if (! yyerrstatus)
  1368.     /* If not already recovering from an error, report this error.  */
  1369.     {
  1370.       ++yynerrs;
  1371.  
  1372. #ifdef YYERROR_VERBOSE
  1373.       yyn = yypact[yystate];
  1374.  
  1375.       if (yyn > YYFLAG && yyn < YYLAST)
  1376.     {
  1377.       int size = 0;
  1378.       char *msg;
  1379.       int x, count;
  1380.  
  1381.       count = 0;
  1382.       for (x = 0; x < (sizeof(yytname) / sizeof(char *)); x++)
  1383.         if (yycheck[x + yyn] == x)
  1384.           size += strlen(yytname[x]) + 15, count++;
  1385.       msg = (char *) xmalloc(size + 15);
  1386.       strcpy(msg, "parse error");
  1387.  
  1388.       if (count < 5)
  1389.         {
  1390.           count = 0;
  1391.           for (x = 0; x < (sizeof(yytname) / sizeof(char *)); x++)
  1392.         if (yycheck[x + yyn] == x)
  1393.           {
  1394.             strcat(msg, count == 0 ? ", expecting `" : " or `");
  1395.             strcat(msg, yytname[x]);
  1396.             strcat(msg, "'");
  1397.             count++;
  1398.           }
  1399.         }
  1400.       yyerror(msg);
  1401.       free(msg);
  1402.     }
  1403.       else
  1404. #endif /* YYERROR_VERBOSE */
  1405.     yyerror("parse error");
  1406.     }
  1407.  
  1408. yyerrlab1:   /* here on error raised explicitly by an action */
  1409.  
  1410.   if (yyerrstatus == 3)
  1411.     {
  1412.       /* if just tried and failed to reuse lookahead token after an error, discard it.  */
  1413.  
  1414.       /* return failure if at end of input */
  1415.       if (yychar == YYEOF)
  1416.     YYABORT;
  1417.  
  1418. #if YYDEBUG != 0
  1419.       if (yydebug)
  1420.     fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
  1421. #endif
  1422.  
  1423.       yychar = YYEMPTY;
  1424.     }
  1425.  
  1426.   /* Else will try to reuse lookahead token
  1427.      after shifting the error token.  */
  1428.  
  1429.   yyerrstatus = 3;        /* Each real token shifted decrements this */
  1430.  
  1431.   goto yyerrhandle;
  1432.  
  1433. yyerrdefault:  /* current state does not do anything special for the error token. */
  1434.  
  1435. #if 0
  1436.   /* This is wrong; only states that explicitly want error tokens
  1437.      should shift them.  */
  1438.   yyn = yydefact[yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
  1439.   if (yyn) goto yydefault;
  1440. #endif
  1441.  
  1442. yyerrpop:   /* pop the current state because it cannot handle the error token */
  1443.  
  1444.   if (yyssp == yyss) YYABORT;
  1445.   yyvsp--;
  1446.   yystate = *--yyssp;
  1447. #ifdef YYLSP_NEEDED
  1448.   yylsp--;
  1449. #endif
  1450.  
  1451. #if YYDEBUG != 0
  1452.   if (yydebug)
  1453.     {
  1454.       short *ssp1 = yyss - 1;
  1455.       fprintf (stderr, "Error: state stack now");
  1456.       while (ssp1 != yyssp)
  1457.     fprintf (stderr, " %d", *++ssp1);
  1458.       fprintf (stderr, "\n");
  1459.     }
  1460. #endif
  1461.  
  1462. yyerrhandle:
  1463.  
  1464.   yyn = yypact[yystate];
  1465.   if (yyn == YYFLAG)
  1466.     goto yyerrdefault;
  1467.  
  1468.   yyn += YYTERROR;
  1469.   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
  1470.     goto yyerrdefault;
  1471.  
  1472.   yyn = yytable[yyn];
  1473.   if (yyn < 0)
  1474.     {
  1475.       if (yyn == YYFLAG)
  1476.     goto yyerrpop;
  1477.       yyn = -yyn;
  1478.       goto yyreduce;
  1479.     }
  1480.   else if (yyn == 0)
  1481.     goto yyerrpop;
  1482.  
  1483.   if (yyn == YYFINAL)
  1484.     YYACCEPT;
  1485.  
  1486. #if YYDEBUG != 0
  1487.   if (yydebug)
  1488.     fprintf(stderr, "Shifting error token, ");
  1489. #endif
  1490.  
  1491.   *++yyvsp = yylval;
  1492. #ifdef YYLSP_NEEDED
  1493.   *++yylsp = yylloc;
  1494. #endif
  1495.  
  1496.   yystate = yyn;
  1497.   goto yynewstate;
  1498. }
  1499. #line 649 "parse.y"
  1500.  
  1501.  
  1502.  
  1503. /* build_eof_action - build the "<<EOF>>" action for the active start
  1504.  *                    conditions
  1505.  */
  1506.  
  1507. void build_eof_action()
  1508.  
  1509.     {
  1510.     register int i;
  1511.  
  1512.     for ( i = 1; i <= actvp; ++i )
  1513.     {
  1514.     if ( sceof[actvsc[i]] )
  1515.         format_pinpoint_message(
  1516.         "multiple <<EOF>> rules for start condition %s",
  1517.             scname[actvsc[i]] );
  1518.  
  1519.     else
  1520.         {
  1521.         sceof[actvsc[i]] = true;
  1522.         fprintf( temp_action_file, "case YY_STATE_EOF(%s):\n",
  1523.              scname[actvsc[i]] );
  1524.         }
  1525.     }
  1526.  
  1527.     line_directive_out( temp_action_file );
  1528.     }
  1529.  
  1530.  
  1531. /* synerr - report a syntax error */
  1532.  
  1533. void synerr( str )
  1534. char str[];
  1535.  
  1536.     {
  1537.     syntaxerror = true;
  1538.     pinpoint_message( str );
  1539.     }
  1540.  
  1541.  
  1542. /* format_pinpoint_message - write out a message formatted with one string,
  1543.  *                 pinpointing its location
  1544.  */
  1545.  
  1546. void format_pinpoint_message( msg, arg )
  1547. char msg[], arg[];
  1548.  
  1549.     {
  1550.     char errmsg[MAXLINE];
  1551.  
  1552.     (void) sprintf( errmsg, msg, arg );
  1553.     pinpoint_message( errmsg );
  1554.     }
  1555.  
  1556.  
  1557. /* pinpoint_message - write out a message, pinpointing its location */
  1558.  
  1559. void pinpoint_message( str )
  1560. char str[];
  1561.  
  1562.     {
  1563.     fprintf( stderr, "\"%s\", line %d: %s\n", infilename, linenum, str );
  1564.     }
  1565.  
  1566.  
  1567. /* yyerror - eat up an error message from the parser;
  1568.  *         currently, messages are ignore
  1569.  */
  1570.  
  1571. void yyerror( msg )
  1572. char msg[];
  1573.  
  1574.     {
  1575.     }
  1576.