Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assignment #4 Due Tuesday, March 20, 2018 Problem 1. Consider the following statement: In Java, a floating-point value cannot be assigned to an integer type

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Assignment #4 Due Tuesday, March 20, 2018 Problem 1. Consider the following statement: "In Java, a floating-point value cannot be assigned to an integer type variable, although the opposite is legal. " Which of the following is wrong? (a) Context-free grammars cannot describe this statement at al. (b) Context-free grammars can describe this statement but it is cumbersome. (c) Attribute grammars must be used to describe this statement Problem 2:Complete the following statements using the provides options nodes. This grammar can be -,--.._..-, or their combination. (a) Attribute grammars, inherited attribute, and synthesized attribute. (d) This statement has nothing to do with Semantic of grammar. have additions to Context-free grammars to carry so me semantic info on parse tree .........- (b) Static Semantic grammars, inherited attribute, and synthesized attribute. Semantic attribute, static attribute, and dynamic attribute. (c) (d) Non of the above Problem 3: Which of the following option is correct about the addition to a context-free grammar to implement an attribute grammar? (a) For each grammar symbol x there is a set Afx) of attribute values (b) Each rule has a set of functions that define certain attributes of the oootecninals in the rule (c) Each rule has a (possibly empty) set of predicates to check for attribute consistency (d) All of the above are correct Problem 4: In synthesized attributes, the semantic information passes , so that the value ed attribute on a parse tree node depends only on the values of the attributes on that of a synthesiz node's (a) up a parse tree, children nodes (b) down (c) up a parse tree, node's parent node and those of its sibling nodes (d) down and across a tree, children nodes and across a tree, node's parent node and those of its sibling nodes Problem 5: In inherited attributes, semantic information passes , so that the value of an inherited attribute on a parse tree node depends on the attribute values of that MacBook

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems For Advanced Applications 9th International Conference Dasfaa 2004 Jeju Island Korea March 2004 Proceedings Lncs 2973

Authors: YoonJoon Lee ,Jianzhong Li ,Kyu-Young Whang

2004th Edition

3540210474, 978-3540210474

More Books

Students also viewed these Databases questions

Question

Azure Analytics is a suite made up of which three tools?

Answered: 1 week ago

Question

2. List the advantages of listening well

Answered: 1 week ago