implemented parser. but some programs can't be parsed. should be corrected later.