code: public Selector getSelector(String selector) {
      Selector ans;
      try {
        ans = QueryExpr();
        if (!ans.mayBeBoolean())
          ans.setType(Selector.INVALID);
      } catch (ParseException e) {
        // No FFDC code needed
        Object obj = null;
        ans = new LiteralImpl(obj);
        ans.setType(Selector.INVALID);
      }
      return ans;
    }
docs: Return the Selector tree associated with a primed parser.
  
  @return a selector tree.  If the parse was successful, the top node of the tree will
  be of BOOLEAN type; otherwise, it will be of INVALID type.