]> git.draconx.ca Git - cdecl99.git/blobdiff - src/parse.y
libcdecl: Merge some output strings.
[cdecl99.git] / src / parse.y
index 8abc21a7b0450c28aa223d62359ba9805dd944d3..6f3b3044584c4cf8ccf3a4be8f13d0bdf6e798d8 100644 (file)
@@ -32,7 +32,6 @@
 #include <stdbool.h>
 
 #include "scan.h"
-#include "cdecl.h"
 #include "cdecl-internal.h"
 #include "errmsg.h"
 
  * 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 <inttypes.h>
 #include <stdbool.h>
+#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($$); }       <decl>
 
 /* Magic tokens */
-%token T_LEX_ERROR
+%token T_LEX_ERROR "@@@"
 
 %token <item>    T_IDENT "identifier"
 %token <uintval> T_UINT  "integer constant"