cst 320 compiler methods dr. sherry yang pv 171 yangs/[email protected] (541) 885-1594

14
CST 320 Compiler Methods Dr. Sherry Yang Dr. Sherry Yang PV 171 PV 171 http://www.cset.oit.edu/~yangs/ http://www.cset.oit.edu/~yangs/ CST320 CST320 [email protected] [email protected] (541) 885-1594 (541) 885-1594

Upload: chester-baker

Post on 13-Jan-2016

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CST 320 Compiler Methods Dr. Sherry Yang PV 171 yangs/CST320sherry.yang@oit.edu (541) 885-1594

CST 320Compiler Methods

CST 320Compiler Methods

Dr. Sherry YangDr. Sherry Yang

PV 171PV 171

http://www.cset.oit.edu/~yangs/CST320http://www.cset.oit.edu/~yangs/CST320

[email protected]@oit.edu

(541) 885-1594(541) 885-1594

Page 2: CST 320 Compiler Methods Dr. Sherry Yang PV 171 yangs/CST320sherry.yang@oit.edu (541) 885-1594

2

Course DescriptionCourse Description

This course is designed to introduce the basic This course is designed to introduce the basic concepts of compiler design and operation. concepts of compiler design and operation. Topics include lexical and syntactical analysis, Topics include lexical and syntactical analysis, parsing, translation, semantic processing and parsing, translation, semantic processing and code generation. In addition, students will code generation. In addition, students will implement a small compiler using development implement a small compiler using development tools, lex and yacc. tools, lex and yacc.

We might use other tools (Boost Spirit, Phoenix We might use other tools (Boost Spirit, Phoenix (Microsoft), Pargen, etc.)(Microsoft), Pargen, etc.)

Page 3: CST 320 Compiler Methods Dr. Sherry Yang PV 171 yangs/CST320sherry.yang@oit.edu (541) 885-1594

Conventional TranslatorConventional Translator

skeletal source

programpreprocessor

source

program

library, relocatable object files

compiler

assembler

target assembly program

loader / linker

relocatable machine

code

absolute machine

code

Page 4: CST 320 Compiler Methods Dr. Sherry Yang PV 171 yangs/CST320sherry.yang@oit.edu (541) 885-1594

Structure of CompilerStructure of Compiler

Lexical Analyzer (scanner)

Source Program

Syntax Analysis(Parser)

Tokens Semantic Analysis

Syntactic Structure

Optimizer

Code Generator

Intermediate Representation

Target machine code

Symbol Table

Page 5: CST 320 Compiler Methods Dr. Sherry Yang PV 171 yangs/CST320sherry.yang@oit.edu (541) 885-1594

5

Evaluation MethodsEvaluation Methods

The final grade, which may range from A to F, is determined by a composite evaluation of the student's performance in:

2 Tests 40%

Labs, Homework & Project 55% †

In-Class Exercises (Attendance) 5%

Page 6: CST 320 Compiler Methods Dr. Sherry Yang PV 171 yangs/CST320sherry.yang@oit.edu (541) 885-1594

6

GradingGrading

Your grade will be calculated as follows:*Your grade will be calculated as follows:*92%+ = A92%+ = A83%+ = B83%+ = B70%+ = C70%+ = C60%+ = D60%+ = D59%- = F59%- = F

* Class participation will be considered in evaluating "borderline" * Class participation will be considered in evaluating "borderline" grades.grades.

† † You must complete all labs and project in order to get a grade for You must complete all labs and project in order to get a grade for the class. Incompletes will be given if you failed to turn in all labs the class. Incompletes will be given if you failed to turn in all labs and project. The highest grade that you can receive for the class and project. The highest grade that you can receive for the class once the incomplete has been removed is a B. once the incomplete has been removed is a B.

Page 7: CST 320 Compiler Methods Dr. Sherry Yang PV 171 yangs/CST320sherry.yang@oit.edu (541) 885-1594

7

TextbookTextbook

Optional / Recommended Text Parsons, Introduction to Compiler Construction

References: Aho, Sethi, and Ullman, Compilers: Principles,

Techniques, and Tools, Addison-Wesley, 1986. Fischer and LeBlanc, Crafting a Compiler with C,

Benjamin Cummings, 1991.

Page 8: CST 320 Compiler Methods Dr. Sherry Yang PV 171 yangs/CST320sherry.yang@oit.edu (541) 885-1594

8

Student ResponsibilitiesStudent Responsibilities

