class_body
{ "{"
field_declaration
modifiers
private "private"
final "final"
type_identifier "AbstractCompiler"
variable_declarator
identifier "compiler"
; ";"
field_declaration
modifiers
private "private"
final "final"
boolean_type "boolean"
variable_declarator
identifier "aggressiveRenaming"
; ";"
field_declaration
modifiers
private "private"
final "final"
array_type
integral_type
char "char"
dimensions
[ "["
] "]"
variable_declarator
identifier "reservedCharacters"
; ";"
block_comment "/** Previously used prototype renaming map. */"
field_declaration
modifiers
private "private"
final "final"
type_identifier "VariableMap"
variable_declarator
identifier "prevUsedRenameMap"
; ";"
block_comment "/**\n * The Property class encapsulates the information nee"...
class_declaration (+438 nodes collapsed)
block_comment "/**\n * Sorts Property objects by their count, breaking tie"...
field_declaration (+112 nodes collapsed)
line_comment "// Set of String nodes to rename"
field_declaration (+25 nodes collapsed)
line_comment "// Mapping of property names to Property objects"
field_declaration (+29 nodes collapsed)
line_comment "// Set of names not to rename. Externed properties/methods a"...
field_declaration (+51 nodes collapsed)
line_comment "// Set of OBJLIT nodes that are assigned to prototypes"
field_declaration (+25 nodes collapsed)
block_comment "/**\n * Creates an instance.\n *\n * @param compiler The "...
constructor_declaration (+72 nodes collapsed)
block_comment "/**\n * Does property/method renaming.\n *\n * @param ext"...
method_declaration (+534 nodes collapsed)
block_comment "/**\n * Runs through the list of properties and tries to re"...
method_declaration (+97 nodes collapsed)
block_comment "/**\n * Iterate through the nodes, collect all of the STRIN"...
class_declaration (+120 nodes collapsed)
block_comment "/**\n * Iterate through the nodes, collect all of the STRIN"...
class_declaration
modifiers
private "private"
class "class"
identifier "ProcessProperties"
superclass
extends "extends"
type_identifier "AbstractPostOrderCallback"
class_body
{ "{"
method_declaration
modifiers
public "public"
void_type "void"
identifier "visit"
formal_parameters
( "("
formal_parameter
type_identifier "NodeTraversal"
identifier "t"
, ","
formal_parameter
type_identifier "Node"
identifier "n"
, ","
formal_parameter
type_identifier "Node"
identifier "parent"
) ")"
block
{ "{"
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 "GETPROP"
: ":"
switch_block_statement_group (+119 nodes collapsed)
switch_block_statement_group
switch_label
case "case"
field_access
identifier "Token"
. "."
identifier "OBJECTLIT"
: ":"
if_statement
if "if"
parenthesized_expression
( "("
unary_expression
! "!"
method_invocation
identifier "prototypeObjLits"
. "."
identifier "contains"
argument_list
( "("
identifier "n"
) ")"
) ")"
block
{ "{"
line_comment "// Object literals have their property name/value pairs as a"...
line_comment "// list as their children. We want every other node in order"...
line_comment "// only the property names."
for_statement
for "for"
( "("
local_variable_declaration
type_identifier "Node"
variable_declarator
identifier "child"
= "="
method_invocation
identifier "n"
. "."
identifier "getFirstChild"
argument_list
( "("
) ")"
; ";"
binary_expression
identifier "child"
!= "!="
null_literal "null"
; ";"
assignment_expression
identifier "child"
= "="
method_invocation
identifier "child"
. "."
identifier "getNext"
argument_list
( "("
) ")"
) ")"
block
{ "{"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
method_invocation
identifier "child"
. "."
identifier "getType"
argument_list
( "("
) ")"
!= "!="
field_access
identifier "Token"
. "."
identifier "NUMBER"
) ")"
block
{ "{"
expression_statement
method_invocation
identifier "markObjLitPropertyCandidate"
argument_list
( "("
identifier "child"
, ","
method_invocation
identifier "t"
. "."
identifier "getInput"
argument_list
( "("
) ")"
) ")"
; ";"
} "}"
} "}"
} "}"
break_statement
break "break"
; ";"
} "}"
} "}"
block_comment "/**\n * Processes the parent of a GETPROP prototype, whic"...
method_declaration
modifiers
private "private"
void_type "void"
identifier "processPrototypeParent"
formal_parameters
( "("
formal_parameter
type_identifier "Node"
identifier "n"
, ","
formal_parameter
type_identifier "CompilerInput"
identifier "input"
) ")"
block
{ "{"
switch_expression
switch "switch"
parenthesized_expression
( "("
method_invocation
identifier "n"
. "."
identifier "getType"
argument_list
( "("
) ")"
) ")"
switch_block
{ "{"
line_comment "// Foo.prototype.getBar = function() { ... }"
switch_block_statement_group
switch_label
case "case"
field_access
identifier "Token"
. "."
identifier "GETPROP"
: ":"
switch_block_statement_group (+61 nodes collapsed)
line_comment "// Foo.prototype = { \"getBar\" : function() { ... } }"
switch_block_statement_group
switch_label
case "case"
field_access
identifier "Token"
. "."
identifier "ASSIGN"
: ":"
switch_block_statement_group
switch_label
case "case"
field_access
identifier "Token"
. "."
identifier "CALL"
: ":"
local_variable_declaration
type_identifier "Node"
variable_declarator
identifier "map"
; ";"
if_statement (+55 nodes collapsed)
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
method_invocation
identifier "map"
. "."
identifier "getType"
argument_list
( "("
) ")"
== "=="
field_access
identifier "Token"
. "."
identifier "OBJECTLIT"
) ")"
block
{ "{"
line_comment "// Remember this node so that we can avoid processing it aga"...
line_comment "// the traversal reaches it."
expression_statement
method_invocation
identifier "prototypeObjLits"
. "."
identifier "add"
argument_list
( "("
identifier "map"
) ")"
; ";"
for_statement
for "for"
( "("
local_variable_declaration
type_identifier "Node"
variable_declarator
identifier "key"
= "="
method_invocation
identifier "map"
. "."
identifier "getFirstChild"
argument_list
( "("
) ")"
; ";"
binary_expression
identifier "key"
!= "!="
null_literal "null"
; ";"
assignment_expression
identifier "key"
= "="
method_invocation
identifier "key"
. "."
identifier "getNext"
argument_list
( "("
) ")"
) ")"
block
{ "{"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
method_invocation
identifier "key"
. "."
identifier "getType"
argument_list
( "("
) ")"
!= "!="
field_access
identifier "Token"
. "."
identifier "NUMBER"
) ")"
block
{ "{"
line_comment "// May be STRING, GET, or SET"
expression_statement
method_invocation
identifier "markPrototypePropertyCandidate"
argument_list
( "("
identifier "key"
, ","
identifier "input"
) ")"
; ";"
} "}"
} "}"
} "}"
break_statement
break "break"
; ";"
} "}"
} "}"
block_comment "/**\n * Remembers the given String node and increments th"...
method_declaration (+47 nodes collapsed)
block_comment "/**\n * Remembers the given String node and increments th"...
method_declaration (+47 nodes collapsed)
block_comment "/**\n * Remembers the given String node and increments th"...
method_declaration (+47 nodes collapsed)
block_comment "/**\n * Gets the current property for the given name, cre"...
method_declaration (+68 nodes collapsed)
} "}"
block_comment "/**\n * Gets the property renaming map.\n *\n * @return A"...
method_declaration (+95 nodes collapsed)
} "}"