3 //--------------------------------------------------------------------------
5 // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7 // Copyright 2000, 2010 Oracle and/or its affiliates.
9 // OpenOffice.org - a multi-platform office productivity suite
11 // This file is part of OpenOffice.org.
13 // OpenOffice.org is free software: you can redistribute it and/or modify
14 // it under the terms of the GNU Lesser General Public License version 3
15 // only, as published by the Free Software Foundation.
17 // OpenOffice.org is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU Lesser General Public License version 3 for more details
21 // (a copy is included in the LICENSE file that accompanied this code).
23 // You should have received a copy of the GNU Lesser General Public License
24 // version 3 along with OpenOffice.org. If not, see
25 // <http://www.openoffice.org/license.html>
26 // for a copy of the LGPLv3 License.
28 //--------------------------------------------------------------------------
30 #define YY_EXIT 1 // YY_FATAL will not halt the application
33 #include <cstdarg> // std::va_list
40 #include "internalnode.hxx"
42 #ifndef _CONNECTIVITY_SQLYACC_HXX
43 #define _CONNECTIVITY_SQLYACC_HXX
49 #include "sqlbison.hxx"
51 #include "sqlscan.hxx"
52 #include <osl/diagnose.h>
53 #include <rtl/strbuf.hxx>
54 #include <connectivity/sqlparse.hxx>
57 #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2))
58 # pragma GCC diagnostic ignored "-Wwrite-strings"
59 # pragma GCC diagnostic ignored "-Wunused-function"
61 #elif defined __SUNPRO_CC
63 #elif defined _MSC_VER
64 #pragma warning(push, 1)
73 using namespace connectivity;
75 //=============================================================================
77 // Erzeugung der Blaetter fuer die Token
78 // Blaetter werden generell vom Lexer erzeugt
80 static ::rtl::OUString aEmptyString;
82 static sal_Int32 gatherString(int delim, sal_Int32 nTyp);
83 static sal_Int32 gatherName(const sal_Char*);
84 static sal_Int32 gatherNamePre(const sal_Char* );
85 // has to be set before the parser starts
86 OSQLScanner* xxx_pGLOBAL_SQLSCAN = NULL;
88 #define SQL_NEW_NODE(text, token) \
89 SQLyylval.pParseNode = new OSQLInternalNode(text, token);
91 #define SQL_NEW_KEYWORD(token) \
92 SQLyylval.pParseNode = new OSQLInternalNode(aEmptyString, SQL_NODE_KEYWORD, (token)); return token;
94 #define SQL_NEW_INTNUM SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_INTNUM); return SQL_TOKEN_INTNUM;
95 #define SQL_NEW_APPROXNUM SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_APPROXNUM); return SQL_TOKEN_APPROXNUM;
96 #define SQL_NEW_DATE SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_ACCESS_DATE); return SQL_TOKEN_ACCESS_DATE;
98 #define YY_INPUT(buf,result,max_size) \
100 int c = xxx_pGLOBAL_SQLSCAN->SQLyygetc(); \
101 result = (c == EOF) ? YY_NULL : (buf[0] = c, 1);\
104 #define YY_FATAL_ERROR(msg) \
106 xxx_pGLOBAL_SQLSCAN->SQLyyerror(msg); \
110 //=============================================================================
121 %option never-interactive
124 ABS {SQL_NEW_KEYWORD(SQL_TOKEN_ABS); }
125 ACOS {SQL_NEW_KEYWORD(SQL_TOKEN_ACOS); }
126 AFTER {SQL_NEW_KEYWORD(SQL_TOKEN_AFTER); }
127 ALL {SQL_NEW_KEYWORD(SQL_TOKEN_ALL); }
128 ALTER {SQL_NEW_KEYWORD(SQL_TOKEN_ALTER); }
129 AND {SQL_NEW_KEYWORD(SQL_TOKEN_AND); }
130 ANY {SQL_NEW_KEYWORD(SQL_TOKEN_ANY); }
131 ARRAY_AGG {SQL_NEW_KEYWORD(SQL_TOKEN_ARRAY_AGG); }
132 AS {SQL_NEW_KEYWORD(SQL_TOKEN_AS); }
133 ASC {SQL_NEW_KEYWORD(SQL_TOKEN_ASC); }
134 ASCII {SQL_NEW_KEYWORD(SQL_TOKEN_ASCII); }
135 ASIN {SQL_NEW_KEYWORD(SQL_TOKEN_ASIN); }
136 AT {SQL_NEW_KEYWORD(SQL_TOKEN_AT); }
137 ATAN {SQL_NEW_KEYWORD(SQL_TOKEN_ATAN); }
138 ATAN2 {SQL_NEW_KEYWORD(SQL_TOKEN_ATAN2); }
139 ATOMIC {SQL_NEW_KEYWORD(SQL_TOKEN_ATOMIC); }
140 AUTHORIZATION {SQL_NEW_KEYWORD(SQL_TOKEN_AUTHORIZATION); }
141 AVG {SQL_NEW_KEYWORD(SQL_TOKEN_AVG); }
143 BEFORE {SQL_NEW_KEYWORD(SQL_TOKEN_BEFORE); }
144 BEGIN {SQL_NEW_KEYWORD(SQL_TOKEN_BEGIN); }
145 BETWEEN {SQL_NEW_KEYWORD(SQL_TOKEN_BETWEEN); }
146 BIGINT {SQL_NEW_KEYWORD(SQL_TOKEN_BIGINT); }
147 BINARY {SQL_NEW_KEYWORD(SQL_TOKEN_BINARY); }
148 BIT {SQL_NEW_KEYWORD(SQL_TOKEN_BIT); }
149 BIT_LENGTH {SQL_NEW_KEYWORD(SQL_TOKEN_BIT_LENGTH); }
150 BLOB {SQL_NEW_KEYWORD(SQL_TOKEN_BLOB); }
151 BOTH {SQL_NEW_KEYWORD(SQL_TOKEN_BOTH); }
152 BY {SQL_NEW_KEYWORD(SQL_TOKEN_BY); }
154 CALL {SQL_NEW_KEYWORD(SQL_TOKEN_CALL); }
155 CASE {SQL_NEW_KEYWORD(SQL_TOKEN_CASE); }
156 CAST {SQL_NEW_KEYWORD(SQL_TOKEN_CAST); }
157 CEILING {SQL_NEW_KEYWORD(SQL_TOKEN_CEILING); }
158 CHAR {SQL_NEW_KEYWORD(SQL_TOKEN_CHAR); }
159 CHARACTER {SQL_NEW_KEYWORD(SQL_TOKEN_CHARACTER); }
160 CHAR(ACTER)?_LENGTH {SQL_NEW_KEYWORD(SQL_TOKEN_CHAR_LENGTH); }
161 CHECK {SQL_NEW_KEYWORD(SQL_TOKEN_CHECK); }
162 CLOB {SQL_NEW_KEYWORD(SQL_TOKEN_CLOB); }
163 COALESCE {SQL_NEW_KEYWORD(SQL_TOKEN_COALESCE); }
164 COLLATE {SQL_NEW_KEYWORD(SQL_TOKEN_COLLATE); }
165 COLLECT {SQL_NEW_KEYWORD(SQL_TOKEN_COLLECT); }
166 COMMIT {SQL_NEW_KEYWORD(SQL_TOKEN_COMMIT); }
167 CONCAT {SQL_NEW_KEYWORD(SQL_TOKEN_CONCAT); }
168 CONTINUE {SQL_NEW_KEYWORD(SQL_TOKEN_CONTINUE); }
169 CONVERT {SQL_NEW_KEYWORD(SQL_TOKEN_CONVERT); }
170 COS {SQL_NEW_KEYWORD(SQL_TOKEN_COS); }
171 COT {SQL_NEW_KEYWORD(SQL_TOKEN_COT); }
172 COUNT {SQL_NEW_KEYWORD(SQL_TOKEN_COUNT); }
173 CREATE {SQL_NEW_KEYWORD(SQL_TOKEN_CREATE); }
174 CROSS {SQL_NEW_KEYWORD(SQL_TOKEN_CROSS); }
175 CUME_RANK {SQL_NEW_KEYWORD(SQL_TOKEN_CUME_DIST); }
176 CURRENT {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT); }
177 CURRENT_DATE {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT_DATE); }
178 CURRENT_CATALOG {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT_CATALOG); }
179 CURRENT_DEFAULT_TRANSFORM_GROUP {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT_DEFAULT_TRANSFORM_GROUP); }
180 CURRENT_PATH {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT_PATH); }
181 CURRENT_ROLE {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT_ROLE); }
182 CURRENT_SCHEMA {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT_SCHEMA); }
183 CURRENT_USER {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT_USER); }
184 CURDATE {SQL_NEW_KEYWORD(SQL_TOKEN_CURDATE); }
185 CURRENT_TIME {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT_TIME); }
186 CURTIME {SQL_NEW_KEYWORD(SQL_TOKEN_CURTIME); }
187 CURRENT_TIMESTAMP {SQL_NEW_KEYWORD(SQL_TOKEN_CURRENT_TIMESTAMP); }
188 CURSOR {SQL_NEW_KEYWORD(SQL_TOKEN_CURSOR); }
190 D {SQL_NEW_KEYWORD(SQL_TOKEN_D); }
191 DATE {SQL_NEW_KEYWORD(SQL_TOKEN_DATE); }
192 DATEDIFF {SQL_NEW_KEYWORD(SQL_TOKEN_DATEDIFF); }
193 DATEVALUE {SQL_NEW_KEYWORD(SQL_TOKEN_DATEVALUE); }
194 DAY {SQL_NEW_KEYWORD(SQL_TOKEN_DAY); }
195 DAYNAME {SQL_NEW_KEYWORD(SQL_TOKEN_DAYNAME); }
196 DAYOFMONTH {SQL_NEW_KEYWORD(SQL_TOKEN_DAYOFMONTH); }
197 DAYOFWEEK {SQL_NEW_KEYWORD(SQL_TOKEN_DAYOFWEEK); }
198 DAYOFYEAR {SQL_NEW_KEYWORD(SQL_TOKEN_DAYOFYEAR); }
199 DEC {SQL_NEW_KEYWORD(SQL_TOKEN_DEC); }
200 DECIMAL {SQL_NEW_KEYWORD(SQL_TOKEN_DECIMAL); }
201 DECLARE {SQL_NEW_KEYWORD(SQL_TOKEN_DECLARE); }
202 DEFAULT {SQL_NEW_KEYWORD(SQL_TOKEN_DEFAULT); }
203 DEGREES {SQL_NEW_KEYWORD(SQL_TOKEN_DEGREES); }
204 DELETE {SQL_NEW_KEYWORD(SQL_TOKEN_DELETE); }
205 DENSE_RANK {SQL_NEW_KEYWORD(SQL_TOKEN_DENSE_RANK); }
206 DESC {SQL_NEW_KEYWORD(SQL_TOKEN_DESC); }
207 DIFFERENCE {SQL_NEW_KEYWORD(SQL_TOKEN_DIFFERENCE); }
208 DISTINCT {SQL_NEW_KEYWORD(SQL_TOKEN_DISTINCT); }
209 DOUBLE {SQL_NEW_KEYWORD(SQL_TOKEN_DOUBLE); }
210 DROP {SQL_NEW_KEYWORD(SQL_TOKEN_DROP); }
212 EACH {SQL_NEW_KEYWORD(SQL_TOKEN_EACH); }
213 ELSE {SQL_NEW_KEYWORD(SQL_TOKEN_ELSE); }
214 END {SQL_NEW_KEYWORD(SQL_TOKEN_END); }
215 EVERY {SQL_NEW_KEYWORD(SQL_TOKEN_EVERY); }
216 ESCAPE {SQL_NEW_KEYWORD(SQL_TOKEN_ESCAPE); }
217 EXCEPT {SQL_NEW_KEYWORD(SQL_TOKEN_EXCEPT); }
218 EXCLUDE {SQL_NEW_KEYWORD(SQL_TOKEN_EXCLUDE); }
219 EXISTS {SQL_NEW_KEYWORD(SQL_TOKEN_EXISTS); }
220 EXP {SQL_NEW_KEYWORD(SQL_TOKEN_EXP); }
221 EXTRACT {SQL_NEW_KEYWORD(SQL_TOKEN_EXTRACT); }
223 FALSE {SQL_NEW_KEYWORD(SQL_TOKEN_FALSE); }
224 FETCH {SQL_NEW_KEYWORD(SQL_TOKEN_FETCH); }
225 FIRST {SQL_NEW_KEYWORD(SQL_TOKEN_FIRST); }
226 FIRST_VALUE {SQL_NEW_KEYWORD(SQL_TOKEN_FIRST_VALUE); }
227 FLOAT {SQL_NEW_KEYWORD(SQL_TOKEN_FLOAT); }
228 FLOOR {SQL_NEW_KEYWORD(SQL_TOKEN_FLOOR); }
229 FN {SQL_NEW_KEYWORD(SQL_TOKEN_FN); }
230 FOLLOWING {SQL_NEW_KEYWORD(SQL_TOKEN_FOLLOWING); }
231 FOR {SQL_NEW_KEYWORD(SQL_TOKEN_FOR); }
232 FOREIGN {SQL_NEW_KEYWORD(SQL_TOKEN_FOREIGN); }
233 FOUND {SQL_NEW_KEYWORD(SQL_TOKEN_FOUND); }
234 FROM {SQL_NEW_KEYWORD(SQL_TOKEN_FROM); }
235 FULL {SQL_NEW_KEYWORD(SQL_TOKEN_FULL); }
236 FUSION {SQL_NEW_KEYWORD(SQL_TOKEN_FUSION); }
238 GRANT {SQL_NEW_KEYWORD(SQL_TOKEN_GRANT); }
239 GROUP {SQL_NEW_KEYWORD(SQL_TOKEN_GROUP); }
241 HAVING {SQL_NEW_KEYWORD(SQL_TOKEN_HAVING); }
242 HOUR {SQL_NEW_KEYWORD(SQL_TOKEN_HOUR); }
244 IGNORE {SQL_NEW_KEYWORD(SQL_TOKEN_IGNORE); }
245 IN {SQL_NEW_KEYWORD(SQL_TOKEN_IN); }
246 INNER {SQL_NEW_KEYWORD(SQL_TOKEN_INNER); }
247 INSERT {SQL_NEW_KEYWORD(SQL_TOKEN_INSERT); }
248 INSTEAD {SQL_NEW_KEYWORD(SQL_TOKEN_INSTEAD); }
249 INT(EGER)? {SQL_NEW_KEYWORD(SQL_TOKEN_INTEGER); }
250 INTERSECT {SQL_NEW_KEYWORD(SQL_TOKEN_INTERSECT); }
251 INTERVAL {SQL_NEW_KEYWORD(SQL_TOKEN_INTERVAL); }
252 INTERSECTION {SQL_NEW_KEYWORD(SQL_TOKEN_INTERSECTION); }
253 INTO {SQL_NEW_KEYWORD(SQL_TOKEN_INTO); }
254 IS {SQL_NEW_KEYWORD(SQL_TOKEN_IS); }
256 JOIN {SQL_NEW_KEYWORD(SQL_TOKEN_JOIN); }
258 KEY {SQL_NEW_KEYWORD(SQL_TOKEN_KEY); }
260 LAG {SQL_NEW_KEYWORD(SQL_TOKEN_LAG); }
261 LARGE {SQL_NEW_KEYWORD(SQL_TOKEN_LARGE); }
262 LAST {SQL_NEW_KEYWORD(SQL_TOKEN_LAST); }
263 LAST_VALUE {SQL_NEW_KEYWORD(SQL_TOKEN_LAST_VALUE); }
264 LCASE {SQL_NEW_KEYWORD(SQL_TOKEN_LCASE); }
265 LEAD {SQL_NEW_KEYWORD(SQL_TOKEN_LEAD); }
266 LEADING {SQL_NEW_KEYWORD(SQL_TOKEN_LEADING); }
267 LEFT {SQL_NEW_KEYWORD(SQL_TOKEN_LEFT); }
268 LENGTH {SQL_NEW_KEYWORD(SQL_TOKEN_LENGTH); }
269 LIKE {SQL_NEW_KEYWORD(SQL_TOKEN_LIKE); }
270 LIMIT {SQL_NEW_KEYWORD(SQL_TOKEN_LIMIT); }
271 LN {SQL_NEW_KEYWORD(SQL_TOKEN_LN); }
272 LOCAL {SQL_NEW_KEYWORD(SQL_TOKEN_LOCAL); }
273 LOCATE {SQL_NEW_KEYWORD(SQL_TOKEN_LOCATE); }
274 LOG {SQL_NEW_KEYWORD(SQL_TOKEN_LOG); }
275 LOGF {SQL_NEW_KEYWORD(SQL_TOKEN_LOGF); }
276 LOG10 {SQL_NEW_KEYWORD(SQL_TOKEN_LOG10); }
277 LOWER {SQL_NEW_KEYWORD(SQL_TOKEN_LOWER); }
278 LTRIM {SQL_NEW_KEYWORD(SQL_TOKEN_LTRIM); }
280 MAX {SQL_NEW_KEYWORD(SQL_TOKEN_MAX); }
281 MIN {SQL_NEW_KEYWORD(SQL_TOKEN_MIN); }
282 MINUTE {SQL_NEW_KEYWORD(SQL_TOKEN_MINUTE); }
283 MOD {SQL_NEW_KEYWORD(SQL_TOKEN_MOD); }
284 MONTH {SQL_NEW_KEYWORD(SQL_TOKEN_MONTH); }
285 MONTHNAME {SQL_NEW_KEYWORD(SQL_TOKEN_MONTHNAME); }
287 NATIONAL {SQL_NEW_KEYWORD(SQL_TOKEN_NATIONAL); }
288 NATURAL {SQL_NEW_KEYWORD(SQL_TOKEN_NATURAL); }
289 NCHAR {SQL_NEW_KEYWORD(SQL_TOKEN_NCHAR); }
290 NCLOB {SQL_NEW_KEYWORD(SQL_TOKEN_NCLOB); }
291 NEW {SQL_NEW_KEYWORD(SQL_TOKEN_NEW); }
292 NEXT {SQL_NEW_KEYWORD(SQL_TOKEN_NEXT); }
293 NO {SQL_NEW_KEYWORD(SQL_TOKEN_NO); }
294 NOT {SQL_NEW_KEYWORD(SQL_TOKEN_NOT); }
295 NOW {SQL_NEW_KEYWORD(SQL_TOKEN_NOW); }
296 NTH_VALUE {SQL_NEW_KEYWORD(SQL_TOKEN_NTH_VALUE); }
297 NTILE {SQL_NEW_KEYWORD(SQL_TOKEN_NTILE); }
298 NULL {SQL_NEW_KEYWORD(SQL_TOKEN_NULL); }
299 NULLIF {SQL_NEW_KEYWORD(SQL_TOKEN_NULLIF); }
300 NULLS {SQL_NEW_KEYWORD(SQL_TOKEN_NULLS); }
301 NUMERIC {SQL_NEW_KEYWORD(SQL_TOKEN_NUMERIC); }
303 OBJECT {SQL_NEW_KEYWORD(SQL_TOKEN_OBJECT); }
304 OCTET_LENGTH {SQL_NEW_KEYWORD(SQL_TOKEN_OCTET_LENGTH); }
305 OF {SQL_NEW_KEYWORD(SQL_TOKEN_OF); }
306 OFFSET {SQL_NEW_KEYWORD(SQL_TOKEN_OFFSET); }
307 OJ {SQL_NEW_KEYWORD(SQL_TOKEN_OJ); }
308 OLD {SQL_NEW_KEYWORD(SQL_TOKEN_OLD); }
309 ON {SQL_NEW_KEYWORD(SQL_TOKEN_ON); }
310 ONLY {SQL_NEW_KEYWORD(SQL_TOKEN_ONLY); }
311 OPTION {SQL_NEW_KEYWORD(SQL_TOKEN_OPTION); }
312 OR {SQL_NEW_KEYWORD(SQL_TOKEN_OR); }
313 ORDER {SQL_NEW_KEYWORD(SQL_TOKEN_ORDER); }
314 OTHERS {SQL_NEW_KEYWORD(SQL_TOKEN_OTHERS); }
315 OUTER {SQL_NEW_KEYWORD(SQL_TOKEN_OUTER); }
316 OVER {SQL_NEW_KEYWORD(SQL_TOKEN_OVER); }
318 PARTITION {SQL_NEW_KEYWORD(SQL_TOKEN_PARTITION); }
319 PERCENT_RANK {SQL_NEW_KEYWORD(SQL_TOKEN_PERCENT_RANK); }
320 PERCENTILE_CONT {SQL_NEW_KEYWORD(SQL_TOKEN_PERCENTILE_CONT); }
321 PERCENTILE_DISC {SQL_NEW_KEYWORD(SQL_TOKEN_PERCENTILE_DISC); }
322 PI {SQL_NEW_KEYWORD(SQL_TOKEN_PI); }
323 POSITION {SQL_NEW_KEYWORD(SQL_TOKEN_POSITION); }
324 POWER {SQL_NEW_KEYWORD(SQL_TOKEN_POWER); }
325 PRECEDING {SQL_NEW_KEYWORD(SQL_TOKEN_PRECEDING); }
326 PRECISION {SQL_NEW_KEYWORD(SQL_TOKEN_PRECISION); }
327 PRIMARY {SQL_NEW_KEYWORD(SQL_TOKEN_PRIMARY); }
328 PRIVILEGES {SQL_NEW_KEYWORD(SQL_TOKEN_PRIVILEGES); }
329 PROCEDURE {SQL_NEW_KEYWORD(SQL_TOKEN_PROCEDURE); }
330 PUBLIC {SQL_NEW_KEYWORD(SQL_TOKEN_PUBLIC); }
332 QUARTER {SQL_NEW_KEYWORD(SQL_TOKEN_QUARTER); }
334 RADIANS {SQL_NEW_KEYWORD(SQL_TOKEN_RADIANS); }
335 RAND {SQL_NEW_KEYWORD(SQL_TOKEN_RAND); }
336 RANGE {SQL_NEW_KEYWORD(SQL_TOKEN_RANGE); }
337 RANK {SQL_NEW_KEYWORD(SQL_TOKEN_RANK); }
338 REAL {SQL_NEW_KEYWORD(SQL_TOKEN_REAL); }
339 REFERENCES {SQL_NEW_KEYWORD(SQL_TOKEN_REFERENCES); }
340 REFERENCING {SQL_NEW_KEYWORD(SQL_TOKEN_REFERENCING); }
341 REPEAT {SQL_NEW_KEYWORD(SQL_TOKEN_REPEAT); }
342 REPLACE {SQL_NEW_KEYWORD(SQL_TOKEN_REPLACE); }
343 RESPECT {SQL_NEW_KEYWORD(SQL_TOKEN_RESPECT); }
344 ROLLBACK {SQL_NEW_KEYWORD(SQL_TOKEN_ROLLBACK); }
345 ROUND {SQL_NEW_KEYWORD(SQL_TOKEN_ROUND); }
346 ROUNDMAGIC {SQL_NEW_KEYWORD(SQL_TOKEN_ROUNDMAGIC); }
347 ROW {SQL_NEW_KEYWORD(SQL_TOKEN_ROW); }
348 ROWS {SQL_NEW_KEYWORD(SQL_TOKEN_ROWS); }
349 ROW_NUMBER {SQL_NEW_KEYWORD(SQL_TOKEN_ROW_NUMBER); }
350 RIGHT {SQL_NEW_KEYWORD(SQL_TOKEN_RIGHT); }
351 RTRIM {SQL_NEW_KEYWORD(SQL_TOKEN_RTRIM); }
353 SCHEMA {SQL_NEW_KEYWORD(SQL_TOKEN_SCHEMA); }
354 SECOND {SQL_NEW_KEYWORD(SQL_TOKEN_SECOND); }
355 SELECT {SQL_NEW_KEYWORD(SQL_TOKEN_SELECT); }
356 SET {SQL_NEW_KEYWORD(SQL_TOKEN_SET); }
357 SIZE {SQL_NEW_KEYWORD(SQL_TOKEN_SIZE); }
358 SIGN {SQL_NEW_KEYWORD(SQL_TOKEN_SIGN); }
359 SIN {SQL_NEW_KEYWORD(SQL_TOKEN_SIN); }
360 SMALLINT {SQL_NEW_KEYWORD(SQL_TOKEN_SMALLINT); }
361 SOME {SQL_NEW_KEYWORD(SQL_TOKEN_SOME); }
362 SOUNDEX {SQL_NEW_KEYWORD(SQL_TOKEN_SOUNDEX); }
363 SPACE {SQL_NEW_KEYWORD(SQL_TOKEN_SPACE); }
364 SQRT {SQL_NEW_KEYWORD(SQL_TOKEN_SQRT); }
365 STDDEV_POP {SQL_NEW_KEYWORD(SQL_TOKEN_STDDEV_POP); }
366 STDDEV_SAMP {SQL_NEW_KEYWORD(SQL_TOKEN_STDDEV_SAMP); }
367 STATEMENT {SQL_NEW_KEYWORD(SQL_TOKEN_STATEMENT); }
368 SUBSTRING {SQL_NEW_KEYWORD(SQL_TOKEN_SUBSTRING); }
369 SUM {SQL_NEW_KEYWORD(SQL_TOKEN_SUM); }
370 SESSION_USER {SQL_NEW_KEYWORD(SQL_TOKEN_SESSION_USER); }
371 SYSTEM_USER {SQL_NEW_KEYWORD(SQL_TOKEN_SYSTEM_USER); }
373 TABLE {SQL_NEW_KEYWORD(SQL_TOKEN_TABLE); }
374 TAN {SQL_NEW_KEYWORD(SQL_TOKEN_TAN); }
375 THEN {SQL_NEW_KEYWORD(SQL_TOKEN_THEN); }
376 TIES {SQL_NEW_KEYWORD(SQL_TOKEN_TIES); }
377 TIME {SQL_NEW_KEYWORD(SQL_TOKEN_TIME); }
378 TIMESTAMP {SQL_NEW_KEYWORD(SQL_TOKEN_TIMESTAMP); }
379 TIMESTAMPADD {SQL_NEW_KEYWORD(SQL_TOKEN_TIMESTAMPADD); }
380 TIMESTAMPDIFF {SQL_NEW_KEYWORD(SQL_TOKEN_TIMESTAMPDIFF); }
381 TIMEVALUE {SQL_NEW_KEYWORD(SQL_TOKEN_TIMEVALUE); }
382 TIMEZONE_HOUR {SQL_NEW_KEYWORD(SQL_TOKEN_TIMEZONE_HOUR); }
383 TIMEZONE_MINUTE {SQL_NEW_KEYWORD(SQL_TOKEN_TIMEZONE_MINUTE); }
384 TO {SQL_NEW_KEYWORD(SQL_TOKEN_TO); }
385 TRAILING {SQL_NEW_KEYWORD(SQL_TOKEN_TRAILING); }
386 TRANSLATE {SQL_NEW_KEYWORD(SQL_TOKEN_TRANSLATE); }
387 TRIGGER {SQL_NEW_KEYWORD(SQL_TOKEN_TRIGGER); }
388 TRIM {SQL_NEW_KEYWORD(SQL_TOKEN_TRIM); }
389 TRUE {SQL_NEW_KEYWORD(SQL_TOKEN_TRUE); }
390 TRUNCATE {SQL_NEW_KEYWORD(SQL_TOKEN_TRUNCATE); }
391 TS {SQL_NEW_KEYWORD(SQL_TOKEN_TS); }
392 T {SQL_NEW_KEYWORD(SQL_TOKEN_T); }
394 UCASE {SQL_NEW_KEYWORD(SQL_TOKEN_UCASE); }
395 UNBOUNDED {SQL_NEW_KEYWORD(SQL_TOKEN_UNBOUNDED); }
396 UNION {SQL_NEW_KEYWORD(SQL_TOKEN_UNION); }
397 UNIQUE {SQL_NEW_KEYWORD(SQL_TOKEN_UNIQUE); }
398 UNKNOWN {SQL_NEW_KEYWORD(SQL_TOKEN_UNKNOWN); }
399 UPDATE {SQL_NEW_KEYWORD(SQL_TOKEN_UPDATE); }
400 UPPER {SQL_NEW_KEYWORD(SQL_TOKEN_UPPER); }
401 USAGE {SQL_NEW_KEYWORD(SQL_TOKEN_USAGE); }
402 USER {SQL_NEW_KEYWORD(SQL_TOKEN_USER); }
403 USING {SQL_NEW_KEYWORD(SQL_TOKEN_USING); }
405 VARBINARY {SQL_NEW_KEYWORD(SQL_TOKEN_VARBINARY); }
406 VARCHAR {SQL_NEW_KEYWORD(SQL_TOKEN_VARCHAR); }
407 VARYING {SQL_NEW_KEYWORD(SQL_TOKEN_VARYING); }
408 VAR_POP {SQL_NEW_KEYWORD(SQL_TOKEN_VAR_POP); }
409 VAR_SAMP {SQL_NEW_KEYWORD(SQL_TOKEN_VAR_SAMP); }
410 VALUE {SQL_NEW_KEYWORD(SQL_TOKEN_VALUE); }
411 VALUES {SQL_NEW_KEYWORD(SQL_TOKEN_VALUES); }
412 VIEW {SQL_NEW_KEYWORD(SQL_TOKEN_VIEW); }
414 WEEK {SQL_NEW_KEYWORD(SQL_TOKEN_WEEK); }
415 WHEN {SQL_NEW_KEYWORD(SQL_TOKEN_WHEN); }
416 WHERE {SQL_NEW_KEYWORD(SQL_TOKEN_WHERE); }
417 WITH {SQL_NEW_KEYWORD(SQL_TOKEN_WITH); }
418 WITHIN {SQL_NEW_KEYWORD(SQL_TOKEN_WITHIN); }
419 WITHOUT {SQL_NEW_KEYWORD(SQL_TOKEN_WITHOUT); }
420 WORK {SQL_NEW_KEYWORD(SQL_TOKEN_WORK); }
422 YEAR {SQL_NEW_KEYWORD(SQL_TOKEN_YEAR); }
424 ZONE {SQL_NEW_KEYWORD(SQL_TOKEN_ZONE); }
426 "<" { SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_LESS);return SQL_LESS;}
427 ">" { SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_GREAT);return SQL_GREAT;}
428 "=" { SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_EQUAL);return SQL_EQUAL;}
429 "<=" { SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_LESSEQ);return SQL_LESSEQ;}
430 ">=" { SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_GREATEQ);return SQL_GREATEQ;}
431 "<>" { SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_NOTEQUAL);return SQL_NOTEQUAL;}
432 "!=" { SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_NOTEQUAL);return SQL_NOTEQUAL;}
433 "||" { SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQL_NODE_CONCAT);return SQL_CONCAT;}
436 [-+*/:(),.;?{}] { return SQLyytext[0]; }
439 <SQL>[A-Za-z\200-\277\300-\337\340-\357\360-\367\370-\373\374-\375][A-Za-z\200-\277\300-\337\340-\357\360-\367\370-\373\374-\375_0-9]* {return gatherName( SQLyytext);}
441 <SQL>([0-9]+) {SQL_NEW_INTNUM; }
444 <SQL>([0-9]+"."[0-9]*) |
445 <SQL>[0-9]+[eE][+-]?[0-9]+ |
446 <SQL>[0-9]+"."[0-9]*[eE][+-]?[0-9]+ |
447 <SQL>"."[0-9]*[eE][+-]?[0-9]+ {SQL_NEW_APPROXNUM; }
449 <PREDICATE_GER,PREDICATE_ENG,DATE>[A-Za-z\200-\277\300-\337\340-\357\360-\367\370-\373\374-\375][A-Za-z0-9_%.,*?\200-\277\300-\337\340-\357\360-\367\370-\373\374-\375]* {return gatherNamePre(SQLyytext);}
451 <PREDICATE_GER,PREDICATE_ENG>([0-9]+) {SQL_NEW_INTNUM; }
452 <PREDICATE_ENG>([0-9]{1,3}(","[0-9]{3})+) {SQL_NEW_INTNUM; }
453 <PREDICATE_GER>([0-9]{1,3}("."[0-9]{3})+) {SQL_NEW_INTNUM; }
455 <PREDICATE_ENG>([0-9]+"."[0-9]+) |
456 <PREDICATE_ENG>([0-9]{1,3}(","[0-9]{3})+"."[0-9]+) |
457 <PREDICATE_ENG>("."[0-9]+) {SQL_NEW_APPROXNUM; }
458 <PREDICATE_ENG>[0-9]+[eE][+-]?[0-9]+ |
459 <PREDICATE_ENG>[0-9]+"."[0-9]*[eE][+-]?[0-9]+ |
460 <PREDICATE_ENG>"."[0-9]*[eE][+-]?[0-9]+ {SQL_NEW_APPROXNUM; }
462 <PREDICATE_GER>([0-9]+","[0-9]+) |
463 <PREDICATE_GER>([0-9]{1,3}("."[0-9]{3})+","[0-9]+) |
464 <PREDICATE_GER>(","[0-9]+) {SQL_NEW_APPROXNUM; }
465 <PREDICATE_GER>[0-9]+[eE][+-]?[0-9]+ |
466 <PREDICATE_GER>[0-9]+","[0-9]*[eE][+-]?[0-9]+ |
467 <PREDICATE_GER>","[0-9]*[eE][+-]?[0-9]+ {SQL_NEW_APPROXNUM; }
469 <PREDICATE_GER,PREDICATE_ENG>[0-9.,][A-Za-z0-9_.,%]* {return gatherNamePre(SQLyytext);}
471 <SQL>\" { return gatherString('\"',0); }
472 <SQL>` { return gatherString('`' ,0); }
474 <PREDICATE_GER,PREDICATE_ENG,DATE,SQL>"[" { return gatherString(']' ,0);}
476 \' { return gatherString('\'',1); }
478 <PREDICATE_GER,PREDICATE_ENG,DATE># { return gatherString('#' ,2); }
480 <DATE>[0-9]{1,4}[^ ]*[0-9] |
481 <DATE>[0-9]{1,4}[^ ]*[0-9][ ][0-9]{1,4}[^ ]*[0-9] { SQL_NEW_DATE; }
483 <STRING>["-""+""*""/"":""("")"",""."";""?""{""}"] { return SQLyytext[0]; } /* */
484 <STRING>"[" { return gatherString(']' ,0); }
485 <STRING>[^ ':["?"]* { return gatherNamePre(SQLyytext); }
493 . {YY_FATAL_ERROR("Invalid symbol"); return SQL_TOKEN_INVALIDSYMBOL;}
497 // Kludge around a bug (well, Posix incompatibility) in flex 2.5.x
498 // http://bugs.debian.org/cgi-bin/bugreport.cgi?archive=no&bug=189332
499 #if YY_FLEX_MAJOR_VERSION >= 2 && YY_FLEX_MINOR_VERSION >= 5
501 #ifndef YY_FLUSH_BUFFER
502 #define YY_FLUSH_BUFFER SQLyy_flush_buffer(YY_CURRENT_BUFFER )
506 #define yytext_ptr SQLyytext
511 // Versions of flex apparently differ in whether input() resp. yyinput() returns
512 // zero or EOF upon end of file:
513 inline bool checkeof(int c) { return c == 0 || c == EOF; }
516 * Read SQL string literal
518 * '' 'a string' 'quote '' within string'
519 * "" "a string" "quote "" within string"
520 * nTyp == 0 -> SQL_NODE_NAME
521 * nTyp == 1 -> SQL_NODE_STRING
522 * nTyp == 2 -> SQL_NODE_ACCESS_DATE
524 sal_Int32 gatherString(int delim, sal_Int32 nTyp)
527 ::rtl::OStringBuffer sBuffer(256);
529 while (!checkeof(ch = yyinput()))
533 if ((ch = yyinput()) != delim)
541 SQL_NEW_NODE(::rtl::OStringToOUString(sBuffer.makeStringAndClear(),RTL_TEXTENCODING_UTF8), SQL_NODE_NAME);
542 return SQL_TOKEN_NAME;
544 SQL_NEW_NODE(::rtl::OStringToOUString(sBuffer.makeStringAndClear(),RTL_TEXTENCODING_UTF8), SQL_NODE_STRING);
545 return SQL_TOKEN_STRING;
547 SQL_NEW_NODE(::rtl::OStringToOUString(sBuffer.makeStringAndClear(),RTL_TEXTENCODING_UTF8), SQL_NODE_ACCESS_DATE);
548 return SQL_TOKEN_ACCESS_DATE;
553 sBuffer.append(static_cast<sal_Char>(ch));
557 else if (nTyp != 1 && (ch == '\r' || ch == '\n') )
561 sBuffer.append(static_cast<sal_Char>(ch));
564 YY_FATAL_ERROR("Unterminated name string");
565 return SQL_TOKEN_INVALIDSYMBOL;
568 sal_Int32 mapEnumToToken(IParseContext::InternationalKeyCode _eKeyCode )
570 sal_Int32 nTokenID = 0;
573 case IParseContext::KEY_LIKE: nTokenID = SQL_TOKEN_LIKE; break;
574 case IParseContext::KEY_NOT: nTokenID = SQL_TOKEN_NOT; break;
575 case IParseContext::KEY_NULL: nTokenID = SQL_TOKEN_NULL; break;
576 case IParseContext::KEY_TRUE: nTokenID = SQL_TOKEN_TRUE; break;
577 case IParseContext::KEY_FALSE: nTokenID = SQL_TOKEN_FALSE; break;
578 case IParseContext::KEY_IS: nTokenID = SQL_TOKEN_IS; break;
579 case IParseContext::KEY_BETWEEN: nTokenID = SQL_TOKEN_BETWEEN; break;
580 case IParseContext::KEY_OR: nTokenID = SQL_TOKEN_OR; break;
581 case IParseContext::KEY_AND: nTokenID = SQL_TOKEN_AND; break;
582 case IParseContext::KEY_AVG: nTokenID = SQL_TOKEN_AVG; break;
583 case IParseContext::KEY_COUNT: nTokenID = SQL_TOKEN_COUNT; break;
584 case IParseContext::KEY_MAX: nTokenID = SQL_TOKEN_MAX; break;
585 case IParseContext::KEY_MIN: nTokenID = SQL_TOKEN_MIN; break;
586 case IParseContext::KEY_SUM: nTokenID = SQL_TOKEN_SUM; break;
587 case IParseContext::KEY_EVERY: nTokenID = SQL_TOKEN_EVERY; break;
588 case IParseContext::KEY_ANY: nTokenID = SQL_TOKEN_ANY; break;
589 case IParseContext::KEY_SOME: nTokenID = SQL_TOKEN_SOME; break;
590 case IParseContext::KEY_STDDEV_POP: nTokenID = SQL_TOKEN_STDDEV_POP; break;
591 case IParseContext::KEY_STDDEV_SAMP: nTokenID = SQL_TOKEN_STDDEV_SAMP; break;
592 case IParseContext::KEY_VAR_SAMP: nTokenID = SQL_TOKEN_VAR_SAMP; break;
593 case IParseContext::KEY_VAR_POP: nTokenID = SQL_TOKEN_VAR_POP; break;
594 case IParseContext::KEY_COLLECT: nTokenID = SQL_TOKEN_COLLECT; break;
595 case IParseContext::KEY_FUSION: nTokenID = SQL_TOKEN_FUSION; break;
596 case IParseContext::KEY_INTERSECTION: nTokenID = SQL_TOKEN_INTERSECTION; break;
598 OSL_FAIL( "mapEnumToToken: unsupported key!" );
603 * Read SQL Name literal
604 * Valid Names or international keywords:
605 * As we have international keywords, we test first on them
607 sal_Int32 gatherName(const sal_Char* text)
610 OSL_ENSURE(xxx_pGLOBAL_SQLSCAN,"You forgot to set the scanner!");
611 IParseContext::InternationalKeyCode eKeyCode = xxx_pGLOBAL_SQLSCAN->getInternationalTokenID(text);
614 case IParseContext::KEY_LIKE:
615 case IParseContext::KEY_NOT:
616 case IParseContext::KEY_NULL:
617 case IParseContext::KEY_TRUE:
618 case IParseContext::KEY_FALSE:
619 case IParseContext::KEY_IS:
620 case IParseContext::KEY_BETWEEN:
621 case IParseContext::KEY_OR:
622 case IParseContext::KEY_AND:
623 case IParseContext::KEY_COUNT:
624 case IParseContext::KEY_AVG:
625 case IParseContext::KEY_MAX:
626 case IParseContext::KEY_MIN:
627 case IParseContext::KEY_SUM:
628 case IParseContext::KEY_EVERY:
629 case IParseContext::KEY_ANY:
630 case IParseContext::KEY_SOME:
631 case IParseContext::KEY_STDDEV_POP:
632 case IParseContext::KEY_STDDEV_SAMP:
633 case IParseContext::KEY_VAR_SAMP:
634 case IParseContext::KEY_VAR_POP:
635 case IParseContext::KEY_COLLECT:
636 case IParseContext::KEY_FUSION:
637 case IParseContext::KEY_INTERSECTION:
638 nToken = mapEnumToToken(eKeyCode);
639 SQL_NEW_KEYWORD(nToken);
642 SQL_NEW_NODE(::rtl::OUString(text,strlen(text),RTL_TEXTENCODING_UTF8), SQL_NODE_NAME);
643 return SQL_TOKEN_NAME;
647 Read SQL Name literal for predicate check
648 Valid Names or internatioanl keywords:
649 As we have international keywords, we test first on them
651 sal_Int32 gatherNamePre(const sal_Char* text)
654 OSL_ENSURE(xxx_pGLOBAL_SQLSCAN,"You forgot to set the scanner!");
655 IParseContext::InternationalKeyCode eKeyCode = xxx_pGLOBAL_SQLSCAN->getInternationalTokenID(text);
658 case IParseContext::KEY_LIKE:
659 case IParseContext::KEY_NOT:
660 case IParseContext::KEY_NULL:
661 case IParseContext::KEY_TRUE:
662 case IParseContext::KEY_FALSE:
663 case IParseContext::KEY_IS:
664 case IParseContext::KEY_BETWEEN:
665 case IParseContext::KEY_OR:
666 case IParseContext::KEY_AND:
667 case IParseContext::KEY_COUNT:
668 case IParseContext::KEY_AVG:
669 case IParseContext::KEY_MAX:
670 case IParseContext::KEY_MIN:
671 case IParseContext::KEY_SUM:
672 case IParseContext::KEY_EVERY:
673 case IParseContext::KEY_ANY:
674 case IParseContext::KEY_SOME:
675 case IParseContext::KEY_STDDEV_POP:
676 case IParseContext::KEY_STDDEV_SAMP:
677 case IParseContext::KEY_VAR_SAMP:
678 case IParseContext::KEY_VAR_POP:
679 case IParseContext::KEY_COLLECT:
680 case IParseContext::KEY_FUSION:
681 case IParseContext::KEY_INTERSECTION:
682 nToken = mapEnumToToken(eKeyCode);
683 SQL_NEW_KEYWORD(nToken);
686 // we need a special handling for parameter
688 ::rtl::OString sStmt = xxx_pGLOBAL_SQLSCAN->getStatement();
689 sal_Int32 nLength = strlen(text);
690 sal_Int32 nPos = xxx_pGLOBAL_SQLSCAN->GetCurrentPos() - nLength - 2;
691 if (sStmt.getStr()[nPos] == ':')
693 SQL_NEW_NODE(::rtl::OUString(text,nLength,RTL_TEXTENCODING_UTF8), SQL_NODE_NAME);
694 nToken = SQL_TOKEN_NAME;
698 SQL_NEW_NODE(::rtl::OUString(text,nLength,RTL_TEXTENCODING_UTF8), SQL_NODE_STRING);
699 nToken = SQL_TOKEN_STRING;
706 using namespace connectivity;
708 static bool IN_SQLyyerror;
709 //------------------------------------------------------------------------------
710 OSQLScanner::OSQLScanner()
713 , m_bInternational(sal_False)
714 , m_nRule(0) // 0 is INITIAL
716 IN_SQLyyerror = false;
719 //------------------------------------------------------------------------------
720 OSQLScanner::~OSQLScanner()
723 //------------------------------------------------------------------------------
724 void OSQLScanner::SQLyyerror(sal_Char *fmt)
729 IN_SQLyyerror = true;
731 OSL_ENSURE(m_pContext, "OSQLScanner::SQLyyerror: No Context set");
732 m_sErrorMessage = ::rtl::OUString(fmt,strlen(fmt),RTL_TEXTENCODING_UTF8);
733 if (m_nCurrentPos < m_sStatement.getLength())
735 m_sErrorMessage += ::rtl::OUString(": ");
737 ::rtl::OUString aError;
738 static sal_Int32 BUFFERSIZE = 256;
739 static sal_Char* Buffer = 0;
741 Buffer = new sal_Char[BUFFERSIZE];
743 sal_Char *s = Buffer;
745 int ch = SQLyytext ? (SQLyytext[0] == 0 ? ' ' : SQLyytext[0]): ' ';
747 while (!checkeof(ch = yyinput()))
751 if ((ch = yyinput()) != ' ')
757 aError = ::rtl::OUString(Buffer,nPos,RTL_TEXTENCODING_UTF8);
763 if (++nPos == BUFFERSIZE)
765 ::rtl::OString aBuf(Buffer);
768 Buffer = new sal_Char[BUFFERSIZE];
769 for(sal_Int32 i=0;i<aBuf.getLength();++i,++Buffer)
770 *Buffer = aBuf.getStr()[i];
775 m_sErrorMessage += aError;
779 IN_SQLyyerror = false;
783 //------------------------------------------------------------------------------
784 void OSQLScanner::prepareScan(const ::rtl::OUString & rNewStatement, const IParseContext* pContext, sal_Bool bInternational)
789 m_sErrorMessage = ::rtl::OUString();
790 m_sStatement = ::rtl::OUStringToOString(rNewStatement, RTL_TEXTENCODING_UTF8);
792 m_bInternational = bInternational;
793 m_pContext = pContext;
796 //------------------------------------------------------------------------------
797 sal_Int32 OSQLScanner::SQLyygetc(void)
799 sal_Int32 nPos = (m_nCurrentPos >= m_sStatement.getLength()) ? EOF : m_sStatement.getStr()[m_nCurrentPos];
804 //------------------------------------------------------------------------------
805 IParseContext::InternationalKeyCode OSQLScanner::getInternationalTokenID(const sal_Char* sToken) const
807 OSL_ENSURE(m_pContext, "OSQLScanner::getInternationalTokenID: No Context set");
808 return (m_bInternational) ? m_pContext->getIntlKeyCode(::rtl::OString(sToken) ) : IParseContext::KEY_NONE;
810 // -------------------------------------------------------------------------
811 sal_Int32 OSQLScanner::GetCurrentRule() const { return m_nRule; }
812 sal_Int32 OSQLScanner::GetGERRule() const { return PREDICATE_GER; }
813 sal_Int32 OSQLScanner::GetENGRule() const { return PREDICATE_ENG; }
814 sal_Int32 OSQLScanner::GetSQLRule() const { return SQL; }
815 sal_Int32 OSQLScanner::GetDATERule() const { return DATE; }
816 sal_Int32 OSQLScanner::GetSTRINGRule() const { return STRING; }
817 // -------------------------------------------------------------------------
818 void OSQLScanner::setScanner(sal_Bool _bNull)
820 xxx_pGLOBAL_SQLSCAN = _bNull ? NULL : this;
822 // -------------------------------------------------------------------------
823 sal_Int32 OSQLScanner::SQLlex()
828 #if defined __SUNPRO_CC
830 #elif defined _MSC_VER