anchor.diff:  
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   %% Parsing real pages
  +file_parse(File) ->
  +  {ok,B} = file:read_file(File),
  +  lists:reverse(sax(B,fun(T,A)-> [T|A] end, [])).
  +
  +wget_parse(Url) ->
  +  sax(wget(Url),fun(T,A)-> A++[T] end, []).
  +
  +wget_print(Url) ->
  +  io:fwrite("~s~n",[wget(Url)]).
  +
   wget(Url) ->
     inets:start(),
     {ok, {_Rc, _Hdrs, Body}} = http:request(get, {Url, []}, [], []),
     Body.
  -
  -file_parse(File) ->
  -  {ok,B} = file:read_file(File),
  -  sax(B,fun(T,A)-> [T|A] end, []).
  -
  -wget_parse(Url) ->
  -  sax(wget(Url),fun(T,A)-> A++[T] end, []).
  -
  -wget_print(Url) ->
  -  io:fwrite("~s~n",[wget(Url)]).
   
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   %% ad-hoc unit test
  
positive.code: 
  maybe_emit(Token,State) ->
    case Token of
      {sc,Tag,Attrs}   -> emit({end_tag,Tag},emit({tag,Tag,Attrs},State));
      {open,Tag,Attrs} -> emit({tag,Tag,Attrs},push(Tag,State));
      {close,Tag}      -> try emit({end_tag,Tag},pop(Tag,maybe_unroll(Tag,State)))
                          catch bogus -> State
                          end;
      {comment,Cm}     -> emit({comment,Cm},State);
      {'?',DT}    -> emit({'?',DT},State);
      {'!',DT} -> emit({'!',DT},State);
      {text,<<>>}        -> State;
      {text,Text}      -> emit({text,Text},State)
    end.
  
  emit(Token,{Fun,Acc,Stack}) -> {Fun,Fun(Token,Acc),Stack}.
  
negative.code: 
  ff(What,Str) -> ff(What,Str,[]).
  
  ff(_Wht,<<>>,A)        -> {{text,lists:reverse(A)},"",eof};
  ff(_Wht,?m("<",Str),A) -> {{tag,""},Str,{text,lists:reverse(A)}};
  ff(What,?d(H,Str),A)   -> ff(What,Str,[H|A]).
  
  % ff(What,Str) ->
  %   case ff(Str,ff(What),[1,2]) of
  