Group Project Justin Hust Ethan Petuchowski Simon Doty

Slides:



Advertisements
Similar presentations
CPSC 388 – Compiler Design and Construction
Advertisements

OOP Abstraction Classes Class Members: Properties & Methods Instance (object) Encapsulation Interfaces Inheritance Composition Polymorphism Using Inheritance.
Interval Heaps Complete binary tree. Each node (except possibly last one) has 2 elements. Last node has 1 or 2 elements. Let a and b be the elements in.
Elements of Lambda Calculus Functional Programming Academic Year Alessandro Cimatti
ISBN Chapter 10 Implementing Subprograms.
1 Scheme Scheme is a functional language. Scheme is based on lambda calculus. lambda abstraction = function definition In Scheme, a function is defined.
Visitor Pattern Jeff Schott CS590L Spring What is the Purpose of the Visitor Pattern ? n Represent an operation to be performed on the elements.
Arrays, Loops weeks 4-6 (change from syllabus for week 6) Chapter 4.
Syntax Analysis (Chapter 4) 1 Course Overview PART I: overview material 1Introduction 2Language processors (tombstone diagrams, bootstrapping) 3Architecture.
0 Abstract Syntax Tree (AST) Imperative Programming, B. Hirsbrunner, diuf.unifr.ch/pai/ip Each leaf represents an operand and each non leaf an operator.
1 Computer Science 340 Software Design & Testing © Ken Rodham 2003 The “Visitor” Design Pattern Source: "Design Patterns: Elements of Reusable Software"
Dr. Philip Cannata 1 Programming Languages. Dr. Philip Cannata 2 10 Java (Object Oriented) ASP RDF (Horn Clause Deduction, Semantic Web) Relation Jython.
1.3 Executing Programs. How is Computer Code Transformed into an Executable? Interpreters Compilers Hybrid systems.
The different types of variables in a Java program.
Dr. Philip Cannata 1 Programming Languages. Dr. Philip Cannata 2 10 Java (Object Oriented) ACL2 (Propositional Induction) Algorithmic Information Theory.
PPL Syntax & Formal Semantics Lecture Notes: Chapter 2.
Software and Services Group SQL (92 and Beyond) Support for Hive Jason Dai Principal Engineer Intel SSG (Software and Services Group)
The Interpreter Pattern. Defining the Interpreter Intent Given a language, define a representation for its grammar along with an interpreter that uses.
Dr. Philip Cannata 1 with ReL. Dr. Philip Cannata 2 10 Java (Object Oriented) ASP RDF (Horn Clause Deduction, Semantic Web) Relation Jython in Java This.
Dr. Philip Cannata 1 fJyswan. Dr. Philip Cannata 2 10 Java (Object Oriented) ASP RDF (Horn Clause Deduction, Semantic Web) Relation Jython in Java This.
Syntax Analysis (Chapter 4) 1 Course Overview PART I: overview material 1Introduction 2Language processors (tombstone diagrams, bootstrapping) 3Architecture.
LDAP Integration into ReL Clay Smalley Paulo Alcantara.
Floating point numerical information. Previously discussed Recall that: A byte is a memory cell consisting of 8 switches and can store a binary number.
Interpretation Environments and Evaluation. CS 354 Spring Translation Stages Lexical analysis (scanning) Parsing –Recognizing –Building parse tree.
Formal Semantics Chapter Twenty-ThreeModern Programming Languages, 2nd ed.1.
Dr. Philip Cannata 1 Functions and Recursion. Dr. Philip Cannata 2 10 Java (Object Oriented) ASP RDF (Horn Clause Deduction, Semantic Web) Relation Jython.
Genetic Programming Lab For Chess Hadar Rottenberg & Nizan Freedman.
CMSC 330: Organization of Programming Languages
CSE 12 – Basic Data Structures Cynthia Bailey Lee Some slides and figures adapted from Paul Kube’s CSE 12 CS2 in Java Peer Instruction Materials by Cynthia.
8 1 Chapter 8 Advanced SQL Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
/21 Clang Tutorial CS453 Automated Software Testing.
1 Languages and Compilers (SProg og Oversættere) Bent Thomsen Department of Computer Science Aalborg University With acknowledgement to Wei-Tek Tsai who’s.
A SParqly Jython++ A SParqly Jython++ an ASP/SPARQL enhanced Jython Cliff Cheng Carlos Urrutia Francisco Garcia.
Continue the Development of SQL in fJySwan Blake Kobelan, Brittany Blassingill, Andrew Spence.
Visitor-Based HMM Israel Perez, Fayz Rahman, Chinedu Egboh.
BY: JAKE TENBERG & CHELSEA SHIPP PROJECT REVIEW: JGIBBERISH.
CSE 425: Functional Programming I Programs as Functions Some programs act like mathematical functions –Associate a set of input values from the function’s.
PPL Syntax & Formal Semantics Lecture Notes: Chapter 2.
Lecture 5:Interfaces and Abstract Classes Michael Hsu CSULA.
JavaCC Travis Desell. JavaCC and JJTree JJTree –Converts a.jjt grammar file into a.jj intermediary file JavaCC –Converts a.jj file into the specified.
ReL Components CodeCompiler.java Python.g AST Visitor Interpreter
Sixth Lecture ArrayList Abstract Class and Interface
Introduction to Parsing (adapted from CS 164 at Berkeley)
Lambda Expressions By Val Feldsher.
The interpreter.
Variables, Environments and Closures
Introduction to Oracle9i: SQL
LESSON Database Administration Fundamentals Inserting Data.
Programming Language Concepts
Arit Paul and Chris Hitte
Presentation by Julie Betlach 7/02/2009
Carine Iskander Pia Chakrabarti
Is everyone signed up on piazza?
Final Review In Text: Chapters 1-3, 5-11,
Design Pattern: Visitor
FP Foundations, Scheme In Text: Chapter 14.
Dynamic Scoping Lazy Evaluation
Exam 1 Material Study Guide
Object Oriented Programming in java
Final Review In Text: Chapters 1-3, 5-12,
Python Tutorial for C Programmer Boontee Kruatrachue Kritawan Siriboon
Functional interface.
Announcements Exam 2 on Friday, November 2nd Topics
L Calculus.
Names, Types, and Functions
Midterm Review In Text: Chapters 1-3, 5-11, 15.
Database SQL.
Chapter 15 Functional Programming 6/1/2019.
Activation records Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Course Overview PART I: overview material PART II: inside a compiler
Presentation transcript:

