Search in sources :

Example 1 with BLangStreamingInput

use of org.wso2.ballerinalang.compiler.tree.clauses.BLangStreamingInput in project ballerina by ballerina-lang.

the class SemanticAnalyzer method visit.

public void visit(BLangJoinStreamingInput joinStreamingInput) {
    StreamingInput streamingInput = joinStreamingInput.getStreamingInput();
    if (streamingInput != null) {
        ((BLangStreamingInput) streamingInput).accept(this);
    }
    ExpressionNode expressionNode = joinStreamingInput.getOnExpression();
    if (expressionNode != null) {
        ((BLangExpression) expressionNode).accept(this);
    }
}
Also used : JoinStreamingInput(org.ballerinalang.model.tree.clauses.JoinStreamingInput) BLangPatternStreamingInput(org.wso2.ballerinalang.compiler.tree.clauses.BLangPatternStreamingInput) BLangStreamingInput(org.wso2.ballerinalang.compiler.tree.clauses.BLangStreamingInput) BLangJoinStreamingInput(org.wso2.ballerinalang.compiler.tree.clauses.BLangJoinStreamingInput) StreamingInput(org.ballerinalang.model.tree.clauses.StreamingInput) SelectExpressionNode(org.ballerinalang.model.tree.clauses.SelectExpressionNode) ExpressionNode(org.ballerinalang.model.tree.expressions.ExpressionNode) BLangExpression(org.wso2.ballerinalang.compiler.tree.expressions.BLangExpression) BLangStreamingInput(org.wso2.ballerinalang.compiler.tree.clauses.BLangStreamingInput)

Example 2 with BLangStreamingInput

use of org.wso2.ballerinalang.compiler.tree.clauses.BLangStreamingInput in project ballerina by ballerina-lang.

the class TypeChecker method visit.

@Override
public void visit(BLangJoinStreamingInput joinStreamingInput) {
    BLangStreamingInput streamingInput = (BLangStreamingInput) joinStreamingInput.getStreamingInput();
    streamingInput.accept(this);
}
Also used : BLangStreamingInput(org.wso2.ballerinalang.compiler.tree.clauses.BLangStreamingInput)

Example 3 with BLangStreamingInput

use of org.wso2.ballerinalang.compiler.tree.clauses.BLangStreamingInput in project ballerina by ballerina-lang.

the class SiddhiQueryBuilder method visit.

@Override
public void visit(BLangStreamingInput streamingInput) {
    streamingInputClause = new StringBuilder();
    streamingInputClause.append(((BLangSimpleVarRef) streamingInput.getStreamReference()).getVariableName().value);
    WhereNode beforeWhereNode = streamingInput.getBeforeStreamingCondition();
    WhereNode afterWhereNode = streamingInput.getAfterStreamingCondition();
    WindowClauseNode windowClauseNode = streamingInput.getWindowClause();
    if (beforeWhereNode != null) {
        ((BLangWhere) beforeWhereNode).accept(this);
        streamingInputClause.append(" ").append(whereClause);
    }
    if (windowClauseNode != null) {
        ((BLangWindow) windowClauseNode).accept(this);
        streamingInputClause.append(" ").append(windowClause);
    }
    if (afterWhereNode != null) {
        ((BLangWhere) afterWhereNode).accept(this);
        streamingInputClause.append(" ").append(whereClause);
    }
    if (streamingInput.getAlias() != null) {
        streamingInputClause.append(" as ").append(streamingInput.getAlias()).append(" ");
    }
    BLangExpression streamReference = (BLangExpression) streamingInput.getStreamReference();
    if (streamReference != null) {
        streamReference.accept(this);
        streamIds.add(varRef);
        varRef = "";
        addInRefs(streamReference);
    }
}
Also used : BLangSimpleVarRef(org.wso2.ballerinalang.compiler.tree.expressions.BLangSimpleVarRef) BLangWindow(org.wso2.ballerinalang.compiler.tree.clauses.BLangWindow) WhereNode(org.ballerinalang.model.tree.clauses.WhereNode) WindowClauseNode(org.ballerinalang.model.tree.clauses.WindowClauseNode) BLangWhere(org.wso2.ballerinalang.compiler.tree.clauses.BLangWhere) BLangExpression(org.wso2.ballerinalang.compiler.tree.expressions.BLangExpression)

