Skip to content

Instantly share code, notes, and snippets.

@ryuichis
Last active August 16, 2017 14:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryuichis/5d4b826eb38284dc31012b6e7da97038 to your computer and use it in GitHub Desktop.
Save ryuichis/5d4b826eb38284dc31012b6e7da97038 to your computer and use it in GitHub Desktop.
# 1 "/System/Library/Frameworks/Foundation.framework/Headers/FoundationLegacySwiftCompatibility.h" 1 3
# 185 "/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h" 2 3
# 2 "test.m" 2
typedef enum NS_ENUM_State : int NS_ENUM_State; enum NS_ENUM_State : int{
kATC_start = 0,
kATC_stop
};
typedef enum C2 : NSInteger C2; enum C2 : NSInteger {
C2Default,
C2Value1,
C2Value2,
C2Subtitle
};
typedef enum C3 : NSInteger C3; enum C3 : NSInteger {
C3Default,
C3Value1,
C3Value2,
C3Subtitle
};
typedef enum C4 : NSInteger C4; enum C4 : NSInteger {
C4Default,
C4Value1,
C4Value2,
C4Subtitle
};
typedef enum C5 : NSInteger C5; enum C5 : NSInteger {
C5Default,
C5Value1,
C5Value2,
C5Subtitle
};
a decl: Typedef
typedef: NS_ENUM_State
a decl: Typedef
typedef: C2
a decl: Typedef
typedef: C3
a decl: Typedef
typedef: C4
a decl: Enum
enum: C5
a decl: Typedef
typedef: C5
a decl: Enum
enum: C5
a decl: EnumConstant
a decl: EnumConstant
a decl: EnumConstant
a decl: EnumConstant
bool VisitDecl(Decl* decl)
{
cout << "a decl: " << decl->getDeclKindName() << endl;
return true;
}
bool VisitTypedefDecl(TypedefDecl* decl) {
cout << "typedef: " << decl->getNameAsString() << endl;
return true;
}
bool VisitEnumDecl(EnumDecl* decl)
{
cout << "enum: " << decl->getNameAsString() << endl;
return true;
}
#import <Foundation/Foundation.h>
typedef NS_ENUM(int, NS_ENUM_State){
kATC_start = 0,
kATC_stop
};
typedef NS_ENUM(NSInteger, C2) {
C2Default,
C2Value1,
C2Value2,
C2Subtitle
};
typedef CF_ENUM(NSInteger, C3) {
C3Default,
C3Value1,
C3Value2,
C3Subtitle
};
typedef __CF_NAMED_ENUM(NSInteger, C4) {
C4Default,
C4Value1,
C4Value2,
C4Subtitle
};
typedef enum C5 : NSInteger C5; enum C5 : NSInteger {
C5Default,
C5Value1,
C5Value2,
C5Subtitle
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment