正在加载图片...
Example 5. 1 The augmented grammar for balanced parentheses: s"→S s→(S)SE a bottom-up parser of the string (using this grammar is given in following table Parsing stack Input Action OS shift SO reduce S→e 234567 S(S )S shift S(S reduce s→E S(S)s Reduce S→(S)S s reduce S→S S accept• Example 5. 1 The augmented grammar for balanced parentheses: S' → S S → (S)S|ε • A bottom-up parser of the string ( ) using this grammar is given in following table 1 2 3 4 5 6 7 Parsing stack Input Action $ $( $(S $(S) $(S)S $S $S’ ( )$ )$ )$ $ $ $ $ shift reduce S→ε shift reduce S→ε reduce S → (S)S reduce S' → S accept
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有