static function translateSimpleExpSegs (array $segments)
  {
    if (count ($segments) == 1) {
      $seg = $segments[0];

      if ($seg[0] == '#')
        return sprintf ('%s->renderBlock("%s")', self::BINDER_PARAM, substr ($seg, 1));

      PhpCode::evalConstant ($seg, $ok);
      if ($ok) return $seg;
      if (is_callable ($seg))
        return "$seg()";
    }

    $exp   = self::BINDER_PARAM;
    $unary = '';
    foreach ($segments as $i => $seg) {
      if ($i)
        $exp = $seg[0] == '@'
          ? sprintf ('_g(%s,%s)', $exp, self::compileReadProp ($seg))
          : "_g($exp, '" . trim ($seg, "'\"") . "')";
      else {
        list (, $unary, $seg) = str_match ($seg, '/^(!*)(.*)/', 2);
        // If not a constant value, convert it to a property access expression fragment.
        if ($seg[0] == '"' || $seg[0] == "'" || ctype_digit ($seg))
          $exp = $seg;
        else $exp = $seg[0] == '@'
          ? self::compileReadProp ($seg)
          : $exp = "_g($exp,'$seg')";
      }
    }
    $exp = "$unary$exp";
    if (!PhpCode::validateExpression ($exp))
      throw new DataBindingException(sprintf ("Invalid expression <kbd>%s</kbd>.<p>Evaluating <kbd>%s</kbd></p>", implode ('.', $segments), $exp));
    return $exp;
  }