anchor.diff:  	lists:keysearch(category, 1, refac_syntax:get_ann(Exp)).
   
   
  -%% pos_to_syntax_unit(Tree, Start, End, F, MinLength) ->
  -%%     Type = refac_syntax:type(Tree),
  -%%     Res = pos_to_syntax_units_1(Tree, Start, End, F, Type),
  -%%     Units  = filter_syntax_units(Res, MinLength),
  -%%     case Units of 
  -%% 	[] ->
  -%% 	    [];
  -%% 	_ -> hd(Units)
  -%%     end.
  -
   %% -spec(pos_to_syntax_units(Tree::syntaxTree(),  Start::pos(), End::pos(), F::function()) ->[syntaxTree()]).
   pos_to_syntax_units(Tree, Start, End, F, MinLength) ->
       Type = refac_syntax:type(Tree),
  
positive.code: %% This phase needs to get access to the abstract syntax tree.
  
  trim_clones(Cs, MinLength, MinClones, MaxPars, TabWidth) ->
      lists:append([new_trim_clones(C, MinLength, MinClones, MaxPars, TabWidth) || C<-Cs]).
   
  new_trim_clones(_Clone={Range, _Len, _Freq}, MinLength, MinClones, MaxPars, TabWidth) ->
      refac_io:format("Trim a clone....\n"),
      Fun = fun({{File1, L1, C1}, {File2, L2, C2}})->
  		  case File1/=File2 of 
  		      true ->throw({error, []});
  		      _ -> 
  			  {ok, {AnnAST, _}} =refac_util:parse_annotate_file(File1, true, [], TabWidth),
  			  Units=pos_to_syntax_units(AnnAST, {L1, C1}, {L2, C2}, fun is_expr_or_fun/1, MinLength),
  			  lists:map(fun(U) ->
  					    {{StartLn, StartCol}, _} = refac_util:get_range(hd(U)),
  					    {_,{EndLn, EndCol}} = refac_util:get_range(lists:last(U)),
  					    BdStruct = refac_expr_search:var_binding_structure(U),
  					    R = {{File1, StartLn, StartCol}, {File1, EndLn, EndCol}},
  					    case refac_util:pos_to_fun_def(AnnAST, {StartLn + (EndLn - StartLn) div 2, StartCol}) of
  						{ok, FunDef} ->
  						    VarsToExport= refac_sim_expr_search:vars_to_export(FunDef, {EndLn, EndCol}, U),
  						    {R, U,VarsToExport, BdStruct, num_of_tokens(U)};
  						_ ->
  						    throw({error, []})
  					    end
  				    end, Units)
  		  end
  	  end,
       try lists:map(Fun, Range) of
  	ListsOfUnitsList -> 
  	     case lists:usort(lists:map(fun length/1, ListsOfUnitsList)) of 
  		 [_N] -> ZippedUnitsList = zip_list(ListsOfUnitsList),
  			 Cs =lists:append([group_by(4, ZippedUnits)|| ZippedUnits<- ZippedUnitsList]),
  			 lists:append([get_anti_unifier(C, MaxPars)||C<-Cs, C/=[], length(C)>=MinClones, 
  								      element(5, hd(C))>=MinLength]);
  		 _ ->[]
  	     end
       catch
  	 E1:E2 -> 
       	    ?debug("E1E2:\n~p\n", [{E1,E2}]),
       	    []
       end.
  	 
  num_of_tokens(Exprs) ->
      BlockExpr = refac_syntax:block_expr(Exprs),
      Str = refac_prettypr:format(BlockExpr),
  
negative.code:       {Res, Pars} -> 
  	    case Pars > MaxPars of
  		true -> [];
  		_ ->[{Range, Len, F, Res}] 
  		    %%[{Range, Len, F, Res, Pars}]
  	    end
      catch
        _Error_ -> []
  