class_body
{ "{"
field_declaration
modifiers
private "private"
final "final"
type_identifier "JsDocTokenStream"
variable_declarator
identifier "stream"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "JSDocInfoBuilder"
variable_declarator
identifier "jsdocBuilder"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "StaticSourceFile"
variable_declarator
identifier "sourceFile"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "Node"
variable_declarator
identifier "associatedNode"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "ErrorReporter"
variable_declarator
identifier "errorReporter"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "ErrorReporterParser"
variable_declarator
identifier "parser"
= "="
object_creation_expression
new "new"
type_identifier "ErrorReporterParser"
argument_list
( "("
) ")"
; ";"
line_comment "// Use a template node for properties set on all nodes to mi"...
line_comment "// memory footprint associated with these (similar to IRFact"...
field_declaration
modifiers
private "private"
final "final"
type_identifier "Node"
variable_declarator
identifier "templateNode"
; ";"
class_declaration (+236 nodes collapsed)
line_comment "// The DocInfo with the fileoverview tag for the whole file."
field_declaration
modifiers
private "private"
type_identifier "JSDocInfo"
variable_declarator
identifier "fileOverviewJSDocInfo"
= "="
null_literal "null"
; ";"
field_declaration
modifiers
private "private"
type_identifier "State"
variable_declarator
identifier "state"
; ";"
field_declaration
modifiers
private "private"
final "final"
generic_type
type_identifier "Map"
type_arguments
< "<"
type_identifier "String"
, ","
type_identifier "Annotation"
> ">"
variable_declarator
identifier "annotationNames"
; ";"
field_declaration
modifiers
private "private"
final "final"
generic_type
type_identifier "Set"
type_arguments
< "<"
type_identifier "String"
> ">"
variable_declarator
identifier "suppressionNames"
; ";"
field_declaration (+35 nodes collapsed)
field_declaration
modifiers
private "private"
scoped_type_identifier
type_identifier "Node"
. "."
type_identifier "FileLevelJsDocBuilder"
variable_declarator
identifier "fileLevelJsDocBuilder"
; ";"
block_comment "/**\n * Sets the JsDocBuilder for the file-level (root) nod"...
method_declaration (+24 nodes collapsed)
block_comment "/**\n * Sets the file overview JSDocInfo, in order to warn "...
method_declaration (+21 nodes collapsed)
enum_declaration
modifiers
private "private"
enum "enum"
identifier "State"
enum_body
{ "{"
enum_constant
identifier "SEARCHING_ANNOTATION"
, ","
enum_constant
identifier "SEARCHING_NEWLINE"
, ","
enum_constant
identifier "NEXT_IS_ANNOTATION"
} "}"
constructor_declaration (+166 nodes collapsed)
method_declaration (+29 nodes collapsed)
method_declaration (+73 nodes collapsed)
block_comment "/**\n * Parses a string containing a JsDoc type declaration"...
method_declaration (+109 nodes collapsed)
block_comment "/**\n * Parses a {@link JSDocInfo} object. This parsing met"...
method_declaration (+5966 nodes collapsed)
method_declaration (+138 nodes collapsed)
block_comment "/**\n * Parse a {@code @suppress} tag of the form\n * {@co"...
method_declaration (+349 nodes collapsed)
block_comment "/**\n * Parse a {@code @modifies} tag of the form\n * {@co"...
method_declaration (+361 nodes collapsed)
block_comment "/**\n * Looks for a type expression at the current token an"...
method_declaration (+29 nodes collapsed)
block_comment "/**\n * Looks for a type expression at the current token an"...
method_declaration (+47 nodes collapsed)
block_comment "/**\n * Looks for a type expression at the current token an"...
method_declaration (+45 nodes collapsed)
block_comment "/**\n * Looks for a type expression at the current token an"...
method_declaration (+134 nodes collapsed)
block_comment "/**\n * Looks for a parameter type expression at the curren"...
method_declaration (+138 nodes collapsed)
block_comment "/**\n * Converts a JSDoc token to its string representation"...
method_declaration (+271 nodes collapsed)
block_comment "/**\n * Constructs a new {@code JSTypeExpression}.\n * @pa"...
method_declaration (+36 nodes collapsed)
block_comment "/**\n * Tuple for returning both the string extracted and t"...
class_declaration (+60 nodes collapsed)
block_comment "/**\n * Tuple for recording extended types\n */"
class_declaration (+82 nodes collapsed)
block_comment "/**\n * Extracts the text found on the current line startin"...
method_declaration (+131 nodes collapsed)
method_declaration (+28 nodes collapsed)
enum_declaration
modifiers
private "private"
enum "enum"
identifier "WhitespaceOption"
enum_body
{ "{"
block_comment "/**\n * Preserves all whitespace and formatting. Needed f"...
enum_constant
identifier "PRESERVE"
, ","
block_comment "/** Preserves newlines but trims the output. */"
enum_constant
identifier "TRIM"
, ","
block_comment "/** Removes newlines and turns the output into a single line"...
enum_constant
identifier "SINGLE_LINE"
} "}"
block_comment "/**\n * Extracts the text found on the current line and all"...
method_declaration (+767 nodes collapsed)
block_comment "/**\n * Extracts the top-level block comment from the JsDoc"...
method_declaration (+293 nodes collapsed)
block_comment "/**\n * Trim characters from only the end of a string.\n *"...
method_declaration (+134 nodes collapsed)
line_comment "// Based on ES4 grammar proposed on July 10, 2008."
line_comment "// http://wiki.ecmascript.org/doku.php?id=spec:spec"
line_comment "// Deliberately written to line up with the actual grammar r"...
line_comment "// for maximum flexibility."
line_comment "// TODO(nicksantos): The current implementation tries to mai"...
line_comment "// compatibility with previous versions of the spec whenever"...
line_comment "// We should try to gradually withdraw support for these."
block_comment "/**\n * TypeExpressionAnnotation := TypeExpression |\n * "...
method_declaration (+129 nodes collapsed)
block_comment "/**\n * ParamTypeExpressionAnnotation :=\n * '{' Optio"...
method_declaration (+270 nodes collapsed)
block_comment "/**\n * TypeNameAnnotation := TypeName | '{' TypeName '}'\n "...
method_declaration (+129 nodes collapsed)
block_comment "/**\n * TopLevelTypeExpression := TypeExpression\n * |"...
method_declaration (+120 nodes collapsed)
block_comment "/**\n * TypeExpressionList := TopLevelTypeExpression\n * "...
method_declaration (+141 nodes collapsed)
block_comment "/**\n * TypeExpression := BasicTypeExpression\n * | '?"...
method_declaration (+307 nodes collapsed)
block_comment "/**\n * BasicTypeExpression := '*' | 'null' | 'undefined' |"...
method_declaration (+288 nodes collapsed)
block_comment "/**\n * TypeName := NameExpression | NameExpression TypeApp"...
method_declaration (+294 nodes collapsed)
block_comment "/**\n * FunctionType := 'function' FunctionSignatureType\n "...
method_declaration (+501 nodes collapsed)
block_comment "/**\n * ParametersType := RestParameterType | NonRestParame"...
line_comment "// NOTE(nicksantos): The official ES4 grammar forces optiona"...
line_comment "// arguments to come after the required arguments. Our parse"...
line_comment "// enforce this. Instead we allow them anywhere in the funct"...
line_comment "// and then warn about them during type resolution."
line_comment "//"
line_comment "// In theory, it might be mathematically nicer to do the ord"...
line_comment "// But in practice, the order-checking for structural functi"...
line_comment "// the same as the order-checking for @param annotations. An"...
line_comment "// has to happen during type resolution. Rather than duplica"...
line_comment "// order-checking in two places, we just do all of it in typ"...
method_declaration (+446 nodes collapsed)
block_comment "/**\n * ResultType := <empty> | ':' void | ':' TypeExpressi"...
method_declaration (+141 nodes collapsed)
block_comment "/**\n * UnionType := '(' TypeUnionList ')'\n * TypeUnionLi"...
method_declaration (+25 nodes collapsed)
block_comment "/**\n * Create a new union type, with an alternate that has"...
method_declaration (+297 nodes collapsed)
block_comment "/**\n * ArrayType := '[' ElementTypeList ']'\n * ElementTy"...
method_declaration (+246 nodes collapsed)
block_comment "/**\n * RecordType := '{' FieldTypeList '}'\n */"
method_declaration (+120 nodes collapsed)
block_comment "/**\n * FieldTypeList := FieldType | FieldType ',' FieldTyp"...
method_declaration (+137 nodes collapsed)
block_comment "/**\n * FieldType := FieldName | FieldName ':' TypeExpressi"...
method_declaration (+160 nodes collapsed)
block_comment "/**\n * FieldName := NameExpression | StringLiteral | Numbe"...
method_declaration (+58 nodes collapsed)
method_declaration (+62 nodes collapsed)
method_declaration (+48 nodes collapsed)
method_declaration (+39 nodes collapsed)
method_declaration (+69 nodes collapsed)
line_comment "// This is similar to IRFactory.createTemplateNode to share "...
line_comment "// e.g., source-name, between all nodes."
method_declaration (+59 nodes collapsed)
method_declaration (+44 nodes collapsed)
method_declaration (+23 nodes collapsed)
block_comment "/**\n * Eats tokens until {@link JsDocToken#EOL} included, "...
method_declaration (+24 nodes collapsed)
block_comment "/**\n * Eats tokens until {@link JsDocToken#EOL} included, "...
method_declaration (+81 nodes collapsed)
block_comment "/**\n * Specific value indicating that the {@link #unreadTo"...
field_declaration
modifiers
private "private"
static "static"
final "final"
type_identifier "JsDocToken"
variable_declarator
identifier "NO_UNREAD_TOKEN"
= "="
null_literal "null"
; ";"
block_comment "/**\n * One token buffer.\n */"
field_declaration
modifiers
private "private"
type_identifier "JsDocToken"
variable_declarator
identifier "unreadToken"
= "="
identifier "NO_UNREAD_TOKEN"
; ";"
block_comment "/** Restores the lookahead token to the token stream */"
method_declaration
modifiers
private "private"
void_type "void"
identifier "restoreLookAhead"
formal_parameters
( "("
formal_parameter
type_identifier "JsDocToken"
identifier "token"
) ")"
block
{ "{"
expression_statement
assignment_expression
identifier "unreadToken"
= "="
identifier "token"
; ";"
} "}"
block_comment "/**\n * Tests whether the next symbol of the token stream m"...
method_declaration (+31 nodes collapsed)
block_comment "/**\n * Tests that the next symbol of the token stream matc"...
method_declaration (+41 nodes collapsed)
block_comment "/**\n * Gets the next token of the token stream or the buff"...
method_declaration (+45 nodes collapsed)
block_comment "/**\n * Gets the current token, invalidating it in the proc"...
method_declaration (+28 nodes collapsed)
block_comment "/**\n * Skips all EOLs and all empty lines in the JSDoc. Ca"...
method_declaration (+59 nodes collapsed)
block_comment "/**\n * Returns the remainder of the line.\n */"
method_declaration
modifiers
private "private"
type_identifier "String"
identifier "getRemainingJSDocLine"
formal_parameters
( "("
) ")"
block
{ "{"
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "result"
= "="
method_invocation
identifier "stream"
. "."
identifier "getRemainingJSDocLine"
argument_list
( "("
) ")"
; ";"
return_statement
return "return"
identifier "result"
; ";"
} "}"
block_comment "/**\n * Determines whether the parser has been populated wi"...
method_declaration (+21 nodes collapsed)
method_declaration
boolean_type "boolean"
identifier "hasParsedJSDocInfo"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
method_invocation
identifier "jsdocBuilder"
. "."
identifier "isPopulated"
argument_list
( "("
) ")"
; ";"
} "}"
method_declaration
type_identifier "JSDocInfo"
identifier "retrieveAndResetParsedJSDocInfo"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
method_invocation
identifier "jsdocBuilder"
. "."
identifier "build"
argument_list
( "("
identifier "associatedNode"
) ")"
; ";"
} "}"
block_comment "/**\n * Gets the fileoverview JSDocInfo, if any.\n */"
method_declaration
type_identifier "JSDocInfo"
identifier "getFileOverviewJSDocInfo"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "fileOverviewJSDocInfo"
; ";"
} "}"
block_comment "/**\n * Look ahead for a type annotation by advancing the c"...
method_declaration (+103 nodes collapsed)
} "}"