@Override public XpathForClause visitStep(StepContext ctx) { if (isSimpleXpath) { return super.visitStep(ctx); } boolean foundCoverage = false; String axisSpecifier = ctx.axisSpecifier().getText(); String nodeName = ctx.nodeTest().getText(); if (axisSpecifier.isEmpty()) { // is node switch (nodeName) { case XWCPSReservedWords.COVERAGE: foundCoverage = true; for (PredicateContext predicate : ctx.predicate()) { visit(predicate); } break; case XWCPSReservedWords.SERVER: Where<Coverage> serverWhere = query.expressionFactory(); stack.pushWhereStack(serverWhere); for (PredicateContext predicate : ctx.predicate()) { visit(predicate); } stack.popWhereStack(); WhereBuilder<Coverage> serverWhereBuilder = stack.peekWhereStack().isChildOf(stack.popWhereBuilderStack()); stack.popWhereStack(); stack.pushWhereStack(serverWhereBuilder.and()); break; default: throw new ParseCancellationException( "Expecting an xpath with '" + XWCPSReservedWords.COVERAGE + "' element"); } } if (foundCoverage) { isSimpleXpath = true; } // FIXME return null; }