Parsing & Syntax Analysis

Answer & solution
Official answer: A, D
Approach: Ask whether parsing starts with the input's terminal symbols and reduces upward, or starts with the grammar's start symbol and expands downward.
1. A shift-reduce parser shifts input symbols onto a stack, then reduces recognized handles to nonterminals. Repeated reductions construct the parse from leaves toward the root. Hence A is bottom-up.
2. An LR parser is a systematic shift-reduce parser. It reads input from left to right and reconstructs a rightmost derivation in reverse, so D is bottom-up as well.
3. Predictive parsing chooses productions while expanding from the start symbol toward the input. It is top-down, making B false.
4. LL(1) is a predictive, top-down method using one lookahead symbol. Its second L refers to a leftmost derivation, not to upward reduction. C is false.
Answer: A and D. LR and LL both scan left to right, so scan direction alone does not distinguish bottom-up from top-down.