/    /  Compiler Design-Phrase Level Recovery

Phrase Level Recovery

 

Phrase Level Recovery strategy is employed by most error repairing compilers to recover from syntactic error. The main idea in this method is to perform local correction on those input strings that were remaining unchecked on discovering an error.

 

We can do this correction by substituting a string in place of the input prefix. 

 

Some of the local corrections done by compiler design are;

  • Replacing comma by semicolon
  • Deleting extra semicolon
  • Inserting missing semicolon

 

The main drawback of this method is that it faces difficulty in finding the occurrence of the actual error before performing detection.  

 

Reference Link

Phrase Level Recovery