convertHumanReadableToInstructionSet
convertHumanReadableToInstructionSet(
syntax
,names
,indexMap
,existingPlaceHolders
):InstructionSet
Interprets a given syntax string into an instruction set and placeholders.
This function processes a syntax string by constructing an Abstract Syntax Tree (AST), splitting it based on logical operators (AND/OR), and recursively iterating over the tree to generate an instruction set. It also handles placeholders and maps indices for tracking.
Parameters
Parameter | Type | Description |
---|---|---|
syntax | string | The input syntax string to be interpreted. |
names | any [] | An array of names used in the instruction set. |
indexMap | trackerIndexNameMapping [] | A mapping of tracker indices to names. |
existingPlaceHolders | PlaceholderStruct [] | An array of existing placeholders to be considered. |
Returns
An object containing:
instructionSet
: The generated instruction set based on the input syntax.placeHolders
: The placeholders used in the instruction set.