Compiler Construction MCQ :Syntax Analysis(Parser)-LEADING & TRAILING, Operator Precedence Parser & Grammar : Link5

Compiler Construction MCQ :Syntax Analysis(Parser)-LEADING & TRAILING, Operator Precedence Parser & Grammar : Link5

Compiler Construction MCQ & Answers

       Are you worried about the answers to Compiler Construction questions :Syntax Analysis(Parser)-LEADING & TRAILING, Operator Precedence Parser & Grammar ? We have arranged the Show Answer button under the each question. Candidates can click on it to know the right option among the given alternatives. Furthermore, the applicants can check our web portal @ www.totalmcq.com to take part in more MCQ on various subject. Wish, the given information about the Compiler Construction MCQ will helpful to the advance and can learn the various types of questions and answers.


Q.1. Which is not a shift reduce parser action.

A. Shift                                                                           B. goto
C. Reduce                                                                      D. Accept

Q.2. The operator precedence parsing not uses-----precedence relation.

A. <                                                                                  B. >
C. =                                                                                  D. >=

Q.3. ---------grammars have the restriction that no production has either an empty right-hand side (ε) or two adjacent non-terminals in its right-hand side.

A. operator precedence                                                B. precedence
C. operator                                                                     D. None of the above

Q.4. Which of these have highest precedence?

A. *                                                                                   B. ++
C. >>                                                                                 D. ()

Q.5. Which is not the operator precedence relations?

A. a>=b                                                                             B. a ⋗ b
C. a ⋖ b                                                                            D. a ≐ b

Q.6. What is the LEADING(S) for the following grammar?
S➔S-B|B
B➔B*A|A
A➔(S)|id

A. LEADING(S)={-,*,),id}                                                 B. LEADING(S)={-,*,(,)}
C. LEADING(S)={-,*,(,id}                                                 D. LEADING(S)={-,*,(}

Q.7. What is the TRAILING(S) for the following grammar?
S➔S-B|B
B➔B*A|A
A➔(S)|id

A. TRAILING(S)={-,*,),id}                                                B. TRAILING(S)={-,*,(,)}
C. TRAILING(S)={-,*,(,id}                                                D. TRAILING(S)={-,*,(}

Q.8. What is the similarity between LR, LALR and SLR?

A. Use same algorithm, but different parsing table.
B. Same parsing table, but different algorithm.
C. Their Parsing tables and algorithm are similar but uses top down approach.
D. Both Parsing tables and algorithm are different.

Q.9. 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

Q.10. Which of these is true about LR parsing?

A. Is most general non-backtracking shift-reduce parsing.
B. It is still efficient.
C. LR means the input scans from left to right and generate rightmost derivation in reverse.
D. All of the above.

Q.11.Which function is uesd to map terminal symbols to integers in Operator precedence parsers?

A. precedence functions                                               B. operator function
C. operand function                                                       D. None of the above.

Q.12. For parsing arithmetic expressions, involving (, ), + and - , the precedence relation between - and -, will be <, if-------

A. minus is left associative                                             B. minus is right associative
C. we are talking of unary minus                                  D. a ( comes in between

Q.13. The precedence relation between ) and ( will be --------

A. <                                                                                    B. >
C. =                                                                                    D. undefined

Q.14. LR stands for-------

A. Left to right                    B. Left to right reduction
C. right to left                     D. Left to right and right-most derivation in reverse.

Q.15. What is the TRAILING(T) for the following grammar?
E➔E+T|T
T➔T*F|F
F➔id|(E)

A. TRAILING(T)={+,*,(}                                                    B. TRAILING(T)={*,id,(}
C. TRAILING(T)={*,id,)}                                                  D. TRAILING(T)={+,*,id}