X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fidentifier.h;h=bbefb1b6646e1d9cc5cb38009182fa6b41d20959;hb=b8e2dc45abf0cf7a398cb8cef9d9faa24bee6f6c;hp=53be9a7655048c7cabd12c15950bf3a6cd791f6b;hpb=8297784ffdab47d35820735eb130a484ba9b6c01;p=pspp-builds.git diff --git a/src/data/identifier.h b/src/data/identifier.h index 53be9a76..bbefb1b6 100644 --- a/src/data/identifier.h +++ b/src/data/identifier.h @@ -1,6 +1,5 @@ /* PSPP - computes sample statistics. 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 @@ -17,15 +16,15 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#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,23 +50,21 @@ 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); +int lex_id_to_token (struct substring); -extern const char *keywords[T_N_KEYWORDS + 1] ; +/* Identifier names. */ +const char *lex_id_name (int); -#endif /* !lex_def_h */ +#endif /* !data/identifier.h */