@@ -1886,33 +1886,38 @@ MergeOperation MergeWhenNotMatched() : {
1886
1886
{ return mi; }
1887
1887
}
1888
1888
1889
- List<String> RelObjectNameList () : {
1889
+ ObjectNames RelObjectNames () : {
1890
1890
String token = null;
1891
+ Token delimiter = null;
1891
1892
List<String> data = new ArrayList<String>();
1893
+ List<String> delimiters = new ArrayList<String>();
1892
1894
} {
1893
1895
token = RelObjectNameExt() { data.add(token); }
1894
- ( LOOKAHEAD (2) ("." | ":") ("." { data.add(null); })* token = RelObjectNameExt2() { data.add(token); } ) *
1896
+ (
1897
+ LOOKAHEAD (2) ( delimiter = "." | delimiter = ":" ) { delimiters.add(delimiter.image); } ( delimiter = "." { data.add(null); delimiters.add(delimiter.image); })*
1898
+ token = RelObjectNameExt2() { data.add(token); }
1899
+ ) *
1895
1900
1896
- { return data; }
1901
+ { return new ObjectNames( data, delimiters) ; }
1897
1902
}
1898
1903
1899
1904
// See: http://technet.microsoft.com/en-us/library/ms187879%28v=sql.105%29.aspx
1900
1905
1901
1906
Column Column() #Column :
1902
1907
{
1903
- List<String> data = new ArrayList<String>() ;
1908
+ ObjectNames data = null ;
1904
1909
ArrayConstructor arrayConstructor = null;
1905
1910
Token tk = null;
1906
1911
}
1907
1912
{
1908
- data = RelObjectNameList ()
1913
+ data = RelObjectNames ()
1909
1914
[ LOOKAHEAD(2) <K_COMMENT> tk=<S_CHAR_LITERAL> ]
1910
1915
// @todo: we better should return a SEQUENCE instead of a COLUMN
1911
- [ "." <K_NEXTVAL> { data.add("nextval"); } ]
1916
+ [ "." <K_NEXTVAL> { data.getNames(). add("nextval"); } ]
1912
1917
1913
1918
[ LOOKAHEAD(2) arrayConstructor = ArrayConstructor(false) ]
1914
1919
{
1915
- Column col = new Column(data);
1920
+ Column col = new Column(data.getNames(), data.getDelimiters() );
1916
1921
if (tk != null) { col.withCommentText(tk.image); }
1917
1922
if (arrayConstructor!=null) {
1918
1923
col.setArrayConstructor(arrayConstructor);
@@ -2004,13 +2009,13 @@ String RelObjectNameExt2():
2004
2009
Table Table() #TableName :
2005
2010
{
2006
2011
//String serverName = null, databaseName = null, schemaName = null, tableName = null;
2007
- List<String> data = new ArrayList<String>() ;
2012
+ ObjectNames data = null ;
2008
2013
}
2009
2014
{
2010
- data = RelObjectNameList ()
2015
+ data = RelObjectNames ()
2011
2016
2012
2017
{
2013
- Table table = new Table(data);
2018
+ Table table = new Table(data.getNames() );
2014
2019
linkAST(table,jjtThis);
2015
2020
return table;
2016
2021
}
@@ -4545,13 +4550,13 @@ ConnectByRootOperator ConnectByRootOperator() #ConnectByRootOperator: {
4545
4550
}
4546
4551
4547
4552
NextValExpression NextValExpression() : {
4548
- List<String> data = new ArrayList<String>() ;
4553
+ ObjectNames data = null ;
4549
4554
Token token;
4550
4555
}
4551
4556
{
4552
- token=<K_NEXTVAL> data = RelObjectNameList ()
4557
+ token=<K_NEXTVAL> data = RelObjectNames ()
4553
4558
{
4554
- return new NextValExpression(data, token.image);
4559
+ return new NextValExpression(data.getNames() , token.image);
4555
4560
}
4556
4561
}
4557
4562
@@ -5350,7 +5355,7 @@ EqualsTo VariableExpression(): {
5350
5355
5351
5356
Execute Execute(): {
5352
5357
Token token;
5353
- List<String> funcName;
5358
+ ObjectNames funcName;
5354
5359
ExpressionList expressionList = null;
5355
5360
Execute execute = new Execute();
5356
5361
List<Expression> namedExprList;
@@ -5361,7 +5366,7 @@ Execute Execute(): {
5361
5366
| <K_EXECUTE> { execute.setExecType(Execute.ExecType.EXECUTE); }
5362
5367
| <K_CALL> { execute.setExecType(Execute.ExecType.CALL); } )
5363
5368
5364
- funcName=RelObjectNameList () { execute.setName(funcName); }
5369
+ funcName=RelObjectNames () { execute.setName(funcName.getNames() ); }
5365
5370
5366
5371
(
5367
5372
LOOKAHEAD(2) expressionList=ExpressionList() { execute.setExprList(expressionList); }
@@ -5483,13 +5488,13 @@ Function SpecialStringFunctionWithNamedParameters() :
5483
5488
Function SimpleFunction():
5484
5489
{
5485
5490
Function function = new Function();
5486
- List<String> name;
5491
+ ObjectNames name;
5487
5492
Expression expr=null;
5488
5493
Expression attributeExpression = null;
5489
5494
Column attributeColumn = null;
5490
5495
}
5491
5496
{
5492
- name = RelObjectNameList ()
5497
+ name = RelObjectNames ()
5493
5498
"("
5494
5499
[
5495
5500
(
@@ -5508,7 +5513,7 @@ Function SimpleFunction():
5508
5513
]
5509
5514
")"
5510
5515
{
5511
- function.setName(name);
5516
+ function.setName(name.getNames() );
5512
5517
if (expr!=null) {
5513
5518
function.setParameters(expr);
5514
5519
}
@@ -5533,7 +5538,7 @@ Function InternalFunction(boolean escaped):
5533
5538
{
5534
5539
Token prefixToken = null;
5535
5540
Function retval = new Function();
5536
- List<String> funcName;
5541
+ ObjectNames funcName;
5537
5542
ExpressionList expressionList = null;
5538
5543
KeepExpression keep = null;
5539
5544
Expression expr = null;
@@ -5544,7 +5549,7 @@ Function InternalFunction(boolean escaped):
5544
5549
}
5545
5550
{
5546
5551
[ LOOKAHEAD(2) prefixToken = <K_APPROXIMATE> ]
5547
- funcName = RelObjectNameList () { if (prefixToken!=null) funcName.add(0, prefixToken.image ); }
5552
+ funcName = RelObjectNames () { if (prefixToken!=null) funcName.getNames() .add(0, prefixToken.image ); }
5548
5553
5549
5554
"("
5550
5555
[
@@ -5601,7 +5606,7 @@ Function InternalFunction(boolean escaped):
5601
5606
{
5602
5607
retval.setEscaped(escaped);
5603
5608
retval.setParameters(expressionList);
5604
- retval.setName(funcName);
5609
+ retval.setName(funcName.getNames() );
5605
5610
retval.setKeep(keep);
5606
5611
return retval;
5607
5612
}
@@ -5698,10 +5703,10 @@ List<Index.ColumnParams> ColumnNamesWithParamsList() : {
5698
5703
}
5699
5704
5700
5705
Index Index(): {
5701
- List<String> name;
5706
+ ObjectNames name;
5702
5707
}
5703
5708
{
5704
- name= RelObjectNameList () { return new Index().withName(name).withType(""); }
5709
+ name= RelObjectNames () { return new Index().withName(name.getNames() ).withType(""); }
5705
5710
}
5706
5711
5707
5712
CreateIndex CreateIndex():
@@ -7311,7 +7316,7 @@ Grant Grant():
7311
7316
ArrayList<String> privileges = new ArrayList<String>();
7312
7317
List<String> users;
7313
7318
Token tk = null;
7314
- List<String> objName;
7319
+ ObjectNames objName;
7315
7320
}
7316
7321
{
7317
7322
<K_GRANT>
@@ -7320,7 +7325,7 @@ Grant Grant():
7320
7325
[readGrantTypes(privileges) (<K_COMMA> readGrantTypes(privileges))*]
7321
7326
<K_ON>
7322
7327
(
7323
- objName=RelObjectNameList () { grant.setObjectName(objName); }
7328
+ objName=RelObjectNames () { grant.setObjectName(objName.getNames() ); }
7324
7329
)
7325
7330
)
7326
7331
|
@@ -7365,13 +7370,13 @@ void readGrantTypes(ArrayList<String> privileges):
7365
7370
7366
7371
Sequence Sequence() #Sequence :
7367
7372
{
7368
- List<String> data = new ArrayList<String>() ;
7373
+ ObjectNames data = null ;
7369
7374
String serverName = null, databaseName = null, schemaName = null, sequenceName = null;
7370
7375
}
7371
7376
{
7372
- data = RelObjectNameList ()
7377
+ data = RelObjectNames ()
7373
7378
{
7374
- Sequence sequence = new Sequence(data);
7379
+ Sequence sequence = new Sequence(data.getNames() );
7375
7380
linkAST(sequence,jjtThis);
7376
7381
return sequence;
7377
7382
}
@@ -7575,29 +7580,29 @@ CreateSynonym CreateSynonym(boolean isUsingOrReplace):
7575
7580
CreateSynonym createSynonym = new CreateSynonym();
7576
7581
Synonym synonym;
7577
7582
boolean publicSynonym = false;
7578
- List<String> data = new ArrayList<String>() ;
7583
+ ObjectNames data = null ;
7579
7584
}
7580
7585
{
7581
7586
[<K_PUBLIC> { publicSynonym = true; } ]
7582
7587
<K_SYNONYM> synonym=Synonym() { createSynonym.setSynonym(synonym); }
7583
- <K_FOR> data = RelObjectNameList ()
7588
+ <K_FOR> data = RelObjectNames ()
7584
7589
{
7585
7590
createSynonym.setOrReplace(isUsingOrReplace);
7586
7591
createSynonym.setPublicSynonym(publicSynonym);
7587
- createSynonym.setForList(data);
7592
+ createSynonym.setForList(data.getNames() );
7588
7593
return createSynonym;
7589
7594
}
7590
7595
}
7591
7596
7592
7597
Synonym Synonym() #Synonym :
7593
7598
{
7594
- List<String> data = new ArrayList<String>() ;
7599
+ ObjectNames data = null ;
7595
7600
String serverName = null, databaseName = null, schemaName = null, sequenceName = null;
7596
7601
}
7597
7602
{
7598
- data = RelObjectNameList ()
7603
+ data = RelObjectNames ()
7599
7604
{
7600
- Synonym synonym = new Synonym(data);
7605
+ Synonym synonym = new Synonym(data.getNames() );
7601
7606
linkAST(synonym,jjtThis);
7602
7607
return synonym;
7603
7608
}
0 commit comments