1 /* PSPP - a program for statistical analysis.
2 Copyright (C) 1997-9, 2000, 2010 Free Software Foundation, Inc.
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
17 #ifndef DATA_IDENTIFIER_H
18 #define DATA_IDENTIFIER_H 1
23 #include "libpspp/str.h"
28 T_ID = 256, /* Identifier. */
29 T_POS_NUM, /* Positive number. */
30 T_NEG_NUM, /* Negative number. */
31 T_STRING, /* Quoted string. */
32 T_STOP, /* End of input. */
54 bool lex_is_keyword (int token);
56 /* Recognizing identifiers. */
57 bool lex_is_id1 (char);
58 bool lex_is_idn (char);
59 bool lex_uc_is_id1 (ucs4_t);
60 bool lex_uc_is_idn (ucs4_t);
61 bool lex_uc_is_space (ucs4_t);
62 size_t lex_id_get_length (struct substring);
64 /* Comparing identifiers. */
65 bool lex_id_match (struct substring keyword, struct substring token);
66 bool lex_id_match_n (struct substring keyword, struct substring token,
68 int lex_id_to_token (struct substring);
70 /* Identifier names. */
71 const char *lex_id_name (int);
73 #endif /* !data/identifier.h */