Theory of Automata

Syntax Tree In Automata 

When you construct a parse tree then it may contains more details than actually required. So, it is very difficult to compiler to execute unnecessary information’s. That’s why a syntax tree is used which holds just necessary information’s.

Example of Syntax Tree

Consider the following Parse tree

Parse Tree in Automata

As above parse tree is providing the string is “id + id * id ”. Now let us eliminate the extra information from given parse tree to get the same string.

Syntax Tree in Automata

Hence, A String “id + id * id” is derived by elimination of unnecessary information’s. It is called syntax tree.

Abstract Syntax Tree

Abstract syntax tree can be represented as follows

Abstract Syntax Tree

In compiler the Abstract syntax trees are important because abstract syntax tree contains the least unnecessary information.

Help Other’s By Sharing…

Contact Us

Burewala, Vehari, Punjab, Pakistan


Pin It on Pinterest