reshape bits parsers

This commit is contained in:
Sven M. Hallberg 2013-05-14 17:20:05 +02:00
parent c794be5b6f
commit d081cf4284
3 changed files with 58 additions and 2 deletions

View file

@ -19,8 +19,8 @@ typedef struct HCFGrammar_ {
* therefore we must avoid 0 as a token value because NULL means "not in set".
*/
typedef uintptr_t HCFToken;
static inline HCFToken char_token(char c) { return (0x100 | c); }
static inline char token_char(HCFToken t) { return (0xFF & t); }
static inline HCFToken char_token(uint8_t c) { return (0x100 | c); }
static inline uint8_t token_char(HCFToken t) { return (0xFF & t); }
static const HCFToken end_token = 0x200;