This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: <sentence> ::= <noun phrase> <verb phrase>. <noun phrase> ::= <determiner> <noun> | <determiner> <noun> <prepositional phrase> <verb phrase> ::= <verb> | <verb> <noun phrase> | <verb> <noun phrase> <prepositional phrase> <prepositional phrase> ::= <preposition> <noun phrase> <noun> ::= boy | girl | dog | ball | photo | feather <determiner> ::= a | the <verb> ::= saw | touched | kicked | took <preposition> ::= by | with a). Draw a Derivation Tree of the following input: the boy touched the dog with a feather. b). Is this an ambiguous grammar? why? 4. Problem 4 Given the following LL(1) grammar: 1. P -> S $ $ 2. S -> ( S ) S 3. S -> [ S ] S 4. S -> and the following input: ( ( ) [ ] ) [ ] $ $ 1. Draw the Parse Table for the grammar. 2. Draw the LL(1) Parsing Traces of the input sentence above, with the format similar to that in lecture slides (04page#13). 3. Which has higher precedence? "[" or "("?...
View Full Document
This note was uploaded on 01/22/2012 for the course COP 5555 taught by Professor Staff during the Fall '08 term at University of Florida.
- Fall '08