finish parser part code

orginal code, havnt debug.