write large part of parser