List<JCTree> parseParams(String s) throws ParseException { if (s.trim().isEmpty()) return List.nil(); JavacParser p = fac.newParser(s.replace("...", "[]"), false, false, false); ListBuffer<JCTree> paramTypes = new ListBuffer<JCTree>(); paramTypes.add(p.parseType()); if (p.token().kind == TokenKind.IDENTIFIER) p.nextToken(); while (p.token().kind == TokenKind.COMMA) { p.nextToken(); paramTypes.add(p.parseType()); if (p.token().kind == TokenKind.IDENTIFIER) p.nextToken(); } if (p.token().kind != TokenKind.EOF) throw new ParseException("dc.ref.unexpected.input"); return paramTypes.toList(); }
List<JCTree> parseParams(String s) throws ParseException { if (s.trim().isEmpty()) return List.nil(); JavacParser p = fac.newParser(s.replace("...", "[]"), false, false, false); ListBuffer<JCTree> paramTypes = new ListBuffer<JCTree>(); paramTypes.add(p.parseType()); if (p.token().kind == TokenKind.IDENTIFIER) p.nextToken(); while (p.token().kind == TokenKind.COMMA) { p.nextToken(); paramTypes.add(p.parseType()); if (p.token().kind == TokenKind.IDENTIFIER) p.nextToken(); } if (p.token().kind != TokenKind.EOF) throw new ParseException("dc.ref.unexpected.input"); return paramTypes.toList(); }
throw new ParseException("dc.unterminated.inline.tag");
throw new ParseException("dc.unterminated.inline.tag");
throw new ParseException("dc.no.content"); break; throw new ParseException("dc.no.content"); break; throw new ParseException("dc.unexpected.content");
throw new ParseException("dc.no.content"); break; throw new ParseException("dc.no.content"); break; throw new ParseException("dc.unexpected.content");
public DCTree parse(int pos) throws ParseException { skipWhitespace(); boolean typaram = false; if (ch == '<') { typaram = true; nextChar(); } DCIdentifier id = identifier(); if (typaram) { if (ch != '>') throw new ParseException("dc.gt.expected"); nextChar(); } skipWhitespace(); List<DCTree> desc = blockContent(); return m.at(pos).Param(typaram, id, desc); } },
public DCTree parse(int pos) throws ParseException { skipWhitespace(); boolean typaram = false; if (ch == '<') { typaram = true; nextChar(); } DCIdentifier id = identifier(); if (typaram) { if (ch != '>') throw new ParseException("dc.gt.expected"); nextChar(); } skipWhitespace(); List<DCTree> desc = blockContent(); return m.at(pos).Param(typaram, id, desc); } },
/** * Read Java identifier * Matching pairs of { } are skipped; the text is terminated by the first * unmatched }. It is an error if the beginning of the next tag is detected. */ @SuppressWarnings("fallthrough") protected DCIdentifier identifier() throws ParseException { skipWhitespace(); int pos = bp; if (isJavaIdentifierStart(ch)) { Name name = readJavaIdentifier(); return m.at(pos).Identifier(name); } throw new ParseException("dc.identifier.expected"); }
/** * Read Java identifier * Matching pairs of { } are skipped; the text is terminated by the first * unmatched }. It is an error if the beginning of the next tag is detected. */ @SuppressWarnings("fallthrough") protected DCIdentifier identifier() throws ParseException { skipWhitespace(); int pos = bp; if (isJavaIdentifierStart(ch)) { Name name = readJavaIdentifier(); return m.at(pos).Identifier(name); } throw new ParseException("dc.identifier.expected"); }
public DCTree parse(int pos) throws ParseException { DCReference ref = reference(true); skipWhitespace(); if (ch == '}') { nextChar(); return m.at(pos).Value(ref); } nextChar(); throw new ParseException("dc.unexpected.content"); } },
public DCTree parse(int pos) throws ParseException { if (ch == '}') { nextChar(); return m.at(pos).DocRoot(); } inlineText(); // skip unexpected content nextChar(); throw new ParseException("dc.unexpected.content"); } },
public DCTree parse(int pos) throws ParseException { if (ch == '}') { nextChar(); return m.at(pos).InheritDoc(); } inlineText(); // skip unexpected content nextChar(); throw new ParseException("dc.unexpected.content"); } },
JCTree parseType(String s) throws ParseException { JavacParser p = fac.newParser(s, false, false, false); JCTree tree = p.parseType(); if (p.token().kind != TokenKind.EOF) throw new ParseException("dc.ref.unexpected.input"); return tree; }
public DCTree parse(int pos) throws ParseException { DCReference ref = reference(true); skipWhitespace(); if (ch == '}') { nextChar(); return m.at(pos).Value(ref); } nextChar(); throw new ParseException("dc.unexpected.content"); } },
public DCTree parse(int pos) throws ParseException { if (ch == '}') { nextChar(); return m.at(pos).DocRoot(); } inlineText(); // skip unexpected content nextChar(); throw new ParseException("dc.unexpected.content"); } },
Name parseMember(String s) throws ParseException { JavacParser p = fac.newParser(s, false, false, false); Name name = p.ident(); if (p.token().kind != TokenKind.EOF) throw new ParseException("dc.ref.unexpected.input"); return name; }
JCTree parseType(String s) throws ParseException { JavacParser p = fac.newParser(s, false, false, false); JCTree tree = p.parseType(); if (p.token().kind != TokenKind.EOF) throw new ParseException("dc.ref.unexpected.input"); return tree; }
public DCTree parse(int pos) throws ParseException { if (ch == '}') { nextChar(); return m.at(pos).InheritDoc(); } inlineText(); // skip unexpected content nextChar(); throw new ParseException("dc.unexpected.content"); } },
Name parseMember(String s) throws ParseException { JavacParser p = fac.newParser(s, false, false, false); Name name = p.ident(); if (p.token().kind != TokenKind.EOF) throw new ParseException("dc.ref.unexpected.input"); return name; }