@Override
public TupleExpr visit(ASTConstructQuery node, Object data)
throws VisitorException
{
TupleExpr tupleExpr;
if (node.hasQueryBody()) {
// Build tuple expression for query body
tupleExpr = (TupleExpr)node.getQueryBody().jjtAccept(this, null);
}
else {
tupleExpr = new SingletonSet();
}
// Create constructor
ConstructorBuilder cb = new ConstructorBuilder();
ASTConstruct constructNode = node.getConstructClause();
if (!constructNode.isWildcard()) {
TupleExpr constructExpr = (TupleExpr)constructNode.jjtAccept(this, null);
tupleExpr = cb.buildConstructor(tupleExpr, constructExpr, constructNode.isDistinct());
}
else if (node.hasQueryBody()) {
tupleExpr = cb.buildConstructor(tupleExpr, constructNode.isDistinct());
}