Search in sources :

Example 1 with SelectClauseNode

use of org.ballerinalang.model.tree.clauses.SelectClauseNode 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)

Example 2 with SelectClauseNode

use of org.ballerinalang.model.tree.clauses.SelectClauseNode in project ballerina by ballerina-lang.

the class BLangPackageBuilder method startSelectClauseNode.

public void startSelectClauseNode(DiagnosticPos pos, Set<Whitespace> ws) {
    SelectClauseNode selectClauseNode = TreeBuilder.createSelectClauseNode();
    ((BLangSelectClause) selectClauseNode).pos = pos;
    selectClauseNode.addWS(ws);
    this.selectClausesStack.push(selectClauseNode);
}
Also used : SelectClauseNode(org.ballerinalang.model.tree.clauses.SelectClauseNode)

Example 3 with SelectClauseNode

use of org.ballerinalang.model.tree.clauses.SelectClauseNode in project ballerina by ballerina-lang.

the class BLangPackageBuilder method endSelectClauseNode.

public void endSelectClauseNode(boolean isSelectAll, boolean isGroupByAvailable, boolean isHavingAvailable, DiagnosticPos pos, Set<Whitespace> ws) {
    SelectClauseNode selectClauseNode = this.selectClausesStack.peek();
    ((BLangSelectClause) selectClauseNode).pos = pos;
    selectClauseNode.addWS(ws);
    if (!isSelectAll) {
        selectClauseNode.setSelectExpressions(this.selectExpressionsListStack.pop());
    } else {
        selectClauseNode.setSelectAll(true);
    }
    if (isGroupByAvailable) {
        selectClauseNode.setGroupBy(this.groupByClauseStack.pop());
    }
    if (isHavingAvailable) {
        selectClauseNode.setHaving(this.havingClauseStack.pop());
    }
}
Also used : SelectClauseNode(org.ballerinalang.model.tree.clauses.SelectClauseNode)

Example 4 with SelectClauseNode

use of org.ballerinalang.model.tree.clauses.SelectClauseNode 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);
    }
}
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) BLangSelectClause(org.wso2.ballerinalang.compiler.tree.clauses.BLangSelectClause) BLangJoinStreamingInput(org.wso2.ballerinalang.compiler.tree.clauses.BLangJoinStreamingInput) StreamActionNode(org.ballerinalang.model.tree.clauses.StreamActionNode) JoinStreamingInput(org.ballerinalang.model.tree.clauses.JoinStreamingInput) BLangJoinStreamingInput(org.wso2.ballerinalang.compiler.tree.clauses.BLangJoinStreamingInput) OrderByNode(org.ballerinalang.model.tree.clauses.OrderByNode) BLangStreamAction(org.wso2.ballerinalang.compiler.tree.clauses.BLangStreamAction) SelectClauseNode(org.ballerinalang.model.tree.clauses.SelectClauseNode) BLangPatternClause(org.wso2.ballerinalang.compiler.tree.clauses.BLangPatternClause) BLangOrderBy(org.wso2.ballerinalang.compiler.tree.clauses.BLangOrderBy) BLangStreamingInput(org.wso2.ballerinalang.compiler.tree.clauses.BLangStreamingInput)

Aggregations

SelectClauseNode (org.ballerinalang.model.tree.clauses.SelectClauseNode)4 JoinStreamingInput (org.ballerinalang.model.tree.clauses.JoinStreamingInput)2 OrderByNode (org.ballerinalang.model.tree.clauses.OrderByNode)2 StreamingInput (org.ballerinalang.model.tree.clauses.StreamingInput)2 BLangJoinStreamingInput (org.wso2.ballerinalang.compiler.tree.clauses.BLangJoinStreamingInput)2 BLangOrderBy (org.wso2.ballerinalang.compiler.tree.clauses.BLangOrderBy)2 BLangPatternClause (org.wso2.ballerinalang.compiler.tree.clauses.BLangPatternClause)2 BLangPatternStreamingInput (org.wso2.ballerinalang.compiler.tree.clauses.BLangPatternStreamingInput)2 BLangSelectClause (org.wso2.ballerinalang.compiler.tree.clauses.BLangSelectClause)2 BLangStreamAction (org.wso2.ballerinalang.compiler.tree.clauses.BLangStreamAction)2 BLangStreamingInput (org.wso2.ballerinalang.compiler.tree.clauses.BLangStreamingInput)2 OutputRateLimitNode (org.ballerinalang.model.tree.clauses.OutputRateLimitNode)1 PatternClause (org.ballerinalang.model.tree.clauses.PatternClause)1 StreamActionNode (org.ballerinalang.model.tree.clauses.StreamActionNode)1 BLangOutputRateLimit (org.wso2.ballerinalang.compiler.tree.clauses.BLangOutputRateLimit)1