Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

a. Consider the following Semantic rules: image text in transcribed 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatio Temporal Database Management International Workshop Stdbm 99 Edinburgh Scotland September 10 11 1999 Proceedings Lncs 1678

Authors: Michael H. Bohlen ,Christian S. Jensen ,Michel O. Scholl

1999th Edition

3540664017, 978-3540664017

Students also viewed these Databases questions

Question

8. Do the organizations fringe benefits reflect diversity?

Answered: 1 week ago