code: public Object eval(
      Selector sel,
      MatchSpaceKey msg,
      EvalCache cache,
      Object contextValue,
      boolean permissive)
      throws BadMessageFormatMatchingException
    {
  
      // This method should never be applied to a selector that has marked itself invalid
      // during parsing.
      if (sel.getType() == Selector.INVALID)
        throw new IllegalArgumentException(); // sel.toString());
  
      Object ans;
  /** TEMPORARY DISABLE CACHING in THE EXTENDED CASE **/
      if (sel.getUniqueId() != 0 && !sel.isExtended())
      {
        ans = cache.getExprValue(sel.getUniqueId());
        if (ans != null)
          return ans;
      }
  
      ans = evalInternal(sel, msg, cache, contextValue, permissive);
      if (sel.getUniqueId() != 0)
        cache.saveExprValue(sel.getUniqueId(), ans);
      return ans;
    }
docs: Evaluates a selector tree
  
  @param sel the selector tree to evaluate
  
  @param bind the MatchSpaceKey to use in evaluating identifiers and caching partial
  results
  
  @param permissive if true, evaluation should observe "permissive" mode in which there
  are implicit casts between strings and numbers and between strings and booleans
  according to the rules for numeric and boolean literals.  If false, evaluation
  follows the normal JMS rules (numerics are promoted but there are otherwise no
  implicit casts).
  
  @return the result, which will be a String, a BooleanValue, a NumericValue, or null.
  Null is used for "missing" Numeric or String values.  BooleanValue.NULL is used for
  missing Boolean values.
  
  @exception BadMessageFormatMatchingException when the method is unable to determine a
  value because the message (or other object) from which the value must be extracted is
  corrupted or ill-formed.