1class AttrSubject;
2
3class Decl<string diagSpelling = "", bit abstract = 0> : AttrSubject {
4  bit Abstract = abstract;
5  string DiagSpelling = diagSpelling;
6}
7
8class DDecl<Decl base, string diagSpelling = "", bit abstract = 0>
9    : Decl<diagSpelling, abstract> {
10  Decl Base = base;
11}
12
13class DeclContext {}
14
15def TranslationUnit : Decl, DeclContext;
16def PragmaComment : Decl;
17def PragmaDetectMismatch : Decl;
18def ExternCContext : Decl, DeclContext;
19def Named : Decl<"named declarations", 1>;
20  def Namespace : DDecl<Named, "namespaces">, DeclContext;
21  def UsingDirective : DDecl<Named>;
22  def NamespaceAlias : DDecl<Named>;
23  def Label : DDecl<Named, "labels">;
24  def Type : DDecl<Named, "types", 1>;
25    def TypedefName : DDecl<Type, "typedefs", 1>;
26      def Typedef : DDecl<TypedefName>;
27      def TypeAlias : DDecl<TypedefName>;
28      def ObjCTypeParam : DDecl<TypedefName>;
29    def UnresolvedUsingTypename : DDecl<Type>;
30    def Tag : DDecl<Type, "tag types", 1>, DeclContext;
31      def Enum : DDecl<Tag, "enums">;
32      def Record : DDecl<Tag, "structs, unions, classes">;
33        def CXXRecord : DDecl<Record, "classes">;
34          def ClassTemplateSpecialization : DDecl<CXXRecord>;
35            def ClassTemplatePartialSpecialization
36              : DDecl<ClassTemplateSpecialization>;
37    def TemplateTypeParm : DDecl<Type>;
38  def Value : DDecl<Named, "value declarations", 1>;
39    def EnumConstant : DDecl<Value, "enumerators">;
40    def UnresolvedUsingValue : DDecl<Value>;
41    def IndirectField : DDecl<Value>;
42    def Binding : DDecl<Value>;
43    def OMPDeclareReduction : DDecl<Value>, DeclContext;
44    def Declarator : DDecl<Value, "declarators", 1>;
45      def Field : DDecl<Declarator, "non-static data members">;
46        def ObjCIvar : DDecl<Field>;
47        def ObjCAtDefsField : DDecl<Field>;
48      def MSProperty : DDecl<Declarator>;
49      def Function : DDecl<Declarator, "functions">, DeclContext;
50        def CXXDeductionGuide : DDecl<Function>;
51        def CXXMethod : DDecl<Function>;
52          def CXXConstructor : DDecl<CXXMethod>;
53          def CXXDestructor : DDecl<CXXMethod>;
54          def CXXConversion : DDecl<CXXMethod>;
55      def Var : DDecl<Declarator, "variables">;
56        def VarTemplateSpecialization : DDecl<Var>;
57          def VarTemplatePartialSpecialization
58            : DDecl<VarTemplateSpecialization>;
59        def ImplicitParam : DDecl<Var>;
60        def ParmVar : DDecl<Var, "parameters">;
61        def Decomposition : DDecl<Var>;
62        def OMPCapturedExpr : DDecl<Var>;
63      def NonTypeTemplateParm : DDecl<Declarator>;
64  def Template : DDecl<Named, "templates", 1>;
65    def RedeclarableTemplate : DDecl<Template, "redeclarable templates", 1>;
66      def FunctionTemplate : DDecl<RedeclarableTemplate>;
67      def ClassTemplate : DDecl<RedeclarableTemplate>;
68      def VarTemplate : DDecl<RedeclarableTemplate>;
69      def TypeAliasTemplate : DDecl<RedeclarableTemplate>;
70    def TemplateTemplateParm : DDecl<Template>;
71    def BuiltinTemplate : DDecl<Template>;
72  def Using : DDecl<Named>;
73  def UsingPack : DDecl<Named>;
74  def UsingShadow : DDecl<Named>;
75    def ConstructorUsingShadow : DDecl<UsingShadow>;
76  def ObjCMethod : DDecl<Named, "Objective-C methods">, DeclContext;
77  def ObjCContainer : DDecl<Named, "Objective-C containers", 1>, DeclContext;
78    def ObjCCategory : DDecl<ObjCContainer>;
79    def ObjCProtocol : DDecl<ObjCContainer, "Objective-C protocols">;
80    def ObjCInterface : DDecl<ObjCContainer, "Objective-C interfaces">;
81    def ObjCImpl
82        : DDecl<ObjCContainer, "Objective-C implementation declarations", 1>;
83      def ObjCCategoryImpl : DDecl<ObjCImpl>;
84      def ObjCImplementation : DDecl<ObjCImpl>;
85  def ObjCProperty : DDecl<Named, "Objective-C properties">;
86  def ObjCCompatibleAlias : DDecl<Named>;
87def LinkageSpec : Decl, DeclContext;
88def Export : Decl, DeclContext;
89def ObjCPropertyImpl : Decl;
90def FileScopeAsm : Decl;
91def AccessSpec : Decl;
92def Friend : Decl;
93def FriendTemplate : Decl;
94def StaticAssert : Decl;
95def Block : Decl<"blocks">, DeclContext;
96def Captured : Decl, DeclContext;
97def ClassScopeFunctionSpecialization : Decl;
98def Import : Decl;
99def OMPThreadPrivate : Decl;
100def OMPRequires : Decl;
101def Empty : Decl;
102
103