Files
mercury/compiler/parse_tree.m
Simon Taylor 82c6cdb55e Make definitions of abstract types available when generating
Estimated hours taken: 100
Branches: main

Make definitions of abstract types available when generating
code for importing modules.  This is necessary for the .NET
back-end, and for `:- pragma export' on the C back-end.

compiler/prog_data.m:
compiler/modules.m:
compiler/make.dependencies.m:
compiler/recompilation.version.m:
	Handle implementation sections in interface files.

	There is a new pseudo-declaration `abstract_imported'
	which is applied to items from the implementation
	section of an interface file.  `abstract_imported'
	items may not be used in the error checking passes
	for the curent module.

compiler/equiv_type_hlds.m:
compiler/notes/compiler_design.html:
	New file.

	Go over the HLDS expanding all types fully after
	semantic checking has been run.

compiler/mercury_compile.m:
	Add the new pass.

	Don't write the `.opt' file if there are any errors.

compiler/instmap.m:
	Add a predicate instmap_delta_map_foldl to apply
	a procedure to all insts in an instmap.

compiler/equiv_type.m:
	Export predicates for use by equiv_type_hlds.m

	Reorder arguments so state variables and higher-order
	programming can be used.

compiler/prog_data.m:
compiler/prog_io_pragma.m:
compiler/make_hlds.m:
compiler/mercury_to_mercury.m:
	Handle `:- pragma foreign_type' as a form of type
	declaration rather than a pragma.

compiler/hlds_data.m:
compiler/*.m:
	Add a field to the type_info_cell_constructor cons_id
	to identify the type_ctor, which is needed by
	equiv_type_hlds.m.

compiler/module_qual.m:
	Donn't allow items from the implementation section of
	interface files to match items in the current module.

compiler/*.m:
tests/*/*.m:
	Add missing imports which only became apparent with
	the bug fixes above.

	Remove unnecessary imports which only became apparent with
	the bug fixes above.

tests/hard_coded/Mmakefile:
tests/hard_coded/export_test2.{m,exp}:
	Test case.

tests/invalid/Mmakefile:
tests/invalid/missing_interface_import2.{m,err_exp}:
	Test case.
2003-12-01 15:56:15 +00:00

75 lines
2.4 KiB
Mathematica

%-----------------------------------------------------------------------------%
% Copyright (C) 2002-2003 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'
:- import_module recompilation.
% The parse tree data type itself.
:- include_module prog_data.
:- include_module (inst).
% XXX inst uses hlds_data__cons_id
% The parser.
:- include_module prog_io.
:- include_module prog_io_dcg.
:- include_module prog_io_goal.
:- include_module prog_io_pragma.
:- include_module prog_io_typeclass.
:- include_module prog_io_util.
% Pretty-printers.
:- include_module mercury_to_mercury.
:- include_module prog_out.
% 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.
:- include_module module_qual.
:- include_module 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.
% :- include_module 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 ll_backend. % XXX for llds_out.m, which is used
% by modules__append_to_init_list,
% which creates the LLDS and RL
% initialization code.
:- import_module transform_hlds. % XXX for write_pragma_termination_info
% in termination.m, which is used by
% mercury_to_mercury.m
:- end_module parse_tree.
%-----------------------------------------------------------------------------%