DECAF Hidy Han, JiaYan Hu, Kim Tao, Kylie Wu
Overview Introduction & Background ● Project Timeline ● Development Environment ● Syntax & Usage ● Architecture ● Testing ● Demo ●
DECAF - So Easy to Use You Won’t Even Need Caffeine General-Purpose Programming Language, with core features extracted from Java and C. Top-level classes and functions ● Comprehensive C features ● Simple Object-Oriented ● functionality
Goals ● Safety: DECAF is statically typed. ○ Explicit rather than implicit type casting. ○ ● Familiarity: Syntax designed to resemble that of Java and C ○ Great for both beginner and veteran programmers. ○
Project Timeline
Development Environment
Syntax Comments Operators Built-in Types // A single line comment + // add bool // true, false - // subtract int // 4115 /* * // multiply float // 0.25 A multi-line comment / // divide char // ‘h’ */ % // modulus string // “Hello World” and // and array // [int] arr = [int, 5] or // or not // not === // eq. !== // neq. < // lt. > // gt. <= // leq. >= // geq. <type> // cast
Syntax Arrays Control Flow Classes [int] nums = [int, 5]; main() -> int { class Animal { int x; string name; nums[0] = -5; while (x < 5) { int legs; nums[1] = nums[0]; x = x + 1; Animal(string n, int l) -> Animal { if (true) { self.name = n; print_string(“nums[0] is now ”); print_string("foo"); self.legs = l; print_int(nums[0]); continue; } } talk() -> void { print_string("bar"); print_string(self.name); } print_string(" says hi\n"); return 0; } } }
Scanner Architecture Parser Semantic Checker Code Generator LLVM IR DECAF Executables
DECAF Program Global Classes Global Functions Name Fields Return Type Name Methods Formals Body (stmt)
Test Suite ● Automated in testall.sh ● Compares output with test_case.out ● New test cases added when new features are added
Demo
Recommend
More recommend