Commit Graph

25 Commits

Author SHA1 Message Date
Zoltan Somogyi
9b6390b17e Bring the programming style of extras up to date.
extras/curs/curs.m:
extras/curs/curs.panel.m:
    Make panel a separate submodule of curs, not a nested submodule.

extras/base64/base64.m:
extras/curses/mcurses.basics.m:
extras/curses/mcurses.m:
extras/curses/mcurses.misc.m:
extras/curses/mcurses.user.m:
extras/gator/evolve.m:
extras/gator/genotype.m:
extras/gator/phenotype.m:
extras/gator/tausworthe3.m:
extras/monte/dots.m:
extras/monte/geom.m:
extras/monte/hg.m:
extras/monte/monte.m:
extras/monte/rnd.m:
extras/moose/grammar.m:
extras/moose/moose.m:
extras/mopenssl/mopenssl.m:
extras/net/echo.m:
extras/net/errno.m:
extras/net/getaddrinfo.m:
extras/net/net.m:
extras/net/netdb.m:
extras/net/sockets.m:
extras/net/streams.m:
extras/net/tcp.m:
extras/net/test_lookups.m:
extras/net/types.m:
extras/odbc/odbc.m:
extras/odbc/odbc_test.m:
extras/references/README:
extras/references/reference.m:
extras/references/scoped_update.m:
extras/solver_types/library/any.m:
extras/solver_types/library/any_array.m:
extras/solver_types/library/any_assoc_list.m:
extras/solver_types/library/any_list.m:
extras/solver_types/library/any_map.m:
extras/solver_types/library/any_tree234.m:
extras/solver_types/library/any_util.m:
extras/trail/trail.m:
extras/trailed_update/samples/interpreter.m:
extras/trailed_update/samples/vqueens.m:
extras/trailed_update/tests/var_test.m:
extras/trailed_update/tr_array.m:
extras/trailed_update/tr_store.m:
extras/trailed_update/trailed_update.m:
extras/trailed_update/unsafe.m:
extras/trailed_update/var.m:
    Bring programming style up to date.
