531 views
1 votes
1 votes
Is Syntax directed definition and translation is part of Syntax analysis or Semantic analysis?

1 Answer

Best answer
2 votes
2 votes
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

Related questions

0 votes
0 votes
1 answer
1
0 votes
0 votes
1 answer
3
Ebrahim asked Jan 12
170 views
Q1. For the following grammar N - AB | BA A - a | CAC B - b | CBC C - a | b Find the FIRST and FOLLOW
0 votes
0 votes
0 answers
4
Ebrahim asked Jan 11
106 views
Find the FIRST and FOLLOW of the grammar to check whether it is LL (1) parser or not. N → AB | BA A → a | CAC B → b | CBC C → a | b