Question: a . Consider the following Semantic rules: Now translate the following assignments: i) y = a [ i ] [ j ] + b [

a. Consider the following Semantic rules: a. Consider the following Semantic rules: Now translate the following assignments: i) Now translate the following assignments:

i) y = a [ i ] [ j ] + b [ c [ k ] ] [ j ]

ii) y = c [ k ] + b [ a [ c [ i ] ] + 2 ]

B.Grammar:

A B a | c B b | d C b | d C a

B q | | A a C

C f A C B | q

Fill the CLR(1) parsing table with suitable error codes / messages and identify the error in the given input string: c b a f q q a c q

D: Consider the following Semantic rules: S + id = E; {gen( top.get(id.lexeme) '=' E.addr); } | L=E; { gen(L.array.base 'l' L.addr '''=' E.addr); } E + E + E { E.addr = new Temp(); gen(E.addr'=' El addr'+ Ey addr); } id { E.addr = top.get(id.lereme); } IL { E.addr = new Temp(); gen(E.addr '=' Larray.base 'l Laddr '1'); } + id [E] {L.array = top.get(id. lexemne); L.type = L.array.type.elem; L.addr = new Temp(); gen(L.addr'=' E.addr'*' L.type. width); } | L[E] {L.array = L aray; L.type = Lj.type.elem; t = new Temp 0); L.addr = = new Temp(); gen(t'= E.addr 's' L.type.width); gen(L.addr'=' Laddr'+'t); } - . . : . D: Consider the following Semantic rules: S + id = E; {gen( top.get(id.lexeme) '=' E.addr); } | L=E; { gen(L.array.base 'l' L.addr '''=' E.addr); } E + E + E { E.addr = new Temp(); gen(E.addr'=' El addr'+ Ey addr); } id { E.addr = top.get(id.lereme); } IL { E.addr = new Temp(); gen(E.addr '=' Larray.base 'l Laddr '1'); } + id [E] {L.array = top.get(id. lexemne); L.type = L.array.type.elem; L.addr = new Temp(); gen(L.addr'=' E.addr'*' L.type. width); } | L[E] {L.array = L aray; L.type = Lj.type.elem; t = new Temp 0); L.addr = = new Temp(); gen(t'= E.addr 's' L.type.width); gen(L.addr'=' Laddr'+'t); }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!