Replace parsing to ast parsing