Parses strings to find abstract functions (of the format SIFUNC[ARG1][ARG2][ARG3] and extract the arguments from that function and replace it with actual functions and any additional arguments needed
find_bracketed_arguments(str, pattern, replace = "", narg, op = "[", cp = "]")
string containing the actual function call/code built from the prototype function
string containing the prototype function call
string indicating the start of the function eg. "SI_TT_BOLUS["
string to replace pattern
with
number of arguments to prototype function
string used to indicating open parenthesis
string used to indicating close parenthesis