Search in sources :

Example 1 with SelectExpressionNode

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

the class SemanticAnalyzer method visit.

public void visit(BLangSelectClause selectClause) {
    GroupByNode groupByNode = selectClause.getGroupBy();
    if (groupByNode != null) {
        ((BLangGroupBy) groupByNode).accept(this);
    }
    HavingNode havingNode = selectClause.getHaving();
    if (havingNode != null) {
        ((BLangHaving) havingNode).accept(this);
    }
    List<? extends SelectExpressionNode> selectExpressionsList = selectClause.getSelectExpressions();
    if (selectExpressionsList != null) {
        for (SelectExpressionNode selectExpressionNode : selectExpressionsList) {
            ((BLangSelectExpression) selectExpressionNode).accept(this);
        }
    }
}
Also used : HavingNode(org.ballerinalang.model.tree.clauses.HavingNode) SelectExpressionNode(org.ballerinalang.model.tree.clauses.SelectExpressionNode) BLangSelectExpression(org.wso2.ballerinalang.compiler.tree.clauses.BLangSelectExpression) GroupByNode(org.ballerinalang.model.tree.clauses.GroupByNode) BLangGroupBy(org.wso2.ballerinalang.compiler.tree.clauses.BLangGroupBy) BLangHaving(org.wso2.ballerinalang.compiler.tree.clauses.BLangHaving)

Example 2 with SelectExpressionNode

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

the class BLangPackageBuilder method startSelectExpressionNode.

public void startSelectExpressionNode(DiagnosticPos pos, Set<Whitespace> ws) {
    SelectExpressionNode selectExpr = TreeBuilder.createSelectExpressionNode();
    ((BLangSelectExpression) selectExpr).pos = pos;
    selectExpr.addWS(ws);
    this.selectExpressionsStack.push(selectExpr);
}
Also used : SelectExpressionNode(org.ballerinalang.model.tree.clauses.SelectExpressionNode)

Example 3 with SelectExpressionNode

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

the class BLangPackageBuilder method endSelectExpressionNode.

public void endSelectExpressionNode(String identifier, DiagnosticPos pos, Set<Whitespace> ws) {
    SelectExpressionNode selectExpression = this.selectExpressionsStack.peek();
    selectExpression.setExpression(exprNodeStack.pop());
    ((BLangSelectExpression) selectExpression).pos = pos;
    selectExpression.addWS(ws);
    selectExpression.setIdentifier(identifier);
}
Also used : SelectExpressionNode(org.ballerinalang.model.tree.clauses.SelectExpressionNode)

Example 4 with SelectExpressionNode

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

the class BLangPackageBuilder method addSelectExprToSelectExprNodeList.

private void addSelectExprToSelectExprNodeList(List<SelectExpressionNode> selectExprList, int n) {
    if (this.selectExpressionsStack.empty()) {
        throw new IllegalStateException("Select expression stack cannot be empty in processing a SelectClause");
    }
    SelectExpressionNode expr = this.selectExpressionsStack.pop();
    if (n > 1) {
        addSelectExprToSelectExprNodeList(selectExprList, n - 1);
    }
    selectExprList.add(expr);
}
Also used : SelectExpressionNode(org.ballerinalang.model.tree.clauses.SelectExpressionNode)

Aggregations

SelectExpressionNode (org.ballerinalang.model.tree.clauses.SelectExpressionNode)4 GroupByNode (org.ballerinalang.model.tree.clauses.GroupByNode)1 HavingNode (org.ballerinalang.model.tree.clauses.HavingNode)1 BLangGroupBy (org.wso2.ballerinalang.compiler.tree.clauses.BLangGroupBy)1 BLangHaving (org.wso2.ballerinalang.compiler.tree.clauses.BLangHaving)1 BLangSelectExpression (org.wso2.ballerinalang.compiler.tree.clauses.BLangSelectExpression)1