[m-rev.] diff: fix top-level compilation of the extras distribution

Julien Fischer juliensf at csse.unimelb.edu.au
Tue Aug 2 15:12:43 AEST 2011


Branches: main, 11.07

Fix top-level invocations of mmake in the extras distribution.  They were
breaking because the lex subdirectory didn't have an Mmakefile.  (It uses
mmc --make and a normal Makefile instead.)

Make more of the extras distribution build from the top-level.

extras/lex/Mmakefile:
 	Add an Mmakefile that contains the targets required by the top-level
 	extras distribution Mmakefile.  Each of the targets just forwards
 	the work to the actual Makefile.

extras/Mmakefile:
 	Update the list of things that won't compile ``out-of-the-box''.
 	(XXX we should use autoconf to configure these.)

 	Build the base64 encoding library, the fixed point arithmetic library
 	and the error utility by default.

extras/README:
 	Update the description of the lazy_evaluation subdirectory.

extras/base64/Makefile:
extras/base64/Mmakefile:
extras/base64/mercury_base64.m:
extars/base64/Mercury.options:
 	Build and install base64 as a library.  We use mmc --make, controlled
 	from a normal Makefile to do this and then put a forwarding Mmakefile
 	in place using so that compilation from the top-level of the extras
 	distribution works.  (One reason for doing this is that mmc --make
 	provides grade filtering capabilities which are needed here since
 	this library will only work in C grades.)

extras/base64/base64.m:
 	Avoid a compilation error: sizeof cannot be used on things with
 	an incomplete type.

extras/fixed/Makefile:
extras/fixed/Mmakefile:
extras/fixed/Mercury.options:
extras/fixed/mercury_fixed.m:
 	Build and install fixed as a library.  As with base64, use mmc --make
 	and add a forwarding Mmakefile.

extras/fixed/fixed.m:
 	Style and formatting fixes.

extras/lex/Makefile:
 	Add a realclean target

extras/lex/lex.lexeme.m:
 	Replace a call to a deprecated procedure.

Julien.

Index: extras/Mmakefile
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/extras/Mmakefile,v
retrieving revision 1.4
diff -u -r1.4 Mmakefile
--- extras/Mmakefile	20 Apr 2007 05:18:35 -0000	1.4
+++ extras/Mmakefile	2 Aug 2011 04:41:03 -0000
@@ -5,7 +5,7 @@
  #-----------------------------------------------------------------------------#
  #
  # This Mmakefile provides some targets for building and installing most
-# of the libraries in this `extras' distribution.
+# of the libraries and tools in this `extras' distribution.
  #
  # Note that not all subdirectories of `extras' are set up for
  # automatic installation.  This Mmakefile will only build those which are.
@@ -14,17 +14,33 @@
  # built by this Mmakefile, because they are often won't install
  # "out-of-the-box":
  #
-#	graphics 	you need to have tcl/tk or OpenGL installed
-#	morphine 	see morphine/README for instructions on how to install
-#	concurrency 	doesn't work in all compilation grades
-#	trailed_update 	doesn't work in all compilation grades
-#	logged_output 	requires a specially-configured Mercury installation
-#	odbc 		requires an ODBC driver be installed
-#	quickcheck 	no `install' target
-
-SUBDIRS = cgi complex_numbers curs curses dynamic_linking \
-	lazy_evaluation lex moose posix \
-	references windows_installer_generator xml
+#   curs			requires ncurses to be available
+#   curses			requires ncurses to be available
+#   graphics/easyx		requires Xlib to be available 
+#   graphics/mercury_allegro	see README file in that directory for details
+#   graphics/mercury_cairo	see README file in that directory for details
+#   graphics/mercury_glut	requires GLUT (or freeglut) to be available
+#   graphics/mercury_opengl	requires OpenGL to be available
+#   graphics/mercury_tcltk	requires Tcl/Tk to be available 
+#   morphine 		see morphine/README for instructions on how to install
+#   trailed_update 	doesn't work in all compilation grades
+#   lex			see the Makefile in that directory for details 
+#   logged_output 	requires a specially-configured Mercury installation
+#   odbc 		requires an ODBC driver be installed
+
+SUBDIRS = \
+	base64		\
+	cgi 		\
+	complex_numbers	\
+	dynamic_linking \
+	error		\
+	fixed		\
+	lex		\
+	moose		\
+	posix		\
+	references	\
+	windows_installer_generator \
+	xml

  MMAKEFLAGS =

