正在加载图片...
Recursive Predictive Parsing (cont.) When to apply s-productions. A->aA bB 8 If all other productions fail,we should apply an 8-production.For example,if the current token is not a or b,we may apply the 8-production. Most correct choice:We should apply an 8-production for a non- terminal A when the current token is in the follow set of A (which terminals can follow A in the sentential forms). CS308 Compiler Theory 8Recursive Predictive Parsing (cont.) • When to apply ε-productions. A → aA | bB | ε • If all other productions fail, we should apply an ε-production. For example, if the current token is not a or b, we may apply the ε-production. • M h i W h ld l Most correct c h o ice: We s hould app ly an ε - prodif uct ion for a non￾terminal A when the current token is in the follow set of A (which terminals can follow A in the sentential forms) terminals can follow A in the sentential forms). CS308 Compiler Theory 8
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有