[mercury-users] Handy Programming tool for Mercury.

Paul Massey pma at miscrit.be
Thu May 20 19:33:48 AEST 1999


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

I've got a tool which also does something similar (written
in mercury and called mmproto which I've been using for
approx. 2 years or so). The previous version looked for

:- type record ---> record(Type1,Type1,Type2).

in a source file and generated accessors/constructors, plus
a load of other routines which I needed regularly.

I'm currently rewriting this tool because I needed something
a little more flexible. We want to generate COM interface
code and hard-coding a probably changing spec would be
tedious ....

The new version has a little meta-language (untyped) which
describes the manipulates I would like to make to the tree
like structure. This is "sort of" based on ideas from
XML/XSL although the rules obviously doesn't look anything
like XSL rules.

In the new version one of the rulefiles will look for
instances of:

     :- record(name(Label::Type,....)).

in a source file and will generate the appropriate code (As
I understand it this is something like the form which would
be understood by the Mercury compiler itself if Melbourne
could decide on an operator to use?).

My main problem at present is that some of the "operators"
are not correctly defined (as I see it). I'm planning on
making mmproto (v0.2) available sometime soon (the older
version is around somewhere for those who asked for the
networking library)...

Yours,

Paul.

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