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

Looking For Something at vustudents.ning.com? Click Here to Search

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

How to Add New Discussion in Study Group ? Step By Step Guide Click Here.

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 Follow the New Added Discussions at Your Mail Address?

+ 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?


See Your Saved Posts Timeline

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)

+ Click Here to Search (Looking For something at vustudents.ning.com?)

+ Click Here To Join (Our facebook study Group)

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.

 ExprExpr + Term  

ExprTerm

TermTerm * Factor

TermFactor

Factor → "(" Expr ")"

Factorinteger

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.

 Expr1Expr2 + Term [ Expr1.value = Expr2.value + Term.value ]
ExprTerm [ Expr.value = Term.value ]
Term1Term2 * Factor [ Term1.value = Term2.value * Factor.value ]

TermFactor [ Term.value = Factor.value ]

Factor → "(" Expr ")" [ Factor.value = Expr.value ]
Factorinteger [ Factor.value = strToInt(integer.str) ]

There is also parse tree for the expression

please discuss and share your idea solution

 

Parse tree bnya kisi nay ?  

kindly share ur ideas. 

thnkx 

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

RSS

© 2020   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service

.