https://www.google.com/contributor/welcome/?utm_source=publisher&utm_medium=banner&utm_campaign=2376261057261409

Search This Blog

Search with our Site

Custom Search

Sunday, July 1, 2012

Assignment No. 05 Semester Spring 2012 Compiler Construction CS606


Assignment No. 05
Semester Spring 2012
Compiler Construction CS606

Total Marks: 20

Due Date: 03/07/2012
Instructions:

It should be clear that your assignment will not get any credit (zero marks will be awarded) if:

o        The assignment is submitted after due date.
o        The submitted assignment does not open or file corrupt.
o        The assignment is copied (from other student or copy from handouts or internet).
o        Student ID is not mentioned in the assignment File or name of file is other than student ID.
o       It is in some format other than .doc (MS Word Document).

For any query about the assignment, contact at cs606@vu.edu.pk

BEST OF LUCK

Question                                                                                                                                    Marks 20

You are required to write syntax-directed definition to determine the type of each sub-expression by considering the following grammar. The given grammar can generate expressions formed by applying “+” to integer and floating point constants. Also consider that when two integers are added, the result is integer; otherwise, it is a float.  Assign each symbol an attribute “type” also.


S ® S + S | X
X ® n . n | n
























No comments:

Post a Comment