2023-03-30 21:48:10 +11:00
Julien Fischer
4099cca890 Minor cleanups for moose.
extras/moose/*.m:
    As above.
2022-04-18 00:00:09 +10:00
Julien Fischer
6f57bd81e7 Fix an issue with moose.
extras/moose/moose.m:
    Emit an import of the string module since the generated code
    contains calls to string.format.

    Omit the import of std_util from the generated code as that is
    no longer required.

extras/moose/samples/cgram.moo:
    We no longer need to import the string module here.

extras/moose/tests/array_based.moo:
    Syntax and formatting cleanup
2022-03-20 20:06:39 +11:00
Julien Fischer
b863e8bf52 Fix a bug in moose.
extras/moose/moose.m:
    Fix an invalid conversion specifier in a call to string.format
    in the generated code.

extras/moose/samples/alpha.moo:
extras/moose/samples/cgram.moo:
extras/moose/samples/expr.moo:
extras/moose/samples/small.moo:
    Fix compilation problems.

    Clean-up and update syntax.
2022-03-20 17:05:31 +11:00
Julien Fischer
aa5c8f8d65 Fix compilation of extras/moose.
extras/moose/mercury_syntax.m:
    Import the mercury_term_parser modules.

extras/moose/moose.m:
    Replace calls to io.see etc.  (Using explicit stream arguments
    would be better, but is future work.)

extras/moose/tests/array_based.moo:
    Replace a call to a deleted predicate.
2022-03-06 02:40:33 +11:00
Julien Fischer
fe2bc584de Fix compilation of moose.
extras/moose/moose.m:
   Conform to recent changes in the names of the statistics
   reporting predicates.
2021-04-17 00:35:10 +10:00
Zoltan Somogyi
031c7194cd Bring moose's programming style up to date. 2020-05-17 22:59:13 +10:00
Julien Fischer
a67f19dc9d Fix compilation of extras/moose.
extras/moose/moose.m:
    Conform with a name change in the library.
2018-06-28 03:26:23 +10:00
Julien Fischer
e6e295a3cc Generalise the representation of integers in the term module.
In preparation for supporting uint literals and literals for the fixed size
integer types, generalise the representation of integers in the term module, so
that for every integer literal we record its base, value (as an arbitrary
precision integer), signedness and size (the latter two based on the literal's
suffix or lack thereof).

Have the lexer attach information about the integer base to machine sized ints;
we already did this for the 'big_integer' alternative but not the normal one.
In conjunction with the first change, this fixes a problem where the compiler
was accepting non-decimal integers in like arity specifications.  (The
resulting error messages could be improved, but that's a separate change.)

Support uints in more places; mark other places which require further work with
XXX UINT.

library/term.m:
     Generalise the representation of integer terms so that we can store
     the base, signedness and size of a integer along with its value.
     In the new design the value is always stored as an arbitrary precision
     integer so we no longer require the big_integer/2 alternative; delete it.

     Add some utility predicates that make it easier to work with integer terms.

library/term_conversion.m:
library/term_io.m:
     Conform to the above changes,

     Add missing handling for uints in some spots; add XXX UINT comments
     in others -- these will be addressed later.

library/lexer.m:
     Record the base of word sized integer literals.

library/parser.m:
compiler/analysis_file.m:
compiler/fact_table.m:
compiler/get_dependencies.m:
compiler/hlds_out_goal.m:
compiler/hlds_out_util.m:
compiler/intermod.m:
compiler/make.module_dep_file.m:
compiler/parse_class.m:
compiler/parse_inst_mode_name.m:
compiler/parse_item.m:
compiler/parse_pragma.m:
compiler/parse_sym_name.m:
compiler/parse_tree_out_term.m:
compiler/parse_tree_to_term.m:
compiler/parse_type_defn.m:
compiler/parse_util.m:
compiler/prog_ctgc.m:
compiler/prog_util.m:
compiler/recompilation.check.m:
compiler/recompilation.version.m:
compiler/superhomogeneous.m:
mdbcomp/trace_counts.m:
samples/calculator2.m:
extras/moose/moose.m:
    Conform to the above changes.

tests/hard_coded/impl_def_lex.exp:
tests/hard_coded/impl_def_lex_string.exp:
tests/hard_coded/lexer_bigint.exp*:
tests/hard_coded/lexer_zero.exp*:
tests/hard_coded/parse_number_from_string.exp*:
tests/hard_coded/term_to_unit_test.exp:
    Update these expected outputs.
2017-04-22 11:53:14 +10:00
Matthias Güdemann
ef26c238bb Fix moose for more accurate mode checker.
This fixes `write_goto_table/4` in extras/moose/moose.m for the moose
parser generator. The more accurate mode checker requires a more
specific instantiatedness than `ground` for the generated `goto%s/2`
predicates.
2015-06-16 17:22:50 +01:00
Julien Fischer
9ae7fe6b70 Change the argument ordering of predicates in the set module.
Branches: main

Change the argument ordering of predicates in the set module.

library/set.m:
	Change predicate argument orders to match the versions
	in the svset module.

	Group function definitions with the corresponding predicates
	rather than at the end of the file.

	Delete Ralph's comments regarding the argument order in the
	module interface: readers of the library reference guide are
	unlikely to be interested in his opinion of the argument ordering
	ten or so years ago.

	Add extra modes for set.map/3 and set.map_fold/5.

library/svset.m:
library/eqvclass.m:
library/tree234.m:
library/varset.m:
browser/*.m:
compiler/*.m:
deep_profiler/*.m:
mdbcomp/trace_counts.m:
extras/moose/grammar.m:
extras/moose/lalr.m:
extras/moose/moose.m:
tests/hard_coded/bitset_tester.m:
	Conform to the above change.

NEWS:
	Announce the above changes.
2011-05-06 05:03:29 +00:00
Julien Fischer
9f68c330f0 Change the argument order of many of the predicates in the map, bimap, and
Branches: main

Change the argument order of many of the predicates in the map, bimap, and
multi_map modules so they are more conducive to the use of state variable
notation, i.e. make the order the same as in the sv* modules.

Prepare for the deprecation of the sv{bimap,map,multi_map} modules by
removing their use throughout the system.

library/bimap.m:
library/map.m:
library/multi_map.m:
	As above.
NEWS:
	Announce the change.

	Separate out the "highlights" from the "detailed listing" for
	the post-11.01 NEWS.

	Reorganise the announcement of the Unicode support.

benchmarks/*/*.m:
browser/*.m:
compiler/*.m:
deep_profiler/*.m:
extras/*/*.m:
mdbcomp/*.m:
profiler/*.m:
tests/*/*.m:
ssdb/*.m:
samples/*/*.m
slice/*.m:
	Conform to the above change.

	Remove any dependencies on the sv{bimap,map,multi_map} modules.
2011-05-03 04:35:04 +00:00
Julien Fischer
144145573e Don't use "cute" operator overloadings in moose - this allows us to compile it
Branches: main, 11.01

Don't use "cute" operator overloadings in moose - this allows us to compile it
with the non-C backends, some of which don't currently do the name mangling
which would otherwise be required.

Make the moose samples work again.

extras/moose/misc.m:
	Delete this module -- overloading operators in this way was
	never a particuarly good idea, especially as several of the
	overloaded operators (now) mean other things in Mercury.

extras/moose/check.m:
extras/moose/grammar.m:
extras/moose/lalr.m:
extras/moose/mercury_syntax.m:
extras/moose/moose.m:
extras/moose/tables.m:
	Conform to the above changes.

	Import each module on its own line.

extras/moose/options.m:
	As above.

	Use the "multi" form of the option_ops type.

extras/moose/samples/try_alpha.m:
extras/moose/samples/try_expr.m:
	Make these examples work again -- as written the typeclass
	instance they contain does not satisfy the current restrictions
	on the form of instance arguments.

	Syntax and formatting cleanups.
2011-01-18 13:03:59 +00:00
Paul Bone
326e5c640d Corrected a bug in moose whereby it failed to return a non-zero exit code when
Estimated hours taken: 1

Corrected a bug in moose whereby it failed to return a non-zero exit code when
a critical error occured.

Converted moose to modern syntax with regard to DCGs and State Variables and
module delimters such as '__' vs '.'.  Converted some indentation to four
spaces.

extras/moose/check.m:
extras/moose/grammar.m:
extras/moose/lalr.m:
extras/moose/mercury_syntax.m:
extras/moose/misc.m:
extras/moose/moose.m:
extras/moose/options.m:
extras/moose/tables.m:
	As above.

extras/moose/BUGS
	Noted a new bug.

extras/moose/TODO
	Corrected a spelling mistake.
2009-02-21 11:27:54 +00:00
Julien Fischer
0e5f9d1d1d Conform to recent stdlib changes.
Estimated hours taken: 0.1
Branches: main

Conform to recent stdlib changes.

extras/moose/mercury_syntax.m:
extras/moose/moose.m:
	Conform to the recent change change in the representation
	of variables in the term module.
2006-12-05 06:40:03 +00:00
Julien Fischer
9fb4f15dfc Fix compilation problems in the extras distribution caused by recent
Estimated hours taken: 0.5
Branches: main

Fix compilation problems in the extras distribution caused by recent
changes.

extras/stream/stream.m:
	Provide a definition for the type stream/1.

extras/*/*.m:
	Conform to the recent changes to the standard library.
