anchor.diff:  tcontainer(Ref, Content) ->
       #tcontainer{ref = Ref, content = Content}.
   
  +%%% @doc
  +%%% Creates a template tag with the name Id that matches any Erlang term.
  +%%% @param Ref the reference used to create the tags in the template, it is used
  +%%% to reliably tell apart items that are template tags from those that are not,
  +%%% which allows the use of several kinds of templates in the same structure.
  +%%% @param Id the name of the tag created.
  +%%% @return a "template tag" with the name Id that matches any Erlang term.
  +%%% @see extract_vars/4
  +%%% @see replace_vars/3
  +-spec tvar(Ref :: reference(), Id :: term()) -> TemplateTag :: #tcontainer{}.
   tvar(Ref, Id) ->
       tcontainer(Ref, #tvar_rec{id = Id}).
   
  +%%% @doc
  +%%% Creates a template tag with no name that allows you to match
  +%%% the same Erlang term in several different ways. It allows you
  +%%% to incorporate apply calls in a template and match their results.
  +%%% Apply calls are assumed to take only one parameter, and the parameter
  +%%% that is used is the Erlang term matched. If the call produces an
  +%%% exception, this is considered a <code>no_match</code>.
  +%%% The special tuple <code>{identity, term()}</code> allows you to match
  +%%% the whole structure matched by the <code>tobj</code> "template tag"
  +%%% with another "template tag" or Erlang term, for example: a <code>tvar</code>
  +%%% tag to save the value if it matches.
  +%%% <code>tobj</code> cannot be used with {@link replace_vars/3}.
  +%%% @param Ref the reference used to create the tags in the template, it is used
  +%%% to reliably tell apart items that are template tags from those that are not,
  +%%% which allows the use of several kinds of templates in the same structure.
  +%%% @param FuncList A list with the templates and subtargets to match in the form:
  +%%% <ul>
  +%%% <li><code>{{Module, Function}, Template}</code> - Matches the result of
  +%%% calling the function Module:Function, with the target Erlang term as first
  +%%% argument, to the template Template</li>
  +%%% <li><code>{identity, Template}</code> - Matches the target Erlang term
  +%%% to the template Template</li>
  +%%% </ul>
  +%%% @return The template
  +%%% @see extract_vars/4
  +-spec tobj(Ref :: reference(),
  +	   [{identity, Anything :: term()} |
  +	    {{Module :: atom(), Function :: atom()}, Anything :: term()}])
  +	  -> TemplateTag :: #tcontainer{}.
   tobj(Ref, FuncList) ->
       tcontainer(Ref, #tobj_rec{func_list = FuncList}).
   
  
positive.code: %%% @author Pablo Lamela <P.Lamela-Seijas@kent.ac.uk>
  %%% @copyright (C) 2014, Pablo Lamela Seijas
  %%% @doc
  %%% Adds information about idioms to the structure
  %%% @end
  %%% Created : 5 Feb 2014 by Pablo Lamela
  
  -module(idiomizer).
  
  -export([idiomize_module_info/1,
  	 tsatom_val/2, tsint_val/2, tsvar_name/2, tsvar_name_and_id/3, tsvar_id/2,
  	 tcontainer/2, tvar/2, tobj/2, extract_vars/4, replace_vars/3,
  	 tsoneellist_elid/2]).
  
  -include("records.hrl").
  -include("template_recs.hrl").
  
  %% General Function
  
  idiomize_module_info(MIface) ->
      Ref = make_ref(),
      ArgsIdiomized = idiomize_module_info_args(MIface),
  
negative.code: 
  %% Tagging funcs
  
  %%% @doc
  %%% Creates a template that matches an atom in abstract syntax.
  %%% It uses {@link tobj/2} underneath and because of that it cannot be
  %%% used with {@link replace_vars/3}.
  %%% @param Ref the reference used to create the tags in the template, it is used
  %%% to reliably tell apart items that are template tags from those that are not,
  %%% which allows the use of several kinds of templates in the same structure.
  %%% @param ValueTemplate template that will be matched to the result of applying
  %%% erl_syntax:atom_value/1 to the target Erlang term.
  %%% @return the corresponding "template tag"
  %%% @see extract_vars/4
  -spec tsatom_val(Ref :: reference(), ValueTemplate :: term()) -> TemplateTag :: #tcontainer{}.
  tsatom_val(Ref, Value) ->
      tobj(Ref,
  	[{{erl_syntax, type}, atom},
           {{erl_syntax, atom_value}, Value}]).
  
  
  %%% @doc
  %%% Creates a template that matches an integer in abstract syntax.
  %%% It uses {@link tobj/2} underneath and because of that it cannot be
  %%% used with {@link replace_vars/3}.
  %%% @param Ref the reference used to create the tags in the template, it is used
  %%% to reliably tell apart items that are template tags from those that are not,
  %%% which allows the use of several kinds of templates in the same structure.
  %%% @param ValueTemplate template that will be matched to the result of applying
  %%% erl_syntax:integer_value/1 to the target Erlang term.
  %%% @return the corresponding "template tag"
  %%% @see extract_vars/4
  -spec tsint_val(Ref :: reference(), ValueTemplate :: term()) -> TemplateTag :: #tcontainer{}.
  tsint_val(Ref, Value) ->
      tobj(Ref,
  	 [{{erl_syntax, type}, integer},
  	  {{erl_syntax, integer_value}, Value}]).
  
  %%% @doc
  %%% Equivalent to {@link tsvar_name_and_id/3} but it does not include a
  %%% template for the variable name.
  %%% It uses {@link tobj/2} underneath and because of that it cannot be
  %%% used with {@link replace_vars/3}.
  %%% @param Ref the reference used to create the tags in the template, it is used
  %%% to reliably tell apart items that are template tags from those that are not,
  %%% which allows the use of several kinds of templates in the same structure.
  %%% @param ValueTemplate template that will be matched to the target Erlang term.
  %%% @return the corresponding "template tag"
  %%% @see extract_vars/4
  %%% @see tsvar_name_and_id/3
  -spec tsvar_id(Ref :: reference(), ValueTemplate :: term()) -> TemplateTag :: #tcontainer{}.
  tsvar_id(Ref, Id) ->
      tobj(Ref,
  	 [{{erl_syntax, type}, variable},
  	  {identity, Id}]).
  
  %%% @doc
  %%% Equivalent to {@link tsvar_name_and_id/3} but it does not include a
  %%% template for the target Erlang term.
  %%% It uses {@link tobj/2} underneath and because of that it cannot be
  %%% used with {@link replace_vars/3}.
  %%% @param Ref the reference used to create the tags in the template, it is used
  %%% to reliably tell apart items that are template tags from those that are not,
  %%% which allows the use of several kinds of templates in the same structure.
  %%% @param NameTemplate template that will be matched to the result of applying
  %%% erl_syntax:variable_name/1 to the target Erlang term.
  %%% @return the corresponding "template tag"
  %%% @see extract_vars/4
  %%% @see tsvar_name_and_id/3
  -spec tsvar_name(Ref :: reference(), NameTemplate :: term()) -> TemplateTag :: #tcontainer{}.
  tsvar_name(Ref, Name) ->
      tobj(Ref,
  	 [{{erl_syntax, type}, variable},
            {{erl_syntax, variable_name}, Name}]).
  
  
  %%% @doc
  %%% Creates a template that matches a variable in abstract syntax.
  %%% It uses {@link tobj/2} underneath and because of that it cannot be
  %%% used with {@link replace_vars/3}.
  %%% @param Ref the reference used to create the tags in the template, it is used
  %%% to reliably tell apart items that are template tags from those that are not,
  %%% which allows the use of several kinds of templates in the same structure.
  %%% @param NameTemplate template that will be matched to the result of applying
  %%% erl_syntax:variable_name/1 to the target Erlang term.
  %%% @param ValueTemplate template that will be matched to the target Erlang term.
  %%% @return the corresponding "template tag"
  %%% @see extract_vars/4
  %%% @see tsvar_name/2
  %%% @see tsvar_id/2
  -spec tsvar_name_and_id(Ref :: reference(), NameTemplate :: term(),
  			ValueTemplate :: term()) -> TemplateTag :: #tcontainer{}.
  tsvar_name_and_id(Ref, Name, Value) ->
      tobj(Ref,
  	 [{{erl_syntax, type}, variable},
            {{erl_syntax, variable_name}, Name},
  	  {identity, Value}]).
  
  %%% @doc
  %%% Creates a template that matches a list with one element in abstract syntax.
  %%% It uses {@link tobj/2} underneath and because of that it cannot be
  %%% used with {@link replace_vars/3}.
  %%% @param Ref the reference used to create the tags in the template, it is used
  %%% to reliably tell apart items that are template tags from those that are not,
  %%% which allows the use of several kinds of templates in the same structure.
  %%% @param Template template that will be matched to the result of applying
  %%% erl_syntax:list_head/1 of the target Erlang term.
  %%% @return the corresponding "template tag"
  %%% @see extract_vars/4
  -spec tsoneellist_elid(Ref :: reference(), Template :: term()) -> TemplateTag :: #tcontainer{}.
  tsoneellist_elid(Ref, Value) ->
      tobj(Ref,
  	 [{{erl_syntax, list_length}, 1},
  