-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPlSql_Parser.java
More file actions
11011 lines (10480 loc) · 270 KB
/
Copy pathPlSql_Parser.java
File metadata and controls
11011 lines (10480 loc) · 270 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* PlSql.java */
/* Generated By:JJTree&JavaCC: Do not edit this line. PlSql.java */
package parser;
import java.io.Reader;
import java.io.FileInputStream;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.xml.soap.Node;
public class PlSql_Parser implements PlSqlTreeConstants, PlSqlConstants {/*@bgen(jjtree)*/
protected JJTPlSqlState jjtree = new JJTPlSqlState();
private static String code = "";
private static String className = "";
/** Parse PL/SQL from files. Each arg is expected to be the name of a file,
or "-" to indicate System.in.
*/
public static void main( String args[] ) throws Throwable {
className = args[0];
final String input = args[1];
final PlSql_Parser parser = new PlSql_Parser("-".equals(input) ? System.in : new FileInputStream(input));
SimpleNode node = parser.CompilationUnit();
node.dump("");
System.out.println(Node.ENTITY_NODE);
System.out.println(parser.tables.size() + " tables in " + input);
}
public Set<String> functions = new HashSet<String>();
public Set<String> procedures = new HashSet<String>();
public Set<String> tables = new HashSet<String>();
public void reInit(Reader input) {
ReInit(input);
functions.clear();
procedures.clear();
tables.clear();
}
private String lastObjectReference = null;
protected boolean seeTYPE() {
return "TYPE".equalsIgnoreCase(getToken(1).image);
}
protected static final Set<String> ANALYTIC_FUNCTION_NAMES = new HashSet<String>();
static {
ANALYTIC_FUNCTION_NAMES.add("AVG");
ANALYTIC_FUNCTION_NAMES.add("CORR");
ANALYTIC_FUNCTION_NAMES.add("COVAR_POP");
ANALYTIC_FUNCTION_NAMES.add("COVAR_SAMP");
ANALYTIC_FUNCTION_NAMES.add("COUNT");
ANALYTIC_FUNCTION_NAMES.add("CUME_DIST");
ANALYTIC_FUNCTION_NAMES.add("DENSE_RANK");
ANALYTIC_FUNCTION_NAMES.add("FIRST");
ANALYTIC_FUNCTION_NAMES.add("FIRST_VALUE");
ANALYTIC_FUNCTION_NAMES.add("LAG");
ANALYTIC_FUNCTION_NAMES.add("LAST");
ANALYTIC_FUNCTION_NAMES.add("LAST_VALUE");
ANALYTIC_FUNCTION_NAMES.add("LEAD");
ANALYTIC_FUNCTION_NAMES.add("MAX");
ANALYTIC_FUNCTION_NAMES.add("MIN");
ANALYTIC_FUNCTION_NAMES.add("NTILE");
ANALYTIC_FUNCTION_NAMES.add("PERCENT_RANK");
ANALYTIC_FUNCTION_NAMES.add("PERCENTILE_CONT");
ANALYTIC_FUNCTION_NAMES.add("PERCENTILE_DISC");
ANALYTIC_FUNCTION_NAMES.add("RANK");
ANALYTIC_FUNCTION_NAMES.add("RATIO_TO_REPORT");
ANALYTIC_FUNCTION_NAMES.add("REGR_SLOPE");
ANALYTIC_FUNCTION_NAMES.add("REGR_INTERCEPT");
ANALYTIC_FUNCTION_NAMES.add("REGR_COUNT");
ANALYTIC_FUNCTION_NAMES.add("REGR_R2");
ANALYTIC_FUNCTION_NAMES.add("REGR_AVGX");
ANALYTIC_FUNCTION_NAMES.add("REGR_AVGY");
ANALYTIC_FUNCTION_NAMES.add("REGR_SXX");
ANALYTIC_FUNCTION_NAMES.add("REGR_SYY");
ANALYTIC_FUNCTION_NAMES.add("REGR_SXY");
ANALYTIC_FUNCTION_NAMES.add("ROW_NUMBER");
ANALYTIC_FUNCTION_NAMES.add("STDDEV");
ANALYTIC_FUNCTION_NAMES.add("STDDEV_POP");
ANALYTIC_FUNCTION_NAMES.add("STDDEV_SAMP");
ANALYTIC_FUNCTION_NAMES.add("SUM");
ANALYTIC_FUNCTION_NAMES.add("VAR_POP");
ANALYTIC_FUNCTION_NAMES.add("VAR_SAMP");
ANALYTIC_FUNCTION_NAMES.add("VARIANCE");
}
protected boolean seeAnalyticFunction() {
return "(".equals(getToken(2).image)
&& ANALYTIC_FUNCTION_NAMES.contains(getToken(1).image.toUpperCase());
}
/* Represents a PLSQL code block. */
final public SimpleNode CompilationUnit() throws ParseException {/*@bgen(jjtree) CompilationUnit */
SimpleNode jjtn000 = new SimpleNode(JJTCOMPILATIONUNIT);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
try {
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case K_PROCEDURE:{
ProcedureDeclaration();
break;
}
case K_FUNCTION:{
FunctionDeclaration();
break;
}
case K_BEGIN:
case K_CLOSE:
case K_COMMIT:
case K_DECLARE:
case K_DELETE:
case K_EXIT:
case K_FETCH:
case K_FOR:
case K_FORALL:
case K_GOTO:
case K_IF:
case K_INSERT:
case K_LOCK:
case K_LOOP:
case K_MERGE:
case K_NULL:
case K_OPEN:
case K_RAISE:
case K_RETURN:
case K_ROLLBACK:
case K_SAVEPOINT:
case K_SELECT:
case K_SET:
case K_UPDATE:
case K_WHILE:
case S_IDENTIFIER:
case S_BIND:
case S_QUOTED_IDENTIFIER:
case 150:
case 154:
case 160:{
SequenceOfStatements();
break;
}
case K_ALTER:{
AlterSession();
break;
}
case K_CALL:{
jj_consume_token(K_CALL);
ProcedureCall();
break;
}
default:
jj_la1[0] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte000;}
}
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
{if (true) throw (Error)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
}
}
return jjtn000;
}
final public void BindVariable() throws ParseException {/*@bgen(jjtree) BindVariable */
SimpleNode jjtn000 = new SimpleNode(JJTBINDVARIABLE);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
try {
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case S_BIND:{
jj_consume_token(S_BIND);
break;
}
case 150:{
jj_consume_token(150);
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case S_NUMBER:{
jj_consume_token(S_NUMBER);
break;
}
case S_IDENTIFIER:{
jj_consume_token(S_IDENTIFIER);
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case 151:{
jj_consume_token(151);
jj_consume_token(S_IDENTIFIER);
break;
}
default:
jj_la1[1] = jj_gen;
;
}
break;
}
default:
jj_la1[2] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
break;
}
default:
jj_la1[3] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
}
}
}
final public void AlterSession() throws ParseException {/*@bgen(jjtree) AlterSession */
SimpleNode jjtn000 = new SimpleNode(JJTALTERSESSION);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
try {
jj_consume_token(K_ALTER);
ID("SESSION");
jj_consume_token(K_SET);
label_1:
while (true) {
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case S_IDENTIFIER:{
;
break;
}
default:
jj_la1[4] = jj_gen;
break label_1;
}
jj_consume_token(S_IDENTIFIER);
jj_consume_token(152);
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case S_CHAR_LITERAL:{
jj_consume_token(S_CHAR_LITERAL);
break;
}
default:
jj_la1[5] = jj_gen;
if (getToken(1).image.matches("(?i)TRUE|FALSE")) {
jj_consume_token(S_IDENTIFIER);
} else {
jj_consume_token(-1);
throw new ParseException();
}
}
}
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case K_COMMENT:{
jj_consume_token(K_COMMENT);
jj_consume_token(152);
jj_consume_token(S_CHAR_LITERAL);
break;
}
default:
jj_la1[6] = jj_gen;
;
}
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte000;}
}
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
{if (true) throw (Error)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
}
}
}
final public void DeclarationSection() throws ParseException {/*@bgen(jjtree) DeclarationSection */
SimpleNode jjtn000 = new SimpleNode(JJTDECLARATIONSECTION);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
try {
jj_consume_token(K_DECLARE);
Declarations();
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte000;}
}
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
{if (true) throw (Error)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
}
}
}
final public void Declarations() throws ParseException {/*@bgen(jjtree) Declarations */
SimpleNode jjtn000 = new SimpleNode(JJTDECLARATIONS);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
try {
label_2:
while (true) {
if (seeTYPE()) {
ID("TYPE");
jj_consume_token(S_IDENTIFIER);
jj_consume_token(K_IS);
TypeDefinition();
} else {
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case K_CURSOR:{
CursorDeclaration();
break;
}
case K_PRAGMA:{
PragmaDeclaration();
break;
}
case S_IDENTIFIER:{
IdentifierDeclaration();
break;
}
default:
jj_la1[7] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
jj_consume_token(153);
if (jj_2_1(1)) {
;
} else {
break label_2;
}
}
label_3:
while (true) {
if (jj_2_2(1)) {
;
} else {
break label_3;
}
if (!seeTYPE()) {
ProcedureDeclaration();
} else if (!seeTYPE()) {
FunctionDeclaration();
} else {
jj_consume_token(-1);
throw new ParseException();
}
}
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte000;}
}
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
{if (true) throw (Error)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
}
}
}
final public void IdentifierDeclaration() throws ParseException {/*@bgen(jjtree) IdentifierDeclaration */
SimpleNode jjtn000 = new SimpleNode(JJTIDENTIFIERDECLARATION);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
try {
jj_consume_token(S_IDENTIFIER);
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case K_CONSTANT:{
ConstantDeclaration();
break;
}
case K_BINARY_INTEGER:
case K_BOOLEAN:
case K_CHAR:
case K_DATE:
case K_FLOAT:
case K_INTEGER:
case K_NATURAL:
case K_NUMBER:
case K_REAL:
case K_TABLE:
case K_VARCHAR2:
case K_VARCHAR:
case S_IDENTIFIER:
case S_QUOTED_IDENTIFIER:{
VariableDeclaration();
break;
}
case K_EXCEPTION:{
ExceptionDeclaration();
break;
}
default:
jj_la1[8] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte000;}
}
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
{if (true) throw (Error)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
}
}
}
final public void CursorDeclaration() throws ParseException {/*@bgen(jjtree) CursorDeclaration */
SimpleNode jjtn000 = new SimpleNode(JJTCURSORDECLARATION);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
try {
jj_consume_token(K_CURSOR);
jj_consume_token(S_IDENTIFIER);
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case 154:{
jj_consume_token(154);
ParameterList();
jj_consume_token(155);
break;
}
default:
jj_la1[9] = jj_gen;
;
}
jj_consume_token(K_IS);
SelectStatement();
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte000;}
}
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
{if (true) throw (Error)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
}
}
}
final public void PragmaDeclaration() throws ParseException {/*@bgen(jjtree) PragmaDeclaration */
SimpleNode jjtn000 = new SimpleNode(JJTPRAGMADECLARATION);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
try {
jj_consume_token(K_PRAGMA);
jj_consume_token(K_EXCEPTION_INIT);
jj_consume_token(154);
NumOrID();
jj_consume_token(156);
NumOrID();
jj_consume_token(155);
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte000;}
}
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
{if (true) throw (Error)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
}
}
}
final public void ProcedureDeclaration() throws ParseException {/*@bgen(jjtree) ProcedureDeclaration */
SimpleNode jjtn000 = new SimpleNode(JJTPROCEDUREDECLARATION);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
try {
jj_consume_token(K_PROCEDURE);
jj_consume_token(S_IDENTIFIER);
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case 154:{
jj_consume_token(154);
ParameterList();
jj_consume_token(155);
break;
}
default:
jj_la1[10] = jj_gen;
;
}
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case 153:{
jj_consume_token(153);
break;
}
case K_IS:{
jj_consume_token(K_IS);
ProcedureBody();
break;
}
default:
jj_la1[11] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte000;}
}
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
{if (true) throw (Error)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
}
}
}
final public void ProcedureBody() throws ParseException {/*@bgen(jjtree) ProcedureBody */
SimpleNode jjtn000 = new SimpleNode(JJTPROCEDUREBODY);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
try {
if (jj_2_3(1)) {
Declarations();
} else {
;
}
BeginEndBlock();
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte000;}
}
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
{if (true) throw (Error)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
}
}
}
final public void FunctionDeclaration() throws ParseException {/*@bgen(jjtree) FunctionDeclaration */
SimpleNode jjtn000 = new SimpleNode(JJTFUNCTIONDECLARATION);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
try {
jj_consume_token(K_FUNCTION);
jj_consume_token(S_IDENTIFIER);
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case 154:{
jj_consume_token(154);
ParameterList();
jj_consume_token(155);
break;
}
default:
jj_la1[12] = jj_gen;
;
}
jj_consume_token(K_RETURN);
TypeDefinition();
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case 153:{
jj_consume_token(153);
break;
}
case K_IS:{
jj_consume_token(K_IS);
FunctionBody();
break;
}
default:
jj_la1[13] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte000;}
}
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
{if (true) throw (Error)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
}
}
}
final public void FunctionBody() throws ParseException {/*@bgen(jjtree) FunctionBody */
SimpleNode jjtn000 = new SimpleNode(JJTFUNCTIONBODY);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
try {
if (jj_2_4(1)) {
Declarations();
} else {
;
}
BeginEndBlock();
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte000;}
}
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
{if (true) throw (Error)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
}
}
}
final public String[] VariableDeclaration() throws ParseException {/*@bgen(jjtree) VariableDeclaration */
SimpleNode jjtn000 = new SimpleNode(JJTVARIABLEDECLARATION);
boolean jjtc000 = true;
String[] output = new String[3];
output[0] = token.image;
jjtree.openNodeScope(jjtn000);
try {
TypeDefinition();
output[1] = token.image;
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case K_NOT:{
jj_consume_token(K_NOT);
jj_consume_token(K_NULL);
break;
}
default:
jj_la1[14] = jj_gen;
;
}
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case K_DEFAULT:
case 157:{
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case 157:{
jj_consume_token(157);
break;
}
case K_DEFAULT:{
jj_consume_token(K_DEFAULT);
break;
}
default:
jj_la1[15] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
PlSqlExpression();
output[2] = token.image;
break;
}
default:
jj_la1[16] = jj_gen;
;
}
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte000;}
}
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
{if (true) throw (Error)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
}
}
return output;
}
final public void ConstantDeclaration() throws ParseException {/*@bgen(jjtree) ConstantDeclaration */
SimpleNode jjtn000 = new SimpleNode(JJTCONSTANTDECLARATION);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
try {
jj_consume_token(K_CONSTANT);
TypeDefinition();
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case K_NOT:{
jj_consume_token(K_NOT);
jj_consume_token(K_NULL);
break;
}
default:
jj_la1[17] = jj_gen;
;
}
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case 157:{
jj_consume_token(157);
break;
}
case K_DEFAULT:{
jj_consume_token(K_DEFAULT);
break;
}
default:
jj_la1[18] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
PlSqlExpression();
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte000;}
}
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
{if (true) throw (Error)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
}
}
}
final public void TypeDefinition() throws ParseException {/*@bgen(jjtree) TypeDefinition */
SimpleNode jjtn000 = new SimpleNode(JJTTYPEDEFINITION);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
try {
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case K_BINARY_INTEGER:
case K_BOOLEAN:
case K_CHAR:
case K_DATE:
case K_FLOAT:
case K_INTEGER:
case K_NATURAL:
case K_NUMBER:
case K_REAL:
case K_VARCHAR2:
case K_VARCHAR:{
BasicDataTypeDefinition();
break;
}
case K_TABLE:{
jj_consume_token(K_TABLE);
jj_consume_token(K_OF);
TypeDefinition();
if (jj_2_5(2)) {
jj_consume_token(K_INDEX);
jj_consume_token(K_BY);
BasicDataTypeDefinition();
} else {
;
}
break;
}
default:
jj_la1[20] = jj_gen;
if (jj_2_6(2)) {
jj_consume_token(S_IDENTIFIER);
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case 158:{
jj_consume_token(158);
break;
}
case 159:{
jj_consume_token(159);
break;
}
default:
jj_la1[19] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
} else if (jj_2_7(2147483647)) {
TableColumn();
jj_consume_token(158);
} else {
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case S_IDENTIFIER:{
jj_consume_token(S_IDENTIFIER);
break;
}
default:
jj_la1[21] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
}
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte000;}
}
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
{if (true) throw (Error)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
}
}
}
final public void BasicDataTypeDefinition() throws ParseException {/*@bgen(jjtree) BasicDataTypeDefinition */
SimpleNode jjtn000 = new SimpleNode(JJTBASICDATATYPEDEFINITION);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
try {
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case K_CHAR:
case K_FLOAT:
case K_INTEGER:
case K_NATURAL:
case K_NUMBER:
case K_REAL:
case K_VARCHAR2:
case K_VARCHAR:{
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case K_CHAR:{
jj_consume_token(K_CHAR);
break;
}
case K_VARCHAR:{
jj_consume_token(K_VARCHAR);
break;
}
case K_VARCHAR2:{
jj_consume_token(K_VARCHAR2);
break;
}
case K_INTEGER:{
jj_consume_token(K_INTEGER);
break;
}
case K_NUMBER:{
jj_consume_token(K_NUMBER);
break;
}
case K_NATURAL:{
jj_consume_token(K_NATURAL);
break;
}
case K_REAL:{
jj_consume_token(K_REAL);
break;
}
case K_FLOAT:{
jj_consume_token(K_FLOAT);
break;
}
default:
jj_la1[22] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case 154:{
jj_consume_token(154);
jj_consume_token(S_NUMBER);
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
case 156:{
jj_consume_token(156);
jj_consume_token(S_NUMBER);
break;
}
default:
jj_la1[23] = jj_gen;
;
}
jj_consume_token(155);
break;
}
default:
jj_la1[24] = jj_gen;
;
}
break;
}
case K_DATE:{
jj_consume_token(K_DATE);
break;
}
case K_BINARY_INTEGER:{
jj_consume_token(K_BINARY_INTEGER);
break;
}
case K_BOOLEAN:{