What is a parse tree ?
A parse-tree is an internal structure, created by the compiler or interpreter while parsing some language construction. Parsing is also known as ‘syntax analysis’. An example (slightly adapted version of the example found at page 6 of the famous ‘Dragon Book’, Compilers: principles, techniques and tools, by Alfred V. Aho, Ravi Sethi and Jeffrey D. Ullman, Published by Addison Wesley. My copy is from 1986) will illustrate a parse tree. Rather than dealing with the complexities of a SQL statement, let’s take a rather simple language construction: The assignment of the result of an expression to a variable: result := salary + bonus * 1.10 When the compiler analyzes this statement the resulting parse-tree will look like this : assignment ________ statement ____ / | \ / := \ identifier ___ expression _______ | / | \ result / + \ expression __ expression ___ | / | \ identifier / * \ | expression expression salary | | identifier number | | bonus 1.10 The picture is an upside-down representati