gecko-dev/layout/style/nsCSSKeywords.cpp
1998-04-25 19:11:20 +00:00

400 lines
11 KiB
C++

/*
** This is a generated file, do not edit it. This file is created by
** genhash.pl
*/
#include "plstr.h"
#include "nsCSSKeywords.h"
#define TOTAL_KEYWORDS 91
#define MIN_WORD_LENGTH 2
#define MAX_WORD_LENGTH 12
#define MIN_HASH_VALUE 12
#define MAX_HASH_VALUE 312
/* maximum key range = 301, duplicates = 0 */
struct StaticNameTable {
char* tag;
PRInt32 id;
};
static const unsigned char kLowerLookup[256] = {
0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,
32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,
48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,
64,
97,98,99,100,101,102,103,104,105,106,107,108,109,
110,111,112,113,114,115,116,117,118,119,120,121,122,
91, 92, 93, 94, 95, 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111,
112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,
128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,
144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,
160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,
176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,
192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,
208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,
224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,
240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
};
#define MYLOWER(x) kLowerLookup[((x) & 0x7f)]
/**
* Map a name to an ID or -1
*/
PRInt32 nsCSSKeywords::LookupName(const char* str)
{
static unsigned short asso_values[] =
{
313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
313, 313, 313, 313, 313, 7, 313, 313, 313, 313,
313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
313, 313, 313, 313, 313, 313, 313, 313, 313, 313,
313, 313, 313, 313, 313, 313, 313, 5, 125, 117,
67, 0, 10, 55, 15, 20, 5, 35, 0, 25,
75, 0, 10, 0, 106, 25, 0, 30, 10, 90,
10, 0, 313, 313, 313, 313, 313, 313,
};
static unsigned char lengthtable[] =
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0,
4, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7, 0, 0, 0,
8, 0, 0, 0, 2, 0, 0, 8, 6, 7, 0, 4, 0, 0,
0, 0, 0, 0, 11, 0, 0, 7, 0, 0, 2, 0, 0, 0,
0, 0, 0, 0, 5, 6, 7, 0, 9, 0, 0, 7, 0, 0,
0, 11, 0, 0, 0, 5, 0, 2, 0, 9, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 8, 9, 0, 8, 0, 0, 0, 5,
0, 0, 0, 6, 0, 6, 9, 0, 0, 7, 0, 3, 0, 11,
5, 0, 4, 0, 5, 7, 6, 3, 0, 0, 6, 6, 8, 5,
6, 11, 0, 0, 0, 8, 7, 0, 0, 0, 0, 12, 0, 0,
6, 8, 10, 0, 4, 0, 0, 0, 6, 0, 9, 0, 0, 6,
4, 0, 6, 0, 0, 0, 0, 0, 0, 8, 0, 5, 4, 6,
0, 2, 6, 0, 2, 0, 0, 5, 5, 0, 0, 0, 0, 6,
0, 6, 0, 5, 5, 6, 0, 0, 0, 7, 0, 0, 0, 0,
4, 0, 5, 0, 0, 9, 0, 0, 0, 0, 0, 10, 0, 0,
0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 6,
0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 6,
8, 0, 0, 0, 11, 0, 0, 0, 2, 0, 0, 6, 0, 0,
0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0,
0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0,
3, 0, 0, 0, 5,
};
static struct StaticNameTable wordlist[] =
{
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"",}, {"",}, {"",},
{"pt", 58},
{"",},
{"left", 35},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"ex", 20},
{"top", 80},
{"x-large", 87},
{"",}, {"",}, {"",},
{"text-top", 77},
{"",}, {"",}, {"",},
{"px", 59},
{"",}, {"",},
{"xx-small", 90},
{"outset", 52},
{"outside", 53},
{"",},
{"auto", 2},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"text-bottom", 76},
{"",}, {"",},
{"x-small", 88},
{"",}, {"",},
{"em", 19},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"small", 68},
{"square", 72},
{"visible", 86},
{"",},
{"uppercase", 85},
{"",}, {"",},
{"justify", 32},
{"",}, {"",}, {"",},
{"upper-alpha", 83},
{"",}, {"",}, {"",},
{"thick", 78},
{"",},
{"mm", 45},
{"",},
{"list-item", 38},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"",},
{"xx-large", 89},
{"no-repeat", 46},
{"",},
{"overline", 54},
{"",}, {"",}, {"",},
{"solid", 71},
{"",}, {"",}, {"",},
{"inline", 28},
{"",},
{"double", 18},
{"lowercase", 41},
{"",}, {"",},
{"noshade", 49},
{"",},
{"rtl", 66},
{"",},
{"lower-alpha", 39},
{"fixed", 21},
{"",},
{"thin", 79},
{"",},
{"large", 33},
{"inherit", 27},
{"middle", 44},
{"pre", 57},
{"",}, {"",},
{"repeat", 61},
{"medium", 43},
{"relative", 60},
{"inset", 29},
{"inside", 30},
{"transparent", 81},
{"",}, {"",}, {"",},
{"repeat-y", 63},
{"oblique", 51},
{"",}, {"",}, {"",}, {"",},
{"line-through", 37},
{"",}, {"",},
{"dotted", 17},
{"repeat-x", 62},
{"capitalize", 10},
{"",},
{"both", 8},
{"",}, {"",}, {"",},
{"italic", 31},
{"",},
{"paragraph", 55},
{"",}, {"",},
{"static", 73},
{"none", 47},
{"",},
{"bottom", 9},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"absolute", 0},
{"",},
{"block", 5},
{"hand", 23},
{"groove", 22},
{"",},
{"cm", 13},
{"dashed", 14},
{"",},
{"in", 26},
{"",}, {"",},
{"ibeam", 25},
{"super", 75},
{"",}, {"",}, {"",}, {"",},
{"nowrap", 50},
{"",},
{"hidden", 24},
{"",},
{"blink", 4},
{"right", 65},
{"normal", 48},
{"",}, {"",}, {"",},
{"decimal", 15},
{"",}, {"",}, {"",}, {"",},
{"bold", 6},
{"",},
{"ridge", 64},
{"",}, {"",},
{"underline", 82},
{"",}, {"",}, {"",}, {"",}, {"",},
{"small-caps", 69},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"ltr", 42},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"larger", 34},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"disc", 16},
{"",}, {"",}, {"",},
{"bolder", 7},
{"baseline", 3},
{"",}, {"",}, {"",},
{"upper-roman", 84},
{"",}, {"",}, {"",},
{"pc", 56},
{"",}, {"",},
{"circle", 12},
{"",}, {"",}, {"",}, {"",},
{"scroll", 67},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"",}, {"smaller", 70},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"lower-roman", 40},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"",}, {"",},
{"lighter", 36},
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
{"center", 11},
{"",}, {"",}, {"",},
{"sub", 74},
{"",}, {"",}, {"",},
{"arrow", 1},
};
if (str != NULL) {
int len = PL_strlen(str);
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) {
register int hval = len;
switch (hval)
{
default:
case 7:
hval += asso_values[MYLOWER(str[6])];
case 6:
case 5:
case 4:
case 3:
hval += asso_values[MYLOWER(str[2])];
case 2:
hval += asso_values[MYLOWER(str[1])];
case 1:
hval += asso_values[MYLOWER(str[0])];
break;
}
hval += asso_values[MYLOWER(str[len - 1])];
if (hval <= MAX_HASH_VALUE && hval >= MIN_HASH_VALUE) {
if (len == lengthtable[hval]) {
register const char *tag = wordlist[hval].tag;
/*
** While not at the end of the string, if they ever differ
** they are not equal. We know "tag" is already lower case.
*/
while ((*tag != '\0')&&(*str != '\0')) {
if (*tag != (char) MYLOWER(*str)) {
return -1;
}
tag++;
str++;
}
/*
** One of the strings has ended, if they are both ended, then they
** are equal, otherwise not.
*/
if ((*tag == '\0')&&(*str == '\0')) {
return wordlist[hval].id;
}
}
}
}
}
return -1;
}
const nsCSSKeywords::NameTableEntry nsCSSKeywords::kNameTable[] = {
{ "absolute", 0 },
{ "arrow", 1 },
{ "auto", 2 },
{ "baseline", 3 },
{ "blink", 4 },
{ "block", 5 },
{ "bold", 6 },
{ "bolder", 7 },
{ "both", 8 },
{ "bottom", 9 },
{ "capitalize", 10 },
{ "center", 11 },
{ "circle", 12 },
{ "cm", 13 },
{ "dashed", 14 },
{ "decimal", 15 },
{ "disc", 16 },
{ "dotted", 17 },
{ "double", 18 },
{ "em", 19 },
{ "ex", 20 },
{ "fixed", 21 },
{ "groove", 22 },
{ "hand", 23 },
{ "hidden", 24 },
{ "ibeam", 25 },
{ "in", 26 },
{ "inherit", 27 },
{ "inline", 28 },
{ "inset", 29 },
{ "inside", 30 },
{ "italic", 31 },
{ "justify", 32 },
{ "large", 33 },
{ "larger", 34 },
{ "left", 35 },
{ "lighter", 36 },
{ "line-through", 37 },
{ "list-item", 38 },
{ "lower-alpha", 39 },
{ "lower-roman", 40 },
{ "lowercase", 41 },
{ "ltr", 42 },
{ "medium", 43 },
{ "middle", 44 },
{ "mm", 45 },
{ "no-repeat", 46 },
{ "none", 47 },
{ "normal", 48 },
{ "noshade", 49 },
{ "nowrap", 50 },
{ "oblique", 51 },
{ "outset", 52 },
{ "outside", 53 },
{ "overline", 54 },
{ "paragraph", 55 },
{ "pc", 56 },
{ "pre", 57 },
{ "pt", 58 },
{ "px", 59 },
{ "relative", 60 },
{ "repeat", 61 },
{ "repeat-x", 62 },
{ "repeat-y", 63 },
{ "ridge", 64 },
{ "right", 65 },
{ "rtl", 66 },
{ "scroll", 67 },
{ "small", 68 },
{ "small-caps", 69 },
{ "smaller", 70 },
{ "solid", 71 },
{ "square", 72 },
{ "static", 73 },
{ "sub", 74 },
{ "super", 75 },
{ "text-bottom", 76 },
{ "text-top", 77 },
{ "thick", 78 },
{ "thin", 79 },
{ "top", 80 },
{ "transparent", 81 },
{ "underline", 82 },
{ "upper-alpha", 83 },
{ "upper-roman", 84 },
{ "uppercase", 85 },
{ "visible", 86 },
{ "x-large", 87 },
{ "x-small", 88 },
{ "xx-large", 89 },
{ "xx-small", 90 },
};