use of org.wso2.ballerinalang.compiler.tree.expressions.BLangVariableReference in project ballerina by ballerina-lang.
the class BLangPackageBuilder method createFieldBasedAccessNode.
public void createFieldBasedAccessNode(DiagnosticPos pos, Set<Whitespace> ws, String fieldName, FieldType fieldType) {
BLangFieldBasedAccess fieldBasedAccess = (BLangFieldBasedAccess) TreeBuilder.createFieldBasedAccessNode();
fieldBasedAccess.pos = pos;
fieldBasedAccess.addWS(ws);
fieldBasedAccess.field = (BLangIdentifier) createIdentifier(fieldName);
fieldBasedAccess.expr = (BLangVariableReference) exprNodeStack.pop();
fieldBasedAccess.fieldType = fieldType;
addExpressionNode(fieldBasedAccess);
}
use of org.wso2.ballerinalang.compiler.tree.expressions.BLangVariableReference in project ballerina by ballerina-lang.
the class BLangPackageBuilder method createIndexBasedAccessNode.
public void createIndexBasedAccessNode(DiagnosticPos pos, Set<Whitespace> ws) {
BLangIndexBasedAccess indexBasedAccess = (BLangIndexBasedAccess) TreeBuilder.createIndexBasedAccessNode();
indexBasedAccess.pos = pos;
indexBasedAccess.addWS(ws);
indexBasedAccess.indexExpr = (BLangExpression) exprNodeStack.pop();
indexBasedAccess.expr = (BLangVariableReference) exprNodeStack.pop();
addExpressionNode(indexBasedAccess);
}
use of org.wso2.ballerinalang.compiler.tree.expressions.BLangVariableReference in project ballerina by ballerina-lang.
the class BLangPackageBuilder method addPostIncrementStatement.
public void addPostIncrementStatement(DiagnosticPos pos, Set<Whitespace> ws, String operator) {
BLangPostIncrement postIncrement = (BLangPostIncrement) TreeBuilder.createPostIncrementNode();
postIncrement.setVariable((BLangVariableReference) exprNodeStack.pop());
postIncrement.pos = pos;
postIncrement.addWS(ws);
addLiteralValue(pos, ws, TypeTags.INT, Long.parseLong("1"));
postIncrement.increment = (BLangExpression) exprNodeStack.pop();
postIncrement.opKind = OperatorKind.valueFrom(operator);
addStmtToCurrentBlock(postIncrement);
}
use of org.wso2.ballerinalang.compiler.tree.expressions.BLangVariableReference in project ballerina by ballerina-lang.
the class TaintAnalyzer method updatedVarRefTaintedState.
private void updatedVarRefTaintedState(BLangVariableReference varRef, boolean taintedState) {
if (varRef instanceof BLangSimpleVarRef) {
setTaintedStatus(varRef, taintedState);
} else if (varRef instanceof BLangIndexBasedAccess) {
BLangIndexBasedAccess indexBasedAccessExpr = (BLangIndexBasedAccess) varRef;
updatedVarRefTaintedState(indexBasedAccessExpr.expr, taintedState);
} else if (varRef instanceof BLangFieldBasedAccess) {
BLangFieldBasedAccess fieldBasedAccessExpr = (BLangFieldBasedAccess) varRef;
updatedVarRefTaintedState(fieldBasedAccessExpr.expr, taintedState);
}
}
use of org.wso2.ballerinalang.compiler.tree.expressions.BLangVariableReference in project ballerina by ballerina-lang.
the class SemanticAnalyzer method visit.
@Override
public void visit(BLangPatternStreamingEdgeInput patternStreamingEdgeInput) {
BLangVariableReference streamRef = (BLangVariableReference) patternStreamingEdgeInput.getStreamReference();
typeChecker.checkExpr(streamRef, env);
BLangWhere where = (BLangWhere) patternStreamingEdgeInput.getWhereClause();
if (where != null) {
where.accept(this);
}
}
Aggregations