[mercury-users] More: lex and moose together

Fergus Henderson fjh at cs.mu.OZ.AU
Sat Jan 11 04:12:30 AEDT 2003

On 10-Jan-2003, Ondrej Bojar <oboj7042 at ss1000.ms.mff.cuni.cz> wrote:
> On Fri, 10 Jan 2003, Ondrej Bojar wrote:
> > I've searched the archives and found only some discussion on this in
> > summer 2001, and a diff to patch moose by Holger Krug
> > (http://www.cs.mu.oz.au/research/mercury/mailing-lists/mercury-developers/mercury-developers.0109/0005.html).
> >
> > The diff is too old for the extras-rotd-2002-12-01/moose, so I'll have to
> > revert to an older moose.
> I obtained moose of 2001-08-01 (cvs upd -D 2001-08-01 ...) and applied the
> patch. Moose (patched for -u, unique mode for parser state) got compiled
> correctly, but none of the samples work:
> ../moose alpha.moo
> alpha.moo:49: In production for factor/1,
> alpha.moo:49:   the nonterminal [|]/2 is undeclared.

This is probably due to the fact that we changed the way "[X|Y]" is
parsed -- it now gets parsed as '[|]'(X, Y), whereas
previously it used to get parsed as '.'(X, Y).

The new version of Moose has been patched to make it work
with the new Mercury standard library.  But the old version
of Moose that you're using has not, and thus it doesn't work.

Try "fgrep '[|]' moose/*.m" on a recent version of Moose,
and you will see the lines that changed.

If you want to apply the patch, the best way is to start with what
you've done so far, i.e. take the old version of moose from CVS and
apply the patch, but then do `cvs update -A' to incorporate all of
our recent changes.  This may result in some conflicts, which will
be marked with <<< and >>> in the source.  You can look at those
and figure out how to resolve them.  

Then, post the diff to mercury-reviews at cs.mu.oz.au, and if the response
is positive, commit the change to the repository!

Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
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