{"id":20704773,"url":"https://github.com/tekord/cpp-opcode-generator","last_synced_at":"2025-04-23T01:30:32.691Z","repository":{"id":196178759,"uuid":"154993210","full_name":"tekord/cpp-opcode-generator","owner":"tekord","description":"A python script for generating enums with opcode constants based on YAML file definition","archived":false,"fork":false,"pushed_at":"2025-01-08T20:41:16.000Z","size":19,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T20:51:10.204Z","etag":null,"topics":["compilers","cpp","emulation","generators","opcode","programming-language-development","python","rust","virtual-machine"],"latest_commit_sha":null,"homepage":"","language":"Python","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/tekord.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2018-10-27T17:52:35.000Z","updated_at":"2025-01-08T20:41:17.000Z","dependencies_parsed_at":"2023-09-22T09:41:02.871Z","dependency_job_id":"d54a8720-f79e-41eb-bce6-fbe10c5974a3","html_url":"https://github.com/tekord/cpp-opcode-generator","commit_stats":null,"previous_names":["tekord/cpp-opcode-generator"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tekord%2Fcpp-opcode-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tekord%2Fcpp-opcode-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tekord%2Fcpp-opcode-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tekord%2Fcpp-opcode-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tekord","download_url":"https://codeload.github.com/tekord/cpp-opcode-generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250352099,"owners_count":21416436,"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":["compilers","cpp","emulation","generators","opcode","programming-language-development","python","rust","virtual-machine"],"created_at":"2024-11-17T01:14:39.861Z","updated_at":"2025-04-23T01:30:32.669Z","avatar_url":"https://github.com/tekord.png","language":"Python","readme":"# Opcode constant generator for C, C++ and Rust programming languages\n\nA python script for generating enums with opcode constants based on YAML file definition. It may be useful for \nvirtual machine developers. Defining opcodes in external file instead of direct C++/Rust enum has some advantages:\n\n1. It is easier to read. Definition file contains only relevant information, no C++ code.\n2. You can automate a documentation building.\n3. Opcode definition is isolated from your virtual machine implementation, so you can use it in non-C++ implementation\n(of course you'll have to modify this script a little bit).\n\nWritten on Python 3.\n\n## Installation\n\nExecute the following command to install dependencies:\n\n```\npip install -r requirements.txt\n```\n\n## Usage\n\nCopy the `opcodes.example.yaml` file to your application's folder, define all the opcodes you need in this file. \nThen run the script with the following arguments:\n\n```\npython main.py \u003copcode-list\u003e \u003clanguage\u003e [--output path/to/file]\n```\n\nwhere `opcode-list` is a path to file with opcodes (.yaml file); `language` is one of the following options: `c`, \n`cpp`, `rust`; `--output` specified the output file path. If the `output` option is not provided then result will \nbe printed to the standard output.\n \nThe result may look like this:\n\n```cpp\nenum _GeneratedOpCodes {\n    OPCODE_NOP = 0x00,\n    OPCODE_B = 0xA0,\n    OPCODE_BZ = 0xA1,\n    OPCODE_B_FALSE = 0xA1 /* alias for BZ */,\n    OPCODE_B_ZERO = 0xA1 /* alias for BZ */,\n    OPCODE_B_NULL = 0xA1 /* alias for BZ */,\n    OPCODE_BNZ = 0xA2,\n    OPCODE_B_TRUE = 0xA2 /* alias for BNZ */,\n    OPCODE_B_NOT_ZERO = 0xA2 /* alias for BNZ */,\n    OPCODE_B_NOT_NULL = 0xA2 /* alias for BNZ */\n};\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftekord%2Fcpp-opcode-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftekord%2Fcpp-opcode-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftekord%2Fcpp-opcode-generator/lists"}