Browse Source

Cleaned up AST.h.

* Added some regions make the code easier to work with.
* Moved related things together.
pull/222/head
triton 11 years ago
parent
commit
2248b565d3
  1. 115
      src/CppParser/AST.h

115
src/CppParser/AST.h

@ -11,7 +11,7 @@
namespace CppSharp { namespace CppParser { namespace AST { namespace CppSharp { namespace CppParser { namespace AST {
// Types #pragma region Types
enum struct TypeKind enum struct TypeKind
{ {
@ -244,33 +244,17 @@ struct CS_API BuiltinType : public Type
PrimitiveType Type; PrimitiveType Type;
}; };
// Comments #pragma endregion
enum struct RawCommentKind #pragma region ABI
{
Invalid,
OrdinaryBCPL,
OrdinaryC,
BCPLSlash,
BCPLExcl,
JavaDoc,
Qt,
Merged
};
struct FullComment;
struct CS_API RawComment enum struct CppAbi
{ {
RawComment(); Itanium,
RawCommentKind Kind; Microsoft,
STRING(Text) ARM
STRING(BriefText)
CppSharp::CppParser::AST::FullComment* FullComment;
}; };
// Class layouts
enum struct VTableComponentKind enum struct VTableComponentKind
{ {
VCallOffset, VCallOffset,
@ -305,13 +289,6 @@ struct CS_API VFTableInfo
VTableLayout Layout; VTableLayout Layout;
}; };
enum struct CppAbi
{
Itanium,
Microsoft,
ARM
};
struct CS_API ClassLayout struct CS_API ClassLayout
{ {
ClassLayout(); ClassLayout();
@ -325,27 +302,9 @@ struct CS_API ClassLayout
int DataSize; int DataSize;
}; };
// Declarations #pragma endregion
enum struct MacroLocation #pragma region Declarations
{
Unknown,
ClassHead,
ClassBody,
FunctionHead,
FunctionParameters,
FunctionBody,
};
enum struct AccessSpecifier
{
Private,
Protected,
Public
};
struct DeclarationContext;
struct PreprocessedEntity;
enum struct DeclarationKind enum struct DeclarationKind
{ {
@ -375,6 +334,17 @@ enum struct DeclarationKind
#define DECLARE_DECL_KIND(klass, kind) \ #define DECLARE_DECL_KIND(klass, kind) \
klass(); klass();
enum struct AccessSpecifier
{
Private,
Protected,
Public
};
struct DeclarationContext;
struct RawComment;
struct PreprocessedEntity;
struct CS_API Declaration struct CS_API Declaration
{ {
Declaration(DeclarationKind kind); Declaration(DeclarationKind kind);
@ -583,6 +553,9 @@ struct CS_API Variable : public Declaration
CppSharp::CppParser::AST::QualifiedType QualifiedType; CppSharp::CppParser::AST::QualifiedType QualifiedType;
}; };
struct DeclarationContext;
struct PreprocessedEntity;
struct CS_API BaseClassSpecifier struct CS_API BaseClassSpecifier
{ {
BaseClassSpecifier(); BaseClassSpecifier();
@ -680,6 +653,16 @@ struct CS_API Namespace : public DeclarationContext
Namespace(); Namespace();
}; };
enum struct MacroLocation
{
Unknown,
ClassHead,
ClassBody,
FunctionHead,
FunctionParameters,
FunctionBody,
};
struct CS_API PreprocessedEntity : public Declaration struct CS_API PreprocessedEntity : public Declaration
{ {
PreprocessedEntity(); PreprocessedEntity();
@ -719,4 +702,36 @@ struct CS_API ASTContext
VECTOR(TranslationUnit*, TranslationUnits) VECTOR(TranslationUnit*, TranslationUnits)
}; };
#pragma endregion
#pragma region Comments
#define DECLARE_COMMENT_KIND(kind) \
kind##Type();
enum struct RawCommentKind
{
Invalid,
OrdinaryBCPL,
OrdinaryC,
BCPLSlash,
BCPLExcl,
JavaDoc,
Qt,
Merged
};
struct FullComment;
struct CS_API RawComment
{
RawComment();
RawCommentKind Kind;
STRING(Text)
STRING(BriefText)
CppSharp::CppParser::AST::FullComment* FullComment;
};
#pragma endregion
} } } } } }
Loading…
Cancel
Save