Index: extras/README
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/extras/README,v
retrieving revision 1.28
diff -u -r1.28 README
--- extras/README	19 Dec 2010 06:25:32 -0000	1.28
+++ extras/README	1 Aug 2011 06:12:10 -0000
@@ -37,9 +37,8 @@
  		to Allegro/AllegroGL and a Mercury binding to Cairo.

  lazy_evaluation
-		A library module `lazy' containing support for optional
-		lazy evaluation in Mercury, together with some examples
-		of its use, including a module `lazy_list' that defines
+		Some examples of the use of the standard library's
+		`lazy' module, including a module `lazy_list' that defines
  		a lazy list data type.

  lex		A lexer package for Mercury that works over the I/O state,
Index: extras/base64/Makefile
===================================================================
RCS file: extras/base64/Makefile
diff -N extras/base64/Makefile
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ extras/base64/Makefile	2 Aug 2011 04:43:42 -0000
@@ -0,0 +1,22 @@
+#-----------------------------------------------------------------------------#
+# Copyright (C) 2011 The University of Melbourne.
+# This file may only be copied under the terms of the GNU Library General
+# Public License - see the file COPYING.LIB in the Mercury distribution.
+#-----------------------------------------------------------------------------#
+
+# Build the base64 encoder / decoder library using mmc --make.
+
+TARGET=mercury_base64
+
+.PHONY: build
+build:
+	mmc --make lib$(TARGET)
+
+.PHONY: install
+install:
+	mmc --make lib$(TARGET).install
+
+.PHONY: realclean
+realclean:
+	mmc --make $(TARGET).realclean
+	/bin/rm -rf Mercury
Index: extras/base64/Mercury.options
===================================================================
RCS file: extras/base64/Mercury.options
diff -N extras/base64/Mercury.options
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ extras/base64/Mercury.options	2 Aug 2011 04:44:30 -0000
@@ -0,0 +1,10 @@
+# The base64 module (currently) only provides a C implementation of the
+# encoder / decoder.  Compilation will fail if we attempt to build it
+# in a non-C grade.
+
+MCFLAGS += --libgrades-exclude-component java 
+MCFLAGS += --libgrades-exclude-component csharp
+MCFLAGS += --libgrades-exclude-component erlang
+
+MCFLAGS-mercury_base64 += --no-warn-nothing-exported
+MCFLAGS-mercury_base64 += --no-warn-interface-imports
Index: extras/base64/Mmakefile
===================================================================
RCS file: extras/base64/Mmakefile
diff -N extras/base64/Mmakefile
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ extras/base64/Mmakefile	2 Aug 2011 04:45:34 -0000
@@ -0,0 +1,30 @@
+#-----------------------------------------------------------------------------#
+# Copyright (C) 2011 The University of Melbourne.
+# This file may only be copied under the terms of the GNU Library General
+# Public License - see the file COPYING.LIB in the Mercury distribution.
+#-----------------------------------------------------------------------------#
+
+# This is file exists so that do an `mmake' from the top-level of the extras
+# distribution works.  The actual work of building this library is done
+# using the Makefile and mmc --make.  This file just fowards all the work
+# to there.
+
+MAIN_TARGET=build
+
+.PHONY: build
+build:
+	$(MAKE) build
+
+# The depend target does nothing, mmc --make will handle dependencies
+# automatically.
+#
+.PHONY: depend
+depend:
+
+.PHONY: install
+install:
+	$(MAKE) install INSTALL_PREFIX=$(INSTALL_PREFIX)/extras
+
+.PHONY: realclean
+realclean:
+	$(MAKE) realclean
Index: extras/base64/base64.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/extras/base64/base64.m,v
retrieving revision 1.2
diff -u -r1.2 base64.m
--- extras/base64/base64.m	17 Dec 2010 06:10:48 -0000	1.2
+++ extras/base64/base64.m	2 Aug 2011 04:45:06 -0000
@@ -59,13 +59,11 @@
  :- pragma foreign_decl("C", "
  #include <string.h>

-unsigned char alphabet[];
-
  ").

-:- pragma foreign_code("C", "
+:- pragma foreign_decl("C", local, "

-unsigned char alphabet[64] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";
+static unsigned char alphabet[64] = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";

  ").

@@ -73,7 +71,7 @@

  :- pragma foreign_proc("C",
      encode64(Data::in, Len::in, Base64::out),
-    [will_not_call_mercury, thread_safe, promise_pure],
+    [will_not_call_mercury, thread_safe, promise_pure, may_not_duplicate],
  "
      MR_Word base64_buff;
      char *base64_ptr;
@@ -143,7 +141,8 @@

  :- pragma foreign_proc("C",
      decode64(Base64::in, Data::out),
-    [will_not_call_mercury, thread_safe, promise_pure], "
+    [will_not_call_mercury, thread_safe, promise_pure, may_not_duplicate],
+"

      MR_Word data_buff;
      char *data_ptr;
Index: extras/base64/mercury_base64.m
===================================================================
RCS file: extras/base64/mercury_base64.m
diff -N extras/base64/mercury_base64.m
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ extras/base64/mercury_base64.m	1 Aug 2011 12:10:16 -0000
@@ -0,0 +1,4 @@
+:- module mercury_base64.
+:- interface.
+
+:- import_module base64.
Index: extras/fixed/Makefile
===================================================================
RCS file: extras/fixed/Makefile
diff -N extras/fixed/Makefile
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ extras/fixed/Makefile	2 Aug 2011 04:46:56 -0000
@@ -0,0 +1,23 @@
+#-----------------------------------------------------------------------------#
+# Copyright (C) 2011 The University of Melbourne.
+# This file may only be copied under the terms of the GNU Library General
+# Public License - see the file COPYING.LIB in the Mercury distribution.
+#-----------------------------------------------------------------------------#
+
+# Build the fixed point arithmetic library using mmc --make.
+
+TARGET=mercury_fixed
+
+
+.PHONY: build
+build:
+	mmc --make lib$(TARGET)
+
+.PHONY: install
+install:
+	mmc --make lib$(TARGET).install
+
+.PHONY: realclean
+realclean:
+	mmc --make $(TARGET).realclean
+	/bin/rm -rf Mercury
Index: extras/fixed/Mercury.options
===================================================================
RCS file: extras/fixed/Mercury.options
diff -N extras/fixed/Mercury.options
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ extras/fixed/Mercury.options	1 Aug 2011 11:16:22 -0000
@@ -0,0 +1 @@
+MCFLAGS-mercury_fixed = --no-warn-nothing-exported
Index: extras/fixed/Mmakefile
===================================================================
RCS file: extras/fixed/Mmakefile
diff -N extras/fixed/Mmakefile
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ extras/fixed/Mmakefile	2 Aug 2011 04:45:47 -0000
@@ -0,0 +1,29 @@
+#-----------------------------------------------------------------------------#
+# Copyright (C) 2011 The University of Melbourne.
+# This file may only be copied under the terms of the GNU Library General
+# Public License - see the file COPYING.LIB in the Mercury distribution.
+#-----------------------------------------------------------------------------#
+
+# This is file exists so that do an `mmake' from the top-level of the extras
+# distribution works.  The actual work of building this library is done
+# using the Makefile and mmc --make.  This file just fowards all the work
+# to there.
+
+MAIN_TARGET=build
+
+.PHONY: build
+build:
+	$(MAKE) build INSTALL_PREFIX=$(INSTALL_PREFIX)/extras
+
+# The depend target does nothing, mmc --make will handle that for us.
+#
+.PHONY: depend
+depend:
+
+.PHONY: install
+install:
+	$(MAKE) install INSTALL_PREFIX=$(INSTALL_PREFIX)/extras
+
+.PHONY: realclean
+realclean:
+	$(MAKE) realclean
Index: extras/fixed/fixed.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/extras/fixed/fixed.m,v
retrieving revision 1.1
diff -u -r1.1 fixed.m
--- extras/fixed/fixed.m	10 Nov 2006 03:13:15 -0000	1.1
+++ extras/fixed/fixed.m	2 Aug 2011 04:47:11 -0000
@@ -1,8 +1,10 @@
-%---------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
+% vim: ft=mercury ts=4 sw=4 et
+%-----------------------------------------------------------------------------%
  % Copyright (C) 2006 The University of Melbourne.
  % This file may only be copied under the terms of the GNU Library General
  % Public License - see the file COPYING.LIB in the Mercury distribution.
-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
  %
  % File: fixed.m
  % Author: Peter Ross <pro at missioncriticalit.com>
@@ -10,90 +12,76 @@
  % Implementation of fixed point arithmetic which is equivalent to cobol
  % fixed point arithmetic.
  %
-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%

  :- module fixed.
-
  :- interface.

-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%

-    %
      % Represents a fixed point number at some given precision.
      %
  :- type fixed.

-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%

  :- func - fixed = fixed.
  :- func fixed + fixed = fixed.
  :- func fixed - fixed = fixed.
  :- func fixed * fixed = fixed.

-    %
      % div(MinP, A, B) is A / B where the result has
      % to have at least a precision MinP.
      %
  :- func div(int, fixed, fixed) = fixed.

-    % increase or decrease the precision of the given fixed.
+    % Increase or decrease the precision of the given fixed.
      % We decrease the precision by truncating the result.
+    %
  :- func precision(int, fixed) = fixed.

-    %
      % Return the integer part of the fixed point number.
      %
  :- func to_int(fixed) = int.

-    %
      % Given a fixed return the floating point number
      % which represents that fixed point number.
      %
  :- func to_float(fixed) = float.

-    %
      % truncate(P, F) truncates the number, F, to precision, P.
      %
  :- func truncate(int, fixed) = fixed.

-    %
      % round(P, F) rounds the number, F, to precision, P.
      %
  :- func round(int, fixed) = fixed.

-    %
      % Is the given floating point number equal to zero?
      %
  :- pred is_zero(fixed::in) is semidet.

-    %
      % Determine the precision with which the given number
      % is stored.
      %
  :- func fixed_precision(fixed) = int.

-    %
      % Compare two fixed point numbers.
      %
  :- func compare_fixed(fixed::in, fixed::in) = (comparison_result::uo) is det.

-    %
-    % Get the fractional part of a fixed point number as
-    % a string.
+    % Get the fractional part of a fixed point number as a string.
      %
  :- func get_fraction_part_string(fixed) = string.

-    %
-    % Get the integral part of a fixed point number as
-    % a string.
+    % Get the integral part of a fixed point number as % a string.
      %
  :- func get_whole_part_string(fixed) = string.

  %------------------------------------------------------------------------------%
-
-    %
-    % Comparison operators for fixed point numbers
-    %
+%
+% Comparison operators for fixed point numbers.
+%

  :- pred (fixed::in) == (fixed::in) is semidet.
  :- pred (fixed::in) \== (fixed::in) is semidet.
@@ -106,7 +94,7 @@
  %------------------------------------------------------------------------------%

  :- typeclass fixed(T) where [
-        % Return the fixed point representation of T, with the suppiled
+        % Return the fixed point representation of T, with the supplied
          % precision
      func to_fixed(int, T) = fixed
  ].
@@ -119,12 +107,10 @@
      % The string is truncated.
  :- instance fixed(string).

-    %
      % Output a fixed point number as a string.
      %
  :- func to_string(fixed) = string.

-    %
      % Given a string, return the fixed which represents that string.
      %
  :- func to_fixed(string) = fixed.
@@ -134,7 +120,15 @@

  :- implementation.

-:- import_module char, int, integer, list, require, string, float.
+:- import_module char.
+:- import_module float.
+:- import_module int.
+:- import_module integer.
+:- import_module list.
+:- import_module require.
+:- import_module string.
+
+%------------------------------------------------------------------------------%

  :- type fixed
      --->    fixed(
@@ -148,15 +142,18 @@

  X + Y = fixed(P, A + B) :-
      compare(Result, X ^ precision, Y ^ precision),
-    ( Result = (<),
+    (
+        Result = (<),
          P = Y ^ precision,
          A = precision(P, X) ^ number,
          B = Y ^ number
-    ; Result = (=),
+    ;
+        Result = (=),
          P = X ^ precision,
          A = X ^ number,
          B = Y ^ number
-    ; Result = (>),
+    ;
+        Result = (>),
          P = X ^ precision,
          A = X ^ number,
          B = precision(P, Y) ^ number
@@ -164,15 +161,18 @@

  X - Y = fixed(P, A - B) :-
      compare(Result, X ^ precision, Y ^ precision),
-    ( Result = (<),
+    (
+        Result = (<),
          P = Y ^ precision,
          A = precision(P, X) ^ number,
          B = Y ^ number
-    ; Result = (=),
+    ;
+        Result = (=),
          P = X ^ precision,
          A = X ^ number,
          B = Y ^ number
-    ; Result = (>),
+    ;
+        Result = (>),
          P = X ^ precision,
          A = X ^ number,
          B = precision(P, Y) ^ number
@@ -190,7 +190,6 @@
          N = X ^ number // Y ^ number
      ).

-
  precision(DesiredP, fixed(ActualP, N0)) = fixed(DesiredP, N) :-
      compare(Result, DesiredP, ActualP),
      ( Result = (<),
@@ -209,24 +208,28 @@

  round(DesiredP, fixed(ActualP, N0)) = fixed(DesiredP, N) :-
      compare(Result, DesiredP, ActualP),
-    ( Result = (<),
+    (
+        Result = (<),
          Scale = scale(ActualP - DesiredP),
          Rem = N0 rem Scale,
          ( Rem << 1 >= Scale ->
-            N = N0 // Scale + integer__one
+            N = N0 // Scale + integer.one
          ;
              N = N0 // Scale
          )
-    ; Result = (=),
+    ;
+        Result = (=),
          N = N0
-    ; Result = (>),
+    ;
+        Result = (>),
          N = N0 * scale(DesiredP - ActualP)
      ).

- 
-is_zero(N) :- N ^ number = integer__zero.
+is_zero(N) :-
+    N ^ number = integer.zero.

  fixed_precision(N) = N ^ precision.
+
  %------------------------------------------------------------------------------%

  X == Y :-
@@ -259,40 +262,41 @@
      ; Result = (=)
      ).

-
  compare_fixed(X, Y) = Result :-
      Z = (X - Y) ^ number,
-    ( Z < integer__zero ->
+    ( Z < integer.zero ->
          Result = (<)
-    ; Z = integer__zero ->
+    ; Z = integer.zero ->
          Result = (=)
      ;
          Result = (>)
      ).

-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%

  :- instance fixed(int) where [
      to_fixed(N, I) = fixed(N, integer(I) * (integer(10) `pow` integer(N)))
  ].
+
  :- instance fixed(float) where [
-    to_fixed(N, F) = to_fixed(N, string__format(Spec, [f(F)])) :-
-    Spec = string__format("%%.%df", [i(N)])
+    to_fixed(N, F) = to_fixed(N, string.format(Spec, [f(F)])) :-
+    Spec = string.format("%%.%df", [i(N)])
  ].
+
  :- instance fixed(string) where [
      to_fixed(N, S) = fixed(N, scaled_integer(N, S))
  ].

-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%

  to_string(fixed(N, Int)) = Str :-
      ( N = 0 ->
-        Str = integer__to_string(Int)
+        Str = integer.to_string(Int)
      ;
-        Cs0 = to_char_list(integer__to_string(Int)),
+        Cs0 = to_char_list(integer.to_string(Int)),
          insert_decimal_point(N, Cs0, P, Cs1),
          ( N >= P ->
-            Cs = ['0', '.'] ++ list__duplicate(N - P, '0') ++ Cs1
+            Cs = ['0', '.'] ++ list.duplicate(N - P, '0') ++ Cs1
          ;
              Cs = Cs1
          ),
@@ -300,7 +304,7 @@
      ).

  :- pred insert_decimal_point(int::in, list(char)::in,
-                int::out, list(char)::out) is det.
+    int::out, list(char)::out) is det.

  insert_decimal_point(_, [], 0, []).
  insert_decimal_point(N, [C|Cs], P+1, L) :-
@@ -311,15 +315,14 @@
          L = [C | L0]
      ).

-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%

  to_int(F) = int(I) :- fixed(_, I) = precision(0, F).

  to_float(fixed(P, N)) = float(N) / pow(10.0, P).

-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%

-    %
      % Deterministic version of scaled_integer which throws an error, instead
      % of failing.
      %
@@ -332,7 +335,6 @@
          func_error("scaled_integer: " ++ Str)
      ).

-    %
      % scaled_integer(N, S, SI) is true iff
      % SI is a scaled integer which represents the string, S, as a fixed
      % point number of order N.
@@ -358,13 +360,13 @@


  :- pred scaled_integer(int::in, list(char)::in,
-                integer::in, integer::out) is semidet.
+    integer::in, integer::out) is semidet.

  scaled_integer(N, [], A0, A) :-
      A = A0 * scale(N).
  scaled_integer(N, [C|Cs], A0, A) :-
      ( C = ('.') ->
-        L = list__take_upto(N, Cs),
+        L = list.take_upto(N, Cs),
          fraction(L, A0, A1),
          A = A1 * (integer(10) `pow` integer(N - length(L)))
      ;
@@ -392,8 +394,8 @@
  char_to_int('8', 8).
  char_to_int('9', 9).

-%------------------------------------------------------------------------------%
-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%

  :- import_module maybe.

@@ -418,22 +420,23 @@
          error("to_fixed: " ++ Str)
      ).

-:- pred parse_fixed(list(char)::in, integer::in, integer::out, maybe(int)::in, int::out) is semidet.
+:- pred parse_fixed(list(char)::in, integer::in, integer::out,
+    maybe(int)::in, int::out) is semidet.

  parse_fixed([], I, I, no, 0).
  parse_fixed([], I, I, yes(P), P).
-parse_fixed([C|Cs], I0, I, no, P) :-
+parse_fixed([C | Cs], I0, I, no, P) :-
      ( C = ('.') ->
          parse_fixed(Cs, I0, I, yes(0), P)
      ;
          char_to_int(C, CInt),
          parse_fixed(Cs, integer(10) * I0 + integer(CInt), I, no, P)
      ).
-parse_fixed([C|Cs], I0, I, yes(P0), P) :-
+parse_fixed([C | Cs], I0, I, yes(P0), P) :-
      char_to_int(C, CInt),
-    parse_fixed(Cs, integer(10) * I0 + integer(CInt), I, yes(P0+1), P).
+    parse_fixed(Cs, integer(10) * I0 + integer(CInt), I, yes(P0 + 1), P).

-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%

  get_fraction_part_string(fixed(Precision, N)) = FracStr :-
      FracPart = N mod pow(integer(10), integer(Precision)),
@@ -443,7 +446,6 @@
      WholePart = N div pow(integer(10), integer(Precision)),
      WholeStr = to_string(WholePart).

-%------------------------------------------------------------------------------%
-%------------------------------------------------------------------------------%
-%------------------------------------------------------------------------------%
-% vim: ft=mercury ts=4 sw=4 et
+%-----------------------------------------------------------------------------%
+:- end_module fixed.
+%-----------------------------------------------------------------------------%
Index: extras/fixed/mercury_fixed.m
===================================================================
RCS file: extras/fixed/mercury_fixed.m
diff -N extras/fixed/mercury_fixed.m
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ extras/fixed/mercury_fixed.m	1 Aug 2011 11:46:30 -0000
@@ -0,0 +1,10 @@
+%-----------------------------------------------------------------------------%
+% vim: ft=mercury ts=4 sw=4 et
+%-----------------------------------------------------------------------------%
+% Copyright (C) 2011 The University of Melbourne.
+% This file may only be copied under the terms of the GNU Library General
+% Public License - see the file COPYING.LIB in the Mercury distribution.
+%-----------------------------------------------------------------------------%
+
+:- module mercury_fixed.
+:- import_module fixed.
Index: extras/lex/Makefile
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/extras/lex/Makefile,v
retrieving revision 1.1
diff -u -r1.1 Makefile
--- extras/lex/Makefile	2 Mar 2007 03:55:52 -0000	1.1
+++ extras/lex/Makefile	1 Aug 2011 12:04:50 -0000
@@ -27,7 +27,7 @@

  MAIN_TARGET = all

-.PHONY: all install check
+.PHONY: all install check realclean

  all: liblex.compile libregex.compile

@@ -44,5 +44,10 @@
  %.install:
  	mmc --make $(LIBGRADES_FLAGS) --install-prefix $(INSTALL_PREFIX) $@

+%.realclean:
+	mmc --make lex.realclean
+	mmc --make regex.realclean
+	/bin/rm -rf Mercury
+
  check: install
  	(cd tests; mmake check)
Index: extras/lex/Mmakefile
===================================================================
RCS file: extras/lex/Mmakefile
diff -N extras/lex/Mmakefile
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ extras/lex/Mmakefile	2 Aug 2011 05:08:02 -0000
@@ -0,0 +1,29 @@
+#-----------------------------------------------------------------------------#
+# Copyright (C) 2011 The University of Melbourne.
+# This file may only be copied under the terms of the GNU Library General
+# Public License - see the file COPYING.LIB in the Mercury distribution.
+#-----------------------------------------------------------------------------#
+
+# This is file exists so that do an `mmake' from the top-level of the extras
+# distribution works.  The actual work of building this library is done
+# using the Makefile and mmc --make.  This file just fowards all the work
+# to there.
+
+MAIN_TARGET = build
+
+.PHONY: build
+build:
+	$(MAKE) all
+
+# Do nothing, mmc --make will handle this for us.
+#
+.PHONY: depend
+depend:
+
+.PHONY: install
+install:
+	$(MAKE) install INSTALL_PREFIX=$(INSTALL_PREFIX)/extras
+
+.PHONY: realclean
+realclean:
+	$(MAKE) realclean
Index: extras/lex/lex.lexeme.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/extras/lex/lex.lexeme.m,v
retrieving revision 1.6
diff -u -r1.6 lex.lexeme.m
--- extras/lex/lex.lexeme.m	10 Jan 2011 04:32:25 -0000	1.6
+++ extras/lex/lex.lexeme.m	1 Aug 2011 12:00:27 -0000
@@ -99,7 +99,7 @@
      StopStates     = DFA ^ smc_stop_states,
      Transitions    = DFA ^ smc_state_transitions,
      N              = 1 + find_top_state(Transitions),
-    Accepting      = set_accepting_states(StopStates, bitmap.new(N, no)),
+    Accepting      = set_accepting_states(StopStates, bitmap.init(N, no)),
      Rows           = array(set_up_rows(0, N, Transitions)),
      TransitionMap  = transition_map(Accepting, Rows),
      CompiledLexeme = compiled_lexeme(TokenCreator, StartState, TransitionMap).

--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list