subject

Consider the following grammar (yes, it is ambiguous but that is unimportant). The subscripts are used to distinguish otherwise identical non-terminals for the purpose of the questions below. β†’ ; β†’ β†’ β†’ int double = β†’ β†’ + + - | * : β†’ β†’ + β†’ a legal name in the language β†’ a base 10 representation of an integer β†’ a base 10 representation of a floating point number Suppose our static semantic description has five attributes: type = { integer, double } typetable() = { integer, double, error } inittable() = { true, false, error } typebinding = (, { integer, double }) initialized = (, { true, false }) typetable maps each possible variable name to its declared type, and inittable maps each possible variable name to a boolean indicating whether the variable has been assigned a value. Initially, both typetable and inittable will map all possible variable names to error to indicate that the variables have not been declared in the program. typebinding maps a single variable name to its declared type, and initialized maps a single variable name to whether it has been assigned a value. For each subscripted non-terminal, provide a rule to calculate its type, table, inittable, typebindig, and ini- tialized attributes, if that non-terminal requires that attribute. Each attribute should either be inherited or synthesized, but not both. For example, here are two such rules: .type := integer .initialized := (, false) (Here I am using := to create a mapping so you can use = to mean only mathematical equality.)

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 18:00
Which if the following allows you to view and access important information about your documents all in one location
Answers: 3
question
Computers and Technology, 22.06.2019 00:00
Which requirement is an appropriate reason for a business to use it tools
Answers: 3
question
Computers and Technology, 22.06.2019 22:30
The qwerty keyboard is the most common layout of keys on a keyboard
Answers: 3
question
Computers and Technology, 24.06.2019 02:30
How to apply the fly in effect to objects on a slide
Answers: 1
You know the right answer?
Consider the following grammar (yes, it is ambiguous but that is unimportant). The subscripts are us...
Questions
question
Mathematics, 16.11.2019 06:31