This mapping has 3 all-to-all groups: every node on one side corresponds to every node on the other, and none is deleted or inserted. Each member carries an all N:M badge; selecting one highlights all of its counterparts, in the tree and in the code view alike.

Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

…lines 1–1901 unchanged (1901 lines)
1902
1903 /**
1904 * ContextTypeExpression := BasicTypeExpression | '?'
1905 * For expressions on the right hand side of a this: or new:
1906 */
1907 private Node parseContextTypeExpression(JsDocToken token) {
1908 return parseTypeName(token);
1909 }
1910
1911 /**
1912 * BasicTypeExpression := '*' | 'null' | 'undefined' | TypeName
1913 * | FunctionType | UnionType | RecordType | ArrayType
1914 */
…lines 1915–2580 unchanged (666 lines)

After

…lines 1–1901 unchanged (1901 lines)
1902
1903 /**
1904 * ContextTypeExpression := BasicTypeExpression | '?'
1905 * For expressions on the right hand side of a this: or new:
1906 */
1907 private Node parseContextTypeExpression(JsDocToken token) {
1908 if (token == JsDocToken.QMARK) {
1909 return newNode(Token.QMARK);
1910 } else {
1911 return parseBasicTypeExpression(token);
1912 }
1913 }
1914
1915 /**
1916 * BasicTypeExpression := '*' | 'null' | 'undefined' | TypeName
1917 * | FunctionType | UnionType | RecordType | ArrayType
1918 */
…lines 1919–2584 unchanged (666 lines)

Before

