anchor.diff:  
   
   json_rpc(YangFile) ->
  +    json_rpc(YangFile, []).
  +
  +json_rpc(YangFile, Opts) ->
       Dir = filename:dirname(YangFile),
  -    case read(YangFile) of
  +    case read(YangFile, Ext = filename:extension(YangFile), Opts) of
   	{{ok, Y}, Ext} ->
  -	    each_module(fun to_json_rpc/3, Y, {Dir, Ext});
  +	    each_module(fun to_json_rpc/3, Y, {Dir, Ext, Opts});
   	{Error, _} ->
   	    Error
       end.
   
   read(F) ->
  -    read(F, filename:extension(F)).
  -
  -read(F, ".yang") ->
  -    {yang:parse_file(F), ".yang"};
  -read(F, ".eterm") ->
  -    {read_eterm(F), ".eterm"}.
  -
  -read_eterm(F) ->
  -    case file:read_file(F) of
  -	{ok, Bin} ->
  -	    {ok, binary_to_term(Bin)};
  -	Error ->
  -	    Error
  -    end.
  +    read(F, filename:extension(F), []).
  +
  +read(F, ".yang", Opts) ->
  +    {yang_parser:parse(F, Opts), ".yang"};
  +read(F, ".eterm", Opts) ->
  +    {read_eterm(F, Opts), ".eterm"}.
  +
  +read_eterm(F, Opts) ->
  +    case lists:keyfind(open_hook, 1, Opts) of
  +	{_, Open} ->
  +	    case Open(F, Opts) of
  +		{ok, Fd} ->
  +		    try
  +			Bin = read_open_file(Fd),
  +			{ok, binary_to_term(Bin)}
  +		    after
  +			file:close(Fd)
  +		    end;
  +		{error, _} = E ->
  +		    E
  +	    end;
  +	false ->
  +	    case file:read_file(F) of
  +		{ok, Bin} ->
  +		    {ok, binary_to_term(Bin)};
  +		Error ->
  +		    Error
  +	    end
  +    end.
  +
  +read_open_file(Fd) ->
  +    file:position(Fd, bof),
  +    Read = fun() -> file:read(Fd, 4096) end,
  +    read_open_file(Read(), Read, <<>>).
  +
  +read_open_file(eof, _, Acc) ->
  +    Acc;
  +read_open_file({ok, Bytes}, Read, Acc) ->
  +    read_open_file(Read(), Read, <<Acc/binary, Bytes/binary>>).
  +
   
   each_module(F, [{module,_,M,Data}|Rest], Dir) ->
       Ms = binary_to_list(M),
  
positive.code: 			 {"params", {struct, rpc_params(I, Data, Imports)}}]}},
       {reply, {struct, [{"json-rpc", "2.0"},
  		       {"id", ""},
  		       {"result", {struct, rpc_params(O, Data, Imports)}}]}}}.
  
  
  rpc_params([{uses,_,G,_}|T], Data, Imports) ->
  
negative.code: 
  mk_rpc_pair(InOut, N, Data, Imports) ->
      {_,_,_,I} = lists:keyfind(input, 1, InOut),
      O = case lists:keyfind(output, 1, InOut) of
  	    {_,_,_,Ox}  -> Ox;
  	    false -> void
  	end,
      {descr(InOut),
       {request, {struct, [{"json-rpc", "2.0"},
  			 {"method", N},
  