Our Services

Get 15% Discount on your First Order

[rank_math_breadcrumb]

Compiler Theory

Please follow instructions thoroughly.

semantic1.txt

// Variable Initialization Mismatch

function main returns integer;
value: integer is ‘A’;
begin
1;
end;

semantic10.txt

// List Subscript is not Integer

function main returns integer;
aList: list of integer is (1, 2, 3);
begin
aList(1.5);
end;

semantic11.txt

— Mixing Numeric and Character Types with Relational Operator

function main returns integer;
begin
if ‘b’ < ‘c’ then
1;
elsif ‘b’ < 1 then
2;
else
3;
endif;
end;

semantic12.txt

// Using Character Literal with Exponentiation Operator
// and Negation Operator

function main returns integer;
c: character is ~’c’;
begin
5 ^ ‘P’;
end;

semantic13.txt

// Mixing Real Literals with the Remainder Operator

function main returns integer;
begin
4 % 4.8;
end;

semantic14.txt

— If Elsif Else Mismatch

function main returns integer;
begin
if 9 < 10 then
1;
elsif 8 = 1 then
2;
else
3.7;
endif;
end;

semantic15.txt

// Folding a nonnumeric List

function main returns integer;
begin
fold left + (‘a’, ‘b’, ‘c’) endfold;
end;

semantic16.txt

— Narrowing Variable Initialization

function main returns integer;
b: integer is 5 * 2.5;
begin
b + 1;
end;

semantic17.txt

— Narrowing Function Return

function main returns integer;
b: integer is 6 * 2;
begin
if 8 < 0 then
b + 3.0;
else
b * 4.6;
endif;
end;

semantic18.txt

— Duplicate Scalar and List Variables

function main returns integer;
scalar: integer is 4 * 2;
scalar: character is ‘b’;
a_list: list of integer is (4, 2);
a_list: list of real is (2.3, 4.4);
begin
1;
end;

semantic19.txt

// Multiple Semantic Errors

function main returns integer;
value: integer is 4.5;
numbers: list of real is (1, 2, 3);
one: integer is ‘1’;
begin
if value > 0 then
fold left + (‘a’, ‘b’) endfold;
elsif name = ‘N’ then
fold right * (1, 2.5) endfold;
else
when value < 10, 1 : 1.5;
endif;
end;

semantic2.txt

// When Types Mismatch

function main returns integer;
begin
when 2 < 1, 1 : ‘a’;
end;

semantic3.txt

// Non Integer Switch Expression

function main returns integer;
b: character is ‘A’;
begin
switch b is
case 1 => 2;
case 2 => 4;
others => 6;
endswitch;
end;

semantic4.txt

// Case Types Mismatch

function main returns integer;
b: character is ‘b’;
begin
switch 1 is
case 1 => 2;
case 2 => b;
others => 6;
endswitch;
end;

semantic5.txt

// Using Character Variable with Arithmetic Operator

function main returns integer;
b: character is ‘b’;
begin
b + 10;
end;

semantic6.txt

// Undeclared Scalar Variable

function main returns integer;
begin
2 * b + 3;
end;

semantic7.txt

// Undeclared List Variable

function main returns integer;
begin
primes(1) + 1;
end;

semantic8.txt

// List with Elements of Different Types

function main returns integer;
aList: list of integer is (1, 2, 3.5);
begin
aList(1);
end;

semantic9.txt

// List Type Does Not Match Element Types

function main returns character;
aList: list of character is (1, 2, 3);
begin
aList(1);
end;

valid1.txt

— Program with a Real Variable

function main returns real;
a: real is 4.5;
begin
a;
end;

valid2.txt

— Program with a Hexadecimal Literals

function main returns integer;
a: integer is #A;
begin
a + #a;
end;

valid3.txt

— Program with a Real Variable

function main returns real;
a: real is 4 + 4.5;
begin
a;
end;

Share This Post

Email
WhatsApp
Facebook
Twitter
LinkedIn
Pinterest
Reddit

Order a Similar Paper and get 15% Discount on your First Order

Related Questions

CSIA 310 wk2 discussion

  Write a short “newsletter” article (3 to 5 paragraphs) for the non-technical managers and employees at Sifers-Grayson to explain the following: (a) What is Phishing? (Focus on phishing emails and targeted attacks that include spear phishing and whaling.) (b) What “bad things” can happen when a successful phishing attack

