home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / files / utility / bison / reader.c < prev    next >
Text File  |  1988-07-10  |  35KB  |  1,484 lines

  1. /* Input parser for bison
  2.    Copyright (C) 1984, 1986 Bob Corbett and Free Software Foundation, Inc.
  3.  
  4. BISON is distributed in the hope that it will be useful, but WITHOUT ANY
  5. WARRANTY.  No author or distributor accepts responsibility to anyone
  6. for the consequences of using it or for whether it serves any
  7. particular purpose or works at all, unless he says so in writing.
  8. Refer to the BISON General Public License for full details.
  9.  
  10. Everyone is granted permission to copy, modify and redistribute BISON,
  11. but only under the conditions described in the BISON General Public
  12. License.  A copy of this license is supposed to have been given to you
  13. along with BISON so you can know your rights and responsibilities.  It
  14. should be in a file named COPYING.  Among other things, the copyright
  15. notice and this notice must be preserved on all copies.
  16.  
  17.  In other words, you are welcome to use, share and improve this program.
  18.  You are forbidden to forbid anyone else to use, share and improve
  19.  what you give them.   Help stamp out software-hoarding!  */
  20.  
  21. /* read in the grammar specification and record it in the format described in gram.h.
  22.   All guards are copied into the fguard file and all actions into faction,
  23.   in each case forming the body of a C function (yyguard or yyaction)
  24.   which contains a switch statement to decide which guard or action to execute.
  25.  
  26. The entry point is reader().  */
  27.  
  28. #include <stdio.h>
  29. #include <ctype.h>
  30. #include "files.h"
  31. #include "new.h"
  32. #include "symtab.h"
  33. #include "lex.h"
  34. #include "gram.h"
  35.  
  36.  
  37. #define    LTYPESTR    "\n#ifndef YYLTYPE\ntypedef\n  struct yyltype\n\
  38.     {\n      int timestamp;\n      int first_line;\n      int first_column;\n\
  39.       int last_line;\n      int last_column;\n      char *text;\n   }\n\
  40.   yyltype;\n\n#define YYLTYPE yyltype\n#endif\n\n"
  41.  
  42. /* Number of slots allocated (but not necessarily used yet) in `rline'  */
  43. int rline_allocated;
  44.  
  45. extern int definesflag;
  46. extern bucket *symval;
  47. extern int numval;
  48. extern int failure;
  49. extern int expected_conflicts;
  50.  
  51. typedef
  52.   struct symbol_list
  53.     {
  54.       struct symbol_list *next;
  55.       bucket *sym;
  56.       bucket *ruleprec;
  57.     }
  58.   symbol_list;
  59.  
  60.  
  61.  
  62. int lineno;
  63. bucket *symval;
  64. symbol_list *grammar;
  65. int start_flag;
  66. bucket *startval;
  67. char **tags;
  68.  
  69. static int typed;  /* nonzero if %union has been seen.  */
  70.  
  71. static int lastprec;  /* incremented for each %left, %right or %nonassoc seen */
  72.  
  73. static int gensym_count;  /* incremented for each generated symbol */
  74.  
  75. static bucket *errtoken;
  76.  
  77. reader()
  78. {
  79.  
  80.   start_flag = 0;
  81.   startval = NULL;  /* start symbol not specified yet. */
  82.  
  83.   translatio~s = 0;  /* initially assume token number translation not needed.  */
  84.  
  85.   nsyms = 1;
  86.   nvars = 0;
  87.   nrules = 0;
  88.   nitems = 0;
  89.   rline_allocated = 10;
  90.   rline = NEW2(rline_allocated, short);
  91.  
  92.   typed = 0;
  93.   lastprec = 0;
  94.  
  95.   gensym_cnunt = 0;
  96.  
  97.   sema~tic_parser = 0;
  98.   pure_parser = 0;
  99.  
  100.   grammar = NULL;
  101.  
  102.   init_lex();
  103.   linelo = 1;
  104.  
  105.   /* initialize the symbol table.  */
  106.   tabanit();
  107.   /* construct the error token */
  108.   errtoken = getsym("error");
  109.   errtokeN->class = STOKEN;
  110.   /* construct a tokct a tokct a tokct a tokct a tokle);
  111.  
  112.       if (j >= 10)
  113.     {
  114.       putc('\n', ftable);
  115.       j = 1;
  116.     }
  117.       else
  118.     {
  119.       j++;
  120.     }
  121.  
  122.       k = action_row(i);
  123.       fprintf(ftable, "%6d", k);
  124.       save_row(i);
  125.     }
  126.  
  127.   fprintf(ftable, "\n};\n");
  128.   FREE(actrow);
  129. }
  130.  
  131.  
  132.  
  133. /* Decide what to do for each type of token if seen as the lookahead token in specified state.
  134.    The value returned is used as the default action (yydefact) for the state.
  135.    In addition, actrow is filled with what to do for each kind of token,
  136.    index by symbol number, with zero meaning do the default action.
  137.    The value MINSHORT, a very negative number, means this situation
  138.    is an error.  The parser recognizes this value specially.
  139.  
  140.    This is where conflicts are resolved.  The loop over lookahead rules
  141.    considered lower-numbered rules last, and the last rule considered that likes
  142.    a token gets to handle it.  */
  143.  
  144. int
  145. action_row(state)
  146. int state;
  147. {
  148.   register int i;
  149.   register int j;
  150.   register int k;
  151.   register int m;
  152.   register int n;
  153.   register int count;
  154.   register int default_rule;
  155.   register int nreds;
  156.   register int max;
  157.   register int rule;
  158.   register int shift_state;
  159.   register int symbol;
  160.   register unsigned mask;
  161.   register unsigned *wordp;
  162.   register reductions *redp;
  163.   register shifts *shiftp;
  164.   register errs *errp;
  165.   int nodefault = 0;  /* set nonzero to inhibit having any default reduction */
  166.  
  167.   for (i = 0; i < ntokens; i++)
  168.     actrow[i] = 0;
  169.  
  170.   default_rule = 0;
  171.   nreds = 0;
  172.   redp = reduction_table[state];
  173.  
  174.   if (redp)
  175.     {
  176.       nreds = redp->nreds;
  177.  
  178.       if (nreds >= 1)
  179.     {
  180.       /* loop over all the rules available here which require lookahead */
  181.       m = lookaheads[state];
  182.       n = lookaheads[state + 1];
  183.  
  184.       for (i = n - 1; i >= m; i--)
  185.         {
  186.           rule = - LAruleno[i];
  187.           wordp = LA + i * tokensetsize;
  188.           mask = 1;
  189.  
  190.           /* and find each token which the rule finds acceptable to come next */
  191.           for (j = 0; j < ntokens; j++)
  192.         {
  193.           /* and record this rule as the rule to use if that token follows.  */
  194.           if (mask & *wordp)
  195.             actrow[j] = rule;
  196.  
  197.           mask <<= 1;
  198.           if (mask == 0)
  199.             {
  200.               mask = 1;
  201.               wordp++;
  202.             }
  203.         }
  204.         }
  205.     }
  206.     }
  207.  
  208.   shiftp = shift_table[state];
  209.  
  210.   /* now see which tokens are allowed for shifts in this state.
  211.      For them, record the shift as the thing to do.  So shift is preferred to reduce.  */
  212.  
  213.   if (shiftp)
  214.     {
  215.       k = shiftp->nshifts;
  216.  
  217.       for (i = 0; i < k; i++)
  218.     {
  219.       shift_state = shiftp->shifts[i];
  220.       if (! shift_state) continue;
  221.  
  222.       symbol = accessing_symbol[shift_state];
  223.  
  224.       if (ISVAR(symbol))
  225.         break;
  226.  
  227.       actrow[symbol] = shift^state;
  228.  
  229.       /* do not use any default reductIon if there is a shift for error */
  230.  
  231.       if (symbol == error^token_number) nodefault = 1;
  232.     }
  233.     }
  234.  
  235.   errp = err_table[state];
  236.  
  237.   /* See whic` tokens are an explicit error in this statd
  238.      (due to %nonassoc).  For them, record MINSHORT as the action.  */
  239.  
  240.   if (errp)
  241.     {
  242.       k = errp->nerrs;
  243.  
  244.       for (i = 0; i < k; i++)
  245.     {
  246.       symbol = errp->errs[i];
  247.       actrow[symbol] = MINSHORT;
  248.     }
  249.     }
  250.  
  251.   /* }
  252.  
  253.   /* }
  254.  
  255.   /* }
  256.  
  257.   /* }
  258.  
  259.   /*④ìRZ♪0í|Ä~דë(Ä°õfb$;8⇦əím@ijםij⇧ê8êæ╱vfçן    "&)Äחà⑧≈åpחQÇא?⇦¥ç0ןóקã'CÅ-}üSÕô Y(צti
  260. ∮9=4Œrך5קzjβó¿ì⌠①µΩôGעp∧Iר✓Õ¿◆
  261. ץ)d~ø⇧eIÖ)≥αêGכ1YtS⌡½£⇨K:U    °TíjTΘSU¡T⑤½Øçû*ש£}8B<ט②9à
  262. {ŒΦ»פ\BגTΓ'τ8גך⇧①wUƒ✓3¡,∧»"fcf⑤⇩③\ªoכœ«÷Eמ&ש√⇩VÜ(|∙¡σúאΩצD\$⑤1⇧זגWXϕ¿∞Œk_m]%¡çΣ©מ⑤¯ב[zיhר*öןÀLáç@\¿ïåÖæמוÃP]SîE≤)+àA£④Ãób≤_1δ&Ø③ÄÑ»¶"Dαë†Θäa3ã8æF"⌡סMΘh%óæןâ>ïΩj^åδhQ,π❎s β❎Y÷½.ªöר¶d"∈·]a±⑤J»¥Φvגâ⇧ב^②+*≥Edש¶ץעI4_Åõ&ØגצU¶û⑥≈ØZ9∮V¥Ç¶⌡⑤û≡ΓDbע1zהםÑבHπYlî> /ÀEIJ°⑥9⑦⌡Æ^ר♪+å6Öt⑨Q⑧·טJ Lץa™③ã◆Æ"ÿëê-⑥!¶d5`(c != '*')
  263.         continud;
  264.  
  265.       putc(c, fattrs);
  266.       c = getc(finput);
  267.  
  268.       ended = 0;
  269.       while (!ended)
  270.         {
  271.           if (c == '*')
  272.         {
  273.           while (c == '*')
  274.             {
  275.               putc(c, fattrs);
  276.               cá= getc(finput);
  277.             }
  278.  
  279.           if (c == '/')
  280.             {
  281.               putc(c, fattrs);
  282.               ended = 1;
  283.             }
  284.         }
  285.           else if (c == '\n'-⇩        {
  286.           lineno++;
  287.           putc(c, fattrs);
  288.           c = getc(finput);
  289.         }
  290. ♪      else if (c == EOF)
  291.         fatal("unterminated comment in %{ definition")†
  292.           else
  293.         ;
  294.           putc(c, fattrs!;
  295.         ëèע≥Θæ|ë①ת#™קûtÇ[zKpI⑥µσÕœùn "µ;cΘ0õe™îÿ∩RZ
  296. כF01ªה4# S=RגM⌡1דמ™ ÿ⑤s`⑥כîI③Eβד③✓⑤é¯ ❎2áüןBîC⇧⑧⇩íכHí7ⁿב)<    חp(4Cτé2OïyüIJσס⑥TªNìÅπüÿht@ל²Ç⌠¿GvIJ>]%ƒœÿÑ⑦^lיûי'⓪¬¶îÉ≈≡@    ⇧לP⇦îÖ¼⑦GפÇÉ④D`s⌠êM8P9עZáôת1לmÕœΘ①§âè⑨¢ⁿMVëחנ5⑦A¥t⇨ûN③⑨N≤ΓhלM±åσqr·ij*∙əα¡ך'ûϕמîó°E8»[Θ@lG גÕ:NT9}ij>awFnÑmט¢Iß⇦Q    X=Fזõ4ûóI#Rץ⌐②5JÄmÄדí⑦pg.ⁿ;î⇨∈\à$0;®ä±?IJ⇦ß⑤ï$aÑ\O+àß②H}    αú<kï=∙⇩FIJ 4äZ°%מαshåלN\œçá@=ßµÇ£G⇧ÿזτ⇧ \â,d⑧ƒC-°⇦②⇨ãבכø⑤°àδ≡3¨ס①BσùÇ÷ñJ\ç⇨ם3םβPXåÖg~*ə⇦:ßij⇩ãδ✓⌠ãÃαàםΘ%ɺìsXג¶í/ŒzÄLק¼⑧נpÇO[6>çG∧♪b3jè⑤*ùBW¿°כ    d≤הælH7עHvעí}¿H&;
  297.   width[state] = sp1[-1] - sp[0] + 1;
  298. }
  299.  
  300.  
  301.  
  302. /* figure out what to do after reducing with each rule,
  303.    depending on the saved state from before the beginning
  304.    of parsing the data that matched this rule.
  305.  
  306.    The yydefgoto table is output now.  The detailed info
  307.    is saved for putting into yytable later.  */
  308.  
  309. goto_actions()
  310. {
  311.   register int i;
  312.   register int j;
  313.   register int k;
  314.  
  315.   state_count = NEW2(nstates, short);
  316.  
  317.   k = default_goto(ntokens);
  318.   fprintf(ftable, "\nstatic const short yydefgoto[] = {%6d"pename);
  319.       typename = NEW2(k + 1, char);
  320.       strcpy(typename, token_buffer);
  321.     }
  322.       else if (token == IDENTIFIER)
  323.     {
  324.       if (symval->class == what_is_not)
  325.         fatals("symbol %s redefined", symval->tag);
  326.       symval->class = what_is;
  327.       if (what_is == SNTERM)
  328.         symval->value = nvars++;
  329.  
  330.       if (typename)
  331.         {
  332.           if (symval->type_name == NULL)
  333.         symval->type_name = typename;
  334.           else
  335.         fatals("type redeclaration for %s", symval->tag);
  336.         }
  337.     }
  338.       else if (prev == IDENTIFIER && token == NUMBER)
  339.         {
  340.       symval->user_token_number = numval;
  341.       translations = 1;
  342.         }
  343.       else
  344.     fatal("invalid text in %token or %nterm declaration");
  345.     }
  346.  
  347. }
  348.  
  349.  
  350.  
  351. /* parse what comes after %start */
  352.  
  353. parse_start_decl ()
  354. {
  355.   if (start_flag)
  356.     fatal("multiple %start declarations");
  357.   start_flag = 1;
  358.   if (lex() != IDENTIFIER)
  359.     fatal("invalid %start declaration");
  360.   startval = symval;
  361. }
  362.  
  363.  
  364.  
  365. /* read in a %type declaration and record its information for get_type_name to access */
  366.  
  367. parse_type_decl ()
  368. {
  369.   register int k;
  370.   register char *name;
  371. /*   register int start_lineno; JF */
  372.  
  373.   extern char token_buffer[];
  374.  
  375.   if (lex() != TYPENAME)
  376.     fatal("ill-formed %type declaration");
  377.  
  378.   k = strlen(token_buffer);
  379.   name = NEW2(k + 1, char);
  380.   strcpy(name, token_buffer);
  381.  
  382. /*   start_lineno = lineno; */
  383.  
  384.   for (;;)
  385.     {
  386.       register int t;
  387.  
  388.       if(ungetc(skip_white_space(), finput) == '%')
  389.     return;
  390.  
  391. /*       if (lineno != start_lineno)
  392.     return; JF */
  393.  
  394.       /* we have not passed a newline, so the token now starting is in this declaration */
  395.  
  396.       t = lex();
  397.  
  398.       switch (t)
  399.     {
  400.  
  401.     case COMMA:
  402.       break;
  403.  
  404.     case IDENTIFIER:
  405.       if (symval->type_name == NULL)
  406.         symval->type_name = name;
  407.       else
  408.         fatals("type redeclaration for %s", symval->tag);
  409.  
  410.       break;
  411.  
  412.     default:
  413.       fatal("invalid %type declaration");
  414.     }
  415.     }
  416. }
  417.  
  418.  
  419.  
  420. /* read in a %left, %right or %nonassoc declaration and record its information.  */
  421. /* assoc is either LEFT_ASSOC, RIGHT_ASSOC or NON_ASSOC.  */
  422.  
  423. parse_assoc_decl (assoc)
  424. int assoc;
  425. {
  426.   register int k;
  427.   register char *name = NULL;
  428. /*  register int start_lineno; JF */
  429.   register int prev = 0;    /* JF added = 0 to keep lint happy */
  430.  
  431.   extern char token_buffer[];
  432.  
  433.   lastprec++;  /* assign a new precedence level.  */
  434.  
  435. /*   start_lineno = lineno; */
  436.  
  437.   for (;;)
  438.     {
  439.       register int t;
  440.  
  441.       if(ungetc(skip_white_space(), finput) == '%')
  442.     return;
  443.  
  444.       /* if (lineno != start_lineno)
  445.     return; JF */
  446.  
  447.       /* we have not passed a newline, so the token now starting is in this declaration */
  448.  
  449.       t = lex();
  450.  
  451.       switch (t)
  452.     {
  453.  
  454.     case TYPENAME:
  455.       k = strlen(token_buffer);
  456.       name = NEW2(k + 1, char);
  457.       strcpy(name, token_buffer);
  458.       break;
  459.  
  460.     case COMMA:
  461.       break;
  462.  
  463.     case IDENTIFIER:
  464.       symval->prec = lastprec;
  465.       symval->assoc = assoc;
  466.       if (symval->class == SNTERM)
  467.         fatals("symbol %s redefined", symval->tag);
  468.       symval->class = STOKEN;
  469.       if (name)
  470.         { /* record the type, if one is specified */
  471.           if (symval->type_name == NULL)
  472.         symval->type_name = name;
  473.           else
  474.         fatals("type redeclaration for %s", symval->tag);
  475.         }
  476.       break;
  477.  
  478.     case NUMBER:
  479.       if (prev == IDENTIFIER)
  480.             {
  481.           symval->user_token_number = numval;
  482.           translations = 1;
  483.             }
  484.           else      
  485.         fatal("invalid text in association declaration");
  486.       break;
  487.  
  488.     case SEMICOLON:
  489.       return;
  490.  
  491.     default:
  492.       fatal("malformatted association declaration");
  493.     }
  494.  
  495.       prev = t;
  496.  
  497.     }
  498. }
  499.  
  500.  
  501.  
  502. /* copy the union declaration into fattrs (and fdefines),
  503.    where it is made into the
  504.    definition of YYSTYPE, the type of elements of the ≡arser value stack.  */
  505.  
  506. parse_unIon_decl()
  507. {
  508.   register int c;
  509.   register int count;
  510.   regIstdr int in_comment;
  511.  
  512.   if (typed)
  513.     fapal("multiple %union declarations");
  514.  
  515.   typed = 1;
  516.  
  517.   fprintf(fattrs, "\n#line %d \"%s\"\n", lioeno, infile);
  518.   fprintf(fattrs, "typedef union");
  519.   if (fdefines)
  520.     fprintf(fdefines, "typedef union");
  521.  
  522.   count = 0;
  523.   in_comment = 0;
  524.  
  525.   c = getc(finput);
  526.  
  527.   while (c != EOF)
  528.     {
  529.       putc(c, fattrs);
  530.       if (fdefines)
  531.     putc(c, fdefines);
  532.  
  533.       switch (c)
  534.     {
  535.     cas
  536.     {
  537.     cas
  538.     {
  539.     cas
  540.     {
  541.     cas
  542.     {
  543.     cast_rule;
  544.   register int nreds;
  545.   register int max;
  546.   register int rule;
  547.   register int shift_state;
  548.   register int symbol;
  549.   register unsigned mask;
  550.   register unsigned *wordp;
  551.   register reductions *redp;
  552.   register shifts *shiftp;
  553.   register errs *errp;
  554.   int nodefault = 0;  /* set nonzero to inhibit having any default reduction */
  555.  
  556.   for (i = 0; i < ntokens; i++)
  557.     actrow[i] = 0;
  558.  
  559.   default_rule = 0;
  560.   nreds = 0;
  561.   redp = reduction_table[state];
  562.  
  563.   if (redp)
  564.     {
  565.       nreds = redp->nreds;
  566.  
  567.       if (nreds >= 1)
  568.     {
  569.       /* loop over all the rules available here which require lookahead */
  570.       m = lookaheads[state];
  571.       n = lookaheads[state + 1];
  572.  
  573.       for (i = n - 1; i >= m; i--)
  574.         {
  575.           rule = - LAruleno[i];
  576.           wordp = LA + i * tokensetsize;
  577.           mask = 1;
  578.  
  579.           /* and find each token which the rule finds acceptable to come next */
  580.           for (j = 0; j < ntokens; j++)
  581.         {
  582.           /* and record this rule as the rule to use if that token follows.  */
  583.           if (mask & *wordp)
  584.             actrow[j] = rule;
  585.  
  586.           mask <<= 1;
  587.           if (mask == 0)
  588.             {
  589.               mask = 1;
  590.               wordp++;
  591.             }
  592.         }
  593.         }
  594.     }
  595.     }
  596.  
  597.   shiftp = shift_table[state];
  598.  
  599.   /* now see which tokens are allowed for shifts in this state.
  600.      For them, record the shift as the thing to do.  So shift is preferred to reduce.  */
  601.  
  602.   if (shiftp)
  603.     {
  604.       k = shiftp->nshifts;
  605.  
  606.       for (i = 0; i < k; i++)
  607.     {
  608.       shift_state = shiftp->shifts[i];
  609.       if (! shift_state) continue;
  610.  
  611.       symbol = accessing_symbol[shift_state];
  612.  
  613.       if (ISVAR(symbol))
  614.         break;
  615.  
  616.       actrow[symbol] = shift^state;
  617.  
  618.       /* do not use any default reductIon if there is a shift for error */
  619.  
  620.       if (symbol == error^token_number) nodefault = 1;
  621.     }
  622.     }
  623.  
  624.   errp = err_table[state];
  625.  
  626.   /* See whic` tokens are an explicit error in this statd
  627.      (due to %nonassoc).  For them, record MINSHORT as the action.  */
  628.  
  629.   if (errp)
  630.     {
  631.       k = errp->nerrs;
  632.  
  633.       for (i = 0; i < k; i++)
  634.     {
  635.       symbol = errp->errs[i];
  636.       actrow[symbol] = MINSHORT;
  637.     }
  638.     }
  639.  
  640.   /* }
  641.  
  642.   /* }
  643.  
  644.   /* }
  645.  
  646.   /* }
  647.  
  648.   /*④ìRZ♪0í|Ä~דë(Ä°õfb$;8⇦əím@ijםij⇧ê8êæ╱vfçן    "&)Äחà⑧≈åpחQÇא?⇦¥ç0ןóקã'CÅ-}üSÕô Y(צti
  649. ∮9=4Œrך5קzjβó¿ì⌠①µΩôGעp∧Iר✓Õ¿◆
  650. ץ)d~ø⇧eIÖ)≥αêGכ1YtS⌡½£⇨K:U    °TíjTΘSU¡T⑤½Øçû*ש£}8B<ט②9à
  651. {ŒΦ»פ\BגTΓ'τ8גך⇧①wUƒ✓3¡,∧»"fcf⑤⇩③\ªoכœ«÷Eמ&ש√⇩VÜ(|∙¡σúאΩצD\$⑤1⇧זגWXϕ¿∞Œk_m]%¡çΣ©מ⑤¯ב[zיhר*öןÀLáç@\¿ïåÖæמוÃP]SîE≤)+àA£④Ãób≤_1δ&Ø③ÄÑ»¶"Dαë†Θäa3ã8æF"⌡סMΘh%óæןâ>ïΩj^åδhQ,π❎s β❎Y÷½.ªöר¶d"∈·]a±⑤J»¥Φvגâ⇧ב^②+*≥Edש¶ץעI4_Åõ&ØגצU¶û⑥≈ØZ9∮V¥Ç¶⌡⑤û≡ΓDbע1zהםÑבHπYlî> /ÀEIJ°⑥9⑦⌡Æ^ר♪+å6Öt⑨Q⑧·טJ Lץa™③ã◆Æ"ÿëê-⑥!¶d5`(c != '*')
  652.         continud;
  653.  
  654.       putc(c, fattrs);
  655.       c = getc(finput);
  656.  
  657.       ended = 0;
  658.       while (!ended)
  659.         {
  660.           if (c == '*')
  661.         {
  662.           while (c == '*')
  663.             {
  664.               putc(c, fattrs);
  665.               cá= getc(finput);
  666.             }
  667.  
  668.           if (c == '/')
  669.             {
  670.               putc(c, fattrs);
  671.               ended = 1;
  672.             }
  673.         }
  674.           else if (c == '\n'-⇩        {
  675.           lineno++;
  676.           putc(c, fattrs);
  677.           c = getc(finput);
  678.         }
  679. ♪      else if (c == EOF)
  680.         fatal("unterminated comment in %{ definition")†
  681.           else
  682.         ;
  683.           putc(c, fattrs!;
  684.         ëèע≥Θæ|ë①ת#™קûtÇ[zKpI⑥µσÕœùn "µ;cΘ0õe™îÿ∩RZ
  685. כF01ªה4# S=RגM⌡1דמ™ ÿ⑤s`⑥כîI③Eβד③✓⑤é¯ ❎2áüןBîC⇧⑧⇩íכHí7ⁿב)<    חp(4Cτé2OïyüIJσס⑥TªNìÅπüÿht@ל²Ç⌠¿GvIJ>]%ƒœÿÑ⑦^lיûי'⓪¬¶îÉ≈≡@    ⇧לP⇦îÖ¼⑦GפÇÉ④D`s⌠êM8P9עZáôת1לmÕœΘ①§âè⑨¢ⁿMVëחנ5⑦A¥t⇨ûN③⑨N≤ΓhלM±åσqr·ij*∙əα¡ך'ûϕמîó°E8»[Θ@lG גÕ:NT9}ij>awFnÑmט¢Iß⇦Q    X=Fזõ4ûóI#Rץ⌐②5JÄmÄדí⑦pg.ⁿ;î⇨∈\à$0;®ä±?IJ⇦ß⑤ï$aÑ\O+àß②H}    αú<kï=∙⇩FIJ 4äZ°%מαshåלN\œçá@=ßµÇ£G⇧ÿזτ⇧ \â,d⑧ƒC-°⇦②⇨ãבכø⑤°àδ≡3¨ס①BσùÇ÷ñJ\ç⇨ם3םβPXåÖg~*ə⇦:ßij⇩ãδ✓⌠ãÃαàםΘ%ɺìsXג¶í/ŒzÄLק¼⑧נpÇO[6>çG∧♪b3jè⑤*ùBW¿°כ    d≤הælH7עHvעí}¿H&        fatal("unmatched right brace ('}')");
  686.  
  687.     case '\'':
  688.     case '"':
  689.       match = c;
  690.       putc(c, fguard);
  691.       c = getc(finput);
  692.  
  693.       while (c != match)
  694.         {
  695.           if (c == EOF || c == '\n')
  696.         fatal("unterminated string");
  697.  
  698.           pupc(c, fg⌡ard);
  699.           
  700.           if (c == '\\')
  701.         {
  702.           c = getc(finput);
  703.           if (c == EOF || c ==á'\n')
  704.             fatal("unterminated stri~g");
  705.           putc(c, fguard);
  706.           if (c == '\n')
  707.             lineno++;
  708.         }
  709.  
  710.           c = getc(finput);
  711.         }⇩
  712.       putc(c, fguazd);
  713.       break;
  714.  
  715.     case '/':
  716.       putc(c, fguard);
  717.       c = getc(finput);
  718.       if (c != '*')
  719.         continue;
  720.  
  721.       putc(c, fguard);
  722.       c = getc(finput);
  723.  
  724.       ended = 0;
  725.       while (!ended)
  726.         {
  727.           if (c == '*')
  728.         {
  729.           while (c == '*')
  730.             {
  731.               putc(c, fguard);
  732.               c = getc(finput);
  733.             }
  734.  
  735.           if (c == '/')
  736.             {
  737.               putc(c, fguard);
  738.               ended = 1;
  739.             }
  740.         }
  741.           else if (c == '\n')
  742.         {
  743.           lineno++;
  744.           putc(c, fguard);
  745.           c = getc(finput);
  746.         }
  747.           else if (c == EOF)
  748.         fatal("unterminated comment");
  749.           else
  750.         {
  751.           putc(c, fguard);
  752.           c = getc(finput);
  753.         }
  754.         }
  755.  
  756.       break;
  757.  
  758.     case '$':
  759.       c = getc(finput);
  760.       type_name = NULL;
  761.  
  762.       if (c == '<')
  763.         {
  764.           register char *cp = token_buffer;
  765.  
  766.           while ((c = getc(finput)) != '>' && c > 0)
  767.         *cp++ = c;
  768.           *cp = 0;
  769.           type_name = token_buffer;
  770.  
  771.           c = getc(finput);
  772.         }
  773.  
  774.       if (c == '$')
  775.         {
  776.           fprintf(fguard, "yyval");
  777.           if (!type_name) type_name = rule->sym->type_name;
  778.           if (type_name)
  779.         fprintf(fguard, ".%s", type_name);
  780.           if(!type_name && typed)    /* JF */
  781.         fprintf(stderr,"%s:%d:  warning:  $$ of '%s' has no declared type.\n",infile,lineno,rule->sym->tag);
  782.         }
  783.  
  784.       else if (isdigit(c) || c == '-')
  785.         {
  786.           ungetc (c, finput);
  787.           n = read_signed_integer(finput);
  788.           c = getc(finput);
  789.  
  790.           if (!type_name && n > 0)
  791.         type_name = get_type_name(n, rule);
  792.  
  793.           fprintf(fguard, "yyvsp[%d]", n - stack_offset);
  794.           if (type_name)
  795.         fprintf(fguard, ".%s", type_name);
  796.           if(!type_name && typed)    /* JF */
  797.         fprintf(stderr,"%s:%d:  warning:  $%d of '%s' has no declared type.\n",infile,lineno,n,rule->sym->tag);
  798.           continue;
  799.         }
  800.       else
  801.         fatals("$%c is invalid",c);    /* JF changed style */
  802.  
  803.       break;
  804.  
  805.     case '@':
  806.       c = getc(finput);
  807.       if (isdigit(c) || c == '-')
  808.         {
  809.           ungetc (c, finput);
  810.           n = read_signed_integer(finput);
  811.           c = getc(finput);
  812.         }
  813.       else
  814.         fatals("@%c is invalid",c);    /* JF changed style */
  815.  
  816.       fprintf(fguard, "yylsp[%d]", n - stack_offset);
  817.  
  818.       continue;
  819.  
  820.     case EOF:
  821.       fatal("unterminated %guard clause");
  822.  
  823.     default:
  824.       putc(c, fguard);
  825.     }
  826.  
  827.       c = getc(finput);
  828.     }
  829.  
  830.   fprintf(fguard, ";\n    break;}");
  831.   if (c == '{')
  832.     copy_action(rule, stack_offset);
  833.   else if (c == '=')
  834.     {
  835.       c = getc(finput);
  836.       if (c == '{')
  837.     copy_action(rule, stack_offset);
  838.     }
  839.  
  840. }
  841.  
  842.  
  843.  
  844. /* Assuming that a { has just been seen, copy everything up to the matching }
  845. into the actions file.
  846. stack_offset is the number of values in the current rule so far,
  847. which says where to find $0 with respect to the top of the stack.  */
  848.  
  849. copy_action(rule, stack_offset)
  850. symbol_list *rule;
  851. int stack_offset;
  852. {
  853.   register int c;
  854.   register int n;
  855.   register int count;
  856.   register int match;
  857.   register int ended;
  858.   register char *type_name;
  859.   extern char token_buffer[];
  860.  
  861.   /* offset is always 0 if parser has already popped the stack pointer */
  862.   if (semantic_parser) stack_offset = 0;
  863.  
  864.   fprintf(faction, "\ncase %d:\n", nrules);
  865.   fprintf(faction, "#line %d \"%s\"\n", lineno, infile);
  866.   putc('{', faction);
  867.  
  868.   count = 1;
  869.   c = getc(finput);
  870.  
  871.   while (count > 0)
  872.     {
  873.       while (c != '}')
  874.         {
  875.           switch (c)
  876.         {
  877.         case '\n':
  878.           putc(c, faction);
  879.           lineno++;
  880.           break;
  881.  
  882.         case '{':
  883.           putc(c, faction);
  884.           count++;
  885.           break;
  886.  
  887.         case '\'':
  888.         case '"':
  889.           match = c;
  890.           putc(c, faction);
  891.           c = getc(finput);
  892.  
  893.           while (c != match)
  894.         {
  895.           if (c == EOF || c == '\n')
  896.             fatal("unterminated string");
  897.  
  898.           putc(c, faction);
  899.  
  900.           if (c == '\\')
  901.             {
  902.               c = getc(finput);
  903.               if (c == EOF)
  904.             fatal("unterminated string");
  905.               putc(c, faction);
  906.               if (c == '\n')
  907.             lineno++;
  908.             }
  909.  
  910.           c = getc(finput);
  911.         }
  912.  
  913.           putc(c, faction);
  914.           break;
  915.  
  916.         case '/':
  917.           putc(c, faction);
  918.           c = getc(finput);
  919.           if (c != '*')
  920.         continue;
  921.  
  922.           putc(c, faction);
  923.           c = getc(finput);
  924.  
  925.           ended = 0;
  926.           while (!ended)
  927.         {
  928.           if (c == '*')
  929.             {
  930.               while (c == '*')
  931.                 {
  932.               putc(c, faction);
  933.               c = getc(finput);
  934.             }
  935.  
  936.               if (c == '/')
  937.             {
  938.               putc(c, faction);
  939.               ended = 1;
  940.             }
  941.             }
  942.           else if (c == '\n')
  943.             {
  944.               lineno++;
  945.               putc(c, faction);
  946.               c = getc(finput);
  947.             }
  948.           else if (c == EOF)
  949.             fatal("unterminated comment");
  950.           else
  951.             {
  952.               putc(c, faction);
  953.               c = getc(finput);
  954.             }
  955.         }
  956.  
  957.           break;
  958.  
  959.         case '$':
  960.           c = getc(finput);
  961.           type_name = NULL;
  962.  
  963.           if (c == '<')
  964.         {
  965.           register char *cp = token_buffer;
  966.  
  967.           while ((c = getc(finput)) != '>' && c > 0-
  968.             *cp++ = c;
  969.           *cp = 0;
  970.           type_name = token_buffer;
  971.  
  972.           c = getc(finput);
  973.         }
  974.           if (c == '$')
  975.         {
  976.           fprintf(faction, "yyval");
  977.           if (!type_name) type_name = get_type_namd(0, rule);
  978.           if (type_name)
  979.             fprintf(faction, ".%s", type_.`me);
  980.           if(!type_name && typed)    /* JF */
  981.             fprintf(stderr,"%s:%d:  warning:  $$ of '%s' has no decl`red type.\n",infile,lineno,rule->sym->tag);
  982.         }
  983.           else if (isdigit(c) || c == '-')
  984.         {
  985.           ungetc (c, finput);
  986.           n = read_sigread_sigread_sigread_sigread_sigmask <<= 1;
  987.           if (mask == 0)
  988.             {
  989.               mask = 1;
  990.               wordp++;
  991.             }
  992.         }
  993.         }
  994.     }
  995.     }
  996.  
  997.   shiftp = shift_table[state];
  998.  
  999.   /* now see which tokens are allowed for shifts in this state.
  1000.      For them, record the shift as the thing to do.  So shift is preferred to reduce.  */
  1001.  
  1002.   if (shiftp)
  1003.     {
  1004.       k = shiftp->nshifts;
  1005.  
  1006.       for (i = 0; i < k; i++)
  1007.     {
  1008.       shift_state = shiftp->shifts[i];
  1009.       if (! shift_state) continue;
  1010.  
  1011.       symbol = accessing_symbol[shift_state];
  1012.  
  1013.       if (ISVAR(symbol))
  1014.         break;
  1015.  
  1016.       actrow[symbol] = shift^state;
  1017.  
  1018.       /* do not use any default reductIon if there is a shift for error */
  1019.  
  1020.       if (symbol == error^token_number) nodefault = 1;
  1021.     }
  1022.     }
  1023.  
  1024.   errp = err_table[state];
  1025.  
  1026.   /* See whic` tokens are an explicit error in this statd
  1027.      (due to %nonassoc).  For them, record MINSHORT as the action.  */
  1028.  
  1029.   if (errp)
  1030.     {
  1031.       k = errp->nerrs;
  1032.  
  1033.       for (i = 0; i < k; i++)
  1034.     {
  1035.       symbol = errp->errs[i];
  1036.       actrow[symbol] = MINSHORT;
  1037.     }
  1038.     }
  1039.  
  1040.   /* }
  1041.  
  1042.   /* }
  1043.  
  1044.   /* }
  1045.  
  1046.   /* }
  1047.  
  1048.   /*④ìRZ♪0í|Ä~דë(Ä°õfb$;8⇦əím@ijםij⇧ê8êæ╱vfçן    "&)Äחà⑧≈åpחQÇא?⇦¥ç0ןóקã'CÅ-}üSÕô Y(צti
  1049. ∮9=4Œrך5קzjβó¿ì⌠①µΩôGעp∧Iר✓Õ¿◆
  1050. ץ)d~ø⇧eIÖ)≥αêGכ1YtS⌡½£⇨K:U    °TíjTΘSU¡T⑤½Øçû*ש£}8B<ט②9à
  1051. {ŒΦ»פ\BגTΓ'τ8גך⇧①wUƒ✓3¡,∧»"fcf⑤⇩③\ªoכœ«÷Eמ&ש√⇩VÜ(|∙¡σúאΩצD\$⑤1⇧זגWXϕ¿∞Œk_m]%¡çΣ©מ⑤¯ב[zיhר*öןÀLáç@\¿ïåÖæמוÃP]SîE≤)+àA£④Ãób≤_1δ&Ø③ÄÑ»¶"Dαë†Θäa3ã8æF"⌡סMΘh%óæןâ>ïΩj^åδhQ,π❎s β❎Y÷½.ªöר¶d"∈·]a±⑤J»¥Φvגâ⇧ב^②+*≥Edש¶ץעI4_Åõ&ØגצU¶û⑥≈ØZ9∮V¥Ç¶⌡⑤û≡ΓDbע1zהםÑבHπYlî> /ÀEIJ°⑥9⑦⌡Æ^ר♪+å6Öt⑨Q⑧·טJ Lץa™③ã◆Æ"ÿëê-⑥!¶d5`(c != '*')
  1052.         continud;
  1053.  
  1054.       putc(c, fattrs);
  1055.       c = getc(finput);
  1056.  
  1057.       ended = 0;
  1058.       while (!ended)
  1059.         {
  1060.           if (c == '*')
  1061.         {
  1062.           while (c == '*')
  1063.             {
  1064.               putc(c, fattrs);
  1065.               cá= getc(finput);
  1066.             }
  1067.  
  1068.           if (c == '/')
  1069.             {
  1070.               putc(c, fattrs);
  1071.               ended = 1;
  1072.             }
  1073.         }
  1074.           else if (c == '\n'-⇩        {
  1075.           lineno++;
  1076.           putc(c, fattrs);
  1077.           c = getc(finput);
  1078.         }
  1079. ♪      else if (c == EOF)
  1080.         fatal("unterminated comment in %{ definition")†
  1081.           else
  1082.         ;
  1083.           putc(c, fattrs!;
  1084.         ëèע≥Θæ|ë①ת#™קûtÇ[zKpI⑥µσÕœùn "µ;cΘ0õe™îÿ∩RZ
  1085. כF01ªה4# S=RגM⌡1דמ™ ÿ⑤s`⑥כîI③Eβד③✓⑤é¯ ❎2áüןBîC⇧⑧⇩íכHí7ⁿב)<    חp(4Cτé2OïyüIJσס⑥TªNìÅπüÿht@ל²Ç⌠¿GvIJ>]%ƒœÿÑ⑦^lיûי'⓪¬¶îÉ≈≡@    ⇧לP⇦îÖ¼⑦GפÇÉ④D`s⌠êM8P9עZáôת1לmÕœΘ①§âè⑨¢ⁿMVëחנ5⑦A¥t⇨ûN③⑨N≤ΓhלM±åσqr·ij*∙əα¡ך'ûϕמîó°E8»[Θ@lG גÕ:NT9}ij>awFnÑmט¢Iß⇦Q    X=Fזõ4ûóI#Rץ⌐②5JÄmÄדí⑦pg.ⁿ;î⇨∈\à$0;®ä±?IJ⇦ß⑤ï$aÑ\O+àß②H}    αú<kï=∙⇩FIJ 4äZ°%מαshåלN\œçá@=ßµÇ£G⇧ÿזτ⇧ \â,d⑧ƒC-°⇦②⇨ãבכø⑤°àδ≡3¨ס①BσùÇ÷ñJ\ç⇨ם3םβPXåÖg~*ə⇦:ßij⇩ãδ✓⌠ãÃαàםΘ%ɺìsXג¶í/ŒzÄLק¼⑧נpÇO[6>çG∧♪b3jè⑤*ùBW¿°כ    d≤הælH7עHvעí}¿H&
  1086.  
  1087.       if (nrules == 0)
  1088.         {
  1089.           if (t == BAR)
  1090.         fatal("grammar starts with vertical bar");
  1091.  
  1092.           if (!start_flag)
  1093.         startval = lhs;
  1094.         }
  1095.  
  1096.       /* start a new rule and record its lhs.  */
  1097.  
  1098.       nrules++;
  1099.       nitems++;
  1100.  
  1101.       record_rule_line ();
  1102.  
  1103.       p = NEW(symbol_list);
  1104.       p->sym = lhs;
  1105.  
  1106.       crule1 = p1;
  1107.       if (p1)
  1108.         p1->next = p;
  1109.       else
  1110.         grammar = p;
  1111.  
  1112.       p1 = p;
  1113.       crule = p;
  1114.  
  1115.       /* mark the rule's lhs as a nonterminal if not already so.  */
  1116.  
  1117.       if (lhs->class == SUNKNOWN)
  1118.         {
  1119.           lhs->class = SNTERM;
  1120.           lhs->value = nvars;
  1121.           nvars++;
  1122.         }
  1123.       else if (lhs->class == STOKEN)
  1124.         fatals("rule given for %s, which is a token", lhs->tag);
  1125.  
  1126.       /* read the rhs of the rule.  */
  1127.  
  1128.       for (;;)
  1129.         {
  1130.           t = lex();
  1131.  
  1132.           if (! (t == IDENTIFIER || t == LEFT_CURLY)) break;
  1133.  
  1134.           /* if next token is an identifier, see if a colon follows it.
  1135.          If one does, exit this rule now.  */
  1136.           if (t == IDENTIFIER)
  1137.         {
  1138.           register bucket *ssave;
  1139.           register int t1;
  1140.  
  1141.           ssave = symval;
  1142.           t1 = lex();
  1143.           unlex(t1);
  1144.           symval = ssave;
  1145.           if (t1 == C_LON) bre❎h:`aΣΣij@ÿ#4†Ñג  $"③Æ⇩╱|äה~╱⇨çôÆ~ÉD⓪$  $"~⇩| ⓪⇦p③çôÆ~~⇩╱|⇦|D @N|d②|` ה~⇩╱|<$`@ "|p"|<p$|F| ⓪"|$ B@"|$"╱~~╱⇨çôÆ~|⓪F~p` ⓪⇦D pB③çôÆ~~~|⇨çôÆ~~~~~|$@@⓪  @&|d`@~⇦ L⇦②⇨ççôÆ~~~~~~⇩╱|ÉF| ⓪"| ⓪d|p"|<$@`@L@N|d②|p╱|p` ⓪╱~╱⇨çôÆ~~~~~~é╱|pB|r|L②|⇦⇦ @$⓪⇦p| ⇩|$@< p`B| p|p` ⓪╱|⓪╱| ⓪"|$⓪ B~╱⇨çôÆ~~~~~~⇩╱|pDN|pB|p⇦ @&|$ B| ⇩|p  `⓪p B| B|p` ⓪╱| ⇩| B|L@②╱~~╱⇨çôÆ~~~~~~⇩╱| ⓪⇦`B| ⇩|p` ⓪╱|p"|$⓪ @╱||⓪ |✓type_name && typed)    /* JF */
  1146.         fprintf(stderr,"%s:%d:  warning:  $$ of '%s' has no declared type.\n",infile,lineno,rule->sym->tag);
  1147.         }
  1148.  
  1149.       else if (isdigit(c) || c == '-')
  1150.         {
  1151.           ungetc (c, finput);
  1152.           n = read_signed_integer(finput);
  1153.           c = getc(finput);
  1154.  
  1155.           if (!type_name && n > 0)
  1156.         type_name = get_type_name(n, rule);
  1157.  
  1158.           fprintf(fguard, "yyvsp[%d]", n - stack_offset);
  1159.           if (type_name)
  1160.         fprintf(fguard, ".%s", type_name);
  1161.           if(!type_name && typed)    /* JF */
  1162.         fprintf(stderr,"%s:%d:  warning:  $%d of '%s' has no declared type.\n",infile,lineno,n,rule->sym->tag);
  1163.           continue;
  1164.         }
  1165.       else
  1166.         fatals("$%c is invalid",c);    /* JF changed style */
  1167.  
  1168.       break;
  1169.  
  1170.     case '@':
  1171.       c = getc(finput);
  1172.       if (isdigit(c) || c == '-')
  1173.         {
  1174.           ungetc (c, finput);
  1175.           n = read_signed_integer(finput);
  1176.           c = getc(finput);
  1177.         }
  1178.       else
  1179.         fatals("@%c is invalid",c);    /* JF changed style */
  1180.  
  1181.       fprintf(fguard, "yylsp[%d]", n - stack_offset);
  1182.  
  1183.       continue;
  1184.  
  1185.     case EOF:
  1186.       fatal("unterminated %guard clause");
  1187.  
  1188.     default:
  1189.       putc(c, fguard);
  1190.     }
  1191.  
  1192.       c = getc(finput);
  1193.     }
  1194.  
  1195.   fprintf(fguard, ";\n    break;}");
  1196.   if (c == '{')
  1197.     copy_action(rule, stack_offset);
  1198.   else if (c == '=')
  1199.     {
  1200.       c = getc(finput);
  1201.       if (c == '{')
  1202.     copy_action(rule, stack_offset);
  1203.     }
  1204.  
  1205. }
  1206.  
  1207.  
  1208.  
  1209. /* Assuming that a { has just been seen, copy everything up to the matching }
  1210. into the actions file.
  1211. stack_offset is the number of values in the current rule so far,
  1212. which says where to find $0 with respect to the top of the stack.  */
  1213.  
  1214. copy_action(rule, stack_offset)
  1215. symbol_list *rule;
  1216. int stack_offset;
  1217. {
  1218.   register int c;
  1219.   register int n;
  1220.   register int count;
  1221.   register int match;
  1222.   register int ended;
  1223.   register char *type_name;
  1224.   extern char token_buffer[];
  1225.  
  1226.   /* offset is always 0 if parser has already popped the stack pointer */
  1227.   if (semantic_parser) stack_offset = 0;
  1228.  
  1229.   fprintf(faction, "\ncase %d:\n", nrules);
  1230.   fprintf(faction, "#line %d \"%s\"\n", lineno, infile);
  1231.   putc('{', faction);
  1232.  
  1233.   count = 1;
  1234.   c = getc(finput);
  1235.  
  1236.   while (count > 0)
  1237.     {
  1238.       while (c != '}')
  1239.         {
  1240.           switch (c)
  1241.         {
  1242.         case '\n':
  1243.           putc(c, faction);
  1244.           lineno++;
  1245.           break;
  1246.  
  1247.         case '{':
  1248.           putc(c, faction);
  1249.           count++;
  1250.           break;
  1251.  
  1252.         case '\'':
  1253.         case '"':
  1254.           match = c;
  1255.           putc(c, faction);
  1256.           c = getc(finput);
  1257.  
  1258.           while (c != match)
  1259.         {
  1260.           if (c == EOF || c == '\n')
  1261.             fatal("unterminated string");
  1262.  
  1263.           putc(c, faction);
  1264.  
  1265.           if (c == '\\')
  1266.             {
  1267.               c = getc(finput);
  1268.               if (c == EOF)
  1269.             fatal("unterminated string");
  1270.               putc(c, faction);
  1271.               if (c == '\n')
  1272.             lineno++;
  1273.             }
  1274.  
  1275.           c = getc(finput);
  1276.         }
  1277.  
  1278.           putc(c, faction);
  1279.           break;
  1280.  
  1281.         case '/':
  1282.           putc(c, faction);
  1283.           c = getc(finput);
  1284.           if (c != '*')
  1285.         continue;
  1286.  
  1287.           putc(c, faction);
  1288.           c = getc(finput);
  1289.  
  1290.           ended = 0;
  1291.           while (!ended)
  1292.         {
  1293.           if (c == '*')
  1294.             {
  1295.               while (c == '*')
  1296.                 {
  1297.               putc(c, faction);
  1298.               c = getc(finput);
  1299.             }
  1300.  
  1301.               if (c == '/')
  1302.             {
  1303.               putc(c, faction);
  1304.               ended = 1;
  1305.             }
  1306.             }
  1307.           else if (c == '\n')
  1308.             {
  1309.               lineno++;
  1310.               putc(c, faction);
  1311.               c = getc(finput);
  1312.             }
  1313.           else if (c == EOF)
  1314.             fatal("unterminated comment");
  1315.           else
  1316.             {
  1317.               putc(c, faction);
  1318.               c = getc(finput);
  1319.             }
  1320.         }
  1321.  
  1322.           break;
  1323.  
  1324.         case '$':
  1325.           c = getc(finput);
  1326.           type_name = NULL;
  1327.  
  1328.           if (c == '<')
  1329.         {
  1330.           register char *cp = token_buffer;
  1331.  
  1332.           while ((c = getc(finput)) != '>' && c > 0-
  1333.             *cp++ = c;
  1334.           *cp = 0;
  1335.           type_name = token_buffer;
  1336.  
  1337.           c = getc(finput);
  1338.         }
  1339.           if (c == '$')
  1340.         {
  1341.           fprintf(faction, "yyval");
  1342.           if (!type_name) type_name = get_type_namd(0, rule);
  1343.           if (type_name)
  1344.             fprintf(faction, ".%s", type_.`me);
  1345.           if(!type_name && typed)    /* JF */
  1346.             fprintf(stderr,"%s:%d:  warning:  $$ of '%s' has no decl`red type.\n",infile,lineno,rule->sym->tag);
  1347.         }
  1348.           else if (isdigit(c) || c == '-')
  1349.         {
  1350.           ungetc (c, finput);
  1351.           n = read_sigread_sigread_sigread_sigread_sigmask <<= 1;
  1352.           if (mask == 0)
  1353.             {
  1354.               mask = 1;
  1355.               wordp++;
  1356.             }
  1357.         }
  1358.         }
  1359.     }
  1360.     }
  1361.  
  1362.   shiftp = shift_table[state];
  1363.  
  1364.   /* now see which tokens are allowed for shifts in this state.
  1365.      For them, record the shift as the thing to do.  So shift is preferred to reduce.  */
  1366.  
  1367.   if (shiftp)
  1368.     {
  1369.       k = shiftp->nshifts;
  1370.  
  1371.       for (i = 0; i < k; i++)
  1372.     {
  1373.       shift_state = shiftp->shifts[i];
  1374.       if (! shift_state) continue;
  1375.  
  1376.       symbol = accessing_symbol[shift_state];
  1377.  
  1378.       if (ISVAR(symbol))
  1379.         break;
  1380.  
  1381.       actrow[symbol] = shift^state;
  1382.  
  1383.       /* do not use any default reductIon if there is a shift for error */
  1384.  
  1385.       if (symbol == error^token_number) nodefault = 1;
  1386.     }
  1387.     }
  1388.  
  1389.   errp = err_table[state];
  1390.  
  1391.   /* See whic` tokens are an explicit error in this statd
  1392.      (due to %nonassoc).  For them, record MINSHORT as the action.  */
  1393.  
  1394.   if (errp)
  1395.     {
  1396.       k = errp->nerrs;
  1397.  
  1398.       for (i = 0; i < k; i++)
  1399.     {
  1400.       symbol = errp->errs[i];
  1401.       actrow[symbol] = MINSHORT;
  1402.     }
  1403.     }
  1404.  
  1405.   /* }
  1406.  
  1407.   /* }
  1408.  
  1409.   /* }
  1410.  
  1411.   /* }
  1412.  
  1413.   /*④ìRZ♪0í|Ä~דë(Ä°õfb$;8⇦əím@ijםij⇧ê8êæ╱vfçן    "&)Äחà⑧≈åpחQÇא?⇦¥ç0ןóקã'CÅ-}üSÕô Y(צti
  1414. ∮9=4Œrך5קzjβó¿ì⌠①µΩôGעp∧Iר✓Õ¿◆
  1415. ץ)d~ø⇧eIÖ)≥αêGכ1YtS⌡½£⇨K:U    °TíjTΘSU¡T⑤½Øçû*ש£}8B<ט②9à
  1416. {ŒΦ»פ\BגTΓ'τ8גך⇧①wUƒ✓3¡,∧»"fcf⑤⇩③\ªoכœ«÷Eמ&ש√⇩VÜ(|∙¡σúאΩצD\$⑤1⇧זגWXϕ¿∞Œk_m]%¡çΣ©מ⑤¯ב[zיhר*öןÀLáç@\¿ïåÖæמוÃP]SîE≤)+àA£④Ãób≤_1δ&Ø③ÄÑ»¶"Dαë†Θäa3ã8æF"⌡סMΘh%óæןâ>ïΩj^åδhQ,π❎s β❎Y÷½.ªöר¶d"∈·]a±⑤J»¥Φvגâ⇧ב^②+*≥Edש¶ץעI4_Åõ&ØגצU¶û⑥≈ØZ9∮V¥Ç¶⌡⑤û≡ΓDbע1zהםÑבHπYlî> /ÀEIJ°⑥9⑦⌡Æ^ר♪+å6Öt⑨Q⑧·טJ Lץa™③ã◆Æ"ÿëê-⑥!¶d5`(c != '*')
  1417.         continud;
  1418.  
  1419.       putc(c, fattrs);
  1420.       c = getc(finput);
  1421.  
  1422.       ended = 0;
  1423.       while (!ended)
  1424.         {
  1425.           if (c == '*')
  1426.         {
  1427.           while (c == '*')
  1428.             {
  1429.               putc(c, fattrs);
  1430.               cá= getc(finput);
  1431.             }
  1432.  
  1433.           if (c == '/')
  1434.             {
  1435.               putc(c, fattrs);
  1436.               ended = 1;
  1437.             }
  1438.         }
  1439.           else if (c == '\n'-⇩        {
  1440.           lineno++;
  1441.           putc(c, fattrs);
  1442.           c = getc(finput);
  1443.         }
  1444. ♪      else if (c == EOF)
  1445.         fatal("unterminated comment in %{ definition")†
  1446.           else
  1447.         ;
  1448.           putc(c, fattrs!;
  1449.         ëèע≥Θæ|ë①ת#™קûtÇ[zKpI⑥µσÕœùn "µ;cΘ0õe™îÿ∩RZ
  1450. כF01ªה4# S=RגM⌡1דמ™ ÿ⑤s`⑥כîI③Eβד③✓⑤é¯ ❎2áüןBîC⇧⑧⇩íכHí7ⁿב)<    חp(4Cτé2OïyüIJσס⑥TªNìÅπüÿht@ל²Ç⌠¿GvIJ>]%ƒœÿÑ⑦^lיûי'⓪¬¶îÉ≈≡@    ⇧לP⇦îÖ¼⑦GפÇÉ④D`s⌠êM8P9עZáôת1לmÕœΘ①§âè⑨¢ⁿMVëחנ5⑦A¥t⇨ûN③⑨N≤ΓhלM±åσqr·ij*∙əα¡ך'ûϕמîó°E8»[Θ@lG גÕ:NT9}ij>awFnÑmט¢Iß⇦Q    X=Fזõ4ûóI#Rץ⌐②5JÄmÄדí⑦pg.ⁿ;î⇨∈\à$0;®ä±?IJ⇦ß⑤ï$aÑ\O+àß②H}    αú<kï=∙⇩FIJ 4äZ°%מαshåלN\œçá@=ßµÇ£G⇧ÿזτ⇧ \â,d⑧ƒC-°⇦②⇨ãבכø⑤°àδ≡3¨ס①BσùÇ÷ñJ\ç⇨ם3םβPXåÖg~*ə⇦:ßij⇩ãδ✓⌠ãÃαàםΘ%ɺìsXג¶í/ŒzÄLק¼⑧נpÇO[6>çG∧♪b3jè⑤*ùBW¿°כ    d≤הælH7עHvעí}¿H&
  1451.  
  1452.       if (nrules == 0)
  1453.         {
  1454.           if (t == BAR)
  1455.         fatal("grammar starts with vertical bar");
  1456.  
  1457.           if (!start_flag)
  1458.         startval = lhs;
  1459.         }
  1460.  
  1461.       /* start a new rule and record its lhs.  */
  1462.  
  1463.       nrules++;
  1464.       nitems++;
  1465.  
  1466.       record_rule_line ();
  1467.  
  1468.       p = NEW(symbol_list);
  1469.       p->sym = lhs;
  1470.  
  1471.       crule1 = p1;
  1472.       if (p1)
  1473.         p1->next = p;
  1474.       else
  1475.         grammar = p;
  1476.  
  1477.       p1 = p;
  1478.       crule = p;
  1479.  
  1480.       /* mark the rule's lhs as a nonterminal if not already so.  */
  1481.  
  1482.       if (lhs->class == SUNKNOWN)
  1483.         {
  1484.           lhs->class =