Go to the source code of this file.
Defines | |
| #define | SLCONST const |
| #define | MIN_HASH_VALUE 2 |
| #define | MAX_HASH_VALUE 151 |
| #define | MIN_KEYWORD_LEN 2 |
| #define | MAX_KEYWORD_LEN 11 |
Typedefs | |
| struct { | |
| char * name | |
| unsigned int type | |
| unsigned int sizeof_type | |
| double(* to_double_fun )(VOID_STAR) | |
| char * name | |
| SLtt_Char_Type color | |
| char * msg | |
| int sys_errno | |
| char * symbolic_name | |
| char name [3] | |
| int offset | |
| } | Keyword_Table_Type |
Functions | |
| static unsigned char | keyword_hash (char *s, unsigned int len) |
| static Keyword_Table_Type * | is_keyword (char *str, unsigned int len) |
Variables | |
| static SLCONST unsigned char | Keyword_Hash_Table [256] |
| static Keyword_Table_Type | Keyword_Table [] |
|
|
Definition at line 8 of file keywhash.c. Referenced by is_keyword(). |
|
|
Definition at line 10 of file keywhash.c. Referenced by is_keyword(). |
|
|
Definition at line 7 of file keywhash.c. Referenced by is_keyword(). |
|
|
Definition at line 9 of file keywhash.c. Referenced by is_keyword(). |
|
|
Definition at line 5 of file keywhash.c. Referenced by _pcre_compile_1(), _pSLerr_init_interp_exceptions(), get_op_token(), init_acs(), init_exceptions(), and map_or_contract_array(). |
|
|
|
|
||||||||||||
|
Definition at line 206 of file keywhash.c. References keyword_hash(), Keyword_Table, MAX_HASH_VALUE, MAX_KEYWORD_LEN, MIN_HASH_VALUE, MIN_KEYWORD_LEN, and name. Referenced by get_ident_token(). 00207 { 00208 unsigned int hash; 00209 char *name; 00210 Keyword_Table_Type *kw; 00211 00212 if ((len < MIN_KEYWORD_LEN) 00213 || (len > MAX_KEYWORD_LEN)) 00214 return NULL; 00215 00216 hash = keyword_hash (str, len); 00217 if ((hash > MAX_HASH_VALUE) || (hash < MIN_HASH_VALUE)) 00218 return NULL; 00219 00220 kw = &Keyword_Table[hash - MIN_HASH_VALUE]; 00221 if ((NULL != (name = kw->name)) 00222 && (*str == *name) 00223 && (0 == strcmp (str, name))) 00224 return kw; 00225 return NULL; 00226 }
|
|
||||||||||||
|
Definition at line 32 of file keywhash.c. References Keyword_Hash_Table. Referenced by is_keyword(). 00033 { 00034 unsigned int sum; 00035 00036 sum = len; 00037 while (len) 00038 { 00039 len--; 00040 sum += (unsigned int) Keyword_Hash_Table [(unsigned char)s[len]]; 00041 } 00042 return sum; 00043 }
|
|
|
Initial value:
{
152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152,
152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152,
152, 15, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152,
10, 15, 25, 30, 35, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152,
152, 152, 0, 0, 152, 0, 152, 152, 152, 5, 152, 0, 0, 152, 152, 0,
152, 152, 0, 0, 0, 0, 152, 152, 0, 152, 152, 152, 152, 152, 152, 5,
152, 5, 5, 20, 15, 0, 0, 0, 55, 25, 152, 0, 30, 10, 15, 0,
15, 152, 0, 0, 0, 50, 0, 0, 5, 20, 152, 152, 152, 152, 152, 152,
152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152,
152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152,
152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152,
152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152,
152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152,
152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152,
152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152,
152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152
}
Definition at line 12 of file keywhash.c. Referenced by keyword_hash(). |
|
|
Definition at line 52 of file keywhash.c. Referenced by is_keyword(). |
|
|
Definition at line 47 of file keywhash.c. |
|