Project 3

To complete this assignment, review the prompt and grading rubric in the Project Three Guidelines and Rubric. When you have finished your work, submit the assignment here for grading and instructor feedback.

digital marketing

 Digital marketing involves promoting products and services using online platforms.The goal is to increase brand awareness and drive sales 

WEEK 2 DISCUSSION MR

 I UPLOADED IN THE FILE HOW THE ASSIGNMENT SHOULD FLOW AND ALSO THE ACCEPTABLE TOPICS FOR MY PROGRAM THAT U CAN SELECT FROM!  INSTRUCTIONS!! This week you considered study topics deemed acceptable for your program. For this discussion, share with your peers your initial thoughts on a topic you’d like

wk 2 practice models

INSTRUCTIONS!! Discuss the various practice models discussed in Chapter 3 of The Ernst and Young Business Plan GuideLinks to an external site.. What model is the most attractive for your own consultancy? Why? Do you see the model for your practice changing in the future?   READ CHAPTER 3!! OF THE

Computer Science Sustainable Development Goal and Mobile App Assignment

ATTACHED IS THE COPIED STATEMENT ON INTEGRATION OF FAITH AND WORK A s a university, we believe that the message of Jesus Christ bears profound implications, not only for individuals, but also for society and the ways that we as individuals live within it. The Lord Jesus instructed His followers

Intro Pogramming

After viewing the videos and listening to the information on programming, you should be ready to answer the questions listed below.     Your assignment is as follows:  I.   Access the Youtube videos:    Introduction to Programming Fundamentals (by Neso Academy).  You will be responsible for accessing the first 3 videos in

Disruptive technology and its impact on society (Discussion)

A discussion on disruptive technology and its impact on society 1) Discussion 1: Write a reflective response to the lesson on disruptive technology and its impact on society. (200-word minimum) Explore the impact on a macro and micro level looking at the impact on systems and structures as well as the

week 1 begin your

 I am a Kroger fulfillment delivery driver trainer / and I am also a TECH SUPERVISOR for spectrum whichever job you find easier to discuss about share something from your profession, job, or other source of inspiration that generated the idea for your project. What do you want to learn

project 2

To complete this assignment, review the prompt and grading rubric in the Project Two Guidelines and Rubric. When you have finished your work, submit the assignment here for grading and instructor feedback. For reference, refer to the CIA Triad and Fundamental Security Design Principles PDF document.

project 1

To complete this assignment, review the prompt and grading rubric in the Project One Guidelines and Rubric. When you have finished your work, submit the assignment here for grading and instructor feedback.

Final SWOT presentation

Concepts and Applications of Information Technology (IFSM201) Class Project Purpose of this Assignment The Class Project is the most significant assignment in this course, Concepts and Applications of Information Technology. As such, it accounts for 58% of the course points. This assignment is comprised of two deliverables: a SWOT Analysis

Wk4_411

Need help with a question. Due 10/7/2024 Based on your research, readings, and this week’s Learning Team assignment, create a 4- to 5-page sample penetration agreement for a banking institution using the major sections listed below and the purpose of each section. Include examples within each section. The major sections

Discussion 7 Social Networking

  Discussion Seven – Social Networking Social networking Web sites create online communities of Internet users that eliminate barriers created by time, distance, and cultural differences. These sites allow people to interact with others online by sharing opinions, insights, information, interests, and experiences.  Members may use the site to interact

Cap assign

Unit III Scholarly Activity Top of Form Bottom of Form Assignment Content Top of Form Purpose, Subject, Object, and Ethics In this unit, you will determine the purpose, subject, object, and ethical considerations of your case study, then assemble your findings in the  Unit III Case Study Outline Template .

project 3:

Support Queue Case Study Instructions:  Select two tickets from each level and explain how you would solve them. Name:  Level 1 Tickets Instructions:  Select two of the five scenarios to troubleshoot.  One template has been created for each of the two tickets you need to choose.  Make one to two

case

Write three pages of high-quality content for this case study, using the concepts discussed in class and any relevant external resources to support your analysis. Follow the instructions for your research problem carefully, as your argument and research will significantly impact your grade. Ensure that AI patterns do not exceed