X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fidentifier.h;h=352ef2eafc1b3b381a82d7ee55e96b4dc344623e;hb=c1e28f93006b3151c30c6f5e77d88f177960e6d4;hp=7f4beb7478ab8d8979fd1ae0aa73c027f18eea92;hpb=dcf9b154cbcaa35c3d8459a201b77eec8bcb30bd;p=pspp-builds.git diff --git a/src/data/identifier.h b/src/data/identifier.h index 7f4beb74..352ef2ea 100644 --- a/src/data/identifier.h +++ b/src/data/identifier.h @@ -1,31 +1,28 @@ -/* PSPP - computes sample statistics. +/* PSPP - a program for statistical analysis. Copyright (C) 1997-9, 2000 Free Software Foundation, Inc. - Written by Ben Pfaff . - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. */ + along with this program. If not, see . */ -#if !lex_def_h -#define lex_def_h 1 +#ifndef DATA_IDENTIFIER_H +#define DATA_IDENTIFIER_H 1 #include #include #include +#include /* Token types. */ -/* The order of the enumerals below is important. Do not change it. */ enum { T_ID = 256, /* Identifier. */ @@ -51,21 +48,23 @@ enum T_WITH, /* WITH */ T_EXP, /* ** */ - - T_FIRST_KEYWORD = T_AND, - T_LAST_KEYWORD = T_WITH, - T_N_KEYWORDS = T_LAST_KEYWORD - T_FIRST_KEYWORD + 1 }; +/* Tokens. */ +bool lex_is_keyword (int token); + /* Recognizing identifiers. */ bool lex_is_id1 (char); bool lex_is_idn (char); -char *lex_skip_identifier (const char *); +size_t lex_id_get_length (struct substring); /* Comparing identifiers. */ -bool lex_id_match_len (const char *keyword_string, size_t keyword_len, - const char *token_string, size_t token_len); -bool lex_id_match (const char *keyword_string, const char *token_string); -int lex_id_to_token (const char *id, size_t len); +bool lex_id_match (struct substring keyword, struct substring token); +bool lex_id_match_n (struct substring keyword, struct substring token, + size_t n); +int lex_id_to_token (struct substring); + +/* Identifier names. */ +const char *lex_id_name (int); -#endif /* !lex_def_h */ +#endif /* !data/identifier.h */