зеркало из https://github.com/microsoft/clang-1.git
156 строки
4.8 KiB
C++
156 строки
4.8 KiB
C++
//===-- DeclNodes.def - Metadata about Decl AST nodes -----------*- C++ -*-===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This file defines the declaration nodes within the AST. The
|
|
// description of the declaration nodes uses six macros:
|
|
//
|
|
// DECL(Derived, Base) describes a normal declaration type Derived
|
|
// and specifies its base class. Note that Derived should not have
|
|
// the Decl suffix on it, while Base should.
|
|
//
|
|
// LAST_DECL(Derived, Base) is like DECL, but is used for the last
|
|
// declaration in the list.
|
|
//
|
|
// ABSTRACT_DECL(Derived, Base) describes an abstract class that is
|
|
// used to specify a classification of declarations. For example,
|
|
// TagDecl is an abstract class used to describe the various kinds of
|
|
// "tag" declarations (unions, structs, classes, enums).
|
|
//
|
|
// DECL_CONTEXT(Decl) specifies that Decl is a kind of declaration
|
|
// that is also a DeclContext.
|
|
//
|
|
// LAST_DECL_CONTEXT(Decl) is like DECL_CONTEXT, but is used for the
|
|
// last declaration context.
|
|
//
|
|
// DECL_RANGE(CommonBase, Start, End) specifies a range of
|
|
// declaration values that have a common (potentially indirect) base
|
|
// class.
|
|
//
|
|
// LAST_DECL_RANGE(CommonBase, Start, End) is like DECL_RANGE, but is
|
|
// used for the last declaration range.
|
|
//
|
|
// Note that, due to the use of ranges, the order of the these
|
|
// declarations is significant. A declaration should be listed under
|
|
// its base class.
|
|
// ===----------------------------------------------------------------------===//
|
|
|
|
#ifndef DECL
|
|
# define DECL(Derived, Base)
|
|
#endif
|
|
|
|
#ifndef LAST_DECL
|
|
# define LAST_DECL(Derived, Base) DECL(Derived, Base)
|
|
#endif
|
|
|
|
#ifndef ABSTRACT_DECL
|
|
# define ABSTRACT_DECL(Derived, Base)
|
|
#endif
|
|
|
|
#ifndef DECL_CONTEXT
|
|
# define DECL_CONTEXT(Decl)
|
|
#endif
|
|
|
|
#ifndef LAST_DECL_CONTEXT
|
|
# define LAST_DECL_CONTEXT(Decl) DECL_CONTEXT(Decl)
|
|
#endif
|
|
|
|
#ifndef DECL_RANGE
|
|
# define DECL_RANGE(CommonBase, Start, End)
|
|
#endif
|
|
|
|
#ifndef LAST_DECL_RANGE
|
|
# define LAST_DECL_RANGE(CommonBase, Start, End) \
|
|
DECL_RANGE(CommonBase, Start, End)
|
|
#endif
|
|
|
|
DECL(TranslationUnit, Decl)
|
|
ABSTRACT_DECL(Named, Decl)
|
|
DECL(OverloadedFunction, NamedDecl)
|
|
DECL(Field, NameDecl)
|
|
DECL(ObjCIvar, FieldDecl)
|
|
DECL(ObjCAtDefsField, FieldDecl)
|
|
DECL(Namespace, NamedDecl)
|
|
DECL(UsingDirective, NamedDecl)
|
|
ABSTRACT_DECL(Type, NamedDecl)
|
|
DECL(Typedef, TypeDecl)
|
|
ABSTRACT_DECL(Tag, TypeDecl)
|
|
DECL(Enum, TagDecl)
|
|
DECL(Record, TagDecl)
|
|
DECL(CXXRecord, RecordDecl)
|
|
DECL(TemplateTypeParm, TypeDecl)
|
|
ABSTRACT_DECL(Value, NamedDecl)
|
|
DECL(EnumConstant, ValueDecl)
|
|
DECL(Function, ValueDecl)
|
|
DECL(CXXMethod, FunctionDecl)
|
|
DECL(CXXConstructor, CXXMethodDecl)
|
|
DECL(CXXDestructor, CXXMethodDecl)
|
|
DECL(CXXConversion, CXXMethodDecl)
|
|
DECL(Var, ValueDecl)
|
|
DECL(ImplicitParam, VarDecl)
|
|
DECL(CXXClassVar, VarDecl)
|
|
DECL(ParmVar, VarDecl)
|
|
DECL(OriginalParmVar, ParmVarDecl)
|
|
DECL(NonTypeTemplateParm, VarDecl)
|
|
DECL(Template, NamedDecl)
|
|
DECL(FunctionTemplate, TemplateDecl)
|
|
DECL(ClassTemplate, TemplateDecl)
|
|
DECL(TemplateTemplateParm, TemplateDecl)
|
|
DECL(ObjCMethod, NamedDecl)
|
|
DECL(ObjCContainer, NamedDecl)
|
|
DECL(ObjCCategory, ObjCContainerDecl)
|
|
DECL(ObjCProtocol, ObjCContainerDecl)
|
|
DECL(ObjCInterface, ObjCContainerDecl)
|
|
DECL(ObjCCategoryImpl, NamedDecl)
|
|
DECL(ObjCProperty, NamedDecl)
|
|
DECL(ObjCCompatibleAlias, NamedDecl)
|
|
DECL(LinkageSpec, Decl)
|
|
DECL(ObjCPropertyImpl, Decl)
|
|
DECL(ObjCImplementation, Decl)
|
|
DECL(ObjCForwardProtocol, Decl)
|
|
DECL(ObjCClass, Decl)
|
|
DECL(FileScopeAsm, Decl)
|
|
LAST_DECL(Block, Decl)
|
|
|
|
// Declaration contexts
|
|
DECL_CONTEXT(TranslationUnit)
|
|
DECL_CONTEXT(Namespace)
|
|
DECL_CONTEXT(Enum)
|
|
DECL_CONTEXT(Record)
|
|
DECL_CONTEXT(CXXRecord)
|
|
DECL_CONTEXT(Function)
|
|
DECL_CONTEXT(ObjCMethod)
|
|
DECL_CONTEXT(ObjCContainer)
|
|
DECL_CONTEXT(ObjCInterface)
|
|
DECL_CONTEXT(ObjCProtocol)
|
|
DECL_CONTEXT(ObjCCategory)
|
|
DECL_CONTEXT(ObjCCategoryImpl)
|
|
DECL_CONTEXT(LinkageSpec)
|
|
DECL_CONTEXT(ObjCImplementation)
|
|
LAST_DECL_CONTEXT(Block)
|
|
|
|
// Declaration ranges
|
|
DECL_RANGE(Named, OverloadedFunction, ObjCCompatibleAlias)
|
|
DECL_RANGE(ObjCContainer, ObjCContainer, ObjCInterface)
|
|
DECL_RANGE(Field, Field, ObjCAtDefsField)
|
|
DECL_RANGE(Type, Typedef, TemplateTypeParm)
|
|
DECL_RANGE(Tag, Enum, CXXRecord)
|
|
DECL_RANGE(Record, Record, CXXRecord)
|
|
DECL_RANGE(Value, EnumConstant, NonTypeTemplateParm)
|
|
DECL_RANGE(Function, Function, CXXConversion)
|
|
DECL_RANGE(Template, Template, TemplateTemplateParm)
|
|
LAST_DECL_RANGE(Var, Var, NonTypeTemplateParm)
|
|
|
|
#undef LAST_DECL_RANGE
|
|
#undef DECL_RANGE
|
|
#undef LAST_DECL_CONTEXT
|
|
#undef DECL_CONTEXT
|
|
#undef ABSTRACT_DECL
|
|
#undef LAST_DECL
|
|
#undef DECL
|