Recursive Decent Parsing:Error Handling in nested functions
A simple panic-mode error handling system requires that we return to the top of the parser when any error is detected. At the top of the parser, we skip forward until we find a semi-colon (;), then resume parsing.
To return to the top of the parser when an error is detected in one of the parsing functions, we need to add error-handling code to all the functions.
Each parsing function may succeed (in which case we continue parsing) or fail (in which case we stop parsing and return). For example:
while( tokentype == PLUS || tokentype == MINUS ){
return TRUE; /* parsing succeeded so far */
while( tokentype == MULT || tokentype == DIV ){
return TRUE; /* parsing succeeded so far */