Revision 35713

View differences:

tags/v1_11_0_Build_1306/libraries/libGDBMS/.cvsignore
1
target
2
drivers
3
bin-test
4
bin
0 5

  
tags/v1_11_0_Build_1306/libraries/libGDBMS/.project
1
<?xml version="1.0" encoding="UTF-8"?>
2
<projectDescription>
3
	<name>libGDBMS</name>
4
	<comment>GDBMS is a library that allows to make queries to data sets hosted in different formats and hosts. It follows the SQL92 syntax and extends it in several poins. Allows extensions to data sets types, queries, functions and data types.</comment>
5
	<projects>
6
	</projects>
7
	<buildSpec>
8
		<buildCommand>
9
			<name>org.eclipse.jdt.core.javabuilder</name>
10
			<arguments>
11
			</arguments>
12
		</buildCommand>
13
		<buildCommand>
14
			<name>de.loskutov.FileSync.FSBuilder</name>
15
			<arguments>
16
			</arguments>
17
		</buildCommand>
18
	</buildSpec>
19
	<natures>
20
		<nature>org.eclipse.jdt.core.javanature</nature>
21
	</natures>
22
</projectDescription>
0 23

  
tags/v1_11_0_Build_1306/libraries/libGDBMS/conf/grammar/developer guide.txt
1
Pasos para generar la gram?tica
2

  
3
	(1) borrar del paquete parser todo menos SimpleNode y
4
TokenSupport
5
	(2) arrancar el compilegrammar
6
	(3) mover lo que genera en el defaultpackage al paquete 
7
	parser con el men? refactor de eclipse
0 8

  
tags/v1_11_0_Build_1306/libraries/libGDBMS/conf/grammar/sql.jj
1
/* adder.jj Adding up numbers */
2
options {
3
	STATIC = false ;
4
}
5
PARSER_BEGIN(SQLEngine)
6
import java.io.FileInputStream;
7
import java.io.FileNotFoundException;
8
	public class SQLEngine {
9
		public static void main( String[] args )
10
		throws ParseException, TokenMgrError, FileNotFoundException {
11
			SQLEngine parser = new SQLEngine( new FileInputStream(args[0] )) ;
12
			parser.SQLStatement() ; }
13
  private void jjtreeOpenNodeScope( Node node )
14
  {
15
    ((SimpleNode)node).first_token = getToken(1);
16
  }
17

  
18
  private void jjtreeCloseNodeScope( Node node )
19
  {
20
    ((SimpleNode)node).last_token = getToken(0);
21
  }
22

  
23
	public Node getRootNode(){
24
		return jjtree.rootNode();
25
	}
26

  
27
		}
28
PARSER_END(SQLEngine)
29

  
30
/***********************************************************************
31
 * Token definitions
32
 ***********************************************************************/
33

  
34
/* There may be tokens here which don't relate to SQL, but we needed for
35
   the rest of our project [Kevin] */ 
36

  
37
SKIP:
38
{
39
    " "
40
  | "\n"
41
  | "\r"
42
  | "\t"
43
}
44

  
45

  
46
SKIP:
47
{
48
  <COMMENT_LINE: "--" (~["\n","\r"])* ("\n"|"\r"|"\r\n") >
49
}
50

  
51

  
52
SKIP:
53
{
54
  <COMMENT_BLOCK: "/*" (~["*"])* "*" ("*" | (~["*","/"] (~["*"])* "*"))* "/">
55
}
56

  
57

  
58
TOKEN:  /* Keywords */
59
{
60
    < ALL: "all" >
61
  | < AND: "and" >
62
  | < AS: "as" >
63
  | < ASC: "asc" >
64
  | < BEGIN: "begin" >
65
  | < BETWEEN: "between" >
66
  | < BY: "by" >
67
  | < CUSTOM: "custom" >
68
  | < DESC: "desc" >
69
  | < DISTINCT: "distinct" >
70
  | < FROM: "from" >
71
  | < GROUP: "group" >
72
  | < HAVING: "having" >
73
  | < IN: "in" >
74
  | < IS: "is" >
75
  | < LIKE: "like" >
76
  | < NOT: "not" >
77
  | < NULL: "null" >
78
  | < OR: "or" >
79
  | < ORDER: "order" >
80
  | < SELECT: "select" >
81
  | < UNION: "union" >
82
  | < SPACES: "spaces" >
83
  | < TABLES: "tables" >
84
  | < WHERE: "where" >
85

  
86
//***************************************************************************************
87
  | < DELETE: "delete" >
88
  | < EXISTS: "exists" >
89
  | < INSERT: "insert" >
90
  | < INTO: "into" >
91
  | < SET: "set" >
92
  | < UPDATE: "update" >
93
  | < VALUES: "values" >
94
}
95

  
96
 
