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, 22.06.2019 18:00
Suppose an astronomer discovers a large, spherical-shaped body orbiting the sun. the body is composed mostly of rock, and there are no other bodies sharing its orbit. what is the best way to categorize this body? a. planet b. moon c. comet d. asteroid
Answers: 1
question
Computers and Technology, 23.06.2019 06:30
Martha is designing a single-player game. her manager suggests that she plan the design to incorporate future modifications. which principle of game design relates to planning for future modifications?
Answers: 1
question
Computers and Technology, 24.06.2019 00:50
Which of the following is not a key player in the sale of travel products?
Answers: 2
question
Computers and Technology, 24.06.2019 14:40
Create a function (prob3_6) that will do the following: input a positive scalar integer x. if x is odd, multiply it by 3 and add 1. if the given x is even, divide it by 2. repeat this rule on the new value until you get 1, if ever. your program will output how many operations it had to perform to get to 1 and the largest number along the way. for example, start with the number 3: because 3 is odd, we multiply by 3 and add 1 giving us 10. 10 is even so we divide it by 2, giving us 5. 5 is odd so we multiply by 3 and add one, giving us 16. we divide 16 (even) by two giving 8. we divide 8 (even) by two giving 4. we divide 4 (even) by two giving 2. we divide 2 (even) by 2 to give us 1. once we have one, we stop. this example took seven operations to get to one. the largest number we had along the way was 16. every value of n that anyone has ever checked eventually leads to 1, but it is an open mathematical problem (known as the collatz conjectureopens in new tab) whether every value of n eventually leads to 1. your program should include a while loop and an if-statement.
Answers: 3
You know the right answer?
Consider the following grammar (yes, it is ambiguous but that is unimportant). The subscripts are us...
Questions
question
Mathematics, 03.05.2020 13:36
question
Mathematics, 03.05.2020 13:36
Questions on the website: 13722367