Commit Graph

31 Commits

Author SHA1 Message Date
Zoltan Somogyi
a2f89cb891 Give some predicates better names.
extras/xml/parsing.m:
    As above.

extras/xml/xml.parse.m:
extras/xml/xml.parse.chars.m:
    Conform to the change in parsing.m.
2022-06-25 06:45:51 +10:00
Zoltan Somogyi
ce14206488 Clean up several aspects of extras/xml.
extras/xml/parsing.m:
extras/xml/unicode.m:
extras/xml/xml.cat.m:
extras/xml/xml.doc.m:
extras/xml/xml.dtd.m:
extras/xml/xml.encoding.m:
extras/xml/xml.m:
extras/xml/xml.ns.m:
extras/xml/xml.parse.chars.m:
extras/xml/xml.parse.m:
    Use predmode declarations when possible.

    Flatten camelCase.

    Add prefixes to the names of function symbols and fields
    if this avoid ambiguity, either with other parts of this code,
    or with standard Mercury function symbols or predicates.

    Replace uses of graphic characters such as ',' and '-' as
    general purpose function symbols with normal, alphanumeric
    function symbols. (Uses of graphic characters to stand for themselves
    in xml.parse.chars.m are unaffected.)

    Replace uses of graphic symbols such as ',' '->' and '[|]' as type names.

    Improve some other names as well.

    Convert (C->T;E) to (if C then T else E).

    Replace tabs with spaces.

    Delete unused imports.

    Make the order of definitions match the order of declarations.

extras/xml/tryit.m:
    Put the code for handling a single command line argument into its own
    predicate.

    Replace see/seen with read_named_file_as_string.

    Avoid using !IO to pass around the parser state.

    Instead of writing out the parse tree as a single very long line,
    convert both the DTD and the HTML code to a prettyprinter doc,
    and print that. This makes the output actually readable, and
    also makes it usefully diffable as well.

extras/xml/Mmakefile:
    Replace the old do-nothing check action with one that actually does
    check whether the code in this directory can do at least one simple task,
    the one mentioned in in samples/README. It would be nice of we had
    more tests, more extensive tests, or (preferably) both, but that would
    require someone who knows the code significantly better than I do.

    Add a rule for making the tags file.

    Compile the modules in this directory with the same default mmc flags
    as we use in the compiler directory.

extras/xml/XML_FLAGS:
    The default flags for modules in this directory.

extras/xml/Mercury.options:
    The non-default flags for modules in this directory.

extras/xml/samples/newsarticles.exp:
    The expected output of running the updated tryit program on the
    (just one) sample input in this directory.

extras/xml/README:
extras/xml/samples/README:
    Replace some obsolete references, and improve formatting.
2022-06-24 07:26:55 +10:00
Julien Fischer
20e02c9833 Style and formatting updates.
extras/xml/*.m:
    As above.
2022-04-15 18:19:44 +10:00
Julien Fischer
66611dfb0b Fix compilation of extras/xml.
extras/xml/tryit.m:
extras/xml/xml.cat.m:
extras/xml/xml.parse.chars.m:
    Conform to recent library changes.
2022-03-28 20:48:07 +11:00
Julien Fischer
a908799acb Fix issues in extras caused by recent changes.
extras/*/*.m:
     Avoid ambiguous pragmas.

     Replace an use of is.

     Fix module imports.
2021-06-19 21:11:35 +10:00
Mark Brown
d465fa53cb Update the COPYING.LIB file and references to it.
Discussion of these changes can be found on the Mercury developers
mailing list archives from June 2018.

COPYING.LIB:
    Add a special linking exception to the LGPL.

*:
    Update references to COPYING.LIB.

    Clean up some minor errors that have accumulated in copyright
    messages.
2018-06-09 17:43:12 +10:00
Julien Fischer
6def07d5f2 Fix spelling.
extras/xml/parsing.m:
    s/threadded/threaded/
2017-05-07 22:56:22 +10:00
Paul Bone
fc4b3ff196 Remove .cvsignore files
Remove old .cvsignore files, moving their contents to .gitignore files.
There are now no .cvsignore files in the repository.

