use of org.wso2.carbon.identity.core.model.ExpressionNode in project ballerina by ballerina-lang.
the class SemanticAnalyzer method visit.
public void visit(BLangWindow windowClause) {
ExpressionNode expressionNode = windowClause.getFunctionInvocation();
((BLangExpression) expressionNode).accept(this);
}
use of org.wso2.carbon.identity.core.model.ExpressionNode in project ballerina by ballerina-lang.
the class SiddhiQueryBuilder method visit.
@Override
public void visit(BLangPatternStreamingEdgeInput patternStreamingEdgeInput) {
BLangExpression streamRef = (BLangExpression) patternStreamingEdgeInput.getStreamReference();
streamRef.accept(this);
streamIds.add(varRef);
varRef = "";
addInRefs(streamRef);
String alias = patternStreamingEdgeInput.getAliasIdentifier();
patternStreamingClause.append(alias).append(" = ").append(patternStreamingEdgeInput.getStreamReference());
WhereNode whereNode = patternStreamingEdgeInput.getWhereClause();
if (whereNode != null) {
((BLangWhere) whereNode).accept(this);
patternStreamingClause.append(" ").append(whereClause);
whereClause = new StringBuilder();
}
ExpressionNode expression = patternStreamingEdgeInput.getExpression();
if (expression != null) {
((BLangExpression) expression).accept(this);
patternStreamingClause.append(intRangeExpr.toString());
}
}
use of org.wso2.carbon.identity.core.model.ExpressionNode in project ballerina by ballerina-lang.
the class BLangPackageBuilder method addTupleDestructuringStatement.
public void addTupleDestructuringStatement(DiagnosticPos pos, Set<Whitespace> ws, boolean isVarsExist, boolean varDeclaration) {
BLangTupleDestructure stmt = (BLangTupleDestructure) TreeBuilder.createTupleDestructureStatementNode();
stmt.pos = pos;
stmt.addWS(ws);
if (isVarsExist) {
stmt.setDeclaredWithVar(varDeclaration);
stmt.expr = (BLangExpression) exprNodeStack.pop();
List<ExpressionNode> lExprList = exprNodeListStack.pop();
lExprList.forEach(expressionNode -> stmt.varRefs.add((BLangVariableReference) expressionNode));
}
// TODO: handle ParamList Destructue.
addStmtToCurrentBlock(stmt);
}
use of org.wso2.carbon.identity.core.model.ExpressionNode in project ballerina by ballerina-lang.
the class BLangPackageBuilder method addReturnStatement.
public void addReturnStatement(DiagnosticPos pos, Set<Whitespace> ws, boolean exprAvailable) {
BLangReturn retStmt = (BLangReturn) TreeBuilder.createReturnNode();
retStmt.pos = pos;
retStmt.addWS(ws);
if (exprAvailable) {
retStmt.addWS(commaWsStack.pop());
for (ExpressionNode expr : this.exprNodeListStack.pop()) {
retStmt.exprs.add((BLangExpression) expr);
}
}
addStmtToCurrentBlock(retStmt);
}
use of org.wso2.carbon.identity.core.model.ExpressionNode in project ballerina by ballerina-lang.
the class BLangPackageBuilder method addForeachStatement.
public void addForeachStatement(DiagnosticPos pos, Set<Whitespace> ws) {
BLangForeach foreach = (BLangForeach) TreeBuilder.createForeachNode();
foreach.addWS(ws);
foreach.pos = pos;
foreach.setCollection(exprNodeStack.pop());
foreach.addWS(commaWsStack.pop());
List<ExpressionNode> lExprList = exprNodeListStack.pop();
lExprList.forEach(expressionNode -> foreach.addVariable((BLangVariableReference) expressionNode));
BLangBlockStmt foreachBlock = (BLangBlockStmt) this.blockNodeStack.pop();
foreachBlock.pos = pos;
foreach.setBody(foreachBlock);
addStmtToCurrentBlock(foreach);
}
Aggregations