program
block_comment "/*\n * Copyright 2007 The Closure Compiler Authors.\n *\n * Lic"...
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "parsing"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "base"
. "."
identifier "Preconditions"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "base"
. "."
identifier "Splitter"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "collect"
. "."
identifier "ImmutableSet"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "collect"
. "."
identifier "Lists"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "collect"
. "."
identifier "Sets"
; ";"
import_declaration (+22 nodes collapsed)
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "IR"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "JSDocInfo"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "JSDocInfo"
. "."
identifier "Visibility"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "JSDocInfoBuilder"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "JSTypeExpression"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "Node"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "SimpleErrorReporter"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "Token"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "head"
. "."
identifier "ErrorReporter"
; ";"
import_declaration (+22 nodes collapsed)
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "jstype"
. "."
identifier "StaticSourceFile"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "HashSet"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "List"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Map"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Set"
; ";"
block_comment "/**\n * A parser for JSDoc comments.\n *\n */"
line_comment "// TODO(nicksantos): Unify all the JSDocInfo stuff into one "...
line_comment "// spreading it across multiple packages."
class_declaration
modifiers
public "public"
final "final"
class "class"
identifier "JsDocInfoParser"
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 (+45 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 (+185 nodes collapsed)
method_declaration (+29 nodes collapsed)
block_comment "/**\n * Parse a description as a {@code @type}.\n */"
method_declaration (+135 nodes collapsed)
method_declaration (+88 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 (+169 nodes collapsed)
method_declaration (+303 nodes collapsed)
method_declaration (+5715 nodes collapsed)
block_comment "/**\n * Records a marker's description if there is one avai"...
method_declaration (+70 nodes collapsed)
method_declaration (+138 nodes collapsed)
block_comment "/**\n * Parse a {@code @suppress} tag of the form\n * {@co"...
method_declaration (+354 nodes collapsed)
block_comment "/**\n * Parse a {@code @modifies} tag of the form\n * {@co"...
method_declaration (+361 nodes collapsed)
block_comment "/**\n * Parse a {@code @idgenerator} tag of the form\n * {"...
method_declaration (+512 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 (+88 nodes collapsed)
block_comment "/**\n * Looks for a parameter type expression at the curren"...
method_declaration (+92 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 (+317 nodes collapsed)
block_comment "/**\n * ContextTypeExpression := BasicTypeExpression | '?'\n"...
method_declaration
modifiers
private "private"
type_identifier "Node"
identifier "parseContextTypeExpression"
formal_parameters
( "("
formal_parameter
type_identifier "JsDocToken"
identifier "token"
) ")"
block
{ "{"
return_statement all 1:2
return "return" all 1:2
method_invocation
identifier "parseTypeName"
argument_list
( "("
identifier "token"
) ")"
; ";" all 1:2
} "}"
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)
method_declaration (+24 nodes collapsed)
method_declaration (+51 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 (+34 nodes collapsed)
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
modifiers
private "private"
boolean_type "boolean"
identifier "lookAheadForType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
method_invocation
identifier "lookAheadFor"
argument_list
( "("
character_literal "'{'"
) ")"
; ";"
} "}"
method_declaration
modifiers
private "private"
boolean_type "boolean"
identifier "lookAheadForAnnotation"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
method_invocation
identifier "lookAheadFor"
argument_list
( "("
character_literal "'@'"
) ")"
; ";"
} "}"
block_comment "/**\n * Look ahead by advancing the character stream.\n * "...
method_declaration (+107 nodes collapsed)
} "}"

After

program
block_comment "/*\n * Copyright 2007 The Closure Compiler Authors.\n *\n * Lic"...
package_declaration
package "package"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "jscomp"
. "."
identifier "parsing"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "base"
. "."
identifier "Preconditions"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "base"
. "."
identifier "Splitter"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "collect"
. "."
identifier "ImmutableSet"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "collect"
. "."
identifier "Lists"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "common"
. "."
identifier "collect"
. "."
identifier "Sets"
; ";"
import_declaration (+22 nodes collapsed)
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "IR"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "JSDocInfo"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "JSDocInfo"
. "."
identifier "Visibility"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "JSDocInfoBuilder"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "JSTypeExpression"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "Node"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "SimpleErrorReporter"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "Token"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "head"
. "."
identifier "ErrorReporter"
; ";"
import_declaration (+22 nodes collapsed)
import_declaration
import "import"
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
scoped_identifier
identifier "com"
. "."
identifier "google"
. "."
identifier "javascript"
. "."
identifier "rhino"
. "."
identifier "jstype"
. "."
identifier "StaticSourceFile"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "HashSet"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "List"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Map"
; ";"
import_declaration
import "import"
scoped_identifier
scoped_identifier
identifier "java"
. "."
identifier "util"
. "."
identifier "Set"
; ";"
block_comment "/**\n * A parser for JSDoc comments.\n *\n */"
line_comment "// TODO(nicksantos): Unify all the JSDocInfo stuff into one "...
line_comment "// spreading it across multiple packages."
class_declaration
modifiers
public "public"
final "final"
class "class"
identifier "JsDocInfoParser"
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 (+45 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 (+185 nodes collapsed)
method_declaration (+29 nodes collapsed)
block_comment "/**\n * Parse a description as a {@code @type}.\n */"
method_declaration (+135 nodes collapsed)
method_declaration (+88 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 (+169 nodes collapsed)
method_declaration (+303 nodes collapsed)
method_declaration (+5715 nodes collapsed)
block_comment "/**\n * Records a marker's description if there is one avai"...
method_declaration (+70 nodes collapsed)
method_declaration (+138 nodes collapsed)
block_comment "/**\n * Parse a {@code @suppress} tag of the form\n * {@co"...
method_declaration (+354 nodes collapsed)
block_comment "/**\n * Parse a {@code @modifies} tag of the form\n * {@co"...
method_declaration (+361 nodes collapsed)
block_comment "/**\n * Parse a {@code @idgenerator} tag of the form\n * {"...
method_declaration (+512 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 (+88 nodes collapsed)
block_comment "/**\n * Looks for a parameter type expression at the curren"...
method_declaration (+92 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 (+317 nodes collapsed)
block_comment "/**\n * ContextTypeExpression := BasicTypeExpression | '?'\n"...
method_declaration
modifiers
private "private"
type_identifier "Node"
identifier "parseContextTypeExpression"
formal_parameters
( "("
formal_parameter
type_identifier "JsDocToken"
identifier "token"
) ")"
block
{ "{"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "token"
== "=="
field_access
identifier "JsDocToken"
. "."
identifier "QMARK"
) ")"
block
{ "{"
return_statement all 1:2
return "return" all 1:2
method_invocation
identifier "newNode"
argument_list
( "("
field_access
identifier "Token"
. "."
identifier "QMARK"
) ")"
; ";" all 1:2
} "}"
else "else"
block
{ "{"
return_statement all 1:2
return "return" all 1:2
method_invocation
identifier "parseBasicTypeExpression"
argument_list
( "("
identifier "token"
) ")"
; ";" all 1:2
} "}"
} "}"
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)
method_declaration (+24 nodes collapsed)
method_declaration (+51 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 (+34 nodes collapsed)
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
modifiers
private "private"
boolean_type "boolean"
identifier "lookAheadForType"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
method_invocation
identifier "lookAheadFor"
argument_list
( "("
character_literal "'{'"
) ")"
; ";"
} "}"
method_declaration
modifiers
private "private"
boolean_type "boolean"
identifier "lookAheadForAnnotation"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
method_invocation
identifier "lookAheadFor"
argument_list
( "("
character_literal "'@'"
) ")"
; ";"
} "}"
block_comment "/**\n * Look ahead by advancing the character stream.\n * "...
method_declaration (+107 nodes collapsed)
} "}"