Search in sources :

Example 6 with OperatorTranslation

use of org.eclipse.ceylon.compiler.java.codegen.Operators.OperatorTranslation in project ceylon by eclipse.

the class ExpressionTransformer method transform.

// Logical operators
public JCExpression transform(Tree.LogicalOp op) {
    OperatorTranslation operator = Operators.getOperator(op.getClass());
    if (operator == null) {
        return makeErroneous(op, "compiler bug: " + op.getNodeType() + " is not a supported logical operator");
    }
    // Both terms are Booleans and can't be erased to anything
    JCExpression left = transformExpression(op.getLeftTerm(), BoxingStrategy.UNBOXED, null);
    return transformLogicalOp(op, operator, left, op.getRightTerm());
}
Also used : JCExpression(org.eclipse.ceylon.langtools.tools.javac.tree.JCTree.JCExpression) OperatorTranslation(org.eclipse.ceylon.compiler.java.codegen.Operators.OperatorTranslation) AssignmentOperatorTranslation(org.eclipse.ceylon.compiler.java.codegen.Operators.AssignmentOperatorTranslation)

Aggregations

AssignmentOperatorTranslation (org.eclipse.ceylon.compiler.java.codegen.Operators.AssignmentOperatorTranslation)6 OperatorTranslation (org.eclipse.ceylon.compiler.java.codegen.Operators.OperatorTranslation)6 JCExpression (org.eclipse.ceylon.langtools.tools.javac.tree.JCTree.JCExpression)6 Tree (org.eclipse.ceylon.compiler.typechecker.tree.Tree)5 Term (org.eclipse.ceylon.compiler.typechecker.tree.Tree.Term)5 JCTree (org.eclipse.ceylon.langtools.tools.javac.tree.JCTree)5 Type (org.eclipse.ceylon.model.typechecker.model.Type)4 UnionType (org.eclipse.ceylon.model.typechecker.model.UnionType)4 OptimisationStrategy (org.eclipse.ceylon.compiler.java.codegen.Operators.OptimisationStrategy)3 SyntheticName (org.eclipse.ceylon.compiler.java.codegen.Naming.SyntheticName)2 JCVariableDecl (org.eclipse.ceylon.langtools.tools.javac.tree.JCTree.JCVariableDecl)2 JCStatement (org.eclipse.ceylon.langtools.tools.javac.tree.JCTree.JCStatement)1 Name (org.eclipse.ceylon.langtools.tools.javac.util.Name)1