From: Jean Privat Date: Fri, 21 Aug 2015 19:48:25 +0000 (-0400) Subject: Merge: objcwrapper: wrapper generator to access Objective-C services from Nit X-Git-Tag: v0.7.8~76 X-Git-Url: http://nitlanguage.org Merge: objcwrapper: wrapper generator to access Objective-C services from Nit This PR introduces *objcwrapper*, a wrapper generator to access Objective-C services from Nit. At this point, *objcwrapper* can parse large Objective-C header files from Apple, and generate valid Nit code to wrap simple classes. This PR contains the work of @Tagachi (as the first commit), some of my refactoring and new features. Because of this, there is some rewrite between commits. I chose to keep them as-is because it may be useful to debug regressions in the future. Actually, some of the refactoring remove a few features (such as super class declaration parsing), they will be brought back in future PRs. This is a good base for future work but also a work in progress. Please restrain comments to structural and algorithmic problems, the doc and manual will be completed with the missing features. Working features: - [x] Generate a Nit extern class for each Objective-C `@interface` block. - [x] Generate Nit extern methods to wrap Objective-C methods (`- `). - [x] Generate getters for attributes `@property`. - [x] Basic type conversion from Objective-C to Nit. - [x] Partial detection of supported and unsupported types. Todo features: - [ ] Static functions (`+`) as top-level methods. - [ ] Attribute setter (when not `readonly`). - [ ] Intro and use an `ObjcType` instead of a `String`. - [ ] Reproduce class hierarchy. - [ ] Reuse wrapped classes (serialize the model alongside the wrapper). - [ ] Deal with incompatible types: function pointers and others. - [ ] Print a report on unsupported services. - [ ] Support parsing GNUstep classes. - [ ] Generate valid Nit code with Apple classes. - [ ] Merge with *jwrapper*? Pull-Request: #1647 Reviewed-by: Jean Privat Reviewed-by: Lucas Bajolet --- aeb87fda7bac878ef4ce25421d7b652340ae5992