{"id":24331060,"url":"https://github.com/nbkredspy/transpileutilities","last_synced_at":"2025-07-03T09:07:23.975Z","repository":{"id":145895815,"uuid":"617645304","full_name":"NBKRedSpy/TranspileUtilities","owner":"NBKRedSpy","description":"A Harmony Transpiler helper that can create the complement of a local Load or Store OpCode.  Useful for supporting multiple versions of code which vary the local load/store operations.","archived":false,"fork":false,"pushed_at":"2023-03-23T21:30:36.000Z","size":34,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-29T19:18:05.606Z","etag":null,"topics":["harmony","transpiler","utility"],"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/NBKRedSpy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2023-03-22T20:16:01.000Z","updated_at":"2025-05-07T08:55:49.000Z","dependencies_parsed_at":"2023-04-09T19:02:22.190Z","dependency_job_id":null,"html_url":"https://github.com/NBKRedSpy/TranspileUtilities","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/NBKRedSpy/TranspileUtilities","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NBKRedSpy%2FTranspileUtilities","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NBKRedSpy%2FTranspileUtilities/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NBKRedSpy%2FTranspileUtilities/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NBKRedSpy%2FTranspileUtilities/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NBKRedSpy","download_url":"https://codeload.github.com/NBKRedSpy/TranspileUtilities/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NBKRedSpy%2FTranspileUtilities/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263296492,"owners_count":23444494,"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":["harmony","transpiler","utility"],"created_at":"2025-01-18T01:17:17.771Z","updated_at":"2025-07-03T09:07:23.965Z","avatar_url":"https://github.com/NBKRedSpy.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Description \nA Harmony transpiler helper class that can take a local variable load or store operation and create the complement.\n\nUseful when different versions of the target code may change operations.  For example, stloc_3 to stloc_s.\n\n# Examples\n## Code Matcher Example:\n\n```csharp\nStackVariableInstruction fooVariable = null;   //The local variable\n\nreturn codeMatcher\n    .MatchForward(true,\n        ...\n        //The first parameter determines if a load or store operation is required for a successful CodeMatch.\n        new CodeMatch(instruction =\u003e StackVariableInstruction.Create(expectStore: true, instruction, out fooVariable))\n        ...\n        )\n    .ThrowIfNotMatch(\"Did not find load section\")        \n    .Insert(\n        //Inserts a load operation\n        fooVariable.Load,\n        \n        //Some function call\n        CodeInstruction.Call(typeof(Foo), nameof(Foo.Bar)),\n        \n        //Inserts a store operation\n        fooVariable.Store\n    )\n    .InstructionEnumeration();\n```\n## Using Directly:\n```csharp\nvar instruction = new StackVariableInstruction(new CodeInstruction(OpCodes.Stloc_2));\ninstruction.Load;   //Return the load version\ninstruction.Store;  //Return the store version\n```\n\n# Using the Code\nCopy the StackVariableInstruction.cs file from [releases](https://github.com/NBKRedSpy/TranspileUtilities/releases) into the target project.\n\n# StackVariableInstruction.Create\n\nA utility function to create a stack variable while using a code matcher.\n\n|Parameter|Description|\n|--|--|\n|isStore|If true, will expect the codeInstruction to be a store opcode.  Otherwise a load opcode.|\n|codeInstruction|The instruction source.|\n|stackVariable|The newly created stack variable.  Will be null if no match.|\n|returns|True if the opcode matched the isStore expectations.|\n\n\n# Project Folders\n|Project|Description|\n|--|--|\n|src/TranspileUtilities|Creates the /StackVariableInstruction.cs file|\n|src/TranspileUtilitiesTest|The tests for the TranspileUtilities project|\n|src/ILTest|Creates a DLL with the various load/store operations for testing purposes.  Not used in this project|\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnbkredspy%2Ftranspileutilities","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnbkredspy%2Ftranspileutilities","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnbkredspy%2Ftranspileutilities/lists"}