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];*/
|
2001-02-21 17:45:06 +00:00
|
|
|
int32_t pos[UCOL_STRENGTH_LIMIT];
|
|
|
|
uint32_t gapsLo[3*UCOL_CE_STRENGTH_LIMIT];
|
|
|
|
uint32_t gapsHi[3*UCOL_CE_STRENGTH_LIMIT];
|
|
|
|
uint32_t numStr[UCOL_CE_STRENGTH_LIMIT];
|
|
|
|
UColToken* fStrToken[UCOL_CE_STRENGTH_LIMIT];
|
|
|
|
UColToken* lStrToken[UCOL_CE_STRENGTH_LIMIT];
|
2001-02-09 01:04:08 +00:00
|
|
|
|
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-02-26 10:28:56 +00:00
|
|
|
uint32_t CEs[128];
|
|
|
|
uint32_t noOfCEs;
|
|
|
|
uint32_t expCEs[128];
|
|
|
|
uint32_t noOfExpCEs;
|
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-03-01 00:14:29 +00:00
|
|
|
UBool caseBit;
|
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;
|
2001-02-26 10:28:56 +00:00
|
|
|
UCATableHeader *image;
|
2001-01-31 07:20:56 +00:00
|
|
|
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 uint32_t ucol_tok_assembleTokenList(UColTokenParser *src, UErrorCode *status);
|
2001-02-28 21:50:23 +00:00
|
|
|
U_CFUNC void ucol_tok_closeTokenList(UColTokenParser *src);
|
2001-02-05 05:36:12 +00:00
|
|
|
|
2001-02-28 19:01:23 +00:00
|
|
|
int32_t uhash_hashTokens(const void *k);
|
|
|
|
UBool uhash_compareTokens(const void *key1, const void *key2);
|
|
|
|
void ucol_tok_initTokenList(UColTokenParser *src, UErrorCode *status);
|
|
|
|
uint32_t ucol_uprv_tok_assembleTokenList(UColTokenParser *src, UErrorCode *status);
|
|
|
|
|
2001-01-29 22:09:24 +00:00
|
|
|
#endif
|
2001-02-28 19:01:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
|