course overview for compilers j. h. wang sep. 20, 2011

15
Course Overview for Compilers J. H. Wang Sep. 20, 2011

Upload: stewart-lawson

Post on 08-Jan-2018

216 views

Category:

Documents


0 download

DESCRIPTION

Compilers, Fall 2011CSIE, NTUT3 Course Description Time: 12:30-3:00pm, Tue. Classroom: R725, Sixth Teaching Building Textbook: –Charles N. Fischer, Ron K. Cytron, and Richard J. LeBlanc Jr., Crafting a Compiler, Global Edition, Pearson Education, Inc., ( 開發圖書 ) Crafting a Compiler –http://www.cs.wustl.edu/~cytron/cacweb/http://www.cs.wustl.edu/~cytron/cacweb/ References: –Alfred V. Aho, Monica S. Lam, Ravi Sethi, and Jeffrey D. Ullman, Compilers: Principles, Techniques, and Tools, 2nd ed., Addison- Wesley, ( 台北圖書 ) (a.k.a ‘The Dragon Book’) Compilers: Principles, Techniques, and Tools, 2nd ed. –http://dragonbook.stanford.edu/http://dragonbook.stanford.edu/

TRANSCRIPT

Page 1: Course Overview for Compilers J. H. Wang Sep. 20, 2011

Course Overview for Compilers

J. H. WangSep. 20, 2011

Page 2: Course Overview for Compilers J. H. Wang Sep. 20, 2011

Compilers, Fall 2011 CSIE, NTUT 2

Instructor and TA• Instructor

– J. H. Wang ( 王正豪 )– Assistant Professor, CSIE, NTUT– Office: R1534, Technology Building, NTUT– E-mail: [email protected]– Tel: (02) 27712171 ext. 4238– Office Hours: 8:10-10:00 on Tuesdays, 10:10am-2:00pm on Wednesdays

• TA– Lily (@ R1424, WIRL Lab.)

Page 3: Course Overview for Compilers J. H. Wang Sep. 20, 2011

Compilers, Fall 2011 CSIE, NTUT 3

Course Description• Time: 12:30-3:00pm, Tue.• Classroom: R725, Sixth Teaching Building• Textbook:

– Charles N. Fischer, Ron K. Cytron, and Richard J. LeBlanc Jr., Crafting a Compiler, Global Edition, Pearson Education, Inc., 2009. ( 開發圖書 )– http://www.cs.wustl.edu/~cytron/cacweb/

• References: – Alfred V. Aho, Monica S. Lam, Ravi Sethi, and Jeffrey D. Ullman, Compilers: Principles, Techniques, and Tools, 2nd ed., Addison-Wesley, 2007. ( 台北圖書 ) (a.k.a ‘The Dragon Book’)– http://dragonbook.stanford.edu/

Page 4: Course Overview for Compilers J. H. Wang Sep. 20, 2011

Compilers, Fall 2011 CSIE, NTUT 4

Intended Audience• An introductory course of compilers

for undergraduates – seniors

• Prerequisite – Basic knowledge of data structures and

discrete mathematics – Programming experience is necessary

for projects

Page 5: Course Overview for Compilers J. H. Wang Sep. 20, 2011

Compilers, Fall 2011 CSIE, NTUT 5

Additional References• More information

– http://en.wikipedia.org/wiki/Compiler • Course Web page

– http://www.ntut.edu.tw/~jhwang/Compiler/

Page 6: Course Overview for Compilers J. H. Wang Sep. 20, 2011

Compilers, Fall 2011 CSIE, NTUT 6

Teaching• Lectures: mostly in slides• Homework assignments: about 3

assignments• Programming exercises: about 2

assignments– Assignments should be turned in within

two weeks• Exams: 1 midterm exam• Projects: 1 term project/presentation

Page 7: Course Overview for Compilers J. H. Wang Sep. 20, 2011

Compilers, Fall 2011 CSIE, NTUT 7

