+1 vote
16 views

1 Answer

+1 vote
by (user.guest)
selected by (user.guest)
 
Best answer

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.

Related questions

+1 vote
1 answer
+1 vote
1 answer
+1 vote
1 answer
+1 vote
1 answer
+1 vote
1 answer
+1 vote
1 answer
+1 vote
1 answer
+1 vote
1 answer
+2 votes
1 answer
+1 vote
1 answer
+2 votes
1 answer
+1 vote
1 answer
+1 vote
1 answer
+1 vote
1 answer
+2 votes
2 answers
Welcome to CPEN Talk
Solution-oriented students of computer engineering on one platform to get you that

ONE SOLUTION

...