-
Notifications
You must be signed in to change notification settings - Fork 0
/
Node.c
1924 lines (1857 loc) · 108 KB
/
Node.c
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
#include "Statement.h"
#include "Node.h"
#include "cstring.h"
#include "modifysql.h"
#if PY_MAJOR_VERSION >= 3
#define PyLong_FromLong PyLong_FromLong
#define PyUnicode_TO_UNICODE PyUnicode_AS_UNICODE
#define PyUnicode_FromString PyUnicode_FromString
#define PY_TP_FREE(o) Py_TYPE(o)->tp_free((PyObject*)o);
#define PyUnicode_FromStringAndSize PyUnicode_FromStringAndSize
#else
#define PyLong_FromLong PyInt_FromLong
#define PyUnicode_TO_UNICODE PyString_AS_STRING
#define PyUnicode_FromString PyString_FromString
#define PY_TP_FREE(o) o->ob_type->tp_free((PyObject*)o);
#define PyUnicode_FromStringAndSize PyString_FromStringAndSize
#endif
// Initialize this Type
void Node_init_type(PyObject *m) {
// Fill node parsing functions
Node_init();
if (PyType_Ready(&NodeType) < 0)
return;
Py_INCREF(&NodeType);
PyModule_AddObject(m, "Node", (PyObject*)&NodeType);
}
/*char* gsp_getNodeText( gsp_node* node )
{
gsp_sourcetoken* startToken = NULL;
gsp_sourcetoken* endToken = NULL;
gsp_sourcetoken* currentToken = NULL;
CString* content;
char* rc;
if(node == NULL)
return NULL;
if (node->nodeType == t_gsp_list)
{
if(((gsp_list*)node)->length>0){
startToken = (gsp_list_first((gsp_list *)node))->fragment.startToken;
endToken = (gsp_list_last((gsp_list *)node))->fragment.endToken;
}
}else{
startToken = node->fragment.startToken;
endToken = node->fragment.endToken;
}
currentToken = startToken;
if(currentToken == NULL)
return NULL;
while( startToken!=NULL && startToken!=endToken && startToken->tokenStatus == ets_deleted){
startToken = startToken->pNext;
}
if(startToken == NULL || startToken->tokenStatus == ets_deleted){
startToken = NULL;
endToken = NULL;
return NULL;
}
else{
while(endToken!=NULL && endToken!=startToken && endToken->tokenStatus == ets_deleted){
endToken = endToken->pPrev;
}
if(endToken == NULL || endToken->tokenStatus == ets_deleted){
startToken = NULL;
endToken = NULL;
return NULL;
}
content = CStringNew();
if(currentToken->tokenStatus!=ets_deleted)
CStringNAppend(content, currentToken->pStr, currentToken->nStrLen);
while(currentToken != endToken && currentToken->pNext!=NULL){
currentToken = currentToken->pNext;
if(currentToken->tokenStatus!=ets_deleted)
CStringNAppend(content, currentToken->pStr, currentToken->nStrLen);
if(currentToken == endToken)
break;
}
rc = content->buffer;
CStringDeleteWithoutBuffer(content);
return rc;
}
}*/
char* gsp_getSimpleNodeText(gsp_node* node, gsp_sqlparser *parser)
{
gsp_sourcetoken* startToken = NULL;
gsp_sourcetoken* endToken = NULL;
gsp_sourcetoken* currentToken = NULL;
CString* content;
char* rc;
if (node == NULL)
return NULL;
if (node->nodeType == t_gsp_list)
{
if (((gsp_list*)node)->length>0){
startToken = (gsp_list_first((gsp_list *)node))->fragment.startToken;
endToken = (gsp_list_last((gsp_list *)node))->fragment.endToken;
}
}
else{
startToken = node->fragment.startToken;
endToken = node->fragment.endToken;
}
currentToken = startToken;
if (currentToken == NULL)
return NULL;
while (startToken != NULL && startToken != endToken && startToken->tokenStatus == ets_deleted){
startToken = startToken->pNext;
}
if (startToken == NULL || startToken->tokenStatus == ets_deleted){
startToken = NULL;
endToken = NULL;
return NULL;
}
else{
int start, stop, len;
while (endToken != NULL && endToken != startToken && endToken->tokenStatus == ets_deleted){
endToken = endToken->pPrev;
}
if (endToken == NULL || endToken->tokenStatus == ets_deleted){
startToken = NULL;
endToken = NULL;
return NULL;
}
content = CStringNew();
if (startToken == endToken) {
start = startToken->nColumn - 1;
stop = start + startToken->nStrLen;
len = startToken->nStrLen;
}
else {
start = startToken->nColumn - 1;
stop = endToken->nColumn + endToken->nStrLen - 1;
len = stop - start;
}
//printf("%d, %d, %d\n", start, stop, len);
CStringNAppend(content, parser->sqltext + start, len);
rc = content->buffer;
CStringDeleteWithoutBuffer(content);
return rc;
}
}
PyObject *Node_get_text(SqlNode *self, PyObject *args)
{
char *tmp;
PyObject *name;
//tmp = gsp_getNodeText(self->_node);
tmp = gsp_getSimpleNodeText(self->_node, self->_parser);
if (tmp == NULL) {
name = PyUnicode_FromString("");
}
else {
name = PyUnicode_FromString(tmp);
gsp_free(tmp);
}
//Py_XINCREF(name);
return name;
}
PyObject *Node_get_position(SqlNode *self, PyObject *args)
{
if (self->_node->fragment.startToken) {
char *name;
PyObject *pos;
//name = gsp_getNodeText(self->_node);
name = gsp_getSimpleNodeText(self->_node, self->_parser);
if (name == NULL) {
Py_RETURN_NONE;
}
pos = Py_BuildValue("(ii)", self->_node->fragment.startToken->nColumn, strlen(name));
free(name);
return pos;
}
Py_RETURN_NONE;
}
// Provide a (standard) iterator if it's a list node
PyObject *Node_list_iterator(PyObject *o) {
SqlNode *node = (SqlNode*) o;
if (node->_node->nodeType == t_gsp_list) {
PyObject *iter = PyObject_GetIter(PyDict_GetItemString(node->dict, "list"));
Py_XDECREF(iter);
return iter;
}
Py_RETURN_NONE;
}
PyObject *Node_getattro(SqlNode *self, PyObject *name)
{
if (strcmp(PyUnicode_TO_UNICODE(name), "node_text") == 0) {
return Node_get_text(self, NULL);
}
return PyObject_GenericGetAttr((PyObject*)self, name);
}
PyObject *Node_FromNode(gsp_node *node, Statement *stmt) {
PyObject *self;
PyObject *type;
//PyObject *name;
//char *tmp;
//printf("Node_FromNode(%d) : %p\n", node->nodeType, node);
if (Node_parse_functions[node->nodeType] != NULL) {
self = Node_parse_functions[node->nodeType](node, stmt);
if (self->ob_type == &NodeType) {
// it's a SqlNode object!
type = PyLong_FromLong(node->nodeType);
PyDict_SetItemString(((SqlNode*)self)->dict, "node_type", type);
//Py_XDECREF(type);
if (node->nodeType == t_gsp_list) {
/*name = PyUnicode_FromString("LIST");
PyDict_SetItemString(((SqlNode*)self)->dict, "node_text", name);
Py_XDECREF(name);*/
} else {
/*tmp = gsp_getNodeText(node);
name = PyUnicode_FromString(tmp);
gsp_free(tmp);
PyDict_SetItemString(((SqlNode*)self)->dict, "node_text", name);
Py_XDECREF(name);*/
}
} else {
// it's something else! maybe a list. we dont judge.
}
} else {
type = PyLong_FromLong(node->nodeType);
//printf("NO PARSER FOR NODE TYPE: %d\n", node->nodeType);
self = Node_new(&NodeType, NULL, NULL);
PyDict_SetItemString(((SqlNode*)self)->dict, "node_type", type);
/*tmp = gsp_getNodeText(node);
name = PyUnicode_FromString(tmp);
gsp_free(tmp);
PyDict_SetItemString(((SqlNode*)self)->dict, "node_text", name);
Py_XDECREF(name);*/
}
//printf("Node_FromNode: %p %p\n", stmt->_statement, stmt->_statement->sqlparser);
((SqlNode*)self)->_parser = stmt->_statement->sqlparser;
return (PyObject*)self;
}
void Node_dealloc(SqlNode *self)
{
//printf("Node_dealloc %p (%d)\n", self, self->ob_refcnt);
Py_XDECREF(self->dict);
PY_TP_FREE(self)
}
PyObject *Node_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
SqlNode *self;
self = (SqlNode *)type->tp_alloc(type, 0);
if (self != NULL) {
self->_node = NULL;
self->_parser = NULL;
self->dict = PyDict_New();
}
return (PyObject*) self;
}
#define ADD_TOKEN(d, path, name) if (path->name) { PyObject *o = PyUnicode_FromStringAndSize(path->name->pStr, path->name->nStrLen); PyDict_SetItemString(d, #name, o); Py_XDECREF(o); } else { PyDict_SetItemString(d, #name, Py_None); }
#define ADD_INT(d, path, name) if (true) { PyObject *o = PyLong_FromLong(path->name); PyDict_SetItemString(d, #name, o); Py_XDECREF(o); }
#define ADD_NODE(d, path, name) if (path->name) { PyObject *o = Node_FromNode((gsp_node*)path->name, stmt); PyDict_SetItemString(d, #name, o); Py_XDECREF(o); } else { PyDict_SetItemString(d, #name, Py_None); }
#define ADD_LIST(d, path, name) if (path->name) { PyObject *o = Node_parsepath->name; PyDict_SetItemString(d, #name, o); Py_XDECREF(o); } else { PyDict_SetItemString(d, #name, Py_None); }
PyObject *Node_parse_list(gsp_node *node, Statement *stmt)
{
PyObject *list;
struct gsp_listcell *cell;
// generate new Node object
SqlNode *obj;
obj = (SqlNode*) Node_new(&NodeType, Py_None, Py_None); obj->_node = node;
// New list
list = PyList_New(0);
foreach(cell, ((gsp_list*)node)) {
// generate new Node object from list item
PyObject *o;
o= Node_FromNode((gsp_node*)cell->node, stmt);
// add to list
PyList_Append(list, (PyObject*) o);
Py_XDECREF(o);
}
// Add list to node
PyDict_SetItemString(obj->dict, "list", list);
Py_XDECREF(list);
return (PyObject*) obj;
}
/// AUTO-GENERATED PARSING FUNCTIONS
PyObject *Node_parse_listcell(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_listcell*)node), node);
ADD_NODE(obj->dict, ((gsp_listcell*)node), nextCell);
return (PyObject*)obj;
}
PyObject *Node_parse_sql_statement(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_INT(obj->dict, ((gsp_sql_statement*)node), stmtType);
ADD_NODE(obj->dict, ((gsp_sql_statement*)node), parseTree);
ADD_INT(obj->dict, ((gsp_sql_statement*)node), start_token_pos);
ADD_INT(obj->dict, ((gsp_sql_statement*)node), end_token_pos);
ADD_INT(obj->dict, ((gsp_sql_statement*)node), bCteQuery);
ADD_INT(obj->dict, ((gsp_sql_statement*)node), isParsed);
ADD_INT(obj->dict, ((gsp_sql_statement*)node), dummyTag);
return (PyObject*)obj;
}
PyObject *Node_parse_dummy(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_dummy*)node), node1);
ADD_INT(obj->dict, ((gsp_dummy*)node), int1);
return (PyObject*)obj;
}
PyObject *Node_parse_constant(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_TOKEN(obj->dict, ((gsp_constant*)node), signToken);
ADD_TOKEN(obj->dict, ((gsp_constant*)node), stringToken);
ADD_INT(obj->dict, ((gsp_constant*)node), constantType);
return (PyObject*)obj;
}
PyObject *Node_parse_objectname(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_INT(obj->dict, ((gsp_objectname*)node), objectType);
ADD_TOKEN(obj->dict, ((gsp_objectname*)node), serverToken);
ADD_TOKEN(obj->dict, ((gsp_objectname*)node), databaseToken);
ADD_TOKEN(obj->dict, ((gsp_objectname*)node), schemaToken);
ADD_TOKEN(obj->dict, ((gsp_objectname*)node), objectToken);
ADD_TOKEN(obj->dict, ((gsp_objectname*)node), partToken);
ADD_TOKEN(obj->dict, ((gsp_objectname*)node), propertyToken);
ADD_NODE(obj->dict, ((gsp_objectname*)node), fields);
ADD_INT(obj->dict, ((gsp_objectname*)node), nTokens);
ADD_NODE(obj->dict, ((gsp_objectname*)node), dblink);
ADD_NODE(obj->dict, ((gsp_objectname*)node), indices);
return (PyObject*)obj;
}
PyObject *Node_parse_expr(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_INT(obj->dict, ((gsp_expr*)node), expressionType);
ADD_NODE(obj->dict, ((gsp_expr*)node), objectOperand);
ADD_TOKEN(obj->dict, ((gsp_expr*)node), operatorToken);
ADD_NODE(obj->dict, ((gsp_expr*)node), leftOperand);
ADD_NODE(obj->dict, ((gsp_expr*)node), rightOperand);
ADD_NODE(obj->dict, ((gsp_expr*)node), subQueryNode);
ADD_NODE(obj->dict, ((gsp_expr*)node), subQueryStmt);
ADD_NODE(obj->dict, ((gsp_expr*)node), constantOperand);
ADD_NODE(obj->dict, ((gsp_expr*)node), exprList);
ADD_NODE(obj->dict, ((gsp_expr*)node), functionCall);
ADD_NODE(obj->dict, ((gsp_expr*)node), objectAccess);
ADD_NODE(obj->dict, ((gsp_expr*)node), caseExpression);
ADD_TOKEN(obj->dict, ((gsp_expr*)node), quantifier);
ADD_TOKEN(obj->dict, ((gsp_expr*)node), notToken);
ADD_NODE(obj->dict, ((gsp_expr*)node), likeEscapeOperand);
ADD_NODE(obj->dict, ((gsp_expr*)node), betweenOperand);
ADD_NODE(obj->dict, ((gsp_expr*)node), arrayAccess);
ADD_NODE(obj->dict, ((gsp_expr*)node), dataTypeName);
ADD_NODE(obj->dict, ((gsp_expr*)node), intervalExpression);
ADD_NODE(obj->dict, ((gsp_expr*)node), indices);
ADD_NODE(obj->dict, ((gsp_expr*)node), newVariantTypeArgumentList);
return (PyObject*)obj;
}
PyObject *Node_parse_objectAccess(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_objectAccess*)node), objectExpr);
ADD_NODE(obj->dict, ((gsp_objectAccess*)node), attributes);
ADD_NODE(obj->dict, ((gsp_objectAccess*)node), method);
return (PyObject*)obj;
}
PyObject *Node_parse_aliasClause(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_aliasClause*)node), aliasName);
ADD_TOKEN(obj->dict, ((gsp_aliasClause*)node), AsToken);
ADD_NODE(obj->dict, ((gsp_aliasClause*)node), nameList);
return (PyObject*)obj;
}
PyObject *Node_parse_resultColumn(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_resultColumn*)node), expr);
ADD_NODE(obj->dict, ((gsp_resultColumn*)node), aliasClause);
return (PyObject*)obj;
}
PyObject *Node_parse_trimArgument(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_TOKEN(obj->dict, ((gsp_trimArgument*)node), both_trailing_leading);
ADD_NODE(obj->dict, ((gsp_trimArgument*)node), stringExpression);
ADD_NODE(obj->dict, ((gsp_trimArgument*)node), trimCharacter);
return (PyObject*)obj;
}
PyObject *Node_parse_orderByItem(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_orderByItem*)node), sortKey);
ADD_TOKEN(obj->dict, ((gsp_orderByItem*)node), sortToken);
return (PyObject*)obj;
}
PyObject *Node_parse_orderBy(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_orderBy*)node), items);
return (PyObject*)obj;
}
PyObject *Node_parse_keepDenseRankClause(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_keepDenseRankClause*)node), orderBy);
return (PyObject*)obj;
}
PyObject *Node_parse_analyticFunction(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_analyticFunction*)node), keepDenseRankClause);
ADD_NODE(obj->dict, ((gsp_analyticFunction*)node), partitionBy_ExprList);
ADD_NODE(obj->dict, ((gsp_analyticFunction*)node), orderBy);
return (PyObject*)obj;
}
PyObject *Node_parse_functionCall(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_INT(obj->dict, ((gsp_functionCall*)node), functionType);
ADD_NODE(obj->dict, ((gsp_functionCall*)node), functionName);
ADD_INT(obj->dict, ((gsp_functionCall*)node), aggregateType);
ADD_NODE(obj->dict, ((gsp_functionCall*)node), trimArgument);
ADD_NODE(obj->dict, ((gsp_functionCall*)node), analyticFunction);
ADD_NODE(obj->dict, ((gsp_functionCall*)node), Args);
ADD_TOKEN(obj->dict, ((gsp_functionCall*)node), extract_time_token);
ADD_NODE(obj->dict, ((gsp_functionCall*)node), expr1);
ADD_NODE(obj->dict, ((gsp_functionCall*)node), expr2);
ADD_NODE(obj->dict, ((gsp_functionCall*)node), expr3);
ADD_NODE(obj->dict, ((gsp_functionCall*)node), dataTypename);
ADD_NODE(obj->dict, ((gsp_functionCall*)node), windowDef);
ADD_NODE(obj->dict, ((gsp_functionCall*)node), sortClause);
ADD_NODE(obj->dict, ((gsp_functionCall*)node), sortList);
return (PyObject*)obj;
}
PyObject *Node_parse_whenClauseItem(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_whenClauseItem*)node), comparison_expr);
ADD_NODE(obj->dict, ((gsp_whenClauseItem*)node), stmts);
ADD_NODE(obj->dict, ((gsp_whenClauseItem*)node), return_expr);
ADD_NODE(obj->dict, ((gsp_whenClauseItem*)node), countFractionDescriptionList);
return (PyObject*)obj;
}
PyObject *Node_parse_caseExpression(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_caseExpression*)node), input_expr);
ADD_NODE(obj->dict, ((gsp_caseExpression*)node), else_expr);
ADD_NODE(obj->dict, ((gsp_caseExpression*)node), whenClauseItemList);
ADD_NODE(obj->dict, ((gsp_caseExpression*)node), else_statement_node_list);
return (PyObject*)obj;
}
PyObject *Node_parse_intervalExpression(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; return (PyObject*)obj;
}
PyObject *Node_parse_precisionScale(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_precisionScale*)node), precision);
ADD_NODE(obj->dict, ((gsp_precisionScale*)node), scale);
return (PyObject*)obj;
}
PyObject *Node_parse_typename(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_INT(obj->dict, ((gsp_typename*)node), dataType);
ADD_NODE(obj->dict, ((gsp_typename*)node), precisionScale);
ADD_NODE(obj->dict, ((gsp_typename*)node), secondsPrecision);
ADD_NODE(obj->dict, ((gsp_typename*)node), length);
ADD_NODE(obj->dict, ((gsp_typename*)node), genericName);
ADD_NODE(obj->dict, ((gsp_typename*)node), indices);
ADD_NODE(obj->dict, ((gsp_typename*)node), datatypeAttributeList);
return (PyObject*)obj;
}
PyObject *Node_parse_keyReference(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_INT(obj->dict, ((gsp_keyReference*)node), referenceType);
return (PyObject*)obj;
}
PyObject *Node_parse_keyAction(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_INT(obj->dict, ((gsp_keyAction*)node), actionType);
ADD_NODE(obj->dict, ((gsp_keyAction*)node), keyReference);
return (PyObject*)obj;
}
PyObject *Node_parse_constraint(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_INT(obj->dict, ((gsp_constraint*)node), constraintType);
ADD_NODE(obj->dict, ((gsp_constraint*)node), constraintName);
ADD_NODE(obj->dict, ((gsp_constraint*)node), checkCondition);
ADD_NODE(obj->dict, ((gsp_constraint*)node), columnList);
ADD_NODE(obj->dict, ((gsp_constraint*)node), automaticProperties);
ADD_NODE(obj->dict, ((gsp_constraint*)node), referencedObject);
ADD_NODE(obj->dict, ((gsp_constraint*)node), referencedColumnList);
ADD_NODE(obj->dict, ((gsp_constraint*)node), keyActions);
ADD_NODE(obj->dict, ((gsp_constraint*)node), defaultValue);
ADD_NODE(obj->dict, ((gsp_constraint*)node), seedExpr);
ADD_NODE(obj->dict, ((gsp_constraint*)node), incrementExpr);
return (PyObject*)obj;
}
PyObject *Node_parse_mergeInsertClause(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_mergeInsertClause*)node), columnList);
ADD_NODE(obj->dict, ((gsp_mergeInsertClause*)node), valuelist);
ADD_NODE(obj->dict, ((gsp_mergeInsertClause*)node), deleteWhereClause);
return (PyObject*)obj;
}
PyObject *Node_parse_mergeUpdateClause(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_mergeUpdateClause*)node), updateColumnList);
ADD_NODE(obj->dict, ((gsp_mergeUpdateClause*)node), updateWhereClause);
ADD_NODE(obj->dict, ((gsp_mergeUpdateClause*)node), deleteWhereClause);
return (PyObject*)obj;
}
PyObject *Node_parse_mergeDeleteClause(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; return (PyObject*)obj;
}
PyObject *Node_parse_mergeWhenClause(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_mergeWhenClause*)node), condition);
ADD_NODE(obj->dict, ((gsp_mergeWhenClause*)node), updateClause);
ADD_NODE(obj->dict, ((gsp_mergeWhenClause*)node), insertClause);
ADD_NODE(obj->dict, ((gsp_mergeWhenClause*)node), deleteClause);
ADD_NODE(obj->dict, ((gsp_mergeWhenClause*)node), signalStmt);
return (PyObject*)obj;
}
PyObject *Node_parse_dataChangeTable(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_dataChangeTable*)node), stmtNode);
return (PyObject*)obj;
}
PyObject *Node_parse_fromTable(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_fromTable*)node), aliasClause);
ADD_INT(obj->dict, ((gsp_fromTable*)node), fromtableType);
ADD_NODE(obj->dict, ((gsp_fromTable*)node), subQueryNode);
ADD_NODE(obj->dict, ((gsp_fromTable*)node), tableName);
ADD_NODE(obj->dict, ((gsp_fromTable*)node), pxGranule);
ADD_NODE(obj->dict, ((gsp_fromTable*)node), tableSample);
ADD_NODE(obj->dict, ((gsp_fromTable*)node), flashback);
ADD_NODE(obj->dict, ((gsp_fromTable*)node), joinExpr);
ADD_NODE(obj->dict, ((gsp_fromTable*)node), tableExpr);
ADD_TOKEN(obj->dict, ((gsp_fromTable*)node), tableonly);
ADD_NODE(obj->dict, ((gsp_fromTable*)node), dataChangeTable);
ADD_NODE(obj->dict, ((gsp_fromTable*)node), tableHints);
ADD_NODE(obj->dict, ((gsp_fromTable*)node), functionCall);
ADD_NODE(obj->dict, ((gsp_fromTable*)node), openQuery);
ADD_NODE(obj->dict, ((gsp_fromTable*)node), openDatasource);
ADD_NODE(obj->dict, ((gsp_fromTable*)node), containsTable);
ADD_NODE(obj->dict, ((gsp_fromTable*)node), freeTable);
ADD_NODE(obj->dict, ((gsp_fromTable*)node), openRowSet);
ADD_NODE(obj->dict, ((gsp_fromTable*)node), openXML);
ADD_NODE(obj->dict, ((gsp_fromTable*)node), pivotClause);
ADD_NODE(obj->dict, ((gsp_fromTable*)node), unPivotClause);
ADD_NODE(obj->dict, ((gsp_fromTable*)node), rowList);
ADD_NODE(obj->dict, ((gsp_fromTable*)node), outerClause);
return (PyObject*)obj;
}
PyObject *Node_parse_table(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_INT(obj->dict, ((gsp_table*)node), tableSource);
ADD_NODE(obj->dict, ((gsp_table*)node), aliasClause);
ADD_NODE(obj->dict, ((gsp_table*)node), tableName);
ADD_NODE(obj->dict, ((gsp_table*)node), tableExpr);
return (PyObject*)obj;
}
PyObject *Node_parse_mergeSqlNode(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_mergeSqlNode*)node), cteList);
ADD_NODE(obj->dict, ((gsp_mergeSqlNode*)node), whenClauses);
ADD_NODE(obj->dict, ((gsp_mergeSqlNode*)node), targetTableNode);
ADD_NODE(obj->dict, ((gsp_mergeSqlNode*)node), usingTableNode);
ADD_NODE(obj->dict, ((gsp_mergeSqlNode*)node), condition);
ADD_NODE(obj->dict, ((gsp_mergeSqlNode*)node), outputClause);
ADD_NODE(obj->dict, ((gsp_mergeSqlNode*)node), columnList);
ADD_NODE(obj->dict, ((gsp_mergeSqlNode*)node), targetTable);
ADD_NODE(obj->dict, ((gsp_mergeSqlNode*)node), usingTable);
return (PyObject*)obj;
}
PyObject *Node_parse_alterTableOption(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_INT(obj->dict, ((gsp_alterTableOption*)node), optionType);
ADD_NODE(obj->dict, ((gsp_alterTableOption*)node), constraintName);
ADD_NODE(obj->dict, ((gsp_alterTableOption*)node), newConstraintName);
ADD_NODE(obj->dict, ((gsp_alterTableOption*)node), columnName);
ADD_NODE(obj->dict, ((gsp_alterTableOption*)node), newColumnName);
ADD_NODE(obj->dict, ((gsp_alterTableOption*)node), referencedObjectName);
ADD_NODE(obj->dict, ((gsp_alterTableOption*)node), newTableName);
ADD_NODE(obj->dict, ((gsp_alterTableOption*)node), indexName);
ADD_NODE(obj->dict, ((gsp_alterTableOption*)node), columnDefinitionList);
ADD_NODE(obj->dict, ((gsp_alterTableOption*)node), constraintList);
ADD_NODE(obj->dict, ((gsp_alterTableOption*)node), columnNameList);
ADD_NODE(obj->dict, ((gsp_alterTableOption*)node), referencedColumnList);
ADD_NODE(obj->dict, ((gsp_alterTableOption*)node), datatype);
return (PyObject*)obj;
}
PyObject *Node_parse_alterTableSqlNode(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_alterTableSqlNode*)node), tableName);
ADD_NODE(obj->dict, ((gsp_alterTableSqlNode*)node), tableElementList);
ADD_NODE(obj->dict, ((gsp_alterTableSqlNode*)node), alterTableOptionList);
return (PyObject*)obj;
}
PyObject *Node_parse_createSequenceSqlNode(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_createSequenceSqlNode*)node), sequenceName);
ADD_NODE(obj->dict, ((gsp_createSequenceSqlNode*)node), options);
return (PyObject*)obj;
}
PyObject *Node_parse_createSynonymSqlNode(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_createSynonymSqlNode*)node), synonymName);
ADD_NODE(obj->dict, ((gsp_createSynonymSqlNode*)node), forName);
ADD_INT(obj->dict, ((gsp_createSynonymSqlNode*)node), isPublic);
ADD_INT(obj->dict, ((gsp_createSynonymSqlNode*)node), isReplace);
return (PyObject*)obj;
}
PyObject *Node_parse_createDirectorySqlNode(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_createDirectorySqlNode*)node), directoryName);
ADD_NODE(obj->dict, ((gsp_createDirectorySqlNode*)node), path);
return (PyObject*)obj;
}
PyObject *Node_parse_dropViewSqlNode(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_dropViewSqlNode*)node), viewNameList);
return (PyObject*)obj;
}
PyObject *Node_parse_dropTableSqlNode(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_dropTableSqlNode*)node), tableNameList);
return (PyObject*)obj;
}
PyObject *Node_parse_dropIndexItem(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_dropIndexItem*)node), indexName);
ADD_NODE(obj->dict, ((gsp_dropIndexItem*)node), tableName);
return (PyObject*)obj;
}
PyObject *Node_parse_dropIndexSqlNode(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_dropIndexSqlNode*)node), indexName);
ADD_NODE(obj->dict, ((gsp_dropIndexSqlNode*)node), itemList);
return (PyObject*)obj;
}
PyObject *Node_parse_truncateTableSqlNode(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_truncateTableSqlNode*)node), tableName);
return (PyObject*)obj;
}
PyObject *Node_parse_viewAliasItem(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_viewAliasItem*)node), alias);
ADD_NODE(obj->dict, ((gsp_viewAliasItem*)node), columnConstraintList);
ADD_NODE(obj->dict, ((gsp_viewAliasItem*)node), tableConstraint);
return (PyObject*)obj;
}
PyObject *Node_parse_viewAliasClause(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_viewAliasClause*)node), viewAliasItemList);
return (PyObject*)obj;
}
PyObject *Node_parse_createViewSqlNode(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_createViewSqlNode*)node), viewName);
ADD_NODE(obj->dict, ((gsp_createViewSqlNode*)node), selectSqlNode);
ADD_NODE(obj->dict, ((gsp_createViewSqlNode*)node), viewAliasClause);
ADD_INT(obj->dict, ((gsp_createViewSqlNode*)node), isForce);
ADD_INT(obj->dict, ((gsp_createViewSqlNode*)node), isReplace);
ADD_NODE(obj->dict, ((gsp_createViewSqlNode*)node), rowTypeName);
return (PyObject*)obj;
}
PyObject *Node_parse_createMaterializedViewSqlNode(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_createMaterializedViewSqlNode*)node), viewName);
ADD_NODE(obj->dict, ((gsp_createMaterializedViewSqlNode*)node), selectSqlNode);
ADD_NODE(obj->dict, ((gsp_createMaterializedViewSqlNode*)node), viewAliasClause);
return (PyObject*)obj;
}
PyObject *Node_parse_createMaterializedViewLogSqlNode(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_createMaterializedViewLogSqlNode*)node), mvName);
return (PyObject*)obj;
}
PyObject *Node_parse_createIndexSqlNode(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_INT(obj->dict, ((gsp_createIndexSqlNode*)node), indexType);
ADD_NODE(obj->dict, ((gsp_createIndexSqlNode*)node), indexName);
ADD_NODE(obj->dict, ((gsp_createIndexSqlNode*)node), tableName);
ADD_NODE(obj->dict, ((gsp_createIndexSqlNode*)node), indexItemList);
return (PyObject*)obj;
}
PyObject *Node_parse_commitSqlNode(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_commitSqlNode*)node), transName);
return (PyObject*)obj;
}
PyObject *Node_parse_rollbackSqlNode(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_rollbackSqlNode*)node), transName);
return (PyObject*)obj;
}
PyObject *Node_parse_saveTransSqlNode(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_saveTransSqlNode*)node), transName);
return (PyObject*)obj;
}
PyObject *Node_parse_columnDefinition(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_columnDefinition*)node), columnName);
ADD_NODE(obj->dict, ((gsp_columnDefinition*)node), datatype);
ADD_NODE(obj->dict, ((gsp_columnDefinition*)node), constraints);
ADD_NODE(obj->dict, ((gsp_columnDefinition*)node), defaultExpression);
ADD_NODE(obj->dict, ((gsp_columnDefinition*)node), computedColumnExpression);
ADD_INT(obj->dict, ((gsp_columnDefinition*)node), isNull);
ADD_INT(obj->dict, ((gsp_columnDefinition*)node), isRowGuidCol);
return (PyObject*)obj;
}
PyObject *Node_parse_tableElement(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_tableElement*)node), columnDefinition);
ADD_NODE(obj->dict, ((gsp_tableElement*)node), constraint);
return (PyObject*)obj;
}
PyObject *Node_parse_createTableSqlNode(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_createTableSqlNode*)node), table);
ADD_NODE(obj->dict, ((gsp_createTableSqlNode*)node), oftable);
ADD_NODE(obj->dict, ((gsp_createTableSqlNode*)node), tableElementList);
ADD_NODE(obj->dict, ((gsp_createTableSqlNode*)node), columnList);
ADD_NODE(obj->dict, ((gsp_createTableSqlNode*)node), columnName);
ADD_NODE(obj->dict, ((gsp_createTableSqlNode*)node), subQueryNode);
ADD_NODE(obj->dict, ((gsp_createTableSqlNode*)node), superTableName);
ADD_NODE(obj->dict, ((gsp_createTableSqlNode*)node), ofTypeName);
ADD_NODE(obj->dict, ((gsp_createTableSqlNode*)node), likeTableName);
return (PyObject*)obj;
}
PyObject *Node_parse_returningClause(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_returningClause*)node), columnValueList);
ADD_NODE(obj->dict, ((gsp_returningClause*)node), variableList);
return (PyObject*)obj;
}
PyObject *Node_parse_isolationClause(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; return (PyObject*)obj;
}
PyObject *Node_parse_includeColumns(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_includeColumns*)node), columnList);
return (PyObject*)obj;
}
PyObject *Node_parse_deleteSqlNode(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_TOKEN(obj->dict, ((gsp_deleteSqlNode*)node), deleteToken);
ADD_NODE(obj->dict, ((gsp_deleteSqlNode*)node), cteList);
ADD_NODE(obj->dict, ((gsp_deleteSqlNode*)node), whereCondition);
ADD_NODE(obj->dict, ((gsp_deleteSqlNode*)node), returningClause);
ADD_NODE(obj->dict, ((gsp_deleteSqlNode*)node), isolationClause);
ADD_NODE(obj->dict, ((gsp_deleteSqlNode*)node), includeColumns);
ADD_NODE(obj->dict, ((gsp_deleteSqlNode*)node), targetTableNode);
ADD_NODE(obj->dict, ((gsp_deleteSqlNode*)node), topClause);
ADD_NODE(obj->dict, ((gsp_deleteSqlNode*)node), outputClause);
ADD_NODE(obj->dict, ((gsp_deleteSqlNode*)node), sourceTableList);
ADD_NODE(obj->dict, ((gsp_deleteSqlNode*)node), targetTableList);
ADD_NODE(obj->dict, ((gsp_deleteSqlNode*)node), limitClause);
ADD_NODE(obj->dict, ((gsp_deleteSqlNode*)node), sortClause);
return (PyObject*)obj;
}
PyObject *Node_parse_updateSqlNode(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_TOKEN(obj->dict, ((gsp_updateSqlNode*)node), updateToken);
ADD_NODE(obj->dict, ((gsp_updateSqlNode*)node), cteList);
ADD_NODE(obj->dict, ((gsp_updateSqlNode*)node), resultColumnList);
ADD_NODE(obj->dict, ((gsp_updateSqlNode*)node), whereCondition);
ADD_NODE(obj->dict, ((gsp_updateSqlNode*)node), returningClause);
ADD_NODE(obj->dict, ((gsp_updateSqlNode*)node), isolationClause);
ADD_NODE(obj->dict, ((gsp_updateSqlNode*)node), includeColumns);
ADD_NODE(obj->dict, ((gsp_updateSqlNode*)node), targetTableNode);
ADD_NODE(obj->dict, ((gsp_updateSqlNode*)node), topClause);
ADD_NODE(obj->dict, ((gsp_updateSqlNode*)node), outputClause);
ADD_NODE(obj->dict, ((gsp_updateSqlNode*)node), sourceTableList);
ADD_NODE(obj->dict, ((gsp_updateSqlNode*)node), targetTableList);
ADD_NODE(obj->dict, ((gsp_updateSqlNode*)node), limitClause);
ADD_NODE(obj->dict, ((gsp_updateSqlNode*)node), sortClause);
return (PyObject*)obj;
}
PyObject *Node_parse_multiTarget(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_multiTarget*)node), subQueryNode);
ADD_NODE(obj->dict, ((gsp_multiTarget*)node), resultColumnList);
return (PyObject*)obj;
}
PyObject *Node_parse_insertRest(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_INT(obj->dict, ((gsp_insertRest*)node), valueType);
ADD_NODE(obj->dict, ((gsp_insertRest*)node), multiTargetList);
ADD_NODE(obj->dict, ((gsp_insertRest*)node), subQueryNode);
ADD_NODE(obj->dict, ((gsp_insertRest*)node), functionCall);
ADD_NODE(obj->dict, ((gsp_insertRest*)node), recordName);
ADD_NODE(obj->dict, ((gsp_insertRest*)node), updateTargetList);
return (PyObject*)obj;
}
PyObject *Node_parse_insertValuesClause(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_insertValuesClause*)node), multiTargetList);
return (PyObject*)obj;
}
PyObject *Node_parse_insertIntoValue(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_insertIntoValue*)node), fromTable);
ADD_NODE(obj->dict, ((gsp_insertIntoValue*)node), columnList);
ADD_NODE(obj->dict, ((gsp_insertIntoValue*)node), valuesClause);
ADD_NODE(obj->dict, ((gsp_insertIntoValue*)node), table);
return (PyObject*)obj;
}
PyObject *Node_parse_insertCondition(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_insertCondition*)node), condition);
ADD_NODE(obj->dict, ((gsp_insertCondition*)node), insertIntoValues);
return (PyObject*)obj;
}
PyObject *Node_parse_insertSqlNode(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_TOKEN(obj->dict, ((gsp_insertSqlNode*)node), insertToken);
ADD_INT(obj->dict, ((gsp_insertSqlNode*)node), valueType);
ADD_NODE(obj->dict, ((gsp_insertSqlNode*)node), cteList);
ADD_NODE(obj->dict, ((gsp_insertSqlNode*)node), columnList);
ADD_NODE(obj->dict, ((gsp_insertSqlNode*)node), insertIntoValues);
ADD_NODE(obj->dict, ((gsp_insertSqlNode*)node), insertConditions);
ADD_NODE(obj->dict, ((gsp_insertSqlNode*)node), returningClause);
ADD_NODE(obj->dict, ((gsp_insertSqlNode*)node), isolationClause);
ADD_NODE(obj->dict, ((gsp_insertSqlNode*)node), includeColumns);
ADD_NODE(obj->dict, ((gsp_insertSqlNode*)node), targetTableNode);
ADD_NODE(obj->dict, ((gsp_insertSqlNode*)node), insertRest);
ADD_NODE(obj->dict, ((gsp_insertSqlNode*)node), subQueryNode);
ADD_NODE(obj->dict, ((gsp_insertSqlNode*)node), topClause);
ADD_NODE(obj->dict, ((gsp_insertSqlNode*)node), outputClause);
ADD_NODE(obj->dict, ((gsp_insertSqlNode*)node), onDuplicateUpdateList);
ADD_NODE(obj->dict, ((gsp_insertSqlNode*)node), multiTargetList);
ADD_NODE(obj->dict, ((gsp_insertSqlNode*)node), recordName);
ADD_NODE(obj->dict, ((gsp_insertSqlNode*)node), functionCall);
return (PyObject*)obj;
}
PyObject *Node_parse_whereClause(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_whereClause*)node), condition);
return (PyObject*)obj;
}
PyObject *Node_parse_joinExpr(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_INT(obj->dict, ((gsp_joinExpr*)node), jointype);
ADD_INT(obj->dict, ((gsp_joinExpr*)node), original_jontype);
ADD_NODE(obj->dict, ((gsp_joinExpr*)node), aliasClause);
ADD_NODE(obj->dict, ((gsp_joinExpr*)node), leftOperand);
ADD_NODE(obj->dict, ((gsp_joinExpr*)node), rightOperand);
ADD_NODE(obj->dict, ((gsp_joinExpr*)node), onCondition);
ADD_NODE(obj->dict, ((gsp_joinExpr*)node), usingColumns);
return (PyObject*)obj;
}
PyObject *Node_parse_tableSamplePart(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; return (PyObject*)obj;
}
PyObject *Node_parse_tableSample(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; return (PyObject*)obj;
}
PyObject *Node_parse_pxGranule(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; return (PyObject*)obj;
}
PyObject *Node_parse_flashback(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; return (PyObject*)obj;
}
PyObject *Node_parse_forUpdate(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_forUpdate*)node), columnRefs);
return (PyObject*)obj;
}
PyObject *Node_parse_groupingSetItem(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_groupingSetItem*)node), rollupCubeClause);
ADD_NODE(obj->dict, ((gsp_groupingSetItem*)node), expressionItem);
return (PyObject*)obj;
}
PyObject *Node_parse_groupingSet(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_groupingSet*)node), items);
return (PyObject*)obj;
}
PyObject *Node_parse_rollupCube(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_rollupCube*)node), items);
return (PyObject*)obj;
}
PyObject *Node_parse_gruopByItem(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_gruopByItem*)node), expr);
ADD_NODE(obj->dict, ((gsp_gruopByItem*)node), rollupCube);
ADD_NODE(obj->dict, ((gsp_gruopByItem*)node), groupingSet);
ADD_NODE(obj->dict, ((gsp_gruopByItem*)node), aliasClause);
return (PyObject*)obj;
}
PyObject *Node_parse_groupBy(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_TOKEN(obj->dict, ((gsp_groupBy*)node), stGroup);
ADD_TOKEN(obj->dict, ((gsp_groupBy*)node), stBy);
ADD_TOKEN(obj->dict, ((gsp_groupBy*)node), stHaving);
ADD_NODE(obj->dict, ((gsp_groupBy*)node), havingClause);
ADD_NODE(obj->dict, ((gsp_groupBy*)node), items);
return (PyObject*)obj;
}
PyObject *Node_parse_selectDistinct(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_selectDistinct*)node), exprList);
return (PyObject*)obj;
}
PyObject *Node_parse_topClause(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_INT(obj->dict, ((gsp_topClause*)node), bPercent);
ADD_INT(obj->dict, ((gsp_topClause*)node), bWithTies);
ADD_NODE(obj->dict, ((gsp_topClause*)node), expr);
return (PyObject*)obj;
}
PyObject *Node_parse_hierarchical(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_hierarchical*)node), connectByClause);
ADD_NODE(obj->dict, ((gsp_hierarchical*)node), startWithClause);
return (PyObject*)obj;
}
PyObject *Node_parse_intoClause(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_intoClause*)node), exprList);
return (PyObject*)obj;
}
PyObject *Node_parse_valueClause(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_valueClause*)node), valueList);
ADD_NODE(obj->dict, ((gsp_valueClause*)node), nameList);
return (PyObject*)obj;
}
PyObject *Node_parse_fetchFirstClause(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; return (PyObject*)obj;
}
PyObject *Node_parse_optimizeForClause(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; return (PyObject*)obj;
}
PyObject *Node_parse_valueRowItem(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_valueRowItem*)node), expr);
ADD_NODE(obj->dict, ((gsp_valueRowItem*)node), exprList);
return (PyObject*)obj;
}
PyObject *Node_parse_selectSqlNode(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_INT(obj->dict, ((gsp_selectSqlNode*)node), setOperator);
ADD_NODE(obj->dict, ((gsp_selectSqlNode*)node), cteList);
ADD_NODE(obj->dict, ((gsp_selectSqlNode*)node), valueClause);
ADD_TOKEN(obj->dict, ((gsp_selectSqlNode*)node), selectToken);
ADD_NODE(obj->dict, ((gsp_selectSqlNode*)node), selectDistinct);
ADD_NODE(obj->dict, ((gsp_selectSqlNode*)node), resultColumnList);
ADD_NODE(obj->dict, ((gsp_selectSqlNode*)node), intoClause);
ADD_NODE(obj->dict, ((gsp_selectSqlNode*)node), whereCondition);
ADD_NODE(obj->dict, ((gsp_selectSqlNode*)node), hierarchicalClause);
ADD_NODE(obj->dict, ((gsp_selectSqlNode*)node), groupByClause);
ADD_NODE(obj->dict, ((gsp_selectSqlNode*)node), orderbyClause);
ADD_NODE(obj->dict, ((gsp_selectSqlNode*)node), forupdateClause);
ADD_NODE(obj->dict, ((gsp_selectSqlNode*)node), fetchFirstClause);
ADD_NODE(obj->dict, ((gsp_selectSqlNode*)node), optimizeForClause);
ADD_NODE(obj->dict, ((gsp_selectSqlNode*)node), isolationClause);
ADD_NODE(obj->dict, ((gsp_selectSqlNode*)node), computeClause);
ADD_NODE(obj->dict, ((gsp_selectSqlNode*)node), topClause);
ADD_NODE(obj->dict, ((gsp_selectSqlNode*)node), intoTableClause);
ADD_NODE(obj->dict, ((gsp_selectSqlNode*)node), limitClause);
ADD_NODE(obj->dict, ((gsp_selectSqlNode*)node), lockingClause);
ADD_NODE(obj->dict, ((gsp_selectSqlNode*)node), windowClause);
ADD_NODE(obj->dict, ((gsp_selectSqlNode*)node), withClauses);
ADD_NODE(obj->dict, ((gsp_selectSqlNode*)node), qualifyClause);
ADD_NODE(obj->dict, ((gsp_selectSqlNode*)node), sampleClause);
ADD_NODE(obj->dict, ((gsp_selectSqlNode*)node), expandOnClause);
ADD_NODE(obj->dict, ((gsp_selectSqlNode*)node), leftNode);
ADD_NODE(obj->dict, ((gsp_selectSqlNode*)node), rightNode);
ADD_NODE(obj->dict, ((gsp_selectSqlNode*)node), fromTableList);
return (PyObject*)obj;
}
PyObject *Node_parse_cte(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_cte*)node), tableName);
ADD_NODE(obj->dict, ((gsp_cte*)node), selectSqlNode);
ADD_NODE(obj->dict, ((gsp_cte*)node), insertSqlNode);
ADD_NODE(obj->dict, ((gsp_cte*)node), updateSqlNode);
ADD_NODE(obj->dict, ((gsp_cte*)node), deleteSqlNode);
ADD_NODE(obj->dict, ((gsp_cte*)node), columnList);
return (PyObject*)obj;
}
PyObject *Node_parse_commentSqlNode(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_INT(obj->dict, ((gsp_commentSqlNode*)node), dbObjType);
ADD_NODE(obj->dict, ((gsp_commentSqlNode*)node), objectName);
ADD_NODE(obj->dict, ((gsp_commentSqlNode*)node), message);
return (PyObject*)obj;
}
PyObject *Node_parse_callSpec(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_callSpec*)node), declaration);
return (PyObject*)obj;
}
PyObject *Node_parse_returnSqlNode(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_returnSqlNode*)node), expr);
ADD_NODE(obj->dict, ((gsp_returnSqlNode*)node), subQueryNode);
return (PyObject*)obj;
}
PyObject *Node_parse_continueSqlNode(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; return (PyObject*)obj;
}
PyObject *Node_parse_breakSqlNode(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; return (PyObject*)obj;
}
PyObject *Node_parse_grantSqlNode(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_grantSqlNode*)node), nameList);
return (PyObject*)obj;
}
PyObject *Node_parse_executeSqlNode(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_executeSqlNode*)node), moduleName);
ADD_NODE(obj->dict, ((gsp_executeSqlNode*)node), paramList);
return (PyObject*)obj;
}
PyObject *Node_parse_dropRoleSqlNode(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_dropRoleSqlNode*)node), roleNameList);
return (PyObject*)obj;
}
PyObject *Node_parse_dropTriggerSqlNode(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_dropTriggerSqlNode*)node), triggerName);
ADD_NODE(obj->dict, ((gsp_dropTriggerSqlNode*)node), tableName);
return (PyObject*)obj;
}
PyObject *Node_parse_lockTableSqlNode(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; return (PyObject*)obj;
}
PyObject *Node_parse_revokeSqlNode(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; return (PyObject*)obj;
}
PyObject *Node_parse_fetchSqlNode(gsp_node *node, Statement *stmt) {
SqlNode *obj = (SqlNode*)Node_new(&NodeType, Py_None, Py_None); obj->_node = node; ADD_NODE(obj->dict, ((gsp_fetchSqlNode*)node), cursorName);