[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [XBoard-devel] Fwd: A Context-free grammar for PGN
From: |
h.g. muller |
Subject: |
Re: [XBoard-devel] Fwd: A Context-free grammar for PGN |
Date: |
Thu, 23 Dec 2010 21:50:43 +0100 |
What is so exciting about that? If you ignore details that arguably
could be considered semantics (such as that variables have to be declared),
most languages can be described by CFG. PGN is no exception, if you drop
the requirement that the moves form a legal Chess game. I think it would be
quite trivial to write down the CFG.
If it were not for the nesting of variations, PGN could even be generated by
a regular expression. This is why flex can be used to parse it. I only have to
take care of the parentheses nesting in the back end.