/[bison]/bison/src/reader.c
ViewVC logotype

Diff of /bison/src/reader.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.161 by akim, Sun Apr 7 17:43:53 2002 UTC revision 1.162 by akim, Sun Apr 7 17:44:05 2002 UTC
# Line 326  get_type_name (int n, symbol_list *rule) Line 326  get_type_name (int n, symbol_list *rule)
326            complain (_("invalid $ value"));            complain (_("invalid $ value"));
327            return NULL;            return NULL;
328          }          }
329        i++;        ++i;
330      }      }
331    
332    return rp->sym->type_name;    return rp->sym->type_name;
# Line 369  copy_string2 (FILE *fin, struct obstack Line 369  copy_string2 (FILE *fin, struct obstack
369            obstack_1grow (oout, c);            obstack_1grow (oout, c);
370    
371            if (c == '\n')            if (c == '\n')
372              lineno++;              ++lineno;
373          }          }
374    
375        c = getc (fin);        c = getc (fin);
# Line 452  copy_comment (FILE *fin, struct obstack Line 452  copy_comment (FILE *fin, struct obstack
452          }          }
453        else if (c == '\n')        else if (c == '\n')
454          {          {
455            lineno++;            ++lineno;
456            obstack_1grow (oout, c);            obstack_1grow (oout, c);
457            if (cplus_comment)            if (cplus_comment)
458              ended = 1;              ended = 1;
# Line 614  copy_definition (void) Line 614  copy_definition (void)
614          {          {
615          case '\n':          case '\n':
616            obstack_1grow (&attrs_obstack, c);            obstack_1grow (&attrs_obstack, c);
617            lineno++;            ++lineno;
618            break;            break;
619    
620          case '%':          case '%':
# Line 826  parse_assoc_decl (associativity assoc) Line 826  parse_assoc_decl (associativity assoc)
826    char *name = NULL;    char *name = NULL;
827    int prev = 0;    int prev = 0;
828    
829    lastprec++;                   /* Assign a new precedence level, never 0.  */    /* Assign a new precedence level, never 0.  */
830      ++lastprec;
831    
832    for (;;)    for (;;)
833      {      {
# Line 931  parse_union_decl (void) Line 932  parse_union_decl (void)
932        switch (c)        switch (c)
933          {          {
934          case '\n':          case '\n':
935            lineno++;            ++lineno;
936            break;            break;
937    
938          case '/':          case '/':
# Line 939  parse_union_decl (void) Line 940  parse_union_decl (void)
940            break;            break;
941    
942          case '{':          case '{':
943            count++;            ++count;
944            break;            break;
945    
946          case '}':          case '}':
# Line 1276  parse_braces (symbol_list *rule, int sta Line 1277  parse_braces (symbol_list *rule, int sta
1277            {            {
1278            case '\n':            case '\n':
1279              obstack_1grow (&action_obstack, c);              obstack_1grow (&action_obstack, c);
1280              lineno++;              ++lineno;
1281              break;              break;
1282    
1283            case '{':            case '{':
1284              obstack_1grow (&action_obstack, c);              obstack_1grow (&action_obstack, c);
1285              count++;              ++count;
1286              break;              break;
1287    
1288            case '\'':            case '\'':
# Line 1431  readgram (void) Line 1432  readgram (void)
1432            }            }
1433          /* start a new rule and record its lhs.  */          /* start a new rule and record its lhs.  */
1434    
1435          nrules++;          ++nrules;
1436          nitems++;          ++nitems;
1437    
1438          p = symbol_list_new (lhs);          p = symbol_list_new (lhs);
1439    
# Line 1451  readgram (void) Line 1452  readgram (void)
1452            {            {
1453              lhs->class = nterm_sym;              lhs->class = nterm_sym;
1454              lhs->number = nvars;              lhs->number = nvars;
1455              nvars++;              ++nvars;
1456            }            }
1457          else if (lhs->class == token_sym)          else if (lhs->class == token_sym)
1458            complain (_("rule given for %s, which is a token"), lhs->tag);            complain (_("rule given for %s, which is a token"), lhs->tag);
# Line 1509  readgram (void) Line 1510  readgram (void)
1510                  /* Make a new rule, whose body is empty, before the                  /* Make a new rule, whose body is empty, before the
1511                     current one, so that the action just read can                     current one, so that the action just read can
1512                     belong to it.  */                     belong to it.  */
1513                  nrules++;                  ++nrules;
1514                  nitems++;                  ++nitems;
1515                  p = symbol_list_new (sdummy);                  p = symbol_list_new (sdummy);
1516                  /* Attach its lineno to that of the host rule. */                  /* Attach its lineno to that of the host rule. */
1517                  p->line = crule->line;                  p->line = crule->line;
# Line 1531  readgram (void) Line 1532  readgram (void)
1532    
1533                  /* Insert the dummy generated by that rule into this                  /* Insert the dummy generated by that rule into this
1534                     rule.  */                     rule.  */
1535                  nitems++;                  ++nitems;
1536                  p = symbol_list_new (sdummy);                  p = symbol_list_new (sdummy);
1537                  p1->next = p;                  p1->next = p;
1538                  p1 = p;                  p1 = p;
# Line 1541  readgram (void) Line 1542  readgram (void)
1542    
1543              if (t == tok_identifier)              if (t == tok_identifier)
1544                {                {
1545                  nitems++;                  ++nitems;
1546                  p = symbol_list_new (symval);                  p = symbol_list_new (symval);
1547                  p1->next = p;                  p1->next = p;
1548                  p1 = p;                  p1 = p;
# Line 1550  readgram (void) Line 1551  readgram (void)
1551                {                {
1552                  parse_action (crule, rulelength);                  parse_action (crule, rulelength);
1553                  action_flag = 1;                  action_flag = 1;
1554                  xactions++;     /* JF */                  ++xactions;     /* JF */
1555                }                }
1556              rulelength++;              ++rulelength;
1557            }                     /* end of  read rhs of rule */            }                     /* end of  read rhs of rule */
1558    
1559          /* Put an empty link in the list to mark the end of this rule  */          /* Put an empty link in the list to mark the end of this rule  */
# Line 1584  readgram (void) Line 1585  readgram (void)
1585                complain (_("two actions at end of one rule"));                complain (_("two actions at end of one rule"));
1586              parse_action (crule, rulelength);              parse_action (crule, rulelength);
1587              action_flag = 1;              action_flag = 1;
1588              xactions++; /* -wjh */              ++xactions; /* -wjh */
1589              t = lex ();              t = lex ();
1590            }            }
1591          /* If $$ is being set in default way, report if any type          /* If $$ is being set in default way, report if any type
# Line 1785  packgram (void) Line 1786  packgram (void)
1786            rules[ruleno].prec = ruleprec;            rules[ruleno].prec = ruleprec;
1787          }          }
1788        ritem[itemno++] = -ruleno;        ritem[itemno++] = -ruleno;
1789        ruleno++;        ++ruleno;
1790    
1791        if (p)        if (p)
1792          p = p->next;          p = p->next;

Legend:
Removed from v.1.161  
changed lines
  Added in v.1.162

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26