2006-03-30 01:21:20 +00:00
Fergus Henderson
f3f02edec1 Fix a bug introduced by petr's last change: put back the
Estimated hours taken: 1
Branches: main

extras/moose/moose.m:
	Fix a bug introduced by petr's last change: put back the
	`:- import_module list.' declaration, since it is needed for
	the references to `[]', `[|]', `list', and `list_skel'.
	But put it back in the implementation section rather than in
	the interface section, because it is not needed by the interface.

extras/moose/tests/Mmakefile:
extras/moose/tests/array_based.moo:
	Add a regression test.
2004-02-24 00:40:00 +00:00
Peter Ross
1efd65f7cf Remove an unnecessary import_module in the generated code.
Estimated hours taken: 0.1
Branches: main

extras/moose/moose.m:
	Remove an unnecessary import_module in the generated code.
2004-02-23 16:23:51 +00:00
Julien Fischer
d4aec6ecc4 This change doesn't alter any functionality.
Estimated hours taken 5:
Branches: main.

This change doesn't alter any functionality.  It just cleans up some
notation and (hopefully) makes things a little easier to modify in the
future.

The changes are:
	- Remove instances of `:' as a module qualifier.
	- Add more module qualifiers.
	- Use state variables for threading the IO state.
	- Use state variables for accumulators.
	- Remove some unused predicates.

extras/moose/check.m:
extras/moose/lalr.m:
extras/moose/mercury_syntax.m:
extras/moose/moose.m:
extras/moose/options.m:
extras/moose/tables.m:
	Changes to notation as listed above.

extras/moose/grammar.m:
	Replace calls to predicate grammar.foldl/4 with calls to
	function array.foldl/3 from standard library.  Delete grammar.foldl/4.
	Other changes as above.

extras/moose/misc.m:
	Remove predicate between/3 since it isn't used anywhere.
	Other changes as above.
2003-07-16 07:16:03 +00:00
Julien Fischer
a9d249407b Fix moose so that it compiles successfully with intermodule-optimization
Estimated hours taken: 0.5
Branches: main

Fix moose so that it compiles successfully with intermodule-optimization
enabled.

extras/moose/check.m:
extras/moose/grammar.m:
extras/moose/lalr.m:
extras/moose/moose.m:
	Module qualify some predicate names to resolve type ambiguities.
	Add underscores to a couple of variables that are not used.
2003-07-09 07:43:38 +00:00
David Overton
27888d72c8 Action methods are functions so write them out using function syntax
Estimated hours taken: 0.1
Branches: main

extras/moose/moose.m:
	Action methods are functions so write them out using function syntax
	rather than pred syntax.
2002-07-09 03:33:50 +00:00
Ralph Becket
ebc4eb0e3f I have changed moose to support user-specifiable parser state modes,
Estimated hours taken: 20
Branches: main

I have changed moose to support user-specifiable parser state modes,
rather than just in/out.  In particular, this means the parser state
can now include the IO state (this will be useful in conjunction with
lex).

I have also made some changes to the interface.

This change is not backwards compatible.

extras/moose/NEWS:
	Made a note of the fact that this change to moose is not
	backwards compatible.

extras/moose/README:
	Updated the documentation to reflect the new changes.

extras/moose/TODO:
	Removed this change from the TODO list.

extras/moose/grammar.m:
	Removed the unused EndToken argument from construct_grammar/5.

extras/moose/moose.m:
	Fairly extensive changes to support user-specifiable parser
	state modes.
	Changed the order of some arguments in .moo parse declarations.
	Changed the signature of action methods from preds to funcs.

extras/moose/samples/alpha.moo:
extras/moose/samples/expr.moo:
extras/moose/samples/cgram.moo:
extras/moose/samples/small.moo:
	Changed parse declarations to match new scheme.
	Changed the scan predicates in alpha.moo and expr.moo to be
	deterministic.

extras/moose/samples/try_alpha.m:
extras/moose/samples/try_expr.m:
	Changed to use the new interface.
2002-02-19 07:52:00 +00:00
Fergus Henderson
7a2f27f0eb Rename the file mercury.m' as mercury_syntax.m', since using the
Estimated hours taken: 0.25
Branches: main

extras/moose/mercury.m:
extras/moose/mercury_syntax.m:
extras/moose/moose.m:
	Rename the file `mercury.m' as `mercury_syntax.m', since using the
	module name `mercury' doesn't work with the `--high-level-code'
	back-end (the generated header file conflicts with runtime/mercury.h).
	The module name `mercury' is effectively reserved.
2001-11-22 10:07:05 +00:00
Simon Taylor
5544aed7ff Change the list constructor from ./2' to [|]/2'. `./2' will
Estimated hours taken: 3
Branches: main

