def parse(input_string):
global  exprStack<EOL>global targetvar<EOL>exprStack = []<EOL>targetvar=None<EOL>if input_string != '<STR_LIT>':<EOL><INDENT>try:<EOL><INDENT>L=equation.parseString( input_string )<EOL><DEDENT>except ParseException as err:<EOL><INDENT>print('<STR_LIT>', file=sys.stderr)<EOL>print(err.line, file=sys.stderr)<EOL>print("<STR_LIT:U+0020>"*(err.column-<NUM_LIT:1>) + "<STR_LIT>", file=sys.stderr)<EOL>print(err, file=sys.stderr)<EOL>raise<EOL><DEDENT>if debug_flag:<EOL><INDENT>print(input_string, "<STR_LIT>", L)<EOL>print("<STR_LIT>", exprStack)<EOL><DEDENT>try:<EOL><INDENT>result=_evaluateStack(exprStack)<EOL><DEDENT>except TypeError:<EOL><INDENT>print("<STR_LIT>"%input_string, file=sys.stderr)<EOL>raise<EOL><DEDENT>except UnaryUnsupportedError:<EOL><INDENT>print("<STR_LIT>"%input_string, file=sys.stderr)<EOL>raise<EOL><DEDENT>if debug_flag: print("<STR_LIT>",targetvar)<EOL>if targetvar != None:<EOL><INDENT>try:<EOL><INDENT>result = _assignfunc(targetvar,result)<EOL><DEDENT>except TypeError:<EOL><INDENT>print("<STR_LIT>"%input_string, file=sys.stderr)<EOL>raise<EOL><DEDENT>except UnaryUnsupportedError:<EOL><INDENT>print("<STR_LIT>"%input_string, file=sys.stderr)<EOL>raise<EOL><DEDENT>return  result<EOL><DEDENT>else:<EOL><INDENT>print("<STR_LIT>"%input_string, file=sys.stderr)<EOL>raise TypeError<EOL><DEDENT><DEDENT>
Accepts an input string containing an LA equation, e.g.,
"M3_mymatrix = M3_anothermatrix^-1" returns C code function
calls that implement the expression.