Welcome to the blog of Can Sar, a Stanford CS major. This blog is made up of my thoughts on Computer Science and the computer industry, as well as ever exciting tales from my life.
After spending most of Saturday trying to figure out what we had to do for part three of our Cool compiler (type checking), we finally started coding Sunday morning. As of yesterday evening we are pretty much finished with type checking for classes. Our type checker makes sure that every class a class inherits from is actually defined and there are no direct or indirect cycles in the inheritance tree. It also checks that no classes are ever redefined, and that certain classes (String, Bool, Int) are not subclassed.
The hard part of this assignment is figuring out how to use the already provided skeleton code to elegantly achieve what we are trying to do. There were several times when it would have been very easy to hack up a solution, but our goal is to work within the provided environment.
Today we need to figure out how to populate the method tables and how to start type checking in our parse tree for each class. Once we get that working we can split tasks so that Travis and I can both work on different parts of code at the same time. For now things are going well, but I am very glad that we started this early, since we still have an entire week to work on this assignment.