I've also sorted some .gitignore files and avoided repeating a pattern in a
subdirectory's .gitignore file when it is already mentioned in the parent
.gitignore file.
2017-04-04 12:05:56 +10:00
Julien Fischer
2dc59fefbe Fix compilation errors in samples, extras and benchmarks.
benchmarks/progs/quicksort/qs_always_par.m:
benchmarks/progs/quicksort/qs_utils.m:
extras/moose/check.m:
extras/posix/samples/mdprof_cgid.m:
extras/xml/parsing.m:
samples/muz/zparser.m:
samples/muz/ztype_op.m:
    As above -- the compiler now rejects determinism declarations on
    non-predmode predicate declarations.

    Replace a call to bitmap.new with bitmap.init.
2016-01-13 14:16:24 +11:00
Zoltan Somogyi
d33273d033 Tell vim not to expand tabs in Makefiles.
This file-specific setting will override a default setting of expandtabs
in $HOME/.vimrc.

*/Makefile:
*/Mmakefile:
    As above.

tests/hard_coded/.gitignore:
    Don't ignore the purity subdir. This ignore must have been left over
    from when purity.m was a test in hard_coded, not hard_coded/purity,
    and it ignored an executable, not a directory.
2015-01-08 22:07:29 +11:00
Julien Fischer
2a8be7bbf6 Replace '__' as module qualifier in rest of the extras.
extras/*/*.m:
	Replace the use of '__' as a module qualifier in the rest of
	the extras.

	s/io\.state/io/ in the extras.

	Use '=' instead of is/2 in a spot.
2014-12-29 16:48:17 +11:00
Sebastian Godelet
59ce15323f Fix samples/rot13_concise + libxml compilation error
boehm_gc/.gitignore:
    Ignore .obj files

extras/xml/xml.dtd.m:
extras/xml/xml.parse.m:
    Change the name of functor ('1') in the multiplicity/0 type
    to one. The former name does not (yet) work with the C# grade.

samples/.gitignore:
    Ignore library output and sample executables.

samples/c_interface/standalone_c/.gitignore:
    Ignore mercury_lib_int output files.

samples/c_interface/standalone_c/Makefile:
    chmod 0644.

samples/c_interface/.gitignore:
    Ignore object files and executables.

samples/java_interface/.gitignore:
    Ignore Java class files and executables.

samples/lazy_list/.gitignore:
samples/muz/.gitignore:
samples/rot13/.gitignore:
    Ignore executables.

samples/rot13/rot13_concise.m:
    Update call to index_det to use string.det_index.
    Added comments to clarify type inference.

samples/solutions/.gitignore:
    Ignore executables.

samples/solutions/all_solutions.m:
samples/solutions/n_solutions.m:
samples/solutions/one_solution.m:
samples/solutions/some_solutions.m:
    chmod 0644.

samples/solver_types/.gitignore:
    Ignore executables.

samples/solver_types/sudoku.m:
    Output the solution in a 3x3 grid.
2014-03-11 11:30:00 +11:00
Sebastian Godelet
f9899940b7 Add .gitignore files to the extras/ directory
extras/.gitignore:
    Mercury ignores the --use-{grade}-subdir dir
    Mercury/** for git 1.8+ this recursively ignores all build files
    ignoring *.mh and *.init files
    *.err output files
    lib*.{dll|so|a|dylib} ignores target compiler library output
    *.jar ignores the Java grade output
    *.exe for Windows executables

extras/dynamic_linking/.gitignore:
    ignoring the copy of dl.m, name_mangle.m
    ignoring hello lib and dl_test* executables

extras/moose/samples/.gitignore:
    ignoring cgram.m small.m alpha.m expr.m which are
    generated from the .moo grammar files

extras/graphics/mercury_cairo/samples/.gitignore:
    ignoring *.png output and all executables

extras/**/.gitignore:
    In each sample/test/example folder the linux executable/test
    output is ignored
2014-02-27 16:58:43 +11:00
Julien Fischer
df345f7258 Ignore generated files in the extras.
Branches: main, 11.07

