MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

COMPILER DESIGN

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which of the following actions an operator precedence parser may take to recover from an error?
A
Delete symbols from the stack
B
Insert symbols onto the stack
C
Inserting or deleting symbols from the input
D
All of these
Explanation: 

Detailed explanation-1: -Which of the following actions an operator-precedence parser may take to recover from an error? a)Insert symbols onto the stackb)Delete symbols from the stackc)Insert or delete symbols from the inputd)All of the aboveCorrect answer is option ā€˜Dā€™.

Detailed explanation-2: -Error Recovery in operator-precedence parsing: If no precedence relation holds between the terminal on top of the stack and the current input. If a handle has been found, but there is no production with this handle as a right side.

Detailed explanation-3: -There are two types of operator precedence parsing errors, namely character pair errors and reducibility errors.

Detailed explanation-4: -Which of the following is true for operator precedence parsing? Explanation: There are two important properties for these operator precedence parsers is that it does not appear on the right side of any production and no production has two adjacent non-terminals.

Detailed explanation-5: -An operator-precedence parser is a simple shift-reduce parser that is capable of parsing a subset of LR(1) grammars. More precisely, the operator-precedence parser can parse all LR(1) grammars where two consecutive nonterminals and epsilon never appear in the right-hand side of any rule.

There is 1 question to complete.