xboard-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[XBoard-devel] Move Parser


From: h.g. muller
Subject: [XBoard-devel] Move Parser
Date: Tue, 01 Mar 2011 17:59:30 +0100

I was getting increasingly annoyed with the move parser.
Changing it was always very cumbersome, because the same back-end
actions are repeated in many different parsing rules. Furthermore, a
flex-generated parser suffers from several annoying limitations. I had
already solved the problem that it cannot handle nesting, by writing
a wrapper for it that could. But another limitation is that you cannot
make the syntax dependent on anything (just the semantics),
so you cannot for insance have e2e4-stye moves in Chess,
and 7g7f-style moves in Shogi. You would have to generate seperate
parser for that.

The immediate problem I was facing was that the existing parser
cannot handle multi-digit rank numbers in any of the move formats.
Solving that in the flex framework promised to be so cumbersome,
that I decided to completey re-write the parser from scratch.
So I have a parser.c file now that is original source, with about the
same capabilities as the 4.5.1 parser, which could be used to replace
the parser.c that is generated from parser.l. Difference is that it does
intrinsically understand multi-digit rank numbers and Shogi coordinates
(although I have it reject the latter outside variant shogi).

Problem is that this is a sensitive part of XBoard, and that the parser
contains lots of rules for non-PGN-compliant formats. So the fact
that I can use it to flawlessly read back the files saved by WinBoard
by no means proves that it is bug-free. So I certainly don't want to
dump it on the 4.5.x branch. Perhaps I will incorporate it in the 'alien'
branch, as there is an immediate application for it there, namely
19x19 Go. For that I will have to do some more work on it, though,
as the parser in that branch was already modified compared to 4.5.1
(implementing the syntax of multi-leg moves and null moves).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]