boolean (PsiBuilder builder) { final PsiBuilder.Marker mark = builder.mark(); checkMatches(builder, XPath2TokenTypes.IF, XPathBundle.message("parsing.error.if.expected")); checkMatches(builder, XPathTokenTypes.LPAREN, XPathBundle.message("parsing.error.opening.parenthesis.expected")); if (!parseExpr(builder)) { builder.error(XPathBundle.message("parsing.error.expression.expected")); } checkMatches(builder, XPathTokenTypes.RPAREN, XPathBundle.message("parsing.error.closing.parenthesis.expected")); checkMatches(builder, XPath2TokenTypes.THEN, XPathBundle.message("parsing.error.then.expected")); if (!parseExprSingle(builder)) { builder.error(XPathBundle.message("parsing.error.expression.expected")); } checkMatches(builder, XPath2TokenTypes.ELSE, XPathBundle.message("parsing.error.else.expected")); if (!parseExprSingle(builder)) { builder.error(XPathBundle.message("parsing.error.expression.expected")); } mark.done(XPath2ElementTypes.IF); return true; }