lindsay schiminske (ls3245) michelle navarro …str .cmxa maze . ml ocamlftnd ocamlopt -linkpkg...

20
maze Alexander Brown (aab2212) Alexander Freemantle (asf2161) Michelle Navarro (mn2614) Lindsay Schiminske (ls3245)

Upload: others

Post on 08-Sep-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lindsay Schiminske (ls3245) Michelle Navarro …str .cmxa maze . ml ocamlftnd ocamlopt -linkpkg -package I Ivm str .cmxa -package Uvm.analysts ast.cmx codegen.cmx parser . cmx scanner

maze

Alexander Brown (aab2212)Alexander Freemantle (asf2161)Michelle Navarro (mn2614)Lindsay Schiminske (ls3245)

Page 2: Lindsay Schiminske (ls3245) Michelle Navarro …str .cmxa maze . ml ocamlftnd ocamlopt -linkpkg -package I Ivm str .cmxa -package Uvm.analysts ast.cmx codegen.cmx parser . cmx scanner

Introduction

Page 3: Lindsay Schiminske (ls3245) Michelle Navarro …str .cmxa maze . ml ocamlftnd ocamlopt -linkpkg -package I Ivm str .cmxa -package Uvm.analysts ast.cmx codegen.cmx parser . cmx scanner

What is maze?

Page 4: Lindsay Schiminske (ls3245) Michelle Navarro …str .cmxa maze . ml ocamlftnd ocamlopt -linkpkg -package I Ivm str .cmxa -package Uvm.analysts ast.cmx codegen.cmx parser . cmx scanner

Language Evolution

Proposal:

Game design language

Plan:

Object-Oriented Java-like language

Actual:

Java-like imperative language

Page 5: Lindsay Schiminske (ls3245) Michelle Navarro …str .cmxa maze . ml ocamlftnd ocamlopt -linkpkg -package I Ivm str .cmxa -package Uvm.analysts ast.cmx codegen.cmx parser . cmx scanner

An Imperative Language with Java-like syntax

Page 6: Lindsay Schiminske (ls3245) Michelle Navarro …str .cmxa maze . ml ocamlftnd ocamlopt -linkpkg -package I Ivm str .cmxa -package Uvm.analysts ast.cmx codegen.cmx parser . cmx scanner

Tools

Page 7: Lindsay Schiminske (ls3245) Michelle Navarro …str .cmxa maze . ml ocamlftnd ocamlopt -linkpkg -package I Ivm str .cmxa -package Uvm.analysts ast.cmx codegen.cmx parser . cmx scanner
Page 8: Lindsay Schiminske (ls3245) Michelle Navarro …str .cmxa maze . ml ocamlftnd ocamlopt -linkpkg -package I Ivm str .cmxa -package Uvm.analysts ast.cmx codegen.cmx parser . cmx scanner

MAZE Architecture

Page 9: Lindsay Schiminske (ls3245) Michelle Navarro …str .cmxa maze . ml ocamlftnd ocamlopt -linkpkg -package I Ivm str .cmxa -package Uvm.analysts ast.cmx codegen.cmx parser . cmx scanner

program.maze

Scanner Parser AST Analyzer Codegen

LLVM IR

Page 10: Lindsay Schiminske (ls3245) Michelle Navarro …str .cmxa maze . ml ocamlftnd ocamlopt -linkpkg -package I Ivm str .cmxa -package Uvm.analysts ast.cmx codegen.cmx parser . cmx scanner

Syntax

Page 11: Lindsay Schiminske (ls3245) Michelle Navarro …str .cmxa maze . ml ocamlftnd ocamlopt -linkpkg -package I Ivm str .cmxa -package Uvm.analysts ast.cmx codegen.cmx parser . cmx scanner

BasicsMethods

Binary OpsPrimitives

Unary OpsComments

Page 12: Lindsay Schiminske (ls3245) Michelle Navarro …str .cmxa maze . ml ocamlftnd ocamlopt -linkpkg -package I Ivm str .cmxa -package Uvm.analysts ast.cmx codegen.cmx parser . cmx scanner

StatementsIf / else While Loop

Return

Page 13: Lindsay Schiminske (ls3245) Michelle Navarro …str .cmxa maze . ml ocamlftnd ocamlopt -linkpkg -package I Ivm str .cmxa -package Uvm.analysts ast.cmx codegen.cmx parser . cmx scanner

Testing

Page 14: Lindsay Schiminske (ls3245) Michelle Navarro …str .cmxa maze . ml ocamlftnd ocamlopt -linkpkg -package I Ivm str .cmxa -package Uvm.analysts ast.cmx codegen.cmx parser . cmx scanner

Menhir Pretty-PrinterMade sure input tokens = output tokens$ menhir --interpret --interpret-show-cst parser.mly

--explain

Page 15: Lindsay Schiminske (ls3245) Michelle Navarro …str .cmxa maze . ml ocamlftnd ocamlopt -linkpkg -package I Ivm str .cmxa -package Uvm.analysts ast.cmx codegen.cmx parser . cmx scanner

● Add feature → Add test● Run ./testall.sh● Ensure all tests pass

Page 16: Lindsay Schiminske (ls3245) Michelle Navarro …str .cmxa maze . ml ocamlftnd ocamlopt -linkpkg -package I Ivm str .cmxa -package Uvm.analysts ast.cmx codegen.cmx parser . cmx scanner

Tests that should pass: Tests that should fail (with appropriate error message)

Page 17: Lindsay Schiminske (ls3245) Michelle Navarro …str .cmxa maze . ml ocamlftnd ocamlopt -linkpkg -package I Ivm str .cmxa -package Uvm.analysts ast.cmx codegen.cmx parser . cmx scanner

GCD

Passing print an identifier:

Page 18: Lindsay Schiminske (ls3245) Michelle Navarro …str .cmxa maze . ml ocamlftnd ocamlopt -linkpkg -package I Ivm str .cmxa -package Uvm.analysts ast.cmx codegen.cmx parser . cmx scanner

DEMO

Page 19: Lindsay Schiminske (ls3245) Michelle Navarro …str .cmxa maze . ml ocamlftnd ocamlopt -linkpkg -package I Ivm str .cmxa -package Uvm.analysts ast.cmx codegen.cmx parser . cmx scanner

Fibonacci is cool

Page 20: Lindsay Schiminske (ls3245) Michelle Navarro …str .cmxa maze . ml ocamlftnd ocamlopt -linkpkg -package I Ivm str .cmxa -package Uvm.analysts ast.cmx codegen.cmx parser . cmx scanner