extras/*/.cvsignore:
	Ignore generated files in the extras.
2011-11-18 03:03:26 +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
Mark Brown
115491212d Convert from iso-8859-1 to utf8.
extras/xml/xml.parse.m:
	Convert from iso-8859-1 to utf8.
2011-04-07 05:44:18 +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
Ian MacLarty
b2c6c59c87 Fix errors in the xml parser due to the use of obsolete notation.
Estimated hours taken: 0.2
Branches: main and 0.12

extras/xml/parsing.m:
extras/xml/tryit.m:
extras/xml/xml.ns.m:
extras/xml/xml.parse.m:
	Fix errors in the xml parser due to the use of obsolete notation.
2005-10-13 09:49:47 +00:00
Julien Fischer
673dfeb4fa Replace some more instances of '' I missed
Estimated hours taken: 0.1
Branches: main

extras/xml/xml.parse.m:
	Replace some more instances of '' I missed
	in my last diff.
2005-06-01 07:51:35 +00:00
Julien Fischer
b44d8c5b3c Delete the type '' ---> '' and replace instances of
Estimated hours taken: 0.1
Branches: main, 0.12

extras/xml/parsing.m:
extras/xml/xml.parse.m:
	Delete the type '' ---> '' and replace instances of
	it in these files with the unit type from std_util.
	The compiler no longer accepts the former type and
	we aren't going to allow it in future anyway.
2005-06-01 07:43:24 +00:00
Julien Fischer
e70923a910 Remove some non-abstract instance declarations from module
Estimated hours taken: 0.1
Branches: main, release

extras/xml/*.m:
	Remove some non-abstract instance declarations from module
	interfaces; the compiler no longer supports them.

	Replace uses of ':' as a module qualifier.

	Remove duplicate module imports.
2005-05-18 13:50:56 +00:00
Julien Fischer
0a25274404 Fix up some minor things in the extras distribution.
Estimated hours taken: 0.5
Branches: main

Fix up some minor things in the extras distribution.

extras/cgi/Mmakefile:
	Don't warn about mercury_www not exporting anything.

extras/complex_numbers/*.m:
	Replace `:' as the module qualifier.

	Use float.float/1 instead of the now obsolete
	int.to_float/2.

extras/concurrency/midimon.m:
	Replace `:' as the module qualifier.

extras/trailed_update/Mmakefile:
	Don't warn about trailed_update not exporting anything.

extras/xml/*.m:
	Replace `:' as the module qualifier.
	Remove some unnecessary imports.
	Put an underscore in front of an unused variable.
2004-07-30 07:04:45 +00:00
Fergus Henderson
d62c697231 Add appropriate infrastructure to support doing `mmake depend && mmake
Estimated hours taken: 2
Branches: main

Add appropriate infrastructure to support doing `mmake depend && mmake
&& mmake install' in the `extras' directory, and having it automatically
install and build as much as possible.

extras/Mmakefile:
	New file.

extras/cgi/Mmakefile:
	Delete bogus reference to `ALL_LIBGRADES' and `mercury-config'.

extras/complex_numbers/Mmakefile:
extras/concurrency/Mmakefile:
extras/concurrency/concurrency.m:
extras/curses/Mmakefile:
extras/dynamic_linking/Mmakefile:
extras/lazy_evaluation/Mmakefile:
extras/lex/Mmakefile:
extras/moose/Mmakefile:
extras/xml/Mmakefile:
	Add rules for `mmake install'.

extras/references/scoped_update.m:
	Add macro guard around typedef in `c_header_code'.

extras/curs/Mmakefile:
extras/curses/Mmakefile:
	Define MERCURY_BOOTSTRAP_H, to avoid name clash on `bool'
	that is caused by our bootstrap code in runtime/Merucry.h.

extras/curs/curs.m:
	Add `promise_pure' declarations for all pure procedures.
	XXX Should this be needed?  These predicates all take
	io__state arguments.
2002-03-06 10:10:31 +00:00
Simon Taylor
3d3e5f9411 Add io__input_stream_foldl', io__input_stream_foldl_io'
Estimated hours taken: 1

NEWS:
library/io.m:
	Add `io__input_stream_foldl', `io__input_stream_foldl_io'
	and `io__input_stream_foldl2_io', which apply a predicate
	to each character of an input stream in turn.

	Add a new result type `io__maybe_partial_res' which is
	used for operations which can return a partial result
	like io__input_stream_foldl* and io__read_file.

tests/general/io_regression.m:
extras/xml/xml.cat.m:
extras/xml/xml.parse.m:
extras/xml/tryit.m:
extras/morphine/source/coverage_util.m:
	Fix uses of io__read_file and io__read_file_as_string.

tests/general/Mmakefile:
tests/general/io_foldl.{m,exp}:
	Test case.
2002-01-22 14:21:52 +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
Thomas Conway
33314f9799 Improve the performance of the XML parser.
Estimated hours taken: 1
Branches: main

Improve the performance of the XML parser.

extras/xml/parsing.m:
	Put some comments in explaining the performance problem and
	its solution.

extras/xml/xml.parse.chars.m:
	Change baseChar and friends so that the big combinator
	expressions in them are static constants.
2001-06-16 05:46:26 +00:00
Ina Cheng
e8c1373bf9 Add a module to turn an XML document into a namespace-aware XML document.
Estimated hours taken: 44

Add a module to turn an XML document into a namespace-aware XML document.

extras/xml/tryit.m
	change the sample program to print out the new XML output

extras/xml/xml.m
	add xml.ns.m to the wrapper module

extra/xml/xml.ns.m
	the new module containing predicates to turn an XML document to a
	namespace-aware XML document
2001-01-05 04:15:44 +00:00
Ina Cheng
2d727ac647 Add a sample directory in the XML parser directory
Estimated hours taken: 1

Add a sample directory in the XML parser directory


extras/xml/README
	update the README file

extras/xml/tryit.m
	modify the file to print out all output messages as well as any
	error messages

extras/xml/samples
	a sample directory containing instructions on how to run the
	parser and some sample files

extras/xml/samples/README
	README file

extras/xml/samples/newsarticles.xml
	sample XML file for running the XML parser

extras/xml/samples/newsarticles.dtd
	sample DTD file for running the XML parser

extras/xml/samples/catalog
	a catalog file
2000-12-01 06:07:57 +00:00
Zoltan Somogyi
a1cd1a1633 Optionally test the extras directory during bootchecks.
Estimated hours taken: 4

Optionally test the extras directory during bootchecks.

tools/bootcheck
	Add an option, -e, for testing the extras directory. Rename the
	-T/--test-only option as -n/--no-bootcheck, since it does not prevent
	the testing of the extras.

	Bootcheck only test the subdirectories in extras which have an
	Mmakefile and which can be tested in all grades and in all setups.

extras/*/Mmakefile:
	Updates to include extras/Mmake.params if it exists (to get the
	parameters, including grades, of the bootcheck) and to add a check
	target, which in most cases does not do anything yet (which means
	that the only testing we do is checking that the program compiles
	all right). Making "mmake check" do something meaningful will be
	up to the authors of the various subdirectories involved.

	In many cases, add .PHONY annotations on the relevant targets,
	and copyright notices.

