Wizard of House Management - Programming Language and Translators Project Rui Kuang Arvid Bessen Andrey Butov Svetlana Starshinina.

Slides:



Advertisements
Similar presentations
Introduction to C Programming
Advertisements

CPSC 388 – Compiler Design and Construction
Symbol Table.
Semantics Static semantics Dynamic semantics attribute grammars
1 Mooly Sagiv and Greta Yorsh School of Computer Science Tel-Aviv University Modern Compiler Design.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 330 Programming Language Structures Ch.2: Syntax and Semantics Fall 2005.
Introduction To System Analysis and Design
BROOM: A Matrix Language Chris Tobin Michael Weiss Gabe Glaser Brian Pellegrini.
Exceptions in Java Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Environments and Evaluation
Semantic analysis Enforce context-dependent language rules that are not reflected in the BNF, e.g.a function must have a return statement. Decorate AST.
Transformation of Java Card into Diet Java Semester Project Presentation Erich Laube.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Guide To UNIX Using Linux Third Edition
Chapter 1 Program Design
Programming Languages and Translators Prof. Stephen Edwards, Fall 2003 Team Members: Haronil Estevez ~ Diana Jackson ~ Catherine MacInnes ~ Adam Rosenzweig.
Introduction to XML This material is based heavily on the tutorial by the same name at
CH1 – A 1 st Program Using C#. Program Set of instructions which tell a computer what to do. Machine Language Basic language computers use to control.
Advanced Database CS-426 Week 2 – Logic Query Languages, Object Model.
CS102 Introduction to Computer Programming
Introduction To System Analysis and design
A First Program Using C#
5.3 Machine-Independent Compiler Features
220 FINAL TEST REVIEW SESSION Omar Abdelwahab. INHERITANCE AND POLYMORPHISM Suppose you have a class FunClass with public methods show, tell, and smile.
CIS 199 Test 01 Review. Computer Hardware  Central Processing Unit (CPU)  Brains  Operations performed here  Main Memory (RAM)  Scratchpad  Work.
Functions Part I (Syntax). What is a function? A function is a set of statements which is split off into a separate entity that can be used like a “new.
CSC3315 (Spring 2009)1 CSC 3315 Programming Languages Hamid Harroud School of Science and Engineering, Akhawayn University
Client Scripting1 Internet Systems Design. Client Scripting2 n “A scripting language is a programming language that is used to manipulate, customize,
{ Graphite Grigory Arashkovich, Anuj Khanna, Anirban Gangopadhyay, Michael D’Egidio, Laura Willson.
Semantics CSE 340 – Principles of Programming Languages Fall 2015 Adam Doupé Arizona State University
CS 280 Data Structures Professor John Peterson. How Does Parsing Work? You need to know where to start (“statement”) This grammar is constructed so that.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
CS412/413 Introduction to Compilers and Translators Spring ’99 Lecture 8: Semantic Analysis and Symbol Tables.
Interpretation Environments and Evaluation. CS 354 Spring Translation Stages Lexical analysis (scanning) Parsing –Recognizing –Building parse tree.
1 Mooly Sagiv and Greta Yorsh School of Computer Science Tel-Aviv University Modern Compiler Design.
CS 153: Concepts of Compiler Design October 5 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
University of Sunderland CIF 102/FIF102 Fundamentals of DatabasesUnit 15 Programming in Microsoft Access using VBA Using VBA to add functionality.
PLT Final Project---COLOGO Lixing Dong, Zhou Ma, Chao Song, Siyuan Lu, Dongyang Jiang.
1 Compiler Construction (CS-636) Muhammad Bilal Bashir UIIT, Rawalpindi.
CS536 Semantic Analysis Introduction with Emphasis on Name Analysis 1.
Celluloid An interactive media sequencing language.
The Evolution of the StringTemplate Engine Presented to the UC Berkeley Harmonia group 15 December 2004 Terence Parr University of San Francisco
Behavioral Patterns CSE301 University of Sunderland Harry R Erwin, PhD.
S11-1 ADM , Section 11, August 2005 Copyright  2005 MSC.Software Corporation SECTION 11 MACROS: OVERVIEW.
Chapter 5 System Modeling. What is System modeling? System modeling is the process of developing abstract models of a system, with each model presenting.
Cross Language Clone Analysis Team 2 February 3, 2011.
Concepts and Realization of a Diagram Editor Generator Based on Hypergraph Transformation Author: Mark Minas Presenter: Song Gu.
C H A P T E R T W O Linking Syntax And Semantics Programming Languages – Principles and Paradigms by Allen Tucker, Robert Noonan.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 14 Event-Driven Programming with Graphical User Interfaces.
Text TCS INTERNAL Oracle PL/SQL – Introduction. TCS INTERNAL PL SQL Introduction PLSQL means Procedural Language extension of SQL. PLSQL is a database.
CS412/413 Introduction to Compilers Radu Rugina Lecture 11: Symbol Tables 13 Feb 02.
T01. Outline and concepts Promising future comes from the dedication.
Java Programming Fifth Edition Chapter 1 Creating Your First Java Classes.
CIS 199 Test 01 Review.
Chapter 1 Introduction.
Types for Programs and Proofs
Object-Oriented Database Management System (ODBMS)
Semantic Analysis with Emphasis on Name Analysis
Software Design and Development
Chapter 1 Introduction.
CS 153: Concepts of Compiler Design October 3 Class Meeting
C-language Lecture By B.S.S.Tejesh, S.Neeraja Asst.Prof.
CS 536 / Fall 2017 Introduction to programming languages and compilers
IDE and Visualisation of Abstract Syntax Trees for Coco/R
CPSC 388 – Compiler Design and Construction
CSE401 Introduction to Compiler Construction
CSCE 330 Programming Language Structures Ch.2: Syntax and Semantics
CS 432: Compiler Construction Lecture 11
Ninth step for Learning C++ Programming
CMPE 152: Compiler Design September 17 Class Meeting
Presentation transcript:

Wizard of House Management - Programming Language and Translators Project Rui Kuang Arvid Bessen Andrey Butov Svetlana Starshinina

WHOM A programming language for creation and management of a household Language of the future: expanding the use of computers in our everyday lives Allows automation of tedious tasks

Goals Simple Powerful Event-driven Object-oriented Extendible

What Can WHOM Do? Specify how objects respond to changing conditions (environmental object states) Example: if it rains, close all windows & turn off the sprinklers Another example: if a window is broken, set off the alarm, call the police

Why WHOM? Provides easy-to-use event handling, which is important in house manipulation Easy to use even for non-programmers

Syntax and Semantics Java-like syntax Basic Types: – number and string – realtime and normal Library support with “import” Object-oriented (“class”, “extends”) Static semantics analysis done in both AST walker and backend Error handling class catches all the errors from Lexer, Parser, AST walker and backend to log window for displaying

Recipe Import library Class definition – Attributes (class objects, number or string variables) – Methods – Inclass events (trigged by hardware) Variable declaration Event implementation – In-class event – Logic condition

Example // foo.wl string msg; class foo{ number foo_num; void who_am_i(void){ msg = "I am the father"; } class cfoo extends foo{ void who_am_i(void){ msg = "I am the child"; } //example.whom Import “whom.wl”,“foo.wl”; foo a; cfoo b; once (SECOND == 30){ a.who_am_i(); } once (SECOND == 0){ b.who_am_i(); }

Example import whom.wl; //class specification class AdjustableLamp extends Light{ number brightness = 0; void selfAdjust(){ brightness = (LIGHTNESS/10.0)*3.0; } EVENT_BUBBLE_DAD; } AdjustableLamp lamp; number oldLightness = 0; once (oldLightness–LIGHTNESS>4){ lamp.selfAdjust(); oldLightness = LIGHTNESS; } once lamp.EVENT_BUBBLE_BAD{ lamp.brightness=0; }

The Backend – Main Challenges Event-driven Support for complex scoping rules (nested) – static / global – dynamic / stack – classes, subclasses Class hierarchy Object-oriented for object-oriented language: Classes corresponding to aspects of the language

Overview – Main Classes ObservableObject and Event – Events subscribe to ObservableObjects – Subscribers notified if ObservableObject changes Expression and Statement Scopes: ParsingScope and InstantiatedScope Classes

Walking the Tree Get variables / objects for name (existence check) Get methods (dynamic) Construct expressions out of them (type checking) Construct statement out of expressions Statements + scope: block Associate block with surrounding block, method, event,...

Execution Variable changes: all events listening to it reevaluate their conditions Condition holds: execute associated block by executing statements, by executing expressions. Nifty features: – Recursion – Subclassing / polymorphism

WHOM Testing Intended Execution environment: – An embedded system. Viable solution: – Software Emulator Testing solution: – WEM & Organized test programs.

WEM – [W]HOM [EM]ulator Emulation Features – Full display of current state of household. – Dynamic update of external variables such as time. – Ability to affect the behavior of the system by modifying environment variables.

WEM – Debugging Tools

WEM – Organized Test Programs Tier 1 – Source parsing & WHOM syntax. – whitespace parsing, comment parsing… Tier 2 – Backend logic – declaration of classes – global variables – real-time variables – conditional statements – loops

WEM – Organized Test Programs Tier 3 – Event logic – event logic – events triggered by real-time / environment variables Tier 4 – Advanced concepts – recursion – dynamically updated real-time variables

WEM – Organized Test Programs Toy Box Tier – ‘Hack’ programs – Temporary programs. If proven useful, will be moved to one of the primary tiers as part of the standard round of testing. Experimental Tier – What If…? – Code which is ‘theoretically’ possible, but useful for no more than personal curiosity.

Lessons Learned Everything is more complicated than it appears… But without complexity there is no fun! We had a lot of fun working on WHOM…… (We don’t want to live in an automated house…)