0
0
Compiler Designknowledge~10 mins

Top-down vs bottom-up parsing overview in Compiler Design - Interactive Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to identify the parsing method that starts from the root and expands downwards.

Compiler Design
The parsing method that starts from the root and expands downwards is called [1] parsing.
Drag options to blanks, or click blank then click option'
Atop-down
Bbottom-up
Cshift-reduce
DLR
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing top-down with bottom-up parsing.
Thinking bottom-up parsing starts from the root.
2fill in blank
medium

Complete the code to identify the parsing method that starts from the input symbols and builds up to the root.

Compiler Design
The parsing method that starts from the input symbols and builds up to the root is called [1] parsing.
Drag options to blanks, or click blank then click option'
Atop-down
Bpredictive
Cbottom-up
Drecursive descent
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing bottom-up with top-down parsing.
Assuming bottom-up parsing starts from the root.
3fill in blank
hard

Fix the error in the statement about parsing methods.

Compiler Design
Top-down parsing uses [1] to decide which production to apply next.
Drag options to blanks, or click blank then click option'
Astack
Bbacktracking
Cshift-reduce
Dlookahead
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing shift-reduce with top-down parsing.
Thinking top-down parsing always backtracks.
4fill in blank
hard

Fill both blanks to complete the description of bottom-up parsing.

Compiler Design
Bottom-up parsing uses a [1] to hold symbols and applies [2] actions to reduce input to the start symbol.
Drag options to blanks, or click blank then click option'
Astack
Bqueue
Cshift-reduce
Dpredictive
Attempts:
3 left
💡 Hint
Common Mistakes
Using queue instead of stack for bottom-up parsing.
Confusing predictive parsing with bottom-up parsing.
5fill in blank
hard

Fill all three blanks to complete the summary of parsing differences.

Compiler Design
In top-down parsing, the parser starts from the [1] and uses [2] to predict productions, while bottom-up parsing starts from the [3] and uses shift-reduce actions.
Drag options to blanks, or click blank then click option'
Astart symbol
Blookahead
Cinput symbols
Dstack
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up start symbol and input symbols.
Confusing lookahead with stack.