MCQOPTIONS
Saved Bookmarks
This section includes 5 Mcqs, each offering curated multiple-choice questions to sharpen your Compilers knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
When is empty (A -> .,a), the reduction by A-> a is done by _________ |
| A. | If next symbol is a terminal |
| B. | Only If the next input symbol is a |
| C. | Only If the next input symbol is A |
| D. | Only if the next input symbol is a |
| Answer» E. | |
| 2. |
When (in the LR(1) item A -> .a,a) is not empty, the look-head _________ |
| A. | Will be affecting |
| B. | Does not have any affect |
| C. | Shift will take place |
| D. | Reduction will take place |
| Answer» C. Shift will take place | |
| 3. |
If a state does not know whether it will make a shift operation or reduction for a terminal is called _________ |
| A. | Shift/reduce conflict |
| B. | Reduce /shift conflict |
| C. | Shift conflict |
| D. | Reduce conflict |
| Answer» B. Reduce /shift conflict | |
| 4. |
Which of the following is incorrect for the actions of A LR-Parser I) shift s ii) reduce A-> iii) Accept iv) reject? |
| A. | Only I) |
| B. | I) and ii) |
| C. | I), ii) and iii) |
| D. | I), ii) , iii) and iv) |
| Answer» D. I), ii) , iii) and iv) | |
| 5. |
An LR-parser can detect a syntactic error as soon as __________ |
| A. | The parsing starts |
| B. | It is possible to do so a left-to-right scan of the input |
| C. | It is possible to do so a right-to-left scan of the input |
| D. | Parsing ends |
| Answer» C. It is possible to do so a right-to-left scan of the input | |