SUBJECT CODE: 203105351
Prof. Praveen Kumar, Assistant Professor
Computer Science & Engineering
, CHAPTER-3
Top-down parsing
, What is Parsing
Parsing: is that phase of compiler which takes token string as input and with the
help of existing grammar, converts it into the corresponding parse tree.
-> Parser is also known as Syntax Analyzer
⮚Parsing technique is divided in two Types.
Image source : Google
, Top - Down Parsing:
Top-down parser: is the parser which generates parse for the given input string
with the help of grammar productions by expanding the non-terminals i.e. it
starts from the start symbol and ends on the terminals.
⮚It uses left most derivation
Bottom-Up/Shift Reduce parser :Bottom-up Parser is the parser which
generates the parse tree for the given input string with the help of grammar
productions by compressing the non-terminals i.e. it starts from non-terminals
and ends on the stat symbol
⮚It uses reverse of the right most derivation.