summaryrefslogtreecommitdiff
path: root/cpp/token1.h
diff options
context:
space:
mode:
authorRobert de Bath <rdebath@poboxes.com>2002-08-11 08:50:48 +0200
committerLubomir Rintel <lkundrak@v3.sk>2013-10-23 23:48:48 +0200
commit26ade8d624457b7164502ed9c190ca3f146bda0c (patch)
tree75a70b6a562bc595c971e170994a8e302a8c7b3b /cpp/token1.h
parent660429af0232d4afcb3e03fb0437053dd6e16286 (diff)
downloaddev86-26ade8d624457b7164502ed9c190ca3f146bda0c.tar.gz
Import Dev86src-0.16.8.tar.gzv0.16.8
Diffstat (limited to 'cpp/token1.h')
-rw-r--r--cpp/token1.h117
1 files changed, 117 insertions, 0 deletions
diff --git a/cpp/token1.h b/cpp/token1.h
new file mode 100644
index 0000000..2e2b9eb
--- /dev/null
+++ b/cpp/token1.h
@@ -0,0 +1,117 @@
+/* C code produced by gperf version 2.7.1 (19981006 egcs) */
+/* Command-line: gperf -aptTc -N is_ctok -H hash1 token1.tok */
+
+#define TOTAL_KEYWORDS 23
+#define MIN_WORD_LENGTH 2
+#define MAX_WORD_LENGTH 3
+#define MIN_HASH_VALUE 2
+#define MAX_HASH_VALUE 63
+/* maximum key range = 62, duplicates = 0 */
+
+#ifdef __GNUC__
+__inline
+#endif
+static unsigned int
+hash1 (str, len)
+ register const char *str;
+ register unsigned int len;
+{
+ static unsigned char asso_values[] =
+ {
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 1, 64, 64, 64, 3, 25, 64,
+ 64, 64, 13, 18, 64, 8, 30, 15, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 5, 0, 20, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 30, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 23, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+ 64, 64, 64, 64, 64, 64
+ };
+ return len + asso_values[(unsigned char)str[len - 1]] + asso_values[(unsigned char)str[0]];
+}
+
+#ifdef __GNUC__
+__inline
+#endif
+struct token_trans *
+is_ctok (str, len)
+ register const char *str;
+ register unsigned int len;
+{
+ static struct token_trans wordlist[] =
+ {
+ {""}, {""},
+ {"==", TK_EQ_OP},
+ {"!=", TK_NE_OP},
+ {""},
+ {"%=", TK_MOD_ASSIGN},
+ {""},
+ {"<=", TK_LE_OP},
+ {"<<=", TK_LEFT_ASSIGN},
+ {""},
+ {"-=", TK_SUB_ASSIGN},
+ {""},
+ {"<<", TK_LEFT_OP},
+ {""}, {""},
+ {"*=", TK_MUL_ASSIGN},
+ {""},
+ {"/=", TK_DIV_ASSIGN},
+ {"--", TK_DEC_OP},
+ {""},
+ {"+=", TK_ADD_ASSIGN},
+ {""},
+ {">=", TK_GE_OP},
+ {">>=", TK_RIGHT_ASSIGN},
+ {""},
+ {"|=", TK_OR_ASSIGN},
+ {""},
+ {"&=", TK_AND_ASSIGN},
+ {""}, {""},
+ {"->", TK_PTR_OP},
+ {""},
+ {"^=", TK_XOR_ASSIGN},
+ {""}, {""}, {""}, {""}, {""},
+ {"++", TK_INC_OP},
+ {""}, {""}, {""},
+ {">>", TK_RIGHT_OP},
+ {""}, {""}, {""}, {""}, {""},
+ {"||", TK_OR_OP},
+ {""}, {""}, {""},
+ {"&&", TK_AND_OP},
+ {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+ {"..", TK_WORD},
+ {"...", TK_ELLIPSIS}
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ register int key = hash1 (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= 0)
+ {
+ register const char *s = wordlist[key].name;
+
+ if (*str == *s && !strncmp (str + 1, s + 1, len - 1))
+ return &wordlist[key];
+ }
+ }
+ return 0;
+}