├── Tests ├── en.lproj │ └── InfoPlist.strings ├── CSSViewSelectorTest.h ├── CSSObjectCategoryTest.h ├── TestsAppDelegate.h ├── Tests-Prefix.pch ├── Tests-Info.plist ├── CSSViewSelectorTest.m ├── CSSObjectCategoryTest.m └── TestsAppDelegate.m ├── CSSSample ├── en.lproj │ ├── InfoPlist.strings │ ├── CSSSampleViewController.xib │ └── MainWindow.xib ├── maintest.css ├── CSSSample-Prefix.pch ├── main.m ├── CSSSampleViewController.h ├── CSSSampleAppDelegate.h ├── CSSSample-Info.plist ├── CSSSampleViewController.m └── CSSSampleAppDelegate.m ├── .gitmodules ├── README.markdown ├── CALayer+CSS.h ├── CALayer+CSS.m ├── CSSMapper.h ├── .gitignore ├── CSSPlistMapper.h ├── NSObject+CSS.h ├── CSSPlistMapper.m ├── CSSResourceManager.h ├── UIView+CSS.h ├── CSSResourceManager.m ├── CSSParser.h ├── testcase.css ├── CSSTokens.h ├── CSSStyleSheet.h ├── CSSSelector.h ├── NSObject+CSS.m ├── CSSSelectorTree.h ├── CSSStyleSheet.m ├── GHUnitIOSTestMain.m ├── lex ├── mcss.grammer ├── css.grammer └── css.h ├── CSSSelectorTree.m ├── UIView+CSS.m ├── CSSSelector.m ├── CSSParser.m └── CSSSample.xcodeproj └── project.pbxproj /Tests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /CSSSample/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "vendors/GHUnit"] 2 | path = vendors/GHUnit 3 | url = https://github.com/gabriel/gh-unit.git 4 | -------------------------------------------------------------------------------- /CSSSample/maintest.css: -------------------------------------------------------------------------------- 1 | #container{ 2 | backgroundColor: #333333; 3 | } 4 | 5 | UILabel{ 6 | backgroundColor: #ff00ff; 7 | } -------------------------------------------------------------------------------- /README.markdown: -------------------------------------------------------------------------------- 1 | Extremely lightweight skinning system for iOS. It allows you to load a CSS file and skin UIView elements. The system also allows you to do simple searches for subviews like jQuery with CSS selectors. 2 | ============================================ 3 | Getting Started 4 | -------------------------------------------------------------------------------- /CALayer+CSS.h: -------------------------------------------------------------------------------- 1 | // 2 | // CALayer+CSS.h 3 | // CSSSample 4 | // 5 | // Created by Jonathan Dalrymple on 16/07/2011. 6 | // Copyright 2011 Float:Right Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface CALayer (CSS) 13 | 14 | -(id) CSSParent; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /CALayer+CSS.m: -------------------------------------------------------------------------------- 1 | // 2 | // CALayer+CSS.m 3 | // CSSSample 4 | // 5 | // Created by Jonathan Dalrymple on 16/07/2011. 6 | // Copyright 2011 Float:Right Ltd. All rights reserved. 7 | // 8 | 9 | #import "CALayer+CSS.h" 10 | 11 | 12 | @implementation CALayer (CSS) 13 | 14 | -(id) CSSParent{ 15 | return [self superlayer]; 16 | } 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Tests/CSSViewSelectorTest.h: -------------------------------------------------------------------------------- 1 | // 2 | // CSSViewSelectorTest.h 3 | // CSSSample 4 | // 5 | // Created by Jonathan Dalrymple on 16/07/2011. 6 | // Copyright 2011 Float:Right Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface CSSViewSelectorTest : GHTestCase { 13 | UIView *_testView; 14 | } 15 | 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Tests/CSSObjectCategoryTest.h: -------------------------------------------------------------------------------- 1 | // 2 | // CSSViewTests.h 3 | // CSSSample 4 | // 5 | // Created by Jonathan Dalrymple on 16/07/2011. 6 | // Copyright 2011 Float:Right Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "UIView+CSS.h" 11 | 12 | @interface CSSObjectCategoryTest : GHTestCase { 13 | UIView *_testView; 14 | } 15 | 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Tests/TestsAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // TestsAppDelegate.h 3 | // Tests 4 | // 5 | // Created by Jonathan Dalrymple on 16/07/2011. 6 | // Copyright 2011 Float:Right Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TestsAppDelegate : NSObject { 12 | 13 | } 14 | 15 | @property (nonatomic, retain) IBOutlet UIWindow *window; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /CSSSample/CSSSample-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'CSSSample' target in the 'CSSSample' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iPhone SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /Tests/Tests-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Tests' target in the 'Tests' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iPhone SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #import 15 | #endif 16 | -------------------------------------------------------------------------------- /CSSMapper.h: -------------------------------------------------------------------------------- 1 | // 2 | // CSSMapper.h 3 | // CSSSample 4 | // 5 | // Created by Sam Stewart on 7/16/11. 6 | // Copyright 2011 Float:Right Ltd. All rights reserved. 7 | // 8 | 9 | /** Simple interface thath all mappers must implement. 10 | 11 | Each mapper must return a list of mappers (flat namespace though that may change in the future).*/ 12 | @protocol CSSMapper 13 | @required 14 | - (NSDictionary*)loadMappings; 15 | @end -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # xcode noise 2 | *.mode1v3 3 | *.pbxuser 4 | *.perspective 5 | *.perspectivev3 6 | *.pyc 7 | *~.nib/ 8 | build/* 9 | 10 | # Textmate - if you build your xcode projects with it 11 | *.tm_build_errors 12 | 13 | # old skool 14 | .svn 15 | 16 | # osx noise 17 | .DS_Store 18 | profile 19 | project.xcworkspace/ 20 | *.xcodeproj/project.xcworkspace/xcuserdata/* 21 | *.xcodeproj/xcuserdata/* 22 | 23 | # Custom 24 | 25 | *.mode2v3 26 | -------------------------------------------------------------------------------- /CSSPlistMapper.h: -------------------------------------------------------------------------------- 1 | // 2 | // CSSPlistMapper.h 3 | // CSSSample 4 | // 5 | // Created by Sam Stewart on 7/16/11. 6 | // Copyright 2011 Float:Right Ltd. All rights reserved. 7 | // 8 | /** Loads a list of mappings from css selectors to object properties from a plist file.*/ 9 | #import 10 | #import "CSSMapper.h" 11 | 12 | @interface CSSPlistMapper : NSObject { 13 | 14 | } 15 | 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /CSSSample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // CSSSample 4 | // 5 | // Created by Jonathan Dalrymple on 16/07/2011. 6 | // Copyright 2011 Float:Right Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | [pool release]; 16 | return retVal; 17 | } 18 | -------------------------------------------------------------------------------- /CSSSample/CSSSampleViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CSSSampleViewController.h 3 | // CSSSample 4 | // 5 | // Created by Jonathan Dalrymple on 16/07/2011. 6 | // Copyright 2011 Float:Right Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "UIView+CSS.h" 11 | 12 | @interface CSSSampleViewController : UIViewController { 13 | 14 | UILabel *sampleView; 15 | } 16 | @property (nonatomic, retain) IBOutlet UILabel *sampleView; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /NSObject+CSS.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+CSS.h 3 | // CSSSample 4 | // 5 | // Created by Jonathan Dalrymple on 16/07/2011. 6 | // Copyright 2011 Float:Right Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "CSSSelector.h" 11 | 12 | @interface NSObject (CSS) 13 | 14 | @property (nonatomic,copy) NSString *CSSID; 15 | @property (nonatomic,copy) NSSet *CSSClassNames; 16 | @property (nonatomic,readonly) CSSSelector *CSSSelector; 17 | 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /CSSPlistMapper.m: -------------------------------------------------------------------------------- 1 | // 2 | // CSSPlistMapper.m 3 | // CSSSample 4 | // 5 | // Created by Sam Stewart on 7/16/11. 6 | // Copyright 2011 Float:Right Ltd. All rights reserved. 7 | // 8 | 9 | #import "CSSPlistMapper.h" 10 | 11 | 12 | @implementation CSSPlistMapper 13 | 14 | #pragma mark Required Mapper Methods 15 | - (NSDictionary*)loadMappings { 16 | return [NSDictionary dictionaryWithObjectsAndKeys:@"backgroundImage", 17 | @"background-image", nil]; 18 | } 19 | @end 20 | -------------------------------------------------------------------------------- /CSSResourceManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // CSSResourceManager.h 3 | // CSSSample 4 | // 5 | // Created by Sam Stewart on 7/16/11. 6 | // Copyright 2011 Float:Right Ltd. All rights reserved. 7 | // 8 | 9 | /** Singleton instance which does caching and loading of resources.*/ 10 | #import 11 | 12 | 13 | @interface CSSResourceManager : NSObject { 14 | 15 | } 16 | 17 | - (UIImage*)loadImage:(NSString*)path; 18 | - (NSString*)loadCSS:(NSString*)path; 19 | 20 | + (CSSResourceManager*)sharedResourceManager; 21 | @end 22 | -------------------------------------------------------------------------------- /CSSSample/CSSSampleAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // CSSSampleAppDelegate.h 3 | // CSSSample 4 | // 5 | // Created by Jonathan Dalrymple on 16/07/2011. 6 | // Copyright 2011 Float:Right Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class CSSSampleViewController; 12 | 13 | @interface CSSSampleAppDelegate : NSObject { 14 | 15 | } 16 | 17 | @property (nonatomic, retain) IBOutlet UIWindow *window; 18 | 19 | @property (nonatomic, retain) IBOutlet CSSSampleViewController *viewController; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /UIView+CSS.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIVIew+CSS.h 3 | // CSSSample 4 | // 5 | // Created by Jonathan Dalrymple on 16/07/2011. 6 | // Copyright 2011 Float:Right Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "CSSStyleSheet.h" 11 | #import "CSSSelectorTree.h" 12 | 13 | @interface UIView (CSS) 14 | 15 | - (void)applyAll:(CSSStyleSheet*)sheet; 16 | - (void)apply:(CSSStyleSheet*)sheet; 17 | 18 | - (NSArray*)find:(CSSSelector*)selector; 19 | - (NSArray*)findAll:(CSSSelector*)selector; 20 | 21 | -(id) CSSParent; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /CSSResourceManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // CSSResourceManager.m 3 | // CSSSample 4 | // 5 | // Created by Sam Stewart on 7/16/11. 6 | // Copyright 2011 Float:Right Ltd. All rights reserved. 7 | // 8 | 9 | #import "CSSResourceManager.h" 10 | 11 | 12 | @implementation CSSResourceManager 13 | 14 | + (CSSResourceManager*)sharedResourceManager { 15 | static dispatch_once_t onceToken; 16 | static CSSResourceManager *_sharedManager; 17 | dispatch_once(&onceToken, ^{ 18 | _sharedManager = [[CSSResourceManager alloc] init]; 19 | }); 20 | return _sharedManager; 21 | } 22 | @end 23 | -------------------------------------------------------------------------------- /CSSParser.h: -------------------------------------------------------------------------------- 1 | // 2 | // CSSParser.h 3 | // CSSSample 4 | // 5 | // Created by Sam Stewart on 7/16/11. 6 | // Copyright 2011 Float:Right Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CSSParser : NSObject { 12 | @private 13 | NSMutableDictionary* _ruleSets; 14 | NSMutableArray* _activeCssSelectors; 15 | NSMutableDictionary* _activeRuleSet; 16 | NSString* _activePropertyName; 17 | 18 | NSString* _lastTokenText; 19 | int _lastToken; 20 | 21 | union { 22 | struct { 23 | int InsideDefinition : 1; 24 | int InsideProperty : 1; 25 | int InsideFunction : 1; 26 | } Flags; 27 | int _data; 28 | } _state; 29 | } 30 | 31 | - (NSDictionary*)parseFilename:(NSString*)filename; 32 | @end 33 | -------------------------------------------------------------------------------- /testcase.css: -------------------------------------------------------------------------------- 1 | 2 | .classname, 3 | #identifier { 4 | width: 800px; 5 | height: 2em 6 | } 7 | 8 | .alpha .beta { 9 | width: 600px 10 | } 11 | 12 | .jon.suzi { 13 | width: 600px 14 | } 15 | 16 | 17 | .classname:hover { 18 | width: 800px; 19 | } 20 | 21 | .short-hex-colors { 22 | color: #F73; 23 | background-color: #F73 24 | } 25 | 26 | .long-hex-colors { 27 | color: #FF7733; 28 | background-color: #FF7733 29 | } 30 | 31 | .named-color { 32 | color: red; 33 | background-color: red 34 | } 35 | 36 | .named-invalid-color { 37 | color: polkadot; 38 | background-color: polkadot 39 | } 40 | 41 | .fn-color-rgb { 42 | color: rgb(255, 0, 255); 43 | background-color: rgb(255, 0, 255); 44 | } 45 | 46 | .fn-color-rgba { 47 | color: rgba(255, 255, 255, 0.5); 48 | background-color: rgba(255, 255, 255, 0.5); 49 | } 50 | 51 | .font-props { 52 | font-weight: bold; 53 | font-size: 12pt; 54 | font-style: italic; 55 | } 56 | -------------------------------------------------------------------------------- /CSSTokens.h: -------------------------------------------------------------------------------- 1 | // 2 | // CSSInc.h 3 | // CSSSample 4 | // 5 | // Created by Zac Bowling on 7/16/11. 6 | // Copyright 2011 Float:Right Ltd. All rights reserved. 7 | // 8 | 9 | #include 10 | 11 | #ifndef CSSSample_CSSInc_h 12 | #define CSSSample_CSSInc_h 13 | 14 | typedef enum { 15 | CSSFIRST_TOKEN = 0x100, 16 | CSSSTRING = CSSFIRST_TOKEN, 17 | CSSIDENT, //0x101 18 | CSSHASH, //0x102 19 | CSSEMS, //0x103 20 | CSSEXS, //0x104 21 | CSSLENGTH, //0x105 22 | CSSANGLE, //0x106 23 | CSSTIME, //0x107 24 | CSSFREQ, //0x108 25 | CSSDIMEN, //0x109 26 | CSSPERCENTAGE, //0x10A 27 | CSSNUMBER, //0x10B 28 | CSSURI, //0x10C 29 | CSSFUNCTION, //0x10D 30 | CSSUNICODERANGE, //0x10E 31 | CSSUNKNOWN, //0x10F 32 | 33 | } CssParserCodes; 34 | 35 | extern const char* cssnames[]; 36 | 37 | #ifndef YY_TYPEDEF_YY_SCANNER_T 38 | #define YY_TYPEDEF_YY_SCANNER_T 39 | typedef void* yyscan_t; 40 | #endif 41 | 42 | extern FILE *cssin; 43 | 44 | int cssConsume(char* text, int token); 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /Tests/Tests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.devcamp.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | NSMainNibFile 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /CSSSample/CSSSample-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.devcamp.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | NSMainNibFile 30 | MainWindow 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /CSSSample/CSSSampleViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // CSSSampleViewController.m 3 | // CSSSample 4 | // 5 | // Created by Jonathan Dalrymple on 16/07/2011. 6 | // Copyright 2011 Float:Right Ltd. All rights reserved. 7 | // 8 | 9 | #import "CSSSampleViewController.h" 10 | #import "UIView+CSS.h" 11 | #import "NSObject+CSS.h" 12 | @implementation CSSSampleViewController 13 | @synthesize sampleView; 14 | 15 | - (void)dealloc 16 | { 17 | [sampleView release]; 18 | [super dealloc]; 19 | } 20 | 21 | - (void)didReceiveMemoryWarning 22 | { 23 | // Releases the view if it doesn't have a superview. 24 | [super didReceiveMemoryWarning]; 25 | 26 | // Release any cached data, images, etc that aren't in use. 27 | } 28 | 29 | #pragma mark - View lifecycle 30 | 31 | 32 | // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. 33 | - (void)viewDidLoad 34 | { 35 | [super viewDidLoad]; 36 | 37 | NSURL *cssURL; 38 | 39 | cssURL = [[NSBundle mainBundle] URLForResource:@"maintest" 40 | withExtension:@"css" 41 | ]; 42 | 43 | [[self view] apply:[CSSStyleSheet styleSheetFromURL:cssURL]]; 44 | 45 | } 46 | 47 | 48 | - (void)viewDidUnload 49 | { 50 | [self setSampleView:nil]; 51 | [super viewDidUnload]; 52 | // Release any retained subviews of the main view. 53 | // e.g. self.myOutlet = nil; 54 | } 55 | 56 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 57 | { 58 | // Return YES for supported orientations 59 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 60 | } 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /Tests/CSSViewSelectorTest.m: -------------------------------------------------------------------------------- 1 | // 2 | // CSSViewSelectorTest.m 3 | // CSSSample 4 | // 5 | // Created by Jonathan Dalrymple on 16/07/2011. 6 | // Copyright 2011 Float:Right Ltd. All rights reserved. 7 | // 8 | 9 | #import "CSSViewSelectorTest.h" 10 | #import "NSObject+CSS.h" 11 | #import "UIView+CSS.h" 12 | 13 | @implementation CSSViewSelectorTest 14 | 15 | 16 | 17 | 18 | -(void) setUp{ 19 | 20 | //Build a view tree 21 | _testView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 500.0f, 500.0f)]; 22 | 23 | //Create a bunch of the class ids 24 | NSArray *classIDs = [NSArray arrayWithObjects:@"foo",@"bar",@"foobar", nil]; 25 | 26 | [classIDs enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { 27 | 28 | UIView *child = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 200.0f, 200.f)]; 29 | 30 | [child setCSSID:obj]; 31 | 32 | [_testView addSubview:child]; 33 | 34 | [child release]; 35 | 36 | }]; 37 | 38 | } 39 | 40 | -(void) tearDown{ 41 | [_testView release]; 42 | _testView = nil; 43 | } 44 | 45 | -(void) testSubviews{ 46 | 47 | int count; 48 | 49 | count = [[_testView subviews] count]; 50 | 51 | GHAssertTrue( count == 3, @"Subview count %d", count); 52 | } 53 | 54 | -(void) testSelector{ 55 | 56 | NSSet *results; 57 | int count = 0; 58 | 59 | [_testView apply:[CSSStyleSheet styleSheetFromString:@"*{background-color:black}"]]; 60 | 61 | results = [[_testView subviews] valueForKeyPath:@"backgroundColor"]; 62 | 63 | NSLog(@"%@",results); 64 | 65 | count = [results count]; 66 | 67 | //GHAssertTrue( count == 1, @"Invalid count %d",count); 68 | 69 | //GHAssertEqualObjects([results anyObject], [UIColor blackColor], @"Not the same color"); 70 | 71 | } 72 | 73 | @end 74 | -------------------------------------------------------------------------------- /CSSStyleSheet.h: -------------------------------------------------------------------------------- 1 | // 2 | // CSSStyleSheet.h 3 | // CSSSample 4 | // 5 | // Created by Sam Stewart on 7/16/11. 6 | // Copyright 2011 Float:Right Ltd. All rights reserved. 7 | // 8 | /** 9 | Represents css style sheet which has been parsed and loaded into our custom format. 10 | 11 | Each rule is represented backwards and we only split on descendants (not on class). For example you might have ul div.red#hello which would turn into 12 | div.red#hello -> ul 13 | 14 | Most specific to least specific. This setup allows us to ensure the correct properties take precendence and generally makes everything simpler. 15 | 16 | The tree is maintained via the {@link CSSSelectorTree} data structure. 17 | 18 | Searching 19 | --------- 20 | When we search, we do a special type of fuzzy compare. Remember that a css selector can match just a few of the css classes you conform to. 21 | For example, a selector could be red.green and you have the classes "red", "green", and "blue" so the original selector would still match you. 22 | 23 | .red#hello -> ul 24 | 25 | The actual "apply" method on the UIView does the comparison but CSSSelectors know how to compare to each other. 26 | */ 27 | #import 28 | #import "CSSParser.h" 29 | #import "CSSSelector.h" 30 | #import "CSSSelectorTree.h" 31 | 32 | @interface CSSStyleSheet : NSObject { 33 | 34 | CSSParser *parser; 35 | 36 | CSSSelectorTree *_root; 37 | } 38 | 39 | - (void)loadFromURL:(NSURL*)url; 40 | - (void)loadFromString:(NSString*)css_code; 41 | 42 | 43 | //convenience methods 44 | + (CSSStyleSheet*)styleSheetFromURL:(NSURL*)url; 45 | + (CSSStyleSheet*)styleSheetFromString:(NSString*)css_code; 46 | 47 | @property (nonatomic, readonly) CSSSelectorTree *root; 48 | @end 49 | -------------------------------------------------------------------------------- /Tests/CSSObjectCategoryTest.m: -------------------------------------------------------------------------------- 1 | // 2 | // CSSViewTests.m 3 | // CSSSample 4 | // 5 | // Created by Jonathan Dalrymple on 16/07/2011. 6 | // Copyright 2011 Float:Right Ltd. All rights reserved. 7 | // 8 | 9 | #import "CSSObjectCategoryTest.h" 10 | #import "UIView+CSS.h" 11 | 12 | @implementation CSSObjectCategoryTest 13 | 14 | -(void) setUp{ 15 | _testView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 320.0f, 320.f)]; 16 | } 17 | 18 | -(void) tearDown{ 19 | [_testView release]; 20 | _testView = nil; 21 | } 22 | 23 | -(void) testView{ 24 | GHAssertNotNil(_testView, @"Test view is nil"); 25 | } 26 | 27 | -(void) testSetClassName{ 28 | 29 | int count = 0; 30 | 31 | //Initial 32 | [_testView addCSSClassName:@"foo"]; 33 | 34 | count = [[_testView CSSClassNames] count]; 35 | 36 | GHAssertTrue( count == 1, @"Count = %d instead of 1",count); 37 | 38 | //Duplicates 39 | [_testView addCSSClassName:@"foo"]; 40 | 41 | count = [[_testView CSSClassNames] count]; 42 | 43 | GHAssertTrue( count == 1, @"Count = %d instead of 1",count); 44 | 45 | //+1 46 | [_testView addCSSClassName:@"bar"]; 47 | 48 | count = [[_testView CSSClassNames] count]; 49 | 50 | GHAssertTrue( count == 2, @"Count = %d instead of 1",count); 51 | } 52 | 53 | -(void) testRemoveClassName{ 54 | 55 | int count = INT16_MAX; 56 | 57 | //add 58 | [_testView addCSSClassName:@"foo"]; 59 | 60 | count = [[_testView CSSClassNames] count]; 61 | 62 | GHAssertTrue( count == 1, @"Count = %d instead of 1",count); 63 | 64 | //remove 65 | [_testView removeCSSClassName:@"foo"]; 66 | 67 | count = [[_testView CSSClassNames] count]; 68 | 69 | GHAssertTrue( count == 0, @"Count = %d instead of 1",count); 70 | } 71 | 72 | -(void) testBasicSelector{ 73 | 74 | } 75 | 76 | -(void) testSelector{ 77 | 78 | } 79 | 80 | @end 81 | -------------------------------------------------------------------------------- /CSSSelector.h: -------------------------------------------------------------------------------- 1 | // 2 | // CSSSelector.h 3 | // CSSSample 4 | // 5 | // Created by Sam Stewart on 7/16/11. 6 | // Copyright 2011 Float:Right Ltd. All rights reserved. 7 | // 8 | /** 9 | This class represents a CSS selector but only the last component or "slug". We discard all the levels (e.g. "ul ul li") 10 | and just use the ending selector. This allows us to parse more appropriate information such as css class name, css id tag, etc. 11 | 12 | */ 13 | #import 14 | 15 | 16 | @interface CSSSelector : NSObject { 17 | NSString *selector; 18 | NSString *cssID; 19 | 20 | // css class name (like div, ul, li, etc) 21 | NSString *className; 22 | // custom classes we defined (.ourclass,.customclass, ect) 23 | NSMutableArray *classes; 24 | } 25 | 26 | - (id)initWithSelectorStr:(NSString*)selector; 27 | 28 | - (id)initWithClassName:(NSString*)aClassName classNames:(NSSet*)aClassNames classID:(NSString*)aCssID; 29 | 30 | /** Returns the components of the the selector (including the slug). 31 | * The components which are separated by spaces (mainly descendant selectors). 32 | */ 33 | - (NSArray*)selectorComponents; 34 | 35 | /** Checks to see if we partially/fully match the specified selector. Sort of a fuzzy matcher.*/ 36 | - (BOOL)doesMatchIntoSelector:(CSSSelector*)selector; 37 | 38 | /** Convenience method to break long string (with mul sub selectors) into multiple small sub selectors.*/ 39 | + (NSArray*)subSelectorsFromString:(NSString*)main_selector; 40 | 41 | /** The classes which are applied to use.*/ 42 | @property (nonatomic, readonly) NSMutableArray *classes; 43 | @property (nonatomic, readonly) NSString *cssID; 44 | @property (nonatomic, readonly) NSString *className; 45 | @property (nonatomic, readonly) NSString *selector; 46 | //@property (nonatomic, readonly) NSString * 47 | @property (readonly) NSInteger score; 48 | @end 49 | -------------------------------------------------------------------------------- /NSObject+CSS.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+CSS.m 3 | // CSSSample 4 | // 5 | // Created by Jonathan Dalrymple on 16/07/2011. 6 | // Copyright 2011 Float:Right Ltd. All rights reserved. 7 | // 8 | 9 | #import "NSObject+CSS.h" 10 | #import 11 | 12 | static const char* kUIViewIDNameKey = "UIViewCSSIDNameKey"; 13 | static const char* kUIViewClassNameKey = "UIViewCSSClassNameKey"; 14 | static const char* kUIViewCSSSelectorKey = "UIViewCSSSelectorKey"; 15 | 16 | @implementation NSObject (CSS) 17 | 18 | @dynamic CSSID, CSSClassNames, CSSSelector; 19 | 20 | #pragma mark - ID & Class names 21 | 22 | /** 23 | * Set class names 24 | * @param a NSSet 25 | */ 26 | -(void) setCSSClassNames:(NSSet*) aClassName{ 27 | objc_setAssociatedObject(self, &kUIViewClassNameKey, aClassName, OBJC_ASSOCIATION_COPY_NONATOMIC); 28 | } 29 | 30 | /** 31 | * Class names 32 | * 33 | * @return NSSet 34 | */ 35 | -(NSSet*) CSSClassNames{ 36 | return objc_getAssociatedObject(self, &kUIViewClassNameKey); 37 | } 38 | 39 | 40 | /** 41 | * set the view's id 42 | * @param an id name 43 | */ 44 | -(void) setCSSID:(NSString*) anIDName{ 45 | objc_setAssociatedObject(self, &kUIViewIDNameKey, anIDName, OBJC_ASSOCIATION_COPY_NONATOMIC ); 46 | } 47 | 48 | /** 49 | * Get the view's id name 50 | * @return an id name 51 | */ 52 | -(NSString*) CSSID{ 53 | return (NSString*) objc_getAssociatedObject(self, &kUIViewIDNameKey); 54 | } 55 | 56 | 57 | -(CSSSelector*)CSSSelector { 58 | CSSSelector *selector = (CSSSelector*) objc_getAssociatedObject(self, &kUIViewCSSSelectorKey); 59 | 60 | if (!selector) 61 | { 62 | selector = [[CSSSelector alloc] initWithClassName:NSStringFromClass([self class]) 63 | classNames:[self CSSClassNames] 64 | classID:[self CSSID] 65 | ]; 66 | 67 | objc_setAssociatedObject(self, &kUIViewCSSSelectorKey, selector, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 68 | } 69 | 70 | return selector; 71 | } 72 | 73 | @end 74 | -------------------------------------------------------------------------------- /CSSSelectorTree.h: -------------------------------------------------------------------------------- 1 | // 2 | // CSSSelectorTree.h 3 | // CSSSample 4 | // 5 | // Created by Sam Stewart on 7/16/11. 6 | // Copyright 2011 Float:Right Ltd. All rights reserved. 7 | // 8 | // sam red.green#hello 9 | // red -> .green 10 | // #hello 11 | // 12 | // stewart sam red.green#hello 13 | // stew mark red.green#hello 14 | // red.green#hello -> sam -> stewart 15 | // -> sam.mark -> stew 16 | // red.green#hello -> lisa -> stewart 17 | // red.green#hello -> sam 18 | // red.green#hello -> sam 19 | // 20 | 21 | // red green blue 22 | 23 | /** 24 | @class CSSSelectorTree 25 | This is a custom data structure which manages a css selector tree. It allows you to lookup views in the tree 26 | according to their selectors. Each level is caused by a space in a css selector (which represents a descendant relationship) 27 | at each level we have a CSSSelector which contains a variety of properties (like classes, id, tag type) and a list of child 28 | nodes. 29 | 30 | We also track our score for the current level (precendence) and a special subnode called "All" which represents the "base" ruleset 31 | for the current subnode. 32 | */ 33 | #import 34 | #import "CSSSelector.h" 35 | 36 | @interface CSSSelectorTree : NSObject { 37 | //array of CSSSelectorTrees 38 | NSMutableArray *nodes; 39 | 40 | NSDictionary *rules; 41 | CSSSelector *selector; 42 | } 43 | 44 | @property (readonly, nonatomic) NSString *name; 45 | @property (readonly, nonatomic) CSSSelector *selector; 46 | @property (retain, nonatomic) NSDictionary *rules; 47 | // array of CSSSelectoreTree subnodes 48 | @property (readonly, nonatomic) NSMutableArray *nodes; 49 | @property (readonly, nonatomic) NSInteger score; 50 | 51 | - (void)sortNodes; 52 | 53 | - (id)initWithSelector:(CSSSelector*)selector; 54 | 55 | - (NSArray*)find:(CSSSelector*)selector_arg; 56 | 57 | - (BOOL)isLeaf; 58 | /** Utility method to wrap a list of CSS Selectors after parsing and breaking 59 | up this large multi level selector. 60 | Returns an array in reverse order of specificity.*/ 61 | + (NSArray*)subtreesFromSelector:(NSString*)selector; 62 | 63 | /** Links array of CSSTreeSelectors together by each other (like linked list). 64 | It's expected that they are sorted from most specific to least specific. 65 | Returns the root node of the new "subtree".*/ 66 | + (CSSSelectorTree*)chainSubtrees:(NSArray*)subtrees; 67 | @end 68 | -------------------------------------------------------------------------------- /Tests/TestsAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // TestsAppDelegate.m 3 | // Tests 4 | // 5 | // Created by Jonathan Dalrymple on 16/07/2011. 6 | // Copyright 2011 Float:Right Ltd. All rights reserved. 7 | // 8 | 9 | #import "TestsAppDelegate.h" 10 | 11 | @implementation TestsAppDelegate 12 | 13 | 14 | @synthesize window=_window; 15 | 16 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 17 | { 18 | // Override point for customization after application launch. 19 | [self.window makeKeyAndVisible]; 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application 24 | { 25 | /* 26 | Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 27 | Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 28 | */ 29 | } 30 | 31 | - (void)applicationDidEnterBackground:(UIApplication *)application 32 | { 33 | /* 34 | Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 35 | If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 36 | */ 37 | } 38 | 39 | - (void)applicationWillEnterForeground:(UIApplication *)application 40 | { 41 | /* 42 | Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 43 | */ 44 | } 45 | 46 | - (void)applicationDidBecomeActive:(UIApplication *)application 47 | { 48 | /* 49 | Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 50 | */ 51 | } 52 | 53 | - (void)applicationWillTerminate:(UIApplication *)application 54 | { 55 | /* 56 | Called when the application is about to terminate. 57 | Save data if appropriate. 58 | See also applicationDidEnterBackground:. 59 | */ 60 | } 61 | 62 | - (void)dealloc 63 | { 64 | [_window release]; 65 | [super dealloc]; 66 | } 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /CSSStyleSheet.m: -------------------------------------------------------------------------------- 1 | // 2 | // CSSStyleSheet.m 3 | // CSSSample 4 | // 5 | // Created by Sam Stewart on 7/16/11. 6 | // Copyright 2011 Float:Right Ltd. All rights reserved. 7 | // 8 | 9 | #import "CSSStyleSheet.h" 10 | #import "CSSParser.h" 11 | 12 | @interface CSSStyleSheet () 13 | - (void)buildTree:(NSDictionary*)rules; 14 | @end 15 | 16 | @implementation CSSStyleSheet 17 | @synthesize root = _root; 18 | #pragma mark Loader Methods 19 | 20 | + (CSSStyleSheet*)styleSheetFromURL:(NSURL *)url { 21 | CSSStyleSheet *sheet = [[[CSSStyleSheet alloc] init] autorelease]; 22 | [sheet loadFromURL:url]; 23 | return sheet; 24 | } 25 | 26 | + (CSSStyleSheet*)styleSheetFromString:(NSString *)css_code { 27 | //TODO: load and parse from string 28 | return nil; 29 | } 30 | 31 | - (void)loadFromURL:(NSURL*)url { 32 | if (parser) 33 | [parser release], parser = nil; 34 | parser = [[CSSParser alloc] init]; 35 | 36 | // grab the entire file and load the rule dictionary. 37 | NSDictionary *rules = [parser parseFilename:[url path]]; 38 | 39 | //build the tree from the parsed rules 40 | [self buildTree:rules]; 41 | } 42 | 43 | - (void)loadFromString:(NSString *)css_code { 44 | //TODO: load from string (need it in the parser class.) 45 | } 46 | 47 | #pragma mark Tree Parsing methods 48 | - (void)buildTree:(NSDictionary *)rules { 49 | if (_root) [_root release], _root = nil; 50 | 51 | // create the root node for the selector tree 52 | _root = [[CSSSelectorTree alloc] init]; 53 | 54 | NSArray *selectors = [rules allKeys]; 55 | 56 | for (NSString *selector in selectors) { 57 | 58 | NSDictionary *ruleset = [rules objectForKey:selector]; 59 | 60 | //grab subtrees (really horizontal list since they are sublevels.) 61 | // ul, ul, li, sam.red#hello 62 | NSArray *subtrees = [CSSSelectorTree subtreesFromSelector:selector]; 63 | 64 | if ([subtrees count] < 1) 65 | return; 66 | 67 | //ruleset belongs to most specific (or first) 68 | CSSSelectorTree *most_specific = [subtrees objectAtIndex:0]; 69 | most_specific.rules = ruleset; 70 | 71 | //now we convert into tree 72 | CSSSelectorTree *root_subtree = [CSSSelectorTree chainSubtrees:subtrees]; 73 | [_root.nodes addObject:root_subtree]; 74 | } 75 | } 76 | 77 | - (void)dealloc { 78 | [super dealloc]; 79 | [parser release], parser = nil; 80 | [_root release], _root = nil; 81 | } 82 | @end 83 | -------------------------------------------------------------------------------- /CSSSample/CSSSampleAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // CSSSampleAppDelegate.m 3 | // CSSSample 4 | // 5 | // Created by Jonathan Dalrymple on 16/07/2011. 6 | // Copyright 2011 Float:Right Ltd. All rights reserved. 7 | // 8 | 9 | #import "CSSSampleAppDelegate.h" 10 | 11 | #import "CSSSampleViewController.h" 12 | 13 | #import "CSSParser.h" 14 | 15 | @implementation CSSSampleAppDelegate 16 | 17 | 18 | @synthesize window=_window; 19 | 20 | @synthesize viewController=_viewController; 21 | 22 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 23 | { 24 | // Override point for customization after application launch. 25 | 26 | //CSSParser *parser = [[CSSParser alloc] init]; 27 | //NSLog(@"%@",[parser parseFilename:[[[NSBundle mainBundle] bundlePath]stringByAppendingPathComponent:@"testcase.css"]]); 28 | 29 | self.window.rootViewController = self.viewController; 30 | [self.window makeKeyAndVisible]; 31 | return YES; 32 | } 33 | 34 | - (void)applicationWillResignActive:(UIApplication *)application 35 | { 36 | /* 37 | Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 38 | Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 39 | */ 40 | } 41 | 42 | - (void)applicationDidEnterBackground:(UIApplication *)application 43 | { 44 | /* 45 | Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 46 | If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 47 | */ 48 | } 49 | 50 | - (void)applicationWillEnterForeground:(UIApplication *)application 51 | { 52 | /* 53 | Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 54 | */ 55 | } 56 | 57 | - (void)applicationDidBecomeActive:(UIApplication *)application 58 | { 59 | /* 60 | Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 61 | */ 62 | } 63 | 64 | - (void)applicationWillTerminate:(UIApplication *)application 65 | { 66 | /* 67 | Called when the application is about to terminate. 68 | Save data if appropriate. 69 | See also applicationDidEnterBackground:. 70 | */ 71 | } 72 | 73 | - (void)dealloc 74 | { 75 | [_window release]; 76 | [_viewController release]; 77 | [super dealloc]; 78 | } 79 | 80 | @end 81 | -------------------------------------------------------------------------------- /GHUnitIOSTestMain.m: -------------------------------------------------------------------------------- 1 | // 2 | // GHUnitIOSTestMain.m 3 | // GHUnitIPhone 4 | // 5 | // Created by Gabriel Handford on 1/25/09. 6 | // Copyright 2009. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | #import 31 | 32 | // If you are using the framework 33 | #import 34 | // If you are using the static library and importing header files manually 35 | //#import "GHUnit.h" 36 | 37 | // Default exception handler 38 | void exceptionHandler(NSException *exception) { 39 | NSLog(@"%@\n%@", [exception reason], GHUStackTraceFromException(exception)); 40 | } 41 | 42 | int main(int argc, char *argv[]) { 43 | 44 | /*! 45 | For debugging: 46 | Go into the "Get Info" contextual menu of your (test) executable (inside the "Executables" group in the left panel of XCode). 47 | Then go in the "Arguments" tab. You can add the following environment variables: 48 | 49 | Default: Set to: 50 | NSDebugEnabled NO "YES" 51 | NSZombieEnabled NO "YES" 52 | NSDeallocateZombies NO "YES" 53 | NSHangOnUncaughtException NO "YES" 54 | 55 | NSEnableAutoreleasePool YES "NO" 56 | NSAutoreleaseFreedObjectCheckEnabled NO "YES" 57 | NSAutoreleaseHighWaterMark 0 non-negative integer 58 | NSAutoreleaseHighWaterResolution 0 non-negative integer 59 | 60 | For info on these varaiables see NSDebug.h; http://theshadow.uw.hu/iPhoneSDKdoc/Foundation.framework/NSDebug.h.html 61 | 62 | For malloc debugging see: http://developer.apple.com/mac/library/documentation/Performance/Conceptual/ManagingMemory/Articles/MallocDebug.html 63 | */ 64 | 65 | NSSetUncaughtExceptionHandler(&exceptionHandler); 66 | 67 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 68 | 69 | // Register any special test case classes 70 | //[[GHTesting sharedInstance] registerClassName:@"GHSpecialTestCase"]; 71 | 72 | int retVal = UIApplicationMain(argc, argv, nil, @"GHUnitIPhoneAppDelegate"); 73 | 74 | [pool release]; 75 | return retVal; 76 | } 77 | -------------------------------------------------------------------------------- /lex/mcss.grammer: -------------------------------------------------------------------------------- 1 | %option yylineno 2 | %option nounput 3 | %option case-insensitive 4 | %option outfile="css.m" header-file="css.h" 5 | 6 | h [0-9a-f] 7 | nonascii [\200-\377] 8 | unicode \\{h}{1,6}[ \t\r\n\f]? 9 | escape {unicode}|\\[ -~\200-\377] 10 | nmstart [a-z]|{nonascii}|{escape} 11 | nmchar [a-z0-9-]|{nonascii}|{escape} 12 | nmchars [. a-z0-9-]|{nonascii}|{escape} 13 | string1 \"([\t !#$%&(-~]|\\{nl}|\'|{nonascii}|{escape})*\" 14 | string2 \'([\t !#$%&(-~]|\\{nl}|\"|{nonascii}|{escape})*\' 15 | 16 | ident [-]?{nmstart}{nmchars}* 17 | name {nmchar}+ 18 | num [-]?[0-9]+|[-]?[0-9]*"."[0-9]+ 19 | string {string1}|{string2} 20 | url ([!#$%&*-~]|{nonascii}|{escape})* 21 | w [ \t\r\n\f]* 22 | nl \n|\r\n|\r|\f 23 | range \?{1,6}|{h}(\?{0,5}|{h}(\?{0,4}|{h}(\?{0,3}|{h}(\?{0,2}|{h}(\??|{h}))))) 24 | 25 | %% 26 | 27 | [ \t\r\n\f]+ 28 | 29 | \/\*[^*]*\*+([^/][^*]*\*+)*\/ /* ignore comments */ 30 | 31 | "" 33 | "~=" 34 | "|=" 35 | 36 | {string} {cssConsume(yytext, CSSSTRING);} 37 | 38 | {ident}(:{ident})? {cssConsume(yytext, CSSIDENT);} 39 | 40 | "#"{name} {cssConsume(yytext, CSSHASH);} 41 | 42 | "@import" 43 | "@page" 44 | "@media" 45 | "@font-face" 46 | "@charset" 47 | "@namespace" 48 | 49 | "!{w}important" 50 | 51 | {num}em {cssConsume(yytext, CSSEMS);} 52 | {num}ex {cssConsume(yytext, CSSEXS);} 53 | {num}px {cssConsume(yytext, CSSLENGTH);} 54 | {num}cm {cssConsume(yytext, CSSLENGTH);} 55 | {num}mm {cssConsume(yytext, CSSLENGTH);} 56 | {num}in {cssConsume(yytext, CSSLENGTH);} 57 | {num}pt {cssConsume(yytext, CSSLENGTH);} 58 | {num}pc {cssConsume(yytext, CSSLENGTH);} 59 | {num}deg {cssConsume(yytext, CSSANGLE);} 60 | {num}rad {cssConsume(yytext, CSSANGLE);} 61 | {num}grad {cssConsume(yytext, CSSANGLE);} 62 | {num}ms {cssConsume(yytext, CSSTIME);} 63 | {num}s {cssConsume(yytext, CSSTIME);} 64 | {num}Hz {cssConsume(yytext, CSSFREQ);} 65 | {num}kHz {cssConsume(yytext, CSSFREQ);} 66 | {num}{ident} {cssConsume(yytext, CSSDIMEN);} 67 | {num}% {cssConsume(yytext, CSSPERCENTAGE);} 68 | {num} {cssConsume(yytext, CSSNUMBER);} 69 | 70 | "url("{w}{string}{w}")" {cssConsume(yytext, CSSURI);} 71 | "url("{w}{url}{w}")" {cssConsume(yytext, CSSURI);} 72 | {ident}"(" {cssConsume(yytext, CSSFUNCTION);} 73 | 74 | U\+{range} {cssConsume(yytext, CSSUNICODERANGE);} 75 | U\+{h}{1,6}-{h}{1,6} {cssConsume(yytext, CSSUNICODERANGE);} 76 | 77 | . {cssConsume(yytext, CSSUNKNOWN);} 78 | 79 | %% 80 | 81 | int csswrap(void){return 1;} -------------------------------------------------------------------------------- /lex/css.grammer: -------------------------------------------------------------------------------- 1 | h [0-9a-f] 2 | nonascii [\240-\377] 3 | unicode \\{h}{1,6}(\r\n|[ \t\r\n\f])? 4 | escape {unicode}|\\[^\r\n\f0-9a-f] 5 | nmstart [_a-z]|{nonascii}|{escape} 6 | nmchar [_a-z0-9-]|{nonascii}|{escape} 7 | string1 \"([^\n\r\f\\"]|\\{nl}|{escape})*\" 8 | string2 \'([^\n\r\f\\']|\\{nl}|{escape})*\' 9 | badstring1 \"([^\n\r\f\\"]|\\{nl}|{escape})*\\? 10 | badstring2 \'([^\n\r\f\\']|\\{nl}|{escape})*\\? 11 | badcomment1 \/\*[^*]*\*+([^/*][^*]*\*+)* 12 | badcomment2 \/\*[^*]*(\*+[^/*][^*]*)* 13 | baduri1 url\({w}([!#$%&*-\[\]-~]|{nonascii}|{escape})*{w} 14 | baduri2 url\({w}{string}{w} 15 | baduri3 url\({w}{badstring} 16 | comment \/\*[^*]*\*+([^/*][^*]*\*+)*\/ 17 | ident -?{nmstart}{nmchar}* 18 | name {nmchar}+ 19 | num [0-9]+|[0-9]*"."[0-9]+ 20 | string {string1}|{string2} 21 | badstring {badstring1}|{badstring2} 22 | badcomment {badcomment1}|{badcomment2} 23 | baduri {baduri1}|{baduri2}|{baduri3} 24 | url ([!#$%&*-~]|{nonascii}|{escape})* 25 | s [ \t\r\n\f]+ 26 | w {s}? 27 | nl \n|\r\n|\r|\f 28 | 29 | A a|\\0{0,4}(41|61)(\r\n|[ \t\r\n\f])? 30 | C c|\\0{0,4}(43|63)(\r\n|[ \t\r\n\f])? 31 | D d|\\0{0,4}(44|64)(\r\n|[ \t\r\n\f])? 32 | E e|\\0{0,4}(45|65)(\r\n|[ \t\r\n\f])? 33 | G g|\\0{0,4}(47|67)(\r\n|[ \t\r\n\f])?|\\g 34 | H h|\\0{0,4}(48|68)(\r\n|[ \t\r\n\f])?|\\h 35 | I i|\\0{0,4}(49|69)(\r\n|[ \t\r\n\f])?|\\i 36 | K k|\\0{0,4}(4b|6b)(\r\n|[ \t\r\n\f])?|\\k 37 | L l|\\0{0,4}(4c|6c)(\r\n|[ \t\r\n\f])?|\\l 38 | M m|\\0{0,4}(4d|6d)(\r\n|[ \t\r\n\f])?|\\m 39 | N n|\\0{0,4}(4e|6e)(\r\n|[ \t\r\n\f])?|\\n 40 | O o|\\0{0,4}(4f|6f)(\r\n|[ \t\r\n\f])?|\\o 41 | P p|\\0{0,4}(50|70)(\r\n|[ \t\r\n\f])?|\\p 42 | R r|\\0{0,4}(52|72)(\r\n|[ \t\r\n\f])?|\\r 43 | S s|\\0{0,4}(53|73)(\r\n|[ \t\r\n\f])?|\\s 44 | T t|\\0{0,4}(54|74)(\r\n|[ \t\r\n\f])?|\\t 45 | U u|\\0{0,4}(55|75)(\r\n|[ \t\r\n\f])?|\\u 46 | X x|\\0{0,4}(58|78)(\r\n|[ \t\r\n\f])?|\\x 47 | Z z|\\0{0,4}(5a|7a)(\r\n|[ \t\r\n\f])?|\\z 48 | 49 | %% 50 | 51 | {s} //{return S;} 52 | 53 | \/\*[^*]*\*+([^/*][^*]*\*+)*\/ /* ignore comments */ 54 | {badcomment} /* unclosed comment at EOF */ 55 | 56 | "" // {return CDC;} 58 | "~=" // {return INCLUDES;} 59 | "|=" // {return DASHMATCH;} 60 | 61 | {string} {return STRING;} 62 | {badstring} {return BAD_STRING;} 63 | 64 | {ident} {return IDENT;} 65 | 66 | "#"{name} {return HASH;} 67 | 68 | @{I}{M}{P}{O}{R}{T} {return IMPORT_SYM;} 69 | @{P}{A}{G}{E} {return PAGE_SYM;} 70 | @{M}{E}{D}{I}{A} {return MEDIA_SYM;} 71 | "@charset " {return CHARSET_SYM;} 72 | 73 | "!"({w}|{comment})*{I}{M}{P}{O}{R}{T}{A}{N}{T} {return IMPORTANT_SYM;} 74 | 75 | {num}{E}{M} {return EMS;} 76 | {num}{E}{X} {return EXS;} 77 | {num}{P}{X} {return LENGTH;} 78 | {num}{C}{M} {return LENGTH;} 79 | {num}{M}{M} {return LENGTH;} 80 | {num}{I}{N} {return LENGTH;} 81 | {num}{P}{T} {return LENGTH;} 82 | {num}{P}{C} {return LENGTH;} 83 | {num}{D}{E}{G} {return ANGLE;} 84 | {num}{R}{A}{D} {return ANGLE;} 85 | {num}{G}{R}{A}{D} {return ANGLE;} 86 | {num}{M}{S} {return TIME;} 87 | {num}{S} {return TIME;} 88 | {num}{H}{Z} {return FREQ;} 89 | {num}{K}{H}{Z} {return FREQ;} 90 | {num}{ident} {return DIMENSION;} 91 | 92 | {num}% {return PERCENTAGE;} 93 | {num} {return NUMBER;} 94 | 95 | "url("{w}{string}{w}")" {return URI;} 96 | "url("{w}{url}{w}")" {return URI;} 97 | {baduri} {return BAD_URI;} 98 | 99 | {ident}"(" {return FUNCTION;} 100 | 101 | . {return *yytext;} 102 | -------------------------------------------------------------------------------- /CSSSelectorTree.m: -------------------------------------------------------------------------------- 1 | // 2 | // CSSSelectorTree.m 3 | // CSSSample 4 | // 5 | // Created by Sam Stewart on 7/16/11. 6 | // Copyright 2011 Float:Right Ltd. All rights reserved. 7 | // 8 | /** 9 | @class CSSSelectorTree 10 | This custom data structure represents our css tree we inflate after parsing. In fact, it's not really a tree but more of a list of matching "paths". 11 | 12 | An example will hopefully clarify this: 13 | */ 14 | #import "CSSSelectorTree.h" 15 | #import "CSSSelector.h" 16 | 17 | 18 | @implementation CSSSelectorTree 19 | @dynamic score; 20 | @synthesize nodes, rules, selector; 21 | 22 | - (id)initWithSelector:(CSSSelector *)selector_arg { 23 | self = [super init]; 24 | if (self) { 25 | selector = [selector_arg retain]; 26 | } 27 | return self; 28 | } 29 | /** Convenience method for breaking up multi level selector 30 | into multiple smaller selectors wrapped in subtrees. Builds the subtrees in reverse order of specificity.*/ 31 | + (NSArray*)subtreesFromSelector:(NSString *)selector { 32 | NSArray *comps = [selector componentsSeparatedByString:@" "]; 33 | 34 | NSMutableArray *subtrees = [NSMutableArray arrayWithCapacity:20]; 35 | for (NSString *comp in comps) { 36 | CSSSelector *selector = [[CSSSelector alloc] initWithSelectorStr:comp]; 37 | CSSSelectorTree *subtree = [[CSSSelectorTree alloc] initWithSelector:selector]; 38 | 39 | // make sure it's in reverse order. 40 | [subtrees insertObject:subtree atIndex:0]; 41 | } 42 | return subtrees; 43 | } 44 | 45 | + (CSSSelectorTree*)chainSubtrees:(NSArray *)subtrees { 46 | if (![subtrees count]) return nil; 47 | 48 | //start with most specific and begin chaining 49 | CSSSelectorTree *cur_parent = [subtrees objectAtIndex:0]; 50 | CSSSelectorTree *top_parent = cur_parent; 51 | 52 | for (CSSSelectorTree *subtree in subtrees) { 53 | if (subtree != cur_parent) { 54 | [cur_parent.nodes addObject:subtree]; 55 | cur_parent = subtree; //move into subtree 56 | } 57 | } 58 | return top_parent; 59 | } 60 | #pragma mark Accessors 61 | - (void)sortNodes { 62 | [nodes sortUsingComparator:(NSComparator)^(CSSSelector *a_sel, CSSSelector *b_sel) { 63 | NSInteger a_score = [a_sel score]; 64 | NSInteger b_score = [b_sel score]; 65 | 66 | if (a_score < b_score) 67 | return NSOrderedAscending; 68 | else if(a_score > b_score) 69 | return NSOrderedDescending; 70 | else 71 | return NSOrderedSame; 72 | }]; 73 | } 74 | /** Searches subnodes for partial matches for the selector you pass in. 75 | Remember, only a few properties have to match for the entire selector to match. 76 | @return Array of CSSSelectorTree nodes. 77 | */ 78 | - (NSArray*)find:(CSSSelector *)selector_arg { 79 | NSMutableArray *results = [NSMutableArray arrayWithCapacity:20]; 80 | for (CSSSelectorTree *node in nodes) { 81 | if ([node.selector doesMatchIntoSelector:selector_arg]) { 82 | [results addObject:node]; 83 | } 84 | } 85 | return results; 86 | } 87 | 88 | - (BOOL)isLeaf { 89 | return (nodes.count ? NO : YES); 90 | } 91 | - (NSString*)name { 92 | // grab our selector entire selector string.. 93 | return selector.selector; 94 | } 95 | /** Takes the biggest child score to ensure we reflect the child nodes accurately. 96 | Note: this may not be quite right. How do we know we "own" the biggest node?*/ 97 | - (NSInteger)score { 98 | NSInteger max_score = 0; 99 | for (CSSSelectorTree *node in nodes) { 100 | NSInteger score = [node score]; 101 | max_score = (score > max_score ? score : max_score); 102 | } 103 | return max_score; 104 | } 105 | 106 | - (NSMutableArray*)nodes { 107 | 108 | if (!nodes) { 109 | nodes = [[NSMutableArray alloc] initWithCapacity:20]; 110 | } 111 | return nodes; 112 | } 113 | 114 | - (void)dealloc { 115 | [rules release], rules = nil; 116 | [nodes release], nodes = nil; 117 | [selector release], selector = nil; 118 | [super dealloc]; 119 | } 120 | @end 121 | -------------------------------------------------------------------------------- /UIView+CSS.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIVIew+CSS.m 3 | // CSSSample 4 | // 5 | // Created by Jonathan Dalrymple on 16/07/2011. 6 | // Copyright 2011 Float:Right Ltd. All rights reserved. 7 | 8 | #import 9 | #import "UIView+CSS.h" 10 | #import "NSObject+CSS.h" 11 | 12 | @implementation UIView (CSS) 13 | - (void)applyProperties:(NSDictionary*)props { 14 | NSArray *keys = [props allKeys]; 15 | for (NSString *key in keys) { 16 | @try { 17 | [self setValue:[props objectForKey:key] forKeyPath:key]; 18 | } 19 | @catch (NSException *exception) { 20 | NSLog(@"Key does not exist when trying to set from css: %@", [exception reason]); 21 | } 22 | } 23 | } 24 | - (void)applyStylesToChildren:(CSSSelectorTree *)treeNode 25 | withInheirtedStyleDict:(NSDictionary *)mdict 26 | recurse:(BOOL)doRecurse{ 27 | 28 | NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithDictionary:mdict]; 29 | 30 | for (CSSSelectorTree *node in treeNode.nodes) { 31 | //first level is always most specific, do we match? 32 | if ([node.selector doesMatchIntoSelector:self.CSSSelector]) { 33 | 34 | if (node.rules) { 35 | // will replace inherited (as expected) 36 | [dict addEntriesFromDictionary:node.rules]; 37 | } 38 | 39 | // if it has nodes, we need to match upwards in the tree. 40 | if (node.nodes) { 41 | // we need to check if we match all the way up the tree 42 | // we always go all the way to the root bc we do descendant matching not just child matching but descendant 43 | 44 | BOOL doesMatch = YES; 45 | //move through nodes as we move up 46 | NSEnumerator *node_iter = [node.nodes objectEnumerator]; 47 | CSSSelectorTree *subtree = nil; 48 | UIView *parent = nil; 49 | while ((subtree = [node_iter nextObject]) && doesMatch) { 50 | // try to find the appropriate match up the tree 51 | doesMatch = NO; 52 | while ((parent = [self CSSParent])) { 53 | if ([parent.CSSSelector doesMatchIntoSelector:subtree.selector]) { 54 | doesMatch = YES; 55 | //parent will be left where it is on purpose. We don't want rematch a parent. 56 | break; 57 | } 58 | } 59 | } 60 | if (doesMatch) { 61 | //we can now use the style 62 | CSSSelectorTree *tree = [node.nodes objectAtIndex:0]; 63 | if (tree.rules) { 64 | [dict addEntriesFromDictionary:tree.rules]; 65 | } 66 | } 67 | 68 | } 69 | 70 | } 71 | } 72 | [self applyProperties:dict]; 73 | 74 | if (doRecurse) { 75 | //tell all the children to do the rule merging 76 | //also we pass our styles down for inheritance. 77 | [self applyStylesToChildren:treeNode withInheirtedStyleDict:dict recurse:YES]; 78 | } 79 | 80 | } 81 | 82 | 83 | 84 | #pragma mark Actual application methods 85 | //** Applies styles only to this node and doesn't recurse.*/ 86 | - (void)apply:(CSSStyleSheet*)sheet { 87 | [self applyStylesToChildren:[sheet root] withInheirtedStyleDict:[NSDictionary dictionary] recurse:NO]; 88 | 89 | } 90 | - (void)applyAll:(CSSStyleSheet *)sheet { 91 | [self applyStylesToChildren:[sheet root] withInheirtedStyleDict:[NSDictionary dictionary] recurse:YES]; 92 | } 93 | 94 | 95 | 96 | #pragma mark Searching though the "DOM" 97 | /** Searches through the "DOM" for a specific set of subviews specified 98 | by the selector.*/ 99 | - (NSArray*)find:(CSSSelector*)selector { 100 | return nil; 101 | } 102 | - (NSArray*)findAll:(CSSSelector*)selector { 103 | return nil; 104 | } 105 | 106 | -(id) CSSParent{ 107 | return [self superview]; 108 | } 109 | @end 110 | -------------------------------------------------------------------------------- /CSSSelector.m: -------------------------------------------------------------------------------- 1 | // 2 | // CSSSelector.m 3 | // CSSSample 4 | // 5 | // Created by Sam Stewart on 7/16/11. 6 | // Copyright 2011 Float:Right Ltd. All rights reserved. 7 | // 8 | 9 | #import "CSSSelector.h" 10 | @interface CSSSelector () 11 | - (void)parseSelector; 12 | @end 13 | 14 | @implementation CSSSelector 15 | @synthesize cssID, classes, className, selector; 16 | @dynamic score; 17 | 18 | - (id)initWithSelectorStr:(NSString *)selector_arg { 19 | self = [super init]; 20 | if (self) { 21 | selector = [selector_arg retain]; 22 | [self parseSelector]; 23 | } 24 | return self; 25 | } 26 | 27 | - (id)initWithClassName:(NSString*)aClassName classNames:(NSSet*)aClassNames classID:(NSString*)aCssID { 28 | self = [super init]; 29 | if (self) 30 | { 31 | className = [aClassName retain]; 32 | classes = [aClassNames copy]; 33 | cssID = [aCssID retain]; 34 | } 35 | return self; 36 | } 37 | 38 | + (NSArray*)subSelectorsFromString:(NSString *)main_selector { 39 | NSArray *sels = [main_selector componentsSeparatedByString:@" "]; 40 | 41 | NSMutableArray *parsed_sels = [NSMutableArray arrayWithCapacity:30]; 42 | for (NSString *sel in sels) { 43 | CSSSelector *parsed_sel = [[CSSSelector alloc] initWithSelectorStr:sel]; 44 | [parsed_sels addObject:parsed_sel]; 45 | } 46 | return parsed_sels; 47 | } 48 | #pragma mark accessor methods 49 | /** Parses selector string into levels, classes, etc.*/ 50 | - (void)parseSelector { 51 | NSArray *levels = [selector componentsSeparatedByString:@" "]; 52 | 53 | if ([levels count]) { 54 | NSString *slug = [levels lastObject]; 55 | 56 | 57 | NSString *class_slug = nil; 58 | NSString *id_slug = nil; 59 | 60 | // split and try to find ids 61 | NSArray *id_comps = [slug componentsSeparatedByString:@"#"]; 62 | if ([id_comps count] == 2) { 63 | id_slug = [id_comps lastObject]; 64 | if (cssID) [cssID release]; 65 | cssID = id_slug; 66 | 67 | class_slug = [id_comps objectAtIndex:0]; 68 | //might just be id slug 69 | if ([class_slug isEqualToString:@""]) class_slug = nil; 70 | 71 | } else { 72 | class_slug = slug; 73 | } 74 | 75 | //now we parse class slug 76 | if (class_slug) { 77 | NSArray *classes_comps = [class_slug componentsSeparatedByString:@"."]; 78 | NSAssert([classes_comps count], @"Could not parse class slug: %@", class_slug); 79 | 80 | //check to see if first one is class type tag (not css class) 81 | // first entry will not be blank if it's a class tag 82 | // sam.green = "sam", "green" 83 | // .red.green = "", "red", "green" 84 | if (![[classes_comps objectAtIndex:0] isEqualToString:@""]) { 85 | if (className) [className release], className = nil; 86 | className = [classes_comps objectAtIndex:0]; 87 | } else { 88 | if (classes) [classes release], classes = nil; 89 | classes = [[NSMutableArray arrayWithCapacity:20] retain]; 90 | [classes addObjectsFromArray:classes_comps]; 91 | } 92 | } 93 | 94 | 95 | } 96 | } 97 | 98 | - (NSArray*)selectorComponents { 99 | // just split on spaces.. 100 | return [[self description] componentsSeparatedByString:@" "]; 101 | } 102 | 103 | - (BOOL)doesMatchIntoSelector:(CSSSelector *)other_selector { 104 | 105 | 106 | if (self.classes) 107 | { 108 | NSArray *other_classes = other_selector.classes; 109 | for (NSString *class in self.classes) { 110 | if (![other_classes containsObject:class]) 111 | { 112 | return NO; 113 | } 114 | } 115 | } 116 | 117 | // see if the class name doens't match 118 | if (self.className) 119 | { 120 | if (other_selector.className == nil) return NO; 121 | if (![self.className isEqualToString:other_selector.className]) return NO; 122 | } 123 | 124 | // finally see if the id matches (might not...) 125 | if (self.cssID) 126 | { 127 | if (other_selector.cssID == nil) return NO; 128 | if (![self.cssID isEqualToString:other_selector.cssID]) return NO; 129 | } 130 | 131 | return YES; 132 | } 133 | 134 | - (NSString*)description { 135 | return selector; 136 | } 137 | 138 | /** calculates precedence score based on number of classes, ids, etc. 139 | The score is based on the following: 140 | ID are always worth 100 141 | Class are always worth 10 142 | HTML tags (class type tags) are always worth 1. 143 | 144 | Since the score is so simple to calculate, we simply re-run everytime and don't 145 | cache.*/ 146 | - (NSInteger)score { 147 | NSInteger score = 0; 148 | score += (cssID ? 100 : 0); 149 | score += ([classes count] ? [classes count] * 10 : 0); 150 | score += (className ? 1 : 0); 151 | return score; 152 | } 153 | 154 | - (void)dealloc { 155 | 156 | [classes release], classes = nil; 157 | [cssID release], cssID = nil; 158 | [className release], className = nil; 159 | [selector release], selector = nil; 160 | [super dealloc]; 161 | } 162 | @end 163 | -------------------------------------------------------------------------------- /CSSParser.m: -------------------------------------------------------------------------------- 1 | // 2 | // CSSParser.m 3 | // CSSSample 4 | // 5 | // Created by Sam Stewart on 7/16/11. 6 | // Copyright 2011 Float:Right Ltd. All rights reserved. 7 | // 8 | 9 | #import "CSSTokens.h" 10 | #import "css.h" 11 | #import "CSSParser.h" 12 | 13 | typedef enum { 14 | None, 15 | 16 | } ParserStates; 17 | 18 | 19 | // Damn you, flex. Due to the nature of the global methods and whatnot, we can only have one 20 | // parser at any given time. 21 | CSSParser* gActiveParser = nil; 22 | 23 | @interface CSSParser() 24 | 25 | - (void)consumeToken:(int)token text:(char*)text; 26 | 27 | @end 28 | 29 | 30 | int cssConsume(char* text, int token) { 31 | [gActiveParser consumeToken:token text:text]; 32 | 33 | return 0; 34 | } 35 | 36 | 37 | @implementation CSSParser 38 | - (id)init { 39 | self = [super init]; 40 | if (self) { 41 | _ruleSets = [[NSMutableDictionary alloc] init]; 42 | _activeCssSelectors = [[NSMutableArray alloc] init]; 43 | } 44 | 45 | return self; 46 | } 47 | 48 | 49 | - (void)dealloc { 50 | [_ruleSets release],_ruleSets=nil; 51 | [_activeCssSelectors release],_activeCssSelectors=nil; 52 | [_activeRuleSet release],_activeRuleSet=nil; 53 | [_activePropertyName release],_activePropertyName=nil; 54 | [_lastTokenText release],_lastTokenText=nil; 55 | 56 | [super dealloc]; 57 | } 58 | 59 | 60 | - (void)consumeToken:(int)token text:(char*)text { 61 | NSString* string = [[NSString stringWithCString: text 62 | encoding: NSUTF8StringEncoding] lowercaseString]; 63 | NSLog(@" %x : %@",token,string); 64 | 65 | switch (token) { 66 | case CSSHASH: 67 | case CSSIDENT: { 68 | if (_state.Flags.InsideDefinition) { 69 | 70 | // If we're inside a definition then we ignore hashes. 71 | if (CSSHASH != token && !_state.Flags.InsideProperty) { 72 | [_activePropertyName release],_activePropertyName=nil; 73 | _activePropertyName = [string retain]; 74 | 75 | NSMutableArray* values = [[NSMutableArray alloc] init]; 76 | [_activeRuleSet setObject:values forKey:_activePropertyName]; 77 | [values release]; 78 | 79 | } else { 80 | // This is a value, so add it to the active property. 81 | //TTDASSERT(nil != _activePropertyName); 82 | 83 | if (nil != _activePropertyName) { 84 | NSMutableArray* values = [_activeRuleSet objectForKey:_activePropertyName]; 85 | [values addObject:string]; 86 | } 87 | } 88 | 89 | } else { 90 | if (_lastToken == CSSUNKNOWN && [_lastTokenText isEqualToString:@"."]) { 91 | string = [_lastTokenText stringByAppendingString:string]; 92 | } 93 | [_activeCssSelectors addObject:string]; 94 | [_activePropertyName release],_activePropertyName=nil; 95 | } 96 | break; 97 | } 98 | 99 | case CSSFUNCTION: { 100 | if (_state.Flags.InsideProperty) { 101 | _state.Flags.InsideFunction = YES; 102 | 103 | if (nil != _activePropertyName) { 104 | NSMutableArray* values = [_activeRuleSet objectForKey:_activePropertyName]; 105 | [values addObject:string]; 106 | } 107 | } 108 | break; 109 | } 110 | 111 | case CSSSTRING: 112 | case CSSEMS: 113 | case CSSEXS: 114 | case CSSLENGTH: 115 | case CSSANGLE: 116 | case CSSTIME: 117 | case CSSFREQ: 118 | case CSSDIMEN: 119 | case CSSPERCENTAGE: 120 | case CSSNUMBER: 121 | case CSSURI: { 122 | // (nil != _activePropertyName); 123 | 124 | if (nil != _activePropertyName) { 125 | NSMutableArray* values = [_activeRuleSet objectForKey:_activePropertyName]; 126 | [values addObject:string]; 127 | } 128 | break; 129 | } 130 | 131 | case CSSUNKNOWN: { 132 | switch (text[0]) { 133 | case '{': { 134 | _state.Flags.InsideDefinition = YES; 135 | _state.Flags.InsideFunction = NO; 136 | [_activeRuleSet release],_activeRuleSet=nil; 137 | _activeRuleSet = [[NSMutableDictionary alloc] init]; 138 | break; 139 | } 140 | 141 | case '}': { 142 | for (NSString* name in _activeCssSelectors) { 143 | NSMutableDictionary* existingProperties = [_ruleSets objectForKey:name]; 144 | if (nil != existingProperties) { 145 | // Overwrite the properties, instead! 146 | 147 | NSDictionary* iteratorProperties = [_activeRuleSet copy]; 148 | for (NSString* key in iteratorProperties) { 149 | [existingProperties setObject:[_activeRuleSet objectForKey:key] forKey:key]; 150 | } 151 | [iteratorProperties release]; 152 | 153 | } else { 154 | NSMutableDictionary* ruleSet = [_activeRuleSet mutableCopy]; 155 | [_ruleSets setObject:ruleSet forKey:name]; 156 | [ruleSet release]; 157 | } 158 | } 159 | [_activeRuleSet release],_activeRuleSet=nil; 160 | [_activeCssSelectors removeAllObjects]; 161 | _state.Flags.InsideDefinition = NO; 162 | _state.Flags.InsideProperty = NO; 163 | _state.Flags.InsideFunction = NO; 164 | break; 165 | } 166 | 167 | case ':': { 168 | if (_state.Flags.InsideDefinition) { 169 | _state.Flags.InsideProperty = YES; 170 | } 171 | break; 172 | } 173 | 174 | case ')': { 175 | if (_state.Flags.InsideFunction && nil != _activePropertyName) { 176 | NSMutableArray* values = [_activeRuleSet objectForKey:_activePropertyName]; 177 | [values addObject:string]; 178 | } 179 | _state.Flags.InsideFunction = NO; 180 | break; 181 | } 182 | 183 | case ';': { 184 | if (_state.Flags.InsideDefinition) { 185 | _state.Flags.InsideProperty = NO; 186 | } 187 | break; 188 | } 189 | 190 | } 191 | break; 192 | } 193 | } 194 | 195 | [_lastTokenText release]; 196 | _lastTokenText = [string retain]; 197 | _lastToken = token; 198 | } 199 | 200 | #pragma mark - 201 | #pragma mark Public 202 | 203 | 204 | 205 | - (NSDictionary*)parseFilename:(NSString*)filename { 206 | gActiveParser = self; 207 | 208 | [_ruleSets removeAllObjects]; 209 | [_activeCssSelectors removeAllObjects]; 210 | [_activeRuleSet release],_activeRuleSet=nil; 211 | [_activePropertyName release],_activePropertyName=nil; 212 | [_lastTokenText release],_lastTokenText=nil; 213 | 214 | cssin = fopen([filename UTF8String], "r"); 215 | 216 | csslex(); 217 | 218 | fclose(cssin); 219 | 220 | NSDictionary* result = [[_ruleSets copy] autorelease]; 221 | [_ruleSets release],_ruleSets=nil; 222 | return result; 223 | } 224 | 225 | @end 226 | -------------------------------------------------------------------------------- /lex/css.h: -------------------------------------------------------------------------------- 1 | #import "CSSTokens.h" 2 | #ifndef cssHEADER_H 3 | #define cssHEADER_H 1 4 | #define cssIN_HEADER 1 5 | 6 | #line 6 "css.h" 7 | 8 | #define YY_INT_ALIGNED short int 9 | 10 | /* A lexical scanner generated by flex */ 11 | 12 | #define FLEX_SCANNER 13 | #define YY_FLEX_MAJOR_VERSION 2 14 | #define YY_FLEX_MINOR_VERSION 5 15 | #define YY_FLEX_SUBMINOR_VERSION 35 16 | #if YY_FLEX_SUBMINOR_VERSION > 0 17 | #define FLEX_BETA 18 | #endif 19 | 20 | /* First, we deal with platform-specific or compiler-specific issues. */ 21 | 22 | /* begin standard C headers. */ 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | /* end standard C headers. */ 29 | 30 | /* flex integer type definitions */ 31 | 32 | #ifndef FLEXINT_H 33 | #define FLEXINT_H 34 | 35 | /* C99 systems have . Non-C99 systems may or may not. */ 36 | 37 | #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 38 | 39 | /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, 40 | * if you want the limit (max/min) macros for int types. 41 | */ 42 | #ifndef __STDC_LIMIT_MACROS 43 | #define __STDC_LIMIT_MACROS 1 44 | #endif 45 | 46 | #include 47 | typedef int8_t flex_int8_t; 48 | typedef uint8_t flex_uint8_t; 49 | typedef int16_t flex_int16_t; 50 | typedef uint16_t flex_uint16_t; 51 | typedef int32_t flex_int32_t; 52 | typedef uint32_t flex_uint32_t; 53 | #else 54 | typedef signed char flex_int8_t; 55 | typedef short int flex_int16_t; 56 | typedef int flex_int32_t; 57 | typedef unsigned char flex_uint8_t; 58 | typedef unsigned short int flex_uint16_t; 59 | typedef unsigned int flex_uint32_t; 60 | #endif /* ! C99 */ 61 | 62 | /* Limits of integral types. */ 63 | #ifndef INT8_MIN 64 | #define INT8_MIN (-128) 65 | #endif 66 | #ifndef INT16_MIN 67 | #define INT16_MIN (-32767-1) 68 | #endif 69 | #ifndef INT32_MIN 70 | #define INT32_MIN (-2147483647-1) 71 | #endif 72 | #ifndef INT8_MAX 73 | #define INT8_MAX (127) 74 | #endif 75 | #ifndef INT16_MAX 76 | #define INT16_MAX (32767) 77 | #endif 78 | #ifndef INT32_MAX 79 | #define INT32_MAX (2147483647) 80 | #endif 81 | #ifndef UINT8_MAX 82 | #define UINT8_MAX (255U) 83 | #endif 84 | #ifndef UINT16_MAX 85 | #define UINT16_MAX (65535U) 86 | #endif 87 | #ifndef UINT32_MAX 88 | #define UINT32_MAX (4294967295U) 89 | #endif 90 | 91 | #endif /* ! FLEXINT_H */ 92 | 93 | #ifdef __cplusplus 94 | 95 | /* The "const" storage-class-modifier is valid. */ 96 | #define YY_USE_CONST 97 | 98 | #else /* ! __cplusplus */ 99 | 100 | /* C99 requires __STDC__ to be defined as 1. */ 101 | #if defined (__STDC__) 102 | 103 | #define YY_USE_CONST 104 | 105 | #endif /* defined (__STDC__) */ 106 | #endif /* ! __cplusplus */ 107 | 108 | #ifdef YY_USE_CONST 109 | #define yyconst const 110 | #else 111 | #define yyconst 112 | #endif 113 | 114 | /* Size of default input buffer. */ 115 | #ifndef YY_BUF_SIZE 116 | #define YY_BUF_SIZE 16384 117 | #endif 118 | 119 | #ifndef YY_TYPEDEF_YY_BUFFER_STATE 120 | #define YY_TYPEDEF_YY_BUFFER_STATE 121 | typedef struct yy_buffer_state *YY_BUFFER_STATE; 122 | #endif 123 | 124 | extern int cssleng; 125 | 126 | extern FILE *cssin, *cssout; 127 | 128 | #ifndef YY_TYPEDEF_YY_SIZE_T 129 | #define YY_TYPEDEF_YY_SIZE_T 130 | typedef size_t yy_size_t; 131 | #endif 132 | 133 | #ifndef YY_STRUCT_YY_BUFFER_STATE 134 | #define YY_STRUCT_YY_BUFFER_STATE 135 | struct yy_buffer_state 136 | { 137 | FILE *yy_input_file; 138 | 139 | char *yy_ch_buf; /* input buffer */ 140 | char *yy_buf_pos; /* current position in input buffer */ 141 | 142 | /* Size of input buffer in bytes, not including room for EOB 143 | * characters. 144 | */ 145 | yy_size_t yy_buf_size; 146 | 147 | /* Number of characters read into yy_ch_buf, not including EOB 148 | * characters. 149 | */ 150 | int yy_n_chars; 151 | 152 | /* Whether we "own" the buffer - i.e., we know we created it, 153 | * and can realloc() it to grow it, and should free() it to 154 | * delete it. 155 | */ 156 | int yy_is_our_buffer; 157 | 158 | /* Whether this is an "interactive" input source; if so, and 159 | * if we're using stdio for input, then we want to use getc() 160 | * instead of fread(), to make sure we stop fetching input after 161 | * each newline. 162 | */ 163 | int yy_is_interactive; 164 | 165 | /* Whether we're considered to be at the beginning of a line. 166 | * If so, '^' rules will be active on the next match, otherwise 167 | * not. 168 | */ 169 | int yy_at_bol; 170 | 171 | int yy_bs_lineno; /**< The line count. */ 172 | int yy_bs_column; /**< The column count. */ 173 | 174 | /* Whether to try to fill the input buffer when we reach the 175 | * end of it. 176 | */ 177 | int yy_fill_buffer; 178 | 179 | int yy_buffer_status; 180 | 181 | }; 182 | #endif /* !YY_STRUCT_YY_BUFFER_STATE */ 183 | 184 | void cssrestart (FILE *input_file ); 185 | void css_switch_to_buffer (YY_BUFFER_STATE new_buffer ); 186 | YY_BUFFER_STATE css_create_buffer (FILE *file,int size ); 187 | void css_delete_buffer (YY_BUFFER_STATE b ); 188 | void css_flush_buffer (YY_BUFFER_STATE b ); 189 | void csspush_buffer_state (YY_BUFFER_STATE new_buffer ); 190 | void csspop_buffer_state (void ); 191 | 192 | YY_BUFFER_STATE css_scan_buffer (char *base,yy_size_t size ); 193 | YY_BUFFER_STATE css_scan_string (yyconst char *yy_str ); 194 | YY_BUFFER_STATE css_scan_bytes (yyconst char *bytes,int len ); 195 | 196 | void *cssalloc (yy_size_t ); 197 | void *cssrealloc (void *,yy_size_t ); 198 | void cssfree (void * ); 199 | 200 | /* Begin user sect3 */ 201 | 202 | extern int csslineno; 203 | 204 | extern char *csstext; 205 | #define yytext_ptr csstext 206 | 207 | #ifdef YY_HEADER_EXPORT_START_CONDITIONS 208 | #define INITIAL 0 209 | 210 | #endif 211 | 212 | #ifndef YY_NO_UNISTD_H 213 | /* Special case for "unistd.h", since it is non-ANSI. We include it way 214 | * down here because we want the user's section 1 to have been scanned first. 215 | * The user has a chance to override it with an option. 216 | */ 217 | #include 218 | #endif 219 | 220 | #ifndef YY_EXTRA_TYPE 221 | #define YY_EXTRA_TYPE void * 222 | #endif 223 | 224 | /* Accessor methods to globals. 225 | These are made visible to non-reentrant scanners for convenience. */ 226 | 227 | int csslex_destroy (void ); 228 | 229 | int cssget_debug (void ); 230 | 231 | void cssset_debug (int debug_flag ); 232 | 233 | YY_EXTRA_TYPE cssget_extra (void ); 234 | 235 | void cssset_extra (YY_EXTRA_TYPE user_defined ); 236 | 237 | FILE *cssget_in (void ); 238 | 239 | void cssset_in (FILE * in_str ); 240 | 241 | FILE *cssget_out (void ); 242 | 243 | void cssset_out (FILE * out_str ); 244 | 245 | int cssget_leng (void ); 246 | 247 | char *cssget_text (void ); 248 | 249 | int cssget_lineno (void ); 250 | 251 | void cssset_lineno (int line_number ); 252 | 253 | /* Macros after this point can all be overridden by user definitions in 254 | * section 1. 255 | */ 256 | 257 | #ifndef YY_SKIP_YYWRAP 258 | #ifdef __cplusplus 259 | extern "C" int csswrap (void ); 260 | #else 261 | extern int csswrap (void ); 262 | #endif 263 | #endif 264 | 265 | #ifndef yytext_ptr 266 | static void yy_flex_strncpy (char *,yyconst char *,int ); 267 | #endif 268 | 269 | #ifdef YY_NEED_STRLEN 270 | static int yy_flex_strlen (yyconst char * ); 271 | #endif 272 | 273 | #ifndef YY_NO_INPUT 274 | 275 | #endif 276 | 277 | /* Amount of stuff to slurp up with each read. */ 278 | #ifndef YY_READ_BUF_SIZE 279 | #define YY_READ_BUF_SIZE 8192 280 | #endif 281 | 282 | /* Number of entries by which start-condition stack grows. */ 283 | #ifndef YY_START_STACK_INCR 284 | #define YY_START_STACK_INCR 25 285 | #endif 286 | 287 | /* Default declaration of generated scanner - a define so the user can 288 | * easily add parameters. 289 | */ 290 | #ifndef YY_DECL 291 | #define YY_DECL_IS_OURS 1 292 | 293 | extern int csslex (void); 294 | 295 | #define YY_DECL int csslex (void) 296 | #endif /* !YY_DECL */ 297 | 298 | /* yy_get_previous_state - get the state just before the EOB char was reached */ 299 | 300 | #undef YY_NEW_FILE 301 | #undef YY_FLUSH_BUFFER 302 | #undef yy_set_bol 303 | #undef yy_new_buffer 304 | #undef yy_set_interactive 305 | #undef YY_DO_BEFORE_ACTION 306 | 307 | #ifdef YY_DECL_IS_OURS 308 | #undef YY_DECL_IS_OURS 309 | #undef YY_DECL 310 | #endif 311 | 312 | #line 312 "css.h" 313 | #undef cssIN_HEADER 314 | #endif /* cssHEADER_H */ 315 | -------------------------------------------------------------------------------- /CSSSample/en.lproj/CSSSampleViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1072 5 | 10K540 6 | 1306 7 | 1038.36 8 | 461.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 301 12 | 13 | 14 | IBProxyObject 15 | IBUIView 16 | IBUILabel 17 | 18 | 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | PluginDependencyRecalculationVersion 23 | 24 | 25 | 26 | 27 | IBFilesOwner 28 | IBCocoaTouchFramework 29 | 30 | 31 | IBFirstResponder 32 | IBCocoaTouchFramework 33 | 34 | 35 | 36 | 274 37 | 38 | 39 | 40 | 292 41 | 42 | 43 | 44 | 292 45 | {{20, 20}, {100, 100}} 46 | 47 | 48 | 49 | 50 | 1 51 | MSAwLjQzNTI5NDEyMTUgMC44MTE3NjQ3MTcxAA 52 | 53 | NO 54 | YES 55 | 7 56 | NO 57 | IBCocoaTouchFramework 58 | Test View 59 | 60 | Helvetica 61 | 17 62 | 16 63 | 64 | 65 | 1 66 | MCAwIDAAA 67 | 68 | 69 | 1 70 | 10 71 | 1 72 | 73 | 74 | {{90, 160}, {140, 140}} 75 | 76 | 77 | 78 | 1 79 | MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA 80 | 81 | IBCocoaTouchFramework 82 | 83 | 84 | {{0, 20}, {320, 460}} 85 | 86 | 87 | 88 | 89 | 3 90 | MC43NQA 91 | 92 | 2 93 | 94 | 95 | NO 96 | 97 | IBCocoaTouchFramework 98 | 99 | 100 | 101 | 102 | 103 | 104 | view 105 | 106 | 107 | 108 | 7 109 | 110 | 111 | 112 | sampleView 113 | 114 | 115 | 116 | 12 117 | 118 | 119 | 120 | 121 | 122 | 0 123 | 124 | 125 | 126 | 127 | 128 | -1 129 | 130 | 131 | File's Owner 132 | 133 | 134 | -2 135 | 136 | 137 | 138 | 139 | 6 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 13 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 10 156 | 157 | 158 | 159 | 160 | 161 | 162 | CSSSampleViewController 163 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 164 | UIResponder 165 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 166 | 167 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 168 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 169 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 170 | 171 | 172 | 173 | 174 | 175 | 13 176 | 177 | 178 | 179 | 180 | CSSSampleViewController 181 | UIViewController 182 | 183 | sampleView 184 | UILabel 185 | 186 | 187 | sampleView 188 | 189 | sampleView 190 | UILabel 191 | 192 | 193 | 194 | IBProjectSource 195 | ./Classes/CSSSampleViewController.h 196 | 197 | 198 | 199 | 200 | 0 201 | IBCocoaTouchFramework 202 | 203 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 204 | 205 | 206 | 207 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 208 | 209 | 210 | YES 211 | 3 212 | 301 213 | 214 | 215 | -------------------------------------------------------------------------------- /CSSSample/en.lproj/MainWindow.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1024 5 | 10D571 6 | 786 7 | 1038.29 8 | 460.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 112 12 | 13 | 14 | YES 15 | 16 | 17 | 18 | YES 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | YES 23 | 24 | YES 25 | 26 | 27 | YES 28 | 29 | 30 | 31 | YES 32 | 33 | IBFilesOwner 34 | IBCocoaTouchFramework 35 | 36 | 37 | IBFirstResponder 38 | IBCocoaTouchFramework 39 | 40 | 41 | IBCocoaTouchFramework 42 | 43 | 44 | CSSSampleViewController 45 | 46 | 47 | 1 48 | 49 | IBCocoaTouchFramework 50 | NO 51 | 52 | 53 | 54 | 292 55 | {320, 480} 56 | 57 | 1 58 | MSAxIDEAA 59 | 60 | NO 61 | NO 62 | 63 | IBCocoaTouchFramework 64 | YES 65 | 66 | 67 | 68 | 69 | YES 70 | 71 | 72 | delegate 73 | 74 | 75 | 76 | 4 77 | 78 | 79 | 80 | viewController 81 | 82 | 83 | 84 | 11 85 | 86 | 87 | 88 | window 89 | 90 | 91 | 92 | 14 93 | 94 | 95 | 96 | 97 | YES 98 | 99 | 0 100 | 101 | 102 | 103 | 104 | 105 | -1 106 | 107 | 108 | File's Owner 109 | 110 | 111 | 3 112 | 113 | 114 | CSSSample App Delegate 115 | 116 | 117 | -2 118 | 119 | 120 | 121 | 122 | 10 123 | 124 | 125 | 126 | 127 | 12 128 | 129 | 130 | 131 | 132 | 133 | 134 | YES 135 | 136 | YES 137 | -1.CustomClassName 138 | -2.CustomClassName 139 | 10.CustomClassName 140 | 10.IBEditorWindowLastContentRect 141 | 10.IBPluginDependency 142 | 12.IBEditorWindowLastContentRect 143 | 12.IBPluginDependency 144 | 3.CustomClassName 145 | 3.IBPluginDependency 146 | 147 | 148 | YES 149 | UIApplication 150 | UIResponder 151 | CSSSampleViewController 152 | {{234, 376}, {320, 480}} 153 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 154 | {{525, 346}, {320, 480}} 155 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 156 | CSSSampleAppDelegate 157 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 158 | 159 | 160 | 161 | YES 162 | 163 | 164 | YES 165 | 166 | 167 | 168 | 169 | YES 170 | 171 | 172 | YES 173 | 174 | 175 | 176 | 15 177 | 178 | 179 | 180 | YES 181 | 182 | UIWindow 183 | UIView 184 | 185 | IBUserSource 186 | 187 | 188 | 189 | 190 | CSSSampleAppDelegate 191 | NSObject 192 | 193 | YES 194 | 195 | YES 196 | viewController 197 | window 198 | 199 | 200 | YES 201 | CSSSampleViewController 202 | UIWindow 203 | 204 | 205 | 206 | YES 207 | 208 | YES 209 | viewController 210 | window 211 | 212 | 213 | YES 214 | 215 | viewController 216 | CSSSampleViewController 217 | 218 | 219 | window 220 | UIWindow 221 | 222 | 223 | 224 | 225 | IBProjectSource 226 | CSSSampleAppDelegate.h 227 | 228 | 229 | 230 | CSSSampleAppDelegate 231 | NSObject 232 | 233 | IBUserSource 234 | 235 | 236 | 237 | 238 | CSSSampleViewController 239 | UIViewController 240 | 241 | IBProjectSource 242 | CSSSampleViewController.h 243 | 244 | 245 | 246 | 247 | YES 248 | 249 | NSObject 250 | 251 | IBFrameworkSource 252 | Foundation.framework/Headers/NSError.h 253 | 254 | 255 | 256 | NSObject 257 | 258 | IBFrameworkSource 259 | Foundation.framework/Headers/NSFileManager.h 260 | 261 | 262 | 263 | NSObject 264 | 265 | IBFrameworkSource 266 | Foundation.framework/Headers/NSKeyValueCoding.h 267 | 268 | 269 | 270 | NSObject 271 | 272 | IBFrameworkSource 273 | Foundation.framework/Headers/NSKeyValueObserving.h 274 | 275 | 276 | 277 | NSObject 278 | 279 | IBFrameworkSource 280 | Foundation.framework/Headers/NSKeyedArchiver.h 281 | 282 | 283 | 284 | NSObject 285 | 286 | IBFrameworkSource 287 | Foundation.framework/Headers/NSObject.h 288 | 289 | 290 | 291 | NSObject 292 | 293 | IBFrameworkSource 294 | Foundation.framework/Headers/NSRunLoop.h 295 | 296 | 297 | 298 | NSObject 299 | 300 | IBFrameworkSource 301 | Foundation.framework/Headers/NSThread.h 302 | 303 | 304 | 305 | NSObject 306 | 307 | IBFrameworkSource 308 | Foundation.framework/Headers/NSURL.h 309 | 310 | 311 | 312 | NSObject 313 | 314 | IBFrameworkSource 315 | Foundation.framework/Headers/NSURLConnection.h 316 | 317 | 318 | 319 | NSObject 320 | 321 | IBFrameworkSource 322 | UIKit.framework/Headers/UIAccessibility.h 323 | 324 | 325 | 326 | NSObject 327 | 328 | IBFrameworkSource 329 | UIKit.framework/Headers/UINibLoading.h 330 | 331 | 332 | 333 | NSObject 334 | 335 | IBFrameworkSource 336 | UIKit.framework/Headers/UIResponder.h 337 | 338 | 339 | 340 | UIApplication 341 | UIResponder 342 | 343 | IBFrameworkSource 344 | UIKit.framework/Headers/UIApplication.h 345 | 346 | 347 | 348 | UIResponder 349 | NSObject 350 | 351 | 352 | 353 | UISearchBar 354 | UIView 355 | 356 | IBFrameworkSource 357 | UIKit.framework/Headers/UISearchBar.h 358 | 359 | 360 | 361 | UISearchDisplayController 362 | NSObject 363 | 364 | IBFrameworkSource 365 | UIKit.framework/Headers/UISearchDisplayController.h 366 | 367 | 368 | 369 | UIView 370 | 371 | IBFrameworkSource 372 | UIKit.framework/Headers/UITextField.h 373 | 374 | 375 | 376 | UIView 377 | UIResponder 378 | 379 | IBFrameworkSource 380 | UIKit.framework/Headers/UIView.h 381 | 382 | 383 | 384 | UIViewController 385 | 386 | IBFrameworkSource 387 | UIKit.framework/Headers/UINavigationController.h 388 | 389 | 390 | 391 | UIViewController 392 | 393 | IBFrameworkSource 394 | UIKit.framework/Headers/UIPopoverController.h 395 | 396 | 397 | 398 | UIViewController 399 | 400 | IBFrameworkSource 401 | UIKit.framework/Headers/UISplitViewController.h 402 | 403 | 404 | 405 | UIViewController 406 | 407 | IBFrameworkSource 408 | UIKit.framework/Headers/UITabBarController.h 409 | 410 | 411 | 412 | UIViewController 413 | UIResponder 414 | 415 | IBFrameworkSource 416 | UIKit.framework/Headers/UIViewController.h 417 | 418 | 419 | 420 | UIWindow 421 | UIView 422 | 423 | IBFrameworkSource 424 | UIKit.framework/Headers/UIWindow.h 425 | 426 | 427 | 428 | 429 | 0 430 | IBCocoaTouchFramework 431 | 432 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 433 | 434 | 435 | 436 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 437 | 438 | 439 | YES 440 | CSSSample.xcodeproj 441 | 3 442 | 112 443 | 444 | 445 | -------------------------------------------------------------------------------- /CSSSample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1D7B93D313D28E1B00F4AA31 /* UIView+CSS.m in Sources */ = {isa = PBXBuildFile; fileRef = AB5B475113D2272B00FB2A74 /* UIView+CSS.m */; }; 11 | 1D91E74313D29E33009C11F8 /* CSSSelectorTree.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D91E74213D29E33009C11F8 /* CSSSelectorTree.m */; }; 12 | 1DEC908213D262A9005BCF07 /* CSSSelector.m in Sources */ = {isa = PBXBuildFile; fileRef = 1DEC908113D262A8005BCF07 /* CSSSelector.m */; }; 13 | 1DEE03CC13D234FD007C87FE /* CSSResourceManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 1DEE03CB13D234FD007C87FE /* CSSResourceManager.m */; }; 14 | 1DEE03D213D23514007C87FE /* CSSParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 1DEE03D113D23514007C87FE /* CSSParser.m */; }; 15 | 1DEE03D713D235EA007C87FE /* CSSPlistMapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 1DEE03D613D235EA007C87FE /* CSSPlistMapper.m */; }; 16 | 1DEE03DE13D24349007C87FE /* CSSStyleSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = 1DEE03DD13D24349007C87FE /* CSSStyleSheet.m */; }; 17 | AB0ECAE113D25A9F00E151DF /* CALayer+CSS.m in Sources */ = {isa = PBXBuildFile; fileRef = AB0ECAE013D25A9F00E151DF /* CALayer+CSS.m */; }; 18 | AB0ECAE513D25B0A00E151DF /* NSObject+CSS.m in Sources */ = {isa = PBXBuildFile; fileRef = AB0ECAE413D25B0A00E151DF /* NSObject+CSS.m */; }; 19 | AB50CF8913D22017001113D0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB50CF8813D22017001113D0 /* UIKit.framework */; }; 20 | AB50CF8B13D22017001113D0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB50CF8A13D22017001113D0 /* Foundation.framework */; }; 21 | AB50CF8D13D22017001113D0 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB50CF8C13D22017001113D0 /* CoreGraphics.framework */; }; 22 | AB50CF9313D22017001113D0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = AB50CF9113D22017001113D0 /* InfoPlist.strings */; }; 23 | AB50CF9613D22017001113D0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = AB50CF9513D22017001113D0 /* main.m */; }; 24 | AB50CF9913D22017001113D0 /* CSSSampleAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = AB50CF9813D22017001113D0 /* CSSSampleAppDelegate.m */; }; 25 | AB50CF9C13D22017001113D0 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = AB50CF9A13D22017001113D0 /* MainWindow.xib */; }; 26 | AB50CF9F13D22017001113D0 /* CSSSampleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AB50CF9E13D22017001113D0 /* CSSSampleViewController.m */; }; 27 | AB50CFA213D22017001113D0 /* CSSSampleViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = AB50CFA013D22017001113D0 /* CSSSampleViewController.xib */; }; 28 | AB588FBB13D243FE00EC6441 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB50CF8813D22017001113D0 /* UIKit.framework */; }; 29 | AB588FBC13D243FE00EC6441 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB50CF8A13D22017001113D0 /* Foundation.framework */; }; 30 | AB588FBD13D243FE00EC6441 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB50CF8C13D22017001113D0 /* CoreGraphics.framework */; }; 31 | AB588FC313D243FE00EC6441 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = AB588FC113D243FE00EC6441 /* InfoPlist.strings */; }; 32 | AB588FC913D243FE00EC6441 /* TestsAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = AB588FC813D243FE00EC6441 /* TestsAppDelegate.m */; }; 33 | AB588FD013D2441600EC6441 /* GHUnitIOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB588F9713D2412500EC6441 /* GHUnitIOS.framework */; }; 34 | AB588FD113D2442600EC6441 /* GHUnitIOSTestMain.m in Sources */ = {isa = PBXBuildFile; fileRef = AB588F9B13D2427100EC6441 /* GHUnitIOSTestMain.m */; }; 35 | AB588FD513D245A700EC6441 /* CSSObjectCategoryTest.m in Sources */ = {isa = PBXBuildFile; fileRef = AB588FD413D245A700EC6441 /* CSSObjectCategoryTest.m */; }; 36 | AB588FD913D24DB500EC6441 /* CSSViewSelectorTest.m in Sources */ = {isa = PBXBuildFile; fileRef = AB588FD813D24DB500EC6441 /* CSSViewSelectorTest.m */; }; 37 | D9141F5C13D26A4A006B25E0 /* css.m in Sources */ = {isa = PBXBuildFile; fileRef = D9141F5A13D26A4A006B25E0 /* css.m */; }; 38 | D9141F5D13D26A4A006B25E0 /* mcss.grammer in Resources */ = {isa = PBXBuildFile; fileRef = D9141F5B13D26A4A006B25E0 /* mcss.grammer */; }; 39 | D9C27FF313D24CA3000B1A43 /* testcase.css in Resources */ = {isa = PBXBuildFile; fileRef = D9C27FF213D24CA3000B1A43 /* testcase.css */; }; 40 | D9C27FF513D24D2C000B1A43 /* testcase.css in Resources */ = {isa = PBXBuildFile; fileRef = D9C27FF213D24CA3000B1A43 /* testcase.css */; }; 41 | D9C9DBA213D28BE000F34B83 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D9C9DBA113D28BE000F34B83 /* QuartzCore.framework */; }; 42 | D9F5230B13D36EA6003D378D /* maintest.css in Resources */ = {isa = PBXBuildFile; fileRef = D9F5230A13D36EA6003D378D /* maintest.css */; }; 43 | /* End PBXBuildFile section */ 44 | 45 | /* Begin PBXFileReference section */ 46 | 1D91E74113D29E33009C11F8 /* CSSSelectorTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSSelectorTree.h; sourceTree = ""; }; 47 | 1D91E74213D29E33009C11F8 /* CSSSelectorTree.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CSSSelectorTree.m; sourceTree = ""; }; 48 | 1DEC908013D262A8005BCF07 /* CSSSelector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSSelector.h; sourceTree = ""; }; 49 | 1DEC908113D262A8005BCF07 /* CSSSelector.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CSSSelector.m; sourceTree = ""; }; 50 | 1DEE03CA13D234FD007C87FE /* CSSResourceManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSResourceManager.h; sourceTree = ""; }; 51 | 1DEE03CB13D234FD007C87FE /* CSSResourceManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CSSResourceManager.m; sourceTree = ""; }; 52 | 1DEE03D013D23514007C87FE /* CSSParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSParser.h; sourceTree = ""; }; 53 | 1DEE03D113D23514007C87FE /* CSSParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CSSParser.m; sourceTree = ""; }; 54 | 1DEE03D413D23591007C87FE /* CSSMapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSMapper.h; sourceTree = ""; }; 55 | 1DEE03D513D235EA007C87FE /* CSSPlistMapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSPlistMapper.h; sourceTree = ""; }; 56 | 1DEE03D613D235EA007C87FE /* CSSPlistMapper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CSSPlistMapper.m; sourceTree = ""; }; 57 | 1DEE03DC13D24349007C87FE /* CSSStyleSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSStyleSheet.h; sourceTree = ""; }; 58 | 1DEE03DD13D24349007C87FE /* CSSStyleSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CSSStyleSheet.m; sourceTree = ""; }; 59 | AB0ECADF13D25A9F00E151DF /* CALayer+CSS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CALayer+CSS.h"; sourceTree = ""; }; 60 | AB0ECAE013D25A9F00E151DF /* CALayer+CSS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "CALayer+CSS.m"; sourceTree = ""; }; 61 | AB0ECAE313D25B0A00E151DF /* NSObject+CSS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSObject+CSS.h"; sourceTree = ""; }; 62 | AB0ECAE413D25B0A00E151DF /* NSObject+CSS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+CSS.m"; sourceTree = ""; }; 63 | AB50CF8413D22017001113D0 /* CSSSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CSSSample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 64 | AB50CF8813D22017001113D0 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 65 | AB50CF8A13D22017001113D0 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 66 | AB50CF8C13D22017001113D0 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 67 | AB50CF9013D22017001113D0 /* CSSSample-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "CSSSample-Info.plist"; sourceTree = ""; }; 68 | AB50CF9213D22017001113D0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 69 | AB50CF9413D22017001113D0 /* CSSSample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CSSSample-Prefix.pch"; sourceTree = ""; }; 70 | AB50CF9513D22017001113D0 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 71 | AB50CF9713D22017001113D0 /* CSSSampleAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CSSSampleAppDelegate.h; sourceTree = ""; }; 72 | AB50CF9813D22017001113D0 /* CSSSampleAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CSSSampleAppDelegate.m; sourceTree = ""; }; 73 | AB50CF9B13D22017001113D0 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainWindow.xib; sourceTree = ""; }; 74 | AB50CF9D13D22017001113D0 /* CSSSampleViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CSSSampleViewController.h; sourceTree = ""; }; 75 | AB50CF9E13D22017001113D0 /* CSSSampleViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CSSSampleViewController.m; sourceTree = ""; }; 76 | AB50CFA113D22017001113D0 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/CSSSampleViewController.xib; sourceTree = ""; }; 77 | AB588F9713D2412500EC6441 /* GHUnitIOS.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GHUnitIOS.framework; path = "vendors/GHUnit/Examples/MyTestable-iOS/Frameworks/GHUnitIOS.framework"; sourceTree = ""; }; 78 | AB588F9B13D2427100EC6441 /* GHUnitIOSTestMain.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GHUnitIOSTestMain.m; sourceTree = SOURCE_ROOT; }; 79 | AB588FB913D243FE00EC6441 /* Tests.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Tests.app; sourceTree = BUILT_PRODUCTS_DIR; }; 80 | AB588FC013D243FE00EC6441 /* Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Tests-Info.plist"; sourceTree = ""; }; 81 | AB588FC213D243FE00EC6441 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 82 | AB588FC413D243FE00EC6441 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = ""; }; 83 | AB588FC713D243FE00EC6441 /* TestsAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TestsAppDelegate.h; sourceTree = ""; }; 84 | AB588FC813D243FE00EC6441 /* TestsAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TestsAppDelegate.m; sourceTree = ""; }; 85 | AB588FD313D245A700EC6441 /* CSSObjectCategoryTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CSSObjectCategoryTest.h; path = Tests/CSSObjectCategoryTest.h; sourceTree = SOURCE_ROOT; }; 86 | AB588FD413D245A700EC6441 /* CSSObjectCategoryTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CSSObjectCategoryTest.m; path = Tests/CSSObjectCategoryTest.m; sourceTree = SOURCE_ROOT; }; 87 | AB588FD713D24DB500EC6441 /* CSSViewSelectorTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSViewSelectorTest.h; sourceTree = ""; }; 88 | AB588FD813D24DB500EC6441 /* CSSViewSelectorTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CSSViewSelectorTest.m; sourceTree = ""; }; 89 | AB5B475013D2272B00FB2A74 /* UIView+CSS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+CSS.h"; sourceTree = ""; }; 90 | AB5B475113D2272B00FB2A74 /* UIView+CSS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+CSS.m"; sourceTree = ""; }; 91 | D9141F5913D26A4A006B25E0 /* css.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = css.h; path = lex/css.h; sourceTree = ""; }; 92 | D9141F5A13D26A4A006B25E0 /* css.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = css.m; path = lex/css.m; sourceTree = ""; }; 93 | D9141F5B13D26A4A006B25E0 /* mcss.grammer */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = mcss.grammer; path = lex/mcss.grammer; sourceTree = ""; }; 94 | D9141F5F13D26AAB006B25E0 /* CSSTokens.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSTokens.h; sourceTree = ""; }; 95 | D9C27FF213D24CA3000B1A43 /* testcase.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = testcase.css; sourceTree = SOURCE_ROOT; }; 96 | D9C9DBA113D28BE000F34B83 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 97 | D9F5230A13D36EA6003D378D /* maintest.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = maintest.css; sourceTree = ""; }; 98 | /* End PBXFileReference section */ 99 | 100 | /* Begin PBXFrameworksBuildPhase section */ 101 | AB50CF8113D22017001113D0 /* Frameworks */ = { 102 | isa = PBXFrameworksBuildPhase; 103 | buildActionMask = 2147483647; 104 | files = ( 105 | D9C9DBA213D28BE000F34B83 /* QuartzCore.framework in Frameworks */, 106 | AB50CF8913D22017001113D0 /* UIKit.framework in Frameworks */, 107 | AB50CF8B13D22017001113D0 /* Foundation.framework in Frameworks */, 108 | AB50CF8D13D22017001113D0 /* CoreGraphics.framework in Frameworks */, 109 | ); 110 | runOnlyForDeploymentPostprocessing = 0; 111 | }; 112 | AB588FB613D243FE00EC6441 /* Frameworks */ = { 113 | isa = PBXFrameworksBuildPhase; 114 | buildActionMask = 2147483647; 115 | files = ( 116 | AB588FBB13D243FE00EC6441 /* UIKit.framework in Frameworks */, 117 | AB588FBC13D243FE00EC6441 /* Foundation.framework in Frameworks */, 118 | AB588FBD13D243FE00EC6441 /* CoreGraphics.framework in Frameworks */, 119 | AB588FD013D2441600EC6441 /* GHUnitIOS.framework in Frameworks */, 120 | ); 121 | runOnlyForDeploymentPostprocessing = 0; 122 | }; 123 | /* End PBXFrameworksBuildPhase section */ 124 | 125 | /* Begin PBXGroup section */ 126 | 1D91E74413D29F1F009C11F8 /* Selector Tree */ = { 127 | isa = PBXGroup; 128 | children = ( 129 | 1D91E74113D29E33009C11F8 /* CSSSelectorTree.h */, 130 | 1D91E74213D29E33009C11F8 /* CSSSelectorTree.m */, 131 | ); 132 | name = "Selector Tree"; 133 | sourceTree = ""; 134 | }; 135 | 1DEE03C513D234A4007C87FE /* parser */ = { 136 | isa = PBXGroup; 137 | children = ( 138 | 1D91E74413D29F1F009C11F8 /* Selector Tree */, 139 | 1DF02A9E13D285D3005A3D0C /* Lex */, 140 | 1DEE03D013D23514007C87FE /* CSSParser.h */, 141 | 1DEE03D113D23514007C87FE /* CSSParser.m */, 142 | 1DEE03DC13D24349007C87FE /* CSSStyleSheet.h */, 143 | 1DEE03DD13D24349007C87FE /* CSSStyleSheet.m */, 144 | 1DEC908013D262A8005BCF07 /* CSSSelector.h */, 145 | 1DEC908113D262A8005BCF07 /* CSSSelector.m */, 146 | ); 147 | name = parser; 148 | sourceTree = ""; 149 | }; 150 | 1DEE03C913D234D0007C87FE /* managers */ = { 151 | isa = PBXGroup; 152 | children = ( 153 | 1DEE03D813D23662007C87FE /* group */, 154 | 1DEE03D313D2357C007C87FE /* mapper */, 155 | 1DEE03CA13D234FD007C87FE /* CSSResourceManager.h */, 156 | 1DEE03CB13D234FD007C87FE /* CSSResourceManager.m */, 157 | ); 158 | name = managers; 159 | sourceTree = ""; 160 | }; 161 | 1DEE03D313D2357C007C87FE /* mapper */ = { 162 | isa = PBXGroup; 163 | children = ( 164 | 1DEE03D413D23591007C87FE /* CSSMapper.h */, 165 | 1DEE03D513D235EA007C87FE /* CSSPlistMapper.h */, 166 | 1DEE03D613D235EA007C87FE /* CSSPlistMapper.m */, 167 | ); 168 | name = mapper; 169 | sourceTree = ""; 170 | }; 171 | 1DEE03D813D23662007C87FE /* group */ = { 172 | isa = PBXGroup; 173 | children = ( 174 | ); 175 | name = group; 176 | sourceTree = ""; 177 | }; 178 | 1DF02A9E13D285D3005A3D0C /* Lex */ = { 179 | isa = PBXGroup; 180 | children = ( 181 | D9141F5B13D26A4A006B25E0 /* mcss.grammer */, 182 | D9141F5F13D26AAB006B25E0 /* CSSTokens.h */, 183 | D9141F5913D26A4A006B25E0 /* css.h */, 184 | D9141F5A13D26A4A006B25E0 /* css.m */, 185 | ); 186 | name = Lex; 187 | sourceTree = ""; 188 | }; 189 | AB50CF7913D22017001113D0 = { 190 | isa = PBXGroup; 191 | children = ( 192 | AB50CFC113D2201C001113D0 /* CSSApply */, 193 | AB50CF8E13D22017001113D0 /* CSSSample */, 194 | AB588FBE13D243FE00EC6441 /* Tests */, 195 | AB50CF8713D22017001113D0 /* Frameworks */, 196 | AB50CF8513D22017001113D0 /* Products */, 197 | ); 198 | sourceTree = ""; 199 | }; 200 | AB50CF8513D22017001113D0 /* Products */ = { 201 | isa = PBXGroup; 202 | children = ( 203 | AB50CF8413D22017001113D0 /* CSSSample.app */, 204 | AB588FB913D243FE00EC6441 /* Tests.app */, 205 | ); 206 | name = Products; 207 | sourceTree = ""; 208 | }; 209 | AB50CF8713D22017001113D0 /* Frameworks */ = { 210 | isa = PBXGroup; 211 | children = ( 212 | D9C9DBA113D28BE000F34B83 /* QuartzCore.framework */, 213 | AB588F9713D2412500EC6441 /* GHUnitIOS.framework */, 214 | AB50CF8813D22017001113D0 /* UIKit.framework */, 215 | AB50CF8A13D22017001113D0 /* Foundation.framework */, 216 | AB50CF8C13D22017001113D0 /* CoreGraphics.framework */, 217 | ); 218 | name = Frameworks; 219 | sourceTree = ""; 220 | }; 221 | AB50CF8E13D22017001113D0 /* CSSSample */ = { 222 | isa = PBXGroup; 223 | children = ( 224 | AB50CF9713D22017001113D0 /* CSSSampleAppDelegate.h */, 225 | AB50CF9813D22017001113D0 /* CSSSampleAppDelegate.m */, 226 | AB50CF9A13D22017001113D0 /* MainWindow.xib */, 227 | AB50CF9D13D22017001113D0 /* CSSSampleViewController.h */, 228 | AB50CF9E13D22017001113D0 /* CSSSampleViewController.m */, 229 | AB50CFA013D22017001113D0 /* CSSSampleViewController.xib */, 230 | AB50CF8F13D22017001113D0 /* Supporting Files */, 231 | ); 232 | path = CSSSample; 233 | sourceTree = ""; 234 | }; 235 | AB50CF8F13D22017001113D0 /* Supporting Files */ = { 236 | isa = PBXGroup; 237 | children = ( 238 | D9C27FF213D24CA3000B1A43 /* testcase.css */, 239 | AB50CF9013D22017001113D0 /* CSSSample-Info.plist */, 240 | AB50CF9113D22017001113D0 /* InfoPlist.strings */, 241 | AB50CF9413D22017001113D0 /* CSSSample-Prefix.pch */, 242 | AB50CF9513D22017001113D0 /* main.m */, 243 | D9F5230A13D36EA6003D378D /* maintest.css */, 244 | ); 245 | name = "Supporting Files"; 246 | sourceTree = ""; 247 | }; 248 | AB50CFC113D2201C001113D0 /* CSSApply */ = { 249 | isa = PBXGroup; 250 | children = ( 251 | 1DEE03C913D234D0007C87FE /* managers */, 252 | 1DEE03C513D234A4007C87FE /* parser */, 253 | AB50CFC313D2202C001113D0 /* vendors */, 254 | AB50CFC213D22024001113D0 /* categories */, 255 | ); 256 | name = CSSApply; 257 | sourceTree = ""; 258 | }; 259 | AB50CFC213D22024001113D0 /* categories */ = { 260 | isa = PBXGroup; 261 | children = ( 262 | AB5B475013D2272B00FB2A74 /* UIView+CSS.h */, 263 | AB5B475113D2272B00FB2A74 /* UIView+CSS.m */, 264 | AB0ECADF13D25A9F00E151DF /* CALayer+CSS.h */, 265 | AB0ECAE013D25A9F00E151DF /* CALayer+CSS.m */, 266 | AB0ECAE313D25B0A00E151DF /* NSObject+CSS.h */, 267 | AB0ECAE413D25B0A00E151DF /* NSObject+CSS.m */, 268 | ); 269 | name = categories; 270 | sourceTree = ""; 271 | }; 272 | AB50CFC313D2202C001113D0 /* vendors */ = { 273 | isa = PBXGroup; 274 | children = ( 275 | ); 276 | name = vendors; 277 | sourceTree = ""; 278 | }; 279 | AB588FBE13D243FE00EC6441 /* Tests */ = { 280 | isa = PBXGroup; 281 | children = ( 282 | AB588FD213D2452100EC6441 /* Test Cases */, 283 | AB588FC713D243FE00EC6441 /* TestsAppDelegate.h */, 284 | AB588FC813D243FE00EC6441 /* TestsAppDelegate.m */, 285 | AB588FBF13D243FE00EC6441 /* Supporting Files */, 286 | ); 287 | path = Tests; 288 | sourceTree = ""; 289 | }; 290 | AB588FBF13D243FE00EC6441 /* Supporting Files */ = { 291 | isa = PBXGroup; 292 | children = ( 293 | AB588F9B13D2427100EC6441 /* GHUnitIOSTestMain.m */, 294 | AB588FC013D243FE00EC6441 /* Tests-Info.plist */, 295 | AB588FC113D243FE00EC6441 /* InfoPlist.strings */, 296 | AB588FC413D243FE00EC6441 /* Tests-Prefix.pch */, 297 | ); 298 | name = "Supporting Files"; 299 | sourceTree = ""; 300 | }; 301 | AB588FD213D2452100EC6441 /* Test Cases */ = { 302 | isa = PBXGroup; 303 | children = ( 304 | AB588FD313D245A700EC6441 /* CSSObjectCategoryTest.h */, 305 | AB588FD413D245A700EC6441 /* CSSObjectCategoryTest.m */, 306 | AB588FD713D24DB500EC6441 /* CSSViewSelectorTest.h */, 307 | AB588FD813D24DB500EC6441 /* CSSViewSelectorTest.m */, 308 | ); 309 | name = "Test Cases"; 310 | sourceTree = ""; 311 | }; 312 | /* End PBXGroup section */ 313 | 314 | /* Begin PBXNativeTarget section */ 315 | AB50CF8313D22017001113D0 /* CSSSample */ = { 316 | isa = PBXNativeTarget; 317 | buildConfigurationList = AB50CFBB13D22017001113D0 /* Build configuration list for PBXNativeTarget "CSSSample" */; 318 | buildPhases = ( 319 | AB50CF8013D22017001113D0 /* Sources */, 320 | AB50CF8113D22017001113D0 /* Frameworks */, 321 | AB50CF8213D22017001113D0 /* Resources */, 322 | ); 323 | buildRules = ( 324 | ); 325 | dependencies = ( 326 | ); 327 | name = CSSSample; 328 | productName = CSSSample; 329 | productReference = AB50CF8413D22017001113D0 /* CSSSample.app */; 330 | productType = "com.apple.product-type.application"; 331 | }; 332 | AB588FB813D243FE00EC6441 /* Tests */ = { 333 | isa = PBXNativeTarget; 334 | buildConfigurationList = AB588FCD13D243FE00EC6441 /* Build configuration list for PBXNativeTarget "Tests" */; 335 | buildPhases = ( 336 | AB588FB513D243FE00EC6441 /* Sources */, 337 | AB588FB613D243FE00EC6441 /* Frameworks */, 338 | AB588FB713D243FE00EC6441 /* Resources */, 339 | ); 340 | buildRules = ( 341 | ); 342 | dependencies = ( 343 | ); 344 | name = Tests; 345 | productName = Tests; 346 | productReference = AB588FB913D243FE00EC6441 /* Tests.app */; 347 | productType = "com.apple.product-type.application"; 348 | }; 349 | /* End PBXNativeTarget section */ 350 | 351 | /* Begin PBXProject section */ 352 | AB50CF7B13D22017001113D0 /* Project object */ = { 353 | isa = PBXProject; 354 | attributes = { 355 | ORGANIZATIONNAME = "Float:Right Ltd"; 356 | }; 357 | buildConfigurationList = AB50CF7E13D22017001113D0 /* Build configuration list for PBXProject "CSSSample" */; 358 | compatibilityVersion = "Xcode 3.2"; 359 | developmentRegion = English; 360 | hasScannedForEncodings = 0; 361 | knownRegions = ( 362 | en, 363 | ); 364 | mainGroup = AB50CF7913D22017001113D0; 365 | productRefGroup = AB50CF8513D22017001113D0 /* Products */; 366 | projectDirPath = ""; 367 | projectRoot = ""; 368 | targets = ( 369 | AB50CF8313D22017001113D0 /* CSSSample */, 370 | AB588FB813D243FE00EC6441 /* Tests */, 371 | ); 372 | }; 373 | /* End PBXProject section */ 374 | 375 | /* Begin PBXResourcesBuildPhase section */ 376 | AB50CF8213D22017001113D0 /* Resources */ = { 377 | isa = PBXResourcesBuildPhase; 378 | buildActionMask = 2147483647; 379 | files = ( 380 | AB50CF9313D22017001113D0 /* InfoPlist.strings in Resources */, 381 | AB50CF9C13D22017001113D0 /* MainWindow.xib in Resources */, 382 | AB50CFA213D22017001113D0 /* CSSSampleViewController.xib in Resources */, 383 | D9C27FF313D24CA3000B1A43 /* testcase.css in Resources */, 384 | D9141F5D13D26A4A006B25E0 /* mcss.grammer in Resources */, 385 | D9F5230B13D36EA6003D378D /* maintest.css in Resources */, 386 | ); 387 | runOnlyForDeploymentPostprocessing = 0; 388 | }; 389 | AB588FB713D243FE00EC6441 /* Resources */ = { 390 | isa = PBXResourcesBuildPhase; 391 | buildActionMask = 2147483647; 392 | files = ( 393 | D9C27FF513D24D2C000B1A43 /* testcase.css in Resources */, 394 | AB588FC313D243FE00EC6441 /* InfoPlist.strings in Resources */, 395 | ); 396 | runOnlyForDeploymentPostprocessing = 0; 397 | }; 398 | /* End PBXResourcesBuildPhase section */ 399 | 400 | /* Begin PBXSourcesBuildPhase section */ 401 | AB50CF8013D22017001113D0 /* Sources */ = { 402 | isa = PBXSourcesBuildPhase; 403 | buildActionMask = 2147483647; 404 | files = ( 405 | AB50CF9613D22017001113D0 /* main.m in Sources */, 406 | AB50CF9913D22017001113D0 /* CSSSampleAppDelegate.m in Sources */, 407 | AB50CF9F13D22017001113D0 /* CSSSampleViewController.m in Sources */, 408 | 1DEE03CC13D234FD007C87FE /* CSSResourceManager.m in Sources */, 409 | 1DEE03D213D23514007C87FE /* CSSParser.m in Sources */, 410 | 1DEE03D713D235EA007C87FE /* CSSPlistMapper.m in Sources */, 411 | 1DEE03DE13D24349007C87FE /* CSSStyleSheet.m in Sources */, 412 | 1DEC908213D262A9005BCF07 /* CSSSelector.m in Sources */, 413 | D9141F5C13D26A4A006B25E0 /* css.m in Sources */, 414 | AB0ECAE113D25A9F00E151DF /* CALayer+CSS.m in Sources */, 415 | AB0ECAE513D25B0A00E151DF /* NSObject+CSS.m in Sources */, 416 | 1D7B93D313D28E1B00F4AA31 /* UIView+CSS.m in Sources */, 417 | 1D91E74313D29E33009C11F8 /* CSSSelectorTree.m in Sources */, 418 | ); 419 | runOnlyForDeploymentPostprocessing = 0; 420 | }; 421 | AB588FB513D243FE00EC6441 /* Sources */ = { 422 | isa = PBXSourcesBuildPhase; 423 | buildActionMask = 2147483647; 424 | files = ( 425 | AB588FC913D243FE00EC6441 /* TestsAppDelegate.m in Sources */, 426 | AB588FD113D2442600EC6441 /* GHUnitIOSTestMain.m in Sources */, 427 | AB588FD513D245A700EC6441 /* CSSObjectCategoryTest.m in Sources */, 428 | AB588FD913D24DB500EC6441 /* CSSViewSelectorTest.m in Sources */, 429 | ); 430 | runOnlyForDeploymentPostprocessing = 0; 431 | }; 432 | /* End PBXSourcesBuildPhase section */ 433 | 434 | /* Begin PBXVariantGroup section */ 435 | AB50CF9113D22017001113D0 /* InfoPlist.strings */ = { 436 | isa = PBXVariantGroup; 437 | children = ( 438 | AB50CF9213D22017001113D0 /* en */, 439 | ); 440 | name = InfoPlist.strings; 441 | sourceTree = ""; 442 | }; 443 | AB50CF9A13D22017001113D0 /* MainWindow.xib */ = { 444 | isa = PBXVariantGroup; 445 | children = ( 446 | AB50CF9B13D22017001113D0 /* en */, 447 | ); 448 | name = MainWindow.xib; 449 | sourceTree = ""; 450 | }; 451 | AB50CFA013D22017001113D0 /* CSSSampleViewController.xib */ = { 452 | isa = PBXVariantGroup; 453 | children = ( 454 | AB50CFA113D22017001113D0 /* en */, 455 | ); 456 | name = CSSSampleViewController.xib; 457 | sourceTree = ""; 458 | }; 459 | AB588FC113D243FE00EC6441 /* InfoPlist.strings */ = { 460 | isa = PBXVariantGroup; 461 | children = ( 462 | AB588FC213D243FE00EC6441 /* en */, 463 | ); 464 | name = InfoPlist.strings; 465 | sourceTree = ""; 466 | }; 467 | /* End PBXVariantGroup section */ 468 | 469 | /* Begin XCBuildConfiguration section */ 470 | AB50CFB913D22017001113D0 /* Debug */ = { 471 | isa = XCBuildConfiguration; 472 | buildSettings = { 473 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 474 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 475 | GCC_C_LANGUAGE_STANDARD = gnu99; 476 | GCC_OPTIMIZATION_LEVEL = 0; 477 | GCC_PREPROCESSOR_DEFINITIONS = DEBUG; 478 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 479 | GCC_VERSION = ""; 480 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 481 | GCC_WARN_UNUSED_VARIABLE = YES; 482 | IPHONEOS_DEPLOYMENT_TARGET = 4.3; 483 | SDKROOT = iphoneos; 484 | }; 485 | name = Debug; 486 | }; 487 | AB50CFBA13D22017001113D0 /* Release */ = { 488 | isa = XCBuildConfiguration; 489 | buildSettings = { 490 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 491 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 492 | GCC_C_LANGUAGE_STANDARD = gnu99; 493 | GCC_VERSION = ""; 494 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 495 | GCC_WARN_UNUSED_VARIABLE = YES; 496 | IPHONEOS_DEPLOYMENT_TARGET = 4.3; 497 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 498 | SDKROOT = iphoneos; 499 | }; 500 | name = Release; 501 | }; 502 | AB50CFBC13D22017001113D0 /* Debug */ = { 503 | isa = XCBuildConfiguration; 504 | buildSettings = { 505 | ALWAYS_SEARCH_USER_PATHS = NO; 506 | COPY_PHASE_STRIP = NO; 507 | FRAMEWORK_SEARCH_PATHS = ( 508 | "$(inherited)", 509 | "\"$(SRCROOT)/vendors/GHUnit/Examples/MyTestable-iOS/Frameworks\"", 510 | ); 511 | GCC_DYNAMIC_NO_PIC = NO; 512 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 513 | GCC_PREFIX_HEADER = "CSSSample/CSSSample-Prefix.pch"; 514 | GCC_VERSION = com.apple.compilers.llvmgcc42; 515 | INFOPLIST_FILE = "CSSSample/CSSSample-Info.plist"; 516 | IPHONEOS_DEPLOYMENT_TARGET = 4.3; 517 | PRODUCT_NAME = "$(TARGET_NAME)"; 518 | WRAPPER_EXTENSION = app; 519 | }; 520 | name = Debug; 521 | }; 522 | AB50CFBD13D22017001113D0 /* Release */ = { 523 | isa = XCBuildConfiguration; 524 | buildSettings = { 525 | ALWAYS_SEARCH_USER_PATHS = NO; 526 | COPY_PHASE_STRIP = YES; 527 | FRAMEWORK_SEARCH_PATHS = ( 528 | "$(inherited)", 529 | "\"$(SRCROOT)/vendors/GHUnit/Examples/MyTestable-iOS/Frameworks\"", 530 | ); 531 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 532 | GCC_PREFIX_HEADER = "CSSSample/CSSSample-Prefix.pch"; 533 | GCC_VERSION = com.apple.compilers.llvmgcc42; 534 | INFOPLIST_FILE = "CSSSample/CSSSample-Info.plist"; 535 | IPHONEOS_DEPLOYMENT_TARGET = 4.3; 536 | PRODUCT_NAME = "$(TARGET_NAME)"; 537 | VALIDATE_PRODUCT = YES; 538 | WRAPPER_EXTENSION = app; 539 | }; 540 | name = Release; 541 | }; 542 | AB588FCE13D243FE00EC6441 /* Debug */ = { 543 | isa = XCBuildConfiguration; 544 | buildSettings = { 545 | ALWAYS_SEARCH_USER_PATHS = NO; 546 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 547 | COPY_PHASE_STRIP = NO; 548 | FRAMEWORK_SEARCH_PATHS = ( 549 | "$(inherited)", 550 | "\"$(SRCROOT)/vendors/GHUnit/Examples/MyTestable-iOS/Frameworks\"", 551 | ); 552 | GCC_DYNAMIC_NO_PIC = NO; 553 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 554 | GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; 555 | INFOPLIST_FILE = "Tests/Tests-Info.plist"; 556 | OTHER_LDFLAGS = ( 557 | "-ObjC", 558 | "-all_load", 559 | ); 560 | PRODUCT_NAME = "$(TARGET_NAME)"; 561 | WRAPPER_EXTENSION = app; 562 | }; 563 | name = Debug; 564 | }; 565 | AB588FCF13D243FE00EC6441 /* Release */ = { 566 | isa = XCBuildConfiguration; 567 | buildSettings = { 568 | ALWAYS_SEARCH_USER_PATHS = NO; 569 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 570 | COPY_PHASE_STRIP = YES; 571 | FRAMEWORK_SEARCH_PATHS = ( 572 | "$(inherited)", 573 | "\"$(SRCROOT)/vendors/GHUnit/Examples/MyTestable-iOS/Frameworks\"", 574 | ); 575 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 576 | GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; 577 | INFOPLIST_FILE = "Tests/Tests-Info.plist"; 578 | OTHER_LDFLAGS = ( 579 | "-ObjC", 580 | "-all_load", 581 | ); 582 | PRODUCT_NAME = "$(TARGET_NAME)"; 583 | VALIDATE_PRODUCT = YES; 584 | WRAPPER_EXTENSION = app; 585 | }; 586 | name = Release; 587 | }; 588 | /* End XCBuildConfiguration section */ 589 | 590 | /* Begin XCConfigurationList section */ 591 | AB50CF7E13D22017001113D0 /* Build configuration list for PBXProject "CSSSample" */ = { 592 | isa = XCConfigurationList; 593 | buildConfigurations = ( 594 | AB50CFB913D22017001113D0 /* Debug */, 595 | AB50CFBA13D22017001113D0 /* Release */, 596 | ); 597 | defaultConfigurationIsVisible = 0; 598 | defaultConfigurationName = Release; 599 | }; 600 | AB50CFBB13D22017001113D0 /* Build configuration list for PBXNativeTarget "CSSSample" */ = { 601 | isa = XCConfigurationList; 602 | buildConfigurations = ( 603 | AB50CFBC13D22017001113D0 /* Debug */, 604 | AB50CFBD13D22017001113D0 /* Release */, 605 | ); 606 | defaultConfigurationIsVisible = 0; 607 | defaultConfigurationName = Release; 608 | }; 609 | AB588FCD13D243FE00EC6441 /* Build configuration list for PBXNativeTarget "Tests" */ = { 610 | isa = XCConfigurationList; 611 | buildConfigurations = ( 612 | AB588FCE13D243FE00EC6441 /* Debug */, 613 | AB588FCF13D243FE00EC6441 /* Release */, 614 | ); 615 | defaultConfigurationIsVisible = 0; 616 | defaultConfigurationName = Release; 617 | }; 618 | /* End XCConfigurationList section */ 619 | }; 620 | rootObject = AB50CF7B13D22017001113D0 /* Project object */; 621 | } 622 | --------------------------------------------------------------------------------