boardr the racing board game creation language. project manager: eric leung language and tools guru:...
TRANSCRIPT
BoardrThe 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
Motivation1. Winning condition provided.
2. Available for beginning programmers.
Development/Runtime Environment
● Java 1.7 - JDK 7
● ANTLR v4 - ANTLRworks
● git - Github
● Makefileo make game g={pathToGame}
LanguageHighlights: ●Rules
●Board, Players, Die
●Library functions
●Command line game output
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};
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 AnalysisBasic 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 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
DEMOFunTown 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 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.
What Worked Well1. Start early on the final report.
2. Set up a group calendar.
3. Dedicate days to working on the project.
Advice1. 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!