class_body
{ "{"
field_declaration
modifiers
private "private"
final "final"
type_identifier "AbstractCompiler"
variable_declarator
identifier "compiler"
; ";"
block_comment "/** List of global NAME nodes */"
field_declaration (+25 nodes collapsed)
block_comment "/** List of local NAME nodes */"
field_declaration (+25 nodes collapsed)
block_comment "/** List of local names that corresponds to the localNameNod"...
field_declaration (+25 nodes collapsed)
block_comment "/** Set of extern variable names */"
field_declaration (+25 nodes collapsed)
block_comment "/** Set of reserved variable names */"
field_declaration
modifiers
private "private"
final "final"
generic_type
type_identifier "Set"
type_arguments
< "<"
type_identifier "String"
> ">"
variable_declarator
identifier "reservedNames"
; ";"
block_comment "/** The renaming map */"
field_declaration (+29 nodes collapsed)
block_comment "/** The previously used rename map. */"
field_declaration
modifiers
private "private"
final "final"
type_identifier "VariableMap"
variable_declarator
identifier "prevUsedRenameMap"
; ";"
block_comment "/** The global name prefix */"
field_declaration
modifiers
private "private"
final "final"
type_identifier "String"
variable_declarator
identifier "prefix"
; ";"
block_comment "/** Counter for each assignment */"
field_declaration
modifiers
private "private"
integral_type
int "int"
variable_declarator
identifier "assignmentCount"
= "="
decimal_integer_literal "0"
; ";"
block_comment "/** Logs all name assignments */"
field_declaration
modifiers
private "private"
type_identifier "StringBuilder"
variable_declarator
identifier "assignmentLog"
; ";"
class_declaration (+141 nodes collapsed)
block_comment "/** Maps an old name to a new name assignment */"
field_declaration (+29 nodes collapsed)
block_comment "/** Whether renaming should apply to local variables only. *"...
field_declaration
modifiers
private "private"
final "final"
boolean_type "boolean"
variable_declarator
identifier "localRenamingOnly"
; ";"
block_comment "/**\n * Whether anonymous function names should be preserve"...
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "preserveAnonymousFunctionNames"
; ";"
block_comment "/** Generate pseudo names for variables for debugging purpos"...
field_declaration
modifiers
private "private"
boolean_type "boolean"
variable_declarator
identifier "generatePseudoNames"
; ";"
block_comment "/** Characters that shouldn't be used in variable names. */"
field_declaration
modifiers
private "private"
final "final"
array_type
integral_type
char "char"
dimensions
[ "["
] "]"
variable_declarator
identifier "reservedCharacters"
; ";"
block_comment "/** A prefix to distinguish temporary local names from globa"...
field_declaration
modifiers
private "private"
static "static"
final "final"
type_identifier "String"
variable_declarator
identifier "LOCAL_VAR_PREFIX"
= "="
string_literal
" "\""
string_fragment "L "
" "\""
; ";"
constructor_declaration (+177 nodes collapsed)
block_comment "/**\n * Iterate through the nodes, collect all the NAME nod"...
class_declaration
class "class"
identifier "ProcessVars"
superclass
extends "extends"
type_identifier "AbstractPostOrderCallback"
class_body
{ "{"
field_declaration
modifiers
private "private"
final "final"
boolean_type "boolean"
variable_declarator
identifier "isExternsPass_"
; ";"
constructor_declaration
identifier "ProcessVars"
formal_parameters
( "("
formal_parameter
boolean_type "boolean"
identifier "isExterns"
) ")"
constructor_body
{ "{"
expression_statement
assignment_expression
identifier "isExternsPass_"
= "="
identifier "isExterns"
; ";"
} "}"
method_declaration
modifiers
marker_annotation
@ "@"
identifier "Override"
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
{ "{"
if_statement (+24 nodes collapsed)
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "name"
= "="
method_invocation
identifier "n"
. "."
identifier "getString"
argument_list
( "("
) ")"
; ";"
line_comment "// Ignore anonymous functions"
if_statement (+21 nodes collapsed)
line_comment "// Is this local or Global?"
local_variable_declaration (+23 nodes collapsed)
local_variable_declaration (+22 nodes collapsed)
line_comment "// Are we renaming global variables?"
if_statement (+27 nodes collapsed)
line_comment "// Are we renaming anonymous function names?"
if_statement (+44 nodes collapsed)
line_comment "// Check if we can rename this."
if_statement
if "if"
parenthesized_expression
( "("
unary_expression
! "!"
method_invocation
identifier "okToRenameVar"
argument_list
( "("
identifier "name"
, ","
identifier "local"
) ")"
) ")"
block
{ "{"
line_comment "// Blindly de-uniquify for the Prototype library for issue 1"...
return_statement
return "return"
; ";"
} "}"
if_statement (+34 nodes collapsed)
if_statement (+94 nodes collapsed)
} "}"
line_comment "// Increment count of an assignment"
method_declaration (+76 nodes collapsed)
} "}"
block_comment "/**\n * Sorts Assignment objects by their count, breaking t"...
field_declaration (+94 nodes collapsed)
block_comment "/**\n * Sorts Assignment objects by the order the variable "...
field_declaration (+61 nodes collapsed)
block_comment "/**\n * {@inheritDoc}\n */"
method_declaration (+319 nodes collapsed)
method_declaration (+104 nodes collapsed)
method_declaration (+103 nodes collapsed)
method_declaration (+39 nodes collapsed)
block_comment "/**\n * Runs through the assignments and reuses as many nam"...
method_declaration (+137 nodes collapsed)
block_comment "/**\n * Determines which new names to substitute for the or"...
method_declaration (+444 nodes collapsed)
block_comment "/**\n * Makes a final name assignment.\n */"
method_declaration (+82 nodes collapsed)
block_comment "/**\n * Gets the variable map.\n */"
method_declaration
type_identifier "VariableMap"
identifier "getVariableMap"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
object_creation_expression
new "new"
type_identifier "VariableMap"
argument_list
( "("
identifier "renameMap"
) ")"
; ";"
} "}"
block_comment "/**\n * Determines whether a variable name is okay to renam"...
method_declaration (+39 nodes collapsed)
} "}"