Code Monkey home page Code Monkey logo

ceng444's Introduction

ceng444: Language processors

Middle East Technical University CENG introductory compiler course

This is the website of the course when I teach it.

Term: Fall 2019

Instructor: Cem Bozsahin. TA: none.

Office hours: Open door except lecture days (i.e. except TTh this term; my office is B-209 at Informatics, tel: 7758)

Course hours: T/8.40/9.40, Th/8.40/9.40 at BMB-2 (CENG building)
We will actually do 75 minutes without break each day. The course is not 200 minutes!

Textbook: Engineering a compiler, by Keith Cooper and Linda Torczon, 2nd ed, Morgan Kaufmann, 2012.

This is a professional reference, used throughout the world. We will cover a fragment of it, and it's great for future reference if you are into this sort of CS-ey things.

Catalog description: Formal description and classification of programming languages. Syntactic specification. The parsing problem. Top-down and bottom-up parsing. Attaching semantics to syntax. Translator writing systems. Translator writing case study.

Course objectives: Assuming familiarity with formal grammars, i.e., Ceng280 material, we emphasize modern tools and techniques for compiler construction, which can be used for any task of mapping from one formal representation to another.

Course prerequisite: Officially, none, according to METU catalog. Unofficially, you need to feel comfortable with programming, data structures, and formal languages. 3rd-year standing in CS, or CENG280 in the bag, or COGS501 and COGS502 will suffice.

Course outline

  1. Introduction: a walk through all stages of compiling (1 week)
  2. Scanning (lexical analysis) (1)
  3. Parsing (syntactic analysis) (3)
  4. Intermediate code (1)
  5. Virtual machines (1)
  6. Code generation (syntax-directed derivation/description---SDD) (1)
  7. Scope handling and run-time (1)
  8. A preview of compiling functional languages (2)

Course conduct: 11 weeks of lecture, 2 weeks of in-class labs; 1 week in-class exam; 2 programming projects; no extra homework.

We will use 4 tools for compiler design, (1) antLR for LL, (2) LALR parser of Mark Johnson for LR, (3) spim for MIPS code generation, or (4) Spike for RISC-V code generation.

There is an interface to LALR parser written by me, called yalalr.

In-class labs introduce antLR, yalalr, MIPS/spim, RISC-V, and a bit of Lisp.

The second project includes code generation and execution, using MIPs architecture simulator called spim. We also look at a public-domain RISC, RISC-V, using Spike.

Grading:

  1. Mid-term exam: %25 ( 26.11.2019, in class)
  2. mini-project 1 (LL parsing and abstract syntax trees): %20
  3. mini-project 2 (LALR parsing and code generation): %35
  4. Final exam: %20
  5. Gazozuna Kompaylır Ödülü : priceless!!
    Highest honour we give out to best successful completion of the second project.
    It is, ehm, officially recognized,
    and those who are in the know reading your CV at least in Turkey would know what you achieved.
    Usually handed by the end of first spring term after completion, with a ceremony!
    You will be a proud owner of 4 bottles of a yerli ve milli soft drink,
    with a certificate in a low-budget print, namely my handwriting.
    And, since you asked, we can't afford 444 bottles; or 44, in fact.

2019-2020 Gazozuna Kompaylir odulleri:

  • Yunus Can Cakir: bison/flex -> LLVM
  • Emre Gullu: yalalr -> MIPS
  • Ozan Akin : rust -> x64

tebrix!

ceng444's People

Contributors

bozsahin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.