97
TOKEN:  /* Literals */
98
{
99
    < INTEGER_LITERAL: (["0"-"9"])+ >
100
  | < FLOATING_POINT_LITERAL:
101
          (["0"-"9"])+ "." (["0"-"9"])+ (<EXPONENT>)?
102
        | "." (["0"-"9"])+ (<EXPONENT>)?
103
        | (["0"-"9"])+ <EXPONENT>
104
        | (["0"-"9"])+ (<EXPONENT>)?
105
    >
106
  | < #EXPONENT: ["e","E"] (["+","-"])? (["0"-"9"])+ >
107
  | < STRING_LITERAL: "'" (~["'"])* ( "''" (~["'"])* )* "'" >
108
}
109

  
110

  
111
TOKEN:  /* Identifiers */
112
{
113
    < ID: ( <LETTER> )+ ( "_" | "$" | "#" | <DIGIT> | <LETTER> )* >
114
  | < #LETTER: ["A"-"Z", "a"-"z"] >
115
  | < #DIGIT: ["0"-"9"] >
116
}
117

  
118

  
119
TOKEN:  /* Separators and operators */
120
{
121
    < ASSIGN: ":=" >
122
  | < CONCAT: "||" >
123
  | < SEMICOLON: ";" >
124
  | < DOT: "." >
125
  | < TILDE: "~" >
126
  | < LESS: "<" >
127
  | < LESSEQUAL: "<=" >
128
  | < GREATER: ">" >
129
  | < GREATEREQUAL: ">=" >
130
  | < EQUAL: "=" >
131
  | < NOTEQUAL: "!=" >
132
  | < NOTEQUAL2: "<>" >
133
  | < JOINPLUS: "(+)" >
134
  | < OPENPAREN: "(" >
135
  | < CLOSEPAREN: ")" >
136
  | < ASTERISK: "*" >
137
  | < SLASH: "/" >
138
  | < PLUS: "+" >
139
  | < MINUS: "-" >
140
  | < QUESTIONMARK: "?" >
141
  | <COMPARISON: <LESS>
142
       | <LESSEQUAL>
143
       | <GREATER>
144
       | <GREATEREQUAL>
145
       | <EQUAL>
146
       | <NOTEQUAL>
147
       | <NOTEQUAL2>
148
    >
149
}
150

  
151

  
152

  
153
void SQLAndExpr() :
154
{}
155
{
156
  SQLNotExpr()
157
  ( <AND> 
158
	 SQLNotExpr() )*
159
}
160

  
161
void SQLBetweenClause() :
162
{}
163
{
164
  [ <NOT> ]
165
  <BETWEEN> 
166
  SQLSumExpr() 
167
  <AND> 
168
  SQLSumExpr()
169
}
170

  
171
void SQLColRef() :
172
{
173
}
174
{
175
  SQLLvalue()
176
}
177

  
178
void SQLCompareExpr() :
179
{
180
}
181
{
182
  (
183
    LOOKAHEAD (SQLSelect()) SQLSelect()
184
  | LOOKAHEAD (SQLColRef() <IS>) SQLIsClause()
185
  | LOOKAHEAD (<EXISTS>) SQLExistsClause()
186
  | SQLSumExpr() [ SQLCompareExprRight() ] 
187
  )
188
}
189

  
190
void SQLCompareExprRight() :
191
{}
192
{
193
  (
194
    LOOKAHEAD(2) SQLLikeClause()
195
  | LOOKAHEAD(2) SQLInClause()
196
  | SQLLeftJoinClause()
197
  | LOOKAHEAD(SQLCompareOp() SQLSumExpr() "(+)") SQLRightJoinClause() 
198
  | LOOKAHEAD(2) SQLBetweenClause()
199
  | SQLCompareOp() 
200
    SQLSumExpr() 
201
  )
202
}
203

  
204
void SQLCompareOp() :
205
{}
206
{
207
  (
208
    <EQUAL>
209
  | <NOTEQUAL>
210
  | <NOTEQUAL2>
211
  | <GREATER>
212
  | <GREATEREQUAL>
213
  | <LESS>
214
  | <LESSEQUAL>
215
  )
216
}
217

  
218
void SQLCustom() :
219
{}
220
{
221
	<CUSTOM> <ID> 
222
	<TABLES> SQLTableList() 
223
	<VALUES> SQLFunctionArgs()
224
}
225

  
226
void SQLDelete() :
227
{}
228
{
229
  <DELETE> <FROM>
230
  SQLTableList()
231
  [ SQLWhere() ]
232
}
233

  
234
void SQLExistsClause() :
235
{}
236
{
237
  <EXISTS> 
238
  "(" SQLSelect() ")"
239
}
240

  
241
void SQLFunction() :
242
{}
243
{
244
  <ID> 
245
    SQLFunctionArgs() 
246
}
247

  
248
void SQLFunctionArgs() :
249
{}
250
{
251
  "(" 
252
  [ SQLSumExpr() 
253
    ( "," 
254
      SQLSumExpr() )*
255
  ]
256
  ")" 
257
}
258

  
259
void SQLGroupBy() :
260
{}
261
{
262
  <GROUP> <BY> 
263
  SQLOrderByList() 
264
}
265

  
266
void SQLInClause() :
267
{}
268
{
269
  [ <NOT> ]
270
  <IN> 
271
  "(" 
272
  SQLLValueList() 
273
  ")" 
274
}
275

  
276
void SQLInsert() :
277
{}
278
{
279
  <INSERT> <INTO> 
280
  SQLTableList() 
281
  [
282
    "(" 
283
    SQLSelectCols() 
284
    ")" 
285
    <VALUES> 
286
  ]
287
  "("
288
  SQLSelectCols() 
289
  ")"
290
}
291

  
292
void SQLIsClause() :
293
{}
294
{
295
  SQLColRef() 
296
  <IS> 
297
  [ <NOT>  ]
298
  <NULL> 
299
}
300

  
301
void SQLLeftJoinClause() :
302
{
303
}
304
{
305
  "(+)" SQLCompareOp() 
306
  SQLSumExpr()
307
}
308

  
309
void SQLLikeClause() :
310
{}
311
{
312
  [ <NOT>  ]
313
  <LIKE> 
314
  SQLPattern() 
315
}
316

  
317
void SQLLiteral() :
318
{
319
}
320
{
321
  ( <STRING_LITERAL> 
322
  | <INTEGER_LITERAL> 
323
  | <FLOATING_POINT_LITERAL> 
324
  | <SPACES> 
325
  | <ASTERISK> 
326
  )
327
}
328

  
329
void SQLLvalue() :
330
{
331
}
332
{
333
  (
334
    SQLLvalueTerm()
335
  )
336
}
337

  
338
void SQLLvalueTerm() :
339
{
340
}
341
{
342
  <ID> 
343
  ( <DOT> <ID> )*
344
}
345

  
346
void SQLNotExpr() :
347
{}
348
{
349
  [ <NOT> ] 
350
  SQLCompareExpr() 
351
}
352

  
353
void SQLOrderBy() :
354
{}
355
{
356
  <ORDER> <BY> 
357
  SQLOrderByList()
358
}
359

  
360
void SQLOrderByElem() :
361
{}
362
{
363
  SQLColRef()
364
  [ SQLOrderDirection()]
365
}
366

  
367
void SQLOrderByList() :
368
{}
369
{
370
  SQLOrderByElem()
371
  ( LOOKAHEAD(2)
372
    "," 
373
    SQLOrderByElem() )*
374
}
375

  
376
void SQLOrderDirection() :
377
{}
378
{
379
  (
380
    <ASC>
381
  | <DESC>
382
  )
383
}
384

  
385
void SQLOrExpr() :
386
{}
387
{
388
  SQLAndExpr()
389
  ( <OR> 
390
	SQLAndExpr() )* 
391
}
392

  
393
void SQLPattern() :
394
{
395
}
396
{
397
  ( <STRING_LITERAL> 
398
  | "?" 
399
  | SQLLvalue()
400
  )
401
}
402

  
403
void SQLProductExpr() :
404
{}
405
{
406
  SQLUnaryExpr()
407
  ( ( "*"
408
    | "/"
409
    ) SQLUnaryExpr())*
410
}
411

  
412
void SQLRightJoinClause() :
413
{
414
}
415
{
416
  SQLCompareOp()
417
  SQLSumExpr()
418
  "(+)"
419
}
420

  
421
void SQLUnion() :
422
{}
423
{
424
	(
425
	SQLTableRef()
426
	|
427
	<OPENPAREN>
428
	SQLSelect()
429
	<CLOSEPAREN>
430
	)
431
	<UNION>
432
	(
433
	SQLTableRef()
434
	|
435
	<OPENPAREN>
436
	SQLSelect()
437
	<CLOSEPAREN>
438
	)
439
}
440

  
441
void SQLSelect() :
442
{}
443
{
444
  <SELECT>
445
  SQLSelectCols()
446
  [ <INTO>
447
    SQLSelectCols()
448
  ]
449
  <FROM>
450
  SQLTableList()
451
  [ SQLWhere()]
452
  [ SQLGroupBy()]
453
  [ SQLOrderBy()]
454
}
455

  
456
void SQLSelectCols() :
457
{}
458
{
459
  [ <ALL>
460
  | <DISTINCT>
461
  ] ( "*" | SQLSelectList())
462
}
463

  
464
void SQLSelectList() :
465
{}
466
{
467
  SQLSumExpr() [<AS> <ID>]
468
  ( "," SQLSumExpr() [<AS> <ID>])*
469
}
470

  
471
void SQLStatement() :
472
{}
473
{
474
  ( 
475
    SQLSelect() 
476
  | SQLInsert()
477
  | SQLUpdate()
478
  | SQLDelete()
479
  | SQLUnion()
480
  | SQLCustom()
481
  ) ";"
482
}
483

  
484
void SQLSumExpr() :
485
{}
486
{
487
    SQLProductExpr()
488
     ( LOOKAHEAD(2) ( "+" 
489
                    | "-" 
490
                    | "||" 
491
                    ) SQLProductExpr()  )*
492
}
493

  
494
void SQLTableList() :
495
{}
496
{
497
  SQLTableRef()
498
  ( LOOKAHEAD(2) "," SQLTableRef() )*
499
}
500

  
501

  
502
void SQLTableRef() :
503
{
504
}
505
{
506
  (<ID>|<STRING_LITERAL>)
507
  [ <ID>
508
  ]
509
}
510

  
511
void SQLTerm() :
512
{
513
}
514
{
515
  (
516
    "(" 
517
    SQLOrExpr()
518
    ")"
519
  | SQLFunction()
520
  | SQLColRef()
521
  | SQLLiteral()
522
  )
523
}
524

  
525
void SQLUnaryExpr() :
526
{}
527
{
528
  [ ( "+" 
529
    | "-" 
530
    )
531
  ] SQLTerm()
532
}
533

  
534
void SQLUpdate() :
535
{}
536
{
537
  <UPDATE>
538
  SQLTableList()
539
  <SET>
540
  ( 
541
    LOOKAHEAD(SQLLvalue() "=") SQLUpdateAssignment()
542
    [
543
      ","
544
    ] 
545
  )+
546

  
547
  [ SQLWhere() ]
548
}
549

  
550
void SQLUpdateAssignment() :
551
{}
552
{
553
  SQLLvalue() "="
554
  (
555
      LOOKAHEAD(SQLTerm() <CONCAT> ) 
556
      SQLTerm() 
557
      ( <CONCAT> 
558
        SQLTerm() )+
559
      | SQLSumExpr() )
560
}
561

  
562
void SQLLValueElement() :
563
{}
564
{
565
  ( <NULL> 
566
  | SQLSumExpr() 
567
  | SQLSelect()) 
568
}
569

  
570
void SQLLValueList() :
571
{}
572
{
573
  SQLLValueElement() 
574
  ( "," 
575
    SQLLValueElement()
576
  )*
577
}
578

  
579
void SQLWhere() :
580
{}
581
{
582
  <WHERE> SQLOrExpr()
583
}
0 584

  
tags/v1_11_0_Build_1306/libraries/libGDBMS/conf/grammar/sql.jj.jj
1
/*@bgen(jjtree) Generated By:JJTree: Do not edit this line. sql.jj.jj */
2
/*@egen*//* adder.jj Adding up numbers */
3
options {
4
	STATIC = false ;
5
}
6
PARSER_BEGIN(SQLEngine)
7
import java.io.FileInputStream;
8
import java.io.FileNotFoundException;
9
	public class SQLEngine/*@bgen(jjtree)*/implements SQLEngineTreeConstants/*@egen*/ {/*@bgen(jjtree)*/
10
  protected JJTSQLEngineState jjtree = new JJTSQLEngineState();
11

  
12
/*@egen*/
13
		public static void main( String[] args )
14
		throws ParseException, TokenMgrError, FileNotFoundException {
15
			SQLEngine parser = new SQLEngine( new FileInputStream(args[0] )) ;
16
			parser.SQLStatement() ; }
17
  private void jjtreeOpenNodeScope( Node node )
18
  {
19
    ((SimpleNode)node).first_token = getToken(1);
20
  }
21

  
22
  private void jjtreeCloseNodeScope( Node node )
23
  {
24
    ((SimpleNode)node).last_token = getToken(0);
25
  }
26

  
27
	public Node getRootNode(){
28
		return jjtree.rootNode();
29
	}
30

  
31
		}
