Site icon i2tutorials

Compiler Design-Top-Down and Bottom-up Parser

Top-Down and Bottom-up Parser

 

Let us look into the basic Differences between the top-down and Bottom-up Parser.

The following mentioned below are the differences between a Top-Down Parser and a Bottom-Up parser.

 

Top- Down ParserBottom-Up Parser
Parse tree can be built from the roots to the leavesParse tree is built from the leaves to the root
It is simple to implementIt is complex to implement
Less efficient parsing technique, various problems occur during top-down technique such as ambiguity, left recursionBottom-up parser handles ambiguous grammar conflict occur in parse table
It is applicable to small class of languagesIt’s applicable to a broad class of languages.
Various Parsing techniques are: 
  1. Recursive Descent
  2. Predictive
Various Parsing techniques are:
  1. Shift reduce
  2. Operator Precedence
  3. LR Parser

 

Reference Link

Top-Down and Bottom-up Parser

Exit mobile version