Search in sources :

Example 1 with CastableExpr

use of org.eclipse.wst.xml.xpath2.processor.internal.ast.CastableExpr in project webtools.sourceediting by eclipse.

the class DefaultEvaluator method visit.

/**
 * visit castable expression
 *
 * @param cexp
 *            is the castable expression.
 * @return a new function
 */
public Object visit(CastableExpr cexp) {
    boolean castable = false;
    try {
        CastExpr ce = new CastExpr((Expr) cexp.left(), (SingleType) cexp.right());
        visit(ce);
        castable = true;
    } catch (Throwable t) {
        castable = false;
    }
    return ResultSequenceFactory.create_new(new XSBoolean(castable));
}
Also used : XSBoolean(org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean) CastExpr(org.eclipse.wst.xml.xpath2.processor.internal.ast.CastExpr)

Aggregations

CastExpr (org.eclipse.wst.xml.xpath2.processor.internal.ast.CastExpr)1 XSBoolean (org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean)1