Class RhinoToAstTranslator
java.lang.Object
com.ibm.wala.cast.js.translator.RhinoToAstTranslator
- All Implemented Interfaces:
TranslatorToCAst
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.ibm.wala.cast.ir.translator.TranslatorToCAst
TranslatorToCAst.DelegatingContext<C extends TranslatorToCAst.WalkContext<C,
T>, T>, TranslatorToCAst.DoLoopTranslator, TranslatorToCAst.Error -
Field Summary
-
Constructor Summary
ConstructorDescriptionRhinoToAstTranslator
(CAst Ast, ModuleEntry m, String scriptName, boolean replicateForDoLoops) RhinoToAstTranslator
(CAst Ast, ModuleEntry m, String scriptName, boolean replicateForDoLoops, boolean useNewForIn) -
Method Summary
Modifier and TypeMethodDescription<C extends CAstRewriter.RewriteContext<K>,
K extends CAstRewriter.CopyKey<K>>
voidaddRewriter
(CAstRewriterFactory<C, K> factory, boolean prepend) protected CAstNode
noteSourcePosition
(com.ibm.wala.cast.js.translator.RhinoToAstTranslator.WalkContext context, CAstNode n, org.mozilla.javascript.ast.AstNode p) parse the JavaScript code using Rhino, and then translate the resulting AST to CAstMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.ibm.wala.cast.ir.translator.TranslatorToCAst
pushSourcePosition
-
Field Details
-
STANDARD_CALL_FN_NAME
a dummy name to use for standard function calls, only used to distinguish them from constructor calls- See Also:
-
CTOR_CALL_FN_NAME
name used for constructor calls, used to distinguish them from standard function calls- See Also:
-
-
Constructor Details
-
RhinoToAstTranslator
public RhinoToAstTranslator(CAst Ast, ModuleEntry m, String scriptName, boolean replicateForDoLoops) -
RhinoToAstTranslator
public RhinoToAstTranslator(CAst Ast, ModuleEntry m, String scriptName, boolean replicateForDoLoops, boolean useNewForIn)
-
-
Method Details
-
noteSourcePosition
-
translateToCAst
public CAstEntity translateToCAst() throws TranslatorToCAst.Error, IOException, TranslatorToCAst.Errorparse the JavaScript code using Rhino, and then translate the resulting AST to CAst- Specified by:
translateToCAst
in interfaceTranslatorToCAst
- Throws:
TranslatorToCAst.Error
IOException
-
addRewriter
public <C extends CAstRewriter.RewriteContext<K>,K extends CAstRewriter.CopyKey<K>> void addRewriter(CAstRewriterFactory<C, K> factory, boolean prepend) - Specified by:
addRewriter
in interfaceTranslatorToCAst
-