正在加载图片...
Handle Informally,a handle of a string is a substring that matches the right side of a production rule. But not every substring matches the right side of a production rule is handle A handle of a right sentential form y (=aBo)is a production rule a-→βand a position ofy where the string B may be found and replaced by A to produce the previous right-sentential form in a rightmost derivation ofy. S台0A0三0β0 rm rm If the grammar is unambiguous,then every right-sentential form of the grammar has exactly one handle. We will see that o is a string of terminals. CS308 Compiler Theory 5Handle • Informally, a handle of a string is a substring that matches the right side of a prod ction r le of a production rule. – But not every substring matches the right side of a production rule is handle • A h dl an e of i h i lf f a right sentential form γ (≡ αβω) is a production rule A → β and a position of γ where the string where the string β may be found and replaced by A to produce may be found and replaced by A to produce the previous right-sentential form in a rightmost derivation of γ. S ⇒ αAω ⇒ αβω If th i bi th i ht t ti l f f th rm rm * • If the grammar is unambiguous, then every right-sentential form of the grammar has exactly one handle. • We will see that ω is a string of terminals CS308 Compiler Theory 5 We will see that ω is a string of terminals
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有