Search in sources :

Example 1 with VariableSymbol

use of org.ballerinalang.model.symbols.VariableSymbol in project ballerina by ballerina-lang.

the class SiddhiQueryBuilder method visit.

public void visit(BLangForever foreverStatement) {
    siddhiQuery = new StringBuilder();
    streamDefinitionQuery = new StringBuilder();
    streamIds = new HashSet<>();
    inStreamRefs = new ArrayList<>();
    outStreamRefs = new ArrayList<>();
    inTableRefs = new ArrayList<>();
    outTableRefs = new ArrayList<>();
    binaryExpr = null;
    setExpr = null;
    orderByClause = null;
    whereClause = null;
    windowClause = null;
    joinStreamingInputClause = null;
    streamingInputClause = null;
    selectExprClause = null;
    selectExpr = null;
    setAssignmentClause = null;
    groupByClause = null;
    havingClause = null;
    patternStreamingClause = null;
    streamActionClause = null;
    intRangeExpr = null;
    List<VariableNode> globalVariables = foreverStatement.getGlobalVariables();
    if (globalVariables != null) {
        for (VariableNode variable : globalVariables) {
            ((BLangVariable) variable).accept(this);
        }
    }
    List<VariableSymbol> functionVariables = foreverStatement.getFunctionVariables();
    if (functionVariables != null) {
        for (VariableSymbol variable : functionVariables) {
            getStreamDefintionForFuntionVariable((BVarSymbol) variable);
        }
    }
    List<? extends StatementNode> statementNodes = foreverStatement.gettreamingQueryStatements();
    for (StatementNode statementNode : statementNodes) {
        ((BLangStatement) statementNode).accept(this);
    }
    foreverStatement.setSiddhiQuery(this.getSiddhiQuery());
    foreverStatement.setStreamIdsAsString(String.join(",", streamIds));
}
Also used : VariableNode(org.ballerinalang.model.tree.VariableNode) BLangStatement(org.wso2.ballerinalang.compiler.tree.statements.BLangStatement) StatementNode(org.ballerinalang.model.tree.statements.StatementNode) VariableSymbol(org.ballerinalang.model.symbols.VariableSymbol) BLangVariable(org.wso2.ballerinalang.compiler.tree.BLangVariable)

Aggregations

VariableSymbol (org.ballerinalang.model.symbols.VariableSymbol)1 VariableNode (org.ballerinalang.model.tree.VariableNode)1 StatementNode (org.ballerinalang.model.tree.statements.StatementNode)1 BLangVariable (org.wso2.ballerinalang.compiler.tree.BLangVariable)1 BLangStatement (org.wso2.ballerinalang.compiler.tree.statements.BLangStatement)1