Class JsDocInfoParser
java.lang.Object
com.google.javascript.jscomp.parsing.JsDocInfoParser
A parser for JSDoc comments.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
How to handle unexpected JSDoc format -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJsDocInfoParser
(JsDocTokenStream stream, String comment, int commentPosition, @Nullable Node templateNode, Config config, JsDocInfoParser.JsDocSourceKind jsDocSourceKind, ErrorReporter errorReporter) -
Method Summary
Modifier and TypeMethodDescriptionboolean
parse()
Parses aJSDocInfo
object.static JSDocInfo
parseFileOverviewJsdoc
(String toParse) @Nullable JSDocInfo
Parse a description as a@type
.static JSDocInfo
parseJsdoc
(String toParse) Parses a string containing a JsDoc declaration, returning the entire JSDocInfo if the parsing succeeded ornull
if it failed.static Node
parseTypeString
(String typeString) Parses a string containing a JsDoc type declaration, returning the type if the parsing succeeded ornull
if it failed.
-
Field Details
-
BAD_TYPE_WIKI_LINK
- See Also:
-
-
Constructor Details
-
JsDocInfoParser
public JsDocInfoParser(JsDocTokenStream stream, String comment, int commentPosition, @Nullable Node templateNode, Config config, JsDocInfoParser.JsDocSourceKind jsDocSourceKind, ErrorReporter errorReporter)
-
-
Method Details
-
getSourceFile
-
parseInlineTypeDoc
Parse a description as a@type
. -
parseTypeString
Parses a string containing a JsDoc type declaration, returning the type if the parsing succeeded ornull
if it failed. -
parseJsdoc
Parses a string containing a JsDoc declaration, returning the entire JSDocInfo if the parsing succeeded ornull
if it failed. -
parseFileOverviewJsdoc
-
parse
public boolean parse()Parses aJSDocInfo
object. This parsing method reads all tokens returned by theJsDocTokenStream.getJsDocToken()
method until theJsDocToken.EOC
is returned.- Returns:
true
if JSDoc information was correctly parsed,false
otherwise
-
retrieveAndResetParsedJSDocInfo
-