On 12 Sep 2004, at 10:07, Remo D. wrote:

I'm working on all the suggestions that you posted on the "output data
structure" subject and I have a question for you all.

Just imagine you are in the middle of a parsing and have just recognized the
body of a K: field.

<snip>

To avoid unnecessary work, I decided to provide separate functions to parse
the field bodies instead of parsing them anyway.


In other words, you first receive the entire body of the field as a string
and then, if you are really really interested, you call a function like:


  k=abcKey(string);

to really parse the field body, extract all the information and pack them
into k.


And keep in mind that this mechanism have to work even when accessing the
functions from Java, Object Pascal, Lua, Python, ... !


Anyone sees any drawback with this approach?

That seems like a good way to go. Have one main function to deal with fields
which just returns the contents of any field as a string, then a series of
special functions to extract specific information from the string. Same
approach will be needed for other fields too, esp. M: and V: fields in the
header.


Phil Taylor

To subscribe/unsubscribe, point your browser to: http://www.tullochgorm.com/lists.html

Reply via email to