Notes
Outline
Lecture 3 – Lab session
Framework
Using Jlex to construct Lexer
Using CUP to construct Parser with semantic actions
Framework
Support materials are available on line
Manuals for Jlex and CUP on web from my home page
~quintin/courses/compilers4/materials
Code for each section from my Unix account
~quintin/courses/compilers4/proj
Lectures also on web
~quintin/courses/compilers4/lectures
Setup
Add
setenv TIGER ~quintin/courses/compilers4/proj  to your .cshrc/.tcshrc
$TIGER/java/classes to your classpath
Create
a Tiger directory in your own space
Copy
contents of $TIGER/Tiger/chap2 into your Tiger directory
Jlex – LA generator in Java
Parse/Tiger.lex contains most of the Lexical level syntax definition for Tiger
but not strings
type make
produces a java lexical analyer Yylex.java
Construct a Tiger test program
java Parse.Main test.tig