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
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=??}
You are required to add rules to the attribute grammar to calculate E.type for each grammar
production.
Tags:
Noooo...
(E1)
E1.true = E.true
E1.false = E.false
E.code = E1.code
i think aisay ho ga.
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
solution????
@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..
goto BOOL
goto INT
goto INT
{
E.INT=E1.INT;
E.BOOL=E1.BOOL;
}
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
© 2021 Created by + M.Tariq Malik.
Powered by
Promote Us | Report an Issue | Privacy Policy | Terms of Service
We are user-generated contents site. All product, videos, pictures & others contents on site don't seem to be beneath our Copyrights & belong to their respected owners & freely available on public domains. We believe in Our Policy & do according to them. If Any content is offensive in your Copyrights then please email at m.tariqmalik@gmail.com with copyright detail & We will happy to remove it immediately.
Management: Admins ::: Moderators
Awards Badges List | Moderators Group
All Members | Featured Members | Top Reputation Members | Angels Members | Intellectual Members | Criteria for Selection
Become a Team Member | Safety Guidelines for New | Site FAQ & Rules | Safety Matters | Online Safety | Rules For Blog Post