home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 182.lha / CDecl_v2.4 / cdgram.c.old < prev    next >
Text File  |  1988-11-05  |  38KB  |  1,157 lines

  1.  
  2. # line 2 "cdgram.y"
  3. /* Yacc grammar for ANSI and C++ cdecl. */
  4. /* The output of this file is included */
  5. /* into the C file cdecl.c. */
  6. char cdgramsccsid[] = "@(#)cdgram.y    2.2 3/30/88";
  7.  
  8. # line 8 "cdgram.y"
  9. typedef union  {
  10.     char *dynstr;
  11.     struct {
  12.         char *left;
  13.         char *right;
  14.         char *type;
  15.     } halves;
  16. } YYSTYPE;
  17. # define ARRAY 257
  18. # define AS 258
  19. # define CAST 259
  20. # define COMMA 260
  21. # define DECLARE 261
  22. # define DOUBLECOLON 262
  23. # define EXPLAIN 263
  24. # define FUNCTION 264
  25. # define HELP 265
  26. # define INTO 266
  27. # define OF 267
  28. # define MEMBER 268
  29. # define POINTER 269
  30. # define REFERENCE 270
  31. # define RETURNING 271
  32. # define SET 272
  33. # define TO 273
  34. # define CHAR 274
  35. # define CLASS 275
  36. # define CONSTVOLATILE 276
  37. # define DOUBLE 277
  38. # define ENUM 278
  39. # define FLOAT 279
  40. # define INT 280
  41. # define LONG 281
  42. # define NAME 282
  43. # define NUMBER 283
  44. # define SHORT 284
  45. # define SIGNED 285
  46. # define STRUCT 286
  47. # define UNION 287
  48. # define UNSIGNED 288
  49. # define VOID 289
  50. # define AUTO 290
  51. # define EXTERN 291
  52. # define REGISTER 292
  53. # define STATIC 293
  54. #define yyclearin yychar = -1
  55. #define yyerrok yyerrflag = 0
  56. extern int yychar;
  57. extern short yyerrflag;
  58. #ifndef YYMAXDEPTH
  59. #define YYMAXDEPTH 150
  60. #endif
  61. YYSTYPE yylval, yyval;
  62. # define YYERRCODE 256
  63.  
  64. # line 855 "cdgram.y"
  65.  
  66. short yyexca[] ={
  67. -1, 1,
  68.     0, -1,
  69.     -2, 0,
  70. -1, 27,
  71.     282, 81,
  72.     40, 81,
  73.     42, 81,
  74.     38, 81,
  75.     -2, 87,
  76. -1, 37,
  77.     260, 31,
  78.     41, 31,
  79.     -2, 81,
  80. -1, 87,
  81.     282, 82,
  82.     40, 82,
  83.     42, 82,
  84.     38, 82,
  85.     -2, 80,
  86. -1, 92,
  87.     260, 31,
  88.     41, 31,
  89.     -2, 81,
  90.     };
  91. # define YYNPROD 89
  92. # define YYLAST 322
  93. short yyact[]={
  94.  
  95.   67,  79,  28,  69,  72,  68,  66,  76, 159,  13,
  96.   77,  75,  78,  73,  74,  70,  79,  16,  17,  18,
  97.   19,  16,  17,  18,  19,  67, 129,  78,  69, 103,
  98.   68,  66, 125,  25,  76,  39,  23,  77,  75, 128,
  99.   70,  74, 118,  22, 115, 137, 117, 118,  85, 115,
  100.   86, 117,  83,  23, 152,  25,  30, 100,  23,  10,
  101.   22,  56,  25,  23,  47,  22,  60,  59,  37,  97,
  102.   22, 121,  25,  40,  41, 123,  58,  25,  20,  34,
  103.  139, 110,  25, 161, 144,  93, 145,  92,  94,  32,
  104.   24,  57, 147,  71, 126,  29,  81,  21,  42,  55,
  105.    8, 136, 108, 150,  12, 135,  33, 106,  11, 114,
  106.   31,  10,  62, 151, 132, 134,  44,  45,  48,  49,
  107.  156,  43,  35,   2,  63,  15,  53,   1,  54,  14,
  108.   50,  64,  27,  65,  52, 101,  26,  46,  87,  82,
  109.   61,  38,   0,  90,  80,  88,   0,   0,  89,   0,
  110.   95,  96,  98, 108,  91, 108,   0,   0, 108,   0,
  111.   11,   0,  51,   0,   0,   0,   0,   0,   0,   0,
  112.    0,   0,   0,   0, 109,   0, 111, 104, 102,   0,
  113.    0,   0, 105, 112, 107,   0, 122,  99,   0, 113,
  114.    0, 119, 120,   0,   0,   0,   0, 127,   0,   0,
  115.    0,   0,   0,   0,   0, 124, 131,   0, 133,   0,
  116.    0,   0,   0, 142,   0,   0, 130, 143,   0,   0,
  117.    0,   0,   0,   0,   0, 138, 146, 140, 141, 148,
  118.    0, 149,   0,   0,   0,   0, 127,   0,   0,   0,
  119.  153,   0,   0,  25, 158,   0,   0, 127,   0, 128,
  120.  155, 160,  16,  17,  18,  19, 154,   0,   0,   0,
  121.    0, 157,   0,   0,   0,   0,   0,  25,   0,   0,
  122.    0,   0,   0, 128,   0,   0,   0,   0,   0,   0,
  123.    0,   0,   0,   0,   0,   0, 116,   0,   0,   0,
  124.    0, 116,  84,   0,   0,   0,   0,   0,   0,  36,
  125.    0,   0, 145, 145,  92,   9,   0,   0,   5,   0,
  126.    4,   0,   6,   0,   3,   0,   0,   0,   0,   0,
  127.    0,   7 };
  128. short yypact[]={
  129.  
  130. -1000,  49,-1000, 101,-273,-204, -38,-226,-1000, 101,
  131. -1000,-1000,-1000,-169,-194,-1000,-1000,-1000,-1000,-1000,
  132. -187, 101,  28,-248,-196,-214,-212,-214,-214, 101,
  133. -1000,-1000,-269, 101,-194,-1000,-194,-221,-191,-1000,
  134. -206,-207,-1000,-274,-1000,-1000,  10,-214,  10,-1000,
  135. -1000,-194,-1000, 101,-1000,  44,-170,-1000,-194,-199,
  136. -194,-1000,-249,-1000,-225,-247,-1000,-1000,-1000,-1000,
  137. -1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
  138.   10, 101,  67,-214,-181,-214,  10,-1000, 101,   9,
  139.  101,-1000,-221,-200,-194,-1000,-1000,-192,-1000,-1000,
  140. -1000,-1000,-1000,-1000, 101,-1000,  -9,-1000, -67,  10,
  141.   72,  10,  74,-1000,  64,   4,-182,   9,   9,-1000,
  142. -173,-194,-1000,-259,-1000,-1000,  43,-1000,-1000,-1000,
  143.   -1,-1000,  10,-1000,-1000,-226,-1000,-1000,  62,  71,
  144.   11,  11,-1000,-228,-1000,-243,   9,-1000,-1000, 101,
  145.   80,   9,-194,-174,  11,-1000, -33,  11,-1000,-1000,
  146.   42,-1000 };
  147. short yypgo[]={
  148.  
  149.    0,  99, 141, 140, 109,  94,  96, 139, 101, 137,
  150.   93, 112, 135, 133,  90,  95, 129, 125, 131, 124,
  151.   98,  91, 127, 123, 100, 121 };
  152. short yyr1[]={
  153.  
  154.    0,  22,  22,  23,  23,  23,  23,  23,  23,  23,
  155.   23,  23,  23,  23,  23,  24,  24,  15,  15,   6,
  156.    6,   6,   6,   7,   7,   7,   7,   7,   5,   5,
  157.    5,   1,   1,   1,   1,   1,   4,   4,   4,   4,
  158.    4,   4,   4,   4,   4,   8,   8,  21,  21,  21,
  159.   21,  21,  21,  21,   2,   2,  20,  25,   3,   3,
  160.    3,   3,  18,  18,  18,  10,  10,  19,  19,  19,
  161.   19,  19,  11,  11,  12,  12,  13,  13,  13,  13,
  162.   14,  14,   9,  17,  17,  17,  17,  16,  16 };
  163. short yyr2[]={
  164.  
  165.    0,   0,   2,   2,   6,   4,   5,   3,   6,   5,
  166.    5,   8,   3,   1,   2,   1,   1,   1,   0,   1,
  167.    3,   4,   3,   3,   4,   2,   3,   1,   3,   3,
  168.    1,   0,   3,   1,   1,   3,   0,   2,   5,   6,
  169.    3,   4,   2,   2,   2,   2,   3,   3,   6,   4,
  170.    4,   8,   4,   2,   0,   1,   2,   0,   1,   1,
  171.    2,   2,   1,   1,   1,   1,   1,   1,   1,   1,
  172.    1,   1,   2,   1,   1,   1,   1,   1,   1,   1,
  173.    2,   0,   2,   1,   1,   1,   1,   1,   0 };
  174. short yychk[]={
  175.  
  176. -1000, -22, -23, 265, 261, 259, 263, 272, -24, 256,
  177.   10,  59, -24, 282, -16, -17, 290, 291, 292, 293,
  178.  282, -21, 264, 257, -14, 276, -16, -17,  40, -15,
  179.  282, -24, 258, -21, 266, -24, 271,  40,  -2, 283,
  180.  269, 270, -20, -25, -14, -14,  -9, 276, -14, -14,
  181.  -24, -16, -24, -21, -21,  -1, 282, -21, 267, 273,
  182.  273,  -3, -11, -19, -18, -13, 280, 274, 279, 277,
  183.  289, -10, 278, 287, 288, 285, 281, 284, 286, 275,
  184.  -20,  -6,  -7,  42, 282,  38,  40, -14,  -6, -20,
  185.  -21, -24, 260,  41, 258, -21, -21, 268, -21, -19,
  186.  282, -12, -11, 276,  -6, -24,  40,  -8,  91, -14,
  187.  262, -14,  -6, -24,  -4,  40, 282,  42,  38, -24,
  188.   -1, 271, -21, 267, -24,  41,  -5, -14, 282,  93,
  189.  283,  -6,  42,  -6,  41,  41,  -8,  41,  -4, 262,
  190.   -4,  -4, -21, -10,  41, 260, -20,  93,  -6, -15,
  191.   41,  42, 282,  -5,  -4, -24,  40,  -4, -21,  41,
  192.   -5,  41 };
  193. short yydef[]={
  194.  
  195.    1,  -2,   2,   0,  88,  81,  88,  18,  13,   0,
  196.   15,  16,   3,   0,  81,  87,  83,  84,  85,  86,
  197.    0,   0,   0,  54,  57,  81,  81,  -2,  81,   0,
  198.   17,  14,  88,   0,  81,   7,  81,  -2,   0,  55,
  199.    0,   0,  53,   0,  80,  57,   0,  81,   0,  57,
  200.   12,  81,   5,   0,  47,   0,  33,  34,  81,  81,
  201.   81,  56,  58,  59,   0,  73,  67,  68,  69,  70,
  202.   71,  62,  63,  64,  76,  77,  78,  79,  65,  66,
  203.    0,   0,  19,  81,  27,  81,   0,  -2,   0,  36,
  204.    0,   6,  -2,   0,  81,  49,  50,   0,  52,  60,
  205.   61,  72,  74,  75,   0,  10,  81,  25,   0,   0,
  206.    0,   0,   0,   9,   0,  36,   0,  36,  36,   4,
  207.   32,  81,  35,   0,   8,  23,   0,  57,  30,  45,
  208.    0,  20,   0,  22,  26,  18,  44,  37,   0,   0,
  209.   42,  43,  48,   0,  24,  81,  36,  46,  21,   0,
  210.   40,  36,  81,  28,  29,  11,  81,  41,  51,  38,
  211.    0,  39 };
  212. #ifndef lint
  213. static    char yaccpar_sccsid[] = "@(#)yaccpar 1.2 86/07/18 SMI"; /* from UCB 4.1 83/02/11 */
  214. #endif
  215.  
  216. #
  217. # define YYFLAG -1000
  218. # define YYERROR goto yyerrlab
  219. # define YYACCEPT return(0)
  220. # define YYABORT return(1)
  221.  
  222. /*    parser for yacc output    */
  223.  
  224. #ifdef YYDEBUG
  225. int yydebug = 0; /* 1 for debugging */
  226. #endif
  227. YYSTYPE yyv[YYMAXDEPTH]; /* where the values are stored */
  228. int yychar = -1; /* current input token number */
  229. int yynerrs = 0;  /* number of errors */
  230. short yyerrflag = 0;  /* error recovery flag */
  231.  
  232. yyparse() {
  233.  
  234.     short yys[YYMAXDEPTH];
  235.     short yyj, yym;
  236.     register YYSTYPE *yypvt;
  237.     register short yystate, *yyps, yyn;
  238.     register YYSTYPE *yypv;
  239.     register short *yyxi;
  240.  
  241.     yystate = 0;
  242.     yychar = -1;
  243.     yynerrs = 0;
  244.     yyerrflag = 0;
  245.     yyps= &yys[-1];
  246.     yypv= &yyv[-1];
  247.  
  248.  yystack:    /* put a state and value onto the stack */
  249.  
  250. #ifdef YYDEBUG
  251.     if( yydebug  ) printf( "state %d, char 0%o\n", yystate, yychar );
  252. #endif
  253.         if( ++yyps>= &yys[YYMAXDEPTH] ) { yyerror( "yacc stack overflow" ); return(1); }
  254.         *yyps = yystate;
  255.         ++yypv;
  256.         *yypv = yyval;
  257.  
  258.  yynewstate:
  259.  
  260.     yyn = yypact[yystate];
  261.  
  262.     if( yyn<= YYFLAG ) goto yydefault; /* simple state */
  263.  
  264.     if( yychar<0 ) if( (yychar=yylex())<0 ) yychar=0;
  265.     if( (yyn += yychar)<0 || yyn >= YYLAST ) goto yydefault;
  266.  
  267.     if( yychk[ yyn=yyact[ yyn ] ] == yychar ){ /* valid shift */
  268.         yychar = -1;
  269.         yyval = yylval;
  270.         yystate = yyn;
  271.         if( yyerrflag > 0 ) --yyerrflag;
  272.         goto yystack;
  273.         }
  274.  
  275.  yydefault:
  276.     /* default state action */
  277.  
  278.     if( (yyn=yydef[yystate]) == -2 ) {
  279.         if( yychar<0 ) if( (yychar=yylex())<0 ) yychar = 0;
  280.         /* look through exception table */
  281.  
  282.         for( yyxi=yyexca; (*yyxi!= (-1)) || (yyxi[1]!=yystate) ; yyxi += 2 ) ; /* VOID */
  283.  
  284.         while( *(yyxi+=2) >= 0 ){
  285.             if( *yyxi == yychar ) break;
  286.             }
  287.         if( (yyn = yyxi[1]) < 0 ) return(0);   /* accept */
  288.         }
  289.  
  290.     if( yyn == 0 ){ /* error */
  291.         /* error ... attempt to resume parsing */
  292.  
  293.         switch( yyerrflag ){
  294.  
  295.         case 0:   /* brand new error */
  296.  
  297.             yyerror( "syntax error" );
  298.         yyerrlab:
  299.             ++yynerrs;
  300.  
  301.         case 1:
  302.         case 2: /* incompletely recovered error ... try again */
  303.  
  304.             yyerrflag = 3;
  305.  
  306.             /* find a state where "error" is a legal shift action */
  307.  
  308.             while ( yyps >= yys ) {
  309.                yyn = yypact[*yyps] + YYERRCODE;
  310.                if( yyn>= 0 && yyn < YYLAST && yychk[yyact[yyn]] == YYERRCODE ){
  311.                   yystate = yyact[yyn];  /* simulate a shift of "error" */
  312.                   goto yystack;
  313.                   }
  314.                yyn = yypact[*yyps];
  315.  
  316.                /* the current yyps has no shift onn "error", pop stack */
  317.  
  318. #ifdef YYDEBUG
  319.                if( yydebug ) printf( "error recovery pops state %d, uncovers %d\n", *yyps, yyps[-1] );
  320. #endif
  321.                --yyps;
  322.                --yypv;
  323.                }
  324.  
  325.             /* there is no state on the stack with an error shift ... abort */
  326.  
  327.     yyabort:
  328.             return(1);
  329.  
  330.  
  331.         case 3:  /* no shift yet; clobber input char */
  332.  
  333. #ifdef YYDEBUG
  334.             if( yydebug ) printf( "error recovery discards char %d\n", yychar );
  335. #endif
  336.  
  337.             if( yychar == 0 ) goto yyabort; /* don't discard EOF, quit */
  338.             yychar = -1;
  339.             goto yynewstate;   /* try again in the same state */
  340.  
  341.             }
  342.  
  343.         }
  344.  
  345.     /* reduction by production yyn */
  346.  
  347. #ifdef YYDEBUG
  348.         if( yydebug ) printf("reduce %d\n",yyn);
  349. #endif
  350.         yyps -= yyr2[yyn];
  351.         yypvt = yypv;
  352.         yypv -= yyr2[yyn];
  353.         yyval = yypv[1];
  354.         yym=yyn;
  355.             /* consult goto table to find next state */
  356.         yyn = yyr1[yyn];
  357.         yyj = yypgo[yyn] + *yyps + 1;
  358.         if( yyj>=YYLAST || yychk[ yystate = yyact[yyj] ] != -yyn ) yystate = yyact[yypgo[yyn]];
  359.         switch(yym){
  360.             
  361. case 2:
  362. # line 33 "cdgram.y"
  363. {
  364.             prompt();
  365.             prev = 0;
  366.             } break;
  367. case 3:
  368. # line 40 "cdgram.y"
  369. {
  370.             Debug((stderr, "stmt: help\n"));
  371.             dohelp();
  372.             } break;
  373. case 4:
  374. # line 46 "cdgram.y"
  375. {
  376.             Debug((stderr, "stmt: DECLARE NAME AS opt_storage adecl\n"));
  377.             Debug((stderr, "\tNAME='%s'\n", yypvt[-4].dynstr));
  378.             Debug((stderr, "\topt_storage='%s'\n", yypvt[-2].dynstr));
  379.             Debug((stderr, "\tacdecl.left='%s'\n", yypvt[-1].halves.left));
  380.             Debug((stderr, "\tacdecl.right='%s'\n", yypvt[-1].halves.right));
  381.             Debug((stderr, "\tacdecl.type='%s'\n", yypvt[-1].halves.type));
  382.             Debug((stderr, "\tprev = '%s'\n", visible(prev)));
  383.             dodeclare(yypvt[-4].dynstr, yypvt[-2].dynstr, yypvt[-1].halves.left, yypvt[-1].halves.right, yypvt[-1].halves.type);
  384.             } break;
  385. case 5:
  386. # line 58 "cdgram.y"
  387. {
  388.             Debug((stderr, "stmt: DECLARE opt_storage adecl\n"));
  389.             Debug((stderr, "\topt_storage='%s'\n", yypvt[-2].dynstr));
  390.             Debug((stderr, "\tacdecl.left='%s'\n", yypvt[-1].halves.left));
  391.             Debug((stderr, "\tacdecl.right='%s'\n", yypvt[-1].halves.right));
  392.             Debug((stderr, "\tacdecl.type='%s'\n", yypvt[-1].halves.type));
  393.             Debug((stderr, "\tprev = '%s'\n", visible(prev)));
  394.             dodeclare(NullCP, yypvt[-2].dynstr, yypvt[-1].halves.left, yypvt[-1].halves.right, yypvt[-1].halves.type);
  395.             } break;
  396. case 6:
  397. # line 69 "cdgram.y"
  398. {
  399.             Debug((stderr, "stmt: CAST NAME AS adecl\n"));
  400.             Debug((stderr, "\tNAME='%s'\n", yypvt[-3].dynstr));
  401.             Debug((stderr, "\tacdecl.left='%s'\n", yypvt[-1].halves.left));
  402.             Debug((stderr, "\tacdecl.right='%s'\n", yypvt[-1].halves.right));
  403.             Debug((stderr, "\tacdecl.type='%s'\n", yypvt[-1].halves.type));
  404.             docast(yypvt[-3].dynstr, yypvt[-1].halves.left, yypvt[-1].halves.right, yypvt[-1].halves.type);
  405.             } break;
  406. case 7:
  407. # line 79 "cdgram.y"
  408. {
  409.             Debug((stderr, "stmt: CAST adecl\n"));
  410.             Debug((stderr, "\tacdecl.left='%s'\n", yypvt[-1].halves.left));
  411.             Debug((stderr, "\tacdecl.right='%s'\n", yypvt[-1].halves.right));
  412.             Debug((stderr, "\tacdecl.type='%s'\n", yypvt[-1].halves.type));
  413.             docast(NullCP, yypvt[-1].halves.left, yypvt[-1].halves.right, yypvt[-1].halves.type);
  414.             } break;
  415. case 8:
  416. # line 88 "cdgram.y"
  417. {
  418.             Debug((stderr, "stmt: EXPLAIN opt_storage opt_constvol_list type cdecl\n"));
  419.             Debug((stderr, "\topt_storage='%s'\n", yypvt[-4].dynstr));
  420.             Debug((stderr, "\topt_constvol_list='%s'\n", yypvt[-3].dynstr));
  421.             Debug((stderr, "\ttype='%s'\n", yypvt[-2].dynstr));
  422.             Debug((stderr, "\tcdecl='%s'\n", yypvt[-1].dynstr));
  423.             Debug((stderr, "\tprev = '%s'\n", visible(prev)));
  424.             dodexplain(yypvt[-4].dynstr, yypvt[-3].dynstr, yypvt[-2].dynstr, yypvt[-1].dynstr);
  425.             } break;
  426. case 9:
  427. # line 99 "cdgram.y"
  428. {
  429.             Debug((stderr, "stmt: EXPLAIN storage opt_constvol_list cdecl\n"));
  430.             Debug((stderr, "\tstorage='%s'\n", yypvt[-3].dynstr));
  431.             Debug((stderr, "\topt_constvol_list='%s'\n", yypvt[-2].dynstr));
  432.             Debug((stderr, "\tcdecl='%s'\n", yypvt[-1].dynstr));
  433.             Debug((stderr, "\tprev = '%s'\n", visible(prev)));
  434.             dodexplain(yypvt[-3].dynstr, yypvt[-2].dynstr, NullCP, yypvt[-1].dynstr);
  435.             } break;
  436. case 10:
  437. # line 109 "cdgram.y"
  438. {
  439.             Debug((stderr, "stmt: EXPLAIN opt_storage constvol_list cdecl\n"));
  440.             Debug((stderr, "\topt_storage='%s'\n", yypvt[-3].dynstr));
  441.             Debug((stderr, "\tconstvol_list='%s'\n", yypvt[-2].dynstr));
  442.             Debug((stderr, "\tcdecl='%s'\n", yypvt[-1].dynstr));
  443.             Debug((stderr, "\tprev = '%s'\n", visible(prev)));
  444.             dodexplain(yypvt[-3].dynstr, yypvt[-2].dynstr, NullCP, yypvt[-1].dynstr);
  445.             } break;
  446. case 11:
  447. # line 119 "cdgram.y"
  448. {
  449.             Debug((stderr, "stmt: EXPLAIN ( opt_constvol_list type cast ) optNAME\n"));
  450.             Debug((stderr, "\topt_constvol_list='%s'\n", yypvt[-5].dynstr));
  451.             Debug((stderr, "\ttype='%s'\n", yypvt[-4].dynstr));
  452.             Debug((stderr, "\tcast='%s'\n", yypvt[-3].dynstr));
  453.             Debug((stderr, "\tNAME='%s'\n", yypvt[-1].dynstr));
  454.             Debug((stderr, "\tprev = '%s'\n", visible(prev)));
  455.             docexplain(yypvt[-5].dynstr, yypvt[-4].dynstr, yypvt[-3].dynstr, yypvt[-1].dynstr);
  456.             } break;
  457. case 12:
  458. # line 130 "cdgram.y"
  459. {
  460.             Debug((stderr, "stmt: SET optNAME\n"));
  461.             Debug((stderr, "\toptNAME='%s'\n", yypvt[-1].dynstr));
  462.             doset(yypvt[-1].dynstr);
  463.             } break;
  464. case 14:
  465. # line 138 "cdgram.y"
  466. {
  467.             yyerrok;
  468.             } break;
  469. case 15:
  470. # line 144 "cdgram.y"
  471. {
  472.             doprompt();
  473.             } break;
  474. case 16:
  475. # line 148 "cdgram.y"
  476. {
  477.             noprompt();
  478.             } break;
  479. case 17:
  480. # line 154 "cdgram.y"
  481. {
  482.             Debug((stderr, "optNAME: NAME\n"));
  483.             Debug((stderr, "\tNAME='%s'\n", yypvt[-0].dynstr));
  484.             yyval.dynstr = yypvt[-0].dynstr;
  485.             } break;
  486. case 18:
  487. # line 161 "cdgram.y"
  488. {
  489.             Debug((stderr, "optNAME: EMPTY\n"));
  490.             yyval.dynstr = ds(unknown_name);
  491.             } break;
  492. case 20:
  493. # line 169 "cdgram.y"
  494. {
  495.             Debug((stderr, "cdecl: * opt_constvol_list cdecl\n"));
  496.             Debug((stderr, "\topt_constvol_list='%s'\n", yypvt[-1].dynstr));
  497.             Debug((stderr, "\tcdecl='%s'\n", yypvt[-0].dynstr));
  498.             yyval.dynstr = cat(yypvt[-0].dynstr,yypvt[-1].dynstr,ds(strlen(yypvt[-1].dynstr)?" pointer to ":"pointer to "),NullCP);
  499.             prev = 'p';
  500.             Debug((stderr, "\tprev = '%s'\n", visible(prev)));
  501.             } break;
  502. case 21:
  503. # line 179 "cdgram.y"
  504. {
  505.             Debug((stderr, "cdecl: NAME DOUBLECOLON '*' cdecl\n"));
  506.             Debug((stderr, "\tNAME='%s'\n", yypvt[-3].dynstr));
  507.             Debug((stderr, "\tcdecl='%s'\n", yypvt[-0].dynstr));
  508.             if (!CplusplusFlag)
  509.                 unsupp("pointer to member of class", NullCP);
  510.             yyval.dynstr = cat(yypvt[-0].dynstr,ds("pointer to member of class "),yypvt[-3].dynstr,ds(" "),NullCP);
  511.             prev = 'p';
  512.             Debug((stderr, "\tprev = '%s'\n", visible(prev)));
  513.             } break;
  514. case 22:
  515. # line 191 "cdgram.y"
  516. {
  517.             Debug((stderr, "cdecl: & opt_constvol_list cdecl\n"));
  518.             Debug((stderr, "\topt_constvol_list='%s'\n", yypvt[-1].dynstr));
  519.             Debug((stderr, "\tcdecl='%s'\n", yypvt[-0].dynstr));
  520.             if (!CplusplusFlag)
  521.                 unsupp("reference", NullCP);
  522.             yyval.dynstr = cat(yypvt[-0].dynstr,yypvt[-1].dynstr,ds(strlen(yypvt[-1].dynstr)?" reference to ":"reference to "),NullCP);
  523.             prev = 'r';
  524.             Debug((stderr, "\tprev = '%s'\n", visible(prev)));
  525.             } break;
  526. case 23:
  527. # line 204 "cdgram.y"
  528. {
  529.             Debug((stderr, "cdecl1: cdecl1()\n"));
  530.             Debug((stderr, "\tcdecl1='%s'\n", yypvt[-2].dynstr));
  531.             yyval.dynstr = cat(yypvt[-2].dynstr,ds("function returning "),NullCP);
  532.             prev = 'f';
  533.             Debug((stderr, "\tprev = '%s'\n", visible(prev)));
  534.             } break;
  535. case 24:
  536. # line 213 "cdgram.y"
  537. {
  538.             Debug((stderr, "cdecl1: cdecl1(castlist)\n"));
  539.             Debug((stderr, "\tcdecl1='%s'\n", yypvt[-3].dynstr));
  540.             Debug((stderr, "\tcastlist='%s'\n", yypvt[-1].dynstr));
  541.             yyval.dynstr = cat(yypvt[-3].dynstr, ds("function ("),
  542.                   yypvt[-1].dynstr, ds(") returning "), NullCP);
  543.             prev = 'f';
  544.             Debug((stderr, "\tprev = '%s'\n", visible(prev)));
  545.             } break;
  546. case 25:
  547. # line 224 "cdgram.y"
  548. {
  549.             Debug((stderr, "cdecl1: cdecl1 cdims\n"));
  550.             Debug((stderr, "\tcdecl1='%s'\n", yypvt[-1].dynstr));
  551.             Debug((stderr, "\tcdims='%s'\n", yypvt[-0].dynstr));
  552.             yyval.dynstr = cat(yypvt[-1].dynstr,ds("array "),yypvt[-0].dynstr,NullCP);
  553.             prev = 'a';
  554.             Debug((stderr, "\tprev = '%s'\n", visible(prev)));
  555.             } break;
  556. case 26:
  557. # line 234 "cdgram.y"
  558. {
  559.             Debug((stderr, "cdecl1: (cdecl)\n"));
  560.             Debug((stderr, "\tcdecl='%s'\n", yypvt[-1].dynstr));
  561.             yyval.dynstr = yypvt[-1].dynstr;
  562.             /* prev = prev; */
  563.             Debug((stderr, "\tprev = '%s'\n", visible(prev)));
  564.             } break;
  565. case 27:
  566. # line 243 "cdgram.y"
  567. {
  568.             Debug((stderr, "cdecl1: NAME\n"));
  569.             Debug((stderr, "\tNAME='%s'\n", yypvt[-0].dynstr));
  570.             savedname = yypvt[-0].dynstr;
  571.             yyval.dynstr = ds("");
  572.             prev = 'n';
  573.             Debug((stderr, "\tprev = '%s'\n", visible(prev)));
  574.             } break;
  575. case 28:
  576. # line 254 "cdgram.y"
  577. {
  578.             Debug((stderr, "castlist: castlist1, castlist2\n"));
  579.             Debug((stderr, "\tcastlist1='%s'\n", yypvt[-2].dynstr));
  580.             Debug((stderr, "\tcastlist2='%s'\n", yypvt[-0].dynstr));
  581.             yyval.dynstr = cat(yypvt[-2].dynstr, ds(", "), yypvt[-0].dynstr, NullCP);
  582.             } break;
  583. case 29:
  584. # line 262 "cdgram.y"
  585. {
  586.             Debug((stderr, "castlist: opt_constvol_list type cast\n"));
  587.             Debug((stderr, "\topt_constvol_list='%s'\n", yypvt[-2].dynstr));
  588.             Debug((stderr, "\ttype='%s'\n", yypvt[-1].dynstr));
  589.             Debug((stderr, "\tcast='%s'\n", yypvt[-0].dynstr));
  590.             yyval.dynstr = cat(yypvt[-0].dynstr, yypvt[-2].dynstr, ds(strlen(yypvt[-2].dynstr) ? " " : ""), yypvt[-1].dynstr, NullCP);
  591.             } break;
  592. case 30:
  593. # line 271 "cdgram.y"
  594. {
  595.             yyval.dynstr = yypvt[-0].dynstr;
  596.             } break;
  597. case 31:
  598. # line 277 "cdgram.y"
  599. {
  600.             Debug((stderr, "adecllist: EMPTY\n"));
  601.             yyval.dynstr = ds("");
  602.             } break;
  603. case 32:
  604. # line 283 "cdgram.y"
  605. {
  606.             Debug((stderr, "adecllist: adecllist1, adecllist2\n"));
  607.             Debug((stderr, "\tadecllist1='%s'\n", yypvt[-2].dynstr));
  608.             Debug((stderr, "\tadecllist2='%s'\n", yypvt[-0].dynstr));
  609.             yyval.dynstr = cat(yypvt[-2].dynstr, ds(", "), yypvt[-0].dynstr, NullCP);
  610.             } break;
  611. case 33:
  612. # line 291 "cdgram.y"
  613. {
  614.             Debug((stderr, "adecllist: NAME\n"));
  615.             Debug((stderr, "\tNAME='%s'\n", yypvt[-0].dynstr));
  616.             yyval.dynstr = yypvt[-0].dynstr;
  617.             } break;
  618. case 34:
  619. # line 298 "cdgram.y"
  620. {
  621.             Debug((stderr, "adecllist: adecl\n"));
  622.             Debug((stderr, "\tadecl.left='%s'\n", yypvt[-0].halves.left));
  623.             Debug((stderr, "\tadecl.right='%s'\n", yypvt[-0].halves.right));
  624.             Debug((stderr, "\tadecl.type='%s'\n", yypvt[-0].halves.type));
  625.             yyval.dynstr = cat(yypvt[-0].halves.type, ds(" "), yypvt[-0].halves.left, yypvt[-0].halves.right, NullCP);
  626.             } break;
  627. case 35:
  628. # line 307 "cdgram.y"
  629. {
  630.             Debug((stderr, "adecllist: NAME AS adecl\n"));
  631.             Debug((stderr, "\tNAME='%s'\n", yypvt[-2].dynstr));
  632.             Debug((stderr, "\tadecl.left='%s'\n", yypvt[-0].halves.left));
  633.             Debug((stderr, "\tadecl.right='%s'\n", yypvt[-0].halves.right));
  634.             Debug((stderr, "\tadecl.type='%s'\n", yypvt[-0].halves.type));
  635.             yyval.dynstr = cat(yypvt[-0].halves.type, ds(" "), yypvt[-0].halves.left, yypvt[-2].dynstr, yypvt[-0].halves.right, NullCP);
  636.             } break;
  637. case 36:
  638. # line 318 "cdgram.y"
  639. {
  640.             Debug((stderr, "cast: EMPTY\n"));
  641.             yyval.dynstr = ds("");
  642.             /* prev = prev; */
  643.             Debug((stderr, "\tprev = '%s'\n", visible(prev)));
  644.             } break;
  645. case 37:
  646. # line 326 "cdgram.y"
  647. {
  648.             Debug((stderr, "cast: ()\n"));
  649.             yyval.dynstr = ds("function returning ");
  650.             prev = 'f';
  651.             Debug((stderr, "\tprev = '%s'\n", visible(prev)));
  652.             } break;
  653. case 38:
  654. # line 334 "cdgram.y"
  655. {
  656.             Debug((stderr, "cast: (cast)()\n"));
  657.             Debug((stderr, "\tcast='%s'\n", yypvt[-3].dynstr));
  658.             yyval.dynstr = cat(yypvt[-3].dynstr,ds("function returning "),NullCP);
  659.             prev = 'f';
  660.             Debug((stderr, "\tprev = '%s'\n", visible(prev)));
  661.             } break;
  662. case 39:
  663. # line 343 "cdgram.y"
  664. {
  665.             Debug((stderr, "cast: (cast)(castlist)\n"));
  666.             Debug((stderr, "\tcast='%s'\n", yypvt[-4].dynstr));
  667.             Debug((stderr, "\tcastlist='%s'\n", yypvt[-1].dynstr));
  668.             yyval.dynstr = cat(yypvt[-4].dynstr,ds("function ("),yypvt[-1].dynstr,ds(") returning "),NullCP);
  669.             prev = 'f';
  670.             Debug((stderr, "\tprev = '%s'\n", visible(prev)));
  671.             } break;
  672. case 40:
  673. # line 353 "cdgram.y"
  674. {
  675.             Debug((stderr, "cast: (cast)\n"));
  676.             Debug((stderr, "\tcast='%s'\n", yypvt[-1].dynstr));
  677.             yyval.dynstr = yypvt[-1].dynstr;
  678.             /* prev = prev; */
  679.             Debug((stderr, "\tprev = '%s'\n", visible(prev)));
  680.             } break;
  681. case 41:
  682. # line 362 "cdgram.y"
  683. {
  684.             Debug((stderr, "cast: NAME::*cast\n"));
  685.             Debug((stderr, "\tcast='%s'\n", yypvt[-0].dynstr));
  686.             if (!CplusplusFlag)
  687.                 unsupp("pointer to member of class", NullCP);
  688.             yyval.dynstr = cat(yypvt[-0].dynstr,ds("pointer to member of class "),yypvt[-3].dynstr,ds(" "),NullCP);
  689.             prev = 'p';
  690.             Debug((stderr, "\tprev = '%s'\n", visible(prev)));
  691.             } break;
  692. case 42:
  693. # line 373 "cdgram.y"
  694. {
  695.             Debug((stderr, "cast: *cast\n"));
  696.             Debug((stderr, "\tcast='%s'\n", yypvt[-0].dynstr));
  697.             yyval.dynstr = cat(yypvt[-0].dynstr,ds("pointer to "),NullCP);
  698.             prev = 'p';
  699.             Debug((stderr, "\tprev = '%s'\n", visible(prev)));
  700.             } break;
  701. case 43:
  702. # line 382 "cdgram.y"
  703. {
  704.             Debug((stderr, "cast: &cast\n"));
  705.             Debug((stderr, "\tcast='%s'\n", yypvt[-0].dynstr));
  706.             if (!CplusplusFlag)
  707.                 unsupp("reference", NullCP);
  708.             yyval.dynstr = cat(yypvt[-0].dynstr,ds("reference to "),NullCP);
  709.             prev = 'r';
  710.             Debug((stderr, "\tprev = '%s'\n", visible(prev)));
  711.             } break;
  712. case 44:
  713. # line 393 "cdgram.y"
  714. {
  715.             Debug((stderr, "cast: cast cdims\n"));
  716.             Debug((stderr, "\tcast='%s'\n", yypvt[-1].dynstr));
  717.             Debug((stderr, "\tcdims='%s'\n", yypvt[-0].dynstr));
  718.             yyval.dynstr = cat(yypvt[-1].dynstr,ds("array "),yypvt[-0].dynstr,NullCP);
  719.             prev = 'a';
  720.             Debug((stderr, "\tprev = '%s'\n", visible(prev)));
  721.             } break;
  722. case 45:
  723. # line 404 "cdgram.y"
  724. {
  725.             Debug((stderr, "cdims: []\n"));
  726.             yyval.dynstr = ds("of ");
  727.             } break;
  728. case 46:
  729. # line 410 "cdgram.y"
  730. {
  731.             Debug((stderr, "cdims: [NUMBER]\n"));
  732.             Debug((stderr, "\tNUMBER='%s'\n", yypvt[-1].dynstr));
  733.             yyval.dynstr = cat(yypvt[-1].dynstr,ds(" of "),NullCP);
  734.             } break;
  735. case 47:
  736. # line 418 "cdgram.y"
  737. {
  738.             Debug((stderr, "adecl: FUNCTION RETURNING adecl\n"));
  739.             Debug((stderr, "\tadecl.left='%s'\n", yypvt[-0].halves.left));
  740.             Debug((stderr, "\tadecl.right='%s'\n", yypvt[-0].halves.right));
  741.             Debug((stderr, "\tadecl.type='%s'\n", yypvt[-0].halves.type));
  742.             if (prev == 'f')
  743.                 unsupp("Function returning function",
  744.                        "function returning pointer to function");
  745.             else if (prev=='A' || prev=='a')
  746.                 unsupp("Function returning array",
  747.                        "function returning pointer");
  748.             yyval.halves.left = yypvt[-0].halves.left;
  749.             yyval.halves.right = cat(ds("()"),yypvt[-0].halves.right,NullCP);
  750.             yyval.halves.type = yypvt[-0].halves.type;
  751.             prev = 'f';
  752.             Debug((stderr, "\n\tadecl now =\n"));
  753.             Debug((stderr, "\t\tadecl.left='%s'\n", yyval.halves.left));
  754.             Debug((stderr, "\t\tadecl.right='%s'\n", yyval.halves.right));
  755.             Debug((stderr, "\t\tadecl.type='%s'\n", yyval.halves.type));
  756.             Debug((stderr, "\tprev = '%s'\n", visible(prev)));
  757.             } break;
  758. case 48:
  759. # line 441 "cdgram.y"
  760. {
  761.             Debug((stderr, "adecl: FUNCTION (adecllist) RETURNING adecl\n"));
  762.             Debug((stderr, "\tadecllist='%s'\n", yypvt[-3].dynstr));
  763.             Debug((stderr, "\tadecl.left='%s'\n", yypvt[-0].halves.left));
  764.             Debug((stderr, "\tadecl.right='%s'\n", yypvt[-0].halves.right));
  765.             Debug((stderr, "\tadecl.type='%s'\n", yypvt[-0].halves.type));
  766.             if (prev == 'f')
  767.                 unsupp("Function returning function",
  768.                        "function returning pointer to function");
  769.             else if (prev=='A' || prev=='a')
  770.                 unsupp("Function returning array",
  771.                        "function returning pointer");
  772.             yyval.halves.left = yypvt[-0].halves.left;
  773.             yyval.halves.right = cat(ds("("),yypvt[-3].dynstr,ds(")"),yypvt[-0].halves.right,NullCP);
  774.             yyval.halves.type = yypvt[-0].halves.type;
  775.             prev = 'f';
  776.             Debug((stderr, "\n\tadecl now =\n"));
  777.             Debug((stderr, "\t\tadecl.left='%s'\n", yyval.halves.left));
  778.             Debug((stderr, "\t\tadecl.right='%s'\n", yyval.halves.right));
  779.             Debug((stderr, "\t\tadecl.type='%s'\n", yyval.halves.type));
  780.             Debug((stderr, "\tprev = '%s'\n", visible(prev)));
  781.             } break;
  782. case 49:
  783. # line 465 "cdgram.y"
  784. {
  785.             Debug((stderr, "adecl: ARRAY adims OF adecl\n"));
  786.             Debug((stderr, "\tadims='%s'\n", yypvt[-2].dynstr));
  787.             Debug((stderr, "\tadecl.left='%s'\n", yypvt[-0].halves.left));
  788.             Debug((stderr, "\tadecl.right='%s'\n", yypvt[-0].halves.right));
  789.             Debug((stderr, "\tadecl.type='%s'\n", yypvt[-0].halves.type));
  790.             if (prev == 'f')
  791.                 unsupp("Array of function",
  792.                        "array of pointer to function");
  793.             else if (prev == 'a')
  794.                 unsupp("Inner array of unspecified size",
  795.                        "array of pointer");
  796.             else if (prev == 'v')
  797.                 unsupp("Array of void",
  798.                        "pointer to void");
  799.             if (arbdims)
  800.                 prev = 'a';
  801.             else
  802.                 prev = 'A';
  803.             yyval.halves.left = yypvt[-0].halves.left;
  804.             yyval.halves.right = cat(yypvt[-2].dynstr,yypvt[-0].halves.right,NullCP);
  805.             yyval.halves.type = yypvt[-0].halves.type;
  806.             Debug((stderr, "\n\tadecl now =\n"));
  807.             Debug((stderr, "\t\tadecl.left='%s'\n", yyval.halves.left));
  808.             Debug((stderr, "\t\tadecl.right='%s'\n", yyval.halves.right));
  809.             Debug((stderr, "\t\tadecl.type='%s'\n", yyval.halves.type));
  810.             Debug((stderr, "\tprev = '%s'\n", visible(prev)));
  811.             } break;
  812. case 50:
  813. # line 495 "cdgram.y"
  814. {
  815.             char *op = "", *cp = "", *sp = "";
  816.  
  817.             Debug((stderr, "adecl: opt_constvol_list POINTER TO adecl\n"));
  818.             Debug((stderr, "\topt_constvol_list='%s'\n", yypvt[-3].dynstr));
  819.             Debug((stderr, "\tadecl.left='%s'\n", yypvt[-0].halves.left));
  820.             Debug((stderr, "\tadecl.right='%s'\n", yypvt[-0].halves.right));
  821.             Debug((stderr, "\tadecl.type='%s'\n", yypvt[-0].halves.type));
  822.             if (prev == 'a')
  823.                 unsupp("Pointer to array of unspecified dimension",
  824.                        "pointer to object");
  825.             if (prev=='a' || prev=='A' || prev=='f') {
  826.                 op = "(";
  827.                 cp = ")";
  828.             }
  829.             if (strlen(yypvt[-3].dynstr) != 0)
  830.                 sp = " ";
  831.             yyval.halves.left = cat(yypvt[-0].halves.left,ds(op),ds("*"),
  832.                        ds(sp),yypvt[-3].dynstr,ds(sp),NullCP);
  833.             yyval.halves.right = cat(ds(cp),yypvt[-0].halves.right,NullCP);
  834.             yyval.halves.type = yypvt[-0].halves.type;
  835.             prev = 'p';
  836.             Debug((stderr, "\n\tadecl now =\n"));
  837.             Debug((stderr, "\t\tadecl.left='%s'\n", yyval.halves.left));
  838.             Debug((stderr, "\t\tadecl.right='%s'\n", yyval.halves.right));
  839.             Debug((stderr, "\t\tadecl.type='%s'\n", yyval.halves.type));
  840.             Debug((stderr, "\tprev = '%s'\n", visible(prev)));
  841.             } break;
  842. case 51:
  843. # line 525 "cdgram.y"
  844. {
  845.             char *op = "", *cp = "", *sp = "";
  846.  
  847.             Debug((stderr, "adecl: opt_constvol_list POINTER TO MEMBER OF ClassStruct NAME adecl\n"));
  848.             Debug((stderr, "\topt_constvol_list='%s'\n", yypvt[-7].dynstr));
  849.             Debug((stderr, "\tClassStruct='%s'\n", yypvt[-2].dynstr));
  850.             Debug((stderr, "\tNAME='%s'\n", yypvt[-1].dynstr));
  851.             Debug((stderr, "\tadecl.left='%s'\n", yypvt[-0].halves.left));
  852.             Debug((stderr, "\tadecl.right='%s'\n", yypvt[-0].halves.right));
  853.             Debug((stderr, "\tadecl.type='%s'\n", yypvt[-0].halves.type));
  854.             if (!CplusplusFlag)
  855.                 unsupp("pointer to member of class", NullCP);
  856.             if (prev == 'a')
  857.                 unsupp("Pointer to array of unspecified dimension",
  858.                        "pointer to object");
  859.             if (prev=='a' || prev=='A' || prev=='f') {
  860.                 op = "(";
  861.                 cp = ")";
  862.             }
  863.             if (strlen(yypvt[-7].dynstr) != 0)
  864.                 sp = " ";
  865.             yyval.halves.left = cat(yypvt[-0].halves.left,ds(op),yypvt[-1].dynstr,ds("::*"),
  866.                       ds(sp),yypvt[-7].dynstr,ds(sp),NullCP);
  867.             yyval.halves.right = cat(ds(cp),yypvt[-0].halves.right,NullCP);
  868.             yyval.halves.type = yypvt[-0].halves.type;
  869.             prev = 'p';
  870.             Debug((stderr, "\n\tadecl now =\n"));
  871.             Debug((stderr, "\t\tadecl.left='%s'\n", yyval.halves.left));
  872.             Debug((stderr, "\t\tadecl.right='%s'\n", yyval.halves.right));
  873.             Debug((stderr, "\t\tadecl.type='%s'\n", yyval.halves.type));
  874.             Debug((stderr, "\tprev = '%s'\n", visible(prev)));
  875.             } break;
  876. case 52:
  877. # line 559 "cdgram.y"
  878. {
  879.             char *op = "", *cp = "", *sp = "";
  880.  
  881.             Debug((stderr, "adecl: opt_constvol_list REFERENCE TO adecl\n"));
  882.             Debug((stderr, "\topt_constvol_list='%s'\n", yypvt[-3].dynstr));
  883.             Debug((stderr, "\tadecl.left='%s'\n", yypvt[-0].halves.left));
  884.             Debug((stderr, "\tadecl.right='%s'\n", yypvt[-0].halves.right));
  885.             Debug((stderr, "\tadecl.type='%s'\n", yypvt[-0].halves.type));
  886.             if (!CplusplusFlag)
  887.                 unsupp("reference", NullCP);
  888.             if (prev == 'v')
  889.                 unsupp("Reference to void",
  890.                        "pointer to void");
  891.             else if (prev == 'a')
  892.                 unsupp("Reference to array of unspecified dimension",
  893.                        "reference to object");
  894.             if (prev=='a' || prev=='A' || prev=='f') {
  895.                 op = "(";
  896.                 cp = ")";
  897.             }
  898.             if (strlen(yypvt[-3].dynstr) != 0)
  899.                 sp = " ";
  900.             yyval.halves.left = cat(yypvt[-0].halves.left,ds(op),ds("&"),
  901.                        ds(sp),yypvt[-3].dynstr,ds(sp),NullCP);
  902.             yyval.halves.right = cat(ds(cp),yypvt[-0].halves.right,NullCP);
  903.             yyval.halves.type = yypvt[-0].halves.type;
  904.             prev = 'r';
  905.             Debug((stderr, "\n\tadecl now =\n"));
  906.             Debug((stderr, "\t\tadecl.left='%s'\n", yyval.halves.left));
  907.             Debug((stderr, "\t\tadecl.right='%s'\n", yyval.halves.right));
  908.             Debug((stderr, "\t\tadecl.type='%s'\n", yyval.halves.type));
  909.             Debug((stderr, "\tprev = '%s'\n", visible(prev)));
  910.             } break;
  911. case 53:
  912. # line 594 "cdgram.y"
  913. {
  914.             Debug((stderr, "adecl: opt_constvol_list type\n"));
  915.             Debug((stderr, "\topt_constvol_list='%s'\n", yypvt[-1].dynstr));
  916.             Debug((stderr, "\ttype='%s'\n", yypvt[-0].dynstr));
  917.             yyval.halves.left = ds("");
  918.             yyval.halves.right = ds("");
  919.             yyval.halves.type = cat(yypvt[-1].dynstr,ds(strlen(yypvt[-1].dynstr)?" ":""),yypvt[-0].dynstr,NullCP);
  920.             if (strcmp(yypvt[-0].dynstr, "void") == 0)
  921.                 prev = 'v';
  922.             else if ((strncmp(yypvt[-0].dynstr, "struct", 6) == 0) ||
  923.                      (strncmp(yypvt[-0].dynstr, "class", 5) == 0))
  924.                 prev = 's';
  925.             else
  926.                 prev = 't';
  927.             Debug((stderr, "\n\tadecl now =\n"));
  928.             Debug((stderr, "\t\tadecl.left='%s'\n", yyval.halves.left));
  929.             Debug((stderr, "\t\tadecl.right='%s'\n", yyval.halves.right));
  930.             Debug((stderr, "\t\tadecl.type='%s'\n", yyval.halves.type));
  931.             Debug((stderr, "\tprev = '%s'\n", visible(prev)));
  932.             } break;
  933. case 54:
  934. # line 617 "cdgram.y"
  935. {
  936.             Debug((stderr, "adims: EMPTY\n"));
  937.             arbdims = 1;
  938.             yyval.dynstr = ds("[]");
  939.             } break;
  940. case 55:
  941. # line 624 "cdgram.y"
  942. {
  943.             Debug((stderr, "adims: NUMBER\n"));
  944.             Debug((stderr, "\tNUMBER='%s'\n", yypvt[-0].dynstr));
  945.             arbdims = 0;
  946.             yyval.dynstr = cat(ds("["),yypvt[-0].dynstr,ds("]"),NullCP);
  947.             } break;
  948. case 56:
  949. # line 633 "cdgram.y"
  950. {
  951.             Debug((stderr, "type: tinit c_type\n"));
  952.             Debug((stderr, "\ttinit=''\n"));
  953.             Debug((stderr, "\tc_type='%s'\n", yypvt[-0].dynstr));
  954.             mbcheck();
  955.             yyval.dynstr = yypvt[-0].dynstr;
  956.             } break;
  957. case 57:
  958. # line 643 "cdgram.y"
  959. {
  960.             Debug((stderr, "tinit: EMPTY\n"));
  961.             modbits = 0;
  962.             } break;
  963. case 58:
  964. # line 650 "cdgram.y"
  965. {
  966.             Debug((stderr, "c_type: mod_list\n"));
  967.             Debug((stderr, "\tmod_list='%s'\n", yypvt[-0].dynstr));
  968.             yyval.dynstr = yypvt[-0].dynstr;
  969.             } break;
  970. case 59:
  971. # line 657 "cdgram.y"
  972. {
  973.             Debug((stderr, "c_type: tname\n"));
  974.             Debug((stderr, "\ttname='%s'\n", yypvt[-0].dynstr));
  975.             yyval.dynstr = yypvt[-0].dynstr;
  976.             } break;
  977. case 60:
  978. # line 664 "cdgram.y"
  979. {
  980.             Debug((stderr, "c_type: mod_list tname\n"));
  981.             Debug((stderr, "\tmod_list='%s'\n", yypvt[-1].dynstr));
  982.             Debug((stderr, "\ttname='%s'\n", yypvt[-0].dynstr));
  983.             yyval.dynstr = cat(yypvt[-1].dynstr,ds(" "),yypvt[-0].dynstr,NullCP);
  984.             } break;
  985. case 61:
  986. # line 672 "cdgram.y"
  987. {
  988.             Debug((stderr, "c_type: StrClaUniEnum NAME\n"));
  989.             Debug((stderr, "\tStrClaUniEnum='%s'\n", yypvt[-1].dynstr));
  990.             Debug((stderr, "\tNAME='%s'\n", yypvt[-0].dynstr));
  991.             yyval.dynstr = cat(yypvt[-1].dynstr,ds(" "),yypvt[-0].dynstr,NullCP);
  992.             } break;
  993. case 64:
  994. # line 683 "cdgram.y"
  995. {
  996.             yyval.dynstr = yypvt[-0].dynstr;
  997.             } break;
  998. case 66:
  999. # line 690 "cdgram.y"
  1000. {
  1001.             yyval.dynstr = yypvt[-0].dynstr;
  1002.             } break;
  1003. case 67:
  1004. # line 696 "cdgram.y"
  1005. {
  1006.             Debug((stderr, "tname: INT\n"));
  1007.             Debug((stderr, "\tINT='%s'\n", yypvt[-0].dynstr));
  1008.             modbits |= MB_INT; yyval.dynstr = yypvt[-0].dynstr;
  1009.             } break;
  1010. case 68:
  1011. # line 703 "cdgram.y"
  1012. {
  1013.             Debug((stderr, "tname: CHAR\n"));
  1014.             Debug((stderr, "\tCHAR='%s'\n", yypvt[-0].dynstr));
  1015.             modbits |= MB_CHAR; yyval.dynstr = yypvt[-0].dynstr;
  1016.             } break;
  1017. case 69:
  1018. # line 710 "cdgram.y"
  1019. {
  1020.             Debug((stderr, "tname: FLOAT\n"));
  1021.             Debug((stderr, "\tFLOAT='%s'\n", yypvt[-0].dynstr));
  1022.             modbits |= MB_FLOAT; yyval.dynstr = yypvt[-0].dynstr;
  1023.             } break;
  1024. case 70:
  1025. # line 717 "cdgram.y"
  1026. {
  1027.             Debug((stderr, "tname: DOUBLE\n"));
  1028.             Debug((stderr, "\tDOUBLE='%s'\n", yypvt[-0].dynstr));
  1029.             modbits |= MB_DOUBLE; yyval.dynstr = yypvt[-0].dynstr;
  1030.             } break;
  1031. case 71:
  1032. # line 724 "cdgram.y"
  1033. {
  1034.             Debug((stderr, "tname: VOID\n"));
  1035.             Debug((stderr, "\tVOID='%s'\n", yypvt[-0].dynstr));
  1036.             modbits |= MB_VOID; yyval.dynstr = yypvt[-0].dynstr;
  1037.             } break;
  1038. case 72:
  1039. # line 732 "cdgram.y"
  1040. {
  1041.             Debug((stderr, "mod_list: modifier mod_list1\n"));
  1042.             Debug((stderr, "\tmodifier='%s'\n", yypvt[-1].dynstr));
  1043.             Debug((stderr, "\tmod_list1='%s'\n", yypvt[-0].dynstr));
  1044.             yyval.dynstr = cat(yypvt[-1].dynstr,ds(" "),yypvt[-0].dynstr,NullCP);
  1045.             } break;
  1046. case 73:
  1047. # line 740 "cdgram.y"
  1048. {
  1049.             Debug((stderr, "mod_list: modifier\n"));
  1050.             Debug((stderr, "\tmodifier='%s'\n", yypvt[-0].dynstr));
  1051.             yyval.dynstr = yypvt[-0].dynstr;
  1052.             } break;
  1053. case 74:
  1054. # line 748 "cdgram.y"
  1055. {
  1056.             Debug((stderr, "mod_list1: mod_list\n"));
  1057.             Debug((stderr, "\tmod_list='%s'\n", yypvt[-0].dynstr));
  1058.             yyval.dynstr = yypvt[-0].dynstr;
  1059.             } break;
  1060. case 75:
  1061. # line 755 "cdgram.y"
  1062. {
  1063.             Debug((stderr, "mod_list1: CONSTVOLATILE\n"));
  1064.             Debug((stderr, "\tCONSTVOLATILE='%s'\n", yypvt[-0].dynstr));
  1065.             if (PreANSIFlag)
  1066.                 notsupported(" (Pre-ANSI Compiler)", yypvt[-0].dynstr, NullCP);
  1067.             else if (RitchieFlag)
  1068.                 notsupported(" (Ritchie Compiler)", yypvt[-0].dynstr, NullCP);
  1069.             else if ((strcmp(yypvt[-0].dynstr, "noalias") == 0) && CplusplusFlag)
  1070.                 unsupp(yypvt[-0].dynstr, NullCP);
  1071.             yyval.dynstr = yypvt[-0].dynstr;
  1072.             } break;
  1073. case 76:
  1074. # line 769 "cdgram.y"
  1075. {
  1076.             Debug((stderr, "modifier: UNSIGNED\n"));
  1077.             Debug((stderr, "\tUNSIGNED='%s'\n", yypvt[-0].dynstr));
  1078.             modbits |= MB_UNSIGNED; yyval.dynstr = yypvt[-0].dynstr;
  1079.             } break;
  1080. case 77:
  1081. # line 776 "cdgram.y"
  1082. {
  1083.             Debug((stderr, "modifier: SIGNED\n"));
  1084.             Debug((stderr, "\tSIGNED='%s'\n", yypvt[-0].dynstr));
  1085.             modbits |= MB_SIGNED; yyval.dynstr = yypvt[-0].dynstr;
  1086.             } break;
  1087. case 78:
  1088. # line 783 "cdgram.y"
  1089. {
  1090.             Debug((stderr, "modifier: LONG\n"));
  1091.             Debug((stderr, "\tLONG='%s'\n", yypvt[-0].dynstr));
  1092.             modbits |= MB_LONG; yyval.dynstr = yypvt[-0].dynstr;
  1093.             } break;
  1094. case 79:
  1095. # line 790 "cdgram.y"
  1096. {
  1097.             Debug((stderr, "modifier: SHORT\n"));
  1098.             Debug((stderr, "\tSHORT='%s'\n", yypvt[-0].dynstr));
  1099.             modbits |= MB_SHORT; yyval.dynstr = yypvt[-0].dynstr;
  1100.             } break;
  1101. case 80:
  1102. # line 798 "cdgram.y"
  1103. {
  1104.             Debug((stderr, "opt_constvol_list: CONSTVOLATILE opt_constvol_list\n"));
  1105.             Debug((stderr, "\tCONSTVOLATILE='%s'\n", yypvt[-1].dynstr));
  1106.             Debug((stderr, "\topt_constvol_list='%s'\n", yypvt[-0].dynstr));
  1107.             if (PreANSIFlag)
  1108.                 notsupported(" (Pre-ANSI Compiler)", yypvt[-1].dynstr, NullCP);
  1109.             else if (RitchieFlag)
  1110.                 notsupported(" (Ritchie Compiler)", yypvt[-1].dynstr, NullCP);
  1111.             else if ((strcmp(yypvt[-1].dynstr, "noalias") == 0) && CplusplusFlag)
  1112.                 unsupp(yypvt[-1].dynstr, NullCP);
  1113.             yyval.dynstr = cat(yypvt[-1].dynstr,ds(strlen(yypvt[-0].dynstr) ? " " : ""),yypvt[-0].dynstr,NullCP);
  1114.             } break;
  1115. case 81:
  1116. # line 812 "cdgram.y"
  1117. {
  1118.             Debug((stderr, "opt_constvol_list: EMPTY\n"));
  1119.             yyval.dynstr = ds("");
  1120.             } break;
  1121. case 82:
  1122. # line 819 "cdgram.y"
  1123. {
  1124.             Debug((stderr, "constvol_list: CONSTVOLATILE opt_constvol_list\n"));
  1125.             Debug((stderr, "\tCONSTVOLATILE='%s'\n", yypvt[-1].dynstr));
  1126.             Debug((stderr, "\topt_constvol_list='%s'\n", yypvt[-0].dynstr));
  1127.             if (PreANSIFlag)
  1128.                 notsupported(" (Pre-ANSI Compiler)", yypvt[-1].dynstr, NullCP);
  1129.             else if (RitchieFlag)
  1130.                 notsupported(" (Ritchie Compiler)", yypvt[-1].dynstr, NullCP);
  1131.             else if ((strcmp(yypvt[-1].dynstr, "noalias") == 0) && CplusplusFlag)
  1132.                 unsupp(yypvt[-1].dynstr, NullCP);
  1133.             yyval.dynstr = cat(yypvt[-1].dynstr,ds(strlen(yypvt[-0].dynstr) ? " " : ""),yypvt[-0].dynstr,NullCP);
  1134.             } break;
  1135. case 86:
  1136. # line 837 "cdgram.y"
  1137. {
  1138.             Debug((stderr, "storage: AUTO,EXTERN,STATIC,REGISTER (%s)\n", yypvt[-0].dynstr));
  1139.             yyval.dynstr = yypvt[-0].dynstr;
  1140.             } break;
  1141. case 87:
  1142. # line 844 "cdgram.y"
  1143. {
  1144.             Debug((stderr, "opt_storage: storage=%s\n", yypvt[-0].dynstr));
  1145.             yyval.dynstr = yypvt[-0].dynstr;
  1146.             } break;
  1147. case 88:
  1148. # line 850 "cdgram.y"
  1149. {
  1150.             Debug((stderr, "opt_storage: EMPTY\n"));
  1151.             yyval.dynstr = ds("");
  1152.             } break;
  1153.         }
  1154.         goto yystack;  /* stack new state and value */
  1155.  
  1156.     }
  1157.