正在加载图片...
Left-Most and Right-Most Derivations Left-Most Derivation E盒E盒(E)盒-(E+E)盒(id+E)盒(id+id) Right-Most Derivation E盒E盒-(E)a-(E+E)a(E+id)盒-(id+id) We will see that the top-down parsers try to find the left-most derivation of the given source program. We will see that the bottom-up parsers try to find the right-most derivation of the given source program in the reverse order. CS308 Compiler Theory 9Left-Most and Right-Most Derivations Left-Most Derivation E ⇒ -E ⇒ -(E) ⇒ -(E+E) ⇒ -(id+E) ⇒ -(id+id) lm lm lm lm lm Right-Most Derivation E ⇒ - E ⇒ -(E) ⇒ -(E+E) ⇒ -(E+id) ⇒ -(id+id) (id+id) W ill h h d fi d h l f di i rm rm rm rm rm • We will see t hat t he top￾down parsers try to fi n d t he l e ft-most der ivat ion of the given source program. • We will see that the bottom-up parsers try to find the right-most derivation of the given source program in the reverse order CS308 Compiler Theory 9 derivation of the given source program in the reverse order
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有