objcwrapper -
Generator of Nit extern classes to wrap Objective-C services.
Description
objcwrapper is a tool to help access Objective-C classes and methods from Nit. It generates Nit code composed of extern classes and extern methods from the Objective-C FFI. The code should be valid Nit, but it may need some tweaking by hand before use.
objcwrapper takes as input preprocessed Objective-C header files.
This preprocessing is usually done by combinig (or piping) calls to:
gcc -E
, header_keeper
and header_static
.
See the check rules in the Makefile for example preprocessing.
Usage
Compile objcwrapper with:
make
Compile the wrapper
NSArray.nit
from the preprocessed headerNSArray.h
with:bin/objcwrapper -o NSArray.h NSArray.h
Import the generated module as usual from any Nit program. It is not recommended to modify the generated file directly, but you can redef the generated classes from other modules.
See also
jwrapper is the inspiration for this tool. It generate wrappers to access Java services from Nit.
Content
- objcwrapper: Generator of Nit extern classes to wrap Objective-C services. (contrib/objcwrapper)
- examples (contrib/objcwrapper/examples)
- uikit (contrib/objcwrapper/examples/uikit)
- src (contrib/objcwrapper/src)
- header_static: Filters preprocessed C-like header files to remove static code and keep their signatures. (contrib/objcwrapper/src/header_static.nit)
- objc_generator: Code generation (contrib/objcwrapper/src/objc_generator.nit)
- objc_lexer: Lexer generated by nitcc for the grammar objc (contrib/objcwrapper/src/objc_lexer.nit)
- objc_model: Model of the parsed Objective-C files (contrib/objcwrapper/src/objc_model.nit)
- objc_parser: Parser generated by nitcc for the grammar objc (contrib/objcwrapper/src/objc_parser.nit)
- objc_test_parser: Standalone parser tester for the language objc (contrib/objcwrapper/src/objc_test_parser.nit)
- objc_visitor: AST visitor (contrib/objcwrapper/src/objc_visitor.nit)
- objcwrapper: Generator of Nit modules to wrap Objective-C services (contrib/objcwrapper/src/objcwrapper.nit)
- preprocessing: Preprocessing of input files (contrib/objcwrapper/src/preprocessing.nit)
- examples (contrib/objcwrapper/examples)