if (xpathdebug) { Log.write('about to run ' + cand.rule[3].toString()); } 
function xpathReduce(stack, ahead) {  var cand = null;  if (stack.length > 0) {    var top = stack[stack.length-1];    var ruleset = xpathRules[top.tag.key];    if (ruleset) {      for (var i = 0; i < ruleset.length; ++i) {        var rule = ruleset[i];        var match = xpathMatchStack(stack, rule[1]);        if (match.length) {          cand = {            tag: rule[0],            rule: rule,            match: match          };          cand.prec = xpathGrammarPrecedence(cand);          break;        }      }    }  }  var ret;  if (cand && (!ahead || cand.prec > ahead.prec ||                (ahead.tag.left && cand.prec >= ahead.prec))) {    for (var i = 0; i < cand.match.matchlength; ++i) {      stack.pop();    }    if (xpathdebug) {      Log.write('reduce ' + cand.tag.label + ' ' + cand.prec +                ' ahead ' + (ahead ? ahead.tag.label + ' ' + ahead.prec +                              (ahead.tag.left ? ' left' : '')                             : ' none '));    }    var matchexpr = mapExpr(cand.match, function(m) { return m.expr; });    cand.expr = cand.rule[3].apply(null, matchexpr);    stack.push(cand);    ret = true;  } else {    if (ahead) {      if (xpathdebug) {        Log.write('shift ' + ahead.tag.label + ' ' + ahead.prec +                   (ahead.tag.left ? ' left' : '') +                  ' over ' + (cand ? cand.tag.label + ' ' +                               cand.prec : ' none'));      }      stack.push(ahead);    }    ret = false;  }  return ret;}
4983	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/4983/5b7d0f445e4aa79f03d8ed4259e14bef5795cc5e/xpath.js/buggy/src/main/resources/core/xpath/xpath.js