8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 18:03:04 +01:00

Added LEX_StringIsAKeyword function to avoid an awkward #include from isql

module.
This commit is contained in:
skywalker 2002-06-29 13:47:28 +00:00
parent ef70859937
commit 13d2715fd8
4 changed files with 47 additions and 0 deletions

View File

@ -20,6 +20,13 @@
* 2001.08.03 John Bellardo changed LIMIT token to SKIP
* 2001.07.28 John Bellardo added tokens for FIRST and LIMIT
See dsql/parse.y for a chronological list. */
/*
* This file is included in parse.y and isql/isql.epp - at some point a
* smarter way of doing it so one one instance is needed would be best.
* MOD 29-Jun-2002
*/
{NOT_LSS, "!<", 1},
{NEQ, "!=", 1},
{NOT_GTR, "!>", 1},

View File

@ -3789,6 +3789,25 @@ static CONST TOK tokens [] = {
};
/* This method is currently used in isql/isql.epp to check if a
user field is a reserved word, and hence needs to be quoted.
Obviously a hash table would make this a little quicker
MOD 29-June-2002
*/
bool LEX_StringIsAToken(const char*in_str)
{
CONST TOK *tok_ptr = tokens;
while (tok_ptr -> tok_string) {
if (!strcmp(tok_ptr -> tok_string, in_str)) {
return true;
}
++tok_ptr;
}
return false;
}
void LEX_dsql_init (void)
{
/**************************************

View File

@ -3630,6 +3630,25 @@ static CONST TOK tokens [] = {
};
/* This method is currently used in isql/isql.epp to check if a
user field is a reserved word, and hence needs to be quoted.
Obviously a hash table would make this a little quicker
MOD 29-June-2002
*/
bool LEX_StringIsAToken(const char*in_str)
{
CONST TOK *tok_ptr = tokens;
while (tok_ptr -> tok_string) {
if (!strcmp(tok_ptr -> tok_string, in_str)) {
return true;
}
++tok_ptr;
}
return false;
}
void LEX_dsql_init (void)
{
/**************************************

View File

@ -29,6 +29,8 @@ extern "C" {
#endif
extern int dsql_yyparse(USHORT, USHORT, USHORT, BOOLEAN *);
extern bool LEX_StringIsAToken(const char*);
extern void LEX_dsql_init(void);
extern void LEX_string(TEXT *, USHORT, SSHORT);