Boardr The Racing Board Game Creation Language
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
Boardr: Origins ● Programming Languages and Translators course ● wanted a concept that we were all interested in ● games → board games → racing board games
Motivation 1. Winning condition provided. 2. Available for beginning programmers.
Development/Runtime Environment ● Java JDK 7 ● ANTLR v4 - ANTLRworks ● git - Github ● Makefile o make game g={pathToGame}
Language Highlights: ● Rules ● Board, Players, Die ● Library functions ● Command line game output
Hello World Player Hello; //creates a Player named Hello Player World; //creates a Player named World Board HelloWorld = 1; //creates a board with one block Die = 1; //creates a die with one side with maximum (and minimum) value of 1 Number[] i = [ 1 ]; //array of Numbers that contains the positions Rule hello (i) { //creates a new rule, with i as a placeholder String hello = “Hello World”; println(hello); //prints “Hello World!” to the console };
Here’s the parse tree!
next Token Translator Architecture Lexer Parser CustomListener Symbol Table.boardr file BoardrTranslator token stream AST Java Code Playable Game
Semantic Analysis Basic types: Board, Die, Player, Number, String, boolean Type checking! ● Symbol Table ● Type Mismatch ● Undeclared Variable ● Operation Mismatch
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.
Example Test Program Input 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.java java BoardrTranslator../testing/typeCheckTest.boardr text is Strings="string"; should be string: "string"; should be boolean: true should be string: "hello" should be string: 1 TypeMismatchError: Type error! Cannot convert Number into String
DEMO FunTown and Ladders
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)
Github Commits Note: All of the earliest commits working on grammar (from late March/early April) were lost because of Github failures.
Lessons Learned 1. 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.
What Worked Well 1. Start early on the final report. 2. Set up a group calendar. 3. Dedicate days to working on the project.
Advice 1. Remind each other of due dates. 2. Know the tools that you are using (well).
Why use Boardr? ● intuitive ● interactive ● for basic programmers
Thank you!