阿摩線上測驗 登入

申論題資訊

試卷:98年 - 98 公務升官等考試_薦任_資訊處理:程式語言#34333
科目:程式語言
年份:98年
排序:0

申論題內容

一、我們有下面的 BNF 文法。(15 分)
S ::= NP AS
NP ::= NOUN PHRASES
NOUN ::= “a man” | “a lady” | “a dog” | “a cat”
PHRASES ::= | PROP NOUN PHRASES
PROP ::= “with” | “for” | “by”
AS ::= VERB NP | AS CONC AS
VERB ::= “likes” | “owns” | “catches”
CONC ::= “and”
請依據上述文法,畫出下面句子的 derivation tree。
“a man with a cat likes a lady by a dog and owns a dog for a lady”