Difference between Top down parsing and Bottom up parsing

Content WritingFile SystemComputers

Top Down Parsing

Top down parsing technique is a parsing technique which starts from the top of the parse tree, move downwards, evaluates rules of grammer.

Bottom Up Parsing

Top down parsing technique is again a parsing technique which starts from the lowest level of the parse tree, move upwards and evaluates rules of grammer.

Following are some of the important differences between Top Down Parsing and Bottom Up Parsing.

Sr. No.KeyTop Down ParsingBottom Up Parsing
1StrategyTop down approach starts evaluating the parse tree from the top and move downwards for parsing other nodes.Bottom up approach starts evaluating the parse tree from the lowest level of the tree and move upwards for parsing the node.
2AttemptTop down parsing attempts to find the left most derivation for a given string.Bottom up parsing attempts to reduce the input string to first symbol of the grammer.
3Derivation TypeTop down parsing uses leftmost derivation.Bottom up parsing uses the rightmost derivation.
4ObjectiveTop down parsing searches for a production rule to be used to construct a string.Bottom up parsing searches for a production rule to be used to reduce a string to get a starting symbol of grammer.
raja
Published on 15-Apr-2020 11:17:40
Advertisements