

MCQOPTIONS
Saved Bookmarks
This section includes 6 Mcqs, each offering curated multiple-choice questions to sharpen your Compilers knowledge and support exam preparation. Choose a topic below to get started.
1. |
In a bottom-up evaluation of a syntax directed definition its inherited attributes can do which of the following? |
A. | Always evaluated |
B. | Can be evaluated if the definition is L attributed |
C. | Can be evaluated if the definition has synthesized attributes |
D. | Never be evaluated |
Answer» C. Can be evaluated if the definition has synthesized attributes | |
2. |
Which grammar rules violate the requirements of an operator grammar? |
A. | 1 only |
B. | 1 and 3 only |
C. | 2 and 3 only |
D. | 3 and 4 onlyView Answer |
Answer» C. 2 and 3 only | |
3. |
Consider the grammar. For a sentence n + n × n, the handles in the right-sentential form of the reduction are __________ |
A. | n, E + n and E + n × n |
B. | n, E + n and E + n × n |
C. | n, n + n and n + n × n |
D. | n, E + n and E × nView Answer |
Answer» E. | |
4. |
The grammar A → AA | (A) | e is not suitable for predictive-parsing because the grammar is? |
A. | | e is not suitable for predictive-parsing because the grammar is?a) Ambiguous |
B. | Left recursive |
C. | Right recursive |
D. | An operator grammar |
Answer» C. Right recursive | |
5. |
Consider the grammar defined by the following production rules: Which one of the following is TRUE? |
A. | + is left associative, while ∗ is right associative |
B. | + is right associative, while ∗ is left associative |
C. | Both + and ∗ are right associative |
D. | Both + and ∗ are left associativeView Answer |
Answer» C. Both + and ∗ are right associative | |
6. |
Find the TRUE statement? |
A. | I and II |
B. | I and IV |
C. | III and IV |
D. | I III and IVView Answer |
Answer» C. III and IV | |