/    /  Compiler Design-Syntax Error Recovery

Syntax Error Recovery

 

The various strategies employed by parse to recover from syntactic error are as follows:

  • Panic Mode Recovery
  • Parse Level Recovery
  • Error Production
  • Global Production 

 

Panic Mode Recovery 

Panic mode recovery is a simple strategy employed by most of the parsing methods to recover from syntactic error. The idea behind is to discard a single input symbol one at a time after discovering the error unit until a set of synchronizing tokens like semicolon or end are found. Hence, this strategy mainly focuses on a considerable amount of input skips checking no additional input error. 

 

The advantage of this strategy is that it ensures that the parser will not enter an infinite loop while performing the skips. Besides these, we mainly use the method when there are fewer errors encountered in the statement. 

 

Reference Link

Syntax Error Recovery