Best practices for parsing files

BCS ao at pathlink.com
Fri Jan 26 08:52:10 PST 2007


Reply to lurker,

> BCS wrote:
> 
>> As far as slicing goes, I'm working on a parser that read a file into
>> memory (I guess it could mmap it in as well) and converts it to an
>> array of token structs. A parser will then walk on the array. If you
>> new a big array of struct in advance and have your lexer write
>> directly to the array (slicing out of the file where the text is
>> important, that should be fairly fast.
>> 
> Excellent! Is any of your code available? We really would like take a
> look at your code (If possible). We are a little lost right now and by
> your description It seams very much like what we want to build.
> 
> Thanks
> 

That isn't how my lexer works (at the moment), I was just saying I think 
it could be done. In fact, my app copies everything to make sure that it 
doesn't stomp on it's self.

OTOH, it wouldn't be to hard to port it to what I described above, and I 
plan on posting the code when I get a bit closer to done.





More information about the Digitalmars-d mailing list