# What is Dependence Graph ?

+1 vote
79 views

+1 vote
by
selected by (user.guest)

Dependence Graph: If an attribute b depends on an attribute c then the semantic rule for b must be evaluated after the semantic rule for c

The dependencies among the nodes can be depicted by a directed graph called dependency graph.

Dependency Graph: Directed graph indicating interdependencies among the synthesized and inherited attributes of various nodes in a parse tree.

Algorithm to construct dependency graph for each node n in the parse tree do for each attribute a of the grammar symbol do  construct a node in the dependency graph

for a

for each node n in the parse tree do

for each semantic rule b = f (c1 , c2 , ..., ck ) do { associated with production at n }

for i = 1 to k do

Construct an edge from ci to b

An algorithm to construct the dependency graph. After making one node for every attribute of all the nodes of the parse tree, make one edge from each of the other attributes on which it depends.

+1 vote
+1 vote
+1 vote
–1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote
+1 vote