lib: rename include dir to babeltrace2
[babeltrace.git] / plugins / ctf / common / metadata / parser.y
index 02203aeb422aa9a9e236a4a0d679b79e1d287896..4e666dbb98e7885ebc0a6f3e21d91e3adefe0f39 100644 (file)
@@ -25,6 +25,9 @@
  * SOFTWARE.
  */
 
+#define BT_LOG_TAG "PLUGIN-CTF-METADATA-PARSER"
+#include "logging.h"
+
 #include <stdio.h>
 #include <ctype.h>
 #include <unistd.h>
 #include <glib.h>
 #include <errno.h>
 #include <inttypes.h>
-#include <babeltrace/list-internal.h>
-#include <babeltrace/babeltrace-internal.h>
+#include <babeltrace2/list-internal.h>
+#include <babeltrace2/assert-internal.h>
 #include "scanner.h"
 #include "parser.h"
 #include "ast.h"
 #include "objstack.h"
 
-BT_HIDDEN
-int yydebug;
+#if BT_LOG_ENABLED_VERBOSE
+# define YYDEBUG 1
+# define YYFPRINTF(_stream, _fmt, args...) BT_LOGV(_fmt, ## args)
+#else
+# define YYDEBUG 0
+#endif
 
 /* Join two lists, put "add" at the end of "head".  */
 static inline void
@@ -157,7 +164,7 @@ int parse_base_sequence(const char *src, size_t len, size_t pos,
                        return -1;
                }
        }
-       assert(nr_char > 0);
+       BT_ASSERT(nr_char > 0);
        buffer[nr_char] = '\0';
        *buf_len = nr_char;
        return 0;
