Syntax Trees
- ismartthinking
- Apr 7, 2020
- 1 min read
Syntax trees are abstract or compact representation of parse trees.
They are also called as Abstract Syntax Trees.
Example-

Problem-01:
Considering the following grammar-
E → E + T | T
T → T x F | F
F → ( E ) | id
Generate the following for the string id + id x id
Parse tree
Syntax tree
Directed Acyclic Graph (DAG)
Solution-
Parse Tree-

Syntax Tree-

Directed Acyclic Graph-

Comments