M2: Lexical Analysis

This second modules provides an overview of the lexical analysis component of a compiler. We discuss how one implements this component by hand or using an auto generated tool.

Pre-recorded Lectures and Required Readings

The pre-recorded lectures are available here: M2 Videos. You can also find the videos under the “Panopto” tab on the MPCS 51300 canvas site.

The lectures are a series of approx 20-30 minute videos divided into 4 sections:

  • 2.1 - Converting a NFA to DFA

  • 2.2 - Coding a Scanner

  • 2.3 - Using ANTLR to implement a Lexer (Coming Saturday)

Supplementary Resources

  • The slides and code presented in this module are accessible on our Canvas Page right before class. Click on the Files link and you then can download the m2.pdf file.

  • Engineering a Compiler readings:
    • Chapter 2.1 - 2.5

  • Go by Example
    • Pointers section

  • Understanding Pointers in Go

Synchronous Session (In-person or Remote)

You will find the links to the Zoom sessions on Canvas. As a reminder here are the dates and times for the synchronous session for this module:

  • Dates/Times
    • Section 1: Tuesday January 10th @ 5:30pm-7:30pm

  • Discussion Outline
    • Overview of Lexical Analysis

    • Introduction to Regular Expressions

    • Finite Automata: NFAs and DFAs

Assignment

Assignments are always due on Wednesday evenings.

  • Homework #2, due Wednesday January 18th at 11:59pm CDT