{"id":31910282,"url":"https://github.com/yisaer/idl-parser","last_synced_at":"2025-10-13T16:21:25.915Z","repository":{"id":305630980,"uuid":"995142462","full_name":"Yisaer/idl-parser","owner":"Yisaer","description":"OMG IDL Parser written in go ","archived":false,"fork":false,"pushed_at":"2025-08-11T01:50:13.000Z","size":56,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-11T21:44:13.674Z","etag":null,"topics":["go","omg-idl","parser","parser-combinator"],"latest_commit_sha":null,"homepage":"","language":"Go","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/Yisaer.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-03T03:13:30.000Z","updated_at":"2025-08-11T01:48:24.000Z","dependencies_parsed_at":"2025-07-21T08:32:53.937Z","dependency_job_id":null,"html_url":"https://github.com/Yisaer/idl-parser","commit_stats":null,"previous_names":["yisaer/idl-parser"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Yisaer/idl-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yisaer%2Fidl-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yisaer%2Fidl-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yisaer%2Fidl-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yisaer%2Fidl-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Yisaer","download_url":"https://codeload.github.com/Yisaer/idl-parser/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yisaer%2Fidl-parser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279016059,"owners_count":26085799,"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","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["go","omg-idl","parser","parser-combinator"],"created_at":"2025-10-13T16:21:23.511Z","updated_at":"2025-10-13T16:21:25.909Z","avatar_url":"https://github.com/Yisaer.png","language":"Go","readme":"# idl-parser\n\nOMG IDL Parser written in go inspired by [gomme](https://github.com/oleiade/gomme)\n\nAn OMG IDL (Interface Definition Language) parser written in Go, inspired by gomme.\n\n## Features\n* Parses OMG IDL syntax into structured Go types\n* Supports common IDL constructs:\n  * Modules\n  * Basic Types\n  * Type references\n  * Arrays/Sequence\n  * Annotations\n* Simple API with Parse() function\n* Comprehensive test coverage\n\n## Basic Type Transform\n\n| IDL Base Type        | Common Base Type | Description             |\n|----------------------|------------------|-------------------------|\n| `octet`              | `uint8`          | 8-bit unsigned integer  |\n| `short`              | `int16`          | 16-bit signed integer   |\n| `unsigned short`     | `uint16`         | 16-bit unsigned integer |\n| `long`               | `int32`          | 32-bit signed integer   |\n| `unsigned long`      | `uint32`         | 32-bit unsigned integer |\n| `long long`          | `int64`          | 64-bit signed integer   |\n| `unsigned long long` | `uint64`         | 64-bit unsigned integer |\n| `float`              | `float32`        | 32-bit floating point   |\n| `double`             | `float64`        | 64-bit floating point   |\n| `boolean`            | `bool`           | Boolean value           |\n| `string`             | `string`         | Variable-length string  |\n\n```txt\nmodule m {\n     struct c {\n        octet id1;\n        short id2;\n        unsigned short id3;\n     }\n}\n```\n\n### Dynamic String\n\n```txt\nmodule m {\n     struct c {\n        string name;\n     }\n}\n```\n\n### Fixed Length String\n\n```txt\nmodule m {\n     struct c {\n        string\u003c10\u003e name;\n     }\n}\n```\n\n### Array \n\nArray is the fixed list of given element\n\n```txt\nmodule m {\n     struct c {\n        octet[10] idList;\n     }\n}\n```\n\n### Sequence\n\nArray is the dynamic list of given element\n\n```txt\nmodule m {\n     struct c {\n        sequence\u003coctet\u003e idList;\n     }\n}\n```\n\n### TypeRef\n\n```txt\nmodule m {\n    struct c1 {\n        octet id1;\n        short id2;\n        unsigned short id3;\n    }\n    \n    struct c2 {\n        c1      refc1;\n        short   id2;\n    }\n}\n```\n\n## Installation\n\n```bash\ngo get github.com/Yisaer/idlparser\n```\n\n## Quick Start\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\n\t\"github.com/Yisaer/idlparser/ast\"\n)\n\nfunc main() {\n\tinput := `module example {\n\t\tstruct Point {\n\t\t\tlong x;\n\t\t\tlong y;\n\t\t};\n\t}`\n\n\tresult := ast.Parse(input)\n\tfmt.Printf(\"Parsed module: %+v\\n\", result.Output)\n}\n```\n\n## Example\n\nThe parser can handle complex IDL definitions:\n\n```bash\nmodule spi {\n\tbitset idbits {\n\t\tbitfield\u003c4\u003e bid;  // 4 bits for bid\n\t};\n\n\tstruct CANFrame {\n\t\t@format octet header;\n\t\t@format(a=\"b\",key=123) idbits id;\n\t};\n}\n```\n\nSee [ast_test.go](./ast/ast_test.go) for more parsing examples.\n\n## License\n\nThis project is licensed under the terms of the MIT license. See [LICENSE](./LICENSE) for details.\n\n## Contributing\n\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyisaer%2Fidl-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyisaer%2Fidl-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyisaer%2Fidl-parser/lists"}