[mercury-users] Handy Programming tool for Mercury.

Richard A. O'Keefe ok at atlas.otago.ac.nz
Fri May 21 13:05:45 AEST 1999


Someone wrote:
	> If I/someone eventually gets around to providing a decent generic
	> parsing module then the next version will probably be in Mercury.
	
David Jeffery replied:
	This would be a very worthwhile exercise.  It is pretty
	important, I think, that we are able to write tools like this in
	Mercury.
	
	Design, anyone?

I'm baffled.  The only parsing notations I know that come close to DCGs
for power and convenience are close relatives.  I've used, heck, I've
even _taught_, parser combinators in Haskell, and they seem to me to
be (a) clumsy compared with DCGs, and (b) essentially dependent on lazy
evaluation.  I've used, and taught, Yacc.  If you look around, you'll
find that most functional languages (ML, Lisp, even Erlang) have some
kind of Yacc clone available, but with the usual Yacc-ish clusmy error
handling.  If you want a more powerful technique than Yacc's, there's
the potentially-infinite-lookahead method used in PCCTS.  But there
again we are talking about attributed grammars which are really just
a restriction of DCGs.  The only thing different is the execution
strategy.

It seems to me that if you want a superb parsing kit for Mercury,
you don't need any new *notation*, but you *might* need an alternative
execution strategy (I have a fondness for left-corner parsing, but
there are plenty of others) and you will do well to think about
error recovery (I lack Backhouse's stuff, but that's a bit old by now
so I suppose there's something better).

--------------------------------------------------------------------------
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