Java Code Examples for kodkod.ast.IntToExprCast#intExpr()
The following examples show how to use
kodkod.ast.IntToExprCast#intExpr() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PartialCannonicalizer.java From quetzal with Eclipse Public License 2.0 | 6 votes |
public Expression visit(IntToExprCast expr) { Expression ret = lookup(expr); if (ret!=null) return ret; final IntCastOperator op = expr.op(); final IntExpression child = expr.intExpr().accept(this); final int hash = hash(op, child); for(Iterator<PartialCannonicalizer.Holder<Expression>> itr = exprs.get(hash); itr.hasNext(); ) { final Expression next = itr.next().obj; if (next.getClass()==IntToExprCast.class) { if (((IntToExprCast)next).intExpr()==child) return cache(expr, next); } } ret = child==expr.intExpr() ? expr : child.cast(op); exprs.add(new PartialCannonicalizer.Holder<Expression>(ret, hash)); return cache(expr,ret); }
Example 2
Source File: AbstractReplacer.java From org.alloytools.alloy with Apache License 2.0 | 5 votes |
/** * Calls lookup(castExpr) and returns the cached value, if any. If a replacement * has not been cached, visits the expression's child. If nothing changes, the * argument is cached and returned, otherwise a replacement expression is cached * and returned. * * @return { e: Expression | e = * castExpr.intExpr.accept(delegate).toExpression() } */ @Override public Expression visit(IntToExprCast castExpr) { Expression ret = lookup(castExpr); if (ret != null) return ret; final IntExpression intExpr = castExpr.intExpr().accept(delegate); ret = (intExpr == castExpr.intExpr()) ? castExpr : intExpr.cast(castExpr.op()); return cache(castExpr, ret); }
Example 3
Source File: AbstractReplacer.java From kodkod with MIT License | 5 votes |
/** * Calls lookup(castExpr) and returns the cached value, if any. If a replacement * has not been cached, visits the expression's child. If nothing changes, the argument * is cached and returned, otherwise a replacement expression is cached and returned. * @return { e: Expression | e = castExpr.intExpr.accept(this).toExpression() } */ public Expression visit(IntToExprCast castExpr) { Expression ret = lookup(castExpr); if (ret!=null) return ret; final IntExpression intExpr = castExpr.intExpr().accept(this); ret = (intExpr==castExpr.intExpr()) ? castExpr : intExpr.cast(castExpr.op()); return cache(castExpr, ret); }