About the Project 1 Starter Code
Overview

The starter code distributed as part of this project is totally optional, and it's really designed to remove some of the boilerplate so you can write the code that matters for this course. That being said, it is kinda hefty, so this page serves as a brief walkthrough of what you get.

If you want to use the starter code, maybe start by trying it, and come back here only if you're confused.

Code Files
The following files should be included in the project tarball:
  • frontend.hh: Token definitions (this file will eventually be generated by the parser generator). Do not change this file.
  • main.cpp: Contains the entrypoint (i.e. main function) that tests the lexer. You do not need to change this file, but you are free to do so.
  • lexer.hpp: Header declaration for the scanner class. You do not need to change this file, but you are free to do so.
  • a.l: Flex definition for the scanner class. You should change this file
  • tokens.cpp: Contains the code for printing tokens. You do not need to change this file, but you are free to do so.
  • tokens.hpp: Defintions for the Token class and subclasses. You do not need to change this file, but you are free to do so.
  • Makefile: A Makefile that uses Flex to create a scanner, and also builds the ac binary program. You do not need to change this file, but you are free to do so.