Hello and welcome to CPSC411 Compiler Construction I Tutorials 01/04 webpage. This course will include basic knowledge and concepts about compiler construction. In the lab, I will be introducing techniques and tools needed for building a compiler. If you find yourself interested in this course, you may want to consider taking CPSC510: Compiler Construction II as well.
 

Assignments & Notes

Assignment information will be posted here.

Assignment 1: due Jan. 26th
One test case for marking: test.m-
One example solution to assignment one (using Jlex): sample.lex
Marks for assignment one will be handed back to you in person in labs.

Assignment 2: due Feb. 16th
The fixed version of assignment discription is here.
 
Assignment 3:
Sample solution in Java by Michael Dickson

Notes:
Note #2, Jan 17th: Note2     Sample Lexer(using Alex): Note2.x

Note #3, Jan 22nd: Sample Lexer for recursive commenting (by Brett Giles) ScanInts.x    monadUserWrapper. Some documents can be found here.
Stand-alone Lexer Sample: For the modified ScanInts lexer that can be compiled into a stand-alone executable, click here.

Note #4, Mar 4th: Sample Lexer and Parser (using Alex and Happy) Tokens_posn.x    tiny.y.

Tools & Docs


  • A Context Free Grammers tool
  • GHC Haskell compiler
  • Hugs Haskell interpreter

    Lexer and parsing tools for different languages. You need to choose one for your assignments. If your favorite language or tool is not listed here, please talk to me in the lab.
  • Lex/Yacc for C: Flex and Bison
  • Lex/Yacc for Haskell: Alex and Happy
  • Lex/Yacc for Java: Jlex and Cup

    Documentations:
  • A very good Haskell Tutorial for starters
     

contact

  • Email: ntang@cpsc.ucalgary.ca
  • Phone: 210-9420
  • Office: ICT 618A, Programming Language Lab (please contact me in advance for appointment)