/** * Copy an expression. This makes a deep copy. * * @return the copy of the original expression * @param rebindings variables that need to be re-bound */ /*@NotNull*/ public Expression copy(RebindingMap rebindings) { AtomicSequenceConverter atomicConverter = new AtomicSequenceConverter(getBaseExpression().copy(rebindings), requiredItemType); ExpressionTool.copyLocationInfo(this, atomicConverter); atomicConverter.setConverter(converter); atomicConverter.setRoleDiagnostic(getRoleDiagnostic()); return atomicConverter; }
/** * Copy an expression. This makes a deep copy. * * @return the copy of the original expression * @param rebindings variables that need to be re-bound */ /*@NotNull*/ public Expression copy(RebindingMap rebindings) { AtomicSequenceConverter atomicConverter = new AtomicSequenceConverter(getBaseExpression().copy(rebindings), requiredItemType); ExpressionTool.copyLocationInfo(this, atomicConverter); atomicConverter.setConverter(converter); atomicConverter.setRoleDiagnostic(getRoleDiagnostic()); return atomicConverter; }
private static Expression makePromoter(Expression exp, Converter converter, BuiltInAtomicType type) { ConversionRules rules = exp.getConfiguration().getConversionRules(); converter.setConversionRules(rules); if (exp instanceof Literal && ((Literal) exp).getValue() instanceof AtomicValue) { ConversionResult result = converter.convert((AtomicValue) ((Literal) exp).getValue()); if (result instanceof AtomicValue) { Literal converted = Literal.makeLiteral((AtomicValue) result, exp); ExpressionTool.copyLocationInfo(exp, converted); return converted; } } AtomicSequenceConverter asc = new AtomicSequenceConverter(exp, type); asc.setConverter(converter); ExpressionTool.copyLocationInfo(exp, asc); return asc; }
private static Expression makePromoter(Expression exp, Converter converter, BuiltInAtomicType type) { ConversionRules rules = exp.getConfiguration().getConversionRules(); converter.setConversionRules(rules); if (exp instanceof Literal && ((Literal) exp).getValue() instanceof AtomicValue) { ConversionResult result = converter.convert((AtomicValue) ((Literal) exp).getValue()); if (result instanceof AtomicValue) { Literal converted = Literal.makeLiteral((AtomicValue) result, exp); ExpressionTool.copyLocationInfo(exp, converted); return converted; } } AtomicSequenceConverter asc = new AtomicSequenceConverter(exp, type); asc.setConverter(converter); ExpressionTool.copyLocationInfo(exp, asc); return asc; }