pspp-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pspp-cvs] Changes to pspp/src/lexer.c


From: Ben Pfaff
Subject: [Pspp-cvs] Changes to pspp/src/lexer.c
Date: Fri, 11 Mar 2005 20:08:34 -0500

Index: pspp/src/lexer.c
diff -u pspp/src/lexer.c:1.13 pspp/src/lexer.c:1.14
--- pspp/src/lexer.c:1.13       Mon Mar  7 03:04:50 2005
+++ pspp/src/lexer.c    Sat Mar 12 01:08:33 2005
@@ -81,7 +81,6 @@
 static double put_tokval;
 
 static void unexpected_eof (void);
-static inline int check_id (const char *id, size_t len);
 static void convert_numeric_string_to_char_string (int type);
 static int parse_string (int type);
 
@@ -363,7 +362,7 @@
          strncpy (tokid, ds_c_str (&tokstr), 8);
          tokid[8] = 0;
 
-         token = check_id (ds_c_str (&tokstr), ds_length (&tokstr));
+         token = lex_id_to_token (ds_c_str (&tokstr), ds_length (&tokstr));
          break;
 
        default:
@@ -636,6 +635,23 @@
 {
   return lex_id_match_len (kw, strlen (kw), tok, strlen (tok));
 }
+
+/* Returns the proper token type, either T_ID or a reserved keyword
+   enum, for ID[], which must contain LEN characters. */
+int
+lex_id_to_token (const char *id, size_t len)
+{
+  const char **kwp;
+
+  if (len < 2 || len > 4)
+    return T_ID;
+  
+  for (kwp = keywords; *kwp; kwp++)
+    if (!strcasecmp (*kwp, id))
+      return T_FIRST_KEYWORD + (kwp - keywords);
+
+  return T_ID;
+}
 
 /* Weird token functions. */
 
@@ -1002,23 +1018,6 @@
   msg (FE, _("Unexpected end of file."));
 }
 
-/* Returns the proper token type, either T_ID or a reserved keyword
-   enum, for ID[], which must contain LEN characters. */
-static inline int
-check_id (const char *id, size_t len)
-{
-  const char **kwp;
-
-  if (len < 2 || len > 4)
-    return T_ID;
-  
-  for (kwp = keywords; *kwp; kwp++)
-    if (!strcmp (*kwp, id))
-      return T_FIRST_KEYWORD + (kwp - keywords);
-
-  return T_ID;
-}
-
 /* When invoked, tokstr contains a string of binary, octal, or hex
    digits, for values of TYPE of 0, 1, or 2, respectively.  The string
    is converted to characters having the specified values. */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]