/** * Looks for a type expression at the current token and if found, * returns it. Note that this method consumes input. * * @param token The current token. * @return The type expression found or null if none. */ Node parseAndRecordTypeNode(JsDocToken token) { return parseAndRecordTypeNode(token, stream.getLineno(), stream.getCharno(), token == JsDocToken.LEFT_CURLY, false); }
/** * Looks for a type expression at the current token and if found, * returns it. Note that this method consumes input. * * @param token The current token. * @return The type expression found or null if none. */ Node parseAndRecordTypeNode(JsDocToken token) { return parseAndRecordTypeNode(token, stream.getLineno(), stream.getCharno(), token == JsDocToken.LEFT_CURLY, false); }
private void recordTypeNode(int lineno, int startCharno, Node typeAst, boolean matchingLC) { if (typeAst != null) { int endLineno = stream.getLineno(); int endCharno = stream.getCharno(); jsdocBuilder.markTypeNode( typeAst, lineno, startCharno, endLineno, endCharno, matchingLC); } }
private void recordTypeNode(int lineno, int startCharno, Node typeAst, boolean matchingLC) { if (typeAst != null) { int endLineno = stream.getLineno(); int endCharno = stream.getCharno(); jsdocBuilder.markTypeNode( typeAst, lineno, startCharno, endLineno, endCharno, matchingLC); } }
private Node reportTypeSyntaxWarning(String warning) { addTypeWarning(warning, stream.getLineno(), stream.getCharno()); return null; }
private void addTypeWarning(String messageId) { addTypeWarning(messageId, stream.getLineno(), stream.getCharno()); }
private Node reportTypeSyntaxWarning(String warning) { addTypeWarning(warning, stream.getLineno(), stream.getCharno()); return null; }
private void addParserWarning(String messageId) { addParserWarning(messageId, stream.getLineno(), stream.getCharno()); }
private void addTypeWarning(String messageId) { addTypeWarning(messageId, stream.getLineno(), stream.getCharno()); }
private Node newStringNode(String s) { return newStringNode(s, stream.getLineno(), stream.getCharno()); }
private void addParserWarning(String messageId, String messageArg) { addParserWarning(messageId, messageArg, stream.getLineno(), stream.getCharno()); }
private void addParserWarning(String messageId) { addParserWarning(messageId, stream.getLineno(), stream.getCharno()); }
private Node newStringNode(String s) { return newStringNode(s, stream.getLineno(), stream.getCharno()); }
private void addTypeWarning(String messageId, String messageArg) { addTypeWarning(messageId, messageArg, stream.getLineno(), stream.getCharno()); }
private void addParserWarning(String messageId, String messageArg) { addParserWarning(messageId, messageArg, stream.getLineno(), stream.getCharno()); }
private void addTypeWarning(String messageId, String messageArg) { addTypeWarning(messageId, messageArg, stream.getLineno(), stream.getCharno()); }
private Node newNode(Token type) { return new Node(type, stream.getLineno(), stream.getCharno()).clonePropsFrom(templateNode); }
private Node newNode(int type) { return new Node(type, stream.getLineno(), stream.getCharno()).clonePropsFrom(templateNode); }
/** * FieldName := NameExpression | StringLiteral | NumberLiteral | * ReservedIdentifier */ private Node parseFieldName(JsDocToken token) { switch (token) { case STRING: String s = stream.getString(); Node n = Node.newString( Token.STRING_KEY, s, stream.getLineno(), stream.getCharno()) .clonePropsFrom(templateNode); n.setLength(s.length()); return n; default: return null; } }
private Node parseNameExpression(JsDocToken token) { if (token != JsDocToken.STRING) { return reportGenericTypeSyntaxWarning(); } String typeName = stream.getString(); int lineno = stream.getLineno(); int charno = stream.getCharno(); while (match(JsDocToken.EOL) && typeName.charAt(typeName.length() - 1) == '.') { skipEOLs(); if (match(JsDocToken.STRING)) { next(); typeName += stream.getString(); } } return newStringNode(typeName, lineno, charno); }