objective-c-parser icon indicating copy to clipboard operation
objective-c-parser copied to clipboard

Parse properties, superclass and conforming protocols

Open Eskils opened this issue 1 year ago • 0 comments

This PR aims to implement support for parsing @\property declarations, an interface’s superclass and conforming protocols.

The following header-file:

@interface BasicName : NSObject <Ponies, Foo>

// Another comment
@property(nonatomic, readonly) NSArray<NSString *> titles;


// This is the comment of basic method one
- (NSInteger)basicMethodOne;

@end

…will be parsed into:

{
    "name": "BasicName",
    "superclass": "NSObject",
    "protocols": ["Ponies", "Foo"],
    "properties": [
        {
	    "attributes": ["nonatomic", "readonly"],
	    "name": "titles",
	    "type": "NSArray<NSString *>"
        }
    ],
    "methods": [
        {
	    "args": [],
	    "comment": "This is the comment of basic method one",
	    "name": "basicMethodOne",
	    "returnType": "NSInteger"
        }
    ]
}

Please let me know if there is anything you would like to change or supplement.

Eskils avatar Aug 01 '24 11:08 Eskils