mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-18 19:03:45 +00:00
Estimated hours taken: 1000 Add Opium-M in the extras. (committed on behalf of Erwan Jahier). extras/opium_m/copyright.txt: The copyright for Opium-M. extras/opium_m/VERSION: extras/opium_m/README: extras/opium_m/opium-mode.el: An emacs mode designed to write opium scenario. extras/opium_m/INSTALL-OPIUM-M: Opium-M installation script. extras/opium_m/source/interactive_queries.op: extras/opium_m/source/browse.op: extras/opium_m/source/control_flow.op: extras/opium_m/source/coprocess_M.op: extras/opium_m/source/opium_kernel_M.op: extras/opium_m/source/current_arg_M.op: extras/opium_m/source/current_slots_M.op: extras/opium_m/source/display_M.op: extras/opium_m/source/source_M.op: extras/opium_m/source/event_attributes_M.op: extras/opium_m/source/step_by_step_M.op: extras/opium_m/source/exec_control_M.op: extras/opium_m/source/forward_move_M.op: extras/opium_m/source/load_Opium-M.pl: extras/opium_m/source/make_scenario-M.pl: extras/opium_m/source/load_Opium-M_without_banner.pl: extras/opium_m/source/load_scenario-M.pl: The Opium-M source files. extras/opium_m/source/partch.autoload: extras/opium_m/source/partch.interface: extras/opium_m/source/partch.parameter: extras/opium_m/source/partch.scenario_handler: extras/opium_m/source/partch.error: extras/opium_m/source/partch.types: extras/opium_m/source/partch.translate: extras/opium_m/source/partch.util.pl: extras/opium_m/source/partch.make: extras/opium_m/source/partch.scenario: Patches to create the scenario handler for Opium-M. autoload.op, etc. are part of the Eclipse distribution; to avoid licensing issues, we copy thoses files from the Eclipse installation directory during the installation and then we patch them using those files. extras/opium_m/non-regression-tests/*: Non regression tests for Opium-M. extras/opium_m/non-regression-tests/queens.m: extras/opium_m/non-regression-tests/test_vars.m: extras/opium_m/non-regression-tests/test_listing.m: Mercury files that are tested. extras/opium_m/non-regression-tests/browse.in: extras/opium_m/non-regression-tests/queens.in: extras/opium_m/non-regression-tests/test_vars.in: Input of the non regression tests. extras/opium_m/non-regression-tests/queens.exp: extras/opium_m/non-regression-tests/test_vars.exp: extras/opium_m/non-regression-tests/listing_output.exp: Expected output of the non regression tests. extras/opium_m/non-regression-tests/runtests: extras/opium_m/non-regression-tests/Mmakefile: To perform the non regression tests. extras/opium_m/non-regression-tests/Mmake.common: extras/opium_m/non-regression-tests/shutdown: extras/opium_m/non-regression-tests/startup: extras/opium_m/non-regression-tests/handle_options: Those files are copied from the Mercury tests repository. extras/opium_m/scripts/exec_mercury_program: Script that is used to run Mercury programs under the control of Opium-M. extras/opium_m/scripts/fixmanual: Script that patch the output of `manual' command (which automaticly generates the Opium-M Reference Manual).
187 lines
6.0 KiB
Plaintext
187 lines
6.0 KiB
Plaintext
%------------------------------------------------------------------------------%
|
|
% Copyright (C) 1999 INRIA/INSA.
|
|
--- /soft/eclipse/eclipse4.1/lib_pd/opium_light/translate.op Sat Feb 20 16:09:16 1999
|
|
+++ translate.op Thu Nov 4 09:03:37 1999
|
|
@@ -20,13 +20,13 @@
|
|
translate_file_i(Scenario, SrcFile, Load, AutoLoad, SrcDir, Mod),
|
|
close(Load),
|
|
close(AutoLoad),
|
|
- opium_printf(output, "%w is translated\n", [SrcFile]),
|
|
+ printf(output, "%w is translated\n", [SrcFile]),
|
|
!.
|
|
translate_file(Scenario, SrcFile, LoadFile, AutoLoadFile, SrcDir, _) :-
|
|
- opium_printf(output, "could not translate %w\n", [SrcFile]).
|
|
+ printf(output, "could not translate %w\n", [SrcFile]).
|
|
|
|
translate_file_i(Scenario, SrcFile, Load, Autoload, SrcDir, Mod) :-
|
|
- opium_printf(output, "translating %w\n", [SrcFile]),
|
|
+ printf(output, "translating %w\n", [SrcFile]),
|
|
build_load(Scenario, SrcFile, Load, Autoload, SrcDir, Mod).
|
|
|
|
/*
|
|
@@ -62,7 +62,7 @@
|
|
exists(File),
|
|
!.
|
|
existing(File) :-
|
|
- opium_printf(error, "file %w does not exist\n", [File]),
|
|
+ printf(error, "file %w does not exist\n", [File]),
|
|
fail.
|
|
|
|
|
|
@@ -293,7 +293,7 @@
|
|
( is_opium_declaration(Pred/_),
|
|
!,
|
|
X =.. [_ | [name:Name | _]],
|
|
- opium_printf(error, "%w %w not properly declared\n", [Pred, Name])
|
|
+ printf(error, "%w %w not properly declared\n", [Pred, Name])
|
|
;
|
|
true
|
|
).
|
|
@@ -302,7 +302,7 @@
|
|
( is_opium_declaration(Pred/_),
|
|
!,
|
|
X =.. [_ | [name:Name | _]],
|
|
- opium_printf(error, "%w %w not properly declared\n", [Pred, Name])
|
|
+ printf(error, "%w %w not properly declared\n", [Pred, Name])
|
|
;
|
|
true
|
|
).
|
|
@@ -324,7 +324,7 @@
|
|
* trace : requires an execution, produces trace line
|
|
* tool : tool wrt Sepia's module system (requires current module)
|
|
*
|
|
- * Checking of argument types and print_line are added if required,
|
|
+ * Checking of argument types and print_event are added if required,
|
|
* primitives are generated automatically.
|
|
*/
|
|
build_cmd(Load, Autoload, Name, ArgList, TypeList, Abbrev, CommandType, Procedure, Scenario, Clause) :-
|
|
@@ -351,7 +351,7 @@
|
|
build_cmd_int(trace, Load, Autoload, Name, [], [], Abbrev, Impl, Scenario) :-
|
|
!,
|
|
concat_atom([Name, '_np'], Name_np),
|
|
- build_tracing_command(Load, Name, Name_np),
|
|
+ opium_assert(Load, (Name :- Name_np, print_event)),
|
|
build_related_primitives(trace, Load, Name, Name_np, Impl, [], [], Abbrev, Scenario),
|
|
build_autoload_info(Autoload, Name, Name, Scenario),
|
|
build_abbrev(Load, Autoload, Name, [], Abbrev, Scenario).
|
|
@@ -360,7 +360,12 @@
|
|
Cmd1 =.. [Name | ArgList],
|
|
concat_atom([Name, '_np'], Name_np),
|
|
name_variables(ArgList, ArgNameList),
|
|
- build_tracing_command_with_arguments(Load, Cmd1, ArgList, ArgNameList, TypeList, Name_np),
|
|
+ opium_assert(Load,
|
|
+ (Cmd1 :-
|
|
+ check_arg_type(ArgList, ArgNameList, TypeList, NewList),
|
|
+ Cmd2 =.. [Name_np | NewList],
|
|
+ Cmd2,
|
|
+ print_event)),
|
|
build_related_primitives(trace, Load, Name, Name_np, Impl, ArgList, TypeList, Abbrev, Scenario),
|
|
build_autoload_info(Autoload, Cmd1, Name, Scenario),
|
|
build_abbrev(Load, Autoload, Name, ArgList, Abbrev, Scenario).
|
|
@@ -391,16 +396,6 @@
|
|
build_autoload_info(Autoload, Cmd, Name, Scenario),
|
|
build_tool_abbrev(Load, Autoload, BodyName/BodyArity, Abbrev/Arity, ArgList, Scenario).
|
|
|
|
-build_tracing_command(Load, Name, Name_np) :-
|
|
- opium_assert(Load, (Name :- Name_np, print_line)).
|
|
-
|
|
-build_tracing_command_with_arguments(Load, Cmd1, ArgList, ArgNameList, TypeList, Name_np) :-
|
|
- opium_assert(Load,
|
|
- (Cmd1 :-
|
|
- check_arg_type(ArgList, ArgNameList, TypeList, NewList),
|
|
- Cmd2 =.. [Name_np | NewList],
|
|
- Cmd2,
|
|
- print_line)).
|
|
|
|
/*
|
|
* build_abbrev/6
|
|
@@ -509,7 +504,7 @@
|
|
opium_assert(Load,
|
|
(Name :-
|
|
Condition,
|
|
- opium_printf(help, "\n%w\n\n%w\n\n", [Goal, Message]),
|
|
+ printf(help, "\n%w\n\n%w\n\n", [Goal, Message]),
|
|
execute_demo_goal(Goal)
|
|
)),
|
|
opium_assert(Load, :- load_decl(Clause)).
|
|
@@ -556,7 +551,7 @@
|
|
is_list_of_atoms_or_empty_list(NeededScenarios),
|
|
!
|
|
;
|
|
- opium_printf(error, "scenario %w is not properly declared\n", [Name]),
|
|
+ printf(error, "scenario %w is not properly declared\n", [Name]),
|
|
fail
|
|
).
|
|
check_declaration(command,
|
|
@@ -583,7 +578,7 @@
|
|
is_list(ParameterList),
|
|
!
|
|
;
|
|
- opium_printf(error, "command %w is not properly declared\n", [Name]),
|
|
+ printf(error, "command %w is not properly declared\n", [Name]),
|
|
fail
|
|
).
|
|
check_declaration(procedure,
|
|
@@ -601,7 +596,7 @@
|
|
is_list(ParameterList),
|
|
!
|
|
;
|
|
- opium_printf(error, "procedure %w is not properly declared\n", [Name]),
|
|
+ printf(error, "procedure %w is not properly declared\n", [Name]),
|
|
fail
|
|
).
|
|
check_declaration(primitive,
|
|
@@ -622,7 +617,7 @@
|
|
atom(Procedure),
|
|
!
|
|
;
|
|
- opium_printf(error, "primitive %w is not properly declared\n", [Name]),
|
|
+ printf(error, "primitive %w is not properly declared\n", [Name]),
|
|
fail
|
|
).
|
|
check_declaration(type,
|
|
@@ -636,7 +631,7 @@
|
|
atom(Procedure),
|
|
!
|
|
;
|
|
- opium_printf(error, "type %w is not properly declared\n", [Name]),
|
|
+ printf(error, "type %w is not properly declared\n", [Name]),
|
|
fail
|
|
).
|
|
check_declaration(demo,
|
|
@@ -650,7 +645,7 @@
|
|
( atom(Name),
|
|
!
|
|
;
|
|
- opium_printf(error, "demo %w is not properly declared\n", [Name]),
|
|
+ printf(error, "demo %w is not properly declared\n", [Name]),
|
|
fail
|
|
).
|
|
|
|
@@ -675,14 +670,14 @@
|
|
member(ParType, [c, single, multiple]),
|
|
!
|
|
;
|
|
- opium_printf(error, "parameter %w is not properly declared\n", [Name]),
|
|
+ printf(error, "parameter %w is not properly declared\n", [Name]),
|
|
fail
|
|
).
|
|
|
|
default_args_correct(Name, ArgTypeList, DefaultArg, Mod) :-
|
|
var(DefaultArg),
|
|
!,
|
|
- opium_printf(error, "default of parameter %w must not be a variable\n", [Name]),
|
|
+ printf(error, "default of parameter %w must not be a variable\n", [Name]),
|
|
fail.
|
|
default_args_correct(Name, ArgTypeList, nodefault, Mod) :-
|
|
!.
|
|
@@ -690,7 +685,7 @@
|
|
is_list(DefaultArg),
|
|
!.
|
|
default_args_correct(Name, ArgTypeList, DefaultArg, Mod) :-
|
|
- opium_printf(error, "default values of parameter %w have to be in a list\n", [Name]),
|
|
+ printf(error, "default values of parameter %w have to be in a list\n", [Name]),
|
|
fail.
|
|
|
|
|