Lookup tables are used to reduce branching and improve performance when parsing and processing characters.
◆ REDUCT_CHAR_FLAGS
| #define REDUCT_CHAR_FLAGS |
( |
|
_c | ) |
(reductCharTable[(unsigned char)(_c)].flags) |
Get the character flags for a given character.
- Parameters
-
| _c | The character to get flags for. |
- Returns
- The character flags.
Definition at line 54 of file char.h.
◆ REDUCT_CHAR_TO_LOWER
| #define REDUCT_CHAR_TO_LOWER |
( |
|
_c | ) |
(reductCharTable[(unsigned char)(_c)].lower) |
Get the lowercase equivalent of a character.
- Parameters
-
| _c | The character to get the lowercase equivalent of. |
- Returns
- The lowercase equivalent of the character.
Definition at line 62 of file char.h.
◆ REDUCT_CHAR_TO_UPPER
| #define REDUCT_CHAR_TO_UPPER |
( |
|
_c | ) |
(reductCharTable[(unsigned char)(_c)].upper) |
Get the uppercase equivalent of a character.
- Parameters
-
| _c | The character to get the uppercase equivalent of. |
- Returns
- The uppercase equivalent of the character.
Definition at line 70 of file char.h.
◆ REDUCT_CHAR_IS_WHITESPACE
Check if a character is whitespace.
- Parameters
-
| _c | The character to check. |
- Returns
- REDUCT_TRUE if the character is whitespace, REDUCT_FALSE otherwise.
Definition at line 78 of file char.h.
◆ REDUCT_CHAR_IS_LETTER
Check if a character is a letter.
- Parameters
-
| _c | The character to check. |
- Returns
- REDUCT_TRUE if the character is a letter, REDUCT_FALSE otherwise.
Definition at line 86 of file char.h.
◆ REDUCT_CHAR_IS_DIGIT
Check if a character is a decimal digit.
- Parameters
-
| _c | The character to check. |
- Returns
- REDUCT_TRUE if the character is a decimal digit, REDUCT_FALSE otherwise.
Definition at line 94 of file char.h.
◆ REDUCT_CHAR_IS_SYMBOL
Check if a character is a symbol.
- Parameters
-
| _c | The character to check. |
- Returns
- REDUCT_TRUE if the character is a symbol, REDUCT_FALSE otherwise.
Definition at line 102 of file char.h.
◆ REDUCT_CHAR_IS_HEX_DIGIT
Check if a character is a hexidecimal digit.
- Parameters
-
| _c | The character to check. |
- Returns
- REDUCT_TRUE if the character is a hexidecimal digit, REDUCT_FALSE otherwise.
Definition at line 110 of file char.h.
◆ reduct_char_flags_t
Character classification flags.
Follows the grammar defined in the README.
| Enumerator |
|---|
| REDUCT_CHAR_LETTER | Is a letter.
|
| REDUCT_CHAR_DIGIT | Is a decimal digit.
|
| REDUCT_CHAR_SYMBOL | Is a symbol.
|
| REDUCT_CHAR_WHITESPACE | Is whitespace.
|
| REDUCT_CHAR_HEX_DIGIT | Is a hexidecimal digit.
|
Definition at line 20 of file char.h.
◆ reductCharTable
Global character lookup table.
Definition at line 6 of file char_impl.h.