本文整理汇总了Java中kodkod.ast.IntToExprCast.intExpr方法的典型用法代码示例。如果您正苦于以下问题:Java IntToExprCast.intExpr方法的具体用法?Java IntToExprCast.intExpr怎么用?Java IntToExprCast.intExpr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kodkod.ast.IntToExprCast
的用法示例。
在下文中一共展示了IntToExprCast.intExpr方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import kodkod.ast.IntToExprCast; //导入方法依赖的package包/类
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);
}
示例2: visit
import kodkod.ast.IntToExprCast; //导入方法依赖的package包/类
/**
* 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() }
*/
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);
}
示例3: visit
import kodkod.ast.IntToExprCast; //导入方法依赖的package包/类
/**
* 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);
}