2. Parser
A parser is a compiler or interpreter component that
breaks data into smaller elements for easy
translation into another language. A parser takes
input in the form of a sequence of tokens or program
instructions and usually builds a data structure in the
form of a parse tree or an abstract syntax tree.
Types of Parsing
3. Top-Down Parser
Top-down parsing constructs parse tree for the input
string, starting from root node and creating the
nodes of parse tree in pre-order.
It is done by leftmost derivation for an input string.
4. Recursive Descent Parsing
Recursive descent is a top-down parsing technique
that constructs the parse tree from the top and the
input is read from left to right.
5. Back tracking
Backtracking is a general algorithm for finding all (or
some) solutions to some computational problems,
that incrementally builds candidates to the solutions,
and abandons each partial candidate (“backtracks”)
as soon as it determines that the candidate cannot
possibly be completed to a valid solution.