Search in sources :

Example 16 with BLangBinaryExpr

use of org.wso2.ballerinalang.compiler.tree.expressions.BLangBinaryExpr in project ballerina by ballerina-lang.

the class SiddhiQueryBuilder method visit.

@Override
public void visit(BLangWhere where) {
    whereClause = new StringBuilder();
    whereClause.append("[");
    BLangBinaryExpr expr = (BLangBinaryExpr) where.getExpression();
    expr.accept(this);
    whereClause.append(binaryExpr);
    whereClause.append("]");
}
Also used : BLangBinaryExpr(org.wso2.ballerinalang.compiler.tree.expressions.BLangBinaryExpr)

Example 17 with BLangBinaryExpr

use of org.wso2.ballerinalang.compiler.tree.expressions.BLangBinaryExpr in project ballerina by ballerina-lang.

the class SiddhiQueryBuilder method visit.

@Override
public void visit(BLangHaving having) {
    BLangBinaryExpr expr = (BLangBinaryExpr) having.getExpression();
    havingClause = new StringBuilder("having ");
    expr.accept(this);
    havingClause.append(binaryExpr);
}
Also used : BLangBinaryExpr(org.wso2.ballerinalang.compiler.tree.expressions.BLangBinaryExpr)

Example 18 with BLangBinaryExpr

use of org.wso2.ballerinalang.compiler.tree.expressions.BLangBinaryExpr in project ballerina by ballerina-lang.

the class BLangPackageBuilder method createBinaryExpr.

public void createBinaryExpr(DiagnosticPos pos, Set<Whitespace> ws, String operator) {
    BLangBinaryExpr binaryExpressionNode = (BLangBinaryExpr) TreeBuilder.createBinaryExpressionNode();
    binaryExpressionNode.pos = pos;
    binaryExpressionNode.addWS(ws);
    binaryExpressionNode.rhsExpr = (BLangExpression) exprNodeStack.pop();
    binaryExpressionNode.lhsExpr = (BLangExpression) exprNodeStack.pop();
    binaryExpressionNode.opKind = OperatorKind.valueFrom(operator);
    addExpressionNode(binaryExpressionNode);
}
Also used : BLangBinaryExpr(org.wso2.ballerinalang.compiler.tree.expressions.BLangBinaryExpr)

Example 19 with BLangBinaryExpr

use of org.wso2.ballerinalang.compiler.tree.expressions.BLangBinaryExpr in project ballerina by ballerina-lang.

the class SqlQueryBuilder method visit.

@Override
public void visit(BLangWhere where) {
    whereClause = new StringBuilder();
    whereClause.append("where ");
    BLangBinaryExpr expr = (BLangBinaryExpr) where.getExpression();
    addParametrizedSQL(expr, whereClause, whereExprParams);
}
Also used : BLangBinaryExpr(org.wso2.ballerinalang.compiler.tree.expressions.BLangBinaryExpr)

Example 20 with BLangBinaryExpr

use of org.wso2.ballerinalang.compiler.tree.expressions.BLangBinaryExpr in project ballerina by ballerina-lang.

the class SqlQueryBuilder method visit.

@Override
public void visit(BLangJoinStreamingInput joinStreamingInput) {
    BLangBinaryExpr expr = (BLangBinaryExpr) joinStreamingInput.getOnExpression();
    BLangStreamingInput streamingInput = (BLangStreamingInput) joinStreamingInput.getStreamingInput();
    joinStreamingInputClause = new StringBuilder();
    streamingInput.accept(this);
    joinStreamingInputClause.append("join ").append(streamingInputClause).append(" on ");
    addParametrizedSQL(expr, joinStreamingInputClause, joinOnExprParams);
}
Also used : BLangBinaryExpr(org.wso2.ballerinalang.compiler.tree.expressions.BLangBinaryExpr) BLangStreamingInput(org.wso2.ballerinalang.compiler.tree.clauses.BLangStreamingInput)

Aggregations

BLangBinaryExpr (org.wso2.ballerinalang.compiler.tree.expressions.BLangBinaryExpr)15 BLangAssignment (org.wso2.ballerinalang.compiler.tree.statements.BLangAssignment)5 DiagnosticPos (org.wso2.ballerinalang.compiler.util.diagnotic.DiagnosticPos)5 BLangStreamingInput (org.wso2.ballerinalang.compiler.tree.clauses.BLangStreamingInput)2 BLangExpression (org.wso2.ballerinalang.compiler.tree.expressions.BLangExpression)2 Operand (org.wso2.ballerinalang.programfile.Instruction.Operand)2 RegIndex (org.wso2.ballerinalang.programfile.Instruction.RegIndex)2 SelectExpressionNode (org.ballerinalang.model.tree.clauses.SelectExpressionNode)1 ExpressionNode (org.ballerinalang.model.tree.expressions.ExpressionNode)1 BSymbol (org.wso2.ballerinalang.compiler.semantics.model.symbols.BSymbol)1 BType (org.wso2.ballerinalang.compiler.semantics.model.types.BType)1 BLangSimpleVarRef (org.wso2.ballerinalang.compiler.tree.expressions.BLangSimpleVarRef)1 BLangTernaryExpr (org.wso2.ballerinalang.compiler.tree.expressions.BLangTernaryExpr)1 BLangIf (org.wso2.ballerinalang.compiler.tree.statements.BLangIf)1 BLangReturn (org.wso2.ballerinalang.compiler.tree.statements.BLangReturn)1