Example 4 with BLangStreamingInput

use of org.wso2.ballerinalang.compiler.tree.clauses.BLangStreamingInput in project ballerina by ballerina-lang.

the class SiddhiQueryBuilder method visit.

@Override
public void visit(BLangJoinStreamingInput joinStreamingInput) {
    BLangBinaryExpr expr = (BLangBinaryExpr) joinStreamingInput.getOnExpression();
    BLangStreamingInput streamingInput = (BLangStreamingInput) joinStreamingInput.getStreamingInput();
    joinStreamingInputClause = new StringBuilder();
    streamingInput.accept(this);
    if (joinStreamingInput.isUnidirectionalBeforeJoin()) {
        joinStreamingInputClause.append(" unidirectional ");
    }
    String joinType = joinStreamingInput.getJoinType();
    joinStreamingInputClause.append(" ").append(joinType).append(" ");
    if (joinStreamingInput.isUnidirectionalAfterJoin()) {
        joinStreamingInputClause.append(" unidirectional ");
    }
    joinStreamingInputClause.append(streamingInputClause).append(" on ");
    binaryExpr = new StringBuilder();
    expr.accept(this);
    joinStreamingInputClause.append(binaryExpr);
}
Also used : BLangBinaryExpr(org.wso2.ballerinalang.compiler.tree.expressions.BLangBinaryExpr) BLangStreamingInput(org.wso2.ballerinalang.compiler.tree.clauses.BLangStreamingInput)

Example 5 with BLangStreamingInput

use of org.wso2.ballerinalang.compiler.tree.clauses.BLangStreamingInput in project ballerina by ballerina-lang.

the class SiddhiQueryBuilder method visit.

@Override
public void visit(BLangStreamingQueryStatement streamingQueryStatement) {
    siddhiQuery.append("from ");
    StreamingInput streamingInput = streamingQueryStatement.getStreamingInput();
    if (streamingInput != null) {
        ((BLangStreamingInput) streamingInput).accept(this);
        siddhiQuery.append(" ").append(streamingInputClause);
    }
    PatternClause patternClause = streamingQueryStatement.getPatternClause();
    if (patternClause != null) {
        patternStreamingClause = new StringBuilder();
        ((BLangPatternClause) patternClause).accept(this);
        siddhiQuery.append(" ").append(patternStreamingClause);
    }
    JoinStreamingInput joinStreamingInput = streamingQueryStatement.getJoiningInput();
    if (joinStreamingInput != null) {
        ((BLangJoinStreamingInput) joinStreamingInput).accept(this);
        siddhiQuery.append(" ").append(joinStreamingInputClause);
    }
    SelectClauseNode selectClauseNode = streamingQueryStatement.getSelectClause();
    if (selectClauseNode != null) {
        ((BLangSelectClause) selectClauseNode).accept(this);
        siddhiQuery.append(" ").append(selectExprClause);
    }
    OrderByNode orderByNode = streamingQueryStatement.getOrderbyClause();
    if (orderByNode != null) {
        ((BLangOrderBy) orderByNode).accept(this);
        siddhiQuery.append(" ").append(orderByClause);
    }
    OutputRateLimitNode outputRateLimitNode = streamingQueryStatement.getOutputRateLimitNode();
    if (outputRateLimitNode != null) {
        ((BLangOutputRateLimit) outputRateLimitNode).accept(this);
        siddhiQuery.append(" ").append(outputRateLimitClause);
    }
    BLangStreamAction streamActionNode = (BLangStreamAction) streamingQueryStatement.getStreamingAction();
    if (streamActionNode != null) {
        streamActionNode.accept(this);
        siddhiQuery.append(" ").append(streamActionClause);
        siddhiQuery.append(" ; ");
    }
}
Also used : OutputRateLimitNode(org.ballerinalang.model.tree.clauses.OutputRateLimitNode) OrderByNode(org.ballerinalang.model.tree.clauses.OrderByNode) BLangPatternClause(org.wso2.ballerinalang.compiler.tree.clauses.BLangPatternClause) SelectClauseNode(org.ballerinalang.model.tree.clauses.SelectClauseNode) PatternClause(org.ballerinalang.model.tree.clauses.PatternClause) BLangPatternClause(org.wso2.ballerinalang.compiler.tree.clauses.BLangPatternClause) BLangOutputRateLimit(org.wso2.ballerinalang.compiler.tree.clauses.BLangOutputRateLimit) BLangPatternStreamingInput(org.wso2.ballerinalang.compiler.tree.clauses.BLangPatternStreamingInput) JoinStreamingInput(org.ballerinalang.model.tree.clauses.JoinStreamingInput) BLangStreamingInput(org.wso2.ballerinalang.compiler.tree.clauses.BLangStreamingInput) BLangJoinStreamingInput(org.wso2.ballerinalang.compiler.tree.clauses.BLangJoinStreamingInput) StreamingInput(org.ballerinalang.model.tree.clauses.StreamingInput) BLangSelectClause(org.wso2.ballerinalang.compiler.tree.clauses.BLangSelectClause) BLangJoinStreamingInput(org.wso2.ballerinalang.compiler.tree.clauses.BLangJoinStreamingInput) JoinStreamingInput(org.ballerinalang.model.tree.clauses.JoinStreamingInput) BLangJoinStreamingInput(org.wso2.ballerinalang.compiler.tree.clauses.BLangJoinStreamingInput) BLangStreamAction(org.wso2.ballerinalang.compiler.tree.clauses.BLangStreamAction) BLangOrderBy(org.wso2.ballerinalang.compiler.tree.clauses.BLangOrderBy) BLangStreamingInput(org.wso2.ballerinalang.compiler.tree.clauses.BLangStreamingInput)

