code: func Parse(cmds []string) ([]*api.GenericResource, error) {
  	tokens := make(map[string][]string)
  
  	for _, term := range cmds {
  		kva := strings.Split(term, "=")
  		if len(kva) != 2 {
  			return nil, newParseError("incorrect term %s, missing"+
  				" '=' or malformed expression", term)
  		}
  
  		key := strings.TrimSpace(kva[0])
  		val := strings.TrimSpace(kva[1])
  
  		tokens[key] = append(tokens[key], val)
  	}
  
  	var rs []*api.GenericResource
  	for k, v := range tokens {
  		if u, ok := isDiscreteResource(v); ok {
  			if u < 0 {
  				return nil, newParseError("cannot ask for"+
  					" negative resource %s", k)
  			}
  
  			rs = append(rs, NewDiscrete(k, u))
  			continue
  		}
  
  		if allNamedResources(v) {
  			rs = append(rs, NewSet(k, v...)...)
  			continue
  		}
  
  		return nil, newParseError("mixed discrete and named resources"+
  			" in expression '%s=%s'", k, v)
  	}
  
  	return rs, nil
  }
docs: // Parse parses a table of GenericResource resources