So I am asked to write a function called parens that will allow me to do this. Say that I have a string (a + (x) * (6 + 14) - q7), then I will get:
(6 + 14)
(a + (x) * (6 + 14) - q7)
the function parens takes a parameter which is the address of the starting string which is always a '('. The base case here is when it finds ')' then it prints another function called printFormula that takes two parameter, one is the address of the '(' ($a0) and the number of chars to be printed ($a1). Whenever it sees a '(' then it will call the function parens again. My confusion is that what should I do when it's not a '(' or a ')' ?? Can someone help me to develop this function??