Yenta A Simple Recommendation Language Kenny Rivera - Tester Becky Tang – System Architect Shylah Weber – Systems Integrator Anthony Yim – Project Manager.

Slides:



Advertisements
Similar presentations
Vilmos Zsombori , Shanghai
Advertisements

IT 325 OPERATING SYSTEM C programming language. Why use C instead of Java Intermediate-level language:  Low-level features like bit operations  High-level.
ANTLR in SSP Xingzhong Xu Hong Man Aug Outline ANTLR Abstract Syntax Tree Code Equivalence (Code Re-hosting) Future Work.
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.
Programming Languages Marjan Sirjani 2 2. Language Design Issues Design to Run efficiently : early languages Easy to write correctly : new languages.
CS105 INTRODUCTION TO COMPUTER CONCEPTS INTRO TO PROGRAMMING Instructor: Cuong (Charlie) Pham.
1 Pass Compiler 1. 1.Introduction 1.1 Types of compilers 2.Stages of 1 Pass Compiler 2.1 Lexical analysis 2.2. syntactical analyzer 2.3. Code generation.
BROOM: A Matrix Language Chris Tobin Michael Weiss Gabe Glaser Brian Pellegrini.
Crash Language1 Crash. A Graphical Animation Tool By: Mikhail Litvin Vadim Belobrovka Michael Anikin Daniel Burdeinick.
Reasons to study concepts of PL
ESL - A language for Social Networks Team : Fantastic Four Ashwath Narsimhan – Project Manager Jyotsna Sebe – System Architect Shailesh Saroha – System.
Chapter 3 Program translation1 Chapt. 3 Language Translation Syntax and Semantics Translation phases Formal translation models.
CS 280 Data Structures Professor John Peterson. Lexer Project Questions? Must be in by Friday – solutions will be posted after class The next project.
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.
ANTLR Andrew Pangborn & Zach Busser. ANTLR in a Nutshell ANother Tool for Language Recognition generates lexers generates parsers (and parse trees)‏ Java-based,
StringTemplate Terence Parr University of San Francisco
Creating File Access Services Presented by Ashraf Memon Presented by Ashraf Memon.
Introduction to Java Appendix A. Appendix A: Introduction to Java2 Chapter Objectives To understand the essentials of object-oriented programming in Java.
(1.1) COEN 171 Programming Languages Winter 2000 Ron Danielson.
Prof. Bodik CS 164 Lecture 51 Building a Parser I CS164 3:30-5:00 TT 10 Evans.
INTRODUCTION TO COMPUTING CHAPTER NO. 06. Compilers and Language Translation Introduction The Compilation Process Phase 1 – Lexical Analysis Phase 2 –
DAT602 Database Application Development Lecture 5 JAVA Review.
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.
Parser-Driven Games Tool programming © Allan C. Milne Abertay University v
Boardr The Racing Board Game Creation Language. Project Manager: Eric Leung Language and Tools Guru: Shensi Ding System Architect: Seong Jin Park System.
Java Programming Introduction & Concepts. Introduction to Java Developed at Sun Microsystems by James Gosling in 1991 Object Oriented Free Compiled and.
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.
CST320 - Lec 11 Why study compilers? n n Ties lots of things you know together: –Theory (finite automata, grammars) –Data structures –Modularization –Utilization.
Turnt. A TURN BASED GAME CREATION LANGUAGE.. turnt Language JEFFREY TAO.
BUILDING JAVA PROGRAMS CHAPTER 2 Days of For Loops Past.
Grammatica :: Parser Gen anurag naidu Winter Compiler Construction.
1 Recitation 8. 2 Outline Goals of this recitation: 1.Learn about loading files 2.Learn about command line arguments 3.Review of Exceptions.
BUILD ON THE POLYGLOT COMPILER FRAMEWORK MIHAL BRUMBULLI 7th Workshop “SEERE” Montenegro-Risan 9-14 September 2007 SimJ Programming Language.
Introduction IS Outline  Goals of the course  Course organization  Java command line  Object-oriented programming  File I/O.
Lab 2 Primer Assignment 3 Structure File I/O More parsing and HTTP Formatting.
1. 2 Preface In the time since the 1986 edition of this book, the world of compiler design has changed significantly 3.
Celluloid An interactive media sequencing language.
Weaving a Debugging Aspect into Domain-Specific Language Grammars SAC ’05 PSC Track Santa Fe, New Mexico USA March 17, 2005 Hui Wu, Jeff Gray, Marjan Mernik,
Java for C++ Programmers A Brief Tutorial. Overview Classes and Objects Simple Program Constructors Arrays Strings Inheritance and Interfaces Exceptions.
5-Jan-16 Recursive descent parsing. Some notes on recursive descent The starter code that I gave you did not exactly fit the grammar that I gave you Both.
String line = console.readLine() StringTokenizer st = new StringTokenizer(line)
David LOU – Project Manager Markus SCHANTA – Language Guru Long CHEN – System Architect Xiaolong JIANG – System Integrator Jingbo YANG – Tester & Validator.
CSC 4181 Compiler Construction
Computer Science A 1. Course plan Introduction to programming Basic concepts of typical programming languages. Tools: compiler, editor, integrated editor,
Functions, Part 1 of 3 Topics  Using Predefined Functions  Programmer-Defined Functions  Using Input Parameters  Function Header Comments Reading 
Execution ways of program References: www. en.wikipedia.org/wiki/Integrated_development_environment  You can execute or run a simple java program with.
Presented by : A best website designer company. Chapter 1 Introduction Prof Chung. 1.
Programming Language Theory 2014, 1 Chapter 1 :: Introduction Origin : Michael L. Scott School of Computer & Information Engineering,
9-December-2002cse Tools © 2002 University of Washington1 Lexical and Parser Tools CSE 413, Autumn 2002 Programming Languages
© 2004 Goodrich, Tamassia Stacks. © 2004 Goodrich, Tamassia Stack: Last In First Out (LIFO).–Used in procedure calls, to compute arithmetic expressions.
Aryeh Tasher Brian Ramos Qijun Zhong Michael Li Tian Zhang.
Computer Language
Programming what is C++
PRINCIPLES OF COMPILER DESIGN
Chapter 1 Introduction.
Introduction to Compiler Construction
CS 3304 Comparative Languages
Compiler Construction
Chapter 1 Introduction.
PROGRAMMING LANGUAGES
Lecture Note Set 1 Thursday 12-May-05
Syntax Analysis Sections :.
Syntax-Directed Translation
Subject: Language Processor
School of Computer & Information Engineering,
File Input and Output.
CS105 Introduction to Computer Concepts Intro to programming
Introduction to ANTLR Jin Tianxing
Faculty of Computer Science and Information System
Presentation transcript:

