/[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.128 by akim, Thu Dec 27 18:06:41 2001 UTC revision 1.129 by akim, Thu Dec 27 18:07:31 2001 UTC
# Line 334  copy_at (FILE *fin, struct obstack *oout Line 334  copy_at (FILE *fin, struct obstack *oout
334    
335        ungetc (c, fin);        ungetc (c, fin);
336        n = read_signed_integer (fin);        n = read_signed_integer (fin);
337          if (n > stack_offset)
338        obstack_fgrow1 (oout, "yylsp[%d]", n - stack_offset);          complain (_("invalid value: %s%d"), "@", n);
339        locations_flag = 1;        else
340            {
341              /* Offset is always 0 if parser has already popped the stack
342                 pointer.  */
343              obstack_fgrow1 (oout, "yylsp[%d]",
344                              n - (semantic_parser ? 0 : stack_offset));
345              locations_flag = 1;
346            }
347      }      }
348    else    else
349      {      {
# Line 391  copy_dollar (FILE *fin, struct obstack * Line 398  copy_dollar (FILE *fin, struct obstack *
398        ungetc (c, fin);        ungetc (c, fin);
399        n = read_signed_integer (fin);        n = read_signed_integer (fin);
400    
401        if (!type_name && n > 0)        if (n > stack_offset)
402          type_name = get_type_name (n, rule);          complain (_("invalid value: %s%d"), "$", n);
403          else
404        obstack_fgrow1 (oout, "yyvsp[%d]", n - stack_offset);          {
405              if (!type_name && n > 0)
406                type_name = get_type_name (n, rule);
407    
408        if (type_name)            /* Offset is always 0 if parser has already popped the stack
409          obstack_fgrow1 (oout, ".%s", type_name);               pointer.  */
410        if (!type_name && typed)            obstack_fgrow1 (oout, "yyvsp[%d]",
411          complain (_("$%d of `%s' has no declared type"),                            n - (semantic_parser ? 0 : stack_offset));
412                    n, rule->sym->tag);  
413              if (type_name)
414                obstack_fgrow1 (oout, ".%s", type_name);
415              if (!type_name && typed)
416                complain (_("$%d of `%s' has no declared type"),
417                          n, rule->sym->tag);
418            }
419      }      }
420    else    else
421      {      {
# Line 882  parse_thong_decl (void) Line 897  parse_thong_decl (void)
897    nsyms--;    nsyms--;
898  }  }
899    
900    
901  static void  static void
902  parse_muscle_decl (void)  parse_muscle_decl (void)
903  {  {
# Line 1081  read_declarations (void) Line 1097  read_declarations (void)
1097  | values in the current rule so far, which says where to find `$0'   |  | values in the current rule so far, which says where to find `$0'   |
1098  | with respect to the top of the stack.                              |  | with respect to the top of the stack.                              |
1099  |                                                                    |  |                                                                    |
1100  | This routine is used both for actions and guards.  Only the        |  | This routine is used both for actions and guards.  Only            |
1101  | actions_obstack is used, but this is fine, since we use only       |  | ACTION_OBSTACK is used, but this is fine, since we use only        |
1102  | pointers to relevant portions inside this obstack.                 |  | pointers to relevant portions inside this obstack.                 |
1103  `-------------------------------------------------------------------*/  `-------------------------------------------------------------------*/
1104    
# Line 1092  parse_braces (symbol_list *rule, int sta Line 1108  parse_braces (symbol_list *rule, int sta
1108    int c;    int c;
1109    int count;    int count;
1110    
   /* offset is always 0 if parser has already popped the stack pointer */  
   if (semantic_parser)  
     stack_offset = 0;  
   
1111    count = 1;    count = 1;
1112    while (count > 0)    while (count > 0)
1113      {      {

Legend:
Removed from v.1.128  
changed lines
  Added in v.1.129

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