Change the list constructor from `./2' to `[|]/2'. `./2' will
eventually become the module qualification operator.

library/parser.m:
library/io.m:
library/sparse_bitset.m:
library/std_util.m:
library/term_io.m:
compiler/mercury_to_mercury.m:
compiler/prog_io_dcg.m:
compiler/prog_io_goal.m:
compiler/prog_io_pragma.m:
compiler/prog_io_typeclass.m:
compiler/prog_io_util.m:
browser/interactive_query.m:
extras/moose/grammar.m:
extras/moose/moose.m:
extras/morphine/source/generate_call_site_cov.m:
extras/xml/xml.encoding.m:
samples/muz/higher_order.m:
tests/debugger/declarative/app.m:
tests/dppd/transpose_impl.m:
tests/hard_coded/ground_dd.m:
tests/hard_coded/split_c_files.m:
	Change all references to `./2' to use `[|]/2' instead.

compiler/typecheck.m:
	Handle `./2' as a special case in `report_error_undef_cons'.

	Warn about module list not being imported if `[|]/2' is undefined.

compiler/llds_out.m:
util/mdemangle.c:
profiler/demangle.m:
	Add name conversions for `[|]' (f_cons) and `[]' (f_nil).

NEWS:
doc/reference_manual.texi:
w3/tutorial/lists-n-things.m4:
	Document the changes.

tests/debugger/{,declarative}/*.exp*:
	Update test case results. For some tests the output changed
	because they output lists in the non-pretty format. For others,
	the output changed because the alphabetical ordering of the
	constructors of type `list/1' changed, so the numbering of
	the switch branches in the goal paths changed.
2001-09-25 09:37:12 +00:00
Tyson Dowd
2a81aec951 Moose, the Mercury parser generator.
Estimated hours taken: 5 (+ unknown hours by Tom, + unknown hours by fjh)

Moose, the Mercury parser generator.

extras/moose/Mmakefile:
extras/moose/check.m:
extras/moose/grammar.m:
extras/moose/lalr.m:
extras/moose/mercury.m:
extras/moose/misc.m:
extras/moose/moose.m:
extras/moose/options.m:
extras/moose/tables.m:

extras/moose/BUGS:
	A list of known bugs.

extras/moose/TODO:
	Things that still need to be done.

extras/moose/README:
	Documentation for moose (thanks to fjh).

extras/moose/samples/Mmakefile:
extras/moose/samples/README:
extras/moose/samples/alpha.input:
extras/moose/samples/alpha.moo:
extras/moose/samples/cgram.moo:
extras/moose/samples/expr.input:
extras/moose/samples/expr.moo:
extras/moose/samples/small.moo:
extras/moose/samples/try_alpha.m:
extras/moose/samples/try_expr.m:
	Some samples.
2000-05-22 05:22:18 +00:00