32
PARSER_END(SQLEngine)
33

  
34
/***********************************************************************
35
 * Token definitions
36
 ***********************************************************************/
37

  
38
/* There may be tokens here which don't relate to SQL, but we needed for
39
   the rest of our project [Kevin] */ 
40

  
41
SKIP:
42
{
43
    " "
44
  | "\n"
45
  | "\r"
46
  | "\t"
47
}
48

  
49

  
50
SKIP:
51
{
52
  <COMMENT_LINE: "--" (~["\n","\r"])* ("\n"|"\r"|"\r\n") >
53
}
54

  
55

  
56
SKIP:
57
{
58
  <COMMENT_BLOCK: "/*" (~["*"])* "*" ("*" | (~["*","/"] (~["*"])* "*"))* "/">
59
}
60

  
61

  
62
TOKEN:  /* Keywords */
63
{
64
    < ALL: "all" >
65
  | < AND: "and" >
66
  | < AS: "as" >
67
  | < ASC: "asc" >
68
  | < BEGIN: "begin" >
69
  | < BETWEEN: "between" >
70
  | < BY: "by" >
71
  | < CUSTOM: "custom" >
72
  | < DESC: "desc" >
73
  | < DISTINCT: "distinct" >
74
  | < FROM: "from" >
75
  | < GROUP: "group" >
76
  | < HAVING: "having" >
77
  | < IN: "in" >
78
  | < IS: "is" >
79
  | < LIKE: "like" >
80
  | < MAX: "max" >
81
  | < MIN: "min" >
82
  | < NOT: "not" >
83
  | < NULL: "null" >
84
  | < OR: "or" >
85
  | < ORDER: "order" >
86
  | < SELECT: "select" >
87
  | < UNION: "union" >
88
  | < SPACES: "spaces" >
89
  | < SUBSTR: "substr" >
90
  | < SUM: "sum" >
91
  | < TABLES: "tables" >
92
  | < UPPER: "upper" >
93
  | < WHERE: "where" >
94

  
95
//***************************************************************************************
96
  | < COUNT: "count" >
97
  | < DELETE: "delete" >
98
  | < EXISTS: "exists" >
99
  | < INSERT: "insert" >
100
  | < INTO: "into" >
101
  | < LENGTH: "length" >
102
  | < LTRIM: "ltrim" >
103
  | < REPLACE: "replace" >
104
  | < RTRIM: "rtrim" >
105
  | < SET: "set" >
106
  | < UPDATE: "update" >
107
  | < VALUES: "values" >
108
}
109

  
110
 
