Frontend driver (monolithic)

This module provides the main entry points for loading source programs (in a suitable form for performing analysis and transformations) and print them back as source.

Adding new frontend

(to be written)


Usage and interface

Documentation on exports

supported_language(L)

Indicates that a translation is available from language L to Ciao Prolog language.

language_extension(L,E)

E is an extension (including the dot) for files that must be translated from language L to Ciao.

language_output_extension(L,E)

E is the extension of the file produced as output by the Ciao printer for language L.

translate_input_file(L,In,O,M,Out)

This is the main predicate called when the file In needs to be translated from language L into Ciao Prolog. Some options to the translation may be passed in the variable O and the module name that one wants to get can be given in M. The translation should produce a file and indicate where it is located through O.

Usage:translate_input_file(L,In,O,M,Out)

initial_transformations(L,T)

T is the initial list of transformations needed for language L after it has been loaded as clauses.

Usage:initial_transformations(L,T)

Usage:detect_language(AbsFile,Lang)

Lang is the detected language for AbsFile file.

    PREDICATEmodule/1

    Usage 1:module(FileName)

    Reads the code of FileName and its preprocessing unit, and sets it as the current module.

    • The following properties should hold at call time:
      (nonvar/1)FileName is currently a term which is not a free variable.
      (sourcename/1)FileName is a source name.

    Usage 2:module(FileNameList)

    Reads the code of the list of file names FileNameList (and their preprocessing units), and sets them as the current modules.

    • The following properties should hold at call time:
      (nonvar/1)FileNameList is currently a term which is not a free variable.
      (list/2)FileNameList is a list of atms.

    PREDICATEmodule/2

    Usage:module(Ms,Info)

    Same as module/1 but it also prints the time required to read the module and returns extra information (including the time) on its second argument.

    • The following properties should hold at call time:
      (nonvar/1)Ms is currently a term which is not a free variable.
      (var/1)Info is a free variable.

    Usage:

    Loads the already preprocess sources of the libraries. This predicate is called implicitly by module/1 but that we can call it explicitly to ensure that the cache is preloaded.

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

      PREDICATEoutput/0

      Usage:

      Outputs the current module preprocessing state with the default output options. Equivalent to output(File,[]).

        PREDICATEoutput/1

        Usage:output(File)

        Outputs to File the current module preprocessing state with the default output options. If unbound, File is unified with a default name (encoding the preprocessing steps). Equivalent to output(File,[]).

          PREDICATEoutput/2

          Usage:output(File,Opts)

          Outputs the current module preprocessing state to a file File. If unbound, File is unified with a default name (encoding the preprocessing steps). The output format (which should be valid for the loaded program) is guessed from the file extension. Opts is a list of options for this predicate (see output_option/1)

          • The following properties should hold at call time:
            (nonvar/1)Opts is currently a term which is not a free variable.

          PREDICATEoutput_ext/1

          Usage:output_ext(Ext)

          Extension Ext is a supported output extension.

          • The following properties should hold at call time:
            (atm/1)Ext is an atom.

          Usage:output_by_ext(Ext,File)

          Produce output File for the given extension Ext.

          • The following properties should hold at call time:
            (atm/1)Ext is an atom.
            (sourcename/1)File is a source name.

          No further documentation available for this predicate.

          No further documentation available for this predicate.

          Usage:

          Generate and preload the preprocessed assertions from the libraries (specified in the cmds/cachedmods/cached_core.pl module.

          .

            (UNDOC_REEXPORT)get_data/2
            Imported from p_dump (see the corresponding documentation for details).

            (UNDOC_REEXPORT)clean_ciaopp_db/1
            Imported from p_dump (see the corresponding documentation for details).

            (UNDOC_REEXPORT)clean_all_ciaopp_db/0
            Imported from p_dump (see the corresponding documentation for details).

            (UNDOC_REEXPORT)dump/2
            Imported from p_dump (see the corresponding documentation for details).

            (UNDOC_REEXPORT)dump_dir/1
            Imported from p_dump (see the corresponding documentation for details).

            (UNDOC_REEXPORT)add_to_db/1
            Imported from p_dump (see the corresponding documentation for details).

            (UNDOC_REEXPORT)show_dump/1
            Imported from p_dump (see the corresponding documentation for details).

            (UNDOC_REEXPORT)restore/2
            Imported from p_dump (see the corresponding documentation for details).

            (UNDOC_REEXPORT)restore/1
            Imported from p_dump (see the corresponding documentation for details).

            (UNDOC_REEXPORT)dump/1
            Imported from p_dump (see the corresponding documentation for details).