use of org.ballerinalang.model.tree.statements.StreamingQueryStatementNode in project ballerina by ballerina-lang.
the class BLangPackageBuilder method endStreamingQueryStatementNode.
public void endStreamingQueryStatementNode(DiagnosticPos pos, Set<Whitespace> ws) {
StreamingQueryStatementNode streamingQueryStatementNode = this.streamingQueryStatementStack.peek();
((BLangStreamingQueryStatement) streamingQueryStatementNode).pos = pos;
streamingQueryStatementNode.addWS(ws);
if (!streamingInputStack.empty()) {
streamingQueryStatementNode.setStreamingInput(streamingInputStack.pop());
if (!joinStreamingInputsStack.empty()) {
streamingQueryStatementNode.setJoinStreamingInput(joinStreamingInputsStack.pop());
}
} else if (!patternClauseStack.empty()) {
streamingQueryStatementNode.setPatternClause(patternClauseStack.pop());
}
if (!selectClausesStack.empty()) {
streamingQueryStatementNode.setSelectClause(selectClausesStack.pop());
}
if (!orderByClauseStack.empty()) {
streamingQueryStatementNode.setOrderByClause(orderByClauseStack.pop());
}
if (!outputRateLimitStack.empty()) {
streamingQueryStatementNode.setOutputRateLimitNode(outputRateLimitStack.pop());
}
streamingQueryStatementNode.setStreamingAction(streamActionNodeStack.pop());
}
use of org.ballerinalang.model.tree.statements.StreamingQueryStatementNode in project ballerina by ballerina-lang.
the class SemanticAnalyzer method visit.
// Streaming related methods.
public void visit(BLangForever foreverStatement) {
for (StreamingQueryStatementNode streamingQueryStatement : foreverStatement.gettreamingQueryStatements()) {
analyzeStmt((BLangStatement) streamingQueryStatement, env);
}
List<BLangVariable> globalVariableList = this.env.enclPkg.globalVars;
if (globalVariableList != null) {
for (BLangVariable variable : globalVariableList) {
if (((variable).type.tsymbol) != null) {
if ("stream".equals((((variable).type.tsymbol)).name.value)) {
foreverStatement.addGlobalVariable(variable);
}
}
}
}
List<BVarSymbol> functionParameterList = ((BInvokableSymbol) this.env.scope.owner).getParameters();
for (BVarSymbol varSymbol : functionParameterList) {
if ("stream".equals((((varSymbol).type.tsymbol)).name.value)) {
foreverStatement.addFunctionVariable(varSymbol);
}
}
}
use of org.ballerinalang.model.tree.statements.StreamingQueryStatementNode in project ballerina by ballerina-lang.
the class Desugar method addFunctionPointersToArgs.
private void addFunctionPointersToArgs(List<BLangExpression> args, List<StreamingQueryStatementNode> streamingStmts) {
BLangArrayLiteral funcPointers = createArrayLiteralExprNode();
for (StreamingQueryStatementNode stmt : streamingStmts) {
funcPointers.exprs.add(rewrite((BLangExpression) stmt.getStreamingAction().getInvokableBody(), env));
}
args.add(funcPointers);
}
use of org.ballerinalang.model.tree.statements.StreamingQueryStatementNode in project ballerina by ballerina-lang.
the class BLangPackageBuilder method startStreamingQueryStatementNode.
public void startStreamingQueryStatementNode(DiagnosticPos pos, Set<Whitespace> ws) {
StreamingQueryStatementNode streamingQueryStatementNode = TreeBuilder.createStreamingQueryStatementNode();
((BLangStreamingQueryStatement) streamingQueryStatementNode).pos = pos;
streamingQueryStatementNode.addWS(ws);
this.streamingQueryStatementStack.push(streamingQueryStatementNode);
}
Aggregations