Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

D Microsoft Word-CSC45 s/CSC455. Proj 1 %20(2).pdf Question 3: Attached is the BNF basis of Example 3.6 in the book that requires (1) expression's data

image text in transcribed
D Microsoft Word-CSC45 s/CSC455. Proj 1 %20(2).pdf Question 3: Attached is the BNF basis of Example 3.6 in the book that requires (1) expression's data type will be int only when both operands are int, and (2) the data types on both sides of the assignment operator " must be the same. Now change/add/remove the semantic rules/predicates (i.e., you are not going to change the Syntax rules) so that 1) 2) Data types cannot be mixed in expressions, but Assignment statements need not have the same types on both sides of the assignment operator ", the data type of the left side will become whatever data type of the right side. Page 1 of 3 Dr. Chen Spring 2018 1 . Syntax rule: cassign> " Semantic rule: [2] [3] + Semantic rule: [3J.actual, type int) then int else real end if Predicate: Semantic rule: xpr.actual type .actual_type Predicate: cexpr.actual type w. cexpro.expected type B Semantic rule.cvar.actual_type look-up ( A I I c

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions