X-Git-Url: https://git.draconx.ca/gitweb/cdecl99.git/blobdiff_plain/a41aa156f28753613f38924fc856d3dc992cfc56..4c819e9466a0573afae0f9787a4704a479517624:/src/parse.y diff --git a/src/parse.y b/src/parse.y index 8abc21a..6f3b304 100644 --- a/src/parse.y +++ b/src/parse.y @@ -32,7 +32,6 @@ #include #include "scan.h" -#include "cdecl.h" #include "cdecl-internal.h" #include "errmsg.h" @@ -108,18 +107,13 @@ * name strings can be used directly in error messages and there is no * need for any string processing. */ -#define yytnamerr(a, b) ( (a) ? yytnamerr_copy(a, b) \ - : strlen(b) ) - -static size_t yytnamerr_copy(char *dst, const char *src) -{ - return cdecl__strlcpy(dst, src, strlen(src)+1); -} +#define yytnamerr(a, b) ( (a) ? cdecl__strlcpy(a, b, -1) : strlen(b) ) %} %code requires { #include #include +#include "cdecl.h" } %code provides { @@ -129,7 +123,7 @@ const char *cdecl__token_name(unsigned token); } %union { - uintmax_t uintval; + cdecl_uintmax uintval; unsigned spectype; bool boolval; struct cdecl_declspec *declspec; @@ -278,7 +272,7 @@ static struct cdecl_declarator *nulldecl(void) %destructor { free_decl($$); } /* Magic tokens */ -%token T_LEX_ERROR +%token T_LEX_ERROR "@@@" %token T_IDENT "identifier" %token T_UINT "integer constant"