anchor.diff:                      io_lib:format("~p()", [Tag]);
                   {0,1} ->
                       if Style =:= ubf ->
  -                            io_lib:format("~s()?", [Tag]);
  +                            io_lib:format("~p()?", [Tag]);
                          true ->
  -                            io_lib:format("~s() | undefined", [Tag])
  +                            io_lib:format("~p() | undefined", [Tag])
                       end;
                   {0,0} ->
                       if Style =:= ubf ->
  -                            io_lib:format("~s{0}", [Tag]);
  +                            io_lib:format("~p{0}", [Tag]);
                          true ->
                               io_lib:format("undefined", [])
                       end
  
positive.code:           , ""
            , ""
            , [
               ["% #'", atom_to_list(Name), "'{}", "\n%\t"
                , join([ case Default of
                             [] ->
                                 io_lib:format("'~s'::~s", [Field, typeref(ubf,Type,C)]);
                             [D] ->
                                 io_lib:format("'~s'=~p::~s", [Field, D, typeref(ubf,Type,C)])
                         end || {Field,Default,Type} <- FDTs ], ", ")
                , "\n\n-ifndef('$ubf_record_", atom_to_list(Name), "').\n"
                , "-define('$ubf_record_", atom_to_list(Name), "', true).\n"
                , "-record('", atom_to_list(Name), "', {\n\t"
                , join([ case Default of
                             [] ->
                                 io_lib:format("'~s'::~s", [Field, typeref(erlang,Type,C)]);
                             [D] ->
                                 io_lib:format("'~s'=~p::~s", [Field, D, typeref(erlang,Type,C)])
                         end || {Field,Default,Type} <- FDTs ], ", ")
                , "}).\n"
                , "-endif.\n\n"
  
negative.code:     io_lib:format("list(~s)", [join([ atom_to_list(Attr) || Attr <- Attrs ], ",")]);
  typeref(_Style,{predef,{tuple,Attrs}},_C) ->
      io_lib:format("tuple(~s)", [join([ atom_to_list(Attr) || Attr <- Attrs ], ",")]);
  %% abnf
  typeref(ubf,{abnf_alt,_}=X,_C) ->
      io_lib:format("~p", [X]);
  typeref(ubf,{abnf_seq,_}=X,_C) ->
      io_lib:format("~p", [X]);
  typeref(ubf,{abnf_repeat,Min,Max,Type},C) ->
      io_lib:format("{abnf_repeat,~s,~s,~s}",
                    [typeref(ubf,Min,C), typeref(ubf,Max,C), typeref(ubf,Type,C)]);
  typeref(ubf,{abnf_byte_range,_,_}=X,_C) ->
      io_lib:format("~p", [X]);
  typeref(ubf,{abnf_byte_alt,_}=X,_C) ->
      io_lib:format("~p", [X]);
  typeref(ubf,{abnf_byte_seq,_}=X,_C) ->
      io_lib:format("~p", [X]);
  typeref(ubf,{abnf_byte_val,_}=X,_C) ->
      io_lib:format("~p", [X]);
  typeref(_Style,{abnf_alt,_},_C) ->
      "binary()";
  typeref(_Style,{abnf_seq,_},_C) ->
      "binary()";
  typeref(_Style,{abnf_repeat,_,_,_},_C) ->
      "binary()";
  typeref(_Style,{abnf_byte_range,_,_},_C) ->
      "binary()";
  typeref(_Style,{abnf_byte_alt,_},_C) ->
      "binary()";
  typeref(_Style,{abnf_byte_seq,_},_C) ->
      "binary()";
  typeref(_Style,{abnf_byte_val,_},_C) ->
      "binary()";
  %% otherwise
  typeref(_Style,Type, _C) ->
      io_lib:format("~p()", [Type]).
  