+ /*
+ * Only accept alias name containing:
+ * - identifier
+ * - identifier * (any number of pointers)
+ * NOT accepting alias names containing [] (would otherwise
+ * cause semantic clash for later declarations of
+ * arrays/sequences of elements, where elements could be
+ * arrays/sequences themselves (if allowed in typealias).
+ * NOT accepting alias with identifier. The declarator should
+ * be either empty or contain pointer(s).
+ */
+ if (node->u.type_declarator.type == TYPEDEC_NESTED)
+ goto errperm;
+ bt_list_for_each_entry(iter, &node->parent->u.typealias_alias.type_specifier_list->u.type_specifier_list.head,
+ siblings) {
+ switch (iter->u.type_specifier.type) {
+ case TYPESPEC_FLOATING_POINT:
+ case TYPESPEC_INTEGER:
+ case TYPESPEC_STRING:
+ case TYPESPEC_STRUCT:
+ case TYPESPEC_VARIANT:
+ case TYPESPEC_ENUM:
+ if (bt_list_empty(&node->u.type_declarator.pointers))
+ goto errperm;
+ break;
+ default:
+ break;
+ }
+ }
+ if (node->u.type_declarator.type == TYPEDEC_ID &&
+ node->u.type_declarator.u.id != NULL)
+ goto errperm;
+ break; /* OK */
+ case NODE_TYPEDEF: