#include "gl/c-ctype.h"
+/* Tokens. */
+
+const char *
+token_type_to_string (enum token_type type)
+{
+ switch (type)
+ {
+#define TOKEN_TYPE(TYPE) case T_##TYPE: return #TYPE;
+ TOKEN_TYPES
+#undef TOKEN_TYPE
+ case TOKEN_N_TYPES:
+ default:
+ return "unknown token type";
+ }
+}
+
/* Recognizing identifiers. */
static bool
/* Returns true if TOKEN is representable as a keyword. */
bool
-lex_is_keyword (int token)
+lex_is_keyword (enum token_type token)
{
const struct keyword *kw;
for (kw = keywords; kw < &keywords[keyword_cnt]; kw++)
/* Returns the name for the given keyword token type. */
const char *
-lex_id_name (int token)
+lex_id_name (enum token_type token)
{
const struct keyword *kw;