finish parser

haven't been tested yet.