A pretty book had a happy Mary sentence
Sign up to view full document!
SIGN UP
根據題目之文法產生規則,寫出以下敘述的推導方法。 A pretty book had a happy Mary <sentence>: : = <noun phrase><verb phrase> <noun phrase>: : = <article><adjective><name>∣<article> <adjective > <noun> <verb phrase>: : = <verb>∣<verb><noun phrase> <name>: : = John∣Mary <noun>: : = book∣peanut∣friend <adjective>: : = happy∣pretty∣tasty <article>: : = a∣the <verb>: : = ate∣loved∣had
• • • 請解釋下列名詞: (1) 關鍵字(key word) (2) 保留字(reserved word) (3) 懸置指標(dangling pointer) (4) 懸置標記引用(dangling label reference)
• • 設有一語言以EBNF (Extended Backus-Naur Form) 規則式定義如下: <bin-num> : : = [<digit>] <three-ones>[<digit>] <three-ones> : : = 111 <digit> : : = 0 | 1 | 0 <bin-num> | 1 <bin-num> 請指出以下四個式子,何者符合上述的文法規定: (1) 0000111111010 (2) 1111110 (3) 0011000101011 (4) 011011111
- Slides: 12