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 (+21 nodes collapsed)
line_comment "// The LOCALE independent \"locale\""
field_declaration
modifiers
private "private"
static "static"
final "final"
type_identifier "Locale"
variable_declarator
identifier "ROOT_LOCALE"
= "="
object_creation_expression
new "new"
type_identifier "Locale"
argument_list
( "("
string_literal
" "\""
" "\""
) ")"
; ";"
method_declaration (+169 nodes collapsed)
method_declaration (+458 nodes collapsed)
method_declaration (+106 nodes collapsed)
method_declaration (+317 nodes collapsed)
method_declaration (+68 nodes collapsed)
method_declaration (+370 nodes collapsed)
block_comment "/**\n * Folds 'typeof(foo)' if foo is a literal, e.g.\n * "...
method_declaration (+351 nodes collapsed)
method_declaration (+696 nodes collapsed)
block_comment "/**\n * Try to fold {@code left instanceof right} into {@co"...
method_declaration (+214 nodes collapsed)
method_declaration (+518 nodes collapsed)
block_comment "/**\n * Try to fold a AND/OR node.\n */"
method_declaration (+207 nodes collapsed)
block_comment "/**\n * Expressions such as [foo() + 'a' + 'b'] generate pa"...
method_declaration (+408 nodes collapsed)
block_comment "/**\n * Try to fold an ADD node with constant operands\n *"...
method_declaration (+155 nodes collapsed)
block_comment "/**\n * Try to fold arithmetic binary operators\n */"
method_declaration (+99 nodes collapsed)
block_comment "/**\n * Try to fold arithmetic binary operators\n */"
method_declaration
modifiers
private "private"
type_identifier "Node"
identifier "performArithmeticOp"
formal_parameters
( "("
formal_parameter
integral_type
int "int"
identifier "opType"
, ","
formal_parameter
type_identifier "Node"
identifier "left"
, ","
formal_parameter
type_identifier "Node"
identifier "right"
) ")"
block
{ "{"
line_comment "// Unlike other operations, ADD operands are not always conv"...
line_comment "// to Number."
if_statement (+46 nodes collapsed)
local_variable_declaration
floating_point_type
double "double"
variable_declarator
identifier "result"
; ";"
line_comment "// TODO(johnlenz): Handle NaN with unknown value. BIT ops co"...
line_comment "// to zero so this is a little akward here."
local_variable_declaration
type_identifier "Double"
variable_declarator
identifier "lValObj"
= "="
method_invocation
identifier "NodeUtil"
. "."
identifier "getNumberValue"
argument_list
( "("
identifier "left"
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "lValObj"
== "=="
null_literal "null"
) ")"
block
{ "{"
return_statement
return "return"
null_literal "null"
; ";"
} "}"
local_variable_declaration
type_identifier "Double"
variable_declarator
identifier "rValObj"
= "="
method_invocation
identifier "NodeUtil"
. "."
identifier "getNumberValue"
argument_list
( "("
identifier "right"
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "rValObj"
== "=="
null_literal "null"
) ")"
block
{ "{"
return_statement
return "return"
null_literal "null"
; ";"
} "}"
local_variable_declaration
floating_point_type
double "double"
variable_declarator
identifier "lval"
= "="
identifier "lValObj"
; ";"
local_variable_declaration
floating_point_type
double "double"
variable_declarator
identifier "rval"
= "="
identifier "rValObj"
; ";"
switch_expression
switch "switch"
parenthesized_expression
( "("
identifier "opType"
) ")"
switch_block
{ "{"
switch_block_statement_group (+34 nodes collapsed)
switch_block_statement_group (+34 nodes collapsed)
switch_block_statement_group (+34 nodes collapsed)
switch_block_statement_group
switch_label
case "case"
field_access
identifier "Token"
. "."
identifier "ADD"
: ":"
expression_statement
assignment_expression
identifier "result"
= "="
binary_expression
identifier "lval"
+ "+"
identifier "rval"
; ";"
break_statement
break "break"
; ";"
switch_block_statement_group
switch_label
case "case"
field_access
identifier "Token"
. "."
identifier "SUB"
: ":"
expression_statement
assignment_expression
identifier "result"
= "="
binary_expression
identifier "lval"
- "-"
identifier "rval"
; ";"
break_statement
break "break"
; ";"
switch_block_statement_group
switch_label
case "case"
field_access
identifier "Token"
. "."
identifier "MUL"
: ":"
expression_statement
assignment_expression
identifier "result"
= "="
binary_expression
identifier "lval"
* "*"
identifier "rval"
; ";"
break_statement
break "break"
; ";"
switch_block_statement_group
switch_label
case "case"
field_access
identifier "Token"
. "."
identifier "MOD"
: ":"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "rval"
== "=="
decimal_integer_literal "0"
) ")"
block
{ "{"
expression_statement
method_invocation
identifier "error"
argument_list
( "("
method_invocation
identifier "DiagnosticType"
. "."
identifier "error"
argument_list
( "("
string_literal
" "\""
string_fragment "JSC_DIVIDE_BY_0_ERROR"
" "\""
, ","
string_literal
" "\""
string_fragment "Divide by 0"
" "\""
) ")"
, ","
identifier "right"
) ")"
; ";"
return_statement
return "return"
null_literal "null"
; ";"
} "}"
expression_statement
assignment_expression
identifier "result"
= "="
binary_expression
identifier "lval"
% "%"
identifier "rval"
; ";"
break_statement
break "break"
; ";"
switch_block_statement_group
switch_label
case "case"
field_access
identifier "Token"
. "."
identifier "DIV"
: ":"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "rval"
== "=="
decimal_integer_literal "0"
) ")"
block
{ "{"
expression_statement
method_invocation
identifier "error"
argument_list
( "("
method_invocation
identifier "DiagnosticType"
. "."
identifier "error"
argument_list
( "("
string_literal
" "\""
string_fragment "JSC_DIVIDE_BY_0_ERROR"
" "\""
, ","
string_literal
" "\""
string_fragment "Divide by 0"
" "\""
) ")"
, ","
identifier "right"
) ")"
; ";"
return_statement
return "return"
null_literal "null"
; ";"
} "}"
expression_statement
assignment_expression
identifier "result"
= "="
binary_expression
identifier "lval"
/ "/"
identifier "rval"
; ";"
break_statement
break "break"
; ";"
switch_block_statement_group
switch_label
default "default"
: ":"
throw_statement
throw "throw"
object_creation_expression
new "new"
type_identifier "Error"
argument_list
( "("
string_literal
" "\""
string_fragment "Unexpected arithmetic operator"
" "\""
) ")"
; ";"
} "}"
line_comment "// TODO(johnlenz): consider removing the result length check"...
line_comment "// length of the left and right value plus 1 byte for the op"...
if_statement (+207 nodes collapsed)
return_statement
return "return"
null_literal "null"
; ";"
} "}"
block_comment "/**\n * Expressions such as [foo() * 10 * 20] generate pars"...
method_declaration (+333 nodes collapsed)
method_declaration (+174 nodes collapsed)
block_comment "/**\n * Try to fold shift operations\n */"
method_declaration (+424 nodes collapsed)
block_comment "/**\n * Try to fold comparison nodes, e.g ==\n */"
method_declaration (+1249 nodes collapsed)
block_comment "/**\n * The result of the comparison as a Boolean or null i"...
method_declaration (+336 nodes collapsed)
block_comment "/**\n * @param value The value to compare to \"undefined\"\n "...
method_declaration (+246 nodes collapsed)
block_comment "/**\n * Try to fold away unnecessary object instantiation.\n"...
method_declaration (+64 nodes collapsed)
block_comment "/** Returns whether this node must be coerced to a string. *"...
method_declaration (+54 nodes collapsed)
method_declaration (+259 nodes collapsed)
method_declaration (+63 nodes collapsed)
block_comment "/**\n * Try to eveluate known String methods\n * .index"...
method_declaration (+411 nodes collapsed)
block_comment "/**\n * @return The lowered string Node.\n */"
method_declaration (+82 nodes collapsed)
block_comment "/**\n * @return The uppered string Node.\n */"
method_declaration (+82 nodes collapsed)
block_comment "/**\n * Try to evaluate String.indexOf/lastIndexOf:\n * "...
method_declaration (+315 nodes collapsed)
block_comment "/**\n * Try to fold an array join: ['a', 'b', 'c'].join('')"...
method_declaration (+911 nodes collapsed)
block_comment "/**\n * Try to fold .substr() calls on strings\n */"
method_declaration (+375 nodes collapsed)
block_comment "/**\n * Try to fold .substring() calls on strings\n */"
method_declaration (+379 nodes collapsed)
block_comment "/**\n * Try to fold array-element. e.g [1, 2, 3][10];\n */"
method_declaration (+333 nodes collapsed)
block_comment "/**\n * Try to fold array-length. e.g [1, 2, 3].length ==> "...
method_declaration (+251 nodes collapsed)
} "}"