mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-19 19:33:46 +00:00
The mapping from the old to the new module names is:
prog_io -> parse_module
prog_io_dcg -> parse_dcg_goal
prog_io_error -> parse_error
prog_io_find -> find_module
prog_io_goal -> parse_goal
prog_io_inst_mode_defn -> parse_inst_mode_defn
prog_io_inst_mode_name -> parse_inst_mode_name
prog_io_iom -> parse_types
prog_io_item -> parse_item
prog_io_mutable -> parse_mutable
prog_io_pragma -> parse_pragma
prog_io_sym_name -> parse_sym_name
prog_io_type_defn -> parse_type_defn
prog_io_type_name -> parse_type_name
prog_io_typeclass -> parse_class
prog_io_util -> parse_util
prog_io_vars -> parse_vars
unparse -> parse_tree_to_term
59 lines
2.7 KiB
Mathematica
59 lines
2.7 KiB
Mathematica
%-----------------------------------------------------------------------------e
|
|
% vim: ft=mercury ts=4 sw=4 et
|
|
%-----------------------------------------------------------------------------e
|
|
% Copyright (C) 2015 The Mercury team.
|
|
% This file may only be copied under the terms of the GNU General
|
|
% Public License - see the file COPYING in the Mercury distribution.
|
|
%---------------------------------------------------------------------------%
|
|
%
|
|
% This module defines a type used by several modules that parse items
|
|
% and/or markers.
|
|
%
|
|
%---------------------------------------------------------------------------%
|
|
|
|
:- module parse_tree.parse_types.
|
|
|
|
:- interface.
|
|
|
|
:- import_module mdbcomp.
|
|
:- import_module mdbcomp.sym_name.
|
|
:- import_module parse_tree.prog_data.
|
|
:- import_module parse_tree.prog_item.
|
|
:- import_module recompilation.
|
|
|
|
:- import_module list.
|
|
|
|
% This type represents the result of parsing one term.
|
|
:- type item_or_marker
|
|
---> iom_item(item)
|
|
% The term contains an item.
|
|
; iom_marker_include(one_or_more(item_include))
|
|
% The term contains an `:- include_module' declaration.
|
|
; iom_marker_avail(one_or_more(item_avail))
|
|
% The term contains an `:- import_module' or `:- use_module'
|
|
% declaration.
|
|
; iom_marker_version_numbers(version_numbers)
|
|
% The term was a record of the version numbers of the items
|
|
% in an interface file.
|
|
; iom_marker_src_file(string)
|
|
% The term was a pragma specifying the new filename.
|
|
; iom_marker_module_start(module_name, prog_context, int)
|
|
% The term was a `:- module' declaration. The arguments give
|
|
% the module's name, and the context and sequence number of the
|
|
% declaration. The module name is exactly what was in the
|
|
% declaration; it is NOT implicitly module qualified by the
|
|
% enclosing module.
|
|
; iom_marker_module_end(module_name, prog_context, int)
|
|
% The term was a `:- end_module' declaration. The arguments give
|
|
% the module's name, and the context and sequence number of the
|
|
% declaration. Again, the module name as is, and not implicitly
|
|
% module qualified.
|
|
; iom_marker_section(module_section, prog_context, int).
|
|
% The term was a `:- interface' or `:- implementation' declaration.
|
|
% The arguments give the section's kind, and the context
|
|
% and sequence number of the declaration.
|
|
|
|
%---------------------------------------------------------------------------%
|
|
:- end_module parse_tree.parse_types.
|
|
%---------------------------------------------------------------------------%
|