BGD - Columbia Universityaho/.../14-05-14_Team7_BGD.pdf · Introduction BGD is a simple language...
Transcript of BGD - Columbia Universityaho/.../14-05-14_Team7_BGD.pdf · Introduction BGD is a simple language...
![Page 1: BGD - Columbia Universityaho/.../14-05-14_Team7_BGD.pdf · Introduction BGD is a simple language for designing board game applications How to use Put your source code in our compiler](https://reader035.fdocuments.us/reader035/viewer/2022062603/5f03b7427e708231d40a6b1c/html5/thumbnails/1.jpg)
BGD--The Board Game Designer
![Page 2: BGD - Columbia Universityaho/.../14-05-14_Team7_BGD.pdf · Introduction BGD is a simple language for designing board game applications How to use Put your source code in our compiler](https://reader035.fdocuments.us/reader035/viewer/2022062603/5f03b7427e708231d40a6b1c/html5/thumbnails/2.jpg)
Introduction
Xiao Huang - Project ManagerKe Wu - Language GuruYinghui Huang - System ArchitectXingyu Wang - System IntegratorDechuan Xu - System Tester
![Page 3: BGD - Columbia Universityaho/.../14-05-14_Team7_BGD.pdf · Introduction BGD is a simple language for designing board game applications How to use Put your source code in our compiler](https://reader035.fdocuments.us/reader035/viewer/2022062603/5f03b7427e708231d40a6b1c/html5/thumbnails/3.jpg)
Introduction
● BGD is a simple language for designing board game applications ● How to use
○ Put your source code in our compiler folder○ Run $sh compile.sh your_code.bgd○ Run $sh run.sh○ Enjoy
● Sample Game○ Tic-Tac-Toe○ YushenGame
![Page 4: BGD - Columbia Universityaho/.../14-05-14_Team7_BGD.pdf · Introduction BGD is a simple language for designing board game applications How to use Put your source code in our compiler](https://reader035.fdocuments.us/reader035/viewer/2022062603/5f03b7427e708231d40a6b1c/html5/thumbnails/4.jpg)
Introduction ● Motivation
○ At very beginning, to be honest...○ Then, we found it interesting to construct our owner language○ Want to see our language coming to earth inspires us
● Properties○ Specify common properties ○ Primitive calculation
![Page 5: BGD - Columbia Universityaho/.../14-05-14_Team7_BGD.pdf · Introduction BGD is a simple language for designing board game applications How to use Put your source code in our compiler](https://reader035.fdocuments.us/reader035/viewer/2022062603/5f03b7427e708231d40a6b1c/html5/thumbnails/5.jpg)
Syntactic Constructs: Overview
piece_stmt
board_stmt
player_stmt
rule_stmt
function_stmt
input_stmt
![Page 6: BGD - Columbia Universityaho/.../14-05-14_Team7_BGD.pdf · Introduction BGD is a simple language for designing board game applications How to use Put your source code in our compiler](https://reader035.fdocuments.us/reader035/viewer/2022062603/5f03b7427e708231d40a6b1c/html5/thumbnails/6.jpg)
Syntactic Constructs: Overview
State types and numbers of pieces
State size of the game board
State number of players
State what kinds of actions in your game
State the restriction rules of the actions
![Page 7: BGD - Columbia Universityaho/.../14-05-14_Team7_BGD.pdf · Introduction BGD is a simple language for designing board game applications How to use Put your source code in our compiler](https://reader035.fdocuments.us/reader035/viewer/2022062603/5f03b7427e708231d40a6b1c/html5/thumbnails/7.jpg)
Syntactic Constructs: Overview
If you want to initialize the game board with pieces, you can define an initialize function.
Format:type player position
![Page 8: BGD - Columbia Universityaho/.../14-05-14_Team7_BGD.pdf · Introduction BGD is a simple language for designing board game applications How to use Put your source code in our compiler](https://reader035.fdocuments.us/reader035/viewer/2022062603/5f03b7427e708231d40a6b1c/html5/thumbnails/8.jpg)
Syntactic Constructs: Primitive data type: int, double, boolean, stringDerived data type: array, pos● pos: a data type for position on the board, consisting of two int value● position := (1,1)
Key word: PIECE, PLAYER, BOARD, RULE, FUNCTION, YES, NO, NIL…Statements: ● if-else statement, while statement, for-loop statement● function-definition statement
We use indentation to identify a suite
![Page 9: BGD - Columbia Universityaho/.../14-05-14_Team7_BGD.pdf · Introduction BGD is a simple language for designing board game applications How to use Put your source code in our compiler](https://reader035.fdocuments.us/reader035/viewer/2022062603/5f03b7427e708231d40a6b1c/html5/thumbnails/9.jpg)
Translator Architecture
Lexer: lexing.pyParser: yaccing.pyICG: traverse.pyCompile shell code: compile.sh
Running shell code: run.sh
![Page 10: BGD - Columbia Universityaho/.../14-05-14_Team7_BGD.pdf · Introduction BGD is a simple language for designing board game applications How to use Put your source code in our compiler](https://reader035.fdocuments.us/reader035/viewer/2022062603/5f03b7427e708231d40a6b1c/html5/thumbnails/10.jpg)
Translator Architecture: Front Endtic-tac-toe.bgd Token Flow
![Page 11: BGD - Columbia Universityaho/.../14-05-14_Team7_BGD.pdf · Introduction BGD is a simple language for designing board game applications How to use Put your source code in our compiler](https://reader035.fdocuments.us/reader035/viewer/2022062603/5f03b7427e708231d40a6b1c/html5/thumbnails/11.jpg)
Translator Architecture: Front Endtic-tac-toe.bgd Parser
![Page 12: BGD - Columbia Universityaho/.../14-05-14_Team7_BGD.pdf · Introduction BGD is a simple language for designing board game applications How to use Put your source code in our compiler](https://reader035.fdocuments.us/reader035/viewer/2022062603/5f03b7427e708231d40a6b1c/html5/thumbnails/12.jpg)
Translator Architecture: Front Endtic-tac-toe.bgd AST
![Page 13: BGD - Columbia Universityaho/.../14-05-14_Team7_BGD.pdf · Introduction BGD is a simple language for designing board game applications How to use Put your source code in our compiler](https://reader035.fdocuments.us/reader035/viewer/2022062603/5f03b7427e708231d40a6b1c/html5/thumbnails/13.jpg)
Translator Architecture: Front Endtic-tac-toe.bgd
GameDesigner.java
![Page 14: BGD - Columbia Universityaho/.../14-05-14_Team7_BGD.pdf · Introduction BGD is a simple language for designing board game applications How to use Put your source code in our compiler](https://reader035.fdocuments.us/reader035/viewer/2022062603/5f03b7427e708231d40a6b1c/html5/thumbnails/14.jpg)
Translator Architecture: Back End
![Page 15: BGD - Columbia Universityaho/.../14-05-14_Team7_BGD.pdf · Introduction BGD is a simple language for designing board game applications How to use Put your source code in our compiler](https://reader035.fdocuments.us/reader035/viewer/2022062603/5f03b7427e708231d40a6b1c/html5/thumbnails/15.jpg)
Runtime Environment
Java Compiler
CompilerFrontend
Source Code
GameDesigner.java
BytecodesJVM
compile.sh:
![Page 16: BGD - Columbia Universityaho/.../14-05-14_Team7_BGD.pdf · Introduction BGD is a simple language for designing board game applications How to use Put your source code in our compiler](https://reader035.fdocuments.us/reader035/viewer/2022062603/5f03b7427e708231d40a6b1c/html5/thumbnails/16.jpg)
Software Development Environment
![Page 17: BGD - Columbia Universityaho/.../14-05-14_Team7_BGD.pdf · Introduction BGD is a simple language for designing board game applications How to use Put your source code in our compiler](https://reader035.fdocuments.us/reader035/viewer/2022062603/5f03b7427e708231d40a6b1c/html5/thumbnails/17.jpg)
Compiler-Generator Tools
PLY (Python Lex-Yacc)Python 2.7
● Lexer lexing.py● Parser yaccing.py● ICG traverse.py
![Page 18: BGD - Columbia Universityaho/.../14-05-14_Team7_BGD.pdf · Introduction BGD is a simple language for designing board game applications How to use Put your source code in our compiler](https://reader035.fdocuments.us/reader035/viewer/2022062603/5f03b7427e708231d40a6b1c/html5/thumbnails/18.jpg)
Test Plan
● Mainly focused on frontend● Based on Python unittest module● Split into four parts:
○ lexer○ yaccer○ traverser○ general tests
![Page 19: BGD - Columbia Universityaho/.../14-05-14_Team7_BGD.pdf · Introduction BGD is a simple language for designing board game applications How to use Put your source code in our compiler](https://reader035.fdocuments.us/reader035/viewer/2022062603/5f03b7427e708231d40a6b1c/html5/thumbnails/19.jpg)
Test Plan: Lexer
1. Lexemes and token types
2. Indentation test3. Sample code test
![Page 20: BGD - Columbia Universityaho/.../14-05-14_Team7_BGD.pdf · Introduction BGD is a simple language for designing board game applications How to use Put your source code in our compiler](https://reader035.fdocuments.us/reader035/viewer/2022062603/5f03b7427e708231d40a6b1c/html5/thumbnails/20.jpg)
Test Plan: Yaccer
● Feed yaccer with test cases and inspect result non-terminals manually.
![Page 21: BGD - Columbia Universityaho/.../14-05-14_Team7_BGD.pdf · Introduction BGD is a simple language for designing board game applications How to use Put your source code in our compiler](https://reader035.fdocuments.us/reader035/viewer/2022062603/5f03b7427e708231d40a6b1c/html5/thumbnails/21.jpg)
Test Plan: Traverser
● Feed traverser with test cases to generate ICG (java code), and inspect code manually.
![Page 22: BGD - Columbia Universityaho/.../14-05-14_Team7_BGD.pdf · Introduction BGD is a simple language for designing board game applications How to use Put your source code in our compiler](https://reader035.fdocuments.us/reader035/viewer/2022062603/5f03b7427e708231d40a6b1c/html5/thumbnails/22.jpg)
Test Plan: General Tests
● PLY○ illegal characters warning for Lex○ Syntax error and SR conflicts warnings for Yacc○ Parsing table generated
● Java○ Eclipse compile-time debugging○ GUI
![Page 23: BGD - Columbia Universityaho/.../14-05-14_Team7_BGD.pdf · Introduction BGD is a simple language for designing board game applications How to use Put your source code in our compiler](https://reader035.fdocuments.us/reader035/viewer/2022062603/5f03b7427e708231d40a6b1c/html5/thumbnails/23.jpg)
PROJECT MANAGEMENT
● Start early○ As early as Jan.28th○ Detailed discussion followed
● Communicate often○ Meet Every Tuesday
● Keep all files up to date
![Page 24: BGD - Columbia Universityaho/.../14-05-14_Team7_BGD.pdf · Introduction BGD is a simple language for designing board game applications How to use Put your source code in our compiler](https://reader035.fdocuments.us/reader035/viewer/2022062603/5f03b7427e708231d40a6b1c/html5/thumbnails/24.jpg)
PROJECT MANAGEMENT
● Waterfall Model
![Page 25: BGD - Columbia Universityaho/.../14-05-14_Team7_BGD.pdf · Introduction BGD is a simple language for designing board game applications How to use Put your source code in our compiler](https://reader035.fdocuments.us/reader035/viewer/2022062603/5f03b7427e708231d40a6b1c/html5/thumbnails/25.jpg)
PROJECT MANAGEMENT
Github Commits
Project Begin
Spring Break
Tutorial & LRM
Before Final
Final Version
![Page 26: BGD - Columbia Universityaho/.../14-05-14_Team7_BGD.pdf · Introduction BGD is a simple language for designing board game applications How to use Put your source code in our compiler](https://reader035.fdocuments.us/reader035/viewer/2022062603/5f03b7427e708231d40a6b1c/html5/thumbnails/26.jpg)
PROJECT MANAGEMENTE
very
Day
Time to Submit
![Page 27: BGD - Columbia Universityaho/.../14-05-14_Team7_BGD.pdf · Introduction BGD is a simple language for designing board game applications How to use Put your source code in our compiler](https://reader035.fdocuments.us/reader035/viewer/2022062603/5f03b7427e708231d40a6b1c/html5/thumbnails/27.jpg)
Conclusion● Lessons Learned
○ Plan ahead○ Meet often○ Divide work reasonably○ Debug before commit is important!
![Page 28: BGD - Columbia Universityaho/.../14-05-14_Team7_BGD.pdf · Introduction BGD is a simple language for designing board game applications How to use Put your source code in our compiler](https://reader035.fdocuments.us/reader035/viewer/2022062603/5f03b7427e708231d40a6b1c/html5/thumbnails/28.jpg)
Conclusion● What Worked Well
○ Tuesday after developing…○ Divide work/everyone
responsible for one part
![Page 29: BGD - Columbia Universityaho/.../14-05-14_Team7_BGD.pdf · Introduction BGD is a simple language for designing board game applications How to use Put your source code in our compiler](https://reader035.fdocuments.us/reader035/viewer/2022062603/5f03b7427e708231d40a6b1c/html5/thumbnails/29.jpg)
Conclusion● What If We Could Start Over
○ Setup grammar asap○ Raise more language examples at first for test
![Page 30: BGD - Columbia Universityaho/.../14-05-14_Team7_BGD.pdf · Introduction BGD is a simple language for designing board game applications How to use Put your source code in our compiler](https://reader035.fdocuments.us/reader035/viewer/2022062603/5f03b7427e708231d40a6b1c/html5/thumbnails/30.jpg)
Conclusion● Why Use Our Language
○ Easy to use■ 12 lines to implement Gomoku game
○ Fun to design your own game■ YushenGame
○ Cross Platform■ Java as target language
![Page 31: BGD - Columbia Universityaho/.../14-05-14_Team7_BGD.pdf · Introduction BGD is a simple language for designing board game applications How to use Put your source code in our compiler](https://reader035.fdocuments.us/reader035/viewer/2022062603/5f03b7427e708231d40a6b1c/html5/thumbnails/31.jpg)
Demo
Demo For our Language:
Let’s have some fun!
![Page 32: BGD - Columbia Universityaho/.../14-05-14_Team7_BGD.pdf · Introduction BGD is a simple language for designing board game applications How to use Put your source code in our compiler](https://reader035.fdocuments.us/reader035/viewer/2022062603/5f03b7427e708231d40a6b1c/html5/thumbnails/32.jpg)
Demo
Program 1: YushenGameProgram 2: GomokuProgram 3: Init
![Page 33: BGD - Columbia Universityaho/.../14-05-14_Team7_BGD.pdf · Introduction BGD is a simple language for designing board game applications How to use Put your source code in our compiler](https://reader035.fdocuments.us/reader035/viewer/2022062603/5f03b7427e708231d40a6b1c/html5/thumbnails/33.jpg)
We had fun in a team!
![Page 34: BGD - Columbia Universityaho/.../14-05-14_Team7_BGD.pdf · Introduction BGD is a simple language for designing board game applications How to use Put your source code in our compiler](https://reader035.fdocuments.us/reader035/viewer/2022062603/5f03b7427e708231d40a6b1c/html5/thumbnails/34.jpg)
Q&A
THANKS!