@@ -284,8 +291,9 @@ int import_string(struct ctf_scanner *scanner, YYSTYPE *lvalp,
        lvalp->s = objstack_alloc(scanner->objstack, len);
        if (src[0] == 'L') {
                // TODO: import wide string
-               printfl_error(yyget_lineno(scanner),
-                       "Wide string not supported yet.");
+               _BT_LOGE_LINENO(yyget_lineno(scanner),
+                       "wide characters are not supported as of this version: "
+                       "scanner-addr=%p", scanner);
                return -1;
        } else {
                return import_basic_string(scanner, lvalp, len, src, delim);
@@ -296,20 +304,20 @@ static void init_scope(struct ctf_scanner_scope *scope,
                       struct ctf_scanner_scope *parent)
 {
        scope->parent = parent;
-       scope->types = g_hash_table_new_full(g_str_hash, g_str_equal,
+       scope->classes = g_hash_table_new_full(g_str_hash, g_str_equal,
                                             NULL, NULL);
 }
 
 static void finalize_scope(struct ctf_scanner_scope *scope)
 {
-       g_hash_table_destroy(scope->types);
+       g_hash_table_destroy(scope->classes);
 }
 
 static void push_scope(struct ctf_scanner *scanner)
 {
        struct ctf_scanner_scope *ns;
 
-       printf_debug("push scope\n");
+       BT_LOGV("Pushing scope: scanner-addr=%p", scanner);
        ns = malloc(sizeof(struct ctf_scanner_scope));
        init_scope(ns, scanner->cs);
        scanner->cs = ns;
@@ -319,7 +327,7 @@ static void pop_scope(struct ctf_scanner *scanner)
 {
        struct ctf_scanner_scope *os;
 
-       printf_debug("pop scope\n");
+       BT_LOGV("Popping scope: scanner-addr=%p", scanner);
        os = scanner->cs;
        scanner->cs = os->parent;
        finalize_scope(os);
@@ -330,8 +338,9 @@ static int lookup_type(struct ctf_scanner_scope *s, const char *id)
 {
        int ret;
 
-       ret = GPOINTER_TO_INT(g_hash_table_lookup(s->types, id));
-       printf_debug("lookup %p %s %d\n", s, id, ret);
+       ret = GPOINTER_TO_INT(g_hash_table_lookup(s->classes, id));
+       BT_LOGV("Looked up type: scanner-addr=%p, id=\"%s\", ret=%d",
+               s, id, ret);
        return ret;
 }
 
@@ -347,16 +356,18 @@ int is_type(struct ctf_scanner *scanner, const char *id)
                        break;
                }
        }
-       printf_debug("is type %s %d\n", id, ret);
+       BT_LOGV("Found if ID is type: scanner-addr=%p, id=\"%s\", ret=%d",
+               scanner, id, ret);
        return ret;
 }
 
 static void add_type(struct ctf_scanner *scanner, char *id)
 {
-       printf_debug("add type %s\n", id);
+       BT_LOGV("Adding type: scanner-addr=%p, id=\"%s\"",
+               scanner, id);
        if (lookup_type(scanner->cs, id))
                return;
-       g_hash_table_insert(scanner->cs->types, id, id);
+       g_hash_table_insert(scanner->cs->classes, id, id);
 }
 
 static struct ctf_node *make_node(struct ctf_scanner *scanner,
@@ -366,7 +377,9 @@ static struct ctf_node *make_node(struct ctf_scanner *scanner,
 
        node = objstack_alloc(scanner->objstack, sizeof(*node));
        if (!node) {
-               printfl_fatal(yyget_lineno(scanner->scanner), "out of memory");
+               _BT_LOGE_LINENO(yyget_lineno(scanner->scanner),
+                       "failed to allocate one stack entry: "
+                       "scanner-addr=%p", scanner);
                return &error_node;
        }
        node->type = type;
@@ -377,9 +390,9 @@ static struct ctf_node *make_node(struct ctf_scanner *scanner,
        switch (type) {
        case NODE_ROOT:
                node->type = NODE_ERROR;
-               printfn_fatal(node, "trying to create root node");
+               BT_LOGE("Trying to create root node: scanner-addr=%p",
+                       scanner);
                break;
-
        case NODE_EVENT:
                BT_INIT_LIST_HEAD(&node->u.event.declaration_list);
                break;
@@ -398,37 +411,33 @@ static struct ctf_node *make_node(struct ctf_scanner *scanner,
        case NODE_CALLSITE:
                BT_INIT_LIST_HEAD(&node->u.callsite.declaration_list);
                break;
-
        case NODE_CTF_EXPRESSION:
                BT_INIT_LIST_HEAD(&node->u.ctf_expression.left);
                BT_INIT_LIST_HEAD(&node->u.ctf_expression.right);
                break;
        case NODE_UNARY_EXPRESSION:
                break;
-
        case NODE_TYPEDEF:
-               BT_INIT_LIST_HEAD(&node->u._typedef.type_declarators);
+               BT_INIT_LIST_HEAD(&node->u.field_class_def.field_class_declarators);
                break;
        case NODE_TYPEALIAS_TARGET:
-               BT_INIT_LIST_HEAD(&node->u.typealias_target.type_declarators);
+               BT_INIT_LIST_HEAD(&node->u.field_class_alias_target.field_class_declarators);
                break;
        case NODE_TYPEALIAS_ALIAS:
-               BT_INIT_LIST_HEAD(&node->u.typealias_alias.type_declarators);
+               BT_INIT_LIST_HEAD(&node->u.field_class_alias_name.field_class_declarators);
                break;
        case NODE_TYPEALIAS:
                break;
-
        case NODE_TYPE_SPECIFIER:
                break;
        case NODE_TYPE_SPECIFIER_LIST:
-               BT_INIT_LIST_HEAD(&node->u.type_specifier_list.head);
+               BT_INIT_LIST_HEAD(&node->u.field_class_specifier_list.head);
                break;
        case NODE_POINTER:
                break;
        case NODE_TYPE_DECLARATOR:
-               BT_INIT_LIST_HEAD(&node->u.type_declarator.pointers);
+               BT_INIT_LIST_HEAD(&node->u.field_class_declarator.pointers);
                break;
-
        case NODE_FLOATING_POINT:
                BT_INIT_LIST_HEAD(&node->u.floating_point.expressions);
                break;
@@ -445,7 +454,7 @@ static struct ctf_node *make_node(struct ctf_scanner *scanner,
                BT_INIT_LIST_HEAD(&node->u._enum.enumerator_list);
                break;
        case NODE_STRUCT_OR_VARIANT_DECLARATION:
-               BT_INIT_LIST_HEAD(&node->u.struct_or_variant_declaration.type_declarators);
+               BT_INIT_LIST_HEAD(&node->u.struct_or_variant_declaration.field_class_declarators);
                break;
        case NODE_VARIANT:
                BT_INIT_LIST_HEAD(&node->u.variant.declaration_list);
@@ -454,11 +463,11 @@ static struct ctf_node *make_node(struct ctf_scanner *scanner,
                BT_INIT_LIST_HEAD(&node->u._struct.declaration_list);
                BT_INIT_LIST_HEAD(&node->u._struct.min_align);
                break;
-
        case NODE_UNKNOWN:
        default:
                node->type = NODE_ERROR;
-               printfn_fatal(node, "unknown node type '%d'", (int) type);
+               BT_LOGE("Unknown node type: scanner-addr=%p, node-type=%d",
+                       scanner, type);
                break;
        }
 
@@ -517,7 +526,7 @@ static int reparent_ctf_expression(struct ctf_node *node,
 
        case NODE_UNKNOWN:
        default:
-               printfn_fatal(node, "unknown node type '%d'", (int) parent->type);
+               BT_LOGE("Unknown node type: node-type=%d", parent->type);
                return -EINVAL;
        }
        return 0;
@@ -574,13 +583,13 @@ static int reparent_typedef(struct ctf_node *node, struct ctf_node *parent)
 
        case NODE_UNKNOWN:
        default:
-               printfn_fatal(node, "unknown node type %d", parent->type);
+               BT_LOGE("Unknown node type: node-type=%d", parent->type);
                return -EINVAL;
        }
        return 0;
 }
 
-static int reparent_typealias(struct ctf_node *node, struct ctf_node *parent)
+static int reparent_field_class_alias(struct ctf_node *node, struct ctf_node *parent)
 {
        switch (parent->type) {
        case NODE_ROOT:
@@ -631,18 +640,18 @@ static int reparent_typealias(struct ctf_node *node, struct ctf_node *parent)
 
        case NODE_UNKNOWN:
        default:
-               printfn_fatal(node, "unknown node type '%d'", (int) parent->type);
+               BT_LOGE("Unknown node type: node-type=%d", parent->type);
                return -EINVAL;
        }
        return 0;
 }
 
-static int reparent_type_specifier(struct ctf_node *node,
+static int reparent_field_class_specifier(struct ctf_node *node,
                                   struct ctf_node *parent)
 {
        switch (parent->type) {
        case NODE_TYPE_SPECIFIER_LIST:
-               _bt_list_splice_tail(&node->tmp_head, &parent->u.type_specifier_list.head);
+               _bt_list_splice_tail(&node->tmp_head, &parent->u.field_class_specifier_list.head);
                break;
 
        case NODE_TYPE_SPECIFIER:
@@ -672,13 +681,13 @@ static int reparent_type_specifier(struct ctf_node *node,
 
        case NODE_UNKNOWN:
        default:
-               printfn_fatal(node, "unknown node type '%d'", (int) parent->type);
+               BT_LOGE("Unknown node type: node-type=%d", parent->type);
                return -EINVAL;
        }
        return 0;
 }
 
-static int reparent_type_specifier_list(struct ctf_node *node,
+static int reparent_field_class_specifier_list(struct ctf_node *node,
                                        struct ctf_node *parent)
 {
        switch (parent->type) {
@@ -710,19 +719,19 @@ static int reparent_type_specifier_list(struct ctf_node *node,
                bt_list_add_tail(&node->siblings, &parent->u._struct.declaration_list);
                break;
        case NODE_TYPEDEF:
-               parent->u._typedef.type_specifier_list = node;
+               parent->u.field_class_def.field_class_specifier_list = node;
                break;
        case NODE_TYPEALIAS_TARGET:
-               parent->u.typealias_target.type_specifier_list = node;
+               parent->u.field_class_alias_target.field_class_specifier_list = node;
                break;
        case NODE_TYPEALIAS_ALIAS:
-               parent->u.typealias_alias.type_specifier_list = node;
+               parent->u.field_class_alias_name.field_class_specifier_list = node;
                break;
        case NODE_ENUM:
-               parent->u._enum.container_type = node;
+               parent->u._enum.container_field_class = node;
                break;
        case NODE_STRUCT_OR_VARIANT_DECLARATION:
-               parent->u.struct_or_variant_declaration.type_specifier_list = node;
+               parent->u.struct_or_variant_declaration.field_class_specifier_list = node;
                break;
        case NODE_TYPE_DECLARATOR:
        case NODE_TYPE_SPECIFIER:
@@ -738,31 +747,31 @@ static int reparent_type_specifier_list(struct ctf_node *node,
 
        case NODE_UNKNOWN:
        default:
-               printfn_fatal(node, "unknown node type '%d'", (int) parent->type);
+               BT_LOGE("Unknown node type: node-type=%d", parent->type);
                return -EINVAL;
        }
        return 0;
 }
 
-static int reparent_type_declarator(struct ctf_node *node,
+static int reparent_field_class_declarator(struct ctf_node *node,
                                    struct ctf_node *parent)
 {
        switch (parent->type) {
        case NODE_TYPE_DECLARATOR:
-               parent->u.type_declarator.type = TYPEDEC_NESTED;
-               parent->u.type_declarator.u.nested.type_declarator = node;
+               parent->u.field_class_declarator.type = TYPEDEC_NESTED;
+               parent->u.field_class_declarator.u.nested.field_class_declarator = node;
                break;
        case NODE_STRUCT_OR_VARIANT_DECLARATION:
-               _bt_list_splice_tail(&node->tmp_head, &parent->u.struct_or_variant_declaration.type_declarators);
+               _bt_list_splice_tail(&node->tmp_head, &parent->u.struct_or_variant_declaration.field_class_declarators);
                break;
        case NODE_TYPEDEF:
-               _bt_list_splice_tail(&node->tmp_head, &parent->u._typedef.type_declarators);
+               _bt_list_splice_tail(&node->tmp_head, &parent->u.field_class_def.field_class_declarators);
                break;
        case NODE_TYPEALIAS_TARGET:
-               _bt_list_splice_tail(&node->tmp_head, &parent->u.typealias_target.type_declarators);
+               _bt_list_splice_tail(&node->tmp_head, &parent->u.field_class_alias_target.field_class_declarators);
                break;
        case NODE_TYPEALIAS_ALIAS:
-               _bt_list_splice_tail(&node->tmp_head, &parent->u.typealias_alias.type_declarators);
+               _bt_list_splice_tail(&node->tmp_head, &parent->u.field_class_alias_name.field_class_declarators);
                break;
 
        case NODE_ROOT:
@@ -789,7 +798,7 @@ static int reparent_type_declarator(struct ctf_node *node,
 
        case NODE_UNKNOWN:
        default:
-               printfn_fatal(node, "unknown node type '%d'", (int) parent->type);
+               BT_LOGE("Unknown node type: node-type=%d", parent->type);
                return -EINVAL;
        }
        return 0;
@@ -812,7 +821,7 @@ static int set_parent_node(struct ctf_node *node,
 
        switch (node->type) {
        case NODE_ROOT:
-               printfn_fatal(node, "trying to reparent root node");
+               BT_LOGE_STR("Trying to reparent root node.");
                return -EINVAL;
 
        case NODE_EVENT:
@@ -862,7 +871,7 @@ static int set_parent_node(struct ctf_node *node,
                return reparent_ctf_expression(node, parent);
        case NODE_UNARY_EXPRESSION:
                if (parent->type == NODE_TYPE_DECLARATOR)
-                       parent->u.type_declarator.bitfield_len = node;
+                       parent->u.field_class_declarator.bitfield_len = node;
                else
                        return -EPERM;
                break;
@@ -871,31 +880,33 @@ static int set_parent_node(struct ctf_node *node,
                return reparent_typedef(node, parent);
        case NODE_TYPEALIAS_TARGET:
                if (parent->type == NODE_TYPEALIAS)
-                       parent->u.typealias.target = node;
+                       parent->u.field_class_alias.target = node;
                else
                        return -EINVAL;
+               /* fall-through */
        case NODE_TYPEALIAS_ALIAS:
                if (parent->type == NODE_TYPEALIAS)
-                       parent->u.typealias.alias = node;
+                       parent->u.field_class_alias.alias = node;
                else
                        return -EINVAL;
+               /* fall-through */
        case NODE_TYPEALIAS:
-               return reparent_typealias(node, parent);
+               return reparent_field_class_alias(node, parent);
 
        case NODE_POINTER:
                if (parent->type == NODE_TYPE_DECLARATOR) {
-                       _bt_list_splice_tail(&node->tmp_head, &parent->u.type_declarator.pointers);
+                       _bt_list_splice_tail(&node->tmp_head, &parent->u.field_class_declarator.pointers);
                } else
                        return -EPERM;
                break;
        case NODE_TYPE_DECLARATOR:
-               return reparent_type_declarator(node, parent);
+               return reparent_field_class_declarator(node, parent);
 
        case NODE_TYPE_SPECIFIER_LIST:
-               return reparent_type_specifier_list(node, parent);
+               return reparent_field_class_specifier_list(node, parent);
 
        case NODE_TYPE_SPECIFIER:
-               return reparent_type_specifier(node, parent);
+               return reparent_field_class_specifier(node, parent);
 
        case NODE_FLOATING_POINT:
        case NODE_INTEGER:
@@ -927,7 +938,7 @@ static int set_parent_node(struct ctf_node *node,
 
        case NODE_UNKNOWN:
        default:
-               printfn_fatal(node, "unknown node type '%d'", (int) parent->type);
+               BT_LOGE("Unknown node type: node-type=%d", parent->type);
                return -EINVAL;
        }
        return 0;
@@ -936,9 +947,8 @@ static int set_parent_node(struct ctf_node *node,
 BT_HIDDEN
 void yyerror(struct ctf_scanner *scanner, yyscan_t yyscanner, const char *str)
 {
-       printfl_error(yyget_lineno(scanner->scanner),
-               "token \"%s\": %s\n",
-               yyget_text(scanner->scanner), str);
+       _BT_LOGE_LINENO(yyget_lineno(scanner->scanner),
+               "%s: token=\"%s\"", str, yyget_text(scanner->scanner));
 }
 
 BT_HIDDEN
@@ -976,10 +986,6 @@ int ctf_scanner_append_ast(struct ctf_scanner *scanner, FILE *input)
 {
        /* Start processing new stream */
        yyrestart(input, scanner->scanner);
-       if (yydebug)
-               fprintf(stdout, "Scanner input is a%s.\n",
-                       isatty(fileno(input)) ? "n interactive tty" :
-                                               " noninteractive file");
        return yyparse(scanner, scanner->scanner);
 }
 
@@ -988,15 +994,13 @@ struct ctf_scanner *ctf_scanner_alloc(void)
        struct ctf_scanner *scanner;
        int ret;
 
-       yydebug = babeltrace_debug;
-
        scanner = malloc(sizeof(*scanner));
        if (!scanner)
                return NULL;
        memset(scanner, 0, sizeof(*scanner));
        ret = yylex_init_extra(scanner, &scanner->scanner);
        if (ret) {
-               printf_fatal("yylex_init error");
+               BT_LOGE("yylex_init_extra() failed: ret=%d", ret);
                goto cleanup_scanner;
        }
        scanner->objstack = objstack_create();
@@ -1015,7 +1019,8 @@ cleanup_objstack:
 cleanup_lexer:
        ret = yylex_destroy(scanner->scanner);
        if (!ret)
-               printf_fatal("yylex_destroy error");
+               BT_LOGE("yylex_destroy() failed: scanner-addr=%p, ret=%d",
+                       scanner, ret);
 cleanup_scanner:
        free(scanner);
        return NULL;
@@ -1031,7 +1036,8 @@ void ctf_scanner_free(struct ctf_scanner *scanner)
        objstack_destroy(scanner->objstack);
        ret = yylex_destroy(scanner->scanner);
        if (ret)
-               printf_error("yylex_destroy error");
+               BT_LOGE("yylex_destroy() failed: scanner-addr=%p, ret=%d",
+                       scanner, ret);
        free(scanner);
 }
 
@@ -1083,12 +1089,12 @@ void ctf_scanner_free(struct ctf_scanner *scanner)
 %type <n> declaration_specifiers
 %type <n> alias_declaration_specifiers
 
-%type <n> type_declarator_list
-%type <n> integer_type_specifier
-%type <n> type_specifier
-%type <n> struct_type_specifier
-%type <n> variant_type_specifier
-%type <n> enum_type_specifier
+%type <n> field_class_declarator_list
+%type <n> integer_field_class_specifier
+%type <n> field_class_specifier
+%type <n> struct_class_specifier
+%type <n> variant_field_class_specifier
+%type <n> enum_field_class_specifier
 %type <n> struct_or_variant_declaration_list
 %type <n> struct_or_variant_declaration
 %type <n> struct_or_variant_declarator_list
@@ -1103,8 +1109,8 @@ void ctf_scanner_free(struct ctf_scanner *scanner)
 %type <n> direct_alias_abstract_declarator
 %type <n> declarator
 %type <n> direct_declarator
-%type <n> type_declarator
-%type <n> direct_type_declarator
+%type <n> field_class_declarator
+%type <n> direct_field_class_declarator
 %type <n> pointer
 %type <n> ctf_assignment_expression_list
 %type <n> ctf_assignment_expression
@@ -1335,54 +1341,54 @@ declaration:
                {       $$ = $1;        }
        |       callsite_declaration
                {       $$ = $1;        }
-       |       declaration_specifiers CTF_TYPEDEF declaration_specifiers type_declarator_list CTF_SEMICOLON
+       |       declaration_specifiers CTF_TYPEDEF declaration_specifiers field_class_declarator_list CTF_SEMICOLON
                {
                        struct ctf_node *list;
 
                        $$ = make_node(scanner, NODE_TYPEDEF);
                        list = make_node(scanner, NODE_TYPE_SPECIFIER_LIST);
-                       $$->u._typedef.type_specifier_list = list;
-                       _bt_list_splice_tail(&($1)->u.type_specifier_list.head, &list->u.type_specifier_list.head);
-                       _bt_list_splice_tail(&($3)->u.type_specifier_list.head, &list->u.type_specifier_list.head);
-                       _bt_list_splice_tail(&($4)->tmp_head, &($$)->u._typedef.type_declarators);
+                       $$->u.field_class_def.field_class_specifier_list = list;
+                       _bt_list_splice_tail(&($1)->u.field_class_specifier_list.head, &list->u.field_class_specifier_list.head);
+                       _bt_list_splice_tail(&($3)->u.field_class_specifier_list.head, &list->u.field_class_specifier_list.head);
+                       _bt_list_splice_tail(&($4)->tmp_head, &($$)->u.field_class_def.field_class_declarators);
                }
-       |       CTF_TYPEDEF declaration_specifiers type_declarator_list CTF_SEMICOLON
+       |       CTF_TYPEDEF declaration_specifiers field_class_declarator_list CTF_SEMICOLON
                {
                        struct ctf_node *list;
 
                        $$ = make_node(scanner, NODE_TYPEDEF);
                        list = make_node(scanner, NODE_TYPE_SPECIFIER_LIST);
-                       $$->u._typedef.type_specifier_list = list;
-                       _bt_list_splice_tail(&($2)->u.type_specifier_list.head, &list->u.type_specifier_list.head);
-                       _bt_list_splice_tail(&($3)->tmp_head, &($$)->u._typedef.type_declarators);
+                       $$->u.field_class_def.field_class_specifier_list = list;
+                       _bt_list_splice_tail(&($2)->u.field_class_specifier_list.head, &list->u.field_class_specifier_list.head);
+                       _bt_list_splice_tail(&($3)->tmp_head, &($$)->u.field_class_def.field_class_declarators);
                }
-       |       declaration_specifiers CTF_TYPEDEF type_declarator_list CTF_SEMICOLON
+       |       declaration_specifiers CTF_TYPEDEF field_class_declarator_list CTF_SEMICOLON
                {
                        struct ctf_node *list;
 
                        $$ = make_node(scanner, NODE_TYPEDEF);
                        list = make_node(scanner, NODE_TYPE_SPECIFIER_LIST);
-                       $$->u._typedef.type_specifier_list = list;
-                       _bt_list_splice_tail(&($1)->u.type_specifier_list.head, &list->u.type_specifier_list.head);
-                       _bt_list_splice_tail(&($3)->tmp_head, &($$)->u._typedef.type_declarators);
+                       $$->u.field_class_def.field_class_specifier_list = list;
+                       _bt_list_splice_tail(&($1)->u.field_class_specifier_list.head, &list->u.field_class_specifier_list.head);
+                       _bt_list_splice_tail(&($3)->tmp_head, &($$)->u.field_class_def.field_class_declarators);
                }
        |       CTF_TYPEALIAS declaration_specifiers abstract_declarator_list CTF_TYPEASSIGN alias_declaration_specifiers alias_abstract_declarator_list CTF_SEMICOLON
                {
                        struct ctf_node *list;
 
                        $$ = make_node(scanner, NODE_TYPEALIAS);
-                       $$->u.typealias.target = make_node(scanner, NODE_TYPEALIAS_TARGET);
-                       $$->u.typealias.alias = make_node(scanner, NODE_TYPEALIAS_ALIAS);
+                       $$->u.field_class_alias.target = make_node(scanner, NODE_TYPEALIAS_TARGET);
+                       $$->u.field_class_alias.alias = make_node(scanner, NODE_TYPEALIAS_ALIAS);
 
                        list = make_node(scanner, NODE_TYPE_SPECIFIER_LIST);
-                       $$->u.typealias.target->u.typealias_target.type_specifier_list = list;
-                       _bt_list_splice_tail(&($2)->u.type_specifier_list.head, &list->u.type_specifier_list.head);
-                       _bt_list_splice_tail(&($3)->tmp_head, &($$)->u.typealias.target->u.typealias_target.type_declarators);
+                       $$->u.field_class_alias.target->u.field_class_alias_target.field_class_specifier_list = list;
+                       _bt_list_splice_tail(&($2)->u.field_class_specifier_list.head, &list->u.field_class_specifier_list.head);
+                       _bt_list_splice_tail(&($3)->tmp_head, &($$)->u.field_class_alias.target->u.field_class_alias_target.field_class_declarators);
 
                        list = make_node(scanner, NODE_TYPE_SPECIFIER_LIST);
-                       $$->u.typealias.alias->u.typealias_alias.type_specifier_list = list;
-                       _bt_list_splice_tail(&($5)->u.type_specifier_list.head, &list->u.type_specifier_list.head);
-                       _bt_list_splice_tail(&($6)->tmp_head, &($$)->u.typealias.alias->u.typealias_alias.type_declarators);
+                       $$->u.field_class_alias.alias->u.field_class_alias_name.field_class_specifier_list = list;
+                       _bt_list_splice_tail(&($5)->u.field_class_specifier_list.head, &list->u.field_class_specifier_list.head);
+                       _bt_list_splice_tail(&($6)->tmp_head, &($$)->u.field_class_alias.alias->u.field_class_alias_name.field_class_declarators);
                }
        ;
 
@@ -1532,16 +1538,16 @@ integer_declaration_specifiers:
 
                        $$ = make_node(scanner, NODE_TYPE_SPECIFIER_LIST);
                        node = make_node(scanner, NODE_TYPE_SPECIFIER);
-                       node->u.type_specifier.type = TYPESPEC_CONST;
-                       bt_list_add_tail(&node->siblings, &($$)->u.type_specifier_list.head);
+                       node->u.field_class_specifier.type = TYPESPEC_CONST;
+                       bt_list_add_tail(&node->siblings, &($$)->u.field_class_specifier_list.head);
                }
-       |       integer_type_specifier
+       |       integer_field_class_specifier
                {
                        struct ctf_node *node;
 
                        $$ = make_node(scanner, NODE_TYPE_SPECIFIER_LIST);
                        node = $1;
-                       bt_list_add_tail(&node->siblings, &($$)->u.type_specifier_list.head);
+                       bt_list_add_tail(&node->siblings, &($$)->u.field_class_specifier_list.head);
                }
        |       integer_declaration_specifiers CTF_CONST
                {
@@ -1549,13 +1555,13 @@ integer_declaration_specifiers:
 
                        $$ = $1;
                        node = make_node(scanner, NODE_TYPE_SPECIFIER);
-                       node->u.type_specifier.type = TYPESPEC_CONST;
-                       bt_list_add_tail(&node->siblings, &($$)->u.type_specifier_list.head);
+                       node->u.field_class_specifier.type = TYPESPEC_CONST;
+                       bt_list_add_tail(&node->siblings, &($$)->u.field_class_specifier_list.head);
                }
-       |       integer_declaration_specifiers integer_type_specifier
+       |       integer_declaration_specifiers integer_field_class_specifier
                {
                        $$ = $1;
-                       bt_list_add_tail(&($2)->siblings, &($$)->u.type_specifier_list.head);
+                       bt_list_add_tail(&($2)->siblings, &($$)->u.field_class_specifier_list.head);
                }
        ;
 
@@ -1566,16 +1572,16 @@ declaration_specifiers:
 
                        $$ = make_node(scanner, NODE_TYPE_SPECIFIER_LIST);
                        node = make_node(scanner, NODE_TYPE_SPECIFIER);
-                       node->u.type_specifier.type = TYPESPEC_CONST;
-                       bt_list_add_tail(&node->siblings, &($$)->u.type_specifier_list.head);
+                       node->u.field_class_specifier.type = TYPESPEC_CONST;
+                       bt_list_add_tail(&node->siblings, &($$)->u.field_class_specifier_list.head);
                }
-       |       type_specifier
+       |       field_class_specifier
                {
                        struct ctf_node *node;
 
                        $$ = make_node(scanner, NODE_TYPE_SPECIFIER_LIST);
                        node = $1;
-                       bt_list_add_tail(&node->siblings, &($$)->u.type_specifier_list.head);
+                       bt_list_add_tail(&node->siblings, &($$)->u.field_class_specifier_list.head);
                }
        |       declaration_specifiers CTF_CONST
                {
@@ -1583,220 +1589,220 @@ declaration_specifiers:
 
                        $$ = $1;
                        node = make_node(scanner, NODE_TYPE_SPECIFIER);
-                       node->u.type_specifier.type = TYPESPEC_CONST;
-                       bt_list_add_tail(&node->siblings, &($$)->u.type_specifier_list.head);
+                       node->u.field_class_specifier.type = TYPESPEC_CONST;
+                       bt_list_add_tail(&node->siblings, &($$)->u.field_class_specifier_list.head);
                }
-       |       declaration_specifiers type_specifier
+       |       declaration_specifiers field_class_specifier
                {
                        $$ = $1;
-                       bt_list_add_tail(&($2)->siblings, &($$)->u.type_specifier_list.head);
+                       bt_list_add_tail(&($2)->siblings, &($$)->u.field_class_specifier_list.head);
                }
        ;
 
-type_declarator_list:
-               type_declarator
+field_class_declarator_list:
+               field_class_declarator
                {       $$ = $1;        }
-       |       type_declarator_list CTF_COMMA type_declarator
+       |       field_class_declarator_list CTF_COMMA field_class_declarator
                {
                        $$ = $1;
                        bt_list_add_tail(&($3)->siblings, &($$)->tmp_head);
                }
        ;
 
-integer_type_specifier:
+integer_field_class_specifier:
                CTF_CHAR
                {
                        $$ = make_node(scanner, NODE_TYPE_SPECIFIER);
-                       $$->u.type_specifier.type = TYPESPEC_CHAR;
+                       $$->u.field_class_specifier.type = TYPESPEC_CHAR;
                }
        |       CTF_SHORT
                {
                        $$ = make_node(scanner, NODE_TYPE_SPECIFIER);
-                       $$->u.type_specifier.type = TYPESPEC_SHORT;
+                       $$->u.field_class_specifier.type = TYPESPEC_SHORT;
                }
        |       CTF_INT
                {
                        $$ = make_node(scanner, NODE_TYPE_SPECIFIER);
-                       $$->u.type_specifier.type = TYPESPEC_INT;
+                       $$->u.field_class_specifier.type = TYPESPEC_INT;
                }
        |       CTF_LONG
                {
                        $$ = make_node(scanner, NODE_TYPE_SPECIFIER);
-                       $$->u.type_specifier.type = TYPESPEC_LONG;
+                       $$->u.field_class_specifier.type = TYPESPEC_LONG;
                }
        |       CTF_SIGNED
                {
                        $$ = make_node(scanner, NODE_TYPE_SPECIFIER);
-                       $$->u.type_specifier.type = TYPESPEC_SIGNED;
+                       $$->u.field_class_specifier.type = TYPESPEC_SIGNED;
                }
        |       CTF_UNSIGNED
                {
                        $$ = make_node(scanner, NODE_TYPE_SPECIFIER);
-                       $$->u.type_specifier.type = TYPESPEC_UNSIGNED;
+                       $$->u.field_class_specifier.type = TYPESPEC_UNSIGNED;
                }
        |       CTF_BOOL
                {
                        $$ = make_node(scanner, NODE_TYPE_SPECIFIER);
-                       $$->u.type_specifier.type = TYPESPEC_BOOL;
+                       $$->u.field_class_specifier.type = TYPESPEC_BOOL;
                }
        |       ID_TYPE
                {
                        $$ = make_node(scanner, NODE_TYPE_SPECIFIER);
-                       $$->u.type_specifier.type = TYPESPEC_ID_TYPE;
-                       $$->u.type_specifier.id_type = yylval.s;
+                       $$->u.field_class_specifier.type = TYPESPEC_ID_TYPE;
+                       $$->u.field_class_specifier.id_type = yylval.s;
                }
        |       CTF_INTEGER CTF_LBRAC CTF_RBRAC
                {
                        $$ = make_node(scanner, NODE_TYPE_SPECIFIER);
-                       $$->u.type_specifier.type = TYPESPEC_INTEGER;
-                       $$->u.type_specifier.node = make_node(scanner, NODE_INTEGER);
+                       $$->u.field_class_specifier.type = TYPESPEC_INTEGER;
+                       $$->u.field_class_specifier.node = make_node(scanner, NODE_INTEGER);
                }
        |       CTF_INTEGER CTF_LBRAC ctf_assignment_expression_list CTF_RBRAC
                {
                        $$ = make_node(scanner, NODE_TYPE_SPECIFIER);
-                       $$->u.type_specifier.type = TYPESPEC_INTEGER;
-                       $$->u.type_specifier.node = make_node(scanner, NODE_INTEGER);
-                       if (set_parent_node($3, $$->u.type_specifier.node))
+                       $$->u.field_class_specifier.type = TYPESPEC_INTEGER;
+                       $$->u.field_class_specifier.node = make_node(scanner, NODE_INTEGER);
+                       if (set_parent_node($3, $$->u.field_class_specifier.node))
                                reparent_error(scanner, "integer reparent error");
                }
        ;
 
-type_specifier:
+field_class_specifier:
                CTF_VOID
                {
                        $$ = make_node(scanner, NODE_TYPE_SPECIFIER);
-                       $$->u.type_specifier.type = TYPESPEC_VOID;
+                       $$->u.field_class_specifier.type = TYPESPEC_VOID;
                }
        |       CTF_CHAR
                {
                        $$ = make_node(scanner, NODE_TYPE_SPECIFIER);
-                       $$->u.type_specifier.type = TYPESPEC_CHAR;
+                       $$->u.field_class_specifier.type = TYPESPEC_CHAR;
                }
        |       CTF_SHORT
                {
                        $$ = make_node(scanner, NODE_TYPE_SPECIFIER);
-                       $$->u.type_specifier.type = TYPESPEC_SHORT;
+                       $$->u.field_class_specifier.type = TYPESPEC_SHORT;
                }
        |       CTF_INT
                {
                        $$ = make_node(scanner, NODE_TYPE_SPECIFIER);
-                       $$->u.type_specifier.type = TYPESPEC_INT;
+                       $$->u.field_class_specifier.type = TYPESPEC_INT;
                }
        |       CTF_LONG
                {
                        $$ = make_node(scanner, NODE_TYPE_SPECIFIER);
-                       $$->u.type_specifier.type = TYPESPEC_LONG;
+                       $$->u.field_class_specifier.type = TYPESPEC_LONG;
                }
        |       CTF_FLOAT
                {
                        $$ = make_node(scanner, NODE_TYPE_SPECIFIER);
-                       $$->u.type_specifier.type = TYPESPEC_FLOAT;
+                       $$->u.field_class_specifier.type = TYPESPEC_FLOAT;
                }
        |       CTF_DOUBLE
                {
                        $$ = make_node(scanner, NODE_TYPE_SPECIFIER);
-                       $$->u.type_specifier.type = TYPESPEC_DOUBLE;
+                       $$->u.field_class_specifier.type = TYPESPEC_DOUBLE;
                }
        |       CTF_SIGNED
                {
                        $$ = make_node(scanner, NODE_TYPE_SPECIFIER);
-                       $$->u.type_specifier.type = TYPESPEC_SIGNED;
+                       $$->u.field_class_specifier.type = TYPESPEC_SIGNED;
                }
        |       CTF_UNSIGNED
                {
                        $$ = make_node(scanner, NODE_TYPE_SPECIFIER);
-                       $$->u.type_specifier.type = TYPESPEC_UNSIGNED;
+                       $$->u.field_class_specifier.type = TYPESPEC_UNSIGNED;
                }
        |       CTF_BOOL
                {
                        $$ = make_node(scanner, NODE_TYPE_SPECIFIER);
-                       $$->u.type_specifier.type = TYPESPEC_BOOL;
+                       $$->u.field_class_specifier.type = TYPESPEC_BOOL;
                }
        |       CTF_COMPLEX
                {
                        $$ = make_node(scanner, NODE_TYPE_SPECIFIER);
-                       $$->u.type_specifier.type = TYPESPEC_COMPLEX;
+                       $$->u.field_class_specifier.type = TYPESPEC_COMPLEX;
                }
        |       CTF_IMAGINARY
                {
                        $$ = make_node(scanner, NODE_TYPE_SPECIFIER);
-                       $$->u.type_specifier.type = TYPESPEC_IMAGINARY;
+                       $$->u.field_class_specifier.type = TYPESPEC_IMAGINARY;
                }
        |       ID_TYPE
                {
                        $$ = make_node(scanner, NODE_TYPE_SPECIFIER);
-                       $$->u.type_specifier.type = TYPESPEC_ID_TYPE;
-                       $$->u.type_specifier.id_type = yylval.s;
+                       $$->u.field_class_specifier.type = TYPESPEC_ID_TYPE;
+                       $$->u.field_class_specifier.id_type = yylval.s;
                }
        |       CTF_FLOATING_POINT CTF_LBRAC CTF_RBRAC
                {
                        $$ = make_node(scanner, NODE_TYPE_SPECIFIER);
-                       $$->u.type_specifier.type = TYPESPEC_FLOATING_POINT;
-                       $$->u.type_specifier.node = make_node(scanner, NODE_FLOATING_POINT);
+                       $$->u.field_class_specifier.type = TYPESPEC_FLOATING_POINT;
+                       $$->u.field_class_specifier.node = make_node(scanner, NODE_FLOATING_POINT);
                }
        |       CTF_FLOATING_POINT CTF_LBRAC ctf_assignment_expression_list CTF_RBRAC
                {
                        $$ = make_node(scanner, NODE_TYPE_SPECIFIER);
-                       $$->u.type_specifier.type = TYPESPEC_FLOATING_POINT;
-                       $$->u.type_specifier.node = make_node(scanner, NODE_FLOATING_POINT);
-                       if (set_parent_node($3, $$->u.type_specifier.node))
+                       $$->u.field_class_specifier.type = TYPESPEC_FLOATING_POINT;
+                       $$->u.field_class_specifier.node = make_node(scanner, NODE_FLOATING_POINT);
+                       if (set_parent_node($3, $$->u.field_class_specifier.node))
                                reparent_error(scanner, "floating point reparent error");
                }
        |       CTF_INTEGER CTF_LBRAC CTF_RBRAC
                {
                        $$ = make_node(scanner, NODE_TYPE_SPECIFIER);
-                       $$->u.type_specifier.type = TYPESPEC_INTEGER;
-                       $$->u.type_specifier.node = make_node(scanner, NODE_INTEGER);
+                       $$->u.field_class_specifier.type = TYPESPEC_INTEGER;
+                       $$->u.field_class_specifier.node = make_node(scanner, NODE_INTEGER);
                }
        |       CTF_INTEGER CTF_LBRAC ctf_assignment_expression_list CTF_RBRAC
                {
                        $$ = make_node(scanner, NODE_TYPE_SPECIFIER);
-                       $$->u.type_specifier.type = TYPESPEC_INTEGER;
-                       $$->u.type_specifier.node = make_node(scanner, NODE_INTEGER);
-                       if (set_parent_node($3, $$->u.type_specifier.node))
+                       $$->u.field_class_specifier.type = TYPESPEC_INTEGER;
+                       $$->u.field_class_specifier.node = make_node(scanner, NODE_INTEGER);
+                       if (set_parent_node($3, $$->u.field_class_specifier.node))
                                reparent_error(scanner, "integer reparent error");
                }
        |       CTF_STRING
                {
                        $$ = make_node(scanner, NODE_TYPE_SPECIFIER);
-                       $$->u.type_specifier.type = TYPESPEC_STRING;
-                       $$->u.type_specifier.node = make_node(scanner, NODE_STRING);
+                       $$->u.field_class_specifier.type = TYPESPEC_STRING;
+                       $$->u.field_class_specifier.node = make_node(scanner, NODE_STRING);
                }
        |       CTF_STRING CTF_LBRAC CTF_RBRAC
                {
                        $$ = make_node(scanner, NODE_TYPE_SPECIFIER);
-                       $$->u.type_specifier.type = TYPESPEC_STRING;
-                       $$->u.type_specifier.node = make_node(scanner, NODE_STRING);
+                       $$->u.field_class_specifier.type = TYPESPEC_STRING;
+                       $$->u.field_class_specifier.node = make_node(scanner, NODE_STRING);
                }
        |       CTF_STRING CTF_LBRAC ctf_assignment_expression_list CTF_RBRAC
                {
                        $$ = make_node(scanner, NODE_TYPE_SPECIFIER);
-                       $$->u.type_specifier.type = TYPESPEC_STRING;
-                       $$->u.type_specifier.node = make_node(scanner, NODE_STRING);
-                       if (set_parent_node($3, $$->u.type_specifier.node))
+                       $$->u.field_class_specifier.type = TYPESPEC_STRING;
+                       $$->u.field_class_specifier.node = make_node(scanner, NODE_STRING);
+                       if (set_parent_node($3, $$->u.field_class_specifier.node))
                                reparent_error(scanner, "string reparent error");
                }
-       |       CTF_ENUM enum_type_specifier
+       |       CTF_ENUM enum_field_class_specifier
                {
                        $$ = make_node(scanner, NODE_TYPE_SPECIFIER);
-                       $$->u.type_specifier.type = TYPESPEC_ENUM;
-                       $$->u.type_specifier.node = $2;
+                       $$->u.field_class_specifier.type = TYPESPEC_ENUM;
+                       $$->u.field_class_specifier.node = $2;
                }
-       |       CTF_VARIANT variant_type_specifier
+       |       CTF_VARIANT variant_field_class_specifier
                {
                        $$ = make_node(scanner, NODE_TYPE_SPECIFIER);
-                       $$->u.type_specifier.type = TYPESPEC_VARIANT;
-                       $$->u.type_specifier.node = $2;
+                       $$->u.field_class_specifier.type = TYPESPEC_VARIANT;
+                       $$->u.field_class_specifier.node = $2;
                }
-       |       CTF_STRUCT struct_type_specifier
+       |       CTF_STRUCT struct_class_specifier
                {
                        $$ = make_node(scanner, NODE_TYPE_SPECIFIER);
-                       $$->u.type_specifier.type = TYPESPEC_STRUCT;
-                       $$->u.type_specifier.node = $2;
+                       $$->u.field_class_specifier.type = TYPESPEC_STRUCT;
+                       $$->u.field_class_specifier.node = $2;
                }
        ;
 
-struct_type_specifier:
+struct_class_specifier:
                struct_declaration_begin struct_or_variant_declaration_list struct_declaration_end
                {
                        $$ = make_node(scanner, NODE_STRUCT);
@@ -1870,7 +1876,7 @@ struct_declaration_end:
                {       pop_scope(scanner);     }
        ;
 
-variant_type_specifier:
+variant_field_class_specifier:
                variant_declaration_begin struct_or_variant_declaration_list variant_declaration_end
                {
                        $$ = make_node(scanner, NODE_VARIANT);
@@ -1986,7 +1992,7 @@ variant_declaration_end:
                {       pop_scope(scanner);     }
        ;
 
-enum_type_specifier:
+enum_field_class_specifier:
                CTF_LBRAC enumerator_list CTF_RBRAC
                {
                        $$ = make_node(scanner, NODE_ENUM);
@@ -1997,7 +2003,7 @@ enum_type_specifier:
                {
                        $$ = make_node(scanner, NODE_ENUM);
                        $$->u._enum.has_body = 1;
-                       ($$)->u._enum.container_type = $2;
+                       ($$)->u._enum.container_field_class = $2;
                        _bt_list_splice_tail(&($4)->tmp_head, &($$)->u._enum.enumerator_list);
                }
        |       IDENTIFIER CTF_LBRAC enumerator_list CTF_RBRAC
@@ -2012,7 +2018,7 @@ enum_type_specifier:
                        $$ = make_node(scanner, NODE_ENUM);
                        $$->u._enum.has_body = 1;
                        $$->u._enum.enum_id = $1;
-                       ($$)->u._enum.container_type = $3;
+                       ($$)->u._enum.container_field_class = $3;
                        _bt_list_splice_tail(&($5)->tmp_head, &($$)->u._enum.enumerator_list);
                }
        |       ID_TYPE CTF_LBRAC enumerator_list CTF_RBRAC
@@ -2027,7 +2033,7 @@ enum_type_specifier:
                        $$ = make_node(scanner, NODE_ENUM);
                        $$->u._enum.has_body = 1;
                        $$->u._enum.enum_id = $1;
-                       ($$)->u._enum.container_type = $3;
+                       ($$)->u._enum.container_field_class = $3;
                        _bt_list_splice_tail(&($5)->tmp_head, &($$)->u._enum.enumerator_list);
                }
        |       CTF_LBRAC enumerator_list CTF_COMMA CTF_RBRAC
@@ -2040,7 +2046,7 @@ enum_type_specifier:
                {
                        $$ = make_node(scanner, NODE_ENUM);
                        $$->u._enum.has_body = 1;
-                       ($$)->u._enum.container_type = $2;
+                       ($$)->u._enum.container_field_class = $2;
                        _bt_list_splice_tail(&($4)->tmp_head, &($$)->u._enum.enumerator_list);
                }
        |       IDENTIFIER CTF_LBRAC enumerator_list CTF_COMMA CTF_RBRAC
@@ -2055,7 +2061,7 @@ enum_type_specifier:
                        $$ = make_node(scanner, NODE_ENUM);
                        $$->u._enum.has_body = 1;
                        $$->u._enum.enum_id = $1;
-                       ($$)->u._enum.container_type = $3;
+                       ($$)->u._enum.container_field_class = $3;
                        _bt_list_splice_tail(&($5)->tmp_head, &($$)->u._enum.enumerator_list);
                }
        |       IDENTIFIER
@@ -2076,7 +2082,7 @@ enum_type_specifier:
                        $$ = make_node(scanner, NODE_ENUM);
                        $$->u._enum.has_body = 1;
                        $$->u._enum.enum_id = $1;
-                       ($$)->u._enum.container_type = $3;
+                       ($$)->u._enum.container_field_class = $3;
                        _bt_list_splice_tail(&($5)->tmp_head, &($$)->u._enum.enumerator_list);
                }
        |       ID_TYPE
@@ -2108,59 +2114,59 @@ struct_or_variant_declaration:
                        struct ctf_node *list;
 
                        list = make_node(scanner, NODE_TYPE_SPECIFIER_LIST);
-                       _bt_list_splice_tail(&($1)->u.type_specifier_list.head, &list->u.type_specifier_list.head);
+                       _bt_list_splice_tail(&($1)->u.field_class_specifier_list.head, &list->u.field_class_specifier_list.head);
                        $$ = make_node(scanner, NODE_STRUCT_OR_VARIANT_DECLARATION);
-                       ($$)->u.struct_or_variant_declaration.type_specifier_list = list;
-                       _bt_list_splice_tail(&($2)->tmp_head, &($$)->u.struct_or_variant_declaration.type_declarators);
+                       ($$)->u.struct_or_variant_declaration.field_class_specifier_list = list;
+                       _bt_list_splice_tail(&($2)->tmp_head, &($$)->u.struct_or_variant_declaration.field_class_declarators);
                }
-       |       declaration_specifiers CTF_TYPEDEF declaration_specifiers type_declarator_list CTF_SEMICOLON
+       |       declaration_specifiers CTF_TYPEDEF declaration_specifiers field_class_declarator_list CTF_SEMICOLON
                {
                        struct ctf_node *list;
 
                        $$ = make_node(scanner, NODE_TYPEDEF);
                        list = make_node(scanner, NODE_TYPE_SPECIFIER_LIST);
-                       $$->u._typedef.type_specifier_list = list;
-                       _bt_list_splice_tail(&($1)->u.type_specifier_list.head, &list->u.type_specifier_list.head);
-                       _bt_list_splice_tail(&($3)->u.type_specifier_list.head, &list->u.type_specifier_list.head);
-                       _bt_list_splice_tail(&($4)->tmp_head, &($$)->u._typedef.type_declarators);
+                       $$->u.field_class_def.field_class_specifier_list = list;
+                       _bt_list_splice_tail(&($1)->u.field_class_specifier_list.head, &list->u.field_class_specifier_list.head);
+                       _bt_list_splice_tail(&($3)->u.field_class_specifier_list.head, &list->u.field_class_specifier_list.head);
+                       _bt_list_splice_tail(&($4)->tmp_head, &($$)->u.field_class_def.field_class_declarators);
                }
-       |       CTF_TYPEDEF declaration_specifiers type_declarator_list CTF_SEMICOLON
+       |       CTF_TYPEDEF declaration_specifiers field_class_declarator_list CTF_SEMICOLON
                {
                        struct ctf_node *list;
 
                        $$ = make_node(scanner, NODE_TYPEDEF);
                        list = make_node(scanner, NODE_TYPE_SPECIFIER_LIST);
-                       $$->u._typedef.type_specifier_list = list;
-                       _bt_list_splice_tail(&($2)->u.type_specifier_list.head, &list->u.type_specifier_list.head);
-                       _bt_list_splice_tail(&($3)->tmp_head, &($$)->u._typedef.type_declarators);
+                       $$->u.field_class_def.field_class_specifier_list = list;
+                       _bt_list_splice_tail(&($2)->u.field_class_specifier_list.head, &list->u.field_class_specifier_list.head);
+                       _bt_list_splice_tail(&($3)->tmp_head, &($$)->u.field_class_def.field_class_declarators);
                }
-       |       declaration_specifiers CTF_TYPEDEF type_declarator_list CTF_SEMICOLON
+       |       declaration_specifiers CTF_TYPEDEF field_class_declarator_list CTF_SEMICOLON
                {
                        struct ctf_node *list;
 
                        list = make_node(scanner, NODE_TYPE_SPECIFIER_LIST);
-                       _bt_list_splice_tail(&($1)->u.type_specifier_list.head, &list->u.type_specifier_list.head);
+                       _bt_list_splice_tail(&($1)->u.field_class_specifier_list.head, &list->u.field_class_specifier_list.head);
                        $$ = make_node(scanner, NODE_TYPEDEF);
-                       ($$)->u.struct_or_variant_declaration.type_specifier_list = list;
-                       _bt_list_splice_tail(&($3)->tmp_head, &($$)->u._typedef.type_declarators);
+                       ($$)->u.struct_or_variant_declaration.field_class_specifier_list = list;
+                       _bt_list_splice_tail(&($3)->tmp_head, &($$)->u.field_class_def.field_class_declarators);
                }
        |       CTF_TYPEALIAS declaration_specifiers abstract_declarator_list CTF_TYPEASSIGN alias_declaration_specifiers alias_abstract_declarator_list CTF_SEMICOLON
                {
                        struct ctf_node *list;
 
                        $$ = make_node(scanner, NODE_TYPEALIAS);
-                       $$->u.typealias.target = make_node(scanner, NODE_TYPEALIAS_TARGET);
-                       $$->u.typealias.alias = make_node(scanner, NODE_TYPEALIAS_ALIAS);
+                       $$->u.field_class_alias.target = make_node(scanner, NODE_TYPEALIAS_TARGET);
+                       $$->u.field_class_alias.alias = make_node(scanner, NODE_TYPEALIAS_ALIAS);
 
                        list = make_node(scanner, NODE_TYPE_SPECIFIER_LIST);
-                       $$->u.typealias.target->u.typealias_target.type_specifier_list = list;
-                       _bt_list_splice_tail(&($2)->u.type_specifier_list.head, &list->u.type_specifier_list.head);
-                       _bt_list_splice_tail(&($3)->tmp_head, &($$)->u.typealias.target->u.typealias_target.type_declarators);
+                       $$->u.field_class_alias.target->u.field_class_alias_target.field_class_specifier_list = list;
+                       _bt_list_splice_tail(&($2)->u.field_class_specifier_list.head, &list->u.field_class_specifier_list.head);
+                       _bt_list_splice_tail(&($3)->tmp_head, &($$)->u.field_class_alias.target->u.field_class_alias_target.field_class_declarators);
 
                        list = make_node(scanner, NODE_TYPE_SPECIFIER_LIST);
-                       $$->u.typealias.alias->u.typealias_alias.type_specifier_list = list;
-                       _bt_list_splice_tail(&($5)->u.type_specifier_list.head, &list->u.type_specifier_list.head);
-                       _bt_list_splice_tail(&($6)->tmp_head, &($$)->u.typealias.alias->u.typealias_alias.type_declarators);
+                       $$->u.field_class_alias.alias->u.field_class_alias_name.field_class_specifier_list = list;
+                       _bt_list_splice_tail(&($5)->u.field_class_specifier_list.head, &list->u.field_class_specifier_list.head);
+                       _bt_list_splice_tail(&($6)->tmp_head, &($$)->u.field_class_alias.alias->u.field_class_alias_name.field_class_declarators);
                }
        ;
 
@@ -2171,16 +2177,16 @@ alias_declaration_specifiers:
 
                        $$ = make_node(scanner, NODE_TYPE_SPECIFIER_LIST);
                        node = make_node(scanner, NODE_TYPE_SPECIFIER);
-                       node->u.type_specifier.type = TYPESPEC_CONST;
-                       bt_list_add_tail(&node->siblings, &($$)->u.type_specifier_list.head);
+                       node->u.field_class_specifier.type = TYPESPEC_CONST;
+                       bt_list_add_tail(&node->siblings, &($$)->u.field_class_specifier_list.head);
                }
-       |       type_specifier
+       |       field_class_specifier
                {
                        struct ctf_node *node;
 
                        $$ = make_node(scanner, NODE_TYPE_SPECIFIER_LIST);
                        node = $1;
-                       bt_list_add_tail(&node->siblings, &($$)->u.type_specifier_list.head);
+                       bt_list_add_tail(&node->siblings, &($$)->u.field_class_specifier_list.head);
                }
        |       IDENTIFIER
                {
@@ -2189,9 +2195,9 @@ alias_declaration_specifiers:
                        add_type(scanner, $1);
                        $$ = make_node(scanner, NODE_TYPE_SPECIFIER_LIST);
                        node = make_node(scanner, NODE_TYPE_SPECIFIER);
-                       node->u.type_specifier.type = TYPESPEC_ID_TYPE;
-                       node->u.type_specifier.id_type = yylval.s;
-                       bt_list_add_tail(&node->siblings, &($$)->u.type_specifier_list.head);
+                       node->u.field_class_specifier.type = TYPESPEC_ID_TYPE;
+                       node->u.field_class_specifier.id_type = yylval.s;
+                       bt_list_add_tail(&node->siblings, &($$)->u.field_class_specifier_list.head);
                }
        |       alias_declaration_specifiers CTF_CONST
                {
@@ -2199,13 +2205,13 @@ alias_declaration_specifiers:
 
                        $$ = $1;
                        node = make_node(scanner, NODE_TYPE_SPECIFIER);
-                       node->u.type_specifier.type = TYPESPEC_CONST;
-                       bt_list_add_tail(&node->siblings, &($$)->u.type_specifier_list.head);
+                       node->u.field_class_specifier.type = TYPESPEC_CONST;
+                       bt_list_add_tail(&node->siblings, &($$)->u.field_class_specifier_list.head);
                }
-       |       alias_declaration_specifiers type_specifier
+       |       alias_declaration_specifiers field_class_specifier
                {
                        $$ = $1;
-                       bt_list_add_tail(&($2)->siblings, &($$)->u.type_specifier_list.head);
+                       bt_list_add_tail(&($2)->siblings, &($$)->u.field_class_specifier_list.head);
                }
        |       alias_declaration_specifiers IDENTIFIER
                {
@@ -2214,9 +2220,9 @@ alias_declaration_specifiers:
                        add_type(scanner, $2);
                        $$ = $1;
                        node = make_node(scanner, NODE_TYPE_SPECIFIER);
-                       node->u.type_specifier.type = TYPESPEC_ID_TYPE;
-                       node->u.type_specifier.id_type = yylval.s;
-                       bt_list_add_tail(&node->siblings, &($$)->u.type_specifier_list.head);
+                       node->u.field_class_specifier.type = TYPESPEC_ID_TYPE;
+                       node->u.field_class_specifier.id_type = yylval.s;
+                       bt_list_add_tail(&node->siblings, &($$)->u.field_class_specifier_list.head);
                }
        ;
 
@@ -2316,7 +2322,7 @@ abstract_declarator:
        |       pointer direct_abstract_declarator
                {
                        $$ = $2;
-                       bt_list_splice(&($1)->tmp_head, &($$)->u.type_declarator.pointers);
+                       bt_list_splice(&($1)->tmp_head, &($$)->u.field_class_declarator.pointers);
                }
        ;
 
@@ -2324,35 +2330,35 @@ direct_abstract_declarator:
                /* empty */
                {
                        $$ = make_node(scanner, NODE_TYPE_DECLARATOR);
-                        $$->u.type_declarator.type = TYPEDEC_ID;
+                        $$->u.field_class_declarator.type = TYPEDEC_ID;
                        /* id is NULL */
                }
        |       IDENTIFIER
                {
                        $$ = make_node(scanner, NODE_TYPE_DECLARATOR);
-                       $$->u.type_declarator.type = TYPEDEC_ID;
-                       $$->u.type_declarator.u.id = $1;
+                       $$->u.field_class_declarator.type = TYPEDEC_ID;
+                       $$->u.field_class_declarator.u.id = $1;
                }
        |       CTF_LPAREN abstract_declarator CTF_RPAREN
                {
                        $$ = make_node(scanner, NODE_TYPE_DECLARATOR);
-                       $$->u.type_declarator.type = TYPEDEC_NESTED;
-                       $$->u.type_declarator.u.nested.type_declarator = $2;
+                       $$->u.field_class_declarator.type = TYPEDEC_NESTED;
+                       $$->u.field_class_declarator.u.nested.field_class_declarator = $2;
                }
        |       direct_abstract_declarator CTF_LSBRAC unary_expression CTF_RSBRAC
                {
                        $$ = make_node(scanner, NODE_TYPE_DECLARATOR);
-                       $$->u.type_declarator.type = TYPEDEC_NESTED;
-                       $$->u.type_declarator.u.nested.type_declarator = $1;
-                       BT_INIT_LIST_HEAD(&($$)->u.type_declarator.u.nested.length);
-                       _bt_list_splice_tail(&($3)->tmp_head, &($$)->u.type_declarator.u.nested.length);
+                       $$->u.field_class_declarator.type = TYPEDEC_NESTED;
+                       $$->u.field_class_declarator.u.nested.field_class_declarator = $1;
+                       BT_INIT_LIST_HEAD(&($$)->u.field_class_declarator.u.nested.length);
+                       _bt_list_splice_tail(&($3)->tmp_head, &($$)->u.field_class_declarator.u.nested.length);
                }
        |       direct_abstract_declarator CTF_LSBRAC CTF_RSBRAC
                {
                        $$ = make_node(scanner, NODE_TYPE_DECLARATOR);
-                       $$->u.type_declarator.type = TYPEDEC_NESTED;
-                       $$->u.type_declarator.u.nested.type_declarator = $1;
-                       $$->u.type_declarator.u.nested.abstract_array = 1;
+                       $$->u.field_class_declarator.type = TYPEDEC_NESTED;
+                       $$->u.field_class_declarator.u.nested.field_class_declarator = $1;
+                       $$->u.field_class_declarator.u.nested.abstract_array = 1;
                }
        ;
 
@@ -2372,7 +2378,7 @@ alias_abstract_declarator:
        |       pointer direct_alias_abstract_declarator
                {
                        $$ = $2;
-                       bt_list_splice(&($1)->tmp_head, &($$)->u.type_declarator.pointers);
+                       bt_list_splice(&($1)->tmp_head, &($$)->u.field_class_declarator.pointers);
                }
        ;
 
@@ -2380,29 +2386,29 @@ direct_alias_abstract_declarator:
                /* empty */
                {
                        $$ = make_node(scanner, NODE_TYPE_DECLARATOR);
-                        $$->u.type_declarator.type = TYPEDEC_ID;
+                        $$->u.field_class_declarator.type = TYPEDEC_ID;
                        /* id is NULL */
                }
        |       CTF_LPAREN alias_abstract_declarator CTF_RPAREN
                {
                        $$ = make_node(scanner, NODE_TYPE_DECLARATOR);
-                       $$->u.type_declarator.type = TYPEDEC_NESTED;
-                       $$->u.type_declarator.u.nested.type_declarator = $2;
+                       $$->u.field_class_declarator.type = TYPEDEC_NESTED;
+                       $$->u.field_class_declarator.u.nested.field_class_declarator = $2;
                }
        |       direct_alias_abstract_declarator CTF_LSBRAC unary_expression CTF_RSBRAC
                {
                        $$ = make_node(scanner, NODE_TYPE_DECLARATOR);
-                       $$->u.type_declarator.type = TYPEDEC_NESTED;
-                       $$->u.type_declarator.u.nested.type_declarator = $1;
-                       BT_INIT_LIST_HEAD(&($$)->u.type_declarator.u.nested.length);
-                       _bt_list_splice_tail(&($3)->tmp_head, &($$)->u.type_declarator.u.nested.length);
+                       $$->u.field_class_declarator.type = TYPEDEC_NESTED;
+                       $$->u.field_class_declarator.u.nested.field_class_declarator = $1;
+                       BT_INIT_LIST_HEAD(&($$)->u.field_class_declarator.u.nested.length);
+                       _bt_list_splice_tail(&($3)->tmp_head, &($$)->u.field_class_declarator.u.nested.length);
                }
        |       direct_alias_abstract_declarator CTF_LSBRAC CTF_RSBRAC
                {
                        $$ = make_node(scanner, NODE_TYPE_DECLARATOR);
-                       $$->u.type_declarator.type = TYPEDEC_NESTED;
-                       $$->u.type_declarator.u.nested.type_declarator = $1;
-                       $$->u.type_declarator.u.nested.abstract_array = 1;
+                       $$->u.field_class_declarator.type = TYPEDEC_NESTED;
+                       $$->u.field_class_declarator.u.nested.field_class_declarator = $1;
+                       $$->u.field_class_declarator.u.nested.abstract_array = 1;
                }
        ;
 
@@ -2412,7 +2418,7 @@ declarator:
        |       pointer direct_declarator
                {
                        $$ = $2;
-                       bt_list_splice(&($1)->tmp_head, &($$)->u.type_declarator.pointers);
+                       bt_list_splice(&($1)->tmp_head, &($$)->u.field_class_declarator.pointers);
                }
        ;
 
@@ -2420,56 +2426,56 @@ direct_declarator:
                IDENTIFIER
                {
                        $$ = make_node(scanner, NODE_TYPE_DECLARATOR);
-                       $$->u.type_declarator.type = TYPEDEC_ID;
-                       $$->u.type_declarator.u.id = $1;
+                       $$->u.field_class_declarator.type = TYPEDEC_ID;
+                       $$->u.field_class_declarator.u.id = $1;
                }
        |       CTF_LPAREN declarator CTF_RPAREN
                {
                        $$ = make_node(scanner, NODE_TYPE_DECLARATOR);
-                       $$->u.type_declarator.type = TYPEDEC_NESTED;
-                       $$->u.type_declarator.u.nested.type_declarator = $2;
+                       $$->u.field_class_declarator.type = TYPEDEC_NESTED;
+                       $$->u.field_class_declarator.u.nested.field_class_declarator = $2;
                }
        |       direct_declarator CTF_LSBRAC unary_expression CTF_RSBRAC
                {
                        $$ = make_node(scanner, NODE_TYPE_DECLARATOR);
-                       $$->u.type_declarator.type = TYPEDEC_NESTED;
-                       $$->u.type_declarator.u.nested.type_declarator = $1;
-                       BT_INIT_LIST_HEAD(&($$)->u.type_declarator.u.nested.length);
-                       _bt_list_splice_tail(&($3)->tmp_head, &($$)->u.type_declarator.u.nested.length);
+                       $$->u.field_class_declarator.type = TYPEDEC_NESTED;
+                       $$->u.field_class_declarator.u.nested.field_class_declarator = $1;
+                       BT_INIT_LIST_HEAD(&($$)->u.field_class_declarator.u.nested.length);
+                       _bt_list_splice_tail(&($3)->tmp_head, &($$)->u.field_class_declarator.u.nested.length);
                }
        ;
 
-type_declarator:
-               direct_type_declarator
+field_class_declarator:
+               direct_field_class_declarator
                {       $$ = $1;        }
-       |       pointer direct_type_declarator
+       |       pointer direct_field_class_declarator
                {
                        $$ = $2;
-                       bt_list_splice(&($1)->tmp_head, &($$)->u.type_declarator.pointers);
+                       bt_list_splice(&($1)->tmp_head, &($$)->u.field_class_declarator.pointers);
                }
        ;
 
-direct_type_declarator:
+direct_field_class_declarator:
                IDENTIFIER
                {
                        add_type(scanner, $1);
                        $$ = make_node(scanner, NODE_TYPE_DECLARATOR);
-                       $$->u.type_declarator.type = TYPEDEC_ID;
-                       $$->u.type_declarator.u.id = $1;
+                       $$->u.field_class_declarator.type = TYPEDEC_ID;
+                       $$->u.field_class_declarator.u.id = $1;
                }
-       |       CTF_LPAREN type_declarator CTF_RPAREN
+       |       CTF_LPAREN field_class_declarator CTF_RPAREN
                {
                        $$ = make_node(scanner, NODE_TYPE_DECLARATOR);
-                       $$->u.type_declarator.type = TYPEDEC_NESTED;
-                       $$->u.type_declarator.u.nested.type_declarator = $2;
+                       $$->u.field_class_declarator.type = TYPEDEC_NESTED;
+                       $$->u.field_class_declarator.u.nested.field_class_declarator = $2;
                }
-       |       direct_type_declarator CTF_LSBRAC unary_expression CTF_RSBRAC
+       |       direct_field_class_declarator CTF_LSBRAC unary_expression CTF_RSBRAC
                {
                        $$ = make_node(scanner, NODE_TYPE_DECLARATOR);
-                       $$->u.type_declarator.type = TYPEDEC_NESTED;
-                       $$->u.type_declarator.u.nested.type_declarator = $1;
-                       BT_INIT_LIST_HEAD(&($$)->u.type_declarator.u.nested.length);
-                       _bt_list_splice_tail(&($3)->tmp_head, &($$)->u.type_declarator.u.nested.length);
+                       $$->u.field_class_declarator.type = TYPEDEC_NESTED;
+                       $$->u.field_class_declarator.u.nested.field_class_declarator = $1;
+                       BT_INIT_LIST_HEAD(&($$)->u.field_class_declarator.u.nested.length);
+                       _bt_list_splice_tail(&($3)->tmp_head, &($$)->u.field_class_declarator.u.nested.length);
                }
        ;
 
@@ -2534,53 +2540,53 @@ ctf_assignment_expression:
                                reparent_error(scanner, "ctf_assignment_expression left expects string");
                        bt_list_add_tail(&($3)->siblings, &($$)->u.ctf_expression.right);
                }
-       |       declaration_specifiers CTF_TYPEDEF declaration_specifiers type_declarator_list
+       |       declaration_specifiers CTF_TYPEDEF declaration_specifiers field_class_declarator_list
                {
                        struct ctf_node *list;
 
                        list = make_node(scanner, NODE_TYPE_SPECIFIER_LIST);
-                       _bt_list_splice_tail(&($1)->u.type_specifier_list.head, &list->u.type_specifier_list.head);
-                       _bt_list_splice_tail(&($3)->u.type_specifier_list.head, &list->u.type_specifier_list.head);
+                       _bt_list_splice_tail(&($1)->u.field_class_specifier_list.head, &list->u.field_class_specifier_list.head);
+                       _bt_list_splice_tail(&($3)->u.field_class_specifier_list.head, &list->u.field_class_specifier_list.head);
                        $$ = make_node(scanner, NODE_TYPEDEF);
-                       ($$)->u.struct_or_variant_declaration.type_specifier_list = list;
-                       _bt_list_splice_tail(&($4)->tmp_head, &($$)->u._typedef.type_declarators);
+                       ($$)->u.struct_or_variant_declaration.field_class_specifier_list = list;
+                       _bt_list_splice_tail(&($4)->tmp_head, &($$)->u.field_class_def.field_class_declarators);
                }
-       |       CTF_TYPEDEF declaration_specifiers type_declarator_list
+       |       CTF_TYPEDEF declaration_specifiers field_class_declarator_list
                {
                        struct ctf_node *list;
 
                        $$ = make_node(scanner, NODE_TYPEDEF);
                        list = make_node(scanner, NODE_TYPE_SPECIFIER_LIST);
-                       $$->u._typedef.type_specifier_list = list;
-                       _bt_list_splice_tail(&($2)->u.type_specifier_list.head, &list->u.type_specifier_list.head);
-                       _bt_list_splice_tail(&($3)->tmp_head, &($$)->u._typedef.type_declarators);
+                       $$->u.field_class_def.field_class_specifier_list = list;
+                       _bt_list_splice_tail(&($2)->u.field_class_specifier_list.head, &list->u.field_class_specifier_list.head);
+                       _bt_list_splice_tail(&($3)->tmp_head, &($$)->u.field_class_def.field_class_declarators);
                }
-       |       declaration_specifiers CTF_TYPEDEF type_declarator_list
+       |       declaration_specifiers CTF_TYPEDEF field_class_declarator_list
                {
                        struct ctf_node *list;
 
                        list = make_node(scanner, NODE_TYPE_SPECIFIER_LIST);
-                       _bt_list_splice_tail(&($1)->u.type_specifier_list.head, &list->u.type_specifier_list.head);
+                       _bt_list_splice_tail(&($1)->u.field_class_specifier_list.head, &list->u.field_class_specifier_list.head);
                        $$ = make_node(scanner, NODE_TYPEDEF);
-                       ($$)->u.struct_or_variant_declaration.type_specifier_list = list;
-                       _bt_list_splice_tail(&($3)->tmp_head, &($$)->u._typedef.type_declarators);
+                       ($$)->u.struct_or_variant_declaration.field_class_specifier_list = list;
+                       _bt_list_splice_tail(&($3)->tmp_head, &($$)->u.field_class_def.field_class_declarators);
                }
        |       CTF_TYPEALIAS declaration_specifiers abstract_declarator_list CTF_TYPEASSIGN alias_declaration_specifiers alias_abstract_declarator_list
                {
                        struct ctf_node *list;
 
                        $$ = make_node(scanner, NODE_TYPEALIAS);
-                       $$->u.typealias.target = make_node(scanner, NODE_TYPEALIAS_TARGET);
-                       $$->u.typealias.alias = make_node(scanner, NODE_TYPEALIAS_ALIAS);
+                       $$->u.field_class_alias.target = make_node(scanner, NODE_TYPEALIAS_TARGET);
+                       $$->u.field_class_alias.alias = make_node(scanner, NODE_TYPEALIAS_ALIAS);
 
                        list = make_node(scanner, NODE_TYPE_SPECIFIER_LIST);
-                       $$->u.typealias.target->u.typealias_target.type_specifier_list = list;
-                       _bt_list_splice_tail(&($2)->u.type_specifier_list.head, &list->u.type_specifier_list.head);
-                       _bt_list_splice_tail(&($3)->tmp_head, &($$)->u.typealias.target->u.typealias_target.type_declarators);
+                       $$->u.field_class_alias.target->u.field_class_alias_target.field_class_specifier_list = list;
+                       _bt_list_splice_tail(&($2)->u.field_class_specifier_list.head, &list->u.field_class_specifier_list.head);
+                       _bt_list_splice_tail(&($3)->tmp_head, &($$)->u.field_class_alias.target->u.field_class_alias_target.field_class_declarators);
 
                        list = make_node(scanner, NODE_TYPE_SPECIFIER_LIST);
-                       $$->u.typealias.alias->u.typealias_alias.type_specifier_list = list;
-                       _bt_list_splice_tail(&($5)->u.type_specifier_list.head, &list->u.type_specifier_list.head);
-                       _bt_list_splice_tail(&($6)->tmp_head, &($$)->u.typealias.alias->u.typealias_alias.type_declarators);
+                       $$->u.field_class_alias.alias->u.field_class_alias_name.field_class_specifier_list = list;
+                       _bt_list_splice_tail(&($5)->u.field_class_specifier_list.head, &list->u.field_class_specifier_list.head);
+                       _bt_list_splice_tail(&($6)->tmp_head, &($$)->u.field_class_alias.alias->u.field_class_alias_name.field_class_declarators);
                }
        ;
This page took 0.057339 seconds and 4 git commands to generate.