[mercury-users] Leveraging Perl

Tomas By T.By at dcs.shef.ac.uk
Wed May 2 09:31:44 AEST 2001


Richard A. O'Keefe writes:
> By far the simplest way to [read HTML] would be to use SWI Prolog, with its
> SGML parser that lets you slurp in HTML or most other SGML applications
> (*not* just XML) as a Prolog data structure and then process it as a tree.
> 
> I would far rather write something like
> 
>     desendant(element(table,_,Rows), Document),
>     member(element(tr,_,[element(th,_,['Paris'])|ParisInfo]), Rows)
> 
> than any analogous Perl text.  SOmeone really should port the SWI SGML
> parser (there's a C core that does everything plus glue to adapt it to
> SWI Prolog) to Mercury.

My Mercury XML parser has a very similar interface, and is quite fast
(since it does not use higher order combinators - lesson here)

ftp://ftp.dcs.shef.ac.uk/home/tomas/xml-0.5.zip
(see also ftp://ftp.dcs.shef.ac.uk/home/tomas/xml.ps)

No need to port the SWI prolog parser IMHO - somebody just need to
write documentation for mine. I'd do it if I had the time.

/Tomas
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list