use of org.wso2.ballerinalang.compiler.tree.expressions.BLangExpression in project ballerina by ballerina-lang.
the class TypeChecker method getXMLTextLiteral.
private BLangExpression getXMLTextLiteral(BLangExpression contentExpr) {
BLangXMLTextLiteral xmlTextLiteral = (BLangXMLTextLiteral) TreeBuilder.createXMLTextLiteralNode();
xmlTextLiteral.concatExpr = contentExpr;
xmlTextLiteral.pos = contentExpr.pos;
return xmlTextLiteral;
}
use of org.wso2.ballerinalang.compiler.tree.expressions.BLangExpression in project ballerina by ballerina-lang.
the class TypeChecker method visit.
@Override
public void visit(BLangSelectExpression selectExpression) {
BLangExpression expr = (BLangExpression) selectExpression.getExpression();
expr.accept(this);
}
use of org.wso2.ballerinalang.compiler.tree.expressions.BLangExpression in project ballerina by ballerina-lang.
the class TypeChecker method checkRestArgs.
private void checkRestArgs(List<BLangExpression> restArgExprs, BLangExpression vararg, BVarSymbol restParam) {
if (vararg != null && !restArgExprs.isEmpty()) {
dlog.error(vararg.pos, DiagnosticCode.INVALID_REST_ARGS);
return;
}
if (vararg != null) {
checkExpr(vararg, this.env, Lists.of(restParam.type));
restArgExprs.add(vararg);
return;
}
for (BLangExpression arg : restArgExprs) {
checkExpr(arg, this.env, Lists.of(((BArrayType) restParam.type).eType));
}
}
use of org.wso2.ballerinalang.compiler.tree.expressions.BLangExpression in project ballerina by ballerina-lang.
the class SemanticAnalyzer method getBinaryExpr.
private BLangExpression getBinaryExpr(BLangExpression lExpr, BLangExpression rExpr, OperatorKind opKind, BSymbol opSymbol) {
BLangBinaryExpr binaryExpressionNode = (BLangBinaryExpr) TreeBuilder.createBinaryExpressionNode();
binaryExpressionNode.lhsExpr = lExpr;
binaryExpressionNode.rhsExpr = rExpr;
binaryExpressionNode.pos = rExpr.pos;
binaryExpressionNode.opKind = opKind;
if (opSymbol != symTable.notFoundSymbol) {
binaryExpressionNode.type = opSymbol.type.getReturnTypes().get(0);
binaryExpressionNode.opSymbol = (BOperatorSymbol) opSymbol;
} else {
binaryExpressionNode.type = symTable.errType;
}
return binaryExpressionNode;
}
use of org.wso2.ballerinalang.compiler.tree.expressions.BLangExpression in project ballerina by ballerina-lang.
the class SemanticAnalyzer method visit.
public void visit(BLangWhere whereClause) {
ExpressionNode expressionNode = whereClause.getExpression();
((BLangExpression) expressionNode).accept(this);
}
Aggregations