anchor.diff:  	_ ->format_search_paths(T, Str++", \""++P++"\"")
       end.
       
  +-spec default_incls()->[string()].			   
   default_incls() ->
     [".", "..", "../hrl", "../incl", "../inc", "../include",
      "../../hrl", "../../incl", "../../inc", "../../include",
      "../../../hrl", "../../../incl", "../../../inc", "../../../include"].
  +
  +%% ============================================================================
  +%% @doc Return the token list annoated to a form if there is any.
  +
  +-spec(get_toks(Node::syntaxTree())-> [token()]).
  +get_toks(Node) ->
  +    As = refac_syntax:get_ann(Node),
  +    case lists:keysearch(toks, 1, As) of
  +      {value, {toks, Toks}} -> Toks;
  +      _ -> []
  +    end.
  +
  +%% =====================================================================
  +%% @doc Reset all the annotations in the subtree to the default (empty) annotation.
  +
  +-spec(reset_attrs(Node::syntaxTree()) -> syntaxTree()).
  +reset_attrs(Node) ->
  +    ast_traverse_api:full_buTP(fun (T, _Others) -> refac_syntax:set_ann(T, [])
  +			       end, Node, {}).
  +
  +%% =====================================================================
  +%% @doc Return the environment variables of an AST node.
  +
  +-spec(get_env_vars(Node::syntaxTree())-> [{atom(), pos()}]).
  +get_env_vars(Node) ->
  +    get_env_vars_1(refac_syntax:get_ann(Node)).
  +
  +get_env_vars_1([{env, B} | _Bs]) -> B;
  +get_env_vars_1([_ | Bs]) -> get_env_vars_1(Bs);
  +get_env_vars_1([]) -> [].
  +
  +%% =====================================================================
  +%% @doc Return the exported variables of an AST node.
  +
  +-spec(get_var_exports(Node::[syntaxTree()]|syntaxTree())-> [{atom(),pos()}]).
  +get_var_exports(Nodes) when is_list(Nodes) ->
  +    lists:flatmap(fun (Node) -> get_var_exports(Node) end, Nodes);
  +get_var_exports(Node) ->
  +    get_var_exports_1(refac_syntax:get_ann(Node)).
  +
  +get_var_exports_1([{bound, B} | _Bs]) -> B; %% Think about this again!!
  +get_var_exports_1([_ | Bs]) -> get_var_exports_1(Bs);
  +get_var_exports_1([]) -> [].
  +
  +
  +%% =====================================================================
  +%% @doc Return the bound variables of an AST node.
  +
  +-spec(get_bound_vars(Node::[syntaxTree()]|syntaxTree())-> [{atom(),pos()}]).
  +get_bound_vars(Nodes) when is_list(Nodes) ->
  +    lists:usort(lists:flatmap(fun (Node) -> get_bound_vars(Node) end, Nodes));
  +get_bound_vars(Node) ->
  +    lists:usort(refac_syntax_lib:fold(fun (N, Acc) ->
  +					      get_bound_vars_1(refac_syntax:get_ann(N)) ++ Acc
  +				      end, [], Node)).
  +					       
  +get_bound_vars_1([{bound, B} | _Bs]) -> B;
  +get_bound_vars_1([_ | Bs]) -> get_bound_vars_1(Bs);
  +get_bound_vars_1([]) -> [].
  +
  +%% =====================================================================
  +%% @doc Return the free variables of an AST node.
  +-spec(get_free_vars(Node::[syntaxTree()]|syntaxTree())-> [{atom(),pos()}]).
  +get_free_vars(Nodes) when is_list(Nodes) ->
  +    FBVs = lists:map(fun (Node) ->
  +			     {get_free_vars(Node), get_bound_vars(Node)}
  +		     end, Nodes),
  +    {FVs, BVs} = lists:unzip(FBVs),
  +    lists:usort(lists:append(FVs)) -- lists:usort(lists:append(BVs));
  +get_free_vars(Node) ->
  +    get_free_vars_1(refac_syntax:get_ann(Node)).
  +
  +get_free_vars_1([{free, B} | _Bs]) -> B;
  +get_free_vars_1([_ | Bs]) -> get_free_vars_1(Bs);
  +get_free_vars_1([]) -> [].
  +     
  +%% =====================================================================
  +%% @doc Return true if an AST node represents an expression.
  +-spec(is_expr(Node:: syntaxTree())-> boolean()).
  +is_expr(Node) ->
  +    As = refac_syntax:get_ann(Node),
  +    case lists:keysearch(category, 1, As) of
  +      {value, {category, C}} ->
  +	  case C of
  +	      expression -> true;
  +	      guard_expression -> true;
  +	      application_op -> true;
  +	      generator -> true;
  +	    _ -> false
  +	  end;
  +      _ -> false
  +    end.
  +
  +%% =====================================================================
  +%% @doc Return true if an AST node represents a pattern.
  +-spec(is_pattern(Node:: syntaxTree())-> boolean()).
  +is_pattern(Node) ->
  +    As = refac_syntax:get_ann(Node),
  +    case lists:keysearch(category, 1, As) of
  +	{value, {category, pattern}} ->
  +	    true;
  +	_ -> false
  +    end.
  +
  +%%===============================================================================
  +%% @spec is_exported({FunName::atom(), Arity::integer()},ModuleInfo) -> boolean()
  +%%       ModuleInfo = [{Key, term()}]
  +%%       Key = attributes | errors | exports | functions | imports | module
  +%%             | records | rules | warnings
  +%% @doc Return true if the function is exported by its defining module.
  +%% @TODO: Think about the interface of this function again.
  +
  +-spec(is_exported({FunName::atom(), Arity::integer()},ModInfo::moduleInfo()) -> boolean()).
  +is_exported({FunName, Arity}, ModInfo) ->
  +    ImpExport = case lists:keysearch(attributes, 1, ModInfo) of
  +		    {value, {attributes, Attrs}} -> 
  +			lists:member({compile, export_all}, Attrs);
  +		    false -> false
  +		end,
  +    ExpExport= 	case lists:keysearch(exports, 1, ModInfo) of
  +		    {value, {exports, ExportList}} ->
  +			 lists:member({FunName, Arity}, ExportList);
  +		    _ -> false
  +		end,
  +    ImpExport or ExpExport.
  +
  +
  +
  +%%===============================================================================
  +%% @spec inscope_funs(ModuleInfo) -> [{ModName, FunName, Arity}]
  +%%       ModuleInfo = [{Key, term()}]
  +%%       Key = attributes | errors | exports | functions | imports | module
  +%%             | records | rules | warnings
  +%%       ModName = atom()
  +%%       FunName = atom()
  +%%       Arity = integer()
  +%%
  +%% @doc Returns the functions that are inscope (either imported by the 
  +%% module or defined within the module) in the current module.
  +%% @TODO: Think about the interface of this function again.
  +
  +-spec(inscope_funs(moduleInfo()) -> [{atom(), atom(), integer()}]).
  +inscope_funs(ModuleInfo) ->
  +    case lists:keysearch(module, 1, ModuleInfo) of
  +      {value, {module, M}} ->
  +	  Imps = case lists:keysearch(imports, 1, ModuleInfo) of
  +		   {value, {imports, I}} ->
  +		       lists:append([lists:map(fun ({F, A}) -> {M1, F, A} end, Fs) || {M1, Fs} <- I]);
  +		   _ -> []
  +		 end,
  +	  Funs = case lists:keysearch(functions, 1, ModuleInfo) of
  +		   {value, {functions, Fs}} -> lists:map(fun ({F, A}) -> {M, F, A} end, Fs);
  +		   _ -> []
  +		 end,
  +	  PreDefinedFuns=[{M, module_info, 1}, {M, module_info, 2}, {M, record_info, 2}],
  +	  Imps ++ Funs ++ PreDefinedFuns;
  +      _ -> []
  +    end.
  +		
  +
  +%% =====================================================================
  +%% @spec update_ann(Node::syntaxTree(), {Key::atom(), Val::term()}) -> syntaxTree()
  +%% @doc Update a specific annotation of the Node with the given one.
  +%% if the kind of annotation already exists in the AST node, the annotation 
  +%% value is replaced with the new one, otherwise the given annotation info 
  +%% is added to the node.
  +
  +-spec(update_ann(Node::syntaxTree(), {Key::atom(), Val::anyterm()}) -> syntaxTree()).
  +update_ann(Tree, {Key, Val}) ->
  +    As0 = refac_syntax:get_ann(Tree),
  +    As1 = case lists:keysearch(Key, 1, As0) of
  +	    {value, _} -> lists:keyreplace(Key, 1, As0, {Key, Val});
  +	    _ -> As0 ++ [{Key, Val}]
  +	  end,
  +    refac_syntax:set_ann(Tree, As1).
  +
  +
  +%% =====================================================================
  +%% @spec callback_funs(Behaviour)->[{FunName, Arity}]
  +%%       Behaviour = gen_server | gen_event | gen_fsm | supervisor
  +%%       FunName = atom()
  +%%       Arity = integer()
  +%% @doc Pre-defined callback functions by the standard Erlang behaviours.
  +
  +-type(behaviour()::gen_server | gen_event | gen_fsm | supervisor).
  +-spec(callback_funs(behaviour())->[{atom(), integer()}]).
  +callback_funs(Behaviour) ->
  +    case Behaviour of
  +      gen_server ->
  +	  [{init, 1}, {handle_call, 3}, {handle_cast, 2}, {handle_info, 2},
  +	   {terminate, 2}, {code_change, 3}];
  +      gen_event ->
  +	  [{init, 1}, {handle_event, 2}, {handle_call, 2}, {handle_info, 2},
  +	   {terminate, 2}, {code_change, 3}];
  +      gen_fsm ->
  +	  [{init, 1}, {handle_event, 3}, {handle_sync_event, 4}, {handle_info, 3},
  +	   {terminate, 3}, {code_change, 4}];
  +      supervisor -> [{init, 1}];
  +      _ -> []
  +    end.
  +
  +-spec is_callback_fun(atom(), atom(), integer()) ->boolean().
  +is_callback_fun(ModInfo, Funname, Arity) ->
  +    case lists:keysearch(attributes, 1, ModInfo) of
  +      {value, {attributes, Attrs}} ->
  +	  case lists:keysearch(behaviour, 1, Attrs) of
  +	    {value, {behaviour, B}} ->
  +		lists:member({Funname, Arity},
  +			     callback_funs(B));
  +	    _ -> false
  +	  end;
  +      _ -> false
  +    end.
  +
  +-spec rewrite(syntaxTree(), syntaxTree())->syntaxTree().
  +rewrite(Tree, Tree1) ->
  +    refac_syntax:copy_attrs(Tree, Tree1).
  
positive.code: 	end,
      lists:usort(refac_syntax_lib:fold(F, [], Node)).
  
  collect_used_records(Node) ->
      Fun = fun(T, S) ->
  		  case refac_syntax:type(T) of
  
negative.code: glast(_Info, List) -> lists:last(List).
  
  %% =====================================================================
  %% @doc Convert a string into upper case.
  %% @see to_lower/1
  
  