]> git.draconx.ca Git - cdecl99.git/blobdiff - src/cdecl.h
Fix pointer declarators.
[cdecl99.git] / src / cdecl.h
index 489be835284d65caf634d91f956d908a216edb69..9c06b799c261a674df2301f9f26ab2055006cf32 100644 (file)
@@ -2,6 +2,7 @@
 #define CEDCL_H_
 
 #include <stddef.h>
+#include <stdint.h>
 
 /* Declaration specifier kinds. */
 enum {
@@ -41,6 +42,8 @@ enum {
 /* Declarator types. */
 enum {
        CDECL_DECL_IDENT,
+       CDECL_DECL_POINTER,
+       CDECL_DECL_ARRAY,
 };
 
 struct cdecl {
@@ -53,7 +56,18 @@ struct cdecl {
        struct cdecl_declarator {
                struct cdecl_declarator *next;
                unsigned type;
-               char *ident;
+               union {
+                       char *ident;
+                       struct cdecl_pointer {
+                               struct cdecl_declspec   *qualifiers;
+                               struct cdecl_declarator *declarator;
+                       } pointer;
+                       struct cdecl_array {
+                               char *vla;
+                               uintmax_t length;
+                               struct cdecl_declarator *declarator;
+                       } array;
+               } u;
        } *declarators;
 };