Turnt. A TURN BASED GAME CREATION LANGUAGE.. turnt Language JEFFREY TAO.

Slides:



Advertisements
Similar presentations
1 JavaCUP JavaCUP (Construct Useful Parser) is a parser generator Produce a parser written in java, itself is also written in Java; There are many parser.
Advertisements

PROC-1 3. Software Process. PROC-2 What’s a process? Set of activities in creating software It involves creativity –hard to automate –Requires human judgment.
Software Development Methodologies 1. A methodology is: A collection of procedures, techniques, principles, and tools that help developers build a computer.
Programming Languages Marjan Sirjani 2 2. Language Design Issues Design to Run efficiently : early languages Easy to write correctly : new languages.
Alternate Software Development Methodologies
Agile development By Sam Chamberlain. First a bit of history..
CS 4800 By Brandon Andrews.  Specifications  Goals  Applications  Design Steps  Testing.
BROOM: A Matrix Language Chris Tobin Michael Weiss Gabe Glaser Brian Pellegrini.
Scripting Languages CS351 – Programming Paradigms.
Guide To UNIX Using Linux Third Edition
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
“GENERIC SCRIPT” Everything can be automated, even automation process itself. “GENERIC SCRIPT” Everything can be automated, even automation process itself.
Big Projects  Part of this class is about picking a cool software project and building it 1.
Systems Software Operating Systems.
public static void main (String[] args)
Miser-C MISRA-C Compliance Checker Ian Biller, Phillippe Dass, Bryan Eldridge, Jon Senchyna, Tracy Thomas Faculty Coach: Professor Michael Lutz Project.
Chapter 9 Interactive Multimedia Authoring with Flash - Introduction to Programming “Computers and Creativity” Richard D. Webster, COSC 109 Instructor.
Platforms for Learning in Computer Science July 28, 2005.
Chapter 4 Agile Development
Java Class Syntax CSIS 3701: Advanced Object Oriented Programming.
INTRODUCTION TO COMPUTING CHAPTER NO. 06. Compilers and Language Translation Introduction The Compilation Process Phase 1 – Lexical Analysis Phase 2 –
Created by, Author Name, School Name—State FLUENCY WITH INFORMATION TECNOLOGY Skills, Concepts, and Capabilities.
Chapter 1. Introduction.
Boardr The Racing Board Game Creation Language. Project Manager: Eric Leung Language and Tools Guru: Shensi Ding System Architect: Seong Jin Park System.
FINAL MPX DELIVERABLE Due when you schedule your interview and presentation.
Chapter 10: Compilers and Language Translation Invitation to Computer Science, Java Version, Third Edition.
Java Programming Introduction & Concepts. Introduction to Java Developed at Sun Microsystems by James Gosling in 1991 Object Oriented Free Compiled and.
{ Graphite Grigory Arashkovich, Anuj Khanna, Anirban Gangopadhyay, Michael D’Egidio, Laura Willson.
Compiler course 1. Introduction. Outline Scope of the course Disciplines involved in it Abstract view for a compiler Front-end and back-end tasks Modules.
CoZy: A very cool language for temperature control Project Manager: Hannah Keiler Language and Tools Guru: Nate Booth System Architect: Giovanni Ortuno.
Software Life Cycle Models. Waterfall Model  The Waterfall Model is the earliest method of structured system development.  The original waterfall model.
Chapter 6 Programming Languages (2) Introduction to CS 1 st Semester, 2015 Sanghyun Park.
Systems Software Operating Systems. What is software? Software is the term that we use for all the programs and data that we use with a computer system.
Implement Unit Test Framework for Application running on a Pocket PC 2003 device Durga Kulkarni Cyberonics Inc August 28, 2009.
Review 1.Lexical Analysis 2.Syntax Analysis 3.Semantic Analysis 4.Code Generation 5.Code Optimization.
PL/T Programming Language for Time Supervised by Professor Alfred V. Aho Teaching Assistant: Mr. Yan Zou Laurent Charignon (lc2817): Project Manager Sameer.
Computers Are Your Future Tenth Edition Chapter 13: Systems Analysis & Design Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall1.
1 Visual Studio.NET.NET as a Teaching Tool John D. Haney John M. Lovely Northern Arizona University College of Business Administration.
1.  10% Assignments/ class participation  10% Pop Quizzes  05% Attendance  25% Mid Term  50% Final Term 2.
BUILD ON THE POLYGLOT COMPILER FRAMEWORK MIHAL BRUMBULLI 7th Workshop “SEERE” Montenegro-Risan 9-14 September 2007 SimJ Programming Language.
SilkTest 2008 R2 SP1: Silk4J Introduction. ConfidentialCopyright © 2008 Borland Software Corporation. 2 What is Silk4J? Silk4J enables you to create functional.
1 Compiler Design (40-414)  Main Text Book: Compilers: Principles, Techniques & Tools, 2 nd ed., Aho, Lam, Sethi, and Ullman, 2007  Evaluation:  Midterm.
Celluloid An interactive media sequencing language.
M1G Introduction to Programming 2 5. Completing the program.
Imagine Creating Software Without a Single Line of Code!
By Mr. Muhammad Pervez Akhtar
T Project Review WellIT I2 Iteration
What is a compiler? –A program that reads a program written in one language (source language) and translates it into an equivalent program in another language.
Lecture1 Instructor: Amal Hussain ALshardy. Introduce students to the basics of writing software programs including variables, types, arrays, control.
BY: JAKE TENBERG & CHELSEA SHIPP PROJECT REVIEW: JGIBBERISH.
Execution ways of program References: www. en.wikipedia.org/wiki/Integrated_development_environment  You can execute or run a simple java program with.
Visual Programming Borland Delphi. Developing Applications Borland Delphi is an object-oriented, visual programming environment to develop 32-bit applications.
Project Management Software development models & methodologies
Open Source Compiler Construction (for the JVM)
CS223: Software Engineering
Agile Project Management and the yin & yang of
Compiler Design (40-414) Main Text Book:
EECS 183 Discussion #9: It’s time to “Git” Python! November 22nd, 2016
Data Virtualization Tutorial: Introduction to SQL Script
CS 3304 Comparative Languages
Project Workflow.
课程名 编译原理 Compiling Techniques
How to Successfully Implement an Agile Project
Software Programming J. Holvikivi 2014.
Chapter 10 Programming Fundamentals with JavaScript
Design and Programming
CSE401 Introduction to Compiler Construction
Syntax-Directed Translation
Chapter 10: Compilers and Language Translation
Agile Development.
Presentation transcript:

turnt. A TURN BASED GAME CREATION LANGUAGE.

turnt Language JEFFREY TAO

Buzzwords Event-driven model ◦Declare events that can be manually or automatically emitted ◦Register callbacks (directives) that run on event emission An action/response way of thinking about implementation (“when … do …”) Globally-accessible, mutable game state

Motivation Create a generalized system for writing the game logic of turn-based games with well-defined rules Ease of implementation translating as directly as possible from rules to source code

Usage Build the translator from grammar using ANTLR cat source.tt | java Translate javac Main.java java Main

Let’s get turnt

turnt. Driver Maintains: ◦List of Events ◦List of Directives ◦Priority Queue of Queued Directives Events: ◦Maintain a list of directives registered to it. ◦Can have an auto emit condition. Directives: ◦Contain a procedure that is called when popped from the priority queue. ◦Many to many relationship with events.

turnt. Driver When executed, the turnt driver emits the “main” event, queueing all directives registered to “main” as of running. Directives are popped. During the execution of a directive if an event is emitted, all directives registered to that event are pushed onto the directive priority queue. After each directive finishes execution, all events are checked to see if their auto-emit conditions are met. Events whose auto-emit conditions are met are emitted, and their registered directives are queued. Directive PoppedDirective Executed Emitted Events Have Their Registered Directives Queued Event List Checked for Auto-Emit Auto-Emitted Events’ Directives Queued

turnt. Driver (Actions) Actions serve as procedures which are executed immediately upon being called with their identifier name, followed by a semi colon. Actions can be called from directives. Nothing is passed or returned, relying on state.

turnt. Driver (State) State is a set of global variables that can be accessed from any directive or action. A variable in state is initialized with a value using the command “state ”, which brings the value into local scope. A variable in state is retrieved using the command “state ”, which brings the value into local scope. A variable in state is modified using the command “state ”. The variable must be brought into local scope by a state initialization or get first.

Project Management KHETTHAI LAKSANAKORN

Project Management (Agile) The following principles of Agile Software Development were followed in implementing the language/translator. ◦Welcoming changing requirements. ◦Working software delivered frequently. ◦Face to face conversation ◦Measuring progress via working software. ◦Sustainable development at a constant pace. ◦Attention to technical excellence and good design. ◦Simplicity. Credit: pixshark.com

Project Management (Meetings) Group meetings: weekly during planning, biweekly during development. Planning: Deciding on language’s programming constructs and features. Development: meetings had two aspects. ◦Goals – identifying deliverables for the next iteration and how they will be implemented. ◦Coding – realizing those deliverables. Coding was also done on an individual basis.

Project Management (Iterative Process) Iteration 1: Driver code, grammar, translator prototype. Capable of running “Hello World” (events, directives, register) Iteration 2: Event emission, runtime register, testing framework. Iteration 3: Type declarations, assignment, control blocks. Priorities for directives. Included overhaul of grammar for ambiguity. Iteration 4: State, user input, auto emission of events.

Project Management (Timeline)

Translator Architecture WHITNEY BAILEY

Block Diagram Turnt Program (example: program.tt) turntLexer.java Turnt Program Token Stream turntParser.javaParse Tree TurntTranslator.java turntToJava.java Main.java

Example Program: Hello World.tt register start main 0; dir start { print “Hello World”; }

Lexical Analysis register start main 0; dir start { print “Hello World”; } turntLexer.java ‘register’ ID: start ‘main’ INT: 0 ‘;’ ‘dir’ ID: start ‘{‘ ‘print’ String: “Hello World” ‘;’ ‘}’

Syntactical Analysis ‘register’ ID: start ‘main’ INT: 0 ‘;’ ‘dir’ ID: start ‘{‘ ‘print’ String: “Hello World” ‘;’ ‘}’ turntParser.java prgm method ‘register’ ID ‘main’ ; INT ‘start’ 0 dir registerMain ‘dir’ ID { } blocks ‘start’ block line print ‘print’String “Hello World”

Translation prgm method ‘register’ ID ‘main’ ; INT ‘start’ 0 dir registerMain ‘dir’ ID { } blocks ‘start’ block line print ‘print’String “Hello World” TurntTranslator.java turntToJava.java Main.java startDirective.java State.java MainEvent.java Event.java Engine.java Actions.java Directive.java

“turnt” environment NOAH STEBBINS

Dev Environment ● UNIX: CLIC & Mac OS X ● Editors rather than IDEs (Sublime & Vim) ● Github & Git ● README o file structure o CLASSPATH variables

Run-time Environment ● Scripts o test_trans.sh → test translator with grammar for input  generates Java files, then “java Main” o test_parse.sh → test parse tree with grammar for input o test_compile.sh → early stages grammar changes o clean.sh

Tools ● ANTLR: “Another Tool for Language Recognition” o everything in Java = convenient o LL parsing o tree parser, walked for a given input (.tt)  turntToJava() contains translations

Testing XIWEI FENG

Test Plan Framework: JUnit version 4.12 A simple Java-based test framework for repeatable tests. One-click for all tests.

Tested Feature Loop: for, while IO: print, prompt Flow control: If-else Data Type and Operation: Bool, Array Others: Action, State, Priority Queue, Emit

Test Sample Turnt file register whileTest main 1; dir whileTest { int i = 0 ; while (i < 10) { print "0"; if (i == 5) { print "5"; } i = i + 1; }

Test Sample Java file import org.junit.*; import java.io.*; public class WhileTest public void testWhile() { final ByteArrayOutputStream out = new ByteArrayOutputStream(); System.setOut(new PrintStream(out)); Main.main(null); Assert.assertEquals("0\n0\n0\n0\n0\n0\n5\n0\n0\n0\n0\n", out.toString()); }

Test Screenshot cd../src/ ls Translate.java install.sh test_parse.sh translateToJava.java clean.sh test_compile.sh test_trans.sh turnt.g4 antlr4 turnt.g4 javac turnt*.java javac Translate.java cd../test/ /run_test.sh WhileTest/ Running Test WhileTest JUnit version Time: OK (1 test)

Lessons Learned Project management is challenging in large groups. Communication of concepts is more difficult than anticipated. Difficult to come to a consensus when team members have different opinions. Difficult to keep track of all the moving parts in the translator.

What Went Well Weekly meetings were effective means of facilitating iterative development. Starting the project early allowed up to finish most of the functionality upfront.

What Should Have Been Done Differently A lot of time was wasted trying to explain concepts. Less time should have been spent debating details (50/50 decisions that don’t matter) More tests needed to be written.

Why Everyone Should Get turnt. Interesting coding paradigm. Provides easy translation of game rules into code. Utilizes a robust driver in the target program. Experience in an event-oriented language. Turn down for what?