test1.txt // Function with Arithmetic Expression function main returns integer; begin 7 + 2 * (5 + 4); end; test2.txt // Function with a

test1.txt

// Function with Arithmetic Expression

function main returns integer;
begin
7 + 2 * (5 + 4);
end;

test2.txt

// Function with a lexical error

function main returns integer;
begin
7 * 2 $ (2 + 4);
end;

test3.txt

// Punctuation symbols

,;() =>

// Identifier

name name123

// Literals

123 ‘a’

// Logical operator

&

// Relational operator

<

// Arithmetic operators

+ *

// Reserved words

begin case character end endswitch function is integer list of returns switch when

test4.txt

// Function with All Reserved Words

function main returns character;
number: real is when 2 < 3, 0 : 1;
values: list of integer is (4, 5, 6);
begin
if number < 6.3 then
fold left + (1, 2, 3) endfold;
elsif 6 < 7 then
fold right + values endfold;
else
switch a is
case 1 => number + 2;
case 2 => number * 3;
others => number;
endswitch;
endif;
end;

test5.txt

// Program Containing the New Operators

function main b: integer, c: integer returns integer;
a: integer is 3;
begin
if (a < 2) | (a > 0) & (~b <> 0) then
7 – 2 / (9 % 4);
else
if b >= 2 | b <= 6 & !(c = 1) then
7 + 2 * (2 + 4);
else
a ^ 2;
endif;
endif;
end;

test6.txt

// Program Containing the New Comment, Modified Identifier
// and Real Literal and Hex and Character Literals

— This is the new style comment

function main b: integer, c: integer returns integer;
a: real is .3;
d: real is 5.7;
a__1: real is .4e2;
ab_c_d: real is 4.3E+1;
ab1_cd2: real is 4.5e-1;
hex: integer is #2aF;
char1: character is ‘C’;
char2: character is ‘\n’;
begin
hex + 2;
end;

test7.txt

// Function with Two Lexical Errors

function main returns integer;
begin
7 $ 2 ? (2 + 4);
end;

test8.txt

— Punctuation symbols

,:;() =>

// Valid identifiers

name_1
name_1__a2_ab3

// Invalid identifiers

name___2
_name3
name4_

// Integer Literals

23 #3aD

// Real Literals

123.45 .123 1.2E2 .1e+2 1.2E-2

// Character Literals

‘A’ ‘\n’

// Logical operators

& | !

// Relational operators

= <> > >= < <=

// Arithmetic operators

+ – * / % ^ ~

// Reserved words

begin case character else elsif end endcase endfold endif endswitch
fold function if integer is left list of others real returns right
switch then when

Share This Post

Email
WhatsApp
Facebook
Twitter
LinkedIn
Pinterest
Reddit

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

Related Questions

250 words Complete The Case of Marie multimedia presentation and

250 words Complete The Case of Marie multimedia presentation and identify  Marie’s relevant family members in relation to the case study. The identified family members will be the focus of your assignment for this unit. What issues do the family members need to deal with? How do the  family members

Visit the Nestlé Corporation website (http://www.nestle.com/) and the Unilever website

  Visit the Nestlé Corporation website (http://www.nestle.com/) and the Unilever website (http://www.unilever.com/). Give a general description of each company’s products. Share the company’s home location. Share how each company’s strategies toward international markets – how are they getting their product to market? Compare their strategies toward international markets. In what

Select and develop a strategic plan You must identify a

Select and develop a strategic plan You must identify a type of business. Please mention below points in your assignment. · Identify the technology with Explanation – what it is and how it works. · Manage the technology and how it positively effects the organization. · Manage the change that

In one-two pages answering the following questions: What are three

 In one-two pages answering the following questions: What are three financial facts that you have determined so far in your work in this course that you believe are critical in determining whether to recommend an investment in this company? Justify your answer. At this point, do you think you will

See attachments below Analysis of Interpersonal Communication in “Friday Night Lights” Interpersonal communication is highly demonstrated in the

See attachments below Analysis of Interpersonal Communication in “Friday Night Lights” Interpersonal communication is highly demonstrated in the “Friday Night Lights” film is. For the analysis of the interpersonal communication of the “Friday Night Lights,” Chapter 6 of “Interpersonal Communication Eighth Edition” can offer comprehensive framework. The chapter elaborate on

For this Discussion, you will reflect on your interview experience

For this Discussion, you will reflect on your interview experience from last week. Perhaps you have noticed how well (or how poorly) you paid attention; or that something the interviewee said astonished you; or how quickly (or slowly) the time went by. To prepare for this Discussion: 1. Review this

Three-strikes laws are the most obvious and controversial use of

Three-strikes laws are the most obvious and controversial use of selective incapacitation. In 2004, approximately 26 states and the U.S. federal court system had three-strikes laws. In most cases, three felonious convictions result in a mandatory life sentence with no possibility of parole. In the case of Lockyer v. Andrade,

Using the CSU Online Library, locate an article at least

Using the CSU Online Library, locate an article at least three pages in length that discusses how the field of marketing is influenced by the buying behavior of consumers. This could involve articles that discuss how consumers actually interpret information about products and services as well as the subsequent impact

The transition from Professional Registered Professional Nurse (RN) to Advanced

  The transition from Professional Registered Professional Nurse (RN) to Advanced Practice Registered Nurse (APN) is often a stressful career change. Reflect on factors that influence role transition and how best to mitigate the transition toward alteration in professional identity, loss of confidence, and novice APN development. Please note: This

Select and discuss one Do, and one Don’t related to

Select and discuss one Do, and one Don’t related to physical activity during pregnancy. (#1_Do and Do Not) Evaluate the statement that “no level of alcoholic beverage intake is safe or advisable during pregnancy.” (#2_Alcoholic Intake) What is the relationship between childhood obesity and chronic diseases? (#3_Childhood Obesity) Explain why

Your assignment this week chapters 6 and 7. Chapter 6.

Your assignment this week chapters 6 and 7. Chapter 6.  Using Figures 6.1-6.11 find examples online that represent each of the lighting arrangements pictured. Be sure to look at each figure and READ the description applied to the arrangement. Chapter 7. Using Figures 7.12 – 7.17 find examples of a

Submit an evidence-based practice PPT about cultural competency in mental

Submit an evidence-based practice PPT about cultural competency in mental health nursing. An evidence-based practice PPT allows you to explore best practice and help improve client outcomes on a psychiatric unit. Your PPT should describe how you, as a nurse, will include – or have included – cultural awareness in a client diagnosed with a mental