170 likes | 779 Views
Compiler Design. Hongwei Xi Comp. Sci. Dept. Boston University. Welcome!. Compiler Design Introduction to some basics in the compiler design and implementation The theory behind various components of a compiler The programming techniques involved to put the theory into practice
E N D
Compiler Design Hongwei Xi Comp. Sci. Dept. Boston University
Welcome! • Compiler Design • Introduction to some basics in the compiler design and implementation • The theory behind various components of a compiler • The programming techniques involved to put the theory into practice • The interfaces used to modularize the compiler BU CAS CS525
Programming Language (I) • Standard ML (SML) is chosen as the implementation language • This allows students to learn first-handedly as to how the module system of SML can be used effectively in constructing (relatively) large programs. BU CAS CS525
Programming Language (II) • Standard ML (SML) • http://cm.bell-labs.com/cm/cs/what/smlnj • If you know little or nothing about SML, please learn it now! BU CAS CS525
Course Overview • Lexical Analysis • Lexical tokens • Regular expressions • Finite automata: DFA and NFA • Parsing • Context-free grammars • LL parsing • Parsing combinators • LR parsing BU CAS CS525
Course Overview • Abstract Syntax • Semantic actions • Abstract parse trees • Semantic Analysis • Symbol tables • Bindings • Type-checking • Expressions • Declarations BU CAS CS525
Course Overview • Activation Records • Stack frames • Translation to Intermediate Code • Intermediate representation trees • Translation into trees • Declarations • Basic Block and Traces • Canonical trees • Conditional Branches BU CAS CS525
Course Overview • Instruction Selection • Algorithm for instruction selection • Liveness Analysis • Register Allocation • Coloring by simplification • Coalescing • Precolored nodes • Graph coloring implementation • Register allocation for trees • Putting all together BU CAS CS525
What is this course like? • It proceeds in a fast pace • You are expected to read the text that we may not have time to cover in class • You are expected to try programming examples that we may not have time to explain in class • You may need to take notes on the materials we cover that are not in the textbook, though I will minimize the need for note-taking by providing you with as many notes as possible BU CAS CS525
What is this course like? • You are to have a rapid exposure to many concepts in programming languages • You are expected to gain a great deal more understanding of programming, which can be really helpful for you to pursue other subjects in computer science • Above all, I hope that you will find a great deal more fun in programming BU CAS CS525
Homework • There are approximately 8 assignments • Individualwork only unless specified otherwise! • Clarity and elegance count • It is not enough to just “work” on test data BU CAS CS525
Warnings • This is likely a challenging course for you as many new and unfamiliar concepts in programming languages are to be introduced rapidly • You may need to give some time for certain concepts to “sink in” • You may find that some programming assignments are difficult and demanding • Please ask for help if you need it: ask it sooner rather than later BU CAS CS525
Pleas • This is the first time for me to teach such a course at Boston University • I am likely to be a bit overly ambitious, and • I am certain to make (quite a few) mistakes, but • I will do my best to make the course run as smoothly as possible • Please be patient and ask (a lot of) questions! BU CAS CS525
Academic Integrity • Strict adherence to the university guidelines • All work you turn in must be solely your own unless specified otherwise • You are allowed to discuss problems with your classmates but you must write your own code and solutions • Please always remember that every student deserves a chance to achieve a fair grade BU CAS CS525
Important Course Information • Lecture Times: 2-3PM MWF • Classroom: KCB 103 @ 565 Commonwealth Ave • Course Homepage:http://www.cs.bu.edu/~hwxi/academic/courses/CS525.html • Instructor: Hongwei Xi • Office Hours: Tuesday 1:00-3:00 PM, Friday 3:00-4:00 PM • Final Letter Grade Calculation:50% (homework) + 20% (midterm) + 30% (final) A: 80% or above B: 70% or above C: 60% or above D: 50% or above (curving may be applied if necessary) BU CAS CS525
The End Questions? BU CAS CS525