2078 8

CSC376 · 2078 · 5 marks

Define attribute grammar with example of inherited and synthesized attributes.

Define attribute grammar with example of inherited and synthesized attributes. [5]

Compiler Design and ConstructionChapter 2: Lexical, Syntax and Semantic AnalysisAttribute Types

An attribute grammar (also called a Syntax-Directed Definition, SDD) is a context-free grammar together with attributes and semantic rules, where: - Attributes are associated with grammar symbols (terminals and non-terminals) - Semantic rules are associated with productions It is a generalization...