Update parser.java

Updated with more comments.