Intermediate Compilers & Programming Language Theory
Q60 / 100

How does an LL(1) parser decide which production to apply?

Correct! Well done.

Incorrect.

The correct answer is C) It consults a parsing table indexed by the current non-terminal and the next single lookahead token, using FIRST and FOLLOW sets built from the grammar

C

Correct Answer

It consults a parsing table indexed by the current non-terminal and the next single lookahead token, using FIRST and FOLLOW sets built from the grammar

Explanation

LL(1) parsing tables are constructed from FIRST sets (tokens that can start a production) and FOLLOW sets (tokens that can follow a non-terminal). With one token of lookahead, the table gives a unique production to apply, avoiding backtracking.

Progress
60/100