BugsWorld Project The Game The Simulator The Language The Translator.

Slides:



Advertisements
Similar presentations
PHP I.
Advertisements

1 Note: Original slides provided by and modified for Mr. Smith’s AP Computer Science A classwww.apComputerScience.com.
Code Generator Translator Architecture Parser Tokenizer string of characters (source code) string of tokens abstract program string of integers (object.
Introduction to Programming G51PRG University of Nottingham Revision 1
CSC 221 Computer Organization and Assembly Language Lecture 21: Conditional and Block Structures: Assembly Programs.
報告者:會計四 簡思佳 The process of converting a program written in a high-level language into a machine-executable form. language implementation Ex.C++
Translator Architecture Code Generator ParserTokenizer string of characters (source code) string of tokens abstract program string of integers (object.
1 Chapter Eight Designing Libraries. 2 Programming Complexity As long as we continue to solve problems of ever-increasing sophistication, the process.
CS252: Systems Programming
IntroductionIntroduction  Computer program: an ordered sequence of statements whose objective is to accomplish a task.  Programming: process of planning.
1 Chapter 1 Object-Oriented Programming. 2 OO programming and design Object-oriented programming and design can be contrasted with alternative programming.
Data Parallel Algorithms Presented By: M.Mohsin Butt
Chapter 2: Algorithm Discovery and Design
1 Key Concepts:  Why C?  Life Cycle Of a C program,  What is a computer program?  A program statement?  Basic parts of a C program,  Printf() function?
1 Chapter 3 Programs and Packages. 2 Java Virtual Machine (JVM) Java programs execute on the JVM. The JVM is a virtual rather than a physical machine,
Lecture 1: Overview of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++ Designed.
ANTLR with ASTs. Abstract Syntax Trees ANTLR can be instructed to produce ASTs for the output of the parser ANTLR uses a prefix notation for representing.
ANTLR.
Overview of JSP Technology. The need of JSP With servlets, it is easy to – Read form data – Read HTTP request headers – Set HTTP status codes and response.
Introduction to Programming Language CS105 Programming Language First-generation: Machine language Second-generation: Assembly language Third-generation:
Chapter 12: Simulation and Modeling
Basics Programming Concepts. Basics A computer program is a set of instructions to tell a computer what to do Machine language = circuit level language.
Parser-Driven Games Tool programming © Allan C. Milne Abertay University v
BL Program PROGRAM identifier IS BEGIN END identifier sequence of statements sequence of new instructions.
CSC 338: Compiler design and implementation
Lexical Analysis - An Introduction Copyright 2003, Keith D. Cooper, Ken Kennedy & Linda Torczon, all rights reserved. Students enrolled in Comp 412 at.
Abstraction IS 101Y/CMSC 101 Computational Thinking and Design Tuesday, September 17, 2013 Marie desJardins University of Maryland, Baltimore County.
Lecture :2 1.  DEFENTION : Java is a programming language expressly designed for use in the distributed environment of the Internet. It was designed.
Chapter 6 Programming Languages (2) Introduction to CS 1 st Semester, 2015 Sanghyun Park.
Chapter 6 Programming Languages © 2007 Pearson Addison-Wesley. All rights reserved.
Topic 26 Two Dimensional Arrays "Computer Science is a science of abstraction -creating the right model for a problem and devising the appropriate mechanizable.
Interpretation Environments and Evaluation. CS 354 Spring Translation Stages Lexical analysis (scanning) Parsing –Recognizing –Building parse tree.
CSE 3341 Principles of Programming Languages Neelam Soundarajan Computer Sc. & Eng. Dreese Labs 579
PHP - 1h. How it works Client requests document Server loads document in memory Server processes document with relevant module (PHP) Server sends XHTML.
COP 4620 / 5625 Programming Language Translation / Compiler Writing Fall 2003 Lecture 1, 08/28/03 Prof. Roy Levow.
What on Earth? LEXEMETOKENPATTERN print p,r,i,n,t (leftpar( 4number4 *arith* 5number5 )rightpar) userAnswerID Letter followed by letters and digits “Game.
ECA 225 Applied Interactive Programming1 ECA 225 Applied Online Programming basics.
A compiler is a computer program that translate written code (source code) into another computer language Associated with high level languages A well.
Using Lists Games Programming in Scratch. Games Programming in Scratch Extension – Using Lists Learning Objectives Create a temporary data store (list)
1 Compiler & its Phases Krishan Kumar Asstt. Prof. (CSE) BPRCE, Gohana.
 Fall Chart 2  Translators and Compilers  Textbook o Programming Language Processors in Java, Authors: David A. Watts & Deryck F. Brown, 2000,
CST336, Dr. Krzysztof Pietroszek Week 2: PHP. 1.Introduction to PHP 2.Embed PHP code into an HTML web page 3.Generate (output HTML) web page using PHP.
Getting Started With Java September 22, Java Bytecode  Bytecode : is a highly optimized set of instructions designed to be executed by the Java.
CS223: Software Engineering
Compiler Construction CPCS302 Dr. Manal Abdulaziz.
CSC 4181 Compiler Construction
1 Asstt. Prof Navjot Kaur Computer Dept PRESENTED BY.
System Programming Basics Cha#2 H.M.Bilal. Operating Systems An operating system is the software on a computer that manages the way different programs.
ICS312 Introduction to Compilers Set 23. What is a Compiler? A compiler is software (a program) that translates a high-level programming language to machine.
Overview of Compilation Prepared by Manuel E. Bermúdez, Ph.D. Associate Professor University of Florida Programming Language Principles Lecture 2.
PZ02CX Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ02CX - Perl Programming Language Design and Implementation.
OCR A Level F453: The function and purpose of translators Translators a. describe the need for, and use of, translators to convert source code.
Review A program is… a set of instructions that tell a computer what to do. Programs can also be called… software. Hardware refers to… the physical components.
BUGSWORLD It CAME from Aaron Shbeeb – Eugene Talagrand Building a better bug – by any means necessary.
Introduction to Compiler Construction
Lexical and Syntax Analysis
Discussion 2: More to discuss
Compiler Construction (CS-636)
Why to use the assembly and why we need this course at all?
Perl Programming Language Design and Implementation (4th Edition)
Overview of Compilation The Compiler Front End
Overview of Compilation The Compiler Front End
JavaScript an introduction.
Escape sequences: Practice using the escape sequences on the code below to see what happens. Try this next code to help you understand the last two sequences.
COMPUTER PROGRAMMING PYTHON
CMPE 152: Compiler Design August 21/23 Lab
Chapter 6: Programming Languages
MDT OCL 1.3 Mini-deck June 10, 2009.
Implementation of a Functional Programming Language
Presentation transcript:

BugsWorld Project The Game The Simulator The Language The Translator

The Game: It’s a BugsWorld!

The Simulator Client Client Server Display Display Client

Simulator Continued… One server, multiple clients and displays Server keeps track of world, processes client requests, resolves conflicts Client simulates creature behavior for all creatures of one species Display shows current state of world plus some statistics about the simulation Each process can run on a different computer (distributed simulation)

The Language: BL The behavior of each species is determined by a program in BL Primitive instructions: move, turnleft, turnright, infect, skip Control structures: IF-THEN, IF-THEN-ELSE, WHILE-DO Defining new instructions: INSTRUCTION-IS Conditions: test whether next cell is empty, friend, enemy, or wall (plus true and random)

An Example PROGRAM TryToGuess IS INSTRUCTION FindObstacle IS WHILE next-is-empty DO move END WHILE END FindObstacle BEGIN # TryToGuess WHILE true DO FindObstacle IF next-is-enemy THEN infect ELSE IF next-is-wall THEN turnleft ELSE # next-is-friend skip END IF END WHILE END TryToGuess

Language Continued… Precise syntax Case sensitive Matching ENDs Comments Identifiers start with ‘a’..’z’,’A’..’Z’ followed by any of ‘a’..’z’,’A’..’Z’,’0’..’9’,’-’

The Translator PROGRAM TryToGuess IS INSTRUCTION FindObstacle IS WHILE next-is-empty DO move END WHILE END FindObstacle BEGIN # TryToGuess WHILE true DO FindObstacle IF next-is-enemy THEN infect ELSE IF next-is-wall THEN turnleft ELSE # next-is-friend skip END IF END TryToGuess <20, 15, 20, 6, 7, 0, 5, 2, 12, 12, 3, 5, 18, 8, 17, 1, 5, 18, 4, 5, 0>

Translator Continued… Code Generator Parser Tokenizer string of characters (source code) string of tokens abstract program string of integers (object code)

What You Will Do Build the translator Complete the client Implement abstract program component (Lab#2, Closed Lab #4) Implement parser extension (Lab #3) Implement code generator extension (Lab #4) Implement tokenizer component (Lab #5) Complete the client Implement interpreter (Closed Lab #6)