Advertisement
Guest User

chess_moves.bnf

a guest
Jul 13th, 2018
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
BNF 0.94 KB | None | 0 0
  1. move ::= (<simpleMove> | <standardMove>) <suffix>
  2. <simpleMove> ::= (fromFile = <file>) (fromRank = <rank>) (toFile = <file>) (toRank = <rank>)
  3. <standardMove> ::= <normalMove> | <bishopMove> | <pawnMove> | <castle>
  4. <normalMove> ::= (piece = <nonBishopPiece>) ((fromFile = <file>) | (fromRank = <rank>))? "x"? (toFile = <file>) (toRank = <rank>)
  5. <bishopMove> ::= (((piece = "B") "x") | (piece = <bishopPiece>)) (fromFile = <file>)? (toFile = <file>) (toRank = <rank>)
  6. <pawnMove> ::= ((fromFile = <file>) "x")? (toFile = <file>) (toRank = <rank>)
  7. <castle> ::= (queensideCastle = "0-0-0") | (kingsideCastle = "0-0")
  8. <file> ::= /[a-hA-H]/
  9. <rank> ::= /[1-8]/
  10. <nonBishopPiece> ::= "p" | "P" | "r" | "R" | "n" | "N" | "q" | "Q" | "k" | "K"
  11. <bishopPiece> ::= "b" | "B"
  12. <suffix> ::= <promotion>? <check>
  13. <promotion> ::= "=" (promotedPiece = <promotablePiece>)
  14. <promotablePiece> ::= "r" | "R" | "n" | "N" | "b" | "B" | "q" | "Q"
  15. <check> ::= "+" | "++" | "#"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement