boolean (PsiBuilder builder, boolean pathRequired) { PsiBuilder.Marker path = builder.mark(); boolean nameLocationPath = false; PsiBuilder.Marker expr = builder.mark(); if (parseAxisStep(builder)) { expr.done(XPathElementTypes.STEP); expr = expr.precede(); if (pathRequired) nameLocationPath = true; } else if (!parseFilterExpr(builder)) { expr.drop(); path.drop(); return false; } while (XPathTokenTypes.PATH_OPS.contains(builder.getTokenType())) { if (pathRequired) nameLocationPath = true; makeToken(builder); if (!parseStepExpr(builder)) { builder.error(XPathBundle.message("parsing.error.expression.expected")); } expr.done(XPathElementTypes.STEP); expr = expr.precede(); } expr.drop(); if (nameLocationPath) { path.done(XPathElementTypes.LOCATION_PATH); } else { path.drop(); } return true; }