use of org.wso2.ballerinalang.compiler.tree.clauses.BLangStreamingInput in project ballerina by ballerina-lang.
the class BLangPackageBuilder method endStreamingInputNode.
public void endStreamingInputNode(String alias, DiagnosticPos pos, Set<Whitespace> ws) {
BLangStreamingInput streamingInput = (BLangStreamingInput) this.streamingInputStack.peek();
streamingInput.pos = pos;
streamingInput.addWS(ws);
if (this.whereClauseStack.size() == 2) {
streamingInput.setAfterStreamingCondition(this.whereClauseStack.pop());
streamingInput.setBeforeStreamingCondition(this.whereClauseStack.pop());
} else if (this.whereClauseStack.size() == 1) {
if (streamingInput.isWindowTraversedAfterWhere()) {
streamingInput.setBeforeStreamingCondition(this.whereClauseStack.pop());
} else {
streamingInput.setAfterStreamingCondition(this.whereClauseStack.pop());
}
}
if (!this.windowClausesStack.empty()) {
streamingInput.setWindowClause(this.windowClausesStack.pop());
}
streamingInput.setStreamReference(this.exprNodeStack.pop());
streamingInput.setAlias(alias);
}
use of org.wso2.ballerinalang.compiler.tree.clauses.BLangStreamingInput in project ballerina by ballerina-lang.
the class BLangPackageBuilder method startStreamingInputNode.
public void startStreamingInputNode(DiagnosticPos pos, Set<Whitespace> ws) {
StreamingInput streamingInput = TreeBuilder.createStreamingInputNode();
((BLangStreamingInput) streamingInput).pos = pos;
streamingInput.addWS(ws);
this.streamingInputStack.push(streamingInput);
}
use of org.wso2.ballerinalang.compiler.tree.clauses.BLangStreamingInput in project ballerina by ballerina-lang.
the class SqlQueryBuilder method visit.
@Override
public void visit(BLangTableQuery tableQuery) {
BLangSelectClause selectClause = (BLangSelectClause) tableQuery.getSelectClauseNode();
BLangStreamingInput streamingInput = (BLangStreamingInput) tableQuery.getStreamingInput();
BLangJoinStreamingInput joinStreamingInput = (BLangJoinStreamingInput) tableQuery.getJoinStreamingInput();
BLangOrderBy orderBy = (BLangOrderBy) tableQuery.getOrderByNode();
StringBuilder sqlTableQuery = new StringBuilder();
/*Add each clause to the sqlQuery and add the params to TableQuery object*/
addSelectClauseAndParams(tableQuery, selectClause, sqlTableQuery);
addFromClauseAndParams(tableQuery, streamingInput, sqlTableQuery);
addJoinClauseAndParams(tableQuery, joinStreamingInput, sqlTableQuery);
addGroupByClause(selectClause, sqlTableQuery);
addHavingClauseAndParams(tableQuery, selectClause, sqlTableQuery);
addOrderByClause(orderBy, sqlTableQuery);
tableQuery.setSqlQuery(sqlTableQuery.toString());
}
use of org.wso2.ballerinalang.compiler.tree.clauses.BLangStreamingInput in project ballerina by ballerina-lang.
the class TypeChecker method visit.
@Override
public void visit(BLangTableQuery tableQuery) {
BLangStreamingInput streamingInput = (BLangStreamingInput) tableQuery.getStreamingInput();
streamingInput.accept(this);
BLangJoinStreamingInput joinStreamingInput = (BLangJoinStreamingInput) tableQuery.getJoinStreamingInput();
if (joinStreamingInput != null) {
joinStreamingInput.accept(this);
}
}
use of org.wso2.ballerinalang.compiler.tree.clauses.BLangStreamingInput in project ballerina by ballerina-lang.
the class SemanticAnalyzer method visit.
public void visit(BLangStreamingQueryStatement streamingQueryStatement) {
StreamingInput streamingInput = streamingQueryStatement.getStreamingInput();
if (streamingInput != null) {
((BLangStreamingInput) streamingInput).accept(this);
JoinStreamingInput joinStreamingInput = streamingQueryStatement.getJoiningInput();
if (joinStreamingInput != null) {
((BLangJoinStreamingInput) joinStreamingInput).accept(this);
}
}
SelectClauseNode selectClauseNode = streamingQueryStatement.getSelectClause();
if (selectClauseNode != null) {
((BLangSelectClause) selectClauseNode).accept(this);
}
OrderByNode orderByNode = streamingQueryStatement.getOrderbyClause();
if (orderByNode != null) {
((BLangOrderBy) orderByNode).accept(this);
}
StreamActionNode streamActionNode = streamingQueryStatement.getStreamingAction();
if (streamActionNode != null) {
((BLangStreamAction) streamActionNode).accept(this);
}
BLangPatternClause patternClause = (BLangPatternClause) streamingQueryStatement.getPatternClause();
if (patternClause != null) {
patternClause.accept(this);
}
}
Aggregations