class_body
{ "{"
field_declaration
modifiers
private "private"
type_identifier "AbstractCompiler"
variable_declarator
identifier "compiler"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "Node"
variable_declarator
identifier "root"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "Node"
variable_declarator
identifier "externsRoot"
; ";"
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "inExterns"
; ";"
field_declaration
modifiers
private "private"
type_identifier "Scope"
variable_declarator
identifier "externsScope"
; ";"
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "generated"
= "="
false "false"
; ";"
block_comment "/**\n * Each reference has an index in post-order.\n * Not"...
field_declaration
modifiers
private "private"
integral_type
int "int"
variable_declarator
identifier "currentPreOrderIndex"
= "="
decimal_integer_literal "0"
; ";"
block_comment "/** Global namespace tree */"
field_declaration (+24 nodes collapsed)
block_comment "/** Maps names (e.g. \"a.b.c\") to nodes in the global namespa"...
field_declaration (+28 nodes collapsed)
block_comment "/**\n * Creates an instance that may emit warnings when bui"...
constructor_declaration (+26 nodes collapsed)
block_comment "/**\n * Creates an instance that may emit warnings when bui"...
constructor_declaration (+46 nodes collapsed)
method_declaration
boolean_type "boolean"
identifier "hasExternsRoot"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
binary_expression
identifier "externsRoot"
!= "!="
null_literal "null"
; ";"
} "}"
method_declaration (+24 nodes collapsed)
method_declaration (+23 nodes collapsed)
method_declaration (+26 nodes collapsed)
method_declaration (+35 nodes collapsed)
method_declaration (+31 nodes collapsed)
method_declaration (+46 nodes collapsed)
method_declaration (+26 nodes collapsed)
method_declaration (+47 nodes collapsed)
method_declaration (+29 nodes collapsed)
block_comment "/**\n * Gets a list of the roots of the forest of the globa"...
method_declaration (+25 nodes collapsed)
block_comment "/**\n * Gets an index of all the global names, indexed by f"...
method_declaration (+27 nodes collapsed)
block_comment "/**\n * A simple data class that contains the information n"...
class_declaration (+75 nodes collapsed)
block_comment "/**\n * If the client adds new nodes to the AST, scan these"...
method_declaration (+101 nodes collapsed)
method_declaration (+85 nodes collapsed)
block_comment "/**\n * Builds the namespace lazily.\n */"
method_declaration (+79 nodes collapsed)
block_comment "/**\n * Determines whether a name reference in a particular"...
method_declaration (+41 nodes collapsed)
block_comment "/**\n * Gets the top variable name from a possibly namespac"...
method_declaration (+52 nodes collapsed)
block_comment "/**\n * Determines whether a variable name reference in a p"...
method_declaration (+84 nodes collapsed)
block_comment "/**\n * Gets whether a scope is the global scope.\n *\n *"...
method_declaration (+27 nodes collapsed)
line_comment "// ---------------------------------------------------------"...
block_comment "/**\n * Builds a tree representation of the global namespac"...
class_declaration
modifiers
private "private"
class "class"
identifier "BuildGlobalNamespace"
super_interfaces
implements "implements"
type_list
scoped_type_identifier
type_identifier "NodeTraversal"
. "."
type_identifier "Callback"
class_body
{ "{"
constructor_declaration
identifier "BuildGlobalNamespace"
formal_parameters
( "("
) ")"
constructor_body
{ "{"
} "}"
method_declaration (+25 nodes collapsed)
block_comment "/** Collect the references in pre-order. */"
method_declaration (+85 nodes collapsed)
method_declaration
modifiers
public "public"
void_type "void"
identifier "collect"
formal_parameters
( "("
formal_parameter
type_identifier "JSModule"
identifier "module"
, ","
formal_parameter
type_identifier "Scope"
identifier "scope"
, ","
formal_parameter
type_identifier "Node"
identifier "n"
) ")"
block
{ "{"
local_variable_declaration
type_identifier "Node"
variable_declarator
identifier "parent"
= "="
method_invocation
identifier "n"
. "."
identifier "getParent"
argument_list
( "("
) ")"
; ";"
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "name"
; ";"
local_variable_declaration
boolean_type "boolean"
variable_declarator
identifier "isSet"
= "="
false "false"
; ";"
local_variable_declaration
scoped_type_identifier
type_identifier "Name"
. "."
type_identifier "Type"
variable_declarator
identifier "type"
= "="
field_access
field_access
identifier "Name"
. "."
identifier "Type"
. "."
identifier "OTHER"
; ";"
local_variable_declaration
boolean_type "boolean"
variable_declarator
identifier "isPropAssign"
= "="
false "false"
; ";"
switch_expression
switch "switch"
parenthesized_expression
( "("
method_invocation
identifier "n"
. "."
identifier "getType"
argument_list
( "("
) ")"
) ")"
switch_block
{ "{"
switch_block_statement_group
switch_label
case "case"
field_access
identifier "Token"
. "."
identifier "GETTER_DEF"
: ":"
switch_block_statement_group
switch_label
case "case"
field_access
identifier "Token"
. "."
identifier "SETTER_DEF"
: ":"
switch_block_statement_group (+180 nodes collapsed)
switch_block_statement_group
switch_label
case "case"
field_access
identifier "Token"
. "."
identifier "NAME"
: ":"
line_comment "// This may be a variable get or set."
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "parent"
!= "!="
null_literal "null"
) ")"
block
{ "{"
switch_expression
switch "switch"
parenthesized_expression
( "("
method_invocation
identifier "parent"
. "."
identifier "getType"
argument_list
( "("
) ")"
) ")"
switch_block
{ "{"
switch_block_statement_group (+55 nodes collapsed)
switch_block_statement_group (+52 nodes collapsed)
switch_block_statement_group
switch_label
case "case"
field_access
identifier "Token"
. "."
identifier "GETPROP"
: ":"
return_statement
return "return"
; ";"
switch_block_statement_group (+67 nodes collapsed)
switch_block_statement_group
switch_label
case "case"
field_access
identifier "Token"
. "."
identifier "INC"
: ":"
switch_block_statement_group (+29 nodes collapsed)
switch_block_statement_group (+50 nodes collapsed)
} "}"
} "}"
expression_statement
assignment_expression
identifier "name"
= "="
method_invocation
identifier "n"
. "."
identifier "getString"
argument_list
( "("
) ")"
; ";"
break_statement
break "break"
; ";"
switch_block_statement_group (+222 nodes collapsed)
switch_block_statement_group
switch_label
default "default"
: ":"
return_statement
return "return"
; ";"
} "}"
line_comment "// We are only interested in global names."
if_statement (+21 nodes collapsed)
if_statement (+83 nodes collapsed)
} "}"
block_comment "/**\n * Gets the fully qualified name corresponding to an"...
method_declaration (+315 nodes collapsed)
block_comment "/**\n * Gets the type of a value or simple expression.\n "...
method_declaration (+191 nodes collapsed)
block_comment "/**\n * Updates our representation of the global namespac"...
method_declaration (+221 nodes collapsed)
block_comment "/**\n * Determines whether a set operation is a construct"...
method_declaration (+117 nodes collapsed)
block_comment "/**\n * Updates our representation of the global namespac"...
method_declaration (+174 nodes collapsed)
block_comment "/**\n * Updates our representation of the global namespac"...
method_declaration (+440 nodes collapsed)
method_declaration (+41 nodes collapsed)
block_comment "/**\n * Determines whether the result of a hook (x?y:z) o"...
method_declaration (+381 nodes collapsed)
block_comment "/**\n * Updates our representation of the global namespac"...
method_declaration (+76 nodes collapsed)
block_comment "/**\n * Updates our representation of the global namespac"...
method_declaration (+302 nodes collapsed)
block_comment "/**\n * Determines whether an assignment is nested (i.e. "...
method_declaration (+39 nodes collapsed)
block_comment "/**\n * Gets a {@link Name} instance for a global name. C"...
method_declaration (+164 nodes collapsed)
} "}"
line_comment "// ---------------------------------------------------------"...
block_comment "/**\n * A name defined in global scope (e.g. \"a\" or \"a.b.c."...
class_declaration (+1718 nodes collapsed)
line_comment "// ---------------------------------------------------------"...
block_comment "/**\n * A global name reference. Contains references to the"...
class_declaration (+703 nodes collapsed)
block_comment "/**\n * An experimental compiler pass for tracking what sym"...
class_declaration (+364 nodes collapsed)
} "}"