A Pascal program can declare variables in the following mann…
Questions
A Pаscаl prоgrаm can declare variables in the fоllоwing manner: var a, b : int This declaration might be described with the following grammar: --> var : --> , ID | ID --> int | float Construct an attribute grammar to assign the data type of each declared variable in a declaration statement. Define attributes and state if each attribute is synthetic or inherited. Write propagation rules for the attributes. Use the format: -> ==> .attribute1 = .attribute2 State how attributes are evaluated through traversing the parse tree. Using the example declarations for a and b above, show the derivations and how attributes are propagated through the parse tree. Use the format: 1. .attribute1 = .attribute2 (14 points)