Beginner Compilers & Programming Language Theory
Q14 / 100

What is the difference between top-down and bottom-up parsing?

Correct! Well done.

Incorrect.

The correct answer is B) Top-down (recursive descent, LL) starts from the start symbol and derives; bottom-up (LR, shift-reduce) starts from tokens and reduces to the start symbol

B

Correct Answer

Top-down (recursive descent, LL) starts from the start symbol and derives; bottom-up (LR, shift-reduce) starts from tokens and reduces to the start symbol

Explanation

LL parsers: predictive, use lookahead to predict which production to apply. LR parsers: build rightmost derivation in reverse, handle larger grammar classes. GCC uses recursive descent; LR is used by Yacc/Bison.

Progress
14/100