1.

Which of the following describes a handle (as applicable to LR-parsing) appropriately?(a) It is the position in a sentential form where the next shift or reduce operation will occur(b) It is a non-terminal whose production will be used for reduction in the next step(c) It is a production that may be used for reduction in a future step along with a position in the sentential form where the next shift or reduce operation will occur.(d) It is the production p that will be used for reduction in the next step along with a position in the sentential form where the right hand side of the production may be foundI had been asked this question during an interview for a job.My query is from Intermediate Code-Generation topic in division Syntax Directed Definition and Translations of Compiler

Answer»

The CORRECT option is (d) It is the production p that will be used for reduction in the next STEP along with a position in the sentential form where the right hand SIDE of the production may be found

The explanation: Handles are the PART of sentential form, & they are identified as the right side of any given production which will be used for reduction in the next step.



Discussion

No Comment Found

Related InterviewSolutions