mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-14 13:23:53 +00:00
Estimated hours taken: 8 Branches: main Allow arbitrary mappings from source file name to module name. The mapping is created using the command `mmc -f *.m', which must be run before `mmake depend'. compiler/parse_tree.m: compiler/source_file_map.m: compiler/notes/compiler_design.html: Add a new module to read, write and search the mapping. compiler/modules.m: Use the source file map when searching for source files. Export `make_directory' for use by source_file_map.m. Use the module name rather than the source file name to generate the executable name. This matches the documentation in the User's Guide, and it's needed to make the tests work. compiler/prog_io.m: Separate out the code to read the first item in a module to find the module name into a new predicate, `find_module_name'. compiler/handle_options.m: Don't complain about the module name not matching the file name when generating the Mercury.modules file -- the file only needs to be generated when the module name doesn't match the file name. compiler/llds_out.m: Remove a duplicate copy of `make_directory'. compiler/options.m: compiler/mercury_compile.m: doc/user_guide.texi: Add the `--generate-source-file-mapping' (-f) option to generate the mapping. NEWS: Document the change. tests/hard_coded/Mmakefile: tests/hard_coded/source_file_map.m: tests/hard_coded/mapped_module.exp: Test case.
65 lines
2.2 KiB
Mathematica
65 lines
2.2 KiB
Mathematica
%-----------------------------------------------------------------------------%
|
|
% Copyright (C) 2002 The University of Melbourne.
|
|
% This file may only be copied under the terms of the GNU General
|
|
% Public License - see the file COPYING in the Mercury distribution.
|
|
%-----------------------------------------------------------------------------%
|
|
%
|
|
% This package contains the parse tree data structure,
|
|
% and modules for parsing and for manipulating parse trees.
|
|
%
|
|
% It corresponds to the parts of "Phase 1: Parsing"
|
|
% in notes/compiler_design.html up to (but not including) make_hlds.m.
|
|
%
|
|
|
|
:- module parse_tree.
|
|
:- interface.
|
|
:- import_module libs.
|
|
:- import_module hlds. % XXX for hlds_data__cons_id
|
|
:- import_module backend_libs. % XXX for `foreign'
|
|
|
|
% The parse tree data type itself.
|
|
:- include_module prog_data, (inst).
|
|
% XXX inst uses hlds_data__cons_id
|
|
|
|
% The parser.
|
|
:- include_module prog_io.
|
|
:- include_module prog_io_goal, prog_io_dcg, prog_io_pragma.
|
|
:- include_module prog_io_typeclass, prog_io_util.
|
|
|
|
% Pretty-printers.
|
|
:- include_module prog_out, mercury_to_mercury.
|
|
|
|
% Utility routines.
|
|
:- include_module prog_util.
|
|
|
|
% Transformations that act on the parse tree,
|
|
% and stuff relating to the module system.
|
|
:- include_module equiv_type.
|
|
:- include_module modules, module_qual, source_file_map.
|
|
|
|
% (Note that intermod and trans_opt also contain routines that
|
|
% act on the parse tree, but those modules are considered part
|
|
% of the HLDS transformations package.)
|
|
% :- include_module intermod, trans_opt.
|
|
|
|
% :- implementation.
|
|
|
|
% XXX lots of stuff uses hlds_data__type_id and type_util.m.
|
|
% XXX modules.m uses llds_out for the init names.
|
|
|
|
%-----------------------------------------------------------------------------%
|
|
|
|
:- implementation.
|
|
|
|
:- import_module check_hlds. % XXX for type_util.m
|
|
:- import_module transform_hlds. % XXX for write_pragma_termination_info
|
|
% in termination.m, which is used by
|
|
% mercury_to_mercury.m
|
|
:- import_module ll_backend. % XXX for llds_out.m, which is used
|
|
% by modules__append_to_init_list,
|
|
% which creates the LLDS and RL
|
|
% initialization code.
|
|
:- end_module parse_tree.
|
|
|
|
%-----------------------------------------------------------------------------%
|