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).
Usage:defines_module(Base,Module)
The source Base.pl defines module Module.
Usage:def_multifile(Base,F,A,DynType)
The source Base.pl defines multifile predicate F/A, defined as DynType (static, dynamic, data or concurrent).
Usage:decl(Base,Decl)
The source Base.pl contains the declaration Decl as an itf-exported new_declaration.
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).
Usage:uses(Base,File)
The source Base.pl imports from file File.
Usage:adds(Base,File)
The source Base.pl does ensure_loaded/1 of file File.
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.
Usage:imports_all(Base,ImpFile)
The source Base.pl imports all predicates of ImpFile.
Usage:includes(Base,File)
The source Base.pl includes file File. Stored in itf file for dependency check.
Usage:loads(Base,File)
The source Base.pl does load_compilation_module of file File. Stored in itf file for dependency check.
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.
Usage:imports_nocheck(Base,Module,F,A)
The source Base.pl imports predicate F/A from module Module using import/2.
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.
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.
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.
Usage:meta_args(Mod,Meta)
Module Mod has meta_predicate declaration Meta.
Usage:defines(Mod,F,A)
Module Mod defines predicate F/A.
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.
Usage:
Identifies a source line range in a file.
location_t(loc(File,L1,L2)) :- atm(File), int(L1), int(L2).
Usage:location(Loc)
Unifies Loc with the locator of the current source line range. If this information can not be obtained, leaves Loc uninstantiated.
location_t(loc(File,L1,L2)) :- atm(File), int(L1), int(L2).
Usage:define_flag(Flag,FlagValues,Default)
Usage:do_on_abolish(G)