Interpreter Project Flex/Bison

mshiaj
Project3TestData.zip

__MACOSX/._Project 3 Test Data

Project 3 Test Data/test7.txt

// Tests All Arithmetic Operators function main returns integer; begin 9 + 2 - (5 + ~1) / 2 % 3 * 3 ^ 1 ^ 2; end;

__MACOSX/Project 3 Test Data/._test7.txt

Project 3 Test Data/test6.txt

// Function with Character Literal Escape Characters function main returns character; lines: integer is 60; begin when lines < 60, '\n' : '\f'; end;

__MACOSX/Project 3 Test Data/._test6.txt

Project 3 Test Data/test4.txt

// Function with a List Variable function main returns integer; primes: list of integer is (2, 3, 5, 7); begin primes(1) + primes(2); end;

__MACOSX/Project 3 Test Data/._test4.txt

Project 3 Test Data/test5.txt

// Function with Arithmetic Expression using Real Literals // and Hexadecimal Integer Literals function main returns real; begin .83e+2 + 2.5E-1 + (4.3E2 + #aF2) * .01; end;

__MACOSX/Project 3 Test Data/._test5.txt

Project 3 Test Data/test1.txt

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

__MACOSX/Project 3 Test Data/._test1.txt

Project 3 Test Data/test2.txt

// Function with When Statement function main returns integer; begin when 3 < 2 & 6 < 7, 7 * 2 : 7 + 2; end;

__MACOSX/Project 3 Test Data/._test2.txt

Project 3 Test Data/test3.txt

// Function with a Switch Statement function main returns character; a: integer is 2 * 2 + 1; begin switch a is case 1 => 'a'; case 2 => 'b'; others => 'c'; endswitch; end;

__MACOSX/Project 3 Test Data/._test3.txt

Project 3 Test Data/test14.txt

// Test Left Fold function main returns integer; begin fold left - (3, 2, 1) endfold; end;

__MACOSX/Project 3 Test Data/._test14.txt

Project 3 Test Data/test15.txt

// Test that Includes All Statements function main a: integer, b: real, c: character returns real; d: integer is when a > 0, #A: #A0; e: list of integer is (3, 2, 1); f: integer is switch a is case 1 => fold left - e endfold; case 2 => fold right - e endfold; others => 0; endswitch; g: integer is if c = 'A' & b > 0 then a * 2; elsif c = 'B' | b < 0 then (a ^ 2) * 10; else 0; endif; begin f + (d - 1) % g; end;

__MACOSX/Project 3 Test Data/._test15.txt

Project 3 Test Data/test16.txt

// Nested if statements function main x: integer, y: integer returns character; begin if x > 0 then if y > 0 then '1'; elsif y < 0 then '4'; else 'Y'; endif; elsif x < 0 then if y > 0 then '3'; elsif y < 0 then '2'; else 'Y'; endif; else if y <> 0 then 'X'; else 'O'; endif; endif; end;

__MACOSX/Project 3 Test Data/._test16.txt

Project 3 Test Data/test12.txt

// Two parameter declarations function main a: integer, b: real returns real; begin if a < #A then b + 1; else b - 1; endif; end;

__MACOSX/Project 3 Test Data/._test12.txt

Project 3 Test Data/test13.txt

// Test Right Fold function main returns integer; values: list of integer is (3, 2, 1); begin fold right - values endfold; end;

__MACOSX/Project 3 Test Data/._test13.txt

Project 3 Test Data/test11.txt

// Single Parameter Declaration function main a: real returns real; begin a + 1.5; end;

__MACOSX/Project 3 Test Data/._test11.txt

Project 3 Test Data/test10.txt

-- Multiple Variable Initializations function main returns character; b: integer is 5 + 1 - 4; c: real is 2 + 3.7; d: character is 'A'; begin if b + 1 - c > 0 then d; else '\n'; endif; end;

__MACOSX/Project 3 Test Data/._test10.txt

Project 3 Test Data/test8.txt

// Test Logical and Relational Operators function main returns integer; begin when !(6 <> 7) & 5 + 4 >= 9 | 6 = 5, 6 + 9 * 3 : 8 - 2 ^ 3; end;

__MACOSX/Project 3 Test Data/._test8.txt

Project 3 Test Data/test9.txt

// Function with an If Statement function main returns integer; a: integer is 28; begin if a < 10 then 1; elsif a < 20 then 2; elsif a < 30 then 3; else 4; endif; end;

__MACOSX/Project 3 Test Data/._test9.txt