Grading Policy• Homework assignments and

programming exercises: 40%• Mid-term exam: 30%• Final project or presentation: 30%

Page 8: Course Overview for Compilers J. H. Wang Sep. 20, 2011

Compilers, Fall 2011 CSIE, NTUT 8

Programming Exercises and Final Project

• At least two programming exercises – Team-based (at most 2 students per team)– Writing your own code or reusing existing open

source code would be fine– Topics: (more on this later…)

• One final project– Either team-based (the same as programming

exercise)– Or compiler-related academic paper presentation

would be another possible option• But, your should do it on your own (only 1 person), NOT

team-based– A proposal is needed around midterm (Nov. 2011)

• Introduction, methods used, experiment designs

Page 9: Course Overview for Compilers J. H. Wang Sep. 20, 2011

Compilers, Fall 2011 CSIE, NTUT 9

Major Topics• Lexical Analysis: scanning• Syntax Analysis: parsing• Code Generation• Optimization

Page 10: Course Overview for Compilers J. H. Wang Sep. 20, 2011

Compilers, Fall 2011 CSIE, NTUT 10

Organization of the Textbook

• I. Basic Part: (Chap. 1-9 will mostly be covered)– Course Overview (1 wk)– Design of a Simple Compiler (1 wk)– Theory and Practice of Scanning (2 wks)– Formal Grammars and Parsing (2 wks)– Top-Down Parsing (2 wks)– Bottom-Up Parsing (3 wks)– Syntax-Directed Compilation (2 wks)– Declaration Processing and Symbol Tables (2 wks)– Semantic Analysis (2 wks)

• II. Advanced Part: (will be skipped)– Intermediate Representations– Code Synthesis for Virtual Machines– Runtime Support– Target Code Generation– Program Analysis and Optimization

Page 11: Course Overview for Compilers J. H. Wang Sep. 20, 2011

Compilers, Fall 2011 CSIE, NTUT 11

Tentative Schedule• Before midterm

– Chap. 1, Overview (1 wk)– Chap. 2, Design of a Simple Compiler (1 wk)– Chap. 3, Theory and Practice of Scanning(2 wks)– Chap. 4, Formal Grammars and Parsing (2 wks)– Chap. 5, Top-Down Parsing (2 wks)

• Before term project– Chap. 6, Bottom-Up Parsing (3 wks)– Chap. 7, Syntax-Directed Compilation (2 wks)– Chap. 8, Declaration Processing and Symbol Tables (2

wks)– Chap. 9, Semantic Analysis (2 wks)– Term Project Presentation (1-2 wks)

Page 12: Course Overview for Compilers J. H. Wang Sep. 20, 2011

Compilers, Fall 2011 CSIE, NTUT 12

Programming Exercises• Lexical analyzer

– Using scanner generator such as lex, flex• Parser

– Using parser generator such as yacc, bison• (Details to be announced…)

Page 13: Course Overview for Compilers J. H. Wang Sep. 20, 2011

Compilers, Fall 2011 CSIE, NTUT 13

Possible Topics for Term Project

• Design and implement a new language or syntax (for programming, human languages, for describing elements in game, or any other purposes)– Lexical analysis– Syntax analysis– Code generation– Optional: optimization

Page 14: Course Overview for Compilers J. H. Wang Sep. 20, 2011

Compilers, Fall 2011 CSIE, NTUT 14

Possible Applications• Parsing and converting documents in different

formats (HTML, XML)• Parsing network protocols and answering

requests in servers• Parsing SQL query results from databases and

generating reports• Printing or previewing PostScript or PDF files in

printers• Parsing e-mail contents and filtering e-mail spam• Converting hardware specification description

into electric circuit layouts• Designing new computer architectures• …

Page 15: Course Overview for Compilers J. H. Wang Sep. 20, 2011

Compilers, Fall 2011 CSIE, NTUT 15

Thanks for Your Attention!• Any question or comment?