-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Milestone
Description
Is your feature request related to a problem? Please describe.
Some users need to define user-specific information for generating a decoder and process it into different forms before generation. Currently, the mcdecoder cannot process user-specific information before generation,
Describe the solution you'd like
Add a functionality to import user code to process user-specific information into a different form.
Possible implementations for this are:
- Define a python hook function to process user-specific information and refer it from MC description
- python config file
from mcdecoder.core import InstructionDecoder def process_instruction(instruction: InstructionDecoder) -> None: instruction.extras = ...
- MC description
decoder: process_instruction_hook: process_instruction
- python config file
- Define a python hook function to process user-specific information and register to mcdecoder
- python config file
from mcdecoder.core import InstructionDecoder, Environment # define a hook function def process_instruction(instruction: InstructionDecoder) -> None: instruction.extras = ... # register a hook function to the environment Environment.add_process_instruction_hook(process_instruction)
- python config file
Describe alternatives you've considered
N/A
Additional context
N/A
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request