[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

using prolog stream in c / big data input

From: Jean-Paul Berger
Subject: using prolog stream in c / big data input
Date: Sat, 05 Jan 2002 21:16:51 +0000

hi ev'ryone,

i am facing some serious problem when reading big amounts of data to prolog. i need to get a codes-list from a socket, which will be parsed using a DCG. but this list may contain up to 3Mb of data. i am using a recursive predicate read as follows:

% S is the stream and [A|B] the codes list
read(S,[A|B]) :-
        \+ at_end_of_stream,
        get_code(S, A),
        A \= -1, A \= 4,
        read(S, B).
read(_, []).

when trying to read a stream greater than 1.4Mb i get a stack overflow (GLOBALSZ=16000, LOCALSZ=16000, TRAILSZ=8000).

so now i would like to use a foreign C-function to get the data into the list. but i don't know, how to access the prolog-stream :(

OR is there any possibility to make the DCG-predicates use streams directly instead of lists? the grammar i am using is quite large, so it would be very hard to change that!

hope you can help me

Send and receive Hotmail on your mobile device:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]