CSC 4181 Compiler Construction Spring 2017


Lab 1 Resources



  • Linux Mint - a modern, elegant and comfortable operating system which is both powerful and easy to use.
  • Ubuntu Linux - download page
  • Windows - how to set up your Windows laptop for use on the projects:
    1. Download and install Cygwin, and select flex, bison, gcc, and make to be installed as well as all of the defaults. Have it install in the default C:\cygwin directory and have it cache the "packages" it downloads in a subdirectory of that, such as C:\cygwin\pkgs. It can take as much as an hour to download and install, but is worth the wait.
    2. Once installed, open a Cygwin command window (from the Start menu or Desktop icon) and navigate to the directory where your project files are. Type "make" and everything should compile!
    3. Note that you can still use any editor you want to write and edit your code, you just need to be in a Cygwin command window to have access to make, flex and bison (as well as lots of other Linux commands).
  • Using yylineno in scanner and parser in order to display the current line number in error messages, for instance: Inside the scanner file (filename.l) add the following: %option yylineno, then recompile (you may need to run "make clean" first). (Thanks to Allison Husk for the pointer)



  • Bison - parser generator manual

Video Lectures



Other Code Generation Tools

Other Compiler Development Tools

  • Java JDK (recommended Java SE 6 Update 23)
  • Eclipse (recommended Eclipse IDE for Java Developers)
  • JFlex (recommended
  • JavaCUP (recommended CUP 11a beta 20060608, executable standalone Jar-package)

Other Documentation

  • JFlex - lexical scanner generator
  • JavaCUP - parser generator
  • Ant - build file automation
  • Yacc - Yet Another Compiler Compiler (Wikipedia article)


Last updated: 03/30/2017