Implements parser.