extras/aditi/NOBOOTTEST:
	Prevent the automatic testing of the aditi subdirectory from
	bootcheck, since this can be done only on a machine with Aditi
	installed.

extras/aditi/NOBOOTTEST:
	Prevent the automatic testing of the aditi subdirectory from
	bootcheck, since this can be done only on a machine with Aditi
	installed.

extras/aditi/NOBOOTTEST:
	Prevent the automatic testing of this subdirectory from bootcheck,
	since this can be done only on a machine with Aditi installed.

extras/dynamic_linking/NOBOOTTEST:
	Prevent the automatic testing of this subdirectory from bootcheck,
	since this can be done only on a machine with the dl library already
	installed.

extras/logged_out/NOBOOTTEST:
	Prevent the automatic testing of this subdirectory from bootcheck,
	since this can be done only in grades with the right kind of stream
	support.

extras/odbc/NOBOOTTEST:
	Prevent the automatic testing of this subdirectory from bootcheck,
	since this can be done only on a machine with ODBC installed.

extras/references/NOBOOTTEST:
extras/trailed_update/NOBOOTTEST:
	Prevent the automatic testing of this subdirectory from bootcheck,
	since this can be done only in trailing grades.

extras/*/.nocopyright:
	Mention the NOBOOTTEST files in the relevant .nocopyright files.
2000-11-21 23:52:54 +00:00
Zoltan Somogyi
76943f86ff New files.
Estimated hours taken: 0.1

extras/*/.nocopyright:
	New files.
2000-11-21 23:48:36 +00:00
Thomas Conway
236316cbe8 Add an XML parser to the extras directory
Estimated hours taken: 100


    Add an XML parser to the extras directory

extras/xml/README:
    A short readme describing the parser.

extras/xml/Mmake:
    The Mmake file for the sample program.

extras/xml/tryit.m:
    A sample program that just parses the files named on the command line.

extras/xml/xml*.m:
    The parser itself.

extras/xml/unicode.m:
    A bunch of functions that return the unicode values for numerous ascii
    symbols.

extras/xml/parsing.m:
    The parsing combinator set used by the xml parser.
2000-09-05 22:34:00 +00:00