
pio.plThe following predicates are exported from this file while their implementation is defined in imported modules or non-module files loaded by this module.
phrase_from_file(:Grammar, +File) is nondet
:- use_module(library(dcg/basics)).
file_contains(File, Pattern) :-
phrase_from_file(match(Pattern), File).
match(Pattern) -->
string(_),
string(Pattern),
remainder(_).
match_count(File, Pattern, Count) :-
aggregate_all(count, file_contains(File, Pattern), Count).
This can be called as (note that the pattern must be a string (code list)):
?- match_count('pure_input.pl', `file`, Count).
phrase_from_file(:Grammar, +File, +Options) is nondet
phrase_from_stream(:Grammar, +Stream)
stream_to_lazy_list(+Stream, -List) is detThe following predicates are exported, but not or incorrectly documented.
lazy_list_character_count(Arg1, Arg2, Arg3)
lazy_list_location(Arg1, Arg2, Arg3)
syntax_error(Arg1, Arg2, Arg3)