During syntax analysis, a parser detects an error but continues parsing by replacing the erroneous token with a valid one. What is this technique called?
15 views
- Panic Mode Recovery
- Error Correction by Phrase-Level Recovery (Correct Answer)
- Backtracking
- Lexical Recovery
Explanation
Phrase-level recovery attempts to correct errors by locally replacing or inserting tokens to continue parsing. Unlike panic mode, which skips tokens until a synchronizing symbol, phrase-level recovery preserves more of the input structure.