home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / program / 322 / flex / parse.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-10-20  |  16.7 KB  |  701 lines

  1. # define CHAR 257
  2. # define NUMBER 258
  3. # define SECTEND 259
  4. # define SCDECL 260
  5. # define XSCDECL 261
  6. # define WHITESPACE 262
  7. # define NAME 263
  8. # define PREVCCL 264
  9.   
  10. # line 18 "parse.y"
  11. #include "flexdef.h"
  12.  
  13. int pat, scnum, eps, headcnt, trailcnt, anyccl, lastchar, i, actvp, rulelen;
  14. int trlcontxt, xcluflg, cclsorted, varlength;
  15. char clower();
  16.  
  17. static int madeany = false;  /* whether we've made the '.' character class */
  18.  
  19. #define yyclearin yychar = -1
  20. #define yyerrok yyerrflag = 0
  21. extern int yychar;
  22. extern short yyerrflag;
  23. #ifndef YYMAXDEPTH
  24. #define YYMAXDEPTH 150
  25. #endif
  26. #ifndef YYSTYPE
  27. #define YYSTYPE int
  28. #endif
  29. YYSTYPE yylval, yyval;
  30. # define YYERRCODE 256
  31.  
  32. # line 456 "parse.y"
  33.  
  34.  
  35. /* synerr - report a syntax error
  36.  *
  37.  * synopsis
  38.  *    char str[];
  39.  *    synerr( str );
  40.  */
  41.  
  42. synerr( str )
  43. char str[];
  44.  
  45.     {
  46.     syntaxerror = true;
  47.     fprintf( stderr, "Syntax error at line %d:  %s\n", linenum, str );
  48.     }
  49.  
  50.  
  51. /* yyerror - eat up an error message from the parser
  52.  *
  53.  * synopsis
  54.  *    char msg[];
  55.  *    yyerror( msg );
  56.  */
  57.  
  58. yyerror( msg )
  59. char msg[];
  60.  
  61.     {
  62.     }
  63. short yyexca[] ={
  64. -1, 1,
  65.     0, -1,
  66.     -2, 0,
  67. -1, 11,
  68.     0, 1,
  69.     -2, 14,
  70.     };
  71. # define YYNPROD 51
  72. # define YYLAST 268
  73. short yyact[]={
  74.  
  75.   29,  29,  29,  45,  16,  71,  30,  30,  30,  56,
  76.   44,  15,  26,  26,  26,  33,   7,   8,   9,  77,
  77.   12,  75,  67,  64,  63,  78,  22,   4,  72,  42,
  78.   79,  66,  55,  39,  48,  49,  54,  41,  62,  25,
  79.   41,  74,  24,  20,  35,  10,  52,  27,  23,  43,
  80.   18,  17,  13,  14,   6,  50,  61,  32,  32,  32,
  81.   19,  36,  37,  38,  47,  11,  46,   5,   3,   2,
  82.    1,  58,  59,   0,  53,   0,   0,   0,   0,   0,
  83.   57,   0,   0,  60,   0,   0,  47,   0,   0,   0,
  84.    0,  70,  69,   0,   0,   0,   0,   0,   0,   0,
  85.   47,   0,   0,   0,   0,   0,   0,   0,   0,  73,
  86.    0,   0,   0,   0,  40,  51,   0,  40,   0,   0,
  87.    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
  88.    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
  89.    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
  90.    0,   0,  76,   0,   0,   0,   0,   0,   0,   0,
  91.    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
  92.    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
  93.    0,   0,   0,   0,   0,  68,  68,   0,   0,   0,
  94.    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
  95.    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
  96.    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
  97.    0,   0,  21,  31,  31,  31,   0,   0,   0,   0,
  98.   28,  28,  28,   0,   0,   0,   0,   0,   0,   0,
  99.    0,   0,   0,   0,   0,   0,  65,   0,   0,   0,
  100.    0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
  101.    0,   0,   0,   0,   0,   0,   0,  34 };
  102. short yypact[]={
  103.  
  104. -1000,-1000,-229,-243,  35,-1000,-242,-1000,-1000,-1000,
  105. -1000,-1000,-252, -34,   5,-1000,-1000,  34, -33, -32,
  106.   -7,-1000,-253, -32, -32,  -8,-1000,-1000,-1000,-1000,
  107.  -32,-1000, -62,-1000,-254,-1000, -32,  -7,  -7,-1000,
  108.  -32,-1000,-1000,  -6,-1000,-1000, -32,  -8,-1000,-1000,
  109. -1000,-234, -11, -10, -71,-1000,-1000,  -7,-1000,-1000,
  110.  -32,-1000,-258, -16,-1000,-1000,-1000,-1000,  -4, -72,
  111. -1000,-1000,-106,-1000,-232,-1000, -95,-1000,-1000,-1000 };
  112. short yypgo[]={
  113.  
  114.    0,  70,  69,  68,  67,  65,  54,  53,  52,  51,
  115.   50,  43,  33,  49,  42,  48,  39,  47,  46,  36 };
  116. short yyr1[]={
  117.  
  118.    0,   1,   2,   3,   3,   3,   4,   6,   6,   7,
  119.    7,   7,   5,   5,   8,   9,   9,   9,   9,   9,
  120.   10,  13,  13,  13,  12,  12,  11,  11,  11,  15,
  121.   14,  14,  16,  16,  16,  16,  16,  16,  16,  16,
  122.   16,  16,  16,  16,  17,  17,  19,  19,  19,  18,
  123.   18 };
  124. short yyr2[]={
  125.  
  126.    0,   4,   0,   5,   0,   2,   1,   1,   1,   3,
  127.    1,   1,   4,   0,   0,   4,   3,   3,   2,   1,
  128.    3,   3,   1,   1,   1,   0,   3,   2,   1,   2,
  129.    2,   1,   2,   2,   2,   6,   5,   4,   1,   1,
  130.    1,   3,   3,   1,   3,   4,   4,   2,   0,   2,
  131.    0 };
  132. short yychk[]={
  133.  
  134. -1000,  -1,  -2,  -3, 256,  -4,  -6, 259, 260, 261,
  135.   10,  -5, 262,  -8,  -7, 263, 256,  -9, -10,  94,
  136.  -11, 256,  60, -15, -14, -16,  46, -17, 264,  34,
  137.   40, 257,  91,  10, 262,  10,  94, -11, -11, -12,
  138.  124,  47,  36, -13, 263, 256, -14, -16,  42,  43,
  139.   63, 123, -18, -11, -19,  94, 263, -11, -12, -12,
  140.  -14,  62,  44, 258,  34, 257,  41,  93, 257, -19,
  141.  -12, 263,  44, 125,  45,  93, 258, 125, 257, 125 };
  142. short yydef[]={
  143.  
  144.    2,  -2,   4,   0,   0,  13,   0,   6,   7,   8,
  145.    5,  -2,   0,   0,   0,  10,  11,   0,   0,   0,
  146.   25,  19,   0,   0,  28,  31,  38,  39,  40,  50,
  147.    0,  43,  48,   3,   0,  12,   0,  25,  25,  18,
  148.    0,  29,  24,   0,  22,  23,  27,  30,  32,  33,
  149.   34,   0,   0,   0,   0,  48,   9,  25,  16,  17,
  150.   26,  20,   0,   0,  41,  49,  42,  44,  47,   0,
  151.   15,  21,   0,  37,   0,  45,   0,  36,  46,  35 };
  152. #ifndef lint
  153. static char yaccpar_sccsid[] = "@(#)yaccpar    4.1    (Berkeley)    2/11/83";
  154. #endif not lint
  155.  
  156. #
  157. # define YYFLAG -1000
  158. # define YYERROR goto yyerrlab
  159. # define YYACCEPT return(0)
  160. # define YYABORT return(1)
  161.  
  162. /*    parser for yacc output    */
  163.  
  164. #ifdef YYDEBUG
  165. int yydebug = 0; /* 1 for debugging */
  166. #endif
  167. YYSTYPE yyv[YYMAXDEPTH]; /* where the values are stored */
  168. int yychar = -1; /* current input token number */
  169. int yynerrs = 0;  /* number of errors */
  170. short yyerrflag = 0;  /* error recovery flag */
  171.  
  172. yyparse() {
  173.  
  174.     short yys[YYMAXDEPTH];
  175.     short yyj, yym;
  176.     register YYSTYPE *yypvt;
  177.     register short yystate, *yyps, yyn;
  178.     register YYSTYPE *yypv;
  179.     register short *yyxi;
  180.  
  181.     yystate = 0;
  182.     yychar = -1;
  183.     yynerrs = 0;
  184.     yyerrflag = 0;
  185.     yyps= &yys[-1];
  186.     yypv= &yyv[-1];
  187.  
  188.  yystack:    /* put a state and value onto the stack */
  189.  
  190. #ifdef YYDEBUG
  191.     if( yydebug  ) printf( "state %d, char 0%o\n", yystate, yychar );
  192. #endif
  193.         if( ++yyps> &yys[YYMAXDEPTH] ) { yyerror( "yacc stack overflow" ); return(1); }
  194.         *yyps = yystate;
  195.         ++yypv;
  196.         *yypv = yyval;
  197.  
  198.  yynewstate:
  199.  
  200.     yyn = yypact[yystate];
  201.  
  202.     if( yyn<= YYFLAG ) goto yydefault; /* simple state */
  203.  
  204.     if( yychar<0 ) if( (yychar=yylex())<0 ) yychar=0;
  205.     if( (yyn += yychar)<0 || yyn >= YYLAST ) goto yydefault;
  206.  
  207.     if( yychk[ yyn=yyact[ yyn ] ] == yychar ){ /* valid shift */
  208.         yychar = -1;
  209.         yyval = yylval;
  210.         yystate = yyn;
  211.         if( yyerrflag > 0 ) --yyerrflag;
  212.         goto yystack;
  213.         }
  214.  
  215.  yydefault:
  216.     /* default state action */
  217.  
  218.     if( (yyn=yydef[yystate]) == -2 ) {
  219.         if( yychar<0 ) if( (yychar=yylex())<0 ) yychar = 0;
  220.         /* look through exception table */
  221.  
  222.         for( yyxi=yyexca; (*yyxi!= (-1)) || (yyxi[1]!=yystate) ; yyxi += 2 ) ; /* VOID */
  223.  
  224.         while( *(yyxi+=2) >= 0 ){
  225.             if( *yyxi == yychar ) break;
  226.             }
  227.         if( (yyn = yyxi[1]) < 0 ) return(0);   /* accept */
  228.         }
  229.  
  230.     if( yyn == 0 ){ /* error */
  231.         /* error ... attempt to resume parsing */
  232.  
  233.         switch( yyerrflag ){
  234.  
  235.         case 0:   /* brand new error */
  236.  
  237.             yyerror( "syntax error" );
  238.         yyerrlab:
  239.             ++yynerrs;
  240.  
  241.         case 1:
  242.         case 2: /* incompletely recovered error ... try again */
  243.  
  244.             yyerrflag = 3;
  245.  
  246.             /* find a state where "error" is a legal shift action */
  247.  
  248.             while ( yyps >= yys ) {
  249.                yyn = yypact[*yyps] + YYERRCODE;
  250.                if( yyn>= 0 && yyn < YYLAST && yychk[yyact[yyn]] == YYERRCODE ){
  251.                   yystate = yyact[yyn];  /* simulate a shift of "error" */
  252.                   goto yystack;
  253.                   }
  254.                yyn = yypact[*yyps];
  255.  
  256.                /* the current yyps has no shift onn "error", pop stack */
  257.  
  258. #ifdef YYDEBUG
  259.                if( yydebug ) printf( "error recovery pops state %d, uncovers %d\n", *yyps, yyps[-1] );
  260. #endif
  261.                --yyps;
  262.                --yypv;
  263.                }
  264.  
  265.             /* there is no state on the stack with an error shift ... abort */
  266.  
  267.     yyabort:
  268.             return(1);
  269.  
  270.  
  271.         case 3:  /* no shift yet; clobber input char */
  272.  
  273. #ifdef YYDEBUG
  274.             if( yydebug ) printf( "error recovery discards char %d\n", yychar );
  275. #endif
  276.  
  277.             if( yychar == 0 ) goto yyabort; /* don't discard EOF, quit */
  278.             yychar = -1;
  279.             goto yynewstate;   /* try again in the same state */
  280.  
  281.             }
  282.  
  283.         }
  284.  
  285.     /* reduction by production yyn */
  286.  
  287. #ifdef YYDEBUG
  288.         if( yydebug ) printf("reduce %d\n",yyn);
  289. #endif
  290.         yyps -= yyr2[yyn];
  291.         yypvt = yypv;
  292.         yypv -= yyr2[yyn];
  293.         yyval = yypv[1];
  294.         yym=yyn;
  295.             /* consult goto table to find next state */
  296.         yyn = yyr1[yyn];
  297.         yyj = yypgo[yyn] + *yyps + 1;
  298.         if( yyj>=YYLAST || yychk[ yystate = yyact[yyj] ] != -yyn ) yystate = yyact[yypgo[yyn]];
  299.         switch(yym){
  300.             
  301. case 2:
  302. # line 33 "parse.y"
  303. {
  304.             /* initialize for processing rules */
  305.  
  306.             /* create default DFA start condition */
  307.             scinstal( "INITIAL", false );
  308.             } break;
  309. case 5:
  310. # line 44 "parse.y"
  311. { synerr( "unknown error processing section 1" ); } break;
  312. case 7:
  313. # line 51 "parse.y"
  314. {
  315.             /* these productions are separate from the s1object
  316.              * rule because the semantics must be done before
  317.              * we parse the remainder of an s1object
  318.              */
  319.  
  320.             xcluflg = false;
  321.             } break;
  322. case 8:
  323. # line 61 "parse.y"
  324. { xcluflg = true; } break;
  325. case 9:
  326. # line 65 "parse.y"
  327. { scinstal( nmstr, xcluflg ); } break;
  328. case 10:
  329. # line 68 "parse.y"
  330. { scinstal( nmstr, xcluflg ); } break;
  331. case 11:
  332. # line 71 "parse.y"
  333. { synerr( "bad start condition list" ); } break;
  334. case 14:
  335. # line 79 "parse.y"
  336. {
  337.             /* initialize for a parse of one rule */
  338.             trlcontxt = varlength = false;
  339.             trailcnt = headcnt = rulelen = 0;
  340.             } break;
  341. case 15:
  342. # line 87 "parse.y"
  343. {
  344.             pat = link_machines( yypvt[-1], yypvt[-0] );
  345.             add_accept( pat, headcnt, trailcnt );
  346.  
  347.             for ( i = 1; i <= actvp; ++i )
  348.                 scbol[actvsc[i]] = mkbranch( scbol[actvsc[i]], pat );
  349.             } break;
  350. case 16:
  351. # line 96 "parse.y"
  352. {
  353.             pat = link_machines( yypvt[-1], yypvt[-0] );
  354.             add_accept( pat, headcnt, trailcnt );
  355.  
  356.             for ( i = 1; i <= actvp; ++i )
  357.                 scset[actvsc[i]] = mkbranch( scset[actvsc[i]], pat );
  358.             } break;
  359. case 17:
  360. # line 105 "parse.y"
  361. {
  362.             pat = link_machines( yypvt[-1], yypvt[-0] );
  363.             add_accept( pat, headcnt, trailcnt );
  364.  
  365.             /* add to all non-exclusive start conditions,
  366.              * including the default (0) start condition
  367.              */
  368.  
  369.             for ( i = 1; i <= lastsc; ++i )
  370.                 if ( ! scxclu[i] )
  371.                 scbol[i] = mkbranch( scbol[i], pat );
  372.             } break;
  373. case 18:
  374. # line 119 "parse.y"
  375. {
  376.             pat = link_machines( yypvt[-1], yypvt[-0] );
  377.             add_accept( pat, headcnt, trailcnt );
  378.  
  379.             for ( i = 1; i <= lastsc; ++i )
  380.                 if ( ! scxclu[i] )
  381.                 scset[i] = mkbranch( scset[i], pat );
  382.             } break;
  383. case 19:
  384. # line 129 "parse.y"
  385. { synerr( "unrecognized rule" ); } break;
  386. case 21:
  387. # line 136 "parse.y"
  388. {
  389.             if ( (scnum = sclookup( nmstr )) == 0 )
  390.                 synerr( "undeclared start condition" );
  391.  
  392.             else
  393.                 actvsc[++actvp] = scnum;
  394.             } break;
  395. case 22:
  396. # line 145 "parse.y"
  397. {
  398.             if ( (scnum = sclookup( nmstr )) == 0 )
  399.                 synerr( "undeclared start condition" );
  400.             else
  401.                 actvsc[actvp = 1] = scnum;
  402.             } break;
  403. case 23:
  404. # line 153 "parse.y"
  405. { synerr( "bad start condition list" ); } break;
  406. case 24:
  407. # line 157 "parse.y"
  408. {
  409.             if ( trlcontxt )
  410.                 {
  411.                 synerr( "trailing context used twice" );
  412.                 yyval = mkstate( SYM_EPSILON );
  413.                 }
  414.             else
  415.                 {
  416.                 trlcontxt = true;
  417.  
  418.                 if ( ! varlength )
  419.                 headcnt = rulelen;
  420.  
  421.                 ++rulelen;
  422.                 trailcnt = 1;
  423.  
  424.                 eps = mkstate( SYM_EPSILON );
  425.                 yyval = link_machines( eps, mkstate( '\n' ) );
  426.                 }
  427.             } break;
  428. case 25:
  429. # line 179 "parse.y"
  430. {
  431.                 yyval = mkstate( SYM_EPSILON );
  432.  
  433.             if ( trlcontxt )
  434.                 {
  435.                 if ( varlength && headcnt == 0 )
  436.                 /* both head and trail are variable-length */
  437.                 synerr( "illegal trailing context" );
  438.  
  439.                 else
  440.                 trailcnt = rulelen;
  441.                 }
  442.                 } break;
  443. case 26:
  444. # line 195 "parse.y"
  445. {
  446.             varlength = true;
  447.  
  448.             yyval = mkor( yypvt[-2], yypvt[-0] );
  449.             } break;
  450. case 27:
  451. # line 202 "parse.y"
  452. { yyval = link_machines( yypvt[-1], yypvt[-0] ); } break;
  453. case 28:
  454. # line 205 "parse.y"
  455. { yyval = yypvt[-0]; } break;
  456. case 29:
  457. # line 210 "parse.y"
  458. {
  459.             /* this rule is separate from the others for "re" so
  460.              * that the reduction will occur before the trailing
  461.              * series is parsed
  462.              */
  463.  
  464.             if ( trlcontxt )
  465.                 synerr( "trailing context used twice" );
  466.             else
  467.                 trlcontxt = true;
  468.  
  469.             if ( varlength )
  470.                 /* the trailing context had better be fixed-length */
  471.                 varlength = false;
  472.             else
  473.                 headcnt = rulelen;
  474.  
  475.             rulelen = 0;
  476.             yyval = yypvt[-1];
  477.             } break;
  478. case 30:
  479. # line 233 "parse.y"
  480. {
  481.             /* this is where concatenation of adjacent patterns
  482.              * gets done
  483.              */
  484.             yyval = link_machines( yypvt[-1], yypvt[-0] );
  485.             } break;
  486. case 31:
  487. # line 241 "parse.y"
  488. { yyval = yypvt[-0]; } break;
  489. case 32:
  490. # line 245 "parse.y"
  491. {
  492.             varlength = true;
  493.  
  494.             yyval = mkclos( yypvt[-1] );
  495.             } break;
  496. case 33:
  497. # line 252 "parse.y"
  498. {
  499.             varlength = true;
  500.  
  501.             yyval = mkposcl( yypvt[-1] );
  502.             } break;
  503. case 34:
  504. # line 259 "parse.y"
  505. {
  506.             varlength = true;
  507.  
  508.             yyval = mkopt( yypvt[-1] );
  509.             } break;
  510. case 35:
  511. # line 266 "parse.y"
  512. {
  513.             varlength = true;
  514.  
  515.             if ( yypvt[-3] > yypvt[-1] || yypvt[-3] <= 0 )
  516.                 {
  517.                 synerr( "bad iteration values" );
  518.                 yyval = yypvt[-5];
  519.                 }
  520.             else
  521.                 yyval = mkrep( yypvt[-5], yypvt[-3], yypvt[-1] );
  522.             } break;
  523. case 36:
  524. # line 279 "parse.y"
  525. {
  526.             varlength = true;
  527.  
  528.             if ( yypvt[-2] <= 0 )
  529.                 {
  530.                 synerr( "iteration value must be positive" );
  531.                 yyval = yypvt[-4];
  532.                 }
  533.  
  534.             else
  535.                 yyval = mkrep( yypvt[-4], yypvt[-2], INFINITY );
  536.             } break;
  537. case 37:
  538. # line 293 "parse.y"
  539. {
  540.             /* the singleton could be something like "(foo)",
  541.              * in which case we have no idea what its length
  542.              * is, so we punt here.
  543.              */
  544.             varlength = true;
  545.  
  546.             if ( yypvt[-1] <= 0 )
  547.                 {
  548.                 synerr( "iteration value must be positive" );
  549.                 yyval = yypvt[-3];
  550.                 }
  551.  
  552.             else
  553.                 yyval = link_machines( yypvt[-3], copysingl( yypvt[-3], yypvt[-1] - 1 ) );
  554.             } break;
  555. case 38:
  556. # line 311 "parse.y"
  557. {
  558.             if ( ! madeany )
  559.                 {
  560.                 /* create the '.' character class */
  561.                 anyccl = cclinit();
  562.                 ccladd( anyccl, '\n' );
  563.                 cclnegate( anyccl );
  564.  
  565.                 if ( useecs )
  566.                 mkeccl( ccltbl + cclmap[anyccl],
  567.                     ccllen[anyccl], nextecm,
  568.                     ecgroup, CSIZE );
  569.                 
  570.                 madeany = true;
  571.                 }
  572.  
  573.             ++rulelen;
  574.  
  575.             yyval = mkstate( -anyccl );
  576.             } break;
  577. case 39:
  578. # line 333 "parse.y"
  579. {
  580.             if ( ! cclsorted )
  581.                 /* sort characters for fast searching.  We use a
  582.                  * shell sort since this list could be large.
  583.                  */
  584.                 cshell( ccltbl + cclmap[yypvt[-0]], ccllen[yypvt[-0]] );
  585.  
  586.             if ( useecs )
  587.                 mkeccl( ccltbl + cclmap[yypvt[-0]], ccllen[yypvt[-0]],
  588.                     nextecm, ecgroup, CSIZE );
  589.                      
  590.             ++rulelen;
  591.  
  592.             yyval = mkstate( -yypvt[-0] );
  593.             } break;
  594. case 40:
  595. # line 350 "parse.y"
  596. {
  597.             ++rulelen;
  598.  
  599.             yyval = mkstate( -yypvt[-0] );
  600.             } break;
  601. case 41:
  602. # line 357 "parse.y"
  603. { yyval = yypvt[-1]; } break;
  604. case 42:
  605. # line 360 "parse.y"
  606. { yyval = yypvt[-1]; } break;
  607. case 43:
  608. # line 363 "parse.y"
  609. {
  610.             ++rulelen;
  611.  
  612.             if ( yypvt[-0] == '\0' )
  613.                 synerr( "null in rule" );
  614.  
  615.             if ( caseins && yypvt[-0] >= 'A' && yypvt[-0] <= 'Z' )
  616.                 yypvt[-0] = clower( yypvt[-0] );
  617.  
  618.             yyval = mkstate( yypvt[-0] );
  619.             } break;
  620. case 44:
  621. # line 377 "parse.y"
  622. { yyval = yypvt[-1]; } break;
  623. case 45:
  624. # line 380 "parse.y"
  625. {
  626.             /* *Sigh* - to be compatible Unix lex, negated ccls
  627.              * match newlines
  628.              */
  629. #ifdef NOTDEF
  630.             ccladd( yypvt[-1], '\n' ); /* negated ccls don't match '\n' */
  631.             cclsorted = false; /* because we added the newline */
  632. #endif
  633.             cclnegate( yypvt[-1] );
  634.             yyval = yypvt[-1];
  635.             } break;
  636. case 46:
  637. # line 394 "parse.y"
  638. {
  639.             if ( yypvt[-2] > yypvt[-0] )
  640.                 synerr( "negative range in character class" );
  641.  
  642.             else
  643.                 {
  644.                 if ( caseins )
  645.                 {
  646.                 if ( yypvt[-2] >= 'A' && yypvt[-2] <= 'Z' )
  647.                     yypvt[-2] = clower( yypvt[-2] );
  648.                 if ( yypvt[-0] >= 'A' && yypvt[-0] <= 'Z' )
  649.                     yypvt[-0] = clower( yypvt[-0] );
  650.                 }
  651.  
  652.                 for ( i = yypvt[-2]; i <= yypvt[-0]; ++i )
  653.                     ccladd( yypvt[-3], i );
  654.  
  655.                 /* keep track if this ccl is staying in alphabetical
  656.                  * order
  657.                  */
  658.                 cclsorted = cclsorted && (yypvt[-2] > lastchar);
  659.                 lastchar = yypvt[-0];
  660.                 }
  661.             
  662.             yyval = yypvt[-3];
  663.             } break;
  664. case 47:
  665. # line 422 "parse.y"
  666. {
  667.             if ( caseins )
  668.                 if ( yypvt[-0] >= 'A' && yypvt[-0] <= 'Z' )
  669.                 yypvt[-0] = clower( yypvt[-0] );
  670.  
  671.             ccladd( yypvt[-1], yypvt[-0] );
  672.             cclsorted = cclsorted && (yypvt[-0] > lastchar);
  673.             lastchar = yypvt[-0];
  674.             yyval = yypvt[-1];
  675.             } break;
  676. case 48:
  677. # line 434 "parse.y"
  678. {
  679.             cclsorted = true;
  680.             lastchar = 0;
  681.             yyval = cclinit();
  682.             } break;
  683. case 49:
  684. # line 442 "parse.y"
  685. {
  686.             if ( caseins )
  687.                 if ( yypvt[-0] >= 'A' && yypvt[-0] <= 'Z' )
  688.                 yypvt[-0] = clower( yypvt[-0] );
  689.  
  690.             ++rulelen;
  691.  
  692.             yyval = link_machines( yypvt[-1], mkstate( yypvt[-0] ) );
  693.             } break;
  694. case 50:
  695. # line 453 "parse.y"
  696. { yyval = mkstate( SYM_EPSILON ); } break;
  697.         }
  698.         goto yystack;  /* stack new state and value */
  699.  
  700.     }
  701.