Hi,

I have to convert PGN files using algebraic notation and I'm doing ok so far.

I have one major stumbling block and I was wondering if anyone has
done something similar.

Algebraic notation is a short form of chess move that only contains an
optional piece identifier, followed by destination square followed by
optional markers:
e5 => pawn moves to e5
Bf3 => Bishop moves to f3
Nh2+ => Knight moves to h2 (and check)

Parsing these is ok, but my task is to generate output containing both
start and end positions for a move.  My research seems to indicate
that this isn't easy without maintaining the current state of the
board and applying each move as I parse it to update the board and
therefore be able to determine where the move came from.  Another
option is to maintain an index of piece-destination
(possible_start_position_1, possible_start_position_2...) - and then
for each piece lookup where it could possibly have come from - I'm not
sure this helps though :)

What was a simple text transformation problem has become a game engine!

I'd be interested to hear any thoughts from people who have attempted
PGN parsing in antlr

Thanks,
Kev

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to