Implementation of parser