Why Strings as Classes?

BCS ao at pathlink.com
Tue Aug 26 13:07:19 PDT 2008


Reply to Benji,

> superdan wrote:
> 
>> Benji Smith Wrote:
>> 
>>> I wrote a streaming CSV parser (which takes discipline to do
>>> correctly, since a double-quote enclosed field can legally contain
>>> arbitrary newline characters, and quotes are escaped by doubling).
>>> It provides a field callback and a record callback, so it's very
>>> handy for performing ETL tasks.
>>> 
>>> If I had to load the whole CSV files into memory before parsing, it
>>> wouldn't work, because sometimes they can be hundreds of megabytes.
>>> But the streaming parser takes up almost no memory at all.
>>> 
>>> --benji
>>> 
>> sure it takes very little memory. i'll tell u how much memory u need
>> in fact. it's the finite state needed by the fsa. u could do that
>> because csv only needs finite state for parsing. soon as you need to
>> backtrack stream parsing becomes very difficult.
>> 
> Noooooooobody uses backtracking to parse.
> 
> Most of the time LL(k) token lookahead solves the problem. Sometimes
> you need a syntactic predicate or (rarely) a semantic predicate.
> 
> I've never even heard of a parser generator framework that supported
> backtracking.
> 
> --benji
> 

Antlr, dparse and (IIRC) eniki all do





More information about the Digitalmars-d mailing list