SIGCSE '05 Using the Rotor C# Compiler for Teaching Elizabeth White Computer Science Department George Mason University Fairfax, VA This work is supported.

Slides:



Advertisements
Similar presentations
Compilers Course 379K, TTH 9:30-11:00 Instructor: Dr. Doron A. Peled Office Hours: Mon 11:00-12:00.
Advertisements

Compiler Construction by Muhammad Bilal Zafar (AP)
Prof Fateman CS 164 Lecture 371 Review: Programming Languages and Compilers CS AM MWF 10 Evans.
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.
January 12, Compiler Design Hongwei Xi Comp. Sci. Dept. Boston University.
Compiler Construction
Introduction & Overview CS4533 from Cooper & Torczon.
ANTLR Andrew Pangborn & Zach Busser. ANTLR in a Nutshell ANother Tool for Language Recognition generates lexers generates parsers (and parse trees)‏ Java-based,
C Chuen-Liang Chen, NTUCS&IE / 1 COMPILER Chuen-Liang Chen Department of Computer Science and Information Engineering National Taiwan University Taipei,
Invitation to Computer Science 5th Edition
ACM SIGCSE ‘04 Using Real Compiler Source Code for Teaching Graduate Compiler Design Elizabeth White Nina Stewart Computer Science Department George Mason.
1 Week 4 Questions / Concerns Comments about Lab1 What’s due: Lab1 check off this week (see schedule) Homework #3 due Wednesday (Define grammar for your.
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
Compiler Construction1 COMP Compiler Construction Lecturer: Dr. Arthur Cater Teaching Assistant:
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.
Lexical Analysis I Specifying Tokens Lecture 2 CS 4318/5531 Spring 2010 Apan Qasem Texas State University *some slides adopted from Cooper and Torczon.
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
Group 4 Java Compiler Group Members: Atul Singh(Y6127) Manish Agrawal(Y6241) Mayank Sachan(Y6253) Sudeept Sinha(Y6483)
CS 153: Concepts of Compiler Design September 16 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
Chapter 1 Introduction. Chapter 1 - Introduction 2 The Goal of Chapter 1 Introduce different forms of language translators Give a high level overview.
CS 460/660 Compiler Construction. Class 01 2 Why Study Compilers? Compilers are important – –Responsible for many aspects of system performance Compilers.
Introduction to Compilers. Related Area Programming languages Machine architecture Language theory Algorithms Data structures Operating systems Software.
Topic #1: Introduction EE 456 – Compiling Techniques Prof. Carl Sable Fall 2003.
1 Compiler Construction (CS-636) Muhammad Bilal Bashir UIIT, Rawalpindi.
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.
. n COMPILERS n n AND n n INTERPRETERS. -Compilers nA compiler is a program thatt reads a program written in one language - the source language- and translates.
Introduction to Compiling
COMPILER CONSTRUCTION Lesson 1 – TDDD16 TDDB44 Compiler Construction 2010 Kristian Stavåker (Erik Hansson.
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.
CS 614: Theory and Construction of Compilers Lecture 7 Fall 2003 Department of Computer Science University of Alabama Joel Jones.
The Model of Compilation Natawut Nupairoj, Ph.D. Department of Computer Engineering Chulalongkorn University.
Course Overview for Compilers J. H. Wang Sep. 20, 2011.
CS453 LectureIntroduction1 CS453 Compiler Construction Original Design: Michelle Strout Instructor:Wim Bohm
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.
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.
Compilers: Bottom-up/6 1 Compiler Structures Objective – –describe bottom-up (LR) parsing using shift- reduce and parse tables – –explain how LR.
CS 404Ahmed Ezzat 1 CS 404 Introduction to Compiler Design Lecture Ahmed Ezzat.
Advanced Computer Systems
Compiler Design (40-414) Main Text Book:
Introduction Chapter : Introduction.
Chapter 1 Introduction.
CS 153: Concepts of Compiler Design August 29 Class Meeting
Using Real Compiler Source Code for Teaching Graduate Compiler Design
Chapter 1 Introduction.
PROGRAMMING LANGUAGES
-by Nisarg Vasavada (Compiled*)
Chapter 1: Introduction to Compiling (Cont.)
Compiler Lecture 1 CS510.
CMPE 152: Compiler Design December 5 Class Meeting
Course supervisor: Lubna Siddiqui
Front End vs Back End of a Compilers
CS 540 George Mason University
CMPE 152: Compiler Design August 21/23 Lab
Subject: Language Processor
Compiler Construction
Lec00-outline May 18, 2019 Compiler Design CS416 Compiler Design.
Introduction Chapter : Introduction.
Faculty of Computer Science and Information System
Presentation transcript:

SIGCSE '05 Using the Rotor C# Compiler for Teaching Elizabeth White Computer Science Department George Mason University Fairfax, VA This work is supported by SSCLI (Rotor) RFP 2

SIGCSE '05 Graduate Compilers Typical courses in graduate compilers include: Theory –Lexical analysis, Syntax analysis (LL/LR), Semantic analysis (type-checking, intermediate code, …), Optimization Development of a ‘compiler’ for a small language –Application of theory –Tools (e.g. Flex, YACC)

SIGCSE '05 Graduate Compilers Typical courses in graduate compilers do not include access to ‘real’ compiler Why? Real compilers are extremely large and complex –SSCLI C# compiler 200,000+ lines of C modules

SIGCSE '05 Can we integrate ‘real’ compilers into a class like this? Idea: Show relevant details illustrating basic theory inside the compiler tied to input code Hide everything else  Hide and Show

SIGCSE '05 Hide and Show Use a debugging tool on the 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 should provide insights that would be difficult to provide to the students using other techniques.

SIGCSE '05 Hide and Show Instructions (debugger commands, breakpoints, watch variables) 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; } SSCLI (Rotor) C# compiler

SIGCSE '05 Hide & Show Demos Platform: Rotor (SSCLI) C# compiler ( Visual Studio.net (MSDNAA) Two demos being used: Lexical Analysis – –Token identification Parsing – –LL (recursive descent)

SIGCSE '05 Demo: Lexical Analysis Illustration: To watch the C# lexer work Set two variables to watch: –Remaining input –‘Current’ token found Set six breakpoints in the lexer code (~1K lines in module) Trace through scanning of C# input This lexer is hand-coded, providing the students with a view of this approach that they don’t typically get.

SIGCSE '05 How should this approach be used? Classroom –Would need strong visualization tools to be effective Directed exercises for individuals –More promising –Assignment based – students have a worksheet they must complete

SIGCSE '05 Current Usage Basic concept demos shown in class and then given as assignments –Lexical Analysis –Parsing Students can install and run on own resources or go to lab setting with TA My goal: work on integration of this idea with the existing course structure

SIGCSE '05 Fall 2004/Spring 2005 – The Reviews Love/Hate –Love – access to a real system where they could see ‘all that theory’ in action –Hate – setup mechanics – some went to lab after frustration with setup Assuming we can streamline the setup, there may be value added.

SIGCSE '05 What’s next? How effective is this approach? Is there value added? What additional tools (such as visualization) would make this approach more effective? Expand to see how hide and show can be used in other courses/areas. –Distributed systems –Follow-on class to compilers

SIGCSE '05 Questions? Contact info: