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

WRK100 – PREPARING FOR THE FUTURE OF WORK Name: Professor Name:

WRK100 – PREPARING FOR THE FUTURE OF WORK Name: Professor Name: Date: Week 6 Assignment – Employability Skills and the Future of Work For this assignment, you will be writing about the value and impact of two of the 10 Skills: Self and Social Awareness and Communication. Before you complete

  What are the main hypotheses? What is/are independent variable(s)? What is/are dependent variable(s)? How did researchers recruit their participants?

  What are the main hypotheses? What is/are independent variable(s)? What is/are dependent variable(s)? How did researchers recruit their participants? Identify participants’ demographic information and data collection procedure. What materials did researchers utilize to measure the hypotheses? Identify the apparatus and measurements. What are the key findings/results of the study?

pfa TASK 1: By Tuesday Evening Reflection and Discussion Forum Week 3

pfa TASK 1: By Tuesday Evening Reflection and Discussion Forum Week 3 Assigned Readings: Chapter 8. Understanding Markets and Industry Changes. Chapter 9. Market Structure and Long-Run Equilibrium. Chapter 10. Strategy: The Quest to Keep Profit from Eroding. Initial Postings: Read and reflect on the assigned readings for the week.