use of org.wso2.charon3.core.utils.codeutils.ExpressionNode in project ballerina by ballerina-lang.
the class SemanticAnalyzer method visit.
public void visit(BLangBinaryExpr binaryExpr) {
ExpressionNode leftExpression = binaryExpr.getLeftExpression();
((BLangExpression) leftExpression).accept(this);
ExpressionNode rightExpression = binaryExpr.getRightExpression();
((BLangExpression) rightExpression).accept(this);
}
use of org.wso2.charon3.core.utils.codeutils.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.charon3.core.utils.codeutils.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.charon3.core.utils.codeutils.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.charon3.core.utils.codeutils.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);
}
Aggregations