ACM SIGCSE ‘04 Using Real Compiler Source Code for Teaching Graduate Compiler Design Elizabeth White Nina Stewart Computer Science Department George Mason.

Slides:



Advertisements
Similar presentations
Software & Services Group, Developer Products Division Copyright© 2010, Intel Corporation. All rights reserved. *Other brands and names are the property.
Advertisements

Compiler Construction by Muhammad Bilal Zafar (AP)
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.
CPSC Compiler Tutorial 9 Review of Compiler.
WPSM Programming Language A simple language that transform simple data structure into complex xML format Wai Y. Wong Peter Chen Seema Gupta Miqdad Mohammed.
SIGCSE '05 Using the Rotor C# Compiler for Teaching Elizabeth White Computer Science Department George Mason University Fairfax, VA This work is supported.
Programming Languages Structure
College of Computer Science & Technology Compiler Construction Principles & Implementation Techniques -1- Compiler Construction Principles & Implementation.
What Is Object-Oriented Design? (Chapter 1). Software Development Life Cycle 1. Problem statement and requirements 2. Solution specification 3. Code design.
Introduction & Overview CS4533 from Cooper & Torczon.
Invitation to Computer Science 5th Edition
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
ITEC 380 Organization of programming languages Dr. Andrew Ray.
COP4020 Programming Languages
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
1 440 Midterm 2012 fall. Given the following two classes: public class A { void doSomething () { System.out.println("A"); } public class B extends A{
CSC 338: Compiler design and implementation
Compiler course 1. Introduction. Outline Scope of the course Disciplines involved in it Abstract view for a compiler Front-end and back-end tasks Modules.
CST320 - Lec 11 Why study compilers? n n Ties lots of things you know together: –Theory (finite automata, grammars) –Data structures –Modularization –Utilization.
1 COMP 3438 – Part II-Lecture 1: Overview of Compiler Design Dr. Zili Shao Department of Computing The Hong Kong Polytechnic Univ.
CSC 230: C and Software Tools Rudra Dutta Computer Science Department Course Introduction.
D. M. Akbar Hussain: Department of Software & Media Technology 1 Compiler is tool: which translate notations from one system to another, usually from source.
Unit-1 Introduction Prepared by: Prof. Harish I Rathod
TDDD55- Compilers and Interpreters Lesson 1 Zeinab Ganjei Department of Computer and Information Science Linköping University.
CS453 LectureIntroduction1 CS453 Compiler Construction Instructor:Wim Bohm Computer Science Building 470 TA: tba
CS 153: Concepts of Compiler Design August 26 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
ProgrammingLanguages Programming Languages Language Definition, Translation and Design.
Towards the better software metrics tool motivation and the first experiences Gordana Rakić Zoran Budimac.
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
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.
U NIVERSITY OF D ELAWARE C OMPUTER & I NFORMATION S CIENCES D EPARTMENT Optimizing Compilers CISC 673 Spring 2009 Overview of Compilers and JikesRVM John.
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.
Chapter 1 Introduction Study Goals: Master: the phases of a compiler Understand: what is a compiler Know: interpreter,compiler structure.
Introduction to Compiling
COMPILER CONSTRUCTION Lesson 1 – TDDD16 TDDB44 Compiler Construction 2010 Kristian Stavåker (Erik Hansson.
Planning a compiler Source Language –A subset of C Target Language –Assembler Performance Criteria –Compiler speed –Code quality –Error diagnostics –Portability.
Compiler Construction (CS-636)
Compiler Introduction 1 Kavita Patel. Outlines 2  1.1 What Do Compilers Do?  1.2 The Structure of a Compiler  1.3 Compilation Process  1.4 Phases.
Chapter 1: Introduction 1 Compiler Designs and Constructions Chapter 1: Introduction Objectives: Course Objectives Introduction Dr. Mohsen Chitsaz.
Course Overview for Compilers J. H. Wang Sep. 14, 2015.
School of Computer Science & Information Technology G6DICP - Lecture 6 Errors, bugs and debugging.
The Model of Compilation Natawut Nupairoj, Ph.D. Department of Computer Engineering Chulalongkorn University.
Course Overview for Compilers J. H. Wang Sep. 20, 2011.
C H A P T E R T W O Linking Syntax And Semantics Programming Languages – Principles and Paradigms by Allen Tucker, Robert Noonan.
Introduction to Language Programming Hierarchy of programming lang. Based on machine independences: 1. Machine language 2. Assembly language 3. Higher.
What is a compiler? –A program that reads a program written in one language (source language) and translates it into an equivalent program in another language.
Compiler Construction CPCS302 Dr. Manal Abdulaziz.
CSC 4181 Compiler Construction
1 Asstt. Prof Navjot Kaur Computer Dept PRESENTED BY.
ICS312 Introduction to Compilers Set 23. What is a Compiler? A compiler is software (a program) that translates a high-level programming language to machine.
COP4020 Programming Languages Introduction Prof. Robert van Engelen (modified by Prof. Em. Chris Lacher)
CS416 Compiler Design1. 2 Course Information Instructor : Dr. Ilyas Cicekli –Office: EA504, –Phone: , – Course Web.
Objective of the course Understanding the fundamentals of the compilation technique Assist you in writing you own compiler (or any part of compiler)
Chapter 1 Introduction Samuel College of Computer Science & Technology Harbin Engineering University.
Compiler Design (40-414) Main Text Book:
Chapter 1 Introduction.
Introduction to Compiler Construction
CS 153: Concepts of Compiler Design August 29 Class Meeting
Using Real Compiler Source Code for Teaching Graduate Compiler Design
Chapter 1 Introduction.
CS 153: Concepts of Compiler Design November 30 Class Meeting
CMPE 152: Compiler Design December 5 Class Meeting
Course supervisor: Lubna Siddiqui
CMPE 152: Compiler Design August 23 Class Meeting
Presentation transcript:

ACM SIGCSE ‘04 Using Real Compiler Source Code for Teaching Graduate Compiler Design Elizabeth White Nina Stewart Computer Science Department George Mason University Ranjan Sen Microsoft Corporation Washington DC

ACM SIGCSE ‘04 Graduate Compilers Typical courses in graduate compilers include: Theory –Lexical analysis, Syntax analysis (LL/LR), Semantic analysis (typechecking, intermediate code generation, …) Development of a ‘compiler’ for a small language –Use of theory –Use of tools

ACM SIGCSE ‘04 Typical courses in compilers do not include: Access to ‘real’ compiler Access to ‘real’ runtime environment Why? Real compilers are extremely large and complex –C# compiler 200,000+ lines of C components

ACM SIGCSE ‘04 Integration Options Classroom –Would need strong visualization tools to be effective Directed exercises for individuals –More promising (at least immediately) –Could be assignment based

ACM SIGCSE ‘04 Can we integrate ‘real’ compilers into a class like this? Idea: Expose relevant details inside the compiler Tie to input code Hide everything else  Hide and Show

ACM SIGCSE ‘04 Hide and Show Implementation: Use a debugging tool on a real compiler. Combine: –Pre-chosen input program –Pre-chosen breakpoints inside source code of the appropriate compiler component Step through the processing of input program and watch how the input program triggers changes. A carefully planned exercise of this type may provide insights that would be difficult to provide to the students using other techniques.

ACM SIGCSE ‘04 Should we integrate ‘real’ compilers into a class like this? Will there be value added? –Strengthen understanding of how basic concepts apply? –Strengthen understanding of inter- relationships between parts of a compiler? How to measure value added?

ACM SIGCSE ‘04 Potential Benefits Demonstration of abstract concepts in a real compiler Motivate students to explore compiler concepts further Experience with debugging and complex OO code

ACM SIGCSE ‘04 Demo Platform: Rotor (SSCLI) C# compiler ( ) Visual Studio.net Concept: Lexical Analysis – –How are some tokens identified by the lexer? –What happens to the input stream as tokens are found?

ACM SIGCSE ‘04 Demo 1.Student starts with: C# input program Instructions for setup of session (VisualStudio.net & DOS) Instructions for Hide & Show session 2.Student follows Hide & Show steps to see given concept demonstration and to answer questions 3.Student encouraged to use current setup to explore concepts further.

ACM SIGCSE ‘04 Current Status Basic concept demo: Lexical Analysis Need to –Find the best mechanism to allow students to independently use the demo. –Find mechanism to allow use in classroom. –Expand to additional concepts Integrated into graduate compilers class Fall 2004.

ACM SIGCSE ‘04 Future How effective is this approach? Make ‘approach’ available. What additional tools (such as visualization) would make this approach more effective? Expand to see how hide and show can be used at the ‘back-end’ of a compiler. What other areas/courses could this approach be effective in?

ACM SIGCSE ‘04 Hide and Show Instructions: (debugger commands, breakpoints C# input file VisualStudio.net Concept Demonstration & Exploration Scanner Parser Optimizer Semantic Analysis Code Generator Symbol Table Target language _parseNumber: fReal = TRUE; while (*p >= '0' && *p <= '9‘) p++; // Number + dot + non-digit -- these are separate tokens, so don't absorb the // dot token into the number. p = pszHold; pFT->iToken = TID_NUMBER; break; } } if (*p == 'E' || *p == 'e‘) { fReal = TRUE; // skip exponent p++; if (*p == '+' || *p == '-‘) p++; while (*p >= '0' && *p <= '9') p++; } … pFT->iToken = TID_NUMBER; break; }