From 47f4012699606ccad8cc4cd48fd95a5df3799c35 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Tue, 11 Aug 2015 17:11:52 -0400 Subject: [PATCH] contrib/objcwrapper: add some doc and license MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- contrib/objcwrapper/src/objc_generator.nit | 15 +++++++++ contrib/objcwrapper/src/objc_model.nit | 49 ++++++++++++++++++++++++++++ contrib/objcwrapper/src/objc_visitor.nit | 15 +++++++++ contrib/objcwrapper/src/objcwrapper.nit | 15 +++++++++ 4 files changed, 94 insertions(+) diff --git a/contrib/objcwrapper/src/objc_generator.nit b/contrib/objcwrapper/src/objc_generator.nit index 5f8fd5c..3ad10b8 100644 --- a/contrib/objcwrapper/src/objc_generator.nit +++ b/contrib/objcwrapper/src/objc_generator.nit @@ -1,3 +1,18 @@ +# This file is part of NIT ( http://www.nitlanguage.org ). +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Code generation module objc_generator import objc_model diff --git a/contrib/objcwrapper/src/objc_model.nit b/contrib/objcwrapper/src/objc_model.nit index 2ade394..b2465c5 100644 --- a/contrib/objcwrapper/src/objc_model.nit +++ b/contrib/objcwrapper/src/objc_model.nit @@ -1,40 +1,89 @@ +# This file is part of NIT ( http://www.nitlanguage.org ). +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Model of the parsed Objective-C files module objc_model +# Model of all the analyzed Objective-C classes class ObjcModel + # All analyzed classes var classes = new Array[ObjcClass] end +# Objective-C class class ObjcClass + # Name of the super classes var super_names = new Array[String] + + # Name of this Objective-C class var name: String + + # Attributes of this Objective-C class var attributes = new Array[ObjcAttribute] + + # Methods of this Objective-C class var methods = new Array[ObjcMethod] end +# Method of an `ObjcClass` class ObjcMethod super Property + # Scope: '+' for a static class method, and '-' for an instance method var scope: Char is noinit, writable + + # Parameters of the method var params = new Array[Param] + + # Return type as a `String` var return_type: String is noinit, writable end +# Attribute of an `ObjcClass` class ObjcAttribute super Property + # Name of this attribute var name: String is noinit, writable + + # Type of this attribute var return_type: String is noinit, writable end +# Property of an `ObjcClass` class Property + # Is this property to be commented out? var is_commented = false is writable end +# Parameter of an `ObjcMethod` class Param + # Parameter name, used by the caller (e.g. `withObject` in `withObject: (NSObject*) obj`) var name: String is noinit, writable + + # Type of the parameter name var return_type: String is noinit, writable + + # Argument name, used within the body (e.g. `obj` in `withObject: (NSObject*) obj`) var variable_name: String is noinit, writable + + # Is this a primitive array? with at least one `[]`. var is_table = false is writable + + # Is this a pointer type? var is_pointer = false is writable + + # Is this a parameter with only a `name`? var is_single = false is writable end diff --git a/contrib/objcwrapper/src/objc_visitor.nit b/contrib/objcwrapper/src/objc_visitor.nit index a73d528..d4056d4 100644 --- a/contrib/objcwrapper/src/objc_visitor.nit +++ b/contrib/objcwrapper/src/objc_visitor.nit @@ -1,3 +1,18 @@ +# This file is part of NIT ( http://www.nitlanguage.org ). +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# AST visitor module objc_visitor import objc_model diff --git a/contrib/objcwrapper/src/objcwrapper.nit b/contrib/objcwrapper/src/objcwrapper.nit index a714a4d..396da6f 100644 --- a/contrib/objcwrapper/src/objcwrapper.nit +++ b/contrib/objcwrapper/src/objcwrapper.nit @@ -1,3 +1,18 @@ +# This file is part of NIT ( http://www.nitlanguage.org ). +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Generator of Nit modules to wrap Objective-C services module objcwrapper import objc_visitor -- 1.7.9.5