申論題內容
四、給定文法(15 分)
<start>::= <stmt>
<stmt>::= <if-stmt> | <assign>
<if-stmt>::= if <expr> then<stmt>
| if <expr> then <stmt> else <stmt>
<assign>::= <ident> := <digit>
<expr>::= <ident> = <digit>
<digit>::= 0 | 1 | …| 9
<ident>::= a | b | …| z
剖析輸入 “if x = 0 then if y = 1 then z := 2 else w := 3”
繪出完整剖析樹之一,並說明另一可能之問題。