Mitchell McMullen Paul Nguyen SWAN. Python written entirely in C#. Can access all.NET libraries and Silverlight. Created by the same guy as Jython. No.

Slides:



Advertisements
Similar presentations
SableCC SableCC is developed by professors and graduate students at McGill University and is open source (licensed under the Apache License, Version 2.0)‏
Advertisements

1 Semantic Processing. 2 Contents Introduction Introduction A Simple Compiler A Simple Compiler Scanning – Theory and Practice Scanning – Theory and Practice.
CS 280 Data Structures Professor John Peterson. Lexer Project Questions? Must be in by Friday – solutions will be posted after class The next project.
How domain specific are Domain Specific Languages? Greg Michaelson School of Mathematical & Computer Sciences Heriot-Watt University.
1.3 Executing Programs. How is Computer Code Transformed into an Executable? Interpreters Compilers Hybrid systems.
Introduction to PL/SQL Chapter 9. Objectives Explain the need for PL/SQL Explain the benefits of PL/SQL Identify the different types of PL/SQL blocks.
ANTLR Andrew Pangborn & Zach Busser. ANTLR in a Nutshell ANother Tool for Language Recognition generates lexers generates parsers (and parse trees)‏ Java-based,
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.
Abstract Syntax Trees Lecture 14 Wed, Mar 3, 2004.
Graph-RAT Overview By Daniel McEnnis. 2/32 What is Graph-RAT  Relational Analysis Toolkit  Database abstraction layer  Evaluation platform  Robustly.
ICS611 Introduction to Compilers Set 1. What is a Compiler? A compiler is software (a program) that translates a high-level programming language to machine.
Getting Started with ANTLR Chapter 1. Domain Specific Languages DSLs are high-level languages designed for specific tasks DSLs include data formats, configuration.
Prof. Bodik CS 164 Lecture 51 Building a Parser I CS164 3:30-5:00 TT 10 Evans.
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.
CSC 338: Compiler design and implementation
Oct 26, 2005 CDT DOM Roadmap Doug Schaefer. Parser History  CDT 1.0 ► JavaCC based parser  Used to populate CModel and Structure Compare ► ctags based.
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.
Chapter 6 Programming Languages (2) Introduction to CS 1 st Semester, 2015 Sanghyun Park.
Interpretation Environments and Evaluation. CS 354 Spring Translation Stages Lexical analysis (scanning) Parsing –Recognizing –Building parse tree.
8 1 Chapter 8 Advanced SQL Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
CS 153: Concepts of Compiler Design September 16 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
Semantically Processing The Semantic Web Presented by: Kunal Patel Dr. Gopal Gupta UNIVERSITY OF TEXAS AT DALLAS.
COP 4620 / 5625 Programming Language Translation / Compiler Writing Fall 2003 Lecture 1, 08/28/03 Prof. Roy Levow.
Compiler design Lecture 1: Compiler Overview Sulaimany University 2 Oct
Introduction to Compilers. Related Area Programming languages Machine architecture Language theory Algorithms Data structures Operating systems Software.
 Overview of technical progress  Grammar-based implementation.
