class_body
{ "{"
field_declaration (+27 nodes collapsed)
field_declaration
modifiers
private "private"
final "final"
type_identifier "AbstractCompiler"
variable_declarator
identifier "compiler"
; ";"
field_declaration (+21 nodes collapsed)
field_declaration
modifiers
private "private"
final "final"
array_type
integral_type
char "char"
dimensions
[ "["
] "]"
variable_declarator
identifier "reservedCharacters"
; ";"
block_comment "/** Map from property name to Property object */"
field_declaration (+23 nodes collapsed)
block_comment "/** Property names that don't get renamed */"
field_declaration (+21 nodes collapsed)
block_comment "/** Names to which properties shouldn't be renamed, to avoid"...
field_declaration (+21 nodes collapsed)
block_comment "/** Map from original property name to new name. */"
field_declaration (+23 nodes collapsed)
block_comment "/** Map from color assigned by GraphColoring to new name. */"
field_declaration (+23 nodes collapsed)
block_comment "/**\n * Sorts Property objects by their count, breaking tie"...
field_declaration (+96 nodes collapsed)
block_comment "/** A map from JSType to a unique representative Integer. */"
field_declaration (+22 nodes collapsed)
block_comment "/**\n * A map from JSType to JSTypeBitSet representing the "...
field_declaration (+22 nodes collapsed)
block_comment "/** A set of types that invalidate properties from ambiguati"...
field_declaration
modifiers
private "private"
final "final"
generic_type
type_identifier "Set"
type_arguments
< "<"
type_identifier "JSType"
> ">"
variable_declarator
identifier "invalidatingTypes"
; ";"
block_comment "/**\n * Prefix of properties to skip renaming. These shoul"...
field_declaration
modifiers
static "static"
final "final"
type_identifier "String"
variable_declarator
identifier "SKIP_PREFIX"
= "="
string_literal
" "\""
string_fragment "JSAbstractCompiler"
" "\""
; ";"
constructor_declaration (+263 nodes collapsed)
block_comment "/**\n * Invalidates the given type, so that no properties o"...
method_declaration (+122 nodes collapsed)
method_declaration
generic_type
type_identifier "Map"
type_arguments
< "<"
type_identifier "String"
, ","
type_identifier "String"
> ">"
identifier "getRenamingMap"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "renamingMap"
; ";"
} "}"
block_comment "/** Returns an integer that uniquely identifies a JSType. */"
method_declaration (+81 nodes collapsed)
method_declaration
modifiers
public "public"
void_type "void"
identifier "process"
formal_parameters
( "("
formal_parameter
type_identifier "Node"
identifier "externs"
, ","
formal_parameter
type_identifier "Node"
identifier "root"
) ")"
block
{ "{"
expression_statement
method_invocation
identifier "NodeTraversal"
. "."
identifier "traverse"
argument_list
( "("
identifier "compiler"
, ","
identifier "externs"
, ","
object_creation_expression
new "new"
type_identifier "ProcessExterns"
argument_list
( "("
) ")"
) ")"
; ";"
expression_statement
method_invocation
identifier "NodeTraversal"
. "."
identifier "traverse"
argument_list
( "("
identifier "compiler"
, ","
identifier "root"
, ","
object_creation_expression
new "new"
type_identifier "ProcessProperties"
argument_list
( "("
) ")"
) ")"
; ";"
local_variable_declaration (+38 nodes collapsed)
expression_statement
method_invocation
identifier "reservedNames"
. "."
identifier "addAll"
argument_list
( "("
identifier "externedNames"
) ")"
; ";"
expression_statement
method_invocation
identifier "reservedNames"
. "."
identifier "addAll"
argument_list
( "("
identifier "quotedNames"
) ")"
; ";"
local_variable_declaration
integral_type
int "int"
variable_declarator
identifier "numRenamedPropertyNames"
= "="
decimal_integer_literal "0"
; ";"
local_variable_declaration
integral_type
int "int"
variable_declarator
identifier "numSkippedPropertyNames"
= "="
decimal_integer_literal "0"
; ";"
local_variable_declaration (+23 nodes collapsed)
enhanced_for_statement
for "for"
( "("
type_identifier "Property"
identifier "p"
: ":"
method_invocation
identifier "propertyMap"
. "."
identifier "values"
argument_list
( "("
) ")"
) ")"
block
{ "{"
if_statement
if "if"
parenthesized_expression
( "("
unary_expression
! "!"
field_access
identifier "p"
. "."
identifier "skipAmbiguating"
) ")"
block
{ "{"
expression_statement
update_expression
++ "++"
identifier "numRenamedPropertyNames"
; ";"
expression_statement
method_invocation
identifier "computeRelatedTypes"
argument_list
( "("
field_access
identifier "p"
. "."
identifier "type"
) ")"
; ";"
expression_statement
method_invocation
identifier "propsByFreq"
. "."
identifier "add"
argument_list
( "("
identifier "p"
) ")"
; ";"
} "}"
else "else"
block (+21 nodes collapsed)
} "}"
local_variable_declaration
type_identifier "PropertyGraph"
variable_declarator
identifier "graph"
= "="
object_creation_expression
new "new"
type_identifier "PropertyGraph"
argument_list
( "("
method_invocation
identifier "Lists"
. "."
identifier "newLinkedList"
argument_list
( "("
identifier "propsByFreq"
) ")"
) ")"
; ";"
local_variable_declaration (+29 nodes collapsed)
local_variable_declaration
integral_type
int "int"
variable_declarator
identifier "numNewPropertyNames"
= "="
method_invocation
identifier "coloring"
. "."
identifier "color"
argument_list
( "("
) ")"
; ";"
local_variable_declaration
type_identifier "NameGenerator"
variable_declarator
identifier "nameGen"
= "="
object_creation_expression
new "new"
type_identifier "NameGenerator"
argument_list
( "("
identifier "reservedNames"
, ","
string_literal
" "\""
" "\""
, ","
identifier "reservedCharacters"
) ")"
; ";"
for_statement (+41 nodes collapsed)
enhanced_for_statement (+88 nodes collapsed)
line_comment "// Update the string nodes."
enhanced_for_statement (+122 nodes collapsed)
expression_statement (+40 nodes collapsed)
} "}"
method_declaration (+75 nodes collapsed)
block_comment "/** Add supertypes of the type to its JSTypeBitSet of relate"...
method_declaration (+315 nodes collapsed)
class_declaration (+255 nodes collapsed)
block_comment "/**\n * A {@link SubGraph} that represents properties. The "...
class_declaration
class "class"
identifier "PropertySubGraph"
super_interfaces
implements "implements"
type_list
generic_type
type_identifier "SubGraph"
type_arguments
< "<"
type_identifier "Property"
, ","
type_identifier "Void"
> ">"
class_body
{ "{"
block_comment "/** Types from which properties in this subgraph are referen"...
field_declaration
type_identifier "JSTypeBitSet"
variable_declarator
identifier "typesInSet"
= "="
object_creation_expression
new "new"
type_identifier "JSTypeBitSet"
argument_list
( "("
method_invocation
identifier "intForType"
. "."
identifier "size"
argument_list
( "("
) ")"
) ")"
; ";"
block_comment "/** Types related to types in {@code typesInSet}. */"
field_declaration
type_identifier "JSTypeBitSet"
variable_declarator
identifier "typesRelatedToSet"
= "="
object_creation_expression
new "new"
type_identifier "JSTypeBitSet"
argument_list
( "("
method_invocation
identifier "intForType"
. "."
identifier "size"
argument_list
( "("
) ")"
) ")"
; ";"
block_comment "/**\n * Returns true if prop is in an independent set fro"...
method_declaration
modifiers
public "public"
boolean_type "boolean"
identifier "isIndependentOf"
formal_parameters
( "("
formal_parameter
type_identifier "Property"
identifier "prop"
) ")"
block
{ "{"
if_statement (+23 nodes collapsed)
return_statement
return "return"
unary_expression
! "!"
method_invocation any 2:1
method_invocation any 2:1
identifier "getRelated"
argument_list
( "("
field_access
identifier "prop"
. "."
identifier "type"
) ")"
. "."
identifier "intersects"
argument_list
( "("
identifier "typesInSet"
) ")"
; ";"
} "}"
block_comment "/**\n * Adds the node to the sub graph, adding all of its"...
method_declaration
modifiers
public "public"
void_type "void"
identifier "addNode"
formal_parameters
( "("
formal_parameter
type_identifier "Property"
identifier "prop"
) ")"
block
{ "{"
expression_statement
method_invocation
identifier "typesInSet"
. "."
identifier "or"
argument_list
( "("
field_access
identifier "prop"
. "."
identifier "typesSet"
) ")"
; ";"
expression_statement
method_invocation
identifier "typesRelatedToSet"
. "."
identifier "or"
argument_list
( "("
method_invocation
identifier "getRelated"
argument_list
( "("
field_access
identifier "prop"
. "."
identifier "type"
) ")"
) ")"
; ";"
} "}"
block_comment "/**\n * Finds all types related to the provided type and "...
method_declaration (+97 nodes collapsed)
block_comment "/**\n * Finds all types related to the provided type and "...
method_declaration (+33 nodes collapsed)
} "}"
class_declaration (+121 nodes collapsed)
block_comment "/** A traversal callback that collects externed property nam"...
class_declaration (+184 nodes collapsed)
block_comment "/** Finds all property references, recording the types on wh"...
class_declaration (+439 nodes collapsed)
block_comment "/** Returns true if properties on this type should not be re"...
method_declaration (+180 nodes collapsed)
method_declaration (+68 nodes collapsed)
block_comment "/**\n * This method gets the JSType from the Node argument "...
method_declaration (+71 nodes collapsed)
block_comment "/** Encapsulates the information needed for renaming a prope"...
class_declaration
modifiers
private "private"
class "class"
identifier "Property"
class_body
{ "{"
field_declaration
modifiers
final "final"
type_identifier "String"
variable_declarator
identifier "oldName"
; ";"
field_declaration
type_identifier "JSType"
variable_declarator
identifier "type"
; ";"
field_declaration
type_identifier "String"
variable_declarator
identifier "newName"
; ";"
field_declaration
integral_type
int "int"
variable_declarator
identifier "numOccurrences"
; ";"
field_declaration
boolean_type "boolean"
variable_declarator
identifier "skipAmbiguating"
; ";"
field_declaration
type_identifier "JSTypeBitSet"
variable_declarator
identifier "typesSet"
= "="
object_creation_expression
new "new"
type_identifier "JSTypeBitSet"
argument_list
( "("
method_invocation
identifier "intForType"
. "."
identifier "size"
argument_list
( "("
) ")"
) ")"
; ";"
constructor_declaration (+43 nodes collapsed)
block_comment "/** Add this type to this property, calculating */"
method_declaration (+108 nodes collapsed)
method_declaration
modifiers
private "private"
void_type "void"
identifier "addNonUnionType"
formal_parameters
( "("
formal_parameter
type_identifier "JSType"
identifier "newType"
) ")"
block
{ "{"
if_statement (+26 nodes collapsed)
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "type"
== "=="
null_literal "null"
) ")"
block
{ "{"
expression_statement
assignment_expression
identifier "type"
= "="
identifier "newType"
; ";"
} "}"
else "else"
block
{ "{"
expression_statement
assignment_expression
identifier "type"
= "="
method_invocation
identifier "type"
. "."
identifier "getLeastSupertype"
argument_list
( "("
identifier "newType"
) ")"
; ";"
} "}"
expression_statement
method_invocation
identifier "typesSet"
. "."
identifier "set"
argument_list
( "("
method_invocation
identifier "getIntForType"
argument_list
( "("
identifier "newType"
) ")"
) ")"
; ";"
} "}"
} "}"
line_comment "// A BitSet that stores type info. Adds pretty-print routine"...
class_declaration (+193 nodes collapsed)
} "}"