CS 6013 - Modern Compilers, Theory and Practice

Assignment 1: Identifying Uninitialized Variables

This assignment is the first part of a multi part project to write an optimizing compiler for BuritoJava. We start with programs in BuritoJava syntax, where (i) all the variables are declared appropriately, (ii) there are no type errors, and our goal is to check if there uninitialized variables.

Use JTB and JavaCC and write in Java one or more visitors which check BuritoJava programs for uninitialized variables. Your main file should be called P1.java, if P.java contains a program to be checked then

java P2 < P.java

should printer either "No uninitialized variables.", or "Uninitialized variable found." Note, your program must take input from standard input and write to standard output (so that we can use redirection).

To check that a program is in BuritoJava form, you could tie the BuritoJava.jj and Main.java to build a parser. A sample Main.java can be found here.

Grading policy
Your homework will be graded for a total of 100 marks. Of these 40 marks will be for the public testcases, and 60 marks for the TA testcases.
[ under development ]