use of org.eclipse.wst.xml.xpath2.processor.internal.ast.BinExpr in project webtools.sourceediting by eclipse.
the class DefaultEvaluator method do_bin_args.
private Collection do_bin_args(BinExpr e) {
ResultSequence one = (ResultSequence) e.left().accept(this);
ResultSequence two = (ResultSequence) e.right().accept(this);
Collection args = new ArrayList();
args.add(one);
args.add(two);
return args;
}
use of org.eclipse.wst.xml.xpath2.processor.internal.ast.BinExpr in project webtools.sourceediting by eclipse.
the class DefaultEvaluator method do_logic_exp.
private boolean[] do_logic_exp(BinExpr e) {
Collection args = do_bin_args(e);
Iterator argiter = args.iterator();
ResultSequence one = (ResultSequence) argiter.next();
ResultSequence two = (ResultSequence) argiter.next();
boolean oneb = effective_boolean_value(one).value();
boolean twob = effective_boolean_value(two).value();
boolean[] res = { oneb, twob };
return res;
}
use of org.eclipse.wst.xml.xpath2.processor.internal.ast.BinExpr in project webtools.sourceediting by eclipse.
the class Normalizer method make_convert_binop.
// fs:fname( fs:convert-operand( fn:data(ARG1), 1.0E0 ),
// fs:convert-operand( fn:data(ARG2), 1.0E0 )
// )
private XPathExpr make_convert_binop(BinExpr e, XPathExpr convarg, QName name) {
Collection args = normalize_bin_args(e);
XPathExpr[] args_arr = new XPathExpr[2];
int j = 0;
for (Iterator i = args.iterator(); i.hasNext(); ) {
args_arr[j] = (XPathExpr) i.next();
j++;
}
Collection argsfname = new ArrayList();
for (j = 0; j < 2; j++) {
XPathExpr arg = make_convert_operand(args_arr[j], convarg);
argsfname.add(arg);
}
return make_function(name, argsfname);
}
use of org.eclipse.wst.xml.xpath2.processor.internal.ast.BinExpr 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;
}
use of org.eclipse.wst.xml.xpath2.processor.internal.ast.BinExpr 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;
}
Aggregations