in Unknown Category
514 views
1 vote
1 vote
Is Syntax directed definition and translation is part of Syntax analysis or Semantic analysis?
in Unknown Category
by
514 views

1 Answer

2 votes
2 votes
Best answer
A syntax-directed definition (SDD) is a context-free grammar with attributes attached to grammar symbols and semantic rules attached to the productions. The semantic rules define values for attributes associated with the symbols of the productions. These values can be computed by creating a parse tree for the input and then making a sequence of passes over the parse tree, evaluating some or all of the rules on each pass. SDDs are useful for specifying translations.

So syntax-directed definition is a part of semantic analysis not syntax analysis as it is associated with meaning not only syntax.
selected by

2 Comments

but it is evaluated with parse trees..and parse trees are generated in syntax analysis phase?
0
0
ohhk got it....we need to assign meanings also to SDt which is done during semantic analysis phase..thanks bro;;
1
1