use of org.wso2.ballerinalang.compiler.tree.expressions.BLangVariableReference in project ballerina by ballerina-lang.
the class BLangPackageBuilder method addAssignmentStatement.
public void addAssignmentStatement(DiagnosticPos pos, Set<Whitespace> ws, boolean isVarDeclaration, boolean safeAssignment) {
ExpressionNode rExprNode = exprNodeStack.pop();
ExpressionNode lExprNode = exprNodeStack.pop();
BLangAssignment assignmentNode = (BLangAssignment) TreeBuilder.createAssignmentNode();
assignmentNode.setExpression(rExprNode);
assignmentNode.setDeclaredWithVar(isVarDeclaration);
assignmentNode.pos = pos;
assignmentNode.addWS(ws);
assignmentNode.safeAssignment = safeAssignment;
assignmentNode.addVariable((BLangVariableReference) lExprNode);
addStmtToCurrentBlock(assignmentNode);
}
use of org.wso2.ballerinalang.compiler.tree.expressions.BLangVariableReference in project ballerina by ballerina-lang.
the class Desugar method visit.
public void visit(BLangCompoundAssignment compoundAssignment) {
BLangAssignment assignStmt = (BLangAssignment) TreeBuilder.createAssignmentNode();
assignStmt.pos = compoundAssignment.pos;
assignStmt.addVariable(rewriteExpr((BLangVariableReference) compoundAssignment.varRef));
assignStmt.expr = rewriteExpr(compoundAssignment.modifiedExpr);
result = assignStmt;
}
Aggregations