Group Project Justin Hust Ethan Petuchowski Simon Doty LISP Interpreter using JavaCC and jjTree SQL Subquery in ReL

Lisp Interpreter Overview Created LISP interpreter by building an Abstract Syntax Tree that is visitable. A different node type for each terminal, non- terminal gets hung on the AST. Uses three visitors – displayAST, build environment, interpret. Modes for static and dynamic scoping

AST Nodes ASTIdentifier x, y, f ASTNum 1000, 3.14 ASTArithExpr (+ 4 3) ASTLambdaExpr (lambda (x) (+ x 3)) Function Application: ASTFunctionExpr ((lambda (y) (+ y y)) 5) ASTNamedFunctionApp (f 5)

AST Print Visitor Visitor for AST Printing Displays abstract syntax for nodes

Interpret Visitor Interpret visitor visits each node and (eagerly) evaluates. Visitor takes scoping mode parameter. Preprocesses all lets to lambdas. Saves deferred substitutions as an ArrayList of TreeMaps ( e.g. x → 5 ; f → (lambda (y) y) )

Environment Visitor Builds environment with FAE-like syntax.

SQL Subquery in ReL Modified Python.g to recognize subselect inside of WHERE clause. Creates sqlsubquery node when it sees SELECT keyword. Modified SQLVisitor.java subSelect() method. Cleans up subselect statement, casts to jsqlparser Select statement, and adds to ArrayList of subselects. Calls getSelect( ) on main select statement and again on each subselect statement using a new instance of SQLVisitor

SQL Subquery in ReL (cont') Now that ArrayList of subselects has elements, SQL to RDF conversion is different. If “subselects” list has elements, WHERE clause must operate on the result from the subquery. e.g. <select> WHERE TYPEID_PETS in <subselect>… WHERE clauses without subqueries are added to the “filters” list as before.