home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!uknet!comlab.ox.ac.uk!oxuniv!popx
- From: popx@vax.oxford.ac.uk
- Newsgroups: comp.lang.prolog
- Subject: Re: pretty printer
- Message-ID: <1992Sep11.144020.8813@vax.oxford.ac.uk>
- Date: 11 Sep 92 13:40:19 GMT
- References: <1992Sep11.091413.676@tom.rz.uni-passau.de>
- Organization: Oxford University VAX 6620
- Lines: 42
-
- In article <1992Sep11.091413.676@tom.rz.uni-passau.de>, baier@forwiss.uni-passau.de (Joern Baier) writes:
- > Hi!
- >
- > As the subject says it I'm looking for a pretty printer.
- > It should read a source code and write it down in a nicer format.
- > It should also be able to deal with comments and keep the vaiable
- > names. I have been looking for it in the libraries but I think there is
- > nothing appropriate.
- >
- > Thanx in advance,
- > Joern
- > --
- > Joern Baier (baier@forwiss.uni-passau.de)
- >
- I don't have a complete pretty-printer. However, the code that comes
- with my "Logic Programming Tutor" includes some of what you need to
- build one. There's a set of predicates (SDO.PL and SDO_OUTPUT.PL) which
- read the grammar of a language in a notation that's like DCGs augmented
- with formatting commands and generate Prolog predicates from it. Portability
- note: you'll need to be able to 'write' into lists or other structures.
-
- There's also a tokeniser and parser, built from the Richard O'Keefe one
- that comes with the Dec-10 library. This can read variable names. It ignores
- comments, but you could make it capture them and return them hooked
- onto the term in some way. I'm not sure what the best way to represent
- a term augmented in this way would be.
-
- You can FTP the code from packages/prolog-pd-software/tutor.tar.Z at
- src.doc.ic.ac.uk . It's a compressed TAR file, so fetch it in binary
- mode, and decompress then untar before using.
-
- If you do build a pretty-printer from these predicates, please send me
- a copy of it.
-
-
- General note: the library contains a lot of other code. See README in the
- aforenamed directory for a short list, CATALOGUE for a long one.
- I would like more contributions: the number I've been offered so far is
- very low compared with the amount of Prolog code that exists.
-
-
- Jocelyn Paine
-