[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-gnubg] Parsing the Kit Woolsey - Jeremy Bagai match
From: |
Joern Thyssen |
Subject: |
Re: [Bug-gnubg] Parsing the Kit Woolsey - Jeremy Bagai match |
Date: |
Mon, 29 Sep 2003 12:12:55 +0000 |
User-agent: |
Mutt/1.4.1i |
On Mon, Sep 29, 2003 at 11:42:24AM +0200, Øystein Johansen wrote
> >===== Original Message From Jon Kinsey <address@hidden> =====
> >At 18:47 28/09/2003, you wrote:
> >>Hi,
> >>
> >>I'm trying to make a parsing algoritme to parse the Kit Woolsey Jeremy
> >>Bagai match founf here:
> >>http://www.csc.no/~paalf/BG/matches/KitWoolsey-JeremyB.txt.gz
> >>
> >>I'm having problems getting the comments into the commentary field. Does
> >>anyone have any ideas?
> >
> >Looks like
> >[<white space>]<name>:<comment><new line><new line>
> >
> >Just look for a word followed by a colon at the line start.
>
> Finding the comment text isn't the problem. Sorry I didn't state that. The
> problem is to add it into the mavelist as a comment. I think I have to parse
> it twice since there is no way to add comments while I'm playing.
No, but what has this got to do with parsing a file? The problem there
is that there is no alloc'ed moverecord until *after* the move. When
parsing a file you can just allocate a temporary buffer for the command
and assign it to the moverecord you've just alloc'ed.
Look at my code for parsing SGG files:
You just save the comment in some buffer and assign
pmr->n.sz = some buffer
prm->d.sz = some buffer
or whatever.
Jørn
pgpyjM6Z2g4KZ.pgp
Description: PGP signature