Merge: objcwrapper: class methods as top-level methods, generate doc and intro `gen_nit`
authorJean Privat <jean@pryen.org>
Tue, 8 Sep 2015 15:54:40 +0000 (11:54 -0400)
committerJean Privat <jean@pryen.org>
Tue, 8 Sep 2015 15:54:40 +0000 (11:54 -0400)
commitca4cebb745fd1731cbf7c16cea1ec6ea61d95da2
treeff3f85173a2d3a207e689bfe97b51640810ccf2b
parent0eb90f31eb2a060290af00b1b21b112e35443748
parentd6358b61087bf4a9433df2c9adccf78499498002
Merge: objcwrapper: class methods as top-level methods, generate doc and intro `gen_nit`

Update _objcwrapper_  so it is more useful. It now supports class/top-level methods, it generates basic doc with each methods and moving the preprocessing to Nit allows to easily parse many files at once.

This PR also extracts the Nit keywords list from jwrapper into the new `gen_nit` lib. I may move up other services common to jwrapper and objcwrapper there in the future.

At this point, we parse 89 out of 121 headers from GNUStep. And I have grammar tweaks stashed away that brind it up to 101, but I'm also considering using an existing and complete grammar... The result is not very usable as it still need to reproduce the class hierarch and avoid reintroducing introduced methods between classes.

I've added a pretty print for errors to help debug the grammar, if there is an interest I could move it up to `nitcc_runtime`, here's an example output:
~~~
Syntax Error: Unexpected rpar ')'; is acceptable instead: data_type, more_type, at 70:38-70:39
in /usr/include/GNUstep/Foundation/NSArchiver.h
- (void) serializeHeaderAt: (unsigned)positionInData
                                     ^
Syntax Error: Unexpected id 'autorelease_thread_vars'; is acceptable instead: declaration, structure_core, type, type_annotation, unsigned, data_type, more_type, function_pointer, at 9:16-9:39
in /usr/include/GNUstep/Foundation/NSAutoreleasePool.h
typedef struct autorelease_thread_vars
               ^^^^^^^^^^^^^^^^^^^^^^^
~~~

Pull-Request: #1688
Reviewed-by: Jean Privat <jean@pryen.org>