Yenta A Simple Recommendation Language Kenny Rivera - Tester Becky Tang – System Architect Shylah Weber – Systems Integrator Anthony Yim – Project Manager

Definition Yenta 1) Yiddish word which describes an old woman who is a matchmaker - a Yentle. (Ref. Fiddler on the Roof) 2) In modern use the meaning has become that of an annoying old hag. (

Motivation Recommendation engines are becoming increasingly popular We wanted to make recommendations: Fast Simple to program Flexible in content

Overview Imperative language Yenta allows recommendations based on either of the following input: A “seed” or example piece of data A set of criteria or “tags” TitleArtistAlbumYearGenreLength WrappedGeorge StraitIt Just Comes Natural2006Country4:10 You Got LuckyTom PettyGreatest Hits2000Rock3:36 MMMBopHansonMiddle of Nowhere1997Pop4:29

Syntactic Constructs Sample Yenta program: Built-in subroutines (3 main steps) – import(string fileName) – applyBasicScore(string tag, string tagValue, double weight,... ) – printTop(int n) Java-like declarations of primitive types – file type file myMusicFile = import("music.txt"); myMusicFile.applyScore("Year", ”2006", "0.8", "Genre", "Pop", "0.2"); myMusicFile.printTop(3);

public void importFile(String filename)throws IOException{ BufferedReader in = new BufferedReader(new FileReader(filename)); BufferedReader in2 = new BufferedReader(new FileReader(filename)); String line = in.readLine(); String lineCopy = line; rows = 0; while (line != null){ rows++; line = in.readLine(); } StringTokenizer st = new StringTokenizer(lineCopy, ”\t"); cols = 0; while(st.hasMoreTokens()){ st.nextToken(); cols++; } tags = new Tag[cols]; line = in2.readLine(); StringTokenizer st3 = new StringTokenizer(line, ”\t"); for(int k = 0; (k < cols) && st3.hasMoreTokens(); k++){ tags[k] = new Tag(st3.nextToken()); tags[k].col = k; } rows--; file = new String[rows][cols]; line = in2.readLine(); int i = 0; while (line != null){ StringTokenizer st2 = new StringTokenizer(line, ”\t"); int j = 0; while(st2.hasMoreTokens()){ file[i][j] = st2.nextToken(); j++; } i++; line = in2.readLine(); } scores = new double[rows]; } Equivalent Java Code for Import() Yikes!

Other Syntactic Constructs Flow control – for loops – if statements Other types – int – double – string (seen) – scoreFunc

Translator Architecture Java compiler Java file representing the Yenta program Main.java Yenta Output Java program Yenta Program Main Java compiler Java interpreter

Translator Architecture Java compiler YentaProg.java Main.java Yenta Output YentaProg YentaProg.txt Main Java compiler Java interpreter javac Main.java java Main < YentaProg.txt javac YentaProg.java java YentaProg

Interpreter Implementation Wrote Java methods that are always in the output file Our grammar simply calls these methods with the programmer’s parameters

Development Environment ++ +

Tools ANTLR v3 Parser + Lexer Takes a LL(*) grammar as input. “Spits out” tokens as output. Example ANTLR grammar

Tools ANTLRWorks parse tree

Tools StringTemplate example StringTemplate Equiv. Java code that was “printed” out. Outputs…

The Proposed Test Suite Unit testing – Grammar was constructed based on several programs designed to exploit key features – Advantages: Provides strict guidelines that code must satisfy. Unit testing finds problems early in development Fuzz testing – Provides random data to our example programs to test for errors and inconsistencies

Advantages Yenta is a simple, easy-to-use language that is: Easy to learn Fast to write Concise, easy-to-read code Can be used by beginners but also augmented by more advanced features

Advantages Yenta’s primary advantage is that it can be used to recommend anything a programmer wishes (Like Columbia classes!)