Aggregations

BLangStreamingInput (org.wso2.ballerinalang.compiler.tree.clauses.BLangStreamingInput)10 BLangJoinStreamingInput (org.wso2.ballerinalang.compiler.tree.clauses.BLangJoinStreamingInput)6 BLangExpression (org.wso2.ballerinalang.compiler.tree.expressions.BLangExpression)5 JoinStreamingInput (org.ballerinalang.model.tree.clauses.JoinStreamingInput)4 StreamingInput (org.ballerinalang.model.tree.clauses.StreamingInput)4 BLangPatternStreamingInput (org.wso2.ballerinalang.compiler.tree.clauses.BLangPatternStreamingInput)4 WhereNode (org.ballerinalang.model.tree.clauses.WhereNode)3 BLangOrderBy (org.wso2.ballerinalang.compiler.tree.clauses.BLangOrderBy)3 BLangSelectClause (org.wso2.ballerinalang.compiler.tree.clauses.BLangSelectClause)3 BLangWhere (org.wso2.ballerinalang.compiler.tree.clauses.BLangWhere)3 OrderByNode (org.ballerinalang.model.tree.clauses.OrderByNode)2 SelectClauseNode (org.ballerinalang.model.tree.clauses.SelectClauseNode)2 WindowClauseNode (org.ballerinalang.model.tree.clauses.WindowClauseNode)2 BLangPatternClause (org.wso2.ballerinalang.compiler.tree.clauses.BLangPatternClause)2 BLangStreamAction (org.wso2.ballerinalang.compiler.tree.clauses.BLangStreamAction)2 BLangWindow (org.wso2.ballerinalang.compiler.tree.clauses.BLangWindow)2 BLangBinaryExpr (org.wso2.ballerinalang.compiler.tree.expressions.BLangBinaryExpr)2 OutputRateLimitNode (org.ballerinalang.model.tree.clauses.OutputRateLimitNode)1 PatternClause (org.ballerinalang.model.tree.clauses.PatternClause)1 SelectExpressionNode (org.ballerinalang.model.tree.clauses.SelectExpressionNode)1