DECAF Hidy Han, JiaYan Hu, Kim Tao, Kylie Wu Overview Introduction - - PowerPoint PPT Presentation

decaf
SMART_READER_LITE
LIVE PREVIEW

DECAF Hidy Han, JiaYan Hu, Kim Tao, Kylie Wu Overview Introduction - - PowerPoint PPT Presentation

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 Wont


slide-1
SLIDE 1

DECAF

Hidy Han, JiaYan Hu, Kim Tao, Kylie Wu

slide-2
SLIDE 2

Overview

  • Introduction & Background
  • Project Timeline
  • Development Environment
  • Syntax & Usage
  • Architecture
  • Testing
  • Demo
slide-3
SLIDE 3

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

slide-4
SLIDE 4

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.

slide-5
SLIDE 5

Project Timeline

slide-6
SLIDE 6

Development Environment

slide-7
SLIDE 7

Syntax

// A single line comment /* A multi-line comment */

Comments

+ // add

  • // subtract

* // multiply / // divide % // modulus and // and

  • r

// or not // not === // eq. !== // neq. < // lt. > // gt. <= // leq. >= // geq. <type> // cast

Operators

bool // true, false int // 4115 float // 0.25 char // ‘h’ string // “Hello World” array // [int] arr = [int, 5]

Built-in Types

slide-8
SLIDE 8

Syntax

[int] nums = [int, 5]; nums[0] = -5; nums[1] = nums[0]; print_string(“nums[0] is now ”); print_int(nums[0]);

Arrays

main() -> int { int x; while (x < 5) { x = x + 1; if (true) { print_string("foo"); continue; } print_string("bar"); } return 0; }

Control Flow

class Animal { string name; int legs; Animal(string n, int l) -> Animal { self.name = n; self.legs = l; } talk() -> void { print_string(self.name); print_string(" says hi\n"); } }

Classes

slide-9
SLIDE 9

Architecture

Parser Scanner LLVM IR Semantic Checker Code Generator DECAF Executables

slide-10
SLIDE 10

DECAF Program Global Functions Global Classes

Return Type Body (stmt) Formals Name Fields Name Methods

slide-11
SLIDE 11

Test Suite

  • Automated in testall.sh
  • Compares output with test_case.out
  • New test cases added when new

features are added

slide-12
SLIDE 12

Demo