Lesson 06 Flashcards
Parsing
is the process of determining if and how a string of terminals can be generated by a grammar. O (n3)
The top-down
is done by starting with the root, labeled with the starting non terminal stmt
lookahead symbol.
The current terminal being scanned in the input
Predictive Parsing
in which the lookahead symbol unambiguously determines the flow of control through the procedure body for each non terminal
The predictive parser consists
of procedures for the non terminals type and simple of the grammar.
ɛ Productions
Predictive parser uses an ɛ production as a default when no other production can be used.
FIRST()
is the set of terminals that appear as thefirst symbols of one or more strings generated from alpha
Left Recursion
When a production for non terminal A starts with a self reference then a predictive parser stuck in loop forever.
Left Recursion can
be eliminated by systematically rewriting the grammar using right recursive productions