version 1.1.2.7, 2001/12/02 22:03:23
|
version 1.1.2.8, 2001/12/03 00:08:00
|
|
|
/* ATTN: works with Flex only */ | /* ATTN: works with Flex only */ |
#define YY_INPUT(BUF, NREAD, NREQUESTED) WQLInput(BUF, NREAD, NREQUESTED) | #define YY_INPUT(BUF, NREAD, NREQUESTED) WQLInput(BUF, NREAD, NREQUESTED) |
| |
|
#include <Pegasus/Common/Config.h> |
|
#include <Pegasus/WQL/WQLParserState.h> |
#include <cstring> | #include <cstring> |
#include <cassert> | #include <cassert> |
#include "WQLYACC.h" | #include "WQLYACC.h" |
|
|
# define WQL_TRACE(X) | # define WQL_TRACE(X) |
#endif | #endif |
| |
|
PEGASUS_NAMESPACE_BEGIN |
|
|
|
extern WQLParserState* globalParserState; |
|
|
|
static char* CloneString(const char* str, Uint32 size = (Uint32)-1); |
|
|
|
PEGASUS_NAMESPACE_END |
|
|
|
PEGASUS_USING_PEGASUS; |
|
|
%} | %} |
| |
POSITIVE_DECIMAL_DIGIT [1-9] | POSITIVE_DECIMAL_DIGIT [1-9] |
|
|
return TOK_FALSE; | return TOK_FALSE; |
} | } |
| |
[Nn][Ul][Ul] { |
[Nn][Uu][Ll][Ll] { |
| |
WQL_TRACE(("LEX: %s [TOK_NULL]\n", yytext)); | WQL_TRACE(("LEX: %s [TOK_NULL]\n", yytext)); |
return TOK_NULL; | return TOK_NULL; |
|
|
| |
[-+]?{DECIMAL_DIGIT}*\.{DECIMAL_DIGIT}+([eE][+-]?{DECIMAL_DIGIT}+)? { | [-+]?{DECIMAL_DIGIT}*\.{DECIMAL_DIGIT}+([eE][+-]?{DECIMAL_DIGIT}+)? { |
| |
|
/* ATTN: make this consistent with WBEMSQL1 "standard" */ |
|
|
WQL_TRACE(("LEX: %s [TOK_DOUBLE]\n", yytext)); | WQL_TRACE(("LEX: %s [TOK_DOUBLE]\n", yytext)); |
WQL_lval.doubleValue = strtod((char*)yytext, (char**)0); | WQL_lval.doubleValue = strtod((char*)yytext, (char**)0); |
return TOK_DOUBLE; | return TOK_DOUBLE; |
|
|
size_t n = strlen(yytext) - 2; | size_t n = strlen(yytext) - 2; |
char* strValue = new char[n + 1]; | char* strValue = new char[n + 1]; |
memcpy(strValue, yytext + 1, n); | memcpy(strValue, yytext + 1, n); |
strValue[n - 1] = '\0'; |
strValue[n] = '\0'; |
WQL_lval.strValue = strValue; | WQL_lval.strValue = strValue; |
|
globalParserState->outstandingStrings.append(strValue); |
} | } |
| |
return TOK_STRING; | return TOK_STRING; |
|
|
memcpy(strValue, yytext, n); | memcpy(strValue, yytext, n); |
strValue[n] = '\0'; | strValue[n] = '\0'; |
WQL_lval.strValue = strValue; | WQL_lval.strValue = strValue; |
|
globalParserState->outstandingStrings.append(strValue); |
} | } |
| |
return TOK_IDENTIFIER; | return TOK_IDENTIFIER; |