You are on page 1of 1
Lecture 17 © ‘Note that productions output are tracing out a lefmost derivation. The grammar symbols on the stack make up lefi-sentenial forms, —— Tevninels & Men tereinely iw Heo stack, ‘Top-down parsing expands a parse tree from the start symbol to the leaves. It always expand the leftmost nomterminal. Consider the state A PF Bap Stl Bem S a Es > Sevivgling reached BAY with b the next token and we are trying to match Bby. There are two possibilities (BUM Table Construction 1. b belongs to an expansion of(@.)— Gvawnar Qube. ‘Any Aya can be used if b can start a string eg from a. In this case we say thatb € FIRST(4) ———» is ee Ai symbol 2. b does not belong to an expansion of A. Expansion of A is empty, ie, A-27€ and b belongs an expansion of 7, ¢.g., bx. which means that b can appear after A inva derivation of the form $2-$ BAbw. We say that b ¢ FOLLOW(A). CL pbav Any A-24 0 can be used if @ expands to €. We say that € € FIRST(A) in this case. in im Can ba devivabin CDeet YZ ee FIRST(X) = {b|X2$ba} U{e| Xie} Defi as ax eral gent

You might also like