Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Project notions -- two programming projects that would make ...

Author: Dann Corbit

Date: 01:57:10 06/14/00

Go up one level in this thread


On June 14, 2000 at 02:31:56, Oliver Roese wrote:

>On June 13, 2000 at 17:17:36, Dann Corbit wrote:
>
>>... the chess programmer's life a whole lot easier.
>>
>>Write a formal BNF grammar for:
>>
>>1. PGN (with the EPD and FEN subsets, darn it!)  This one should probably hold
>>off until PGN II comes out in the near future.
>>
>
>The original specification of Edwards contains already a grammar, written in
>BNF. Scroll down up to the very end of the document and there you have it!

If you mean this:

18: Formal syntax

<PGN-database> ::= <PGN-game> <PGN-database>
                   <empty>

<PGN-game> ::= <tag-section> <movetext-section>

<tag-section> ::= <tag-pair> <tag-section>
                  <empty>

<tag-pair> ::= [ <tag-name> <tag-value> ]

<tag-name> ::= <identifier>

<tag-value> ::= <string>

<movetext-section> ::= <element-sequence> <game-termination>

<element-sequence> ::= <element> <element-sequence>
                       <recursive-variation> <element-sequence>
                       <empty>

<element> ::= <move-number-indication>
              <SAN-move>
              <numeric-annotation-glyph>

<recursive-variation> ::= ( <element-sequence> )

<game-termination> ::= 1-0
                       0-1
                       1/2-1/2
                       *
<empty> ::=

It's about 1% of what is actually needed.




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.