Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Implementing a PGN parser. Should I care about the import format ?

Author: Fabien Letouzey

Date: 01:28:35 02/22/05

Go up one level in this thread


On February 21, 2005 at 08:49:35, Mathieu Pagé wrote:

Hi Mathieu,

>I found it funny to read this in the introduction of the standard : "PGN is
>structured for easy reading and writing by human users and for easy parsing and
>generation by computer programs."

>Can someone explain me wich feature of the pgn standard is meant to be easy to
>parse ?

I guess scanning/parsing knowledge was assumed.

In the case of PGN:

1) Tokens are simple (can be described by regular expressions): no need to look
ahead more than one character after a token to determine its type.

2) The grammar is also simple, here LL(1): with one token of look-ahead you can
decide which production rule to apply.  You can find the grammar near the bottom
of the PGN specification.

This is a part of language design; some old languages like Fortran-77 are
difficult to parse.

In any case this is only my opinion, not a definition of "parsing easiness".

Fabien.




This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.