[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: DCG and stack problems
From: |
Vic Bancroft |
Subject: |
Re: DCG and stack problems |
Date: |
Sun, 30 Dec 2001 23:07:13 -0500 (EST) |
On Mon, 31 Dec 2001, Johannes Middeke wrote:
> Is there any suitable way to process greater amounts of data? Or are there
> any modules for reading and parsing XML-data that don't use recursion?
You should try a repeat / fail loop. Prolog programs can reclaim
variables on backtracking. It might be a little dirty from a logical
perspective, but the pragmatic results will please you. Here is an
example from a program intended to read the users-prolog.mbox
http://www.ai.uga.edu/~bancroft/pub/gplfaq/faq_parse.pl
It's memory footprint grows in proportion to the asserted data. Are you
building a DOM style structure in memory as a result of the parse ?
Perhaps we could create an XML directory under the ExamplesPl . . .
An alternative would be to do some wrappers for an xml library in c or
c++, like Xerces [1] or expat [2].
more,
l8r,
v
--
katabatic cohabitation : to live together as if a married couple or in
company;
to exist together, relating as or being like a wind produced by the flow of
cold
dense air down a slope (as of a mountain or glacier) in an area subject to
radiational cooling. mailto:address@hidden http://america.net/~bancroft
[1] http://xml.apache.org/xalan-c/
[2] http://sourceforge.net/projects/expat/