{"id":17976816,"url":"https://github.com/unixzii/objc-encodingparser","last_synced_at":"2025-03-25T15:31:23.507Z","repository":{"id":41952687,"uuid":"483724374","full_name":"unixzii/objc-encodingparser","owner":"unixzii","description":"A cross-platform library to parse Objective-C type encoding.","archived":false,"fork":false,"pushed_at":"2024-09-01T14:36:47.000Z","size":83,"stargazers_count":42,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-20T13:12:55.435Z","etag":null,"topics":["ios","library","objective-c","parser"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unixzii.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-04-20T16:08:25.000Z","updated_at":"2025-01-31T07:52:08.000Z","dependencies_parsed_at":"2023-01-18T11:16:53.469Z","dependency_job_id":null,"html_url":"https://github.com/unixzii/objc-encodingparser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unixzii%2Fobjc-encodingparser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unixzii%2Fobjc-encodingparser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unixzii%2Fobjc-encodingparser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unixzii%2Fobjc-encodingparser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unixzii","download_url":"https://codeload.github.com/unixzii/objc-encodingparser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245489764,"owners_count":20623789,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ios","library","objective-c","parser"],"created_at":"2024-10-29T17:25:11.074Z","updated_at":"2025-03-25T15:31:22.877Z","avatar_url":"https://github.com/unixzii.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Objective-C Encoding Parser\n\nThis library is a simple parser for Objective-C [type encoding](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtTypeEncodings.html) with a focus on cross-platform.\n\nSee [parser.h](./parser.h) for the provided APIs and [run-test.c](./run-test.c) to learn how this library works in action.\n\n## Features\n\n* Simple and intuitive APIs, ready for use without reading any documents.\n* Zero-dependency and platform-agnostic, tested in macOS, Linux and Windows, easy to integrate with your various analysis facilities.\n* Full support of the type encoding syntax (including struct, union), and able to get the related information of the type (like name, size and alignment).\n* Error tolerance for ill-formed encoding strings, the library parses inputs in its best effort.\n* Built-in dump function to print the human-readable string describing the type.\n\n## Building\n\n### Make\n\n```\ngit clone https://github.com/unixzii/objc-encodingparser.git\ncd objc-encodingparser\nmake\n```\n\nThis will generate both the static library `libocep.a` and a `run-test` program.\n\n### Xcode / Visual Studio\n\nThe project (solution) both contains two targets: `libocep` and `RunTest`. Once build is succeeded, you can retrieve the products from your IDE's build directory.\n\n## Type Node Explained\n\n`ocep_type_node_t` is the core structure of this library, you parse an encoding string and get the result with that type. It's like an n-ary tree and each node has a parent pointer, a child pointer and a sibling pointer. An example is shown as the below figure:\n\n![Example Node](./misc/node_structure.png)\n\nYou can use `ocep_type_node_traverse` function to visit all the children (include itself) of a given node in a DFS-fashion traverse.\n\n## Limitations\n\n* Bit fields are currently not supported (since it's rare in Objective-C code), submit an issue if you see this important.\n* Type size is now calculated in the compact layout (eg. `\"{?=c^vc}\"` will get a size of 16 while actually it's 24).\n\n## License\n\nThis project is licensed under MIT license.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funixzii%2Fobjc-encodingparser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funixzii%2Fobjc-encodingparser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funixzii%2Fobjc-encodingparser/lists"}