111
TOKEN:  /* Literals */
112
{
113
    < INTEGER_LITERAL: (["0"-"9"])+ >
114
  | < FLOATING_POINT_LITERAL:
115
          (["0"-"9"])+ "." (["0"-"9"])+ (<EXPONENT>)?
116
        | "." (["0"-"9"])+ (<EXPONENT>)?
117
        | (["0"-"9"])+ <EXPONENT>
118
        | (["0"-"9"])+ (<EXPONENT>)?
119
    >
120
  | < #EXPONENT: ["e","E"] (["+","-"])? (["0"-"9"])+ >
121
  | < STRING_LITERAL: "'" (~["'"])* ( "''" (~["'"])* )* "'" >
122
}
123

  
124

  
125
TOKEN:  /* Identifiers */
126
{
127
    < ID: ( <LETTER> )+ ( "_" | "$" | "#" | <DIGIT> | <LETTER> )* >
128
  | < #LETTER: ["A"-"Z", "a"-"z"] >
129
  | < #DIGIT: ["0"-"9"] >
130
}
131

  
132

  
133
TOKEN:  /* Separators and operators */
134
{
135
    < ASSIGN: ":=" >
136
  | < CONCAT: "||" >
137
  | < SEMICOLON: ";" >
138
  | < DOT: "." >
139
  | < TILDE: "~" >
140
  | < LESS: "<" >
141
  | < LESSEQUAL: "<=" >
142
  | < GREATER: ">" >
143
  | < GREATEREQUAL: ">=" >
144
  | < EQUAL: "=" >
145
  | < NOTEQUAL: "!=" >
146
  | < NOTEQUAL2: "<>" >
147
  | < JOINPLUS: "(+)" >
148
  | < OPENPAREN: "(" >
149
  | < CLOSEPAREN: ")" >
150
  | < ASTERISK: "*" >
151
  | < SLASH: "/" >
152
  | < PLUS: "+" >
153
  | < MINUS: "-" >
154
  | < QUESTIONMARK: "?" >
155
  | <COMPARISON: <LESS>
156
       | <LESSEQUAL>
157
       | <GREATER>
158
       | <GREATEREQUAL>
159
       | <EQUAL>
160
       | <NOTEQUAL>
161
       | <NOTEQUAL2>
162
    >
163
}
164

  
165

  
166

  
167
void SQLAndExpr() :
168
{/*@bgen(jjtree) SQLAndExpr */
169
  ASTSQLAndExpr jjtn000 = new ASTSQLAndExpr(JJTSQLANDEXPR);
170
  boolean jjtc000 = true;
171
  jjtree.openNodeScope(jjtn000);
172
  jjtreeOpenNodeScope(jjtn000);
173
/*@egen*/}
174
{/*@bgen(jjtree) SQLAndExpr */
175
  try {
176
/*@egen*/
177
  SQLNotExpr()
178
  ( <AND> 
179
	 SQLNotExpr() )*/*@bgen(jjtree)*/
180
  } catch (Throwable jjte000) {
181
    if (jjtc000) {
182
      jjtree.clearNodeScope(jjtn000);
183
      jjtc000 = false;
184
    } else {
185
      jjtree.popNode();
186
    }
187
    if (jjte000 instanceof RuntimeException) {
188
      throw (RuntimeException)jjte000;
189
    }
190
    if (jjte000 instanceof ParseException) {
191
      throw (ParseException)jjte000;
192
    }
193
    throw (Error)jjte000;
194
  } finally {
195
    if (jjtc000) {
196
      jjtree.closeNodeScope(jjtn000, true);
197
      jjtreeCloseNodeScope(jjtn000);
198
    }
199
  }
200
/*@egen*/
201
}
202

  
203
void SQLBetweenClause() :
204
{/*@bgen(jjtree) SQLBetweenClause */
205
  ASTSQLBetweenClause jjtn000 = new ASTSQLBetweenClause(JJTSQLBETWEENCLAUSE);
206
  boolean jjtc000 = true;
207
  jjtree.openNodeScope(jjtn000);
208
  jjtreeOpenNodeScope(jjtn000);
209
/*@egen*/}
210
{/*@bgen(jjtree) SQLBetweenClause */
211
  try {
212
/*@egen*/
213
  [ <NOT> ]
214
  <BETWEEN> 
215
  SQLSumExpr() 
216
  <AND> 
217
  SQLSumExpr()/*@bgen(jjtree)*/
218
  } catch (Throwable jjte000) {
219
    if (jjtc000) {
220
      jjtree.clearNodeScope(jjtn000);
221
      jjtc000 = false;
222
    } else {
223
      jjtree.popNode();
224
    }
225
    if (jjte000 instanceof RuntimeException) {
226
      throw (RuntimeException)jjte000;
227
    }
228
    if (jjte000 instanceof ParseException) {
229
      throw (ParseException)jjte000;
230
    }
231
    throw (Error)jjte000;
232
  } finally {
233
    if (jjtc000) {
234
      jjtree.closeNodeScope(jjtn000, true);
235
      jjtreeCloseNodeScope(jjtn000);
236
    }
237
  }
238
/*@egen*/
239
}
240

  
241
void SQLColRef() :
242
{/*@bgen(jjtree) SQLColRef */
243
  ASTSQLColRef jjtn000 = new ASTSQLColRef(JJTSQLCOLREF);
244
  boolean jjtc000 = true;
245
  jjtree.openNodeScope(jjtn000);
246
  jjtreeOpenNodeScope(jjtn000);
247
/*@egen*/
248
}
249
{/*@bgen(jjtree) SQLColRef */
250
  try {
251
/*@egen*/
252
  SQLLvalue()/*@bgen(jjtree)*/
253
  } catch (Throwable jjte000) {
254
    if (jjtc000) {
255
      jjtree.clearNodeScope(jjtn000);
256
      jjtc000 = false;
257
    } else {
258
      jjtree.popNode();
259
    }
260
    if (jjte000 instanceof RuntimeException) {
261
      throw (RuntimeException)jjte000;
262
    }
263
    if (jjte000 instanceof ParseException) {
264
      throw (ParseException)jjte000;
265
    }
266
    throw (Error)jjte000;
267
  } finally {
268
    if (jjtc000) {
269
      jjtree.closeNodeScope(jjtn000, true);
270
      jjtreeCloseNodeScope(jjtn000);
271
    }
272
  }
273
/*@egen*/
274
}
275

  
276
void SQLCompareExpr() :
277
{/*@bgen(jjtree) SQLCompareExpr */
278
  ASTSQLCompareExpr jjtn000 = new ASTSQLCompareExpr(JJTSQLCOMPAREEXPR);
279
  boolean jjtc000 = true;
280
  jjtree.openNodeScope(jjtn000);
281
  jjtreeOpenNodeScope(jjtn000);
282
/*@egen*/
283
}
284
{/*@bgen(jjtree) SQLCompareExpr */
285
  try {
286
/*@egen*/
287
  (
288
    LOOKAHEAD (SQLSelect()) SQLSelect()
289
  | LOOKAHEAD (SQLColRef() <IS>) SQLIsClause()
290
  | LOOKAHEAD (<EXISTS>) SQLExistsClause()
291
  | SQLSumExpr() [ SQLCompareExprRight() ] 
292
  )/*@bgen(jjtree)*/
293
  } catch (Throwable jjte000) {
294
    if (jjtc000) {
295
      jjtree.clearNodeScope(jjtn000);
296
      jjtc000 = false;
297
    } else {
298
      jjtree.popNode();
299
    }
300
    if (jjte000 instanceof RuntimeException) {
301
      throw (RuntimeException)jjte000;
302
    }
303
    if (jjte000 instanceof ParseException) {
304
      throw (ParseException)jjte000;
305
    }
306
    throw (Error)jjte000;
307
  } finally {
308
    if (jjtc000) {
309
      jjtree.closeNodeScope(jjtn000, true);
310
      jjtreeCloseNodeScope(jjtn000);
311
    }
312
  }
313
/*@egen*/
314
}
315

  
316
void SQLCompareExprRight() :
317
{/*@bgen(jjtree) SQLCompareExprRight */
318
  ASTSQLCompareExprRight jjtn000 = new ASTSQLCompareExprRight(JJTSQLCOMPAREEXPRRIGHT);
319
  boolean jjtc000 = true;
320
  jjtree.openNodeScope(jjtn000);
321
  jjtreeOpenNodeScope(jjtn000);
322
/*@egen*/}
323
{/*@bgen(jjtree) SQLCompareExprRight */
324
  try {
325
/*@egen*/
326
  (
327
    LOOKAHEAD(2) SQLLikeClause()
328
  | LOOKAHEAD(2) SQLInClause()
329
  | SQLLeftJoinClause()
330
  | LOOKAHEAD(SQLCompareOp() SQLSumExpr() "(+)") SQLRightJoinClause() 
331
  | LOOKAHEAD(2) SQLBetweenClause()
332
  | SQLCompareOp() 
333
    SQLSumExpr() 
334
  )/*@bgen(jjtree)*/
335
  } catch (Throwable jjte000) {
336
    if (jjtc000) {
337
      jjtree.clearNodeScope(jjtn000);
338
      jjtc000 = false;
339
    } else {
340
      jjtree.popNode();
341
    }
342
    if (jjte000 instanceof RuntimeException) {
343
      throw (RuntimeException)jjte000;
344
    }
345
    if (jjte000 instanceof ParseException) {
346
      throw (ParseException)jjte000;
347
    }
348
    throw (Error)jjte000;
349
  } finally {
350
    if (jjtc000) {
351
      jjtree.closeNodeScope(jjtn000, true);
352
      jjtreeCloseNodeScope(jjtn000);
353
    }
354
  }
355
/*@egen*/
356
}
357

  
358
void SQLCompareOp() :
359
{/*@bgen(jjtree) SQLCompareOp */
360
  ASTSQLCompareOp jjtn000 = new ASTSQLCompareOp(JJTSQLCOMPAREOP);
361
  boolean jjtc000 = true;
362
  jjtree.openNodeScope(jjtn000);
363
  jjtreeOpenNodeScope(jjtn000);
364
/*@egen*/}
365
{/*@bgen(jjtree) SQLCompareOp */
366
  try {
367
/*@egen*/
368
  (
369
    <EQUAL>
370
  | <NOTEQUAL>
371
  | <NOTEQUAL2>
372
  | <GREATER>
373
  | <GREATEREQUAL>
374
  | <LESS>
375
  | <LESSEQUAL>
376
  )/*@bgen(jjtree)*/
377
  } finally {
378
    if (jjtc000) {
379
      jjtree.closeNodeScope(jjtn000, true);
380
      jjtreeCloseNodeScope(jjtn000);
381
    }
382
  }
383
/*@egen*/
384
}
385

  
386
void SQLCustom() :
387
{/*@bgen(jjtree) SQLCustom */
388
  ASTSQLCustom jjtn000 = new ASTSQLCustom(JJTSQLCUSTOM);
389
  boolean jjtc000 = true;
390
  jjtree.openNodeScope(jjtn000);
391
  jjtreeOpenNodeScope(jjtn000);
392
/*@egen*/}
393
{/*@bgen(jjtree) SQLCustom */
394
        try {
395
/*@egen*/
396
	<CUSTOM> <ID> 
397
	<TABLES> SQLTableList() 
398
	<VALUES> SQLFunctionArgs()/*@bgen(jjtree)*/
399
        } catch (Throwable jjte000) {
400
          if (jjtc000) {
401
            jjtree.clearNodeScope(jjtn000);
402
            jjtc000 = false;
403
          } else {
404
            jjtree.popNode();
405
          }
406
          if (jjte000 instanceof RuntimeException) {
407
            throw (RuntimeException)jjte000;
408
          }
409
          if (jjte000 instanceof ParseException) {
410
            throw (ParseException)jjte000;
411
          }
412
          throw (Error)jjte000;
413
        } finally {
414
          if (jjtc000) {
415
            jjtree.closeNodeScope(jjtn000, true);
416
            jjtreeCloseNodeScope(jjtn000);
417
          }
418
        }
419
/*@egen*/
420
}
421

  
422
void SQLDelete() :
423
{/*@bgen(jjtree) SQLDelete */
424
  ASTSQLDelete jjtn000 = new ASTSQLDelete(JJTSQLDELETE);
425
  boolean jjtc000 = true;
426
  jjtree.openNodeScope(jjtn000);
427
  jjtreeOpenNodeScope(jjtn000);
428
/*@egen*/}
429
{/*@bgen(jjtree) SQLDelete */
430
  try {
431
/*@egen*/
432
  <DELETE> <FROM>
433
  SQLTableList()
434
  [ SQLWhere() ]/*@bgen(jjtree)*/
435
  } catch (Throwable jjte000) {
436
    if (jjtc000) {
437
      jjtree.clearNodeScope(jjtn000);
438
      jjtc000 = false;
439
    } else {
440
      jjtree.popNode();
441
    }
442
    if (jjte000 instanceof RuntimeException) {
443
      throw (RuntimeException)jjte000;
444
    }
445
    if (jjte000 instanceof ParseException) {
446
      throw (ParseException)jjte000;
447
    }
448
    throw (Error)jjte000;
449
  } finally {
450
    if (jjtc000) {
451
      jjtree.closeNodeScope(jjtn000, true);
452
      jjtreeCloseNodeScope(jjtn000);
453
    }
454
  }
455
/*@egen*/
456
}
457

  
458
void SQLExistsClause() :
459
{/*@bgen(jjtree) SQLExistsClause */
460
  ASTSQLExistsClause jjtn000 = new ASTSQLExistsClause(JJTSQLEXISTSCLAUSE);
461
  boolean jjtc000 = true;
462
  jjtree.openNodeScope(jjtn000);
463
  jjtreeOpenNodeScope(jjtn000);
464
/*@egen*/}
465
{/*@bgen(jjtree) SQLExistsClause */
466
  try {
467
/*@egen*/
468
  <EXISTS> 
469
  "(" SQLSelect() ")"/*@bgen(jjtree)*/
470
  } catch (Throwable jjte000) {
471
    if (jjtc000) {
472
      jjtree.clearNodeScope(jjtn000);
473
      jjtc000 = false;
474
    } else {
475
      jjtree.popNode();
476
    }
477
    if (jjte000 instanceof RuntimeException) {
478
      throw (RuntimeException)jjte000;
479
    }
480
    if (jjte000 instanceof ParseException) {
481
      throw (ParseException)jjte000;
482
    }
483
    throw (Error)jjte000;
484
  } finally {
485
    if (jjtc000) {
486
      jjtree.closeNodeScope(jjtn000, true);
487
      jjtreeCloseNodeScope(jjtn000);
488
    }
489
  }
490
/*@egen*/
491
}
492

  
493
void SQLFunction() :
494
{/*@bgen(jjtree) SQLFunction */
495
  ASTSQLFunction jjtn000 = new ASTSQLFunction(JJTSQLFUNCTION);
496
  boolean jjtc000 = true;
497
  jjtree.openNodeScope(jjtn000);
498
  jjtreeOpenNodeScope(jjtn000);
499
/*@egen*/}
500
{/*@bgen(jjtree) SQLFunction */
501
  try {
502
/*@egen*/
503
  <ID> 
504
    SQLFunctionArgs()/*@bgen(jjtree)*/
505
  } catch (Throwable jjte000) {
506
    if (jjtc000) {
507
      jjtree.clearNodeScope(jjtn000);
508
      jjtc000 = false;
509
    } else {
510
      jjtree.popNode();
511
    }
512
    if (jjte000 instanceof RuntimeException) {
513
      throw (RuntimeException)jjte000;
514
    }
515
    if (jjte000 instanceof ParseException) {
516
      throw (ParseException)jjte000;
517
    }
518
    throw (Error)jjte000;
519
  } finally {
520
    if (jjtc000) {
521
      jjtree.closeNodeScope(jjtn000, true);
522
      jjtreeCloseNodeScope(jjtn000);
523
    }
524
  }
525
/*@egen*/ 
526
}
527

  
528
void SQLFunctionArgs() :
529
{/*@bgen(jjtree) SQLFunctionArgs */
530
  ASTSQLFunctionArgs jjtn000 = new ASTSQLFunctionArgs(JJTSQLFUNCTIONARGS);
531
  boolean jjtc000 = true;
532
  jjtree.openNodeScope(jjtn000);
533
  jjtreeOpenNodeScope(jjtn000);
534
/*@egen*/}
535
{/*@bgen(jjtree) SQLFunctionArgs */
536
  try {
537
/*@egen*/
538
  "(" 
539
  [ SQLSumExpr() 
540
    ( "," 
541
      SQLSumExpr() )*
542
  ]
543
  ")"/*@bgen(jjtree)*/
544
  } catch (Throwable jjte000) {
545
    if (jjtc000) {
546
      jjtree.clearNodeScope(jjtn000);
547
      jjtc000 = false;
548
    } else {
549
      jjtree.popNode();
550
    }
551
    if (jjte000 instanceof RuntimeException) {
552
      throw (RuntimeException)jjte000;
553
    }
554
    if (jjte000 instanceof ParseException) {
555
      throw (ParseException)jjte000;
556
    }
557
    throw (Error)jjte000;
558
  } finally {
559
    if (jjtc000) {
560
      jjtree.closeNodeScope(jjtn000, true);
561
      jjtreeCloseNodeScope(jjtn000);
562
    }
563
  }
564
/*@egen*/ 
565
}
566

  
567
void SQLGroupBy() :
568
{/*@bgen(jjtree) SQLGroupBy */
569
  ASTSQLGroupBy jjtn000 = new ASTSQLGroupBy(JJTSQLGROUPBY);
570
  boolean jjtc000 = true;
571
  jjtree.openNodeScope(jjtn000);
572
  jjtreeOpenNodeScope(jjtn000);
573
/*@egen*/}
574
{/*@bgen(jjtree) SQLGroupBy */
575
  try {
576
/*@egen*/
577
  <GROUP> <BY> 
578
  SQLOrderByList()/*@bgen(jjtree)*/
579
  } catch (Throwable jjte000) {
580
    if (jjtc000) {
581
      jjtree.clearNodeScope(jjtn000);
582
      jjtc000 = false;
583
    } else {
584
      jjtree.popNode();
585
    }
586
    if (jjte000 instanceof RuntimeException) {
587
      throw (RuntimeException)jjte000;
588
    }
589
    if (jjte000 instanceof ParseException) {
590
      throw (ParseException)jjte000;
591
    }
592
    throw (Error)jjte000;
593
  } finally {
594
    if (jjtc000) {
595
      jjtree.closeNodeScope(jjtn000, true);
596
      jjtreeCloseNodeScope(jjtn000);
597
    }
598
  }
599
/*@egen*/ 
600
}
601

  
602
void SQLInClause() :
603
{/*@bgen(jjtree) SQLInClause */
604
  ASTSQLInClause jjtn000 = new ASTSQLInClause(JJTSQLINCLAUSE);
605
  boolean jjtc000 = true;
606
  jjtree.openNodeScope(jjtn000);
607
  jjtreeOpenNodeScope(jjtn000);
608
/*@egen*/}
609
{/*@bgen(jjtree) SQLInClause */
610
  try {
611
/*@egen*/
612
  [ <NOT> ]
613
  <IN> 
614
  "(" 
615
  SQLLValueList() 
616
  ")"/*@bgen(jjtree)*/
617
  } catch (Throwable jjte000) {
618
    if (jjtc000) {
619
      jjtree.clearNodeScope(jjtn000);
620
      jjtc000 = false;
621
    } else {
622
      jjtree.popNode();
623
    }
624
    if (jjte000 instanceof RuntimeException) {
625
      throw (RuntimeException)jjte000;
626
    }
627
    if (jjte000 instanceof ParseException) {
628
      throw (ParseException)jjte000;
629
    }
630
    throw (Error)jjte000;
631
  } finally {
632
    if (jjtc000) {
633
      jjtree.closeNodeScope(jjtn000, true);
634
      jjtreeCloseNodeScope(jjtn000);
635
    }
636
  }
637
/*@egen*/ 
638
}
639

  
640
void SQLInsert() :
641
{/*@bgen(jjtree) SQLInsert */
642
  ASTSQLInsert jjtn000 = new ASTSQLInsert(JJTSQLINSERT);
643
  boolean jjtc000 = true;
644
  jjtree.openNodeScope(jjtn000);
645
  jjtreeOpenNodeScope(jjtn000);
646
/*@egen*/}
647
{/*@bgen(jjtree) SQLInsert */
648
  try {
649
/*@egen*/
650
  <INSERT> <INTO> 
651
  SQLTableList() 
652
  [
653
    "(" 
654
    SQLSelectCols() 
655
    ")" 
656
    <VALUES> 
657
  ]
658
  "("
659
  SQLSelectCols() 
660
  ")"/*@bgen(jjtree)*/
661
  } catch (Throwable jjte000) {
662
    if (jjtc000) {
663
      jjtree.clearNodeScope(jjtn000);
664
      jjtc000 = false;
665
    } else {
666
      jjtree.popNode();
667
    }
668
    if (jjte000 instanceof RuntimeException) {
669
      throw (RuntimeException)jjte000;
670
    }
671
    if (jjte000 instanceof ParseException) {
672
      throw (ParseException)jjte000;
673
    }
674
    throw (Error)jjte000;
675
  } finally {
676
    if (jjtc000) {
677
      jjtree.closeNodeScope(jjtn000, true);
678
      jjtreeCloseNodeScope(jjtn000);
679
    }
680
  }
681
/*@egen*/
682
}
683

  
684
void SQLIsClause() :
685
{/*@bgen(jjtree) SQLIsClause */
686
  ASTSQLIsClause jjtn000 = new ASTSQLIsClause(JJTSQLISCLAUSE);
687
  boolean jjtc000 = true;
688
  jjtree.openNodeScope(jjtn000);
689
  jjtreeOpenNodeScope(jjtn000);
690
/*@egen*/}
691
{/*@bgen(jjtree) SQLIsClause */
692
  try {
693
/*@egen*/
694
  SQLColRef() 
695
  <IS> 
696
  [ <NOT>  ]
697
  <NULL>/*@bgen(jjtree)*/
698
  } catch (Throwable jjte000) {
699
    if (jjtc000) {
700
      jjtree.clearNodeScope(jjtn000);
701
      jjtc000 = false;
702
    } else {
703
      jjtree.popNode();
704
    }
705
    if (jjte000 instanceof RuntimeException) {
706
      throw (RuntimeException)jjte000;
707
    }
708
    if (jjte000 instanceof ParseException) {
709
      throw (ParseException)jjte000;
710
    }
711
    throw (Error)jjte000;
712
  } finally {
713
    if (jjtc000) {
714
      jjtree.closeNodeScope(jjtn000, true);
715
      jjtreeCloseNodeScope(jjtn000);
716
    }
717
  }
718
/*@egen*/ 
719
}
720

  
721
void SQLLeftJoinClause() :
722
{/*@bgen(jjtree) SQLLeftJoinClause */
723
  ASTSQLLeftJoinClause jjtn000 = new ASTSQLLeftJoinClause(JJTSQLLEFTJOINCLAUSE);
724
  boolean jjtc000 = true;
725
  jjtree.openNodeScope(jjtn000);
726
  jjtreeOpenNodeScope(jjtn000);
727
/*@egen*/
728
}
729
{/*@bgen(jjtree) SQLLeftJoinClause */
730
  try {
731
/*@egen*/
732
  "(+)" SQLCompareOp() 
733
  SQLSumExpr()/*@bgen(jjtree)*/
734
  } catch (Throwable jjte000) {
735
    if (jjtc000) {
736
      jjtree.clearNodeScope(jjtn000);
737
      jjtc000 = false;
738
    } else {
739
      jjtree.popNode();
740
    }
741
    if (jjte000 instanceof RuntimeException) {
742
      throw (RuntimeException)jjte000;
743
    }
744
    if (jjte000 instanceof ParseException) {
745
      throw (ParseException)jjte000;
746
    }
747
    throw (Error)jjte000;
748
  } finally {
749
    if (jjtc000) {
750
      jjtree.closeNodeScope(jjtn000, true);
751
      jjtreeCloseNodeScope(jjtn000);
752
    }
753
  }
754
/*@egen*/
755
}
756

  
757
void SQLLikeClause() :
758
{/*@bgen(jjtree) SQLLikeClause */
759
  ASTSQLLikeClause jjtn000 = new ASTSQLLikeClause(JJTSQLLIKECLAUSE);
760
  boolean jjtc000 = true;
761
  jjtree.openNodeScope(jjtn000);
762
  jjtreeOpenNodeScope(jjtn000);
763
/*@egen*/}
764
{/*@bgen(jjtree) SQLLikeClause */
765
  try {
766
/*@egen*/
767
  [ <NOT>  ]
768
  <LIKE> 
769
  SQLPattern()/*@bgen(jjtree)*/
770
  } catch (Throwable jjte000) {
771
    if (jjtc000) {
772
      jjtree.clearNodeScope(jjtn000);
773
      jjtc000 = false;
774
    } else {
775
      jjtree.popNode();
776
    }
777
    if (jjte000 instanceof RuntimeException) {
778
      throw (RuntimeException)jjte000;
779
    }
780
    if (jjte000 instanceof ParseException) {
781
      throw (ParseException)jjte000;
782
    }
783
    throw (Error)jjte000;
784
  } finally {
785
    if (jjtc000) {
786
      jjtree.closeNodeScope(jjtn000, true);
787
      jjtreeCloseNodeScope(jjtn000);
788
    }
789
  }
790
/*@egen*/ 
791
}
792

  
793
void SQLLiteral() :
794
{/*@bgen(jjtree) SQLLiteral */
795
  ASTSQLLiteral jjtn000 = new ASTSQLLiteral(JJTSQLLITERAL);
796
  boolean jjtc000 = true;
797
  jjtree.openNodeScope(jjtn000);
798
  jjtreeOpenNodeScope(jjtn000);
799
/*@egen*/
800
}
801
{/*@bgen(jjtree) SQLLiteral */
802
  try {
803
/*@egen*/
804
  ( <STRING_LITERAL> 
805
  | <INTEGER_LITERAL> 
806
  | <FLOATING_POINT_LITERAL> 
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff