COMPUTER SCIENCE AND ENGINEERING
COMPILER DESIGN
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
input
|
|
synchronizing
|
|
group
|
|
none
|
Detailed explanation-1: -Panic-mode error recovery says that all the input symbols are skipped until a synchronizing token is found from the string. In this recovery method, we use FOLLOW symbols as synchronizing tokens and the “synch” in the predictive parsing table to indicate synchronizing tokens obtained from the nonterminal’s FOLLOW sets.
Detailed explanation-2: -In panic-mode recovery, on discovering an error, the parser discards input symbols one at a time until one of a designated set of synchronizing tokens is found. The synchronizing tokens are usually delimiters, such as a semicolon, whose role in the source program is clear.
Detailed explanation-3: -Error correction is done by discarding some input symbols and popping up some symbols from the parsing-stack in order to restore the parser to a valid configuration. Thus, symbol deletions and insertions are simulated.
Detailed explanation-4: -Errors in the program should be detected and reported by the parser. Whenever an error occurs, the parser can handle it and continue to parse the rest of the input. Although the parser is mostly responsible for checking for errors, errors may occur at various stages of the compilation process.