Another method of error recovery that can be implemented is called "phrase level recovery". In phrase level recovery, each error entry in the LL parsing table is examined, and based on language usage, an appropriate error-recovery procedure is constructed. For example, to recover from a construct error that starts with an operator, the error-recovery routine will insert an imaginary id into the input. Then, if some state terminal symbols are derived using an ∈-production, the error entries in that state are replaced by the derivation using the imaginary-id ∈-production. This has the effect of postponing error detection.
|