We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

www.vustudents.ning.com

 www.bit.ly/vucodes + Link For Assignments, GDBs & Online Quizzes Solution www.bit.ly/papersvu + Link For Past Papers, Solved MCQs, Short Notes & More

Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion

# Assignment No. 03 discussion and solution Due Date: 16-02-2015

 Assignment No. 03   Semester: Fall 2014 Compiler Construction CS606 Total Marks: 20   Due Date: 16-02-2015 Objective: To learn and understand basic concepts of Evaluation Methods. Instructions: It should be clear that your assignment will not get any credit (zero marks will be awarded) if: The assignment is submitted after due date. The submitted assignment does not open or file corrupt. The assignment is copied (from other student or copy from handouts or internet). Student name and ID are not mentioned in the assignment file. It is in some format other than .doc or .docx(MS Word Document). For any query about the assignment, contact at cs606@vu.edu.pk Question No 1:                                                                                                                       Marks 20 Consider the following grammar productions. Suppose you have an attribute E.type which can be set to either INT or BOOL.  Assume that the type of an expression is set to INT if an error is detected and you have a routine msg() similar to printf() that can be used to print error message. E  à   CONST                               {E.type=??}           | ID                                      {E.type =getType(ID.name);}           | E1 -E2                              {E.type=??}           | E1> E2                              {E.type=??}           | E1= =E2                            {E.type=??}           | (E1)                                    {E.type=??} Provide the parse tree for the expression (10 > 8) = = (13 - B). BEST OF LUCK

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?

Views: 837

.

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

Attachments:

### Replies to This Discussion

kis lecture sy ha ? and if any body has helping material post please

one of the Fazoooooooll subject..

jis ki Samjh hi nhi atii..........

ye kia he eee assignment to lul he

The following is a simple Context-free grammar which can describe a language made up of multiplication and addition of integers.

`` Expr → Expr + Term  Expr → Term  Term → Term * Factor  Term → Factor  Factor → "(" Expr ")"  Factor → integer ` `

The following attribute grammar can be used to calculate the result of an expression written in the grammar. Note that this grammar only uses synthesized values, and is therefore an S-attributed grammar.

`` Expr1 → Expr2 + Term [ Expr1.value = Expr2.value + Term.value ]  Expr → Term [ Expr.value = Term.value ]  Term1 → Term2 * Factor [ Term1.value = Term2.value * Factor.value ]  Term → Factor [ Term.value = Factor.value ]  Factor → "(" Expr ")" [ Factor.value =  Expr.value ]  Factor → integer [ Factor.value = strToInt(integer.str) ]  ``

There is also parse tree for the expression

Parse tree bnya kisi nay ?

kindly share ur ideas.

thnkx

Provide the parse tree for the expression (10 > 8) = = (13 - B).??

## Latest Activity

3 minutes ago
4 minutes ago
5 minutes ago
5 minutes ago
8 minutes ago
50 minutes ago
54 minutes ago
54 minutes ago
+| |✧ Hαrsh ✧| | updated their profile
1 hour ago
1 hour ago
1 hour ago

1

2

3