class_body
{ "{"
line_comment "// Package protected for tests"
field_declaration
modifiers
private "private"
final "final"
type_identifier "AbstractCompiler"
variable_declarator
identifier "compiler"
; ";"
field_declaration
modifiers
private "private"
final "final"
type_identifier "Callback"
variable_declarator
identifier "callback"
; ";"
block_comment "/** Contains the current node*/"
field_declaration
modifiers
private "private"
type_identifier "Node"
variable_declarator
identifier "curNode"
; ";"
field_declaration (+26 nodes collapsed)
block_comment "/**\n * Stack containing the Scopes that have been created."...
field_declaration (+25 nodes collapsed)
block_comment "/**\n * A stack of scope roots. All scopes that have not be"...
field_declaration (+25 nodes collapsed)
block_comment "/**\n * Stack of control flow graphs (CFG). There is one CF"...
field_declaration (+32 nodes collapsed)
block_comment "/** The current source file name */"
field_declaration
modifiers
private "private"
type_identifier "String"
variable_declarator
identifier "sourceName"
; ";"
block_comment "/** The current input */"
field_declaration
modifiers
private "private"
type_identifier "InputId"
variable_declarator
identifier "inputId"
; ";"
block_comment "/** The scope creator */"
field_declaration
modifiers
private "private"
type_identifier "ScopeCreator"
variable_declarator
identifier "scopeCreator"
; ";"
block_comment "/** Possible callback for scope entry and exist **/"
field_declaration
modifiers
private "private"
type_identifier "ScopedCallback"
variable_declarator
identifier "scopeCallback"
; ";"
block_comment "/**\n * Callback\n */"
interface_declaration (+46 nodes collapsed)
block_comment "/**\n * Callback that also knows about scope changes\n */"
interface_declaration (+34 nodes collapsed)
block_comment "/**\n * Abstract callback to visit all nodes in post order."...
class_declaration (+44 nodes collapsed)
block_comment "/**\n * Abstract scoped callback to visit all nodes in post"...
class_declaration (+78 nodes collapsed)
block_comment "/**\n * Abstract callback to visit all nodes but not traver"...
class_declaration (+72 nodes collapsed)
block_comment "/**\n * Abstract callback to visit all structure and statem"...
class_declaration (+67 nodes collapsed)
block_comment "/**\n * Abstract callback to visit a pruned set of nodes.\n "...
class_declaration (+149 nodes collapsed)
block_comment "/**\n * Creates a node traversal using the specified callba"...
constructor_declaration (+34 nodes collapsed)
block_comment "/**\n * Creates a node traversal using the specified callba"...
constructor_declaration (+93 nodes collapsed)
method_declaration (+119 nodes collapsed)
method_declaration (+90 nodes collapsed)
block_comment "/**\n * Traverses a parse tree recursively.\n */"
method_declaration (+90 nodes collapsed)
method_declaration (+31 nodes collapsed)
method_declaration (+176 nodes collapsed)
field_declaration
modifiers
private "private"
static "static"
final "final"
type_identifier "String"
variable_declarator
identifier "MISSING_SOURCE"
= "="
string_literal
" "\""
string_fragment "[source unknown]"
" "\""
; ";"
method_declaration (+135 nodes collapsed)
block_comment "/**\n * Traverses a parse tree recursively with a scope, st"...
method_declaration (+77 nodes collapsed)
block_comment "/**\n * Traverses a parse tree recursively with a scope, st"...
method_declaration (+165 nodes collapsed)
block_comment "/**\n * Traverses an inner node recursively with a refined "...
method_declaration (+99 nodes collapsed)
block_comment "/**\n * Gets the compiler.\n */"
method_declaration (+21 nodes collapsed)
block_comment "/**\n * Gets the current line number, or zero if it cannot "...
method_declaration (+77 nodes collapsed)
block_comment "/**\n * Gets the current input source name.\n *\n * @retu"...
method_declaration
modifiers
public "public"
type_identifier "String"
identifier "getSourceName"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "sourceName"
; ";"
} "}"
block_comment "/**\n * Gets the current input source.\n */"
method_declaration (+22 nodes collapsed)
block_comment "/**\n * Gets the current input module.\n */"
method_declaration (+40 nodes collapsed)
block_comment "/** Returns the node currently being traversed. */"
method_declaration
modifiers
public "public"
type_identifier "Node"
identifier "getCurrentNode"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "curNode"
; ";"
} "}"
block_comment "/**\n * Traverses a node recursively.\n */"
method_declaration (+48 nodes collapsed)
block_comment "/**\n * Traverses a list of node trees.\n */"
method_declaration (+53 nodes collapsed)
method_declaration (+50 nodes collapsed)
block_comment "/**\n * Traverses a branch.\n */"
method_declaration (+221 nodes collapsed)
block_comment "/**\n * Traverses a function.\n */"
method_declaration
modifiers
private "private"
void_type "void"
identifier "traverseFunction"
formal_parameters
( "("
formal_parameter
type_identifier "Node"
identifier "n"
, ","
formal_parameter
type_identifier "Node"
identifier "parent"
) ")"
block
{ "{"
expression_statement
method_invocation
identifier "Preconditions"
. "."
identifier "checkState"
argument_list
( "("
binary_expression
method_invocation
identifier "n"
. "."
identifier "getChildCount"
argument_list
( "("
) ")"
== "=="
decimal_integer_literal "3"
) ")"
; ";"
expression_statement
method_invocation
identifier "Preconditions"
. "."
identifier "checkState"
argument_list
( "("
method_invocation
identifier "n"
. "."
identifier "isFunction"
argument_list
( "("
) ")"
) ")"
; ";"
local_variable_declaration
modifiers
final "final"
type_identifier "Node"
variable_declarator
identifier "fnName"
= "="
method_invocation
identifier "n"
. "."
identifier "getFirstChild"
argument_list
( "("
) ")"
; ";"
local_variable_declaration (+23 nodes collapsed)
if_statement (+22 nodes collapsed)
expression_statement
assignment_expression
identifier "curNode"
= "="
identifier "n"
; ";"
expression_statement
method_invocation
identifier "pushScope"
argument_list
( "("
identifier "n"
) ")"
; ";"
if_statement (+21 nodes collapsed)
local_variable_declaration
modifiers
final "final"
type_identifier "Node"
variable_declarator
identifier "args"
= "="
method_invocation
identifier "fnName"
. "."
identifier "getNext"
argument_list
( "("
) ")"
; ";"
local_variable_declaration
modifiers
final "final"
type_identifier "Node"
variable_declarator
identifier "body"
= "="
method_invocation
identifier "args"
. "."
identifier "getNext"
argument_list
( "("
) ")"
; ";"
line_comment "// Args"
expression_statement
method_invocation
identifier "traverseBranch"
argument_list
( "("
identifier "args"
, ","
identifier "n"
) ")"
; ";"
line_comment "// Body"
expression_statement
method_invocation
identifier "Preconditions"
. "."
identifier "checkState"
argument_list
( "("
binary_expression
binary_expression
method_invocation
identifier "body"
. "."
identifier "getNext"
argument_list
( "("
) ")"
== "=="
null_literal "null"
&& "&&"
method_invocation
identifier "body"
. "."
identifier "isBlock"
argument_list
( "("
) ")"
) ")"
; ";"
expression_statement
method_invocation
identifier "traverseBranch"
argument_list
( "("
identifier "body"
, ","
identifier "n"
) ")"
; ";"
expression_statement
method_invocation
identifier "popScope"
argument_list
( "("
) ")"
; ";"
} "}"
block_comment "/** Examines the functions stack for the last instance of a "...
method_declaration (+101 nodes collapsed)
block_comment "/** Creates a new scope (e.g. when entering a function). */"
method_declaration (+69 nodes collapsed)
block_comment "/** Creates a new scope (e.g. when entering a function). */"
method_declaration (+69 nodes collapsed)
block_comment "/** Pops back to the previous scope (e.g. when leaving a fun"...
method_declaration (+79 nodes collapsed)
block_comment "/** Gets the current scope. */"
method_declaration (+131 nodes collapsed)
block_comment "/** Gets the control flow graph for the current JS scope. */"
method_declaration (+102 nodes collapsed)
block_comment "/** Returns the current scope's root. */"
method_declaration (+56 nodes collapsed)
block_comment "/**\n * Determines whether the traversal is currently in th"...
method_declaration
boolean_type "boolean"
identifier "inGlobalScope"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
binary_expression
method_invocation
identifier "getScopeDepth"
argument_list
( "("
) ")"
<= "<="
decimal_integer_literal "1"
; ";"
} "}"
method_declaration (+29 nodes collapsed)
method_declaration (+35 nodes collapsed)
block_comment "/** Reports a diagnostic (error or warning) */"
method_declaration (+58 nodes collapsed)
method_declaration (+42 nodes collapsed)
method_declaration
type_identifier "InputId"
identifier "getInputId"
formal_parameters
( "("
) ")"
block
{ "{"
return_statement
return "return"
identifier "inputId"
; ";"
} "}"
block_comment "/**\n * Creates a JSError during NodeTraversal.\n *\n * @"...
method_declaration (+51 nodes collapsed)
block_comment "/**\n * Creates a JSError during NodeTraversal.\n *\n * @"...
method_declaration (+45 nodes collapsed)
} "}"