Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.

Question No 1: Marks 20
Consider the following grammar productions. Suppose you have an attribute E.type which can
be set to either INT, 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
E → CONST {E.type=??}
| ID {E.type =getType(;}
| E1 +E2 {E.type=??}
| E1< E2 {E.type=??}
| E1= =E2 {E.type=??}
| (E1) {E.type=??}
You are required to add rules to the attribute grammar to calculate E.type for each grammar

Views: 2272


Replies to This Discussion



E1.true = E.true 

E1.false = E.false 

E.code =  E1.code

i think aisay ho ga.

help plz?

y ever1 comments at the last day? 

no solution or no any idea yet..

tariq bhai do something for this..

or somebody plz share the solution or idea for this..its last day


@zeeshan we are discussing the solution..So plzz don't just wait for the solution..share ur opinion too..:)

@salma iqbal. sorry to say, i have no idea about assignment. 

that's y i am waiting for solution.

@zeeshan If u did mind of my saying then I apologize.._The point which I  was trying to convey to u was if we all will discuss about assignment then at the end will be able to get the desired solution..I am also unable to grasp the concepts of this subject bt at least sharing my opinion using general knowledge..No body will come to give cooked stuff..

@salma iqbal...nops i didnt mind. actually i tried allot but in the end gain nothing about this subject and assignment. and bcz of my job i have no enough time for studies. but you right. 

@sny2ksa kal say main is assignnment pay bahout damagh lara rahi hun..hadndouts main jahan jahan possibility hy assignment saay regarding question ka answer find karnay main..m trying but still m not sure..and jis sentence ka aap nay poocha hay m also confused regarding that..any how sharing points which i noted from handouts..

  • if E----> CONST goto INT

          goto BOOL

  • if E----->E1+E2 goto BOOL

           goto INT

  • if E1<E2 goto BOOL

          goto INT

  • E----->(E1)





idea solution attached..

but rules hv to be applied in it also.


sny2ksa jo ap ny pdf fil atech ki opn nhi ho rhi wo plzzz wo dobara tech kr 2


it will not like this.

first discussion was right.

first declare types and then write their Rules.

for error checking check attached file.


Looking For Something? Search Below

Latest Activity

Minahil khalid left a comment for ☞De Veloper☜♨
11 minutes ago
Aijaz khan updated their profile
3 hours ago
Aijaz khan joined + M.Tariq Malik's group
3 hours ago
Profile IconRibqa, Muhammad Rizwan Ansari, Muhammad Imran and 3 more joined Virtual University of Pakistan
3 hours ago
Huma noor liked + M.Tariq Malik's group ENG101 English Comprehension
3 hours ago
Melissa Dorn replied to + M.Tariq Malik's discussion Reality of Modern Co-Education System of Pakistan
18 hours ago
Profile IconSamrina, Malaika Iqbal, Tahir Abbas and 2 more joined Virtual University of Pakistan
memon added a discussion to the group MGT610 Business Ethics

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

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