Attribute Grammar
Attribute Grammar
S.Venkatesan
• Attributes are associated with the grammar symbols (T and NT), are similar
to variables in the sense that they can have values assigned to them.
– Predicate functions – state the static semantic rules of the language, are associated
with grammar rules.
Features
• Synthesized (actual type) and Inherited
attributes (expected type).
• Semantic functions.
– Natural
– Structural
Denotational Semantics
• It is based on recursive function theory.
• Applications
– Program Verification
– Program Semantics Specification
Assertions
• Constraints on the program variables at that point in the program.
– Pre and Post Condition
• Weakest Pre-condition
S1,S2,S3…Sn
----------------
S
Program Proofs