Search in sources :

Example 1 with GroupByNode

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

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

the class BLangPackageBuilder method endGroupByClauseNode.

public void endGroupByClauseNode(DiagnosticPos pos, Set<Whitespace> ws) {
    GroupByNode groupByNode = this.groupByClauseStack.peek();
    ((BLangGroupBy) groupByNode).pos = pos;
    groupByNode.addWS(ws);
    this.exprNodeListStack.pop().forEach(groupByNode::addVariableReference);
}
Also used : GroupByNode(org.ballerinalang.model.tree.clauses.GroupByNode)

Example 3 with GroupByNode

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

the class BLangPackageBuilder method startGroupByClauseNode.

public void startGroupByClauseNode(DiagnosticPos pos, Set<Whitespace> ws) {
    GroupByNode groupByNode = TreeBuilder.createGroupByNode();
    ((BLangGroupBy) groupByNode).pos = pos;
    groupByNode.addWS(ws);
    this.groupByClauseStack.push(groupByNode);
}
Also used : GroupByNode(org.ballerinalang.model.tree.clauses.GroupByNode)

Aggregations

GroupByNode (org.ballerinalang.model.tree.clauses.GroupByNode)3 HavingNode (org.ballerinalang.model.tree.clauses.HavingNode)1 SelectExpressionNode (org.ballerinalang.model.tree.clauses.SelectExpressionNode)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