Package caltrop.interpreter

Examples of caltrop.interpreter.ExprEvaluator.evaluate()


                Expression valExpr = decls[i].getInitialValue();

                // Note: this assumes that declarations are
                // ordered by eager dependency
                Object value = (valExpr == null) ? _theContext.createNull()
                        : eval.evaluate(valExpr);
                env.bind(var, value);
            }
        }
    }
View Full Code Here


        final ExprEvaluator eval = new ExprEvaluator(context, env);
        final Expression[] guards = action.getGuards();

        for (int i = 0; i < guards.length; i++) {
            final Object g = eval.evaluate(guards[i]);

            if (!context.booleanValue(g)) {
                // System.out.println("guard not satisfied:" + guards[i]);
                return false;
            }
View Full Code Here

            final OutputChannel channel = ((OutputPort) (outputPortMap
                    .get(outputExpression.getPortname()))).getChannel(0);

            // FIXME: handle multiports
            if (repeatExpr != null) {
                int repeatValue = context.intValue(eval.evaluate(repeatExpr));
                List[] lists = new List[expressions.length];

                for (int j = 0; j < lists.length; j++) {
                    lists[j] = context.getList(eval.evaluate(expressions[j]));
                }
View Full Code Here

            if (repeatExpr != null) {
                int repeatValue = context.intValue(eval.evaluate(repeatExpr));
                List[] lists = new List[expressions.length];

                for (int j = 0; j < lists.length; j++) {
                    lists[j] = context.getList(eval.evaluate(expressions[j]));
                }

                for (int j = 0; j < repeatValue; j++) {
                    for (int k = 0; k < expressions.length; k++) {
                        channel.put(lists[k].get(j));
View Full Code Here

                        channel.put(lists[k].get(j));
                    }
                }
            } else {
                for (int j = 0; j < expressions.length; j++) {
                    channel.put(eval.evaluate(expressions[j]));
                }
            }
        }
    }
View Full Code Here

        final ExprEvaluator eval = new ExprEvaluator(context, env);
        final Expression[] guards = action.getGuards();

        for (int i = 0; i < guards.length; i++) {
            final Object g = eval.evaluate(guards[i]);

            if (!context.booleanValue(g)) {
                // System.out.println("guard not satisfied:" + guards[i]);
                return false;
            }
View Full Code Here

            Expression v = decls[i].getInitialValue();

            if (v == null) {
                env.bind(decls[i].getName(), null);
            } else {
                env.bind(decls[i].getName(), eval.evaluate(v));
            }
        }

        return env;
    }
View Full Code Here

            Expression[] exprs = outputExpr.getExpressions();

            if (repeatExpr == null) {
                for (int j = 0; j < exprs.length; j++) {
                    Expression expr = exprs[j];
                    results.add(eval.evaluate(expr));
                }
            } else {
                int repeatVal = _context.intValue(eval.evaluate(repeatExpr));
                List[] values = new List[exprs.length];
View Full Code Here

                for (int j = 0; j < exprs.length; j++) {
                    Expression expr = exprs[j];
                    results.add(eval.evaluate(expr));
                }
            } else {
                int repeatVal = _context.intValue(eval.evaluate(repeatExpr));
                List[] values = new List[exprs.length];

                for (int j = 0; j < values.length; j++) {
                    values[j] = _context.getList(eval.evaluate(exprs[j]));
                }
View Full Code Here

            } else {
                int repeatVal = _context.intValue(eval.evaluate(repeatExpr));
                List[] values = new List[exprs.length];

                for (int j = 0; j < values.length; j++) {
                    values[j] = _context.getList(eval.evaluate(exprs[j]));
                }

                for (int j = 0; j < repeatVal; j++) {
                    for (int k = 0; k < exprs.length; k++) {
                        results.add(values[k].get(j));
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.