Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "SIGCSE '05 Using the Rotor C# Compiler for Teaching Elizabeth White Computer Science Department George Mason University Fairfax, VA This work is supported."— Presentation transcript:

1 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

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)

3 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++ 138 modules

4 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

5 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.

6 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

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

8 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.

9 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

10 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

11 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.

12 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

13 SIGCSE '05 Questions? Contact info: white@cs.gmu.edu http://cs.gmu.edu/~white/HideAndShow


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

Similar presentations


Ads by Google