~ubuntu-branches/ubuntu/utopic/eclipse-wtp/utopic-proposed

« back to all changes in this revision

Viewing changes to org.eclipse.wst.xml.xpath2.processor/src/org/eclipse/wst/xml/xpath2/processor/DefaultEvaluator.java

  • Committer: Package Import Robot
  • Author(s): Jakub Adam
  • Date: 2014-07-10 12:54:39 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20140710125439-ixzeiqepu8m3e1z6
Tags: 3.6.0-1
* New upstream release.
* Refreshed d/patches/debian-custom-build.patch.
* Regenerate CSSTokenizer during build.
* Override codeless-jar warning in eclipse-wtp binary package.
* Override false positive source-is-missing lintian error in bundle
  org.eclipse.wst.jsdt.support.ie.

Show diffs side-by-side

added added

removed removed

Lines of Context:
80
80
import org.eclipse.wst.xml.xpath2.processor.internal.ast.IntegerLiteral;
81
81
import org.eclipse.wst.xml.xpath2.processor.internal.ast.IntersectExpr;
82
82
import org.eclipse.wst.xml.xpath2.processor.internal.ast.ItemType;
83
 
import org.eclipse.wst.xml.xpath2.processor.internal.ast.LetExpr;
84
83
import org.eclipse.wst.xml.xpath2.processor.internal.ast.MinusExpr;
85
84
import org.eclipse.wst.xml.xpath2.processor.internal.ast.ModExpr;
86
85
import org.eclipse.wst.xml.xpath2.processor.internal.ast.MulExpr;
369
368
                return rs;
370
369
        }
371
370
 
372
 
        private void do_let(ListIterator<VarExprPair> iter,
373
 
                        Expr finalexpr, ResultBuffer destination) {
374
 
 
375
 
                // we have more vars to bind...
376
 
                if (iter.hasNext()) {
377
 
                        VarExprPair ve = (VarExprPair) iter.next();
378
 
 
379
 
                        // evaluate binding sequence
380
 
                        ResultSequence rs = (ResultSequence) ve.expr().accept(this);
381
 
 
382
 
                        QName varname = ve.varname();
383
 
 
384
 
                        // for each item of binding sequence, bind the range
385
 
                        // variable and do the expression, concatenating the
386
 
                        // result
387
 
 
388
 
                        pushScope(varname, rs);
389
 
                        do_let(iter, finalexpr, destination);
390
 
                        popScope();
391
 
                        iter.previous();
392
 
                }
393
 
                // we finally got to do the "last expression"
394
 
                else {
395
 
                        destination.concat((ResultSequence) finalexpr.accept(this));
396
 
                }
397
 
        }
398
 
 
399
 
 
400
 
        private void do_for_each(ListIterator<VarExprPair> iter,
 
371
        private void do_for_each(ListIterator iter,
401
372
                        Expr finalexpr, ResultBuffer destination) {
402
373
 
403
374
                // we have more vars to bind...
537
508
        }
538
509
 
539
510
        /**
540
 
         * visit for expression
541
 
         * 
542
 
         * @param fex
543
 
         *            is the for expression.
544
 
         * @return a new function.
545
 
         */
546
 
        public Object visit(LetExpr fex) {
547
 
                List pairs = new ArrayList(fex.ve_pairs());
548
 
                ResultBuffer rb = new ResultBuffer(); 
549
 
                do_let(pairs.listIterator(), fex.expr(), rb);
550
 
                return rb.getSequence();
551
 
        }
552
 
 
553
 
        /**
554
511
         * visit quantified expression
555
512
         * 
556
513
         * @param qex