+2002-06-20 Akim Demaille <akim@epita.fr>
+
+ * src/symtab.h, src/symtab.c (symbol_type_set)
+ (symbol_destructor_set, symbol_precedence_set): The location is
+ the last argument.
+ Adjust all callers.
+
2002-06-20 Akim Demaille <akim@epita.fr>
* src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
{
symbol_list_t *list;
for (list = yyvsp[0].list; list; list = list->next)
- symbol_destructor_set (list->sym, list->location, yyvsp[-1].string);
+ symbol_destructor_set (list->sym, yyvsp[-1].string, yylsp[-1]);
symbol_list_free (yyvsp[0].list);
current_braced_code = action_braced_code;
}
{
symbol_list_t *list;
for (list = yyvsp[0].list; list; list = list->next)
- symbol_type_set (list->sym, list->location, yyvsp[-1].string);
+ symbol_type_set (list->sym, yyvsp[-1].string, yylsp[-1]);
symbol_list_free (yyvsp[0].list);
}
break;
++current_prec;
for (list = yyvsp[0].list; list; list = list->next)
{
- symbol_type_set (list->sym, list->location, current_type);
- symbol_precedence_set (list->sym, list->location, current_prec, yyvsp[-2].assoc);
+ symbol_type_set (list->sym, current_type, yylsp[-1]);
+ symbol_precedence_set (list->sym, current_prec, yyvsp[-2].assoc, yylsp[-2]);
}
symbol_list_free (yyvsp[0].list);
current_type = NULL;
#line 288 "parse-gram.y"
{
symbol_class_set (yyvsp[0].symbol, current_class, yylsp[0]);
- symbol_type_set (yyvsp[0].symbol, yylsp[0], current_type);
+ symbol_type_set (yyvsp[0].symbol, current_type, yylsp[0]);
}
break;
#line 293 "parse-gram.y"
{
symbol_class_set (yyvsp[-1].symbol, current_class, yylsp[-1]);
- symbol_type_set (yyvsp[-1].symbol, yylsp[-1], current_type);
+ symbol_type_set (yyvsp[-1].symbol, current_type, yylsp[-1]);
symbol_user_token_number_set (yyvsp[-1].symbol, yyvsp[0].integer, yylsp[0]);
}
break;
#line 299 "parse-gram.y"
{
symbol_class_set (yyvsp[-1].symbol, current_class, yylsp[-1]);
- symbol_type_set (yyvsp[-1].symbol, yylsp[-1], current_type);
+ symbol_type_set (yyvsp[-1].symbol, current_type, yylsp[-1]);
symbol_make_alias (yyvsp[-1].symbol, yyvsp[0].symbol);
}
break;
#line 305 "parse-gram.y"
{
symbol_class_set (yyvsp[-2].symbol, current_class, yylsp[-2]);
- symbol_type_set (yyvsp[-2].symbol, yylsp[-2], current_type);
+ symbol_type_set (yyvsp[-2].symbol, current_type, yylsp[-2]);
symbol_user_token_number_set (yyvsp[-2].symbol, yyvsp[-1].integer, yylsp[-1]);
symbol_make_alias (yyvsp[-2].symbol, yyvsp[0].symbol);
}
{
symbol_list_t *list;
for (list = $4; list; list = list->next)
- symbol_destructor_set (list->sym, list->location, $3);
+ symbol_destructor_set (list->sym, $3, @3);
symbol_list_free ($4);
current_braced_code = action_braced_code;
}
{
symbol_list_t *list;
for (list = $3; list; list = list->next)
- symbol_type_set (list->sym, list->location, $2);
+ symbol_type_set (list->sym, $2, @2);
symbol_list_free ($3);
}
;
++current_prec;
for (list = $3; list; list = list->next)
{
- symbol_type_set (list->sym, list->location, current_type);
- symbol_precedence_set (list->sym, list->location, current_prec, $1);
+ symbol_type_set (list->sym, current_type, @2);
+ symbol_precedence_set (list->sym, current_prec, $1, @1);
}
symbol_list_free ($3);
current_type = NULL;
| ID
{
symbol_class_set ($1, current_class, @1);
- symbol_type_set ($1, @1, current_type);
+ symbol_type_set ($1, current_type, @1);
}
| ID INT
{
symbol_class_set ($1, current_class, @1);
- symbol_type_set ($1, @1, current_type);
+ symbol_type_set ($1, current_type, @1);
symbol_user_token_number_set ($1, $2, @2);
}
| ID string_as_id
{
symbol_class_set ($1, current_class, @1);
- symbol_type_set ($1, @1, current_type);
+ symbol_type_set ($1, current_type, @1);
symbol_make_alias ($1, $2);
}
| ID INT string_as_id
{
symbol_class_set ($1, current_class, @1);
- symbol_type_set ($1, @1, current_type);
+ symbol_type_set ($1, current_type, @1);
symbol_user_token_number_set ($1, $2, @2);
symbol_make_alias ($1, $3);
}
`------------------------------------------------------------------*/
void
-symbol_type_set (symbol_t *symbol, location_t location, char *type_name)
+symbol_type_set (symbol_t *symbol, char *type_name, location_t location)
{
if (type_name)
{
`-------------------------------------------------------------------*/
void
-symbol_destructor_set (symbol_t *symbol, location_t location, char *destructor)
+symbol_destructor_set (symbol_t *symbol, char *destructor, location_t location)
{
if (destructor)
{
`------------------------------------------------------------------*/
void
-symbol_precedence_set (symbol_t *symbol, location_t location,
- int prec, associativity assoc)
+symbol_precedence_set (symbol_t *symbol,
+ int prec, associativity assoc, location_t location)
{
if (assoc != undef_assoc)
{
/* Set the TYPE_NAME associated to SYMBOL. Does nothing if passed 0 as
TYPE_NAME. */
-void symbol_type_set PARAMS ((symbol_t *symbol, location_t location,
- char *type_name));
+void symbol_type_set PARAMS ((symbol_t *symbol,
+ char *type_name, location_t location));
/* Set the DESTRUCTOR associated to SYMBOL. */
-void symbol_destructor_set PARAMS ((symbol_t *symbol, location_t location,
- char *destructor));
+void symbol_destructor_set PARAMS ((symbol_t *symbol,
+ char *destructor, location_t location));
/* Set the PRINTER associated to SYMBOL. */
void symbol_printer_set PARAMS ((symbol_t *symbol,
/* Set the PRECEDENCE associated to SYMBOL. Ensures that SYMBOL is a
terminal. Does nothing if invoked with UNDEF_ASSOC as ASSOC. */
-void symbol_precedence_set PARAMS ((symbol_t *symbol, location_t location,
- int prec, associativity assoc));
+void symbol_precedence_set PARAMS ((symbol_t *symbol,
+ int prec, associativity assoc,
+ location_t location));
/* Set the CLASS associated to SYMBOL. */
void symbol_class_set PARAMS ((symbol_t *symbol,