Write true (T) / false (F) for each of the following statements: A. Symbol…

2020

Write true (T) / false (F) for each of the following statements:

A. Symbol table is used only in first phase of a compiler.
B. A pretty printer analyses a program and prints it in such a way that the structure of the program becomes clearly visible.
C. YACC build up LALR parsing table.
D. If a grammar is LALR(1), it is not necessarily SLR(1).

  1. A.

    TTFT

  2. B.

    FTTT

  3. C.

    TTTF

  4. D.

    FTTF

Attempted by 72 students.

Show answer & explanation

Correct answer: B

The correct option is B (FTTT). Statement A is false because the symbol table is accessed by all phases of a compiler. Statements B, C, and D are true: pretty printers format code structurally, YACC generates LALR(1) parsing tables, and the LALR(1) class of grammars is strictly larger than SLR(1).

Explore the full course: Niacl Ao It Specialist