#include "symlist.h"
#include "scan-gram.h"
#include "scan-code.h"
+#include "xmemdup0.h"
#define YYLLOC_DEFAULT(Current, Rhs, N) (Current) = lloc_default (Rhs, N)
static YYLTYPE lloc_default (YYLTYPE const *, int);
}
| "%destructor" "{...}" generic_symlist
{
- symbol_list *list;
- for (list = $3; list; list = list->next)
- symbol_list_destructor_set (list, $2, @2);
- symbol_list_free ($3);
+ code_props code;
+ code_props_symbol_action_init (&code, $2, @2);
+ code_props_translate_code (&code);
+ {
+ symbol_list *list;
+ for (list = $3; list; list = list->next)
+ symbol_list_destructor_set (list, &code);
+ symbol_list_free ($3);
+ }
}
| "%printer" "{...}" generic_symlist
{
- symbol_list *list;
- for (list = $3; list; list = list->next)
- symbol_list_printer_set (list, $2, @2);
- symbol_list_free ($3);
+ code_props code;
+ code_props_symbol_action_init (&code, $2, @2);
+ code_props_translate_code (&code);
+ {
+ symbol_list *list;
+ for (list = $3; list; list = list->next)
+ symbol_list_printer_set (list, &code);
+ symbol_list_free ($3);
+ }
}
| "%default-prec"
{
complain_at (loc, _("missing identifier in parameter declaration"));
else
{
- char *name;
- size_t name_len;
-
- for (name_len = 1;
- memchr (alphanum, name_start[name_len], sizeof alphanum);
- name_len++)
- continue;
-
- name = xmalloc (name_len + 1);
- memcpy (name, name_start, name_len);
- name[name_len] = '\0';
+ char *name = xmemdup0 (name_start, strspn (name_start, alphanum));
muscle_pair_list_grow (type, decl, name);
free (name);
}