public final class JsProgram extends JsNode
Constructor and Description |
---|
JsProgram() |
JsProgram(CorrelationFactory correlator)
Constructs a JavaScript program object.
|
Modifier and Type | Method and Description |
---|---|
SourceInfo |
createSourceInfo(int startPos,
int endPos,
int startLine,
String fileName) |
SourceInfo |
createSourceInfo(int lineNumber,
String location) |
SourceInfo |
createSourceInfoSynthetic(Class<?> caller) |
JsProgramFragment |
getFragment(int fragment) |
JsBlock |
getFragmentBlock(int fragment) |
int |
getFragmentCount() |
JsBlock |
getGlobalBlock()
Gets the one and only global block.
|
JsName |
getIndexedField(String name) |
JsFunction |
getIndexedFunction(String name) |
NodeKind |
getKind() |
JsScope |
getObjectScope() |
JsScope |
getScope()
Gets the top level scope.
|
void |
setFragmentCount(int fragments) |
void |
setIndexedFields(Map<String,JsName> indexedFields) |
void |
setIndexedFunctions(Map<String,JsFunction> indexedFunctions) |
void |
traverse(JsVisitor v,
JsContext ctx)
Causes this object to have the visitor visit itself and its children.
|
getSourceInfo, setSourceInfo, toSource, toSource, toString
public JsProgram()
public JsProgram(CorrelationFactory correlator)
public SourceInfo createSourceInfo(int startPos, int endPos, int startLine, String fileName)
public SourceInfo createSourceInfo(int lineNumber, String location)
public SourceInfo createSourceInfoSynthetic(Class<?> caller)
public JsProgramFragment getFragment(int fragment)
public JsBlock getFragmentBlock(int fragment)
public int getFragmentCount()
public JsBlock getGlobalBlock()
public JsFunction getIndexedFunction(String name)
public JsScope getObjectScope()
public JsScope getScope()
public void setFragmentCount(int fragments)
public void setIndexedFunctions(Map<String,JsFunction> indexedFunctions)
public void traverse(JsVisitor v, JsContext ctx)
JsVisitable
v
- the visitor that should traverse this nodectx
- the context of an existing traversalCopyright © 2018. All rights reserved.