anchor.diff:  to_textual_order(Cs) when is_list(Cs) ->
       lists:keysort(#'ComponentType'.textual_order,Cs).
       
  -
  -gen_check_call(TopType,Cname,Type,InnerType,WhatKind,DefaultValue,Element) ->
  -    case WhatKind of
  -	{primitive,bif} ->
  -	    gen_prim_check_call(InnerType,DefaultValue,Element,Type);
  -	#'Externaltypereference'{module=M,type=T} ->
  -	    %% generate function call
  -	    Name = list2name([T,check]),
  -	    emit({"'",Name,"'(",DefaultValue,", ",Element,")"}),
  -	    %% insert in ets table and do look ahead check
  -	    Typedef = asn1_db:dbget(M,T),
  -	    RefType = Typedef#typedef.typespec,
  -	    InType = asn1ct_gen:get_inner(RefType#type.def),
  -	    case insert_once(check_functions,{Name,RefType}) of
  -		true ->
  -		    lookahead_innertype([T],InType,RefType);
  -		_ ->
  -		    ok
  -	    end;
  -	{constructed,bif} ->
  -	    NameList = [Cname|TopType],
  -	    Name = list2name(NameList ++ [check]),
  -	    emit({"'",Name,"'(",DefaultValue,", ",Element,")"}),
  -	    asn1ct_table:insert(check_functions, {Name, Type}),
  -	    %% Must look for check functions in InnerType,
  -	    %% that may be referenced  or internal defined 
  -	    %% constructed types not used elsewhere.
  -	    lookahead_innertype(NameList,InnerType,Type);
  -	_ ->
  -	    %% Generate Dummy function call i.e. anything is accepted
  -	    emit(["fun() -> true end ()"])
  -    end.
  -
  -gen_prim_check_call(PrimType, Default, Element, Type) ->
  -    case unify_if_string(PrimType) of
  -	'BOOLEAN' ->
  -	    check_call(check_bool, [Default,Element]);
  -	'INTEGER' ->
  -	    NNL = case Type#type.def of
  -		      {_,NamedNumberList} -> NamedNumberList;
  -		      _ -> []
  -		  end,
  -	    check_call(check_int, [Default,Element,{asis,NNL}]);
  -	'BIT STRING' ->
  -	    case Type#type.def of
  -		{_,[]} ->
  -		    check_call(check_bitstring,
  -			       [Default,Element]);
  -		{_,[_|_]=NBL} ->
  -		    check_call(check_named_bitstring,
  -			       [Default,Element,{asis,NBL}])
  -	    end;
  -	'OCTET STRING' ->
  -	    check_call(check_octetstring, [Default,Element]);
  -	'NULL' ->
  -	    check_call(check_null, [Default,Element]);
  -	'OBJECT IDENTIFIER' ->
  -	    check_call(check_objectidentifier, [Default,Element]);
  -	'RELATIVE-OID' ->
  -	    check_call(check_objectidentifier, [Default,Element]);
  -	'ObjectDescriptor' ->
  -	    check_call(check_objectdescriptor, [Default,Element]);
  -	'REAL' ->
  -	    check_call(check_real, [Default,Element]);
  -	'ENUMERATED' ->
  -	    {_,Enumerations} = Type#type.def,
  -	    check_call(check_enum, [Default,Element,{asis,Enumerations}]);
  -	restrictedstring ->
  -	    check_call(check_restrictedstring, [Default,Element])
  -    end.
  -
  -check_call(F, Args) ->
  -    asn1ct_func:call(check, F, Args).
  -
  -%% lokahead_innertype/3 traverses Type and checks if check functions
  -%% have to be generated, i.e. for all constructed or referenced types.
  -lookahead_innertype(Name,'SEQUENCE',Type) ->
  -    Components = (Type#type.def)#'SEQUENCE'.components,
  -    lookahead_components(Name,Components);
  -lookahead_innertype(Name,'SET',Type) ->
  -    Components = (Type#type.def)#'SET'.components,
  -    lookahead_components(Name,Components);
  -lookahead_innertype(Name,'CHOICE',Type) ->
  -    {_,Components} = Type#type.def,
  -    lookahead_components(Name,Components);
  -lookahead_innertype(Name,'SEQUENCE OF',SeqOf) ->
  -    lookahead_sof(Name,'SEQOF',SeqOf);
  -lookahead_innertype(Name,'SET OF',SeqOf) ->
  -    lookahead_sof(Name,'SETOF',SeqOf);
  -lookahead_innertype(_Name,#'Externaltypereference'{module=M,type=T},_) ->
  -    Typedef = asn1_db:dbget(M,T),
  -    RefType = Typedef#typedef.typespec,
  -    insert_once(check_functions,{list2name([T,check]),RefType}),
  -    InType = asn1ct_gen:get_inner(RefType#type.def),
  -    case type(InType) of
  -	{constructed,bif} ->
  -	    lookahead_innertype([T],InType,RefType);
  -	Ref = #'Externaltypereference'{} ->
  -	    lookahead_reference(Ref);
  -	_ ->
  -	    ok
  -    end;
  -lookahead_innertype(_,_,_) ->
  -    ok.
  -
  -lookahead_components(_,[]) -> ok;
  -lookahead_components(Name,[C|Cs]) ->
  -    #'ComponentType'{name=Cname,typespec=Type} = C,
  -    InType = asn1ct_gen:get_inner(Type#type.def),
  -    case asn1ct_gen:type(InType) of
  -	{constructed,bif} ->
  -	    case insert_once(check_functions,
  -			     {list2name([Cname|Name] ++ [check]),Type}) of
  -		true ->
  -		    lookahead_innertype([Cname|Name],InType,Type);
  -		_ ->
  -		    ok
  -	    end;
  -	#'Externaltypereference'{module=RefMod,type=RefName} ->
  -  	    Typedef = asn1_db:dbget(RefMod,RefName),
  -  	    RefType = Typedef#typedef.typespec,
  -  	    case insert_once(check_functions,{list2name([RefName,check]),
  -  					      RefType}) of
  -  		true ->
  -  		    lookahead_innertype([RefName],InType,RefType);
  -  		_ ->
  -  		    ok
  -  	    end;
  -	_ ->
  -	    ok
  -    end,
  -    lookahead_components(Name,Cs).
  -
  -lookahead_sof(Name,SOF,SOFType) ->
  -    Type = case SOFType#type.def of
  -	       {_,_Type} -> _Type;
  -	       _Type -> _Type
  -	   end,
  -    InnerType = asn1ct_gen:get_inner(Type#type.def),
  -    case asn1ct_gen:type(InnerType) of
  -	{constructed,bif} ->
  -	    %% this is if a constructed type is defined in
  -	    %% the SEQUENCE OF type
  -	    NameList = [SOF|Name],
  -	    insert_once(check_functions,
  -			{list2name(NameList ++ [check]),Type}),
  -	    lookahead_innertype(NameList,InnerType,Type);
  -	Ref = #'Externaltypereference'{} ->
  -	    lookahead_reference(Ref);
  -	_ ->
  -	    ok
  -    end.
  -
  -lookahead_reference(#'Externaltypereference'{module=M,type=T}) ->
  -    Typedef = asn1_db:dbget(M,T),
  -    RefType = Typedef#typedef.typespec,
  -    InType = get_inner(RefType#type.def),
  -    case insert_once(check_functions,
  -		     {list2name([T,check]),RefType}) of
  -	true ->
  -	    lookahead_innertype([T],InType,RefType);
  -	_ ->
  -	    ok
  -    end.
  -
   insert_once(Table,Object) ->
       case asn1ct_table:lookup(Table, element(1, Object)) of
   	[] ->
  
positive.code:     pgen_values(Erules,Module,Values),
      pgen_objects(Rtmod,Erules,Module,Objects),
      pgen_objectsets(Rtmod,Erules,Module,ObjectSets),
      case catch lists:member(der,get(encoding_options)) of
  	true ->
  	    pgen_check_defaultval(Erules,Module);
  	_ -> ok
      end,
      pgen_partial_decode(Rtmod,Erules,Module).
  
  pgen_values(_,_,[]) ->
  
negative.code: 	 list2rname/1,
  	 constructed_suffix/2,
  	 unify_if_string/1,
  	 get_constraint/2,
  	 insert_once/2,
  	 ct_gen_module/1,
  