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.

    PREDICATEoutput/0

    Usage:

    Outputs the current Module preprocessing state to a file named Module_opt.ext, where Module is the current module.

      PREDICATEoutput/1

      Usage:output(Output)

      Outputs the current module preprocessing state to a file Output. The output format (which should be valid for the loaded program) is guessed from the file extension.

      • The following properties should hold at call time:
        (nonvar/1)Output 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.

      (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)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).