1 Compiler Design (40-414)  Main Text Book: Compilers: Principles, Techniques & Tools, 2 nd ed., Aho, Lam, Sethi, and Ullman, 2007  Evaluation:  Midterm.
Chapter 1 Introduction Major Data Structures in Compiler
A SParqly Jython++ A SParqly Jython++ an ASP/SPARQL enhanced Jython Cliff Cheng Carlos Urrutia Francisco Garcia.
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.
1 Compiler & its Phases Krishan Kumar Asstt. Prof. (CSE) BPRCE, Gohana.
What am I? while b != 0 if a > b a := a − b else b := b − a return a AST == Abstract Syntax Tree.
PZ03BX Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ03BX –Recursive descent parsing Programming Language.
C H A P T E R T W O Linking Syntax And Semantics Programming Languages – Principles and Paradigms by Allen Tucker, Robert Noonan.
Firoze Abdur Rakib. Syntax errors, also known as parsing errors, are perhaps the most common kind of error you encounter while you are still learning.
Dr. Mohamed Ramadan Saady 314ALL CH1.1 Chapter 1: Introduction to Compiling.
Compiler Construction CPCS302 Dr. Manal Abdulaziz.
BY: JAKE TENBERG & CHELSEA SHIPP PROJECT REVIEW: JGIBBERISH.
Intro to Programming STARS College of Communication and Information Florida State University Written by: Hannah Brock Alissa Ovalle Nicolaus Lopez Martin.
Open Source Compiler Construction (for the JVM)
ReL Components CodeCompiler.java Python.g AST Visitor Interpreter
Compiler Design (40-414) Main Text Book:
Basic Program Analysis
PRINCIPLES OF COMPILER DESIGN
Introduction to Compiler Construction
COMP261 Lecture 18 Parsing 3 of 4.
Lexical and Syntax Analysis
Lambda Expressions By Val Feldsher.
Overview of Compilation The Compiler Front End
Overview of Compilation The Compiler Front End
Abstract Syntax Trees Lecture 14 Mon, Feb 28, 2005.
SQL – Application Persistence Design Patterns
Compiler Designs and Constructions
Basic Program Analysis: AST
IDE and Visualisation of Abstract Syntax Trees for Coco/R
Bottom-up derivation tree, original grammar
Bottom-up derivation tree, original grammar
Preparing for MUPL! Justin Harjanto
Bottom-up derivation tree generation
CS105 Introduction to Computer Concepts Intro to programming
Adapted from slides by Nicholas Shahan and Dan Grossman
Nicholas Shahan Spring 2016
MDT OCL 1.3 Mini-deck June 10, 2009.
Introduction to Compiler Construction
Parsing with IRONY Roman Ivantsov, MCSD
Bottom-up derivation tree generation
High-Level Programming Language
Introduction to Compiler Construction
Course Overview PART I: overview material PART II: inside a compiler
Presentation transcript:

Mitchell McMullen Paul Nguyen SWAN

Python written entirely in C#. Can access all.NET libraries and Silverlight. Created by the same guy as Jython. No design documentation or developer’s guide for source code =(

IronPySwan Added Oracle Database Connectivity. Embedded SQL commands/queries. Allows arbitrary python expressions within SQL commands/queries. (Using back ticks)

Overview

Tokenizer Breaks up the source code into tokens. IronPython uses a mostly hand-written tokenizer and parser. Some token recognition code is auto-generated. MAKECONNECT INSERT _________________ ______________

Parser Identifies tokens as they come in. Implements the Python (BNF) grammar directly. Constructs the Python AST.

MSAstNode Declaration This is where a statement/expression is turned into a node fit for the AST. The statement/expression’s Reduce() method is called, which returns a simpler node. Typically, reduce() links to implementation code.

AstMethods Big collection of Method signatures, used for reflection/indirection to PythonOps. Connection Statement (Nonquery) Expression (Query) AstMethods

PythonOps Pretty much another layer of indirection, and a repository for some helper functions. Connection Statement (Nonquery) Expression (Query)

Runtime Behavior This is the implementation-ey kind of stuff. In the end, this is where the heavy lifting for each method call is located. We have one class, PySwanSqlRunner, which houses the connection and passes the final SQL strings on to the database. These methods are executed by the interpreter.

PySwanSqlRunner Connection Statement (Nonquery) Expression (Query)

Stuff That Still Really Needs Work Error handling is pretty primitive. No RDF. (Sorry, Dr. Cannata!!) SQL must be well-formed.

Programming Language Terms Terminal/Nonterminal (Tokenizer.cs). Abstract Syntax Tree (Parser.cs). Parse tree is implicitly built. (Parser.cs) Python.g BNF is implemented directly (Parser.cs Some SQL involved.

Demonstration Hope you enjoy!

Questions?