1 /* PSPP - computes sample statistics.
2 Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
3 Written by Ben Pfaff <blp@gnu.org>.
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License as
7 published by the Free Software Foundation; either version 2 of the
8 License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25 #include <sys/types.h>
27 /* Returns nonzero if character CH may be the first character in an
29 #define CHAR_IS_ID1(CH) \
30 (isalpha ((unsigned char) (CH)) \
35 /* Returns nonzero if character CH may be a character in an
36 identifier other than the first. */
37 #define CHAR_IS_IDN(CH) \
39 || isdigit ((unsigned char) (CH)) \
44 /* The order of the enumerals below is important. Do not change it. */
47 T_ID = 256, /* Identifier. */
48 T_POS_NUM, /* Positive number. */
49 T_NEG_NUM, /* Negative number. */
50 T_STRING, /* Quoted string. */
51 T_STOP, /* End of input. */
71 T_FIRST_KEYWORD = T_AND,
72 T_LAST_KEYWORD = T_WITH,
73 T_N_KEYWORDS = T_LAST_KEYWORD - T_FIRST_KEYWORD + 1
77 /* Comparing identifiers. */
78 int lex_id_match_len (const char *keyword_string, size_t keyword_len,
79 const char *token_string, size_t token_len);
80 int lex_id_match (const char *keyword_string, const char *token_string);
81 int lex_id_to_token (const char *id, size_t len);
83 #endif /* !lex_def_h */