|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.javascript.jscomp.NodeUtil
public final class NodeUtil
NodeUtil contains generally useful AST utilities.
Method Summary | |
---|---|
static JSDocInfo |
getFunctionJSDocInfo(Node n)
Get the JSDocInfo for a function. |
static Node |
getFunctionParameters(Node fnNode)
|
static InputId |
getInputId(Node n)
|
static String |
getNearestFunctionName(Node n)
Gets the function's name. |
static StaticSourceFile |
getSourceFile(Node n)
|
static String |
getSourceName(Node n)
|
static boolean |
isLValue(Node n)
Determines whether this node is used as an L-value. |
static TernaryValue |
isStrWhiteSpaceChar(int c)
Copied from Rhino's ScriptRuntime |
static boolean |
isValidQualifiedName(String name)
Determines whether the given name is a valid qualified name. |
static Map<Node,Node> |
mapMainToClone(Node main,
Node clone)
Given an AST and its copy, map the root node of each scope of main to the corresponding root node of clone |
static Node |
newQualifiedNameNode(CodingConvention convention,
String name)
Creates a node representing a qualified name. |
static Node |
newQualifiedNameNodeDeclaration(CodingConvention convention,
String name,
Node value,
JSDocInfo info)
Creates a node representing a qualified name. |
static void |
verifyScopeChanges(Map<Node,Node> map,
Node main,
boolean verifyUnchangedNodes,
AbstractCompiler compiler)
Checks that the scope roots marked as changed have indeed changed |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static TernaryValue isStrWhiteSpaceChar(int c)
public static String getNearestFunctionName(Node n)
{'name': function() ...}
{name: function() ...}
function name() ...
var name = function() ...
qualified.name = function() ...
var name2 = function name1() ...
qualified.name2 = function name1() ...
n
- a node whose type is Token.FUNCTION
null
if it has no namepublic static boolean isLValue(Node n)
n
- The node
public static Node newQualifiedNameNode(CodingConvention convention, String name)
name
- A qualified name (e.g. "foo" or "foo.bar.baz")
public static Node newQualifiedNameNodeDeclaration(CodingConvention convention, String name, Node value, JSDocInfo info)
name
- A qualified name (e.g. "foo" or "foo.bar.baz")
public static boolean isValidQualifiedName(String name)
public static Node getFunctionParameters(Node fnNode)
fnNode
- The function.
public static JSDocInfo getFunctionJSDocInfo(Node n)
public static String getSourceName(Node n)
n
- The node.
public static StaticSourceFile getSourceFile(Node n)
n
- The node.
public static InputId getInputId(Node n)
n
- The node.
public static Map<Node,Node> mapMainToClone(Node main, Node clone)
public static void verifyScopeChanges(Map<Node,Node> map, Node main, boolean verifyUnchangedNodes, AbstractCompiler compiler)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |