recursive descent parsing in Java