Compiler Design
Unit II
, Syntax Analysis
• Definition - Role of parser • Recursive Descent Parsing, back
• Lexical versus Syntactic Analysis tracking
• Representative Grammars • Computation of FIRST
• Syntax Error Handling • Problems related to FIRST
• Elimination of Ambiguity, Left • Computation of FOLLOW
Recursion • Problems related to FOLLOW
• Left Factoring • Construction of a predictive
• Top-down parsing parsing table SLR
• Error Recovery in Predictive • Predictive Parsers LL(1)
Parsing Grammars
• Predictive Parsing Algorithm • Transition Diagrams for
Predictive Parsers
• Non Recursive Predictive Parser
, Parser
• Parser is a program that obtains tokens from lexical analyzer and constructs the
parse tree which is passed to the next phase of compiler for further processing.
• Parser implements context free grammar for performing error checks
, The role of parser
token
Source Lexical Parse tree Rest of Front Intermediate
program Analyze Parser End representation
r
getNext
Token
Symbol
table
4
Unit II
, Syntax Analysis
• Definition - Role of parser • Recursive Descent Parsing, back
• Lexical versus Syntactic Analysis tracking
• Representative Grammars • Computation of FIRST
• Syntax Error Handling • Problems related to FIRST
• Elimination of Ambiguity, Left • Computation of FOLLOW
Recursion • Problems related to FOLLOW
• Left Factoring • Construction of a predictive
• Top-down parsing parsing table SLR
• Error Recovery in Predictive • Predictive Parsers LL(1)
Parsing Grammars
• Predictive Parsing Algorithm • Transition Diagrams for
Predictive Parsers
• Non Recursive Predictive Parser
, Parser
• Parser is a program that obtains tokens from lexical analyzer and constructs the
parse tree which is passed to the next phase of compiler for further processing.
• Parser implements context free grammar for performing error checks
, The role of parser
token
Source Lexical Parse tree Rest of Front Intermediate
program Analyze Parser End representation
r
getNext
Token
Symbol
table
4