Files
mercury/compiler/parse_tree.m
Julien Fischer 601fe20aba Simplify the structure of the compiler by removing the cycle
Estimated hours taken: 3.5
Branches: main

Simplify the structure of the compiler by removing the cycle
parse_tree -> backend_libs -> check_hlds -> parse_tree
from the package dependency graph.

I've done this by factoring out the code in backend_libs.foreign
and backend_libs.name_mangle that is needed by the frontend of
the compiler and putting it in a new module, parse_tree.prog_foreign.
This removes the dependency between the parse_tree and backend_libs
packages.

The obvious downside to this is that the name mangler is now
split in two, although such a division was always in implicit
in the predicates of the name_mangle module anyway, ie. between
those bits that operate on the HLDS/MLDS/LLDS level data structures
and those that don't.

compiler/name_mangle.m:
compiler/foreign.m:
compiler/prog_foreign.m:
	Move code for dealing with foreign language procedures that
	is required by the parse_tree package into a new module,
	prog_foreign.

	Update the formatting in some of these modules so that
	they match our current coding standard.

compiler/*.m:
	Update to reflect the above change.

compiler/notes/compiler_design.html:
	Include the new module.

	Fix some spelling errors.
2005-03-21 04:45:51 +00:00

59 lines
1.8 KiB
Mathematica

%-----------------------------------------------------------------------------%
% Copyright (C) 2002-2005 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 mdbcomp.
:- import_module recompilation.
% The parse tree data type itself.
:- include_module prog_data.
% 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_foreign.
:- include_module prog_mode.
:- include_module prog_util.
:- include_module prog_type.
:- include_module error_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.
%-----------------------------------------------------------------------------%
:- end_module parse_tree.
%-----------------------------------------------------------------------------%