4) Grammar Structure
grammar = [
['sentence', '->', ['noun-phrase', 'verb-phrase']],
['noun-phrase', '->', ['Article', 'Noun']],
['verb-phrase', '->', ['Verb', 'noun-phrase']],
['Article', '->', ['the', 'a']],
['Noun', '->', ['man', 'ball', 'woman', 'table']],
['Verb', '->', ['hit', 'took', 'saw', 'liked']]
]
For this grammar:
• Write down 2 valid sentences
• Write down all terminals
• Write all non-terminals