Top-down Parsing is a parsing technique that first looks at the highest level of the parse tree and works down the parse tree by using the rules of grammar while Bottom-up Parsing is a parsing technique that first looks at the lowest level of the parse tree and works up the parse tree by using the rules of grammar.
There are some differences present to differentiate these two parsing techniques, which are given below:
|S.No||Top Down Parsing||Bottom Up Parsing|
|1.||It is a parsing strategy that first looks at the highest level of the parse tree and works down the parse tree by using the rules of grammar.||It is a parsing strategy that first looks at the lowest level of the parse tree and works up the parse tree by using the rules of grammar.|
|2.||Top-down parsing attempts to find the left most derivations for an input string.||Bottom-up parsing can be defined as an attempts to reduce the input string to start symbol of a grammar.|
|3.||In this parsing technique we start parsing from top (start symbol of parse tree) to down (the leaf node of parse tree) in top-down manner.||In this parsing technique we start parsing from bottom (leaf node of parse tree) to up (the start symbol of parse tree) in bottom-up manner.|
|4.||This parsing technique uses Left Most Derivation.||This parsing technique uses Right Most Derivation.|
|5.||It’s main decision is to select what production rule to use in order to construct the string.||It’s main decision is to select when to use a production rule to reduce the string to get the starting symbol.|
- Construction of LL(1) Parsing Table
- Parsing | Set 1 (Introduction, Ambiguity and Parsers)
- Parsing ambiguos grammars using LR parser
- Algorithm for non recursive Predictive Parsing
- Difference between Bottom-Up Model and Top-Down Model
- Bottom Up or Shift Reduce Parsers | Set 2
- Difference between MP4 and MP3
- Difference between 1G and 2G
- Difference between RAM and ROM
- What is the difference between GUI and CUI?
- Difference between URL and URI
- Difference between LAN, MAN and WAN
- Difference Between SEO and SEM
- Difference between H.323 and SIP
- Difference between Blu-ray and DVD
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.