33 typedef uint16_t attr_t;
58 extern char const ToLowerTab_8859_1[];
59 extern char const ToUpperTab_8859_1[];
60 extern attr_t
const PGN_CharAttrTab[];
63 inline char to_lower(
char c) {
return ToLowerTab_8859_1[c - CHAR_MIN]; }
65 inline char to_upper(
char c) {
return ToUpperTab_8859_1[c - CHAR_MIN]; }
77 inline attr_t
is_eol(
char c) {
return PGN_CharAttrTab[c - CHAR_MIN] &
pgn_eol; }
81 inline attr_t
is_file(
char c) {
return PGN_CharAttrTab[c - CHAR_MIN] &
pgn_file; }
83 inline attr_t
is_rank(
char c) {
return PGN_CharAttrTab[c - CHAR_MIN] &
pgn_rank; }
attr_t const pgn_digit
0123456789
char to_lower(char c)
Convert a character to its lower-case equivalent.
attr_t is_piece(char c)
Test whether a character is a chess piece symbol.
attr_t const pgn_file
abcdefgh
attr_t is_quote_or_eol(char c)
Test whether a character is a quote or EOL.
attr_t is_tagname_begin(char c)
Test whether a character could be the first character of a tagname.
attr_t const pgn_eol
'\r' |& #39;\n'
attr_t const pgn_tag_separator_junk
:=
attr_t is_alpha(char c)
Test whether a character is alphabetic.
attr_t const pgn_piece
RNBQK.
attr_t const pgn_tagname_continuation
(pgn_alnum |& #39;_')
attr_t const pgn_tagname_begin
pgn_alnum
attr_t is_printable(char c)
Test whether a character is allowed in a semi-colon comment.
attr_t is_blank(char c)
Test whether a character is a blank.
char to_upper(char c)
Convert a character to its upper-case equivalent.
attr_t is_printable_string(char c)
Test whether a character is allowed in a string.
attr_t is_check(char c)
Test whether a character is a check or mate symbol.
attr_t is_digit(char c)
Test whether a character is a digit.
attr_t is_rank(char c)
Test whether a character is a rank symbol.
attr_t is_white_space(char c)
Test whether a character is white space.
attr_t is_file(char c)
Test whether a character is a file symbol.
attr_t const pgn_alnum
(pgn_alpha | pgn_digit)
attr_t const pgn_comment_start
{;
attr_t const pgn_alpha
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
attr_t const pgn_white_space
(pgn_blank | pgn_eol)
attr_t is_alnum(char c)
Test whether a character is alphanumeric.
attr_t is_comment_start(char c)
Test whether a character is a comment start.
attr_t const pgn_quote_or_eol
(ntl_eol |& #39;"')
attr_t const pgn_punctuation_junk
,;
attr_t is_punctuation_junk(char c)
Test whether a character is punctuation junk.
attr_t const pgn_printable_string
ascii range(-96, -1) | ascii range(35, 91) |& #39;& #39; | ascii range(93, 126) |& #39;!'
attr_t const pgn_printable
ascii range(-96, -1) | ascii range(32, 126)
attr_t const pgn_blank
'& #39; |& #39;\t' |& #39;\v' |& #39;\f'. Note that& #39;\f' is normally not legal in a PGN.
attr_t is_eol(char c)
Test whether a character is an end-of-line character.
attr_t is_printable_comment(char c)
Test whether a character is allowed in a brace comment.
attr_t is_tagname_continuation(char c)
Test whether a character could be part of a tagname.
attr_t const pgn_rank
12345678
attr_t is_tag_separator_junk(char c)
Test whether a character could tag separator junk.
attr_t const pgn_printable_comment
ascii range(-96, -1) | ascii range(32, 124) |& #39;~' | pgn_blank | pgn_eol