Compiler frontend

Author(s): The Ciao Development Team.

This module implements the Ciao compiler front-end.

The main entry point for the front-end is the process_files_from/7 predicate, which process (Ciao) source files and all their dependencies. Source file processing is incremental and dependecy extraction automatic from source declarations. For each processed file, a user-provided back-end (as higher-order arguments) is invoked.

Based on incremental file processing, this module implements source-to-bytecode compilation (using pl2wam and wamql as back-end) and basic support for dynamic module loading (use_mod/3).

Documentation on exports

No further documentation available for this predicate.

No further documentation available for this predicate.

PREDICATEopt_suffix/2
No further documentation available for this predicate.

Usage:defines_module(Base,Module)

The source Base.pl defines module Module.

    The predicate is of type data.

    Usage:def_multifile(Base,F,A,DynType)

    The source Base.pl defines multifile predicate F/A, defined as DynType (static, dynamic, data or concurrent).

      The predicate is of type data.

      PREDICATEdecl/2

      Usage:decl(Base,Decl)

      The source Base.pl contains the declaration Decl as an itf-exported new_declaration.

        The predicate is of type data.

        PREDICATEexports/5

        Usage:exports(Base,F,A,DefType,Meta)

        The source Base.pl exports predicate F/A, defined as DefType (static, implicit, dynamic, data or concurrent) and with meta_predicate declaration Meta (which can be 0 if it has not).

          PREDICATEuses/2

          Usage:uses(Base,File)

          The source Base.pl imports from file File.

            The predicate is of type data.

            PREDICATEadds/2

            Usage:adds(Base,File)

            The source Base.pl does ensure_loaded/1 of file File.

              The predicate is of type data.

              PREDICATEuses_file/2

              Usage:uses_file(Base,File)

              The source Base.pl uses file File explicitly through use_module/1 or use_module/2 or implicity.

                Usage:imports_pred(Base,ImpFile,F,A,DefType,Meta,EndFile)

                The source Base.pl imports from file ImpFile predicate F/A. Predicate is defined as DefType and has meta_predicate declaration Meta (possibly 0). EndFile is '.' if the predicate resides in ImpFile, otherwise it is the file in which the predicate resides (due to reexportations). Stored in itf file for dependency check.

                  The predicate is of type data.

                  PREDICATEimports_all/2

                  Usage:imports_all(Base,ImpFile)

                  The source Base.pl imports all predicates of ImpFile.

                    The predicate is of type data.

                    PREDICATEincludes/2

                    Usage:includes(Base,File)

                    The source Base.pl includes file File. Stored in itf file for dependency check.

                      The predicate is of type data.

                      PREDICATEloads/2

                      Usage:loads(Base,File)

                      The source Base.pl does load_compilation_module of file File. Stored in itf file for dependency check.

                        The predicate is of type data.

                        PREDICATEclause_of/7

                        Usage:clause_of(Base,Head,Body,VarNames,Source,Line0,Line1)

                        We have read from Base.pl (or included files) the clause Head :- Body, which has variable names VarNames, and is located in source Source (that changes if clauses are from an included file) between lines Line0 and Line1. In the special case that Head is a number, Body is the body of a declaration.

                          The predicate is of type data.

                          PREDICATEpackage/2
                          The predicate is of type data.

                          Usage:imports_nocheck(Base,Module,F,A)

                          The source Base.pl imports predicate F/A from module Module using import/2.

                            The predicate is of type data.

                            The predicate is of type data.

                            PREDICATEmeta_pred/4
                            The predicate is of type data.

                            PREDICATEdyn_decl/4
                            The predicate is of type data.

                            PREDICATEdefines/5

                            Usage:defines(Base,F,A,DefType,Meta)

                            The source Base.pl defines predicate F/A, defined as DefType (static, implicit, dynamic, data or concurrent) and with meta_predicate declaration Meta (which can be 0 if it has not). Generated by calling comp_defines/1.

                              The predicate is of type data.

                              Usage:comp_defines(Base)

                              Can be used in the TreatP phase of the compilation process to generate facts of defines/5 for source Base.pl

                                Usage:restore_defines(Base,F,A,DefType,Meta)

                                Given the same arguments obtained from defines/5, it generates (assert in c_itf DB) all necessary data to offer itf functionality.

                                  Usage:restore_imports(M,IM,F,A,EndMod)

                                  Given the same arguments obtained from imports/5, it restores c_itf imports DB.

                                    Usage:restore_multifile(M,IM,F,Def)

                                    Given the same arguments obtained from multifile/4, it restores c_itf multifile DB.

                                      PREDICATEimports/5

                                      Usage:imports(Mod,Mod2,F,A,EndMod)

                                      Module Mod imports from module Mod2 predicate F/A, which resides in module EndMod. EndMod can be different from Mod2 due to reexportation.

                                        The predicate is of type data.

                                        PREDICATEmeta_args/2

                                        Usage:meta_args(Mod,Meta)

                                        Module Mod has meta_predicate declaration Meta.

                                          The predicate is of type data.

                                          PREDICATEmultifile/3
                                          No further documentation available for this predicate.

                                          PREDICATEdefines/3

                                          Usage:defines(Mod,F,A)

                                          Module Mod defines predicate F/A.

                                            The predicate is of type data.

                                            The predicate is of type data.

                                            Usage:add_module_check(Pred)

                                            Used by code expanders (loaded with load_compilation_module/1 declarations) to provide additional checks to be executed before the current file is compiled. The predicate is called with the base name of the file processed as the first argument, and all solutions will be found. A fact module_error/0 can be asserted if a condition which should stop the compilation is found.

                                              Meta-predicate with arguments: add_module_check(pred(1)).

                                              No further documentation available for this predicate.

                                              PREDICATEdefine_ops/0
                                              No further documentation available for this predicate.

                                              PREDICATEprocessed/2
                                              The predicate is of type data.

                                              No further documentation available for this predicate. Meta-predicate with arguments: process_files_from(?,?,?,pred(1),pred(1),pred(1),pred(1)).

                                              No further documentation available for this predicate. Meta-predicate with arguments: process_file(?,?,?,pred(1),pred(1),pred(1),pred(1)).

                                              No further documentation available for this predicate.

                                              No further documentation available for this predicate.

                                              No further documentation available for this predicate.

                                              PREDICATEbase_name/2
                                              No further documentation available for this predicate.

                                              PREDICATEfile_data/3
                                              No further documentation available for this predicate. The predicate is of type data.

                                              No further documentation available for this predicate.

                                              No further documentation available for this predicate.

                                              The predicate is of type data.

                                              No further documentation available for this predicate. The predicate is of type data.

                                              No further documentation available for this predicate. The predicate is of type data.

                                              No further documentation available for this predicate.

                                              No further documentation available for this predicate.

                                              No further documentation available for this predicate. The predicate is of type data.

                                              PREDICATEhandle_exc/1
                                              No further documentation available for this predicate.

                                              PREDICATEfalse/1
                                              No further documentation available for this predicate.

                                              No further documentation available for this predicate.

                                              No further documentation available for this predicate.

                                              No further documentation available for this predicate.

                                              No further documentation available for this predicate.

                                              No further documentation available for this predicate.

                                              No further documentation available for this predicate.

                                              No further documentation available for this predicate.

                                              No further documentation available for this predicate. The predicate is of type data.

                                              PREDICATEpred_module/2
                                              No further documentation available for this predicate. The predicate is of type data.

                                              Usage:

                                              Identifies a source line range in a file.

                                              location_t(loc(File,L1,L2)) :-
                                                  atm(File),
                                                  int(L1),
                                                  int(L2).
                                              

                                                PREDICATElocation/3

                                                Usage:

                                                • The following properties should hold upon exit:
                                                  (atm/1)Arg1 is an atom.
                                                  (int/1)Arg2 is an integer.
                                                  (int/1)Arg3 is an integer.
                                                The predicate is of type data.

                                                PREDICATElocation/1

                                                Usage:location(Loc)

                                                Unifies Loc with the locator of the current source line range. If this information can not be obtained, leaves Loc uninstantiated.

                                                • The following properties should hold upon exit:
                                                  (location_t/1)Identifies a source line range in a file.
                                                  location_t(loc(File,L1,L2)) :-
                                                      atm(File),
                                                      int(L1),
                                                      int(L2).
                                                  

                                                No further documentation available for this predicate.

                                                PREDICATEmultifile/1
                                                No further documentation available for this predicate.

                                                No further documentation available for this predicate. The predicate is of type data.

                                                No further documentation available for this predicate.

                                                PREDICATEstatic_base/1
                                                No further documentation available for this predicate.

                                                PREDICATEuse_mod/3
                                                No further documentation available for this predicate.

                                                No further documentation available for this predicate.

                                                No further documentation available for this predicate.

                                                PREDICATEunload_mod/1
                                                No further documentation available for this predicate.

                                                No further documentation available for this predicate. The predicate is of type data.

                                                No further documentation available for this predicate. The predicate is of type data.

                                                No further documentation available for this predicate. The predicate is of type data.

                                                Documentation on multifiles

                                                PREDICATEdefine_flag/3

                                                Usage:define_flag(Flag,FlagValues,Default)

                                                • The following properties hold upon exit:
                                                  (atm/1)Flag is an atom.
                                                  (flag_values/1)Define the valid flag values
                                                The predicate is multifile.

                                                Usage:do_on_abolish(G)

                                                • The following properties should hold at call time:
                                                  (cgoal/1)G is a term which represents a goal, i.e., an atom or a structure.
                                                The predicate is multifile.