/[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.197 by akim, Mon Jun 17 07:04:49 2002 UTC revision 1.198 by akim, Thu Jun 20 11:10:56 2002 UTC
# Line 50  void Line 50  void
50  grammar_start_symbol_set (symbol_t *s, location_t l)  grammar_start_symbol_set (symbol_t *s, location_t l)
51  {  {
52    if (start_flag)    if (start_flag)
53      complain (_("multiple %s declarations"), "%start");      complain_at (l, _("multiple %s declarations"), "%start");
54    else    else
55      {      {
56        start_flag = 1;        start_flag = 1;
# Line 200  grammar_rule_begin (symbol_t *lhs, locat Line 200  grammar_rule_begin (symbol_t *lhs, locat
200        ++nvars;        ++nvars;
201      }      }
202    else if (lhs->class == token_sym)    else if (lhs->class == token_sym)
203      complain (_("rule given for %s, which is a token"), lhs->tag);      complain_at (location, _("rule given for %s, which is a token"), lhs->tag);
204  }  }
205    
206  /* Check that the last rule (CURRENT_RULE) is properly defined.  For  /* Check that the last rule (CURRENT_RULE) is properly defined.  For
# Line 224  grammar_current_rule_check (void) Line 224  grammar_current_rule_check (void)
224        const char *lhs_type = lhs->type_name       ? lhs->type_name       : "";        const char *lhs_type = lhs->type_name       ? lhs->type_name       : "";
225        const char *rhs_type = first_rhs->type_name ? first_rhs->type_name : "";        const char *rhs_type = first_rhs->type_name ? first_rhs->type_name : "";
226        if (strcmp (lhs_type, rhs_type))        if (strcmp (lhs_type, rhs_type))
227          complain (_("type clash (`%s' `%s') on default action"),          complain_at (current_rule->location,
228                    lhs_type, rhs_type);                       _("type clash (`%s' `%s') on default action"),
229                         lhs_type, rhs_type);
230      }      }
231    /* Warn if there is no default for $$ but we need one.  */    /* Warn if there is no default for $$ but we need one.  */
232    else    else
233      {      {
234        if (lhs->type_name)        if (lhs->type_name)
235          complain (_("empty rule for typed nonterminal, and no action"));          complain_at (current_rule->location,
236                         _("empty rule for typed nonterminal, and no action"));
237      }      }
238  }  }
239    
# Line 299  grammar_midrule_action (void) Line 301  grammar_midrule_action (void)
301  /* Set the precedence symbol of the current rule to PRECSYM. */  /* Set the precedence symbol of the current rule to PRECSYM. */
302    
303  void  void
304  grammar_current_rule_prec_set (symbol_t *precsym)  grammar_current_rule_prec_set (symbol_t *precsym, location_t location)
305  {  {
306    if (current_rule->ruleprec)    if (current_rule->ruleprec)
307      complain (_("two @prec's in a row"));      complain_at (location, _("two @prec's in a row"));
308    current_rule->ruleprec = precsym;    current_rule->ruleprec = precsym;
309  }  }
310    

Legend:
Removed from v.1.197  
changed lines
  Added in v.1.198

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