Boost logo

Boost :

From: Larry Evans (jcampbell3_at_[hidden])
Date: 2002-10-20 21:31:06


Joel de Guzman wrote:

>----- Original Message -----
>From: "Larry Evans" <jcampbell3_at_[hidden]>
>
>
>
>
>>I was wondering if the spirit experts could provide
>>any more justifcation of using spirit to parse qif
>>files for gnucash?
>>
>>
>
>Well, I don't know a thing about qif or gnuscash but I
>don't understand the context of:
>"But not spirit since it has infinite lookahead and "dynamic parsing".
>And I don't see any "link to boost mail-list in my reply to cbbrowne."
>So, really, I'm lost. Could you give us a brief backgrounder?
>
Sure. See
http://www.gnucash.org/pipermail/gnucash-devel/2002-October/007086.html.
Also, the code (it's written in guile, a version of scheme which uses
some "gwrappers" to interface to c code) is at:
  
 http://www.gnucash.org/lxr/gnucash/source/src/import-export/qif-import/qif-parse.scm
The ambiguity centers around parsing doubles and dates and maybe other
items.
Anyway, the ambiguity is indicated by calls to check-and-parse-fields in
function

qif-file:parse-fields

at
http://www.gnucash.org/lxr/gnucash/source/src/import-export/qif-import/qif-file.scm#459
The argument that's quoted, e.g.

'(decimal comma)

indicates the number of regular expressions to try. If more than 1
fits, then a check is
made to see that the result, of type double, is the same and if not an
error is signalled.
What makes it especially frustrating is the constant switching between c
and guile.
For example, the call to:

gnc:double-to-gnc-numeric

at
http://www.gnucash.org/lxr/gnucash/source/src/import-export/qif-import/qif-parse.scm#498
actually calls a c function defined at
http://www.gnucash.org/lxr/gnucash/source/src/engine/gnc-numeric.c#809.

Hope that helps.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk