Java Tree Insertion Grammar