]> git.draconx.ca Git - cdecl99.git/blobdiff - src/parse.y
Hand-code the normalized specifier ordering.
[cdecl99.git] / src / parse.y
index 9c644da4bf02f01b424ec92fd15ea26a29aed9a9..11ae6bb824cea90073c64d158a2a9d49ccfaf4cb 100644 (file)
@@ -1,7 +1,7 @@
 %code top {
 /*
  *  Parser for C declarations.
- *  Copyright © 2011 Nick Bowler
+ *  Copyright © 2011-2012, 2021 Nick Bowler
  *
  *  This program is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -32,8 +32,8 @@
 #include <stdbool.h>
 
 #include "scan.h"
-#include "error.h"
 #include "cdecl.h"
+#include "cdecl-internal.h"
 
 #define FAIL(msg) do { \
        yyerror(&yylloc, NULL, NULL, msg); \
@@ -64,6 +64,7 @@ int cdecl__yyparse(void *scanner, struct cdecl **out);
 
 %union {
        uintmax_t uintval;
+       unsigned spectype;
        _Bool boolval;
        char *strval;
        struct cdecl_declspec *declspec;
@@ -205,7 +206,7 @@ void cdecl__free(struct cdecl *decl)
 
 %type <strval>     vla_ident
 %type <boolval>    varargs
-%type <uintval>    declspec_simple typespec_simple qualifier_simple
+%type <spectype>   declspec_simple typespec_simple qualifier_simple
 %type <declspec>   declspec_notype declspec_noid typespec_noid typespec
 %type <declspec>   qualifier qualifiers
 %type <declspec>   declspecs declspecs_noid