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 = 1, /* Identifier. */
29 T_POS_NUM, /* Positive number. */
30 T_NEG_NUM, /* Negative number. */
31 T_STRING, /* Quoted string. */
32 T_STOP, /* End of input. */
34 T_ENDCMD, /* End of command (e.g. '.'). */
67 bool lex_is_keyword (enum token_type);
69 /* Recognizing identifiers. */
70 bool lex_is_id1 (char);
71 bool lex_is_idn (char);
72 bool lex_uc_is_id1 (ucs4_t);
73 bool lex_uc_is_idn (ucs4_t);
74 bool lex_uc_is_space (ucs4_t);
75 size_t lex_id_get_length (struct substring);
77 /* Comparing identifiers. */
78 bool lex_id_match (struct substring keyword, struct substring token);
79 bool lex_id_match_n (struct substring keyword, struct substring token,
81 int lex_id_to_token (struct substring);
83 /* Identifier names. */
84 const char *lex_id_name (enum token_type);
86 #endif /* !data/identifier.h */