正在加载图片...
TWO Actions The two actions Generate: Replace a non-terminal a at the top of the stack by a string a(in reverse) using a grammar rule a-a, and Match: Match a token on top of the stack with the next input token The list of generating actions in the above table S→>(S)S[S→(S)S] (S[S→→8 ()[S → E Which corresponds precisely to the steps in a leftmost derivation of string This is the characteristic of top-down parsingTwo Actions • The two actions – Generate: Replace a non-terminal A at the top of the stack by a string α(in reverse) using a grammar rule A →α, and – Match: Match a token on top of the stack with the next input token. • The list of generating actions in the above table: S => (S)S [S→(S) S] => ( )S [S→ε] => ( ) [S→ε] • Which corresponds precisely to the steps in a leftmost derivation of string ( ). • This is the characteristic of top-down parsing
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有