class_body
{ "{"
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+22 nodes collapsed)
field_declaration (+22 nodes collapsed)
field_declaration
modifiers
private "private"
final "final"
type_identifier "AbstractCompiler"
variable_declarator
identifier "compiler"
; ";"
constructor_declaration
identifier "FoldConstants"
formal_parameters
( "("
formal_parameter
type_identifier "AbstractCompiler"
identifier "compiler"
) ")"
constructor_body
{ "{"
expression_statement
assignment_expression
field_access
this "this"
. "."
identifier "compiler"
= "="
identifier "compiler"
; ";"
} "}"
method_declaration (+32 nodes collapsed)
method_declaration (+2253 nodes collapsed)
method_declaration (+57 nodes collapsed)
block_comment "/**\n * Does a statement consume a 'dangling else'? A state"...
method_declaration (+128 nodes collapsed)
method_declaration (+462 nodes collapsed)
block_comment "/**\n * Try removing unneeded block nodes and their useless"...
method_declaration (+166 nodes collapsed)
block_comment "/**\n * Try folding :? (hook) and IF nodes by removing dead"...
method_declaration (+1070 nodes collapsed)
block_comment "/**\n * Try to minimize NOT nodes such as !(x==y).\n */"
method_declaration (+200 nodes collapsed)
block_comment "/**\n * Try turning IF nodes into smaller HOOKs\n */"
method_declaration (+1574 nodes collapsed)
block_comment "/**\n * Try to remove duplicate statements from IF blocks. "...
method_declaration (+250 nodes collapsed)
block_comment "/**\n * Reduce \"return undefined\" or \"return void 0\" to sim"...
method_declaration (+191 nodes collapsed)
block_comment "/**\n * Does the expression contain a property assignment?\n"...
method_declaration (+136 nodes collapsed)
block_comment "/**\n * Does the expression contain an operator with lower "...
method_declaration (+129 nodes collapsed)
block_comment "/**\n * Try to fold a AND/OR node.\n */"
method_declaration (+390 nodes collapsed)
block_comment "/**\n * Expressions such as [foo() + 'a' + 'b'] generate pa"...
method_declaration (+233 nodes collapsed)
block_comment "/**\n * Try to fold a ADD node\n */"
method_declaration (+169 nodes collapsed)
block_comment "/**\n * Try to fold arithmetic binary operators\n */"
method_declaration (+329 nodes collapsed)
block_comment "/**\n * Try to fold arithmetic binary operators\n */"
method_declaration (+309 nodes collapsed)
block_comment "/**\n * Try to fold shift operations\n */"
method_declaration (+407 nodes collapsed)
block_comment "/**\n * Try to fold comparison nodes, e.g ==\n */"
method_declaration (+1357 nodes collapsed)
block_comment "/**\n * Try to evaluate String.indexOf/lastIndexOf:\n * "...
method_declaration (+413 nodes collapsed)
block_comment "/**\n * Try to fold an array join: ['a', 'b', 'c'].join('')"...
method_declaration
void_type "void"
identifier "tryFoldStringJoin"
formal_parameters (+22 nodes collapsed)
block
{ "{"
if_statement (+33 nodes collapsed)
local_variable_declaration
type_identifier "Node"
variable_declarator
identifier "arrayNode"
= "="
method_invocation
identifier "left"
. "."
identifier "getFirstChild"
argument_list
( "("
) ")"
; ";"
local_variable_declaration
type_identifier "Node"
variable_declarator
identifier "functionName"
= "="
method_invocation
identifier "arrayNode"
. "."
identifier "getNext"
argument_list
( "("
) ")"
; ";"
if_statement (+48 nodes collapsed)
local_variable_declaration
type_identifier "String"
variable_declarator
identifier "joinString"
= "="
method_invocation
identifier "NodeUtil"
. "."
identifier "getStringValue"
argument_list
( "("
identifier "right"
) ")"
; ";"
local_variable_declaration
generic_type
type_identifier "List"
type_arguments
< "<"
type_identifier "Node"
> ">"
variable_declarator
identifier "arrayFoldedChildren"
= "="
method_invocation
identifier "Lists"
. "."
identifier "newLinkedList"
argument_list
( "("
) ")"
; ";"
local_variable_declaration
type_identifier "StringBuilder"
variable_declarator
identifier "sb"
= "="
object_creation_expression
new "new"
type_identifier "StringBuilder"
argument_list
( "("
) ")"
; ";"
local_variable_declaration
integral_type
int "int"
variable_declarator
identifier "foldedSize"
= "="
decimal_integer_literal "0"
; ";"
local_variable_declaration
type_identifier "Node"
variable_declarator
identifier "elem"
= "="
method_invocation
identifier "arrayNode"
. "."
identifier "getFirstChild"
argument_list
( "("
) ")"
; ";"
line_comment "// Merges adjacent String nodes."
while_statement
while "while"
parenthesized_expression
( "("
binary_expression
identifier "elem"
!= "!="
null_literal "null"
) ")"
block
{ "{"
if_statement
if "if"
parenthesized_expression
( "("
method_invocation
identifier "NodeUtil"
. "."
identifier "isImmutableValue"
argument_list
( "("
identifier "elem"
) ")"
) ")"
block
{ "{"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
method_invocation
identifier "sb"
. "."
identifier "length"
argument_list
( "("
) ")"
> ">"
decimal_integer_literal "0"
) ")"
block
{ "{"
expression_statement
method_invocation
identifier "sb"
. "."
identifier "append"
argument_list
( "("
identifier "joinString"
) ")"
; ";"
} "}"
expression_statement
method_invocation
identifier "sb"
. "."
identifier "append"
argument_list
( "("
method_invocation
identifier "NodeUtil"
. "."
identifier "getStringValue"
argument_list
( "("
identifier "elem"
) ")"
) ")"
; ";"
} "}"
else "else"
block
{ "{"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
method_invocation
identifier "sb"
. "."
identifier "length"
argument_list
( "("
) ")"
> ">"
decimal_integer_literal "0"
) ")"
block
{ "{"
line_comment "// + 2 for the quotes."
expression_statement
assignment_expression
identifier "foldedSize"
+= "+="
binary_expression
method_invocation
identifier "sb"
. "."
identifier "length"
argument_list
( "("
) ")"
+ "+"
decimal_integer_literal "2"
; ";"
expression_statement (+23 nodes collapsed)
expression_statement
assignment_expression
identifier "sb"
= "="
object_creation_expression
new "new"
type_identifier "StringBuilder"
argument_list
( "("
) ")"
; ";"
} "}"
expression_statement
assignment_expression
identifier "foldedSize"
+= "+="
method_invocation
identifier "InlineCostEstimator"
. "."
identifier "getCost"
argument_list
( "("
identifier "elem"
) ")"
; ";"
expression_statement
method_invocation
identifier "arrayFoldedChildren"
. "."
identifier "add"
argument_list
( "("
identifier "elem"
) ")"
; ";"
} "}"
expression_statement
assignment_expression
identifier "elem"
= "="
method_invocation
identifier "elem"
. "."
identifier "getNext"
argument_list
( "("
) ")"
; ";"
} "}"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
method_invocation
identifier "sb"
. "."
identifier "length"
argument_list
( "("
) ")"
> ">"
decimal_integer_literal "0"
) ")"
block (+42 nodes collapsed)
line_comment "// one for each comma."
expression_statement
assignment_expression
identifier "foldedSize"
+= "+="
binary_expression
method_invocation
identifier "arrayFoldedChildren"
. "."
identifier "size"
argument_list
( "("
) ")"
- "-"
decimal_integer_literal "1"
; ";"
local_variable_declaration
integral_type
int "int"
variable_declarator
identifier "originalSize"
= "="
method_invocation
identifier "InlineCostEstimator"
. "."
identifier "getCost"
argument_list
( "("
identifier "n"
) ")"
; ";"
switch_expression (+283 nodes collapsed)
expression_statement
method_invocation
method_invocation
identifier "t"
. "."
identifier "getCompiler"
argument_list
( "("
) ")"
. "."
identifier "reportCodeChange"
argument_list
( "("
) ")"
; ";"
} "}"
block_comment "/**\n * Try to fold array-element. e.g [1, 2, 3][10];\n */"
method_declaration (+347 nodes collapsed)
block_comment "/**\n * Try to fold array-length. e.g [1, 2, 3].length ==> "...
method_declaration (+229 nodes collapsed)
block_comment "/**\n * Try to fold a RegExp constructor to a regular expre"...
method_declaration (+400 nodes collapsed)
field_declaration (+21 nodes collapsed)
block_comment "/**\n * are the given flags valid regular expression flags?"...
method_declaration (+32 nodes collapsed)
block_comment "/**\n * are the given flags safe to fold?\n * We don't fol"...
method_declaration (+29 nodes collapsed)
block_comment "/**\n * returns a string node that can safely be rendered i"...
method_declaration (+232 nodes collapsed)
block_comment "/**\n * Replaces a new Array or Object node with an object "...
method_declaration (+117 nodes collapsed)
block_comment "/**\n * true if the javascript string would contain a unico"...
method_declaration (+147 nodes collapsed)
block_comment "/**\n * Removes WHILEs that always evaluate to false.\n */"
method_declaration (+124 nodes collapsed)
block_comment "/**\n * Removes FORs that always evaluate to false.\n */"
method_declaration (+171 nodes collapsed)
block_comment "/**\n * Removes DOs that always evaluate to false. This lea"...
method_declaration (+171 nodes collapsed)
block_comment "/**\n *\n */"
method_declaration (+90 nodes collapsed)
block_comment "/**\n * Try to minimize conditions expressions, as there ar"...
method_declaration (+493 nodes collapsed)
block_comment "/**\n * Remove always true loop conditions.\n */"
method_declaration (+87 nodes collapsed)
block_comment "/**\n * Replaces a node with a number node if the new numbe"...
method_declaration (+86 nodes collapsed)
block_comment "/**\n * @return Whether the node is a block with a single s"...
method_declaration (+71 nodes collapsed)
block_comment "/**\n * @return The expression node.\n */"
method_declaration (+39 nodes collapsed)
block_comment "/**\n * @return Whether the node is a block with a single s"...
method_declaration (+98 nodes collapsed)
block_comment "/**\n * @return The expression that is part of the return.\n"...
method_declaration (+45 nodes collapsed)
block_comment "/**\n * @return Whether the node is a block with a single s"...
method_declaration (+98 nodes collapsed)
block_comment "/**\n * @return The var node.\n */"
method_declaration (+39 nodes collapsed)
} "}"