Skip to content

Commit c1edf0f

Browse files
feat: AST Node access for FromItem
Signed-off-by: Andreas Reichel <andreas@manticore-projects.com>
1 parent 321c880 commit c1edf0f

3 files changed

Lines changed: 11 additions & 9 deletions

File tree

src/main/java/net/sf/jsqlparser/statement/select/FromItem.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
*/
1010
package net.sf.jsqlparser.statement.select;
1111

12-
import net.sf.jsqlparser.Model;
1312
import net.sf.jsqlparser.expression.Alias;
13+
import net.sf.jsqlparser.parser.ASTNodeAccess;
1414

15-
public interface FromItem extends Model {
15+
public interface FromItem extends ASTNodeAccess {
1616

1717
void accept(FromItemVisitor fromItemVisitor);
1818

src/main/java/net/sf/jsqlparser/statement/select/ParenthesedFromItem.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@
1010
package net.sf.jsqlparser.statement.select;
1111

1212
import net.sf.jsqlparser.expression.Alias;
13+
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
1314

1415
import java.util.ArrayList;
1516
import java.util.Collections;
1617
import java.util.List;
1718
import java.util.Optional;
1819

19-
public class ParenthesedFromItem implements FromItem {
20+
public class ParenthesedFromItem extends ASTNodeAccessImpl implements FromItem {
2021
private FromItem fromItem;
2122
private List<Join> joins;
2223
private Alias alias;

src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2886,7 +2886,7 @@ FromItem ParenthesedFromItem():
28862886
}
28872887
}
28882888

2889-
FromItem FromItem():
2889+
FromItem FromItem() #FromItem:
28902890
{
28912891
FromItem fromItem = null;
28922892
FromItem fromItem2 = null;
@@ -2934,6 +2934,7 @@ FromItem FromItem():
29342934
)
29352935
]
29362936
{
2937+
linkAST(fromItem,jjtThis);
29372938
return fromItem;
29382939
}
29392940
}
@@ -3027,11 +3028,11 @@ Join JoinerExpression() #JoinerExpression:
30273028
)
30283029
)
30293030
]
3030-
{
3031-
linkAST(join,jjtThis);
3032-
join.setFromItem(right);
3033-
return join;
3034-
}
3031+
{
3032+
linkAST(join,jjtThis);
3033+
join.setFromItem(right);
3034+
return join;
3035+
}
30353036

30363037
}
30373038

0 commit comments

Comments
 (0)