[ The ECLiPSe Libraries | Reference Manual | Alphabetic Index ]library(source_processor)
Tools for processing ECLiPSe sources
Predicates
- meta_predicate_pattern(?Pattern)
- Describes built-in ECLiPSe meta-predicate patterns
- source_close(+SourcePos, +OptionList)
- Close an open ECLiPSe source file.
- source_open(+File, +OptionList, -SourcePos)
- Open an ECLiPSe source code file for subsequent processing
- source_read(+SourcePos, -NextPos, -Kind, -SourceTerm)
- Read the next term from an open ECLiPSe source file
Structures
- struct source_position(stream, file, line, offset, remaining_files, included_from, options, created_modules, oldcwd, module)
- Current source position
- struct source_term(term, vars)
- A source term with additional information
Examples
% This can be used as a template for source processing code:
% a source file is opened,
% every term is read and printed,
% then the file is closed
test(File) :-
source_open(File, [], SP0),
(
fromto(begin, _, Class, end),
fromto(SP0, SP1, SP2, SPend)
do
source_read(SP1, SP2, Class, SourceTerm),
SP1 = source_position with [file:F,line:L,module:M],
printf("%w %w:%d %w%n", [M,F,L,Class]),
arg(term of source_term, SourceTerm, Term),
writeclause(Term)
),
source_close(SPend, []).
About
- Author: Joachim Schimpf, IC-Parc
- Copyright © Imperial College London and Parc Technologies
- Date: $Date: 2003/09/02 19:23:12 $
Generated from source_processor.eci on Sat Aug 7 01:44:28 2004