From: Christopher R. <cro...@uo...> - 2007-07-31 18:45:54
|
I think I'll be able to make it work based on what you and others have suggested. I do believe it is a common enough problem, so it's something to keep in mind if the parser methodology is resigned at some point. Chris -----Original Message----- From: Noel O'Boyle [mailto:bao...@gm...] Sent: Tuesday, July 31, 2007 5:27 AM To: Christopher Rowley Cc: cclib-dev List Subject: Re: [cclib-devel] Peeking with iterator I would say avoid peeking and seeking and all that. All you need to do is to make sure that the code for reading in the next section, follows the code for reading in this section, and that the name of the variable containing the "$" line is the same as the name of the variable that is used in the big loop over all lines (typically the variable name is "line"). Does this make sense? I've done this one before. Will this fit all cases? (i.e. do you always know the order of the sections). Clearly, it would be very helpful if you add comments indicating that the order of a particular section is important if you use this method. I see that you've uploaded some datafiles. Can you point to the specific example? Maybe I can think of some other way... Noel On 31/07/07, Christopher Rowley <cro...@uo...> wrote: > > > > > Is there a preferred way to peek ahead in inputfile iterator? The problem > I'm having is that the only way to tell if a section is over is if the next > line is the start of the new section (ie, it starts with a $). I can think > of one work around, which is to use tell() to get the starting position of > the new line, and then seeking back to that point it if it is the end of the > section. Please let me know if there a more elegant way to do this. > > > > Chris > ------------------------------------------------------------------------ - > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > cclib-devel mailing list > ccl...@li... > https://lists.sourceforge.net/lists/listinfo/cclib-devel > > |