#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);
| "%skeleton" STRING
{
char const *skeleton_user = $2;
- if (mbschr (skeleton_user, '/'))
+ if (strchr (skeleton_user, '/'))
{
size_t dir_length = strlen (current_file);
char *skeleton_build;
xmalloc (dir_length + 1 + strlen (skeleton_user) + 1);
if (dir_length > 0)
{
- strncpy (skeleton_build, current_file, dir_length);
+ memcpy (skeleton_build, current_file, dir_length);
skeleton_build[dir_length++] = '/';
}
strcpy (skeleton_build + dir_length, skeleton_user);
{
symbol_list *list;
for (list = $3; list; list = list->next)
- symbol_list_destructor_set (list, $2, @2);
+ symbol_list_code_props_set (list, destructor, @2, $2);
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_code_props_set (list, printer, @2, $2);
symbol_list_free ($3);
}
| "%default-prec"
}
if (! name_start)
- complain_at (loc, _("missing identifier in parameter declaration"));
+ complain_at (loc, complaint,
+ _("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));
if (type & param_lex)
muscle_pair_list_grow ("lex_param", decl, name);
if (type & param_parse)
{
if (strverscmp (version, PACKAGE_VERSION) > 0)
{
- complain_at (*loc, "require bison %s, but have %s",
+ complain_at (*loc, complaint, "require bison %s, but have %s",
version, PACKAGE_VERSION);
exit (EX_MISMATCH);
}
static void
gram_error (location const *loc, char const *msg)
{
- complain_at (*loc, "%s", msg);
+ complain_at (*loc, complaint, "%s", msg);
}
char const *