Examples of sameType()


Examples of org.openquark.cal.compiler.TypeExpr.sameType()

    public ValueNode transform(ValueNodeBuilderHelper valueNodeBuilderHelper, ValueNode sourceVN, TypeExpr destTypeExpr) {

        TypeExpr sourceTypeExpr = sourceVN.getTypeExpr();
       
        // check if we're "transforming" to the same type
        if (sourceTypeExpr.sameType(destTypeExpr)) {
            return sourceVN.copyValueNode(destTypeExpr);
        }

        Object newValue = null;
View Full Code Here

Examples of org.openquark.cal.compiler.TypeExpr.sameType()

        if (sourceVN instanceof LiteralValueNode && !sourceVN.getTypeExpr().sameType(typeConstants.getStringType())) {

            LiteralValueNode sourceLiteralVN = (LiteralValueNode) sourceVN;

            if (sourceTypeExpr.sameType(typeConstants.getDoubleType()) &&
                destTypeExpr.sameType(typeConstants.getIntType())) {

                newValue = Integer.valueOf((int) Math.round(sourceLiteralVN.getDoubleValue().doubleValue()));

            } else if (sourceTypeExpr.sameType(typeConstants.getIntType()) &&
View Full Code Here

Examples of org.openquark.cal.compiler.TypeExpr.sameType()

            if (sourceTypeExpr.sameType(typeConstants.getDoubleType()) &&
                destTypeExpr.sameType(typeConstants.getIntType())) {

                newValue = Integer.valueOf((int) Math.round(sourceLiteralVN.getDoubleValue().doubleValue()));

            } else if (sourceTypeExpr.sameType(typeConstants.getIntType()) &&
                       destTypeExpr.sameType(typeConstants.getDoubleType())) {

                newValue = Double.valueOf(sourceLiteralVN.getIntegerValue().intValue());
            }
View Full Code Here

Examples of org.openquark.cal.compiler.TypeExpr.sameType()

            String probableFunctionName = "make" + dc.getName().getUnqualifiedName();

            for (int i = 0; i < module.getNFunctions(); ++i) {
                Function function = module.getNthFunction(i);
                if (function.getName().getUnqualifiedName().equals(probableFunctionName)) {
                    if (dcTypeExpr.sameType(function.getTypeExpr())) {
                        return QualifiedName.make(module.getModuleName(), probableFunctionName);
                    }
                }
            }
           
View Full Code Here

Examples of org.openquark.cal.compiler.TypeExpr.sameType()

           
            // Transmute the endpoint nodes to the new types
            TypeExpr childTypeExpr = ((TypeConsApp)newTypeExpr).getArg(0);
            ValueNode leftNode;
            ValueNode rightNode;
            if (!childTypeExpr.sameType(this.leftNode.getTypeExpr())) {
                leftNode = this.leftNode.transmuteValueNode(valueNodeBuilderHelper, valueNodeTransformer, childTypeExpr);
                rightNode = this.rightNode.transmuteValueNode(valueNodeBuilderHelper, valueNodeTransformer, childTypeExpr);
            } else {
                leftNode = this.leftNode.copyValueNode();
                rightNode = this.rightNode.copyValueNode();
View Full Code Here

Examples of org.openquark.cal.compiler.TypeExpr.sameType()

        valueFieldKeyListener = null;
       
        PreludeTypeConstants typeConstants = valueEditorManager.getValueNodeBuilderHelper().getPreludeTypeConstants();
       
        // Add a special key listener for certain types.
        if (typeExpr.sameType(typeConstants.getCharType())) {
           
            valueFieldKeyListener = new CharTypeKeyListener();
            ivjValueField.addKeyListener(valueFieldKeyListener);
       
        } else if (typeExpr.rootTypeConsApp() != null) {
View Full Code Here

Examples of org.openquark.cal.compiler.TypeExpr.sameType()

                len = 1;
                changed = true;

            }
           
        } else if (typeExpr.sameType(typeConstants.getIntType()) ||
                   typeExpr.sameType(typeConstants.getIntegerType()) ||
                   typeExpr.sameType(typeConstants.getByteType()) ||
                   typeExpr.sameType(typeConstants.getShortType()) ||
                   typeExpr.sameType(typeConstants.getLongType())) {
View Full Code Here

Examples of org.openquark.cal.compiler.TypeExpr.sameType()

                changed = true;

            }
           
        } else if (typeExpr.sameType(typeConstants.getIntType()) ||
                   typeExpr.sameType(typeConstants.getIntegerType()) ||
                   typeExpr.sameType(typeConstants.getByteType()) ||
                   typeExpr.sameType(typeConstants.getShortType()) ||
                   typeExpr.sameType(typeConstants.getLongType())) {

            // Remove trailing -
View Full Code Here

Examples of org.openquark.cal.compiler.TypeExpr.sameType()

            }
           
        } else if (typeExpr.sameType(typeConstants.getIntType()) ||
                   typeExpr.sameType(typeConstants.getIntegerType()) ||
                   typeExpr.sameType(typeConstants.getByteType()) ||
                   typeExpr.sameType(typeConstants.getShortType()) ||
                   typeExpr.sameType(typeConstants.getLongType())) {

            // Remove trailing -
            len = currentText.length();
View Full Code Here

Examples of org.openquark.cal.compiler.TypeExpr.sameType()

            }
           
        } else if (typeExpr.sameType(typeConstants.getIntType()) ||
                   typeExpr.sameType(typeConstants.getIntegerType()) ||
                   typeExpr.sameType(typeConstants.getByteType()) ||
                   typeExpr.sameType(typeConstants.getShortType()) ||
                   typeExpr.sameType(typeConstants.getLongType())) {

            // Remove trailing -
            len = currentText.length();
            if (len > 0) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.