Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

question 10 6. (10pts) Consider the following grammar: - - | ENDLINE ID > - | + ID | & % | 4. 8. (10pts)

question 10 image text in transcribed
image text in transcribed
image text in transcribed
6. (10pts) Consider the following grammar: - - | ENDLINE ID ">" - | + ID | "&" "%" | 4." 8. (10pts) Recall the following grammar from question 6: (2) (3) | ENDLINE ID "->" | - ID 6 (5) (6) (7) (8) (9) (10) 1 %" Consider the following semantic functions/predicates: (1) Predicate: "main" E ids (2) (prodlist>ids = { id) (3) [0].id = {id}U id ID .id .id ID.id (5) .id = .id (6) .id = [0].id [1].id [0].id (7) Predicate: .id = ID.id This attributed grammar specifies two statie semantic "rules" (restrictions on the programs in this language). What are they? Give a brief description on how they are enforced. For each rule, are the attributes involved synthesized, inherited, or a mixture of both? four->*,,,lo 10. (10pts) Recall the attributed grammar from question 8. Consider the following de- notational semantics: densem( ENDLINE ) = densem( ) U den sem( densem( ID ">" ) = {(ID , bodysem( ))} bodysem( "" ) = bodysem( ) + bodysem( bodysem( ID ) = if ID = main then 10 else 1 bodysem("&") = 2 bodysem("%" ) = 100 body sem( "*") = -10 NOTE: The format is similar to our example form class. The semantics in this ques- tions is different from the one presented in other questions. For the following progams, what is the mathematical meaning? Brielfly explain why. (a) main > step, show step -> &,& show -> %,&, (6) main -> one, two, three, four one -> tuo,&, two -> ,& three -> four...& four-> , ,&.% 6. (10pts) Consider the following grammar: - - | ENDLINE ID ">" - | + ID | "&" "%" | 4." 8. (10pts) Recall the following grammar from question 6: (2) (3) | ENDLINE ID "->" | - ID 6 (5) (6) (7) (8) (9) (10) 1 %" Consider the following semantic functions/predicates: (1) Predicate: "main" E ids (2) (prodlist>ids = { id) (3) [0].id = {id}U id ID .id .id ID.id (5) .id = .id (6) .id = [0].id [1].id [0].id (7) Predicate: .id = ID.id This attributed grammar specifies two statie semantic "rules" (restrictions on the programs in this language). What are they? Give a brief description on how they are enforced. For each rule, are the attributes involved synthesized, inherited, or a mixture of both? four->*,,,lo 10. (10pts) Recall the attributed grammar from question 8. Consider the following de- notational semantics: densem( ENDLINE ) = densem( ) U den sem( densem( ID ">" ) = {(ID , bodysem( ))} bodysem( "" ) = bodysem( ) + bodysem( bodysem( ID ) = if ID = main then 10 else 1 bodysem("&") = 2 bodysem("%" ) = 100 body sem( "*") = -10 NOTE: The format is similar to our example form class. The semantics in this ques- tions is different from the one presented in other questions. For the following progams, what is the mathematical meaning? Brielfly explain why. (a) main > step, show step -> &,& show -> %,&, (6) main -> one, two, three, four one -> tuo,&, two -> ,& three -> four...& four-> , ,&.%

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

Object Databases The Essentials

Authors: Mary E. S. Loomis

1st Edition

020156341X, 978-0201563412

More Books

Students also viewed these Databases questions

Question

Give a brief description of international liquidity.

Answered: 1 week ago