THE
ROLE OF A PARSER
Parser obtains a
string of tokens from the lexical analyzer and verifies that it can be
generated by the language for the
source program. The parser should report any syntax errors in an intelligible
fashion.
The two types of
parsers employed are:
1.Top down parser: which build
parse trees from top(root) to bottom(leaves)
2.Bottom up parser: which
build parse trees from leaves and work up the root.
Therefore there are two types of parsing methods– top-down parsing and bottom-up
parsing.
![]()
Previous Page Home Next Page
Elimination of ambiguity & Top-down parsing
left recursion.$$ Left factoring