{ Graphite Grigory Arashkovich, Anuj Khanna, Anirban Gangopadhyay, Michael D’Egidio, Laura Willson.

Slides:



Advertisements
Similar presentations
Designing a Program & the Java Programming Language
Advertisements

CPSC 388 – Compiler Design and Construction
OO Programming in Java Objectives for today: Overriding the toString() method Polymorphism & Dynamic Binding Interfaces Packages and Class Path.
Semantics Static semantics Dynamic semantics attribute grammars
Semantic analysis Parsing only verifies that the program consists of tokens arranged in a syntactically-valid combination, we now move on to semantic analysis,
WPSM Programming Language A simple language that transform simple data structure into complex xML format Wai Y. Wong Peter Chen Seema Gupta Miqdad Mohammed.
Environments and Evaluation
Chapter 16 Programming and Languages: Telling the Computer What to Do.
An Overview of Programming Logic and Design
CS 101 Problem Solving and Structured Programming in C Sami Rollins Spring 2003.
Assembler Compiler Interpreter ASSEMBLER To convert the assembly language into machine code. Translate mnemonic operation codes to their machine language.
CSE 1301 J Lecture 2 Intro to Java Programming Richard Gesick.
StringTemplate Terence Parr University of San Francisco
+ Java vs. Javascript Jessi Style. + Java Compiled Can stand on its own Written once, run anywhere Two-stage debugging Java is an Object Oriented Programming.
2.2 A Simple Syntax-Directed Translator Syntax-Directed Translation 2.4 Parsing 2.5 A Translator for Simple Expressions 2.6 Lexical Analysis.
Syntax Directed Translation. Syntax directed translation Yacc can do a simple kind of syntax directed translation from an input sentence to C code We.
Chapter 1. Introduction.
Chapter 1 Introduction Dr. Frank Lee. 1.1 Why Study Compiler? To write more efficient code in a high-level language To provide solid foundation in parsing.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
1 Semantic Analysis Aaron Bloomfield CS 415 Fall 2005.
© 2012 Pearson Education, Inc. All rights reserved. 1-1 Why Java? Needed program portability – Program written in a language that would run on various.
1 COMP 3438 – Part II-Lecture 1: Overview of Compiler Design Dr. Zili Shao Department of Computing The Hong Kong Polytechnic Univ.
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.
Unit-1 Introduction Prepared by: Prof. Harish I Rathod
1.  10% Assignments/ class participation  10% Pop Quizzes  05% Attendance  25% Mid Term  50% Final Term 2.
CS 153: Concepts of Compiler Design August 26 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
COP 4620 / 5625 Programming Language Translation / Compiler Writing Fall 2003 Lecture 1, 08/28/03 Prof. Roy Levow.
Graphene So what’s the most efficient way to spam all your Facebook friends? Team Adith Tekur (System Architect/Tester) Neha Rastogi (System Integrator)
Chapter 1 Introduction. Chapter 1 - Introduction 2 The Goal of Chapter 1 Introduce different forms of language translators Give a high level overview.
1. 2 Preface In the time since the 1986 edition of this book, the world of compiler design has changed significantly 3.
CS 460/660 Compiler Construction. Class 01 2 Why Study Compilers? Compilers are important – –Responsible for many aspects of system performance Compilers.
Topic #1: Introduction EE 456 – Compiling Techniques Prof. Carl Sable Fall 2003.
Overview of Previous Lesson(s) Over View  A program must be translated into a form in which it can be executed by a computer.  The software systems.
1 Compiler Design (40-414)  Main Text Book: Compilers: Principles, Techniques & Tools, 2 nd ed., Aho, Lam, Sethi, and Ullman, 2007  Evaluation:  Midterm.
© 2012 Pearson Education, Inc. All rights reserved types of Java programs Application – Stand-alone program (run without a web browser) – Relaxed.
C H A P T E R T W O Linking Syntax And Semantics Programming Languages – Principles and Paradigms by Allen Tucker, Robert Noonan.
5.01 Understand Different Types of Programming Errors
Multiple File Compilation and linking By Bhumik Sapara.
Compiler Construction CPCS302 Dr. Manal Abdulaziz.
Chapter – 8 Software Tools.
Lecture #1: Introduction to Algorithms and Problem Solving Dr. Hmood Al-Dossari King Saud University Department of Computer Science 6 February 2012.
Software. Introduction n A computer can’t do anything without a program of instructions. n A program is a set of instructions a computer carries out.
Creating Java Applications (Software Development Life Cycle) 1. specify the problem requirements - clarify 2. analyze the problem - Input? Processes? Output.
Chapter 1: Introduction to Computers and Programming.
Programming Languages Concepts Chapter 1: Programming Languages Concepts Lecture # 4.
CSE 420 Lecture Program is lexically well-formed: ▫Identifiers have valid names. ▫Strings are properly terminated. ▫No stray characters. Program.
Objective of the course Understanding the fundamentals of the compilation technique Assist you in writing you own compiler (or any part of compiler)
Introduction To Software Development Environment.
CS 404Ahmed Ezzat 1 CS 404 Introduction to Compiler Design Lecture Ahmed Ezzat.
Chapter 1. Introduction.
Advanced Computer Systems
Introduction to Compiler Construction
CSCI-235 Micro-Computer Applications
A Simple Syntax-Directed Translator
CS 536 / Fall 2017 Introduction to programming languages and compilers
Compiler Construction
CS416 Compiler Design lec00-outline September 19, 2018
Developing Applications
Assembler, Compiler, Interpreter
Basic Program Analysis: AST
CSE401 Introduction to Compiler Construction
Programming Fundamentals (750113) Ch1. Problem Solving
Assembler, Compiler, Interpreter
CS416 Compiler Design lec00-outline February 23, 2019
Programming Fundamentals (750113) Ch1. Problem Solving
Programming Fundamentals (750113) Ch1. Problem Solving
Introduction to Compiler Construction
Introduction to Compiler Construction
COP 4620 / 5625 Programming Language Translation / Compiler Writing Fall 2003 Lecture 2, 09/04/2003 Prof. Roy Levow.
Presentation transcript:

{ Graphite Grigory Arashkovich, Anuj Khanna, Anirban Gangopadhyay, Michael D’Egidio, Laura Willson

 Introduction  Why Use Graphite  Example  Challenges  Lessons Learned Outline

 Graphite is a high level programming language  Graphite is designed for users who want to minimize tedious syntax whilst being able to perform effective data visualization  Designed for people who don’t want to learn the semantics of web programming but want to be able to execute proper data visualization  Inputs in a source file that follows the syntax as specified in the language reference manual  Outputs an html page that contains the desired charts Introduction

 Domain Specific- Designed to help new programmers and people inexperienced with web programming be able to output html charts and graphs using high level Java-like syntax  Easy to Use- The syntax created is very similar to that of Java’s. Built in chart types and the Series data structure are supplied with the language  Portable- Source code can be run on any machine and compiled due to portable Java backend  Web Friendly- Nice html charts are outputted by the program Why Use Graphite

class MichaelPLT { void main { Barchart grades; grades.name = “Michael’s Grades for PLTs”; grades.subtitle = “Spring 2012”; Series assignments = {“HW1”, “HW2”, “HW3”, “HW4”, “Final”}; Source Program

grades.xCoordinate = assignments; grades.yCoordinate = assignmentGrades; grades.xAxis = “Assignments”; grades.yAxis = “Grade out of 100”; Page p; p.add(grades);p.save(“MichaelPLT.html”); Source Program Continued

Program Output

 Implemented using a.CUP file with SDTS in Java  Implements control flow, variable declarations, field instantiations, Graph type declarations  Utilizes synthesized and inherited attributes  Main problem that the team faced was cutting the grammar down to a reasonable length Grammar

 Implemented using the Java programming language.  Using the syntax directed translations and the decompile() method, we implemented code generation and successfully compiled down to the Java Programming language.  The syntax tree is comprised of both a traditional tree structure and linked lists Abstract Syntax Tree

 Scoping algorithm would instantiate and set required table entries into the symbol table during the first traversal of the Abstract Syntax Tree  We attempted to work on scoping and type checking algorithms by doing a second traversal of the AST and comparing identifiers with declared class names, function names and variables Scope/Type Checking

 Implemented directly in the ASTNode class  Each tree node implements the decompile() method which recursively generates Java source code given Graphite code by calling the decompile() method on the children and returning a string that contains the compiled Java code Code Generation

 JavaScript packages written in Java are designed to input Java source code and output charts created in JavaScript  The JavaScript code is run using the HighCharts API  The front end wraps the Chart classes, GraphiteNumber, GraphiteString and the Series classes JavaScript Creation

 Balancing the complexities of the grammar and the abstract syntax tree  Debugging the grammar for the language  Making design decisions on the robustness of the grammar Challenges

Hand created sample ASTs to test the Intermediate Representation Tested system integration Black box testing on front end and back end separately JavaScript code generation throws multiple errors if handled incorrectly Testing

 Test code while writing it!  Plan out design decisions before starting implementation!  Set strict deadlines and adhere to them throughout the allotted time! Lessons Learned