Search in sources :

Example 1 with XPathNode

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

the class Normalizer method make_logic_expr.

private BinExpr make_logic_expr(BinExpr e) {
    Collection normalized = normalize_bin_args(e);
    XPathNode[] nor_arr = new XPathNode[2];
    int j = 0;
    for (Iterator i = normalized.iterator(); i.hasNext(); ) {
        nor_arr[j] = (XPathNode) i.next();
        j++;
    }
    Collection args = new ArrayList();
    args.add(nor_arr[0]);
    e.set_left(make_function(new QName("fn", "boolean", FnFunctionLibrary.XPATH_FUNCTIONS_NS), args));
    args.clear();
    args.add(nor_arr[1]);
    e.set_right(make_function(new QName("fn", "boolean", FnFunctionLibrary.XPATH_FUNCTIONS_NS), args));
    return e;
}
Also used : QName(org.eclipse.wst.xml.xpath2.processor.internal.types.QName) Iterator(java.util.Iterator) ArrayList(java.util.ArrayList) Collection(java.util.Collection) XPathNode(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathNode)

Example 2 with XPathNode

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

the class Normalizer method normalize_bin_args.

private Collection normalize_bin_args(BinExpr e) {
    Collection args = new ArrayList();
    XPathNode left = (XPathNode) e.left().accept(this);
    XPathNode right = (XPathNode) e.right().accept(this);
    args.add(left);
    args.add(right);
    return args;
}
Also used : ArrayList(java.util.ArrayList) Collection(java.util.Collection) XPathNode(org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathNode)

Aggregations

ArrayList (java.util.ArrayList)2 Collection (java.util.Collection)2 XPathNode (org.eclipse.wst.xml.xpath2.processor.internal.ast.XPathNode)2 Iterator (java.util.Iterator)1 QName (org.eclipse.wst.xml.xpath2.processor.internal.types.QName)1