Lecture and Lab Attendance:Lecture and Lab Attendance: Students are expected to attend all class sessions and Students are expected to attend all class sessions and

labs. If you know you will be absent on a certain day, labs. If you know you will be absent on a certain day, please inform the instructor in advance so please inform the instructor in advance so arrangements can be made to provide you with the arrangements can be made to provide you with the material covered. Please make every effort to attend material covered. Please make every effort to attend all class sessions. There will be no make up in-class all class sessions. There will be no make up in-class exercises. exercises.

CSET Rule: No Laptops are allowed during lecture. CSET Rule: No Laptops are allowed during lecture. No cell phones & texting. No cell phones & texting.

Page 9: CST 320 Compiler Methods Dr. Sherry Yang PV 171 yangs/CST320sherry.yang@oit.edu (541) 885-1594

9

Student ResponsibilitiesStudent Responsibilities

Tests and Final Exam: All tests are open book, open notes. No electronic

devices are allowed. There will be no make up tests unless there is an

emergency. If you miss a test for any reason, you can take an optional final to make it up. No excuses are necessary.

In case of emergency, please contact Vice President of Student Affairs, Dr. Erin Foley’s office. She will inform all of your instructors.

Page 10: CST 320 Compiler Methods Dr. Sherry Yang PV 171 yangs/CST320sherry.yang@oit.edu (541) 885-1594

10

Academic Dishonesty:Academic Dishonesty: No plagiarism or cheating is allowed in this class. No plagiarism or cheating is allowed in this class.

Please refer to your student handbook regarding Please refer to your student handbook regarding policies on academic dishonesty. A copy of the policies on academic dishonesty. A copy of the policy is posted on the class webpage. policy is posted on the class webpage.

It is okay to get help on your assignments. Please It is okay to get help on your assignments. Please acknowledge all source of help, including them in the acknowledge all source of help, including them in the program documentation as appropriate. program documentation as appropriate.

Student ResponsibilitiesStudent Responsibilities

Page 11: CST 320 Compiler Methods Dr. Sherry Yang PV 171 yangs/CST320sherry.yang@oit.edu (541) 885-1594

11

Homework & Labs:Homework & Labs: All labs are due via email by midnight on the due All labs are due via email by midnight on the due

date. You must follow the assignment submission date. You must follow the assignment submission guidelines below. guidelines below.

Student ResponsibilitiesStudent Responsibilities

Page 12: CST 320 Compiler Methods Dr. Sherry Yang PV 171 yangs/CST320sherry.yang@oit.edu (541) 885-1594

12

Lab Submission GuidelinesLab Submission Guidelines

All labs are due via email by midnight on the due All labs are due via email by midnight on the due date. The instructor will send out an email upon date. The instructor will send out an email upon receiving your lab. If you do not receive an email receiving your lab. If you do not receive an email within 24 hours of submitting the lab, it is YOUR within 24 hours of submitting the lab, it is YOUR responsibility to contact the instructor by email or responsibility to contact the instructor by email or phone. If you do not contact the instructor within 48 phone. If you do not contact the instructor within 48 hours after the due date, the lab is considered late. hours after the due date, the lab is considered late.

There will be a There will be a 20%20% penalty per week for late labs. penalty per week for late labs. All labs and late labs must be turned in by All labs and late labs must be turned in by

Wednesday of Dead week to be graded.Wednesday of Dead week to be graded.

Page 13: CST 320 Compiler Methods Dr. Sherry Yang PV 171 yangs/CST320sherry.yang@oit.edu (541) 885-1594

13

Lab Submission GuidelinesLab Submission Guidelines

11. . Zip up all files required to build the lab.Zip up all files required to build the lab.

2. 2. Include a “Readme” file as appropriate.Include a “Readme” file as appropriate.

3. 3. The archive should also include any other deliverables The archive should also include any other deliverables as called out in the assignment write-up. as called out in the assignment write-up.

4. 4. The archive will be attached to an email with subject The archive will be attached to an email with subject line:line: CST320 Lab #CST320 Lab #xx – – first namefirst name last namelast name

Email the archive to Email the archive to [email protected]@oit.edu & [email protected]

Page 14: CST 320 Compiler Methods Dr. Sherry Yang PV 171 yangs/CST320sherry.yang@oit.edu (541) 885-1594

14

Any student with a disability who anticipates a Any student with a disability who anticipates a need for accommodation in this course is need for accommodation in this course is encouraged to talk with the instructor about encouraged to talk with the instructor about his/her needs as soon as possible.his/her needs as soon as possible.