Attempting to build a small compiler in Java