Parse trees
•	Basic properties
•	One step
•	Ambiguous grammars
Basic properties
•	Visual representation of derivation
•	Root is start symbol
•	Tree (like computer science trees in general) has root on top
•	Leaves should all be terminals
One step
•	Each inner node corresponds to nonterminal being replaced
•	Nonterminal replaced by right side in "Children" nodes, left to right 
•	Each nonterminal or terminal gets its own node
Ambiguous grammars
•	A grammar which allows more than one derivation for the same screen
•	More than one derivation => more than one parse tree
•	Ex: <expr> -> <expr> - <expr> | <number>
•	What are the possible derivations for "3 - 2 - 1"? What value would each derivation imply?
Ambiguous grammar example
•	<expr> => <expr> - <expr>, but then either
•	<number> - <expr>    OR
•	<expr> - <expr> - <expr>
•	If you draw the parse trees, 
•	natural interpretation of the 1st approach = 3 – (2 – 1) = 2
•	2nd approach: (3 – 2) – 1 = 0
•	Lesson to learn: don’t use ambiguous grammars! J
More on writing grammars
•	Productions where the right side has no terminals -- like base cases of recursion
•	Derivations must "reach" these
•	Nonterminals on right side represent (nonoverlapping) parts of the string