2001-01-29 22:09:24 +00:00
|
|
|
#ifndef UCOL_TOKENS_H
|
|
|
|
#define UCOL_TOKENS_H
|
|
|
|
|
|
|
|
#include "ucolimp.h"
|
|
|
|
|
2001-01-31 23:12:37 +00:00
|
|
|
#define UCOL_TOK_POLARITY_NEGATIVE 0
|
|
|
|
#define UCOL_TOK_POLARITY_POSITIVE 1
|
2001-01-29 22:09:24 +00:00
|
|
|
|
2001-01-31 23:12:37 +00:00
|
|
|
typedef struct UColToken UColToken;
|
2001-01-29 22:09:24 +00:00
|
|
|
|
2001-01-31 07:20:56 +00:00
|
|
|
typedef struct {
|
|
|
|
UColToken* first[2];
|
|
|
|
UColToken* last[2];
|
|
|
|
/*
|
2001-01-29 22:09:24 +00:00
|
|
|
UColToken* firstPositive;
|
|
|
|
UColToken* lastPositive;
|
|
|
|
UColToken* firstNegative;
|
|
|
|
UColToken* lastNegative;
|
2001-01-31 07:20:56 +00:00
|
|
|
*/
|
2001-01-29 22:09:24 +00:00
|
|
|
UColToken* reset;
|
|
|
|
uint32_t baseCE;
|
2001-02-08 01:04:43 +00:00
|
|
|
uint32_t baseContCE;
|
2001-01-29 22:09:24 +00:00
|
|
|
uint32_t nextCE;
|
2001-02-08 01:04:43 +00:00
|
|
|
uint32_t nextContCE;
|
2001-01-29 22:09:24 +00:00
|
|
|
uint32_t previousCE;
|
2001-02-08 01:04:43 +00:00
|
|
|
uint32_t previousContCE;
|
2001-02-09 01:04:08 +00:00
|
|
|
/* uint32_t strongest[2];*/
|
|
|
|
int32_t pos[3];
|
|
|
|
uint32_t gapsLo[9];
|
|
|
|
uint32_t gapsHi[9];
|
|
|
|
uint32_t numStr[3];
|
|
|
|
UColToken* fStrToken[3];
|
|
|
|
UColToken* lStrToken[3];
|
|
|
|
|
2001-01-31 23:12:37 +00:00
|
|
|
/*
|
2001-01-29 22:09:24 +00:00
|
|
|
UColAttributeValue strongestP;
|
|
|
|
UColAttributeValue strongestN;
|
2001-01-31 23:12:37 +00:00
|
|
|
*/
|
2001-01-31 07:20:56 +00:00
|
|
|
} UColTokListHeader;
|
|
|
|
|
|
|
|
struct UColToken {
|
2001-01-31 21:10:55 +00:00
|
|
|
UChar debugSource;
|
|
|
|
UChar debugExpansion;
|
2001-01-31 07:20:56 +00:00
|
|
|
uint32_t source;
|
|
|
|
uint32_t expansion;
|
2001-01-31 23:12:37 +00:00
|
|
|
uint32_t strength;
|
2001-02-09 01:04:08 +00:00
|
|
|
uint32_t toInsert;
|
2001-01-31 23:12:37 +00:00
|
|
|
uint32_t polarity; /* 1 for <, <<, <<<, , ; and -1 for >, >>, >>> */
|
2001-01-31 07:20:56 +00:00
|
|
|
UColTokListHeader *listHeader;
|
2001-01-31 21:10:55 +00:00
|
|
|
UColToken* previous;
|
|
|
|
UColToken* next;
|
2001-01-29 22:09:24 +00:00
|
|
|
};
|
|
|
|
|
2001-01-31 07:20:56 +00:00
|
|
|
typedef struct {
|
2001-01-29 22:09:24 +00:00
|
|
|
const UChar *source;
|
|
|
|
const UChar *end;
|
|
|
|
const UChar *current;
|
2001-01-31 07:20:56 +00:00
|
|
|
const InverseTableHeader *invUCA;
|
|
|
|
const UCollator *UCA;
|
|
|
|
uint32_t resultLen;
|
|
|
|
UColTokListHeader *lh;
|
|
|
|
} UColTokenParser;
|
|
|
|
|
|
|
|
|
|
|
|
#define ucol_tok_isSpecialChar(ch) \
|
2001-02-05 05:36:12 +00:00
|
|
|
(((((ch) <= 0x002F) && ((ch) >= 0x0020)) || \
|
2001-01-31 07:20:56 +00:00
|
|
|
(((ch) <= 0x003F) && ((ch) >= 0x003A)) || \
|
|
|
|
(((ch) <= 0x0060) && ((ch) >= 0x005B)) || \
|
|
|
|
(((ch) <= 0x007E) && ((ch) >= 0x007B))))
|
2001-01-29 22:09:24 +00:00
|
|
|
|
|
|
|
|
2001-01-31 07:20:56 +00:00
|
|
|
U_CFUNC UColToken *ucol_tok_parse_next_token(UColTokenParser *src, UErrorCode *status);
|
2001-01-29 22:09:24 +00:00
|
|
|
U_CFUNC UColToken *ucol_tok_open();
|
2001-01-31 07:20:56 +00:00
|
|
|
U_CFUNC uint32_t ucol_tok_assembleTokenList(UColTokenParser *src, UErrorCode *status);
|
2001-02-05 05:36:12 +00:00
|
|
|
|
2001-01-29 22:09:24 +00:00
|
|
|
#endif
|