Examples of asLiteral()


Examples of org.openquark.cal.compiler.Expression.asLiteral()

                                Integer i = (Integer)arg.asLiteral().getLiteral();
                                return i.intValue() != 0;

                            } else if (unqualifiedOpName.equals("divideShort") || unqualifiedOpName.equals("remainderShort")) {

                                Short shortValue = (Short)arg.asLiteral().getLiteral();
                                return shortValue.shortValue() != 0;

                            } else if (unqualifiedOpName.equals("divideByte") || unqualifiedOpName.equals("remainderByte")) {

                                Byte byteValue = (Byte)arg.asLiteral().getLiteral();
View Full Code Here

Examples of org.openquark.cal.compiler.Expression.asLiteral()

                                Short shortValue = (Short)arg.asLiteral().getLiteral();
                                return shortValue.shortValue() != 0;

                            } else if (unqualifiedOpName.equals("divideByte") || unqualifiedOpName.equals("remainderByte")) {

                                Byte byteValue = (Byte)arg.asLiteral().getLiteral();
                                return byteValue.byteValue() != 0;

                            } else {
                                throw new IllegalStateException();
                            }
View Full Code Here

Examples of org.openquark.cal.compiler.Expression.asLiteral()

                         unqualifiedOpName.equals(CAL_Prelude_internal.Functions.remainderByte.getUnqualifiedName()))) {

                        // Check that the second argument is a non zero literal.

                        Expression arg = basicOpExpressions.getArgument(1);
                        if (arg.asLiteral() != null) {

                            if (unqualifiedOpName.equals(CAL_Prelude_internal.Functions.divideLong.getUnqualifiedName()) ||
                                unqualifiedOpName.equals(CAL_Prelude_internal.Functions.remainderLong.getUnqualifiedName())) {

                                Long l = (Long)arg.asLiteral().getLiteral();
View Full Code Here

Examples of org.openquark.cal.compiler.Expression.asLiteral()

                        if (arg.asLiteral() != null) {

                            if (unqualifiedOpName.equals(CAL_Prelude_internal.Functions.divideLong.getUnqualifiedName()) ||
                                unqualifiedOpName.equals(CAL_Prelude_internal.Functions.remainderLong.getUnqualifiedName())) {

                                Long l = (Long)arg.asLiteral().getLiteral();
                                return l.longValue() != 0;

                            } else if (unqualifiedOpName.equals(CAL_Prelude_internal.Functions.divideInt.getUnqualifiedName()) ||
                                unqualifiedOpName.equals(CAL_Prelude_internal.Functions.remainderInt.getUnqualifiedName())) {
View Full Code Here

Examples of org.openquark.cal.compiler.Expression.asLiteral()

                                return l.longValue() != 0;

                            } else if (unqualifiedOpName.equals(CAL_Prelude_internal.Functions.divideInt.getUnqualifiedName()) ||
                                unqualifiedOpName.equals(CAL_Prelude_internal.Functions.remainderInt.getUnqualifiedName())) {

                                Integer i = (Integer)arg.asLiteral().getLiteral();
                                return i.intValue() != 0;

                            } else if (unqualifiedOpName.equals(CAL_Prelude_internal.Functions.divideShort.getUnqualifiedName()) ||
                                unqualifiedOpName.equals(CAL_Prelude_internal.Functions.remainderShort.getUnqualifiedName())) {
View Full Code Here

Examples of org.openquark.cal.compiler.Expression.asLiteral()

                                return i.intValue() != 0;

                            } else if (unqualifiedOpName.equals(CAL_Prelude_internal.Functions.divideShort.getUnqualifiedName()) ||
                                unqualifiedOpName.equals(CAL_Prelude_internal.Functions.remainderShort.getUnqualifiedName())) {

                                Short shortValue = (Short)arg.asLiteral().getLiteral();
                                return shortValue.shortValue() != 0;

                            } else if (unqualifiedOpName.equals(CAL_Prelude_internal.Functions.divideByte.getUnqualifiedName()) ||
                                unqualifiedOpName.equals(CAL_Prelude_internal.Functions.remainderByte.getUnqualifiedName())) {
View Full Code Here

Examples of org.openquark.cal.compiler.Expression.asLiteral()

                                return shortValue.shortValue() != 0;

                            } else if (unqualifiedOpName.equals(CAL_Prelude_internal.Functions.divideByte.getUnqualifiedName()) ||
                                unqualifiedOpName.equals(CAL_Prelude_internal.Functions.remainderByte.getUnqualifiedName())) {

                                Byte byteValue = (Byte)arg.asLiteral().getLiteral();
                                return byteValue.byteValue() != 0;

                            } else {
                                throw new IllegalStateException();
                            }
View Full Code Here

Examples of org.openquark.cal.compiler.Expression.asLiteral()

                !(switchAlt.getFirstAltTag() instanceof DataConstructor)) {
                isa = false;
                break;
            }
            Expression altExpr = switchAlt.getAltExpr();
            if (altExpr.asLiteral() != null) {
                if (!(altExpr.asLiteral().getLiteral() instanceof Boolean)) {
                    isa = false;
                    break;
                }
            } else if (altExpr.asVar() != null) {
View Full Code Here

Examples of org.openquark.cal.compiler.Expression.asLiteral()

                isa = false;
                break;
            }
            Expression altExpr = switchAlt.getAltExpr();
            if (altExpr.asLiteral() != null) {
                if (!(altExpr.asLiteral().getLiteral() instanceof Boolean)) {
                    isa = false;
                    break;
                }
            } else if (altExpr.asVar() != null) {
                DataConstructor dcv = altExpr.asVar().getDataConstructor();
View Full Code Here

Examples of org.openquark.cal.compiler.Expression.asLiteral()

        int defaultIndex = -1;
        int trueCount = 0;
        // Need to determine if there is a default case and how many true and false cases.
        for (int i = 0; i < alts.length; ++i) {
            Expression altExpr = alts[i].getAltExpr();
            Expression.Literal lit = altExpr.asLiteral();
            Expression.Var var = altExpr.asVar();
            boolean isTrue = false;
            if (lit != null && lit.getLiteral() instanceof Boolean && ((Boolean)lit.getLiteral()).booleanValue()) {
                isTrue = true;
                trueCount++;
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.