use of org.wso2.ballerinalang.compiler.tree.expressions.BLangFieldBasedAccess 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.BLangFieldBasedAccess in project ballerina by ballerina-lang.
the class SqlQueryBuilder method visit.
@Override
public void visit(BLangFieldBasedAccess fieldAccessExpr) {
BLangSimpleVarRef expr = (BLangSimpleVarRef) fieldAccessExpr.expr;
String sqlExpr = expr.variableName.value + "." + fieldAccessExpr.field.value;
exprStack.push(sqlExpr);
}
use of org.wso2.ballerinalang.compiler.tree.expressions.BLangFieldBasedAccess 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.BLangFieldBasedAccess in project ballerina by ballerina-lang.
the class Desugar method visitFunctionPointerInvocation.
// private functions
private void visitFunctionPointerInvocation(BLangInvocation iExpr) {
BLangVariableReference expr;
if (iExpr.expr == null) {
expr = new BLangSimpleVarRef();
} else {
BLangFieldBasedAccess fieldBasedAccess = new BLangFieldBasedAccess();
fieldBasedAccess.expr = iExpr.expr;
fieldBasedAccess.field = iExpr.name;
expr = fieldBasedAccess;
}
expr.symbol = (BVarSymbol) iExpr.symbol;
expr.type = iExpr.symbol.type;
expr = rewriteExpr(expr);
result = new BFunctionPointerInvocation(iExpr, expr);
}
use of org.wso2.ballerinalang.compiler.tree.expressions.BLangFieldBasedAccess in project ballerina by ballerina-lang.
the class SiddhiQueryBuilder method visit.
@Override
public void visit(BLangFieldBasedAccess fieldAccessExpr) {
varRef = fieldAccessExpr.toString();
if (fieldAccessExpr.expr instanceof BLangIndexBasedAccess) {
BLangIndexBasedAccess indexBasedAccess = (BLangIndexBasedAccess) fieldAccessExpr.expr;
String exprName = indexBasedAccess.expr.toString() + ".length";
if (varRef.contains(exprName)) {
varRef = varRef.replaceFirst(exprName, "last");
}
}
}
Aggregations