boardr the racing board game creation language. project manager: eric leung language and tools guru:...

20
Boardr The Racing Board Game Creation Language

Upload: daniela-gregory

Post on 12-Jan-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Boardr The Racing Board Game Creation Language. Project Manager: Eric Leung Language and Tools Guru: Shensi Ding System Architect: Seong Jin Park System

BoardrThe Racing Board Game Creation Language

Page 2: Boardr The Racing Board Game Creation Language. Project Manager: Eric Leung Language and Tools Guru: Shensi Ding System Architect: Seong Jin Park System

Project Manager: Eric Leung

Language and Tools Guru: Shensi Ding

System Architect: Seong Jin Park

System Integrator: Jessica Wang

Tester and Validator: Nicholas Chao

The Team

Page 3: Boardr The Racing Board Game Creation Language. Project Manager: Eric Leung Language and Tools Guru: Shensi Ding System Architect: Seong Jin Park System

Boardr: Origins● Programming Languages and Translators course

● wanted a concept that we were all interested in

● games → board games → racing board games

Page 4: Boardr The Racing Board Game Creation Language. Project Manager: Eric Leung Language and Tools Guru: Shensi Ding System Architect: Seong Jin Park System

Motivation1. Winning condition provided.

2. Available for beginning programmers.

Page 5: Boardr The Racing Board Game Creation Language. Project Manager: Eric Leung Language and Tools Guru: Shensi Ding System Architect: Seong Jin Park System

Development/Runtime Environment

● Java 1.7 - JDK 7

● ANTLR v4 - ANTLRworks

● git - Github

● Makefileo make game g={pathToGame}

Page 6: Boardr The Racing Board Game Creation Language. Project Manager: Eric Leung Language and Tools Guru: Shensi Ding System Architect: Seong Jin Park System

LanguageHighlights: ●Rules

●Board, Players, Die

●Library functions

●Command line game output

Page 7: Boardr The Racing Board Game Creation Language. Project Manager: Eric Leung Language and Tools Guru: Shensi Ding System Architect: Seong Jin Park System

Hello WorldPlayer Hello; //creates a Player named HelloPlayer World; //creates a Player named WorldBoard HelloWorld = 1; //creates a board with one blockDie = 1; //creates a die with one side with maximum (and minimum) value of 1Number[] i = [ 1 ]; //array of Numbers that contains the positionsRule hello (i) { //creates a new rule, with i as a placeholder String hello = “Hello World”; println(hello); //prints “Hello World!” to the console};

Page 8: Boardr The Racing Board Game Creation Language. Project Manager: Eric Leung Language and Tools Guru: Shensi Ding System Architect: Seong Jin Park System

Here’s the parse tree!

Page 9: Boardr The Racing Board Game Creation Language. Project Manager: Eric Leung Language and Tools Guru: Shensi Ding System Architect: Seong Jin Park System

next Token

Translator Architecture

Lexer

Parser

CustomListener

Symbol Table

.boardr file BoardrTranslator

token stream

AST

Java Code

Playable Game

Page 10: Boardr The Racing Board Game Creation Language. Project Manager: Eric Leung Language and Tools Guru: Shensi Ding System Architect: Seong Jin Park System

Semantic AnalysisBasic types: Board, Die, Player, Number, String, boolean

Type checking!

●Symbol Table

●Type Mismatch

●Undeclared Variable

●Operation Mismatch

Page 11: Boardr The Racing Board Game Creation Language. Project Manager: Eric Leung Language and Tools Guru: Shensi Ding System Architect: Seong Jin Park System

Testing Plan● Step 1: Run file through antlr to verify correct parse tree. If

incorrect, modify grammar and repeat.

● Step 2: Translate file, using strings to verify correct symbol tables and type checking. We printed out the expected results and compared to the output. If incorrect, modify symbol table or type checking method.

● Step 3: Check output versus parallel java program. If incorrect, analyze and modify Translator or boardr file.

Page 12: Boardr The Racing Board Game Creation Language. Project Manager: Eric Leung Language and Tools Guru: Shensi Ding System Architect: Seong Jin Park System

Example Test ProgramInput

1.Player One;2.Board board = 5;3.Die = 1;4.Rule types([1]){5. String s = "string";6. boolean[] b = [true];7. String[] sa = ["hello", 1];8. };

Output

javac BoardrTranslator.javajava BoardrTranslator ../testing/typeCheckTest.boardrtext is Strings="string";should be string: "string";should be boolean: trueshould be string: "hello"should be string: 1TypeMismatchError: Type error! Cannot convert Number into String

Page 13: Boardr The Racing Board Game Creation Language. Project Manager: Eric Leung Language and Tools Guru: Shensi Ding System Architect: Seong Jin Park System

DEMOFunTown and Ladders

Page 14: Boardr The Racing Board Game Creation Language. Project Manager: Eric Leung Language and Tools Guru: Shensi Ding System Architect: Seong Jin Park System

Timeline of Events

Language Reference

Manual (3/26)

Board idea (early

February)

Team Formation

Grammar implemented

(4/20)

Basic Hello World (4/25)

Code generation complete

(5/10)

Final Report &

Presentation

Begin code generation

(4/21 onwards)

Page 15: Boardr The Racing Board Game Creation Language. Project Manager: Eric Leung Language and Tools Guru: Shensi Ding System Architect: Seong Jin Park System

Github Commits

Note: All of the earliest commits working on grammar (from late March/early April) were lost because of Github failures.

Page 16: Boardr The Racing Board Game Creation Language. Project Manager: Eric Leung Language and Tools Guru: Shensi Ding System Architect: Seong Jin Park System

Lessons Learned1. Listen and be considerate of each others’ opinions.

2. Be flexible with each others’ schedules.

3. Review project continuously.

4. Figure out implementation details carefully.

Page 17: Boardr The Racing Board Game Creation Language. Project Manager: Eric Leung Language and Tools Guru: Shensi Ding System Architect: Seong Jin Park System

What Worked Well1. Start early on the final report.

2. Set up a group calendar.

3. Dedicate days to working on the project.

Page 18: Boardr The Racing Board Game Creation Language. Project Manager: Eric Leung Language and Tools Guru: Shensi Ding System Architect: Seong Jin Park System

Advice1. Remind each other of due dates.

2. Know the tools that you are using (well).

Page 19: Boardr The Racing Board Game Creation Language. Project Manager: Eric Leung Language and Tools Guru: Shensi Ding System Architect: Seong Jin Park System

Why use Boardr?● intuitive

● interactive

● for basic programmers

Page 20: Boardr The Racing Board Game Creation Language. Project Manager: Eric Leung Language and Tools Guru: Shensi Ding System Architect: Seong Jin Park System

Thank you!