reorganize stuff for using JavaScript stuff from Eclipse

This commit is contained in:
dolby 2012-08-21 09:48:53 -04:00
parent 3317c1ccf6
commit 72e8dc9098
308 changed files with 1087 additions and 33377 deletions

View File

@ -3,5 +3,6 @@
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="source"/> <classpathentry kind="src" path="source"/>
<classpathentry kind="src" path="data"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>
</classpath> </classpath>

View File

@ -0,0 +1,11 @@
java\/awt\/.*
javax\/swing\/.*
sun\/awt\/.*
sun\/swing\/.*
com\/sun\/.*
sun\/.*
org\/netbeans\/.*
org\/openide\/.*
com\/ibm\/crypto\/.*
com\/ibm\/security\/.*
org\/apache\/xerces\/.*

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -20,9 +20,9 @@ import org.junit.Test;
import com.ibm.wala.cast.java.client.JDTJavaSourceAnalysisEngine; import com.ibm.wala.cast.java.client.JDTJavaSourceAnalysisEngine;
import com.ibm.wala.cast.java.client.JavaSourceAnalysisEngine; import com.ibm.wala.cast.java.client.JavaSourceAnalysisEngine;
import com.ibm.wala.cast.java.ipa.callgraph.JavaSourceAnalysisScope; import com.ibm.wala.cast.java.ipa.callgraph.JavaSourceAnalysisScope;
import com.ibm.wala.cast.java.jdt.test.Activator;
import com.ibm.wala.cast.java.test.ide.IDEIRTestUtil; import com.ibm.wala.cast.java.test.ide.IDEIRTestUtil;
import com.ibm.wala.core.tests.callGraph.CallGraphTestUtil; import com.ibm.wala.core.tests.callGraph.CallGraphTestUtil;
import com.ibm.wala.core.tests.plugin.CoreTestsPlugin;
import com.ibm.wala.ide.tests.util.EclipseTestUtil; import com.ibm.wala.ide.tests.util.EclipseTestUtil;
import com.ibm.wala.ide.util.EclipseFileProvider; import com.ibm.wala.ide.util.EclipseFileProvider;
import com.ibm.wala.ipa.callgraph.AnalysisScope; import com.ibm.wala.ipa.callgraph.AnalysisScope;
@ -43,7 +43,7 @@ public class JDTJava15IRTests extends IRTests {
@BeforeClass @BeforeClass
public static void beforeClass() { public static void beforeClass() {
EclipseTestUtil.importZippedProject(TestPlugin.getDefault(), JDTJavaIRTests.PROJECT_NAME, JDTJavaIRTests.PROJECT_ZIP, new NullProgressMonitor()); EclipseTestUtil.importZippedProject(Activator.getDefault(), JDTJavaIRTests.PROJECT_NAME, JDTJavaIRTests.PROJECT_ZIP, new NullProgressMonitor());
System.err.println("finish importing project"); System.err.println("finish importing project");
} }
@ -63,7 +63,7 @@ public class JDTJava15IRTests extends IRTests {
try { try {
engine.setExclusionsFile((new EclipseFileProvider()) engine.setExclusionsFile((new EclipseFileProvider())
.getFileFromPlugin(CoreTestsPlugin.getDefault(), CallGraphTestUtil.REGRESSION_EXCLUSIONS).getAbsolutePath()); .getFileFromPlugin(Activator.getDefault(), CallGraphTestUtil.REGRESSION_EXCLUSIONS).getAbsolutePath());
} catch (IOException e) { } catch (IOException e) {
Assert.assertFalse("Cannot find exclusions file", true); Assert.assertFalse("Cannot find exclusions file", true);
} }

View File

@ -50,9 +50,9 @@ import org.junit.BeforeClass;
import com.ibm.wala.cast.java.client.JDTJavaSourceAnalysisEngine; import com.ibm.wala.cast.java.client.JDTJavaSourceAnalysisEngine;
import com.ibm.wala.cast.java.client.JavaSourceAnalysisEngine; import com.ibm.wala.cast.java.client.JavaSourceAnalysisEngine;
import com.ibm.wala.cast.java.ipa.callgraph.JavaSourceAnalysisScope; import com.ibm.wala.cast.java.ipa.callgraph.JavaSourceAnalysisScope;
import com.ibm.wala.cast.java.jdt.test.Activator;
import com.ibm.wala.cast.java.test.ide.IDEIRTestUtil; import com.ibm.wala.cast.java.test.ide.IDEIRTestUtil;
import com.ibm.wala.core.tests.callGraph.CallGraphTestUtil; import com.ibm.wala.core.tests.callGraph.CallGraphTestUtil;
import com.ibm.wala.core.tests.plugin.CoreTestsPlugin;
import com.ibm.wala.ide.tests.util.EclipseTestUtil; import com.ibm.wala.ide.tests.util.EclipseTestUtil;
import com.ibm.wala.ide.util.EclipseFileProvider; import com.ibm.wala.ide.util.EclipseFileProvider;
import com.ibm.wala.ipa.callgraph.AnalysisScope; import com.ibm.wala.ipa.callgraph.AnalysisScope;
@ -77,7 +77,7 @@ public class JDTJavaIRTests extends JavaIRTests {
@BeforeClass @BeforeClass
public static void beforeClass() { public static void beforeClass() {
EclipseTestUtil.importZippedProject(TestPlugin.getDefault(), PROJECT_NAME, PROJECT_ZIP, new NullProgressMonitor()); EclipseTestUtil.importZippedProject(Activator.getDefault(), PROJECT_NAME, PROJECT_ZIP, new NullProgressMonitor());
System.err.println("finish importing project"); System.err.println("finish importing project");
} }
@ -97,7 +97,7 @@ public class JDTJavaIRTests extends JavaIRTests {
try { try {
engine.setExclusionsFile((new EclipseFileProvider()) engine.setExclusionsFile((new EclipseFileProvider())
.getFileFromPlugin(CoreTestsPlugin.getDefault(), CallGraphTestUtil.REGRESSION_EXCLUSIONS).getAbsolutePath()); .getFileFromPlugin(Activator.getDefault(), CallGraphTestUtil.REGRESSION_EXCLUSIONS).getAbsolutePath());
} catch (IOException e) { } catch (IOException e) {
Assert.assertFalse("Cannot find exclusions file", true); Assert.assertFalse("Cannot find exclusions file", true);
} }

View File

@ -38,17 +38,16 @@
package com.ibm.wala.cast.java.translator.jdt; package com.ibm.wala.cast.java.translator.jdt;
import java.io.File; import java.io.File;
import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProject;
import org.eclipse.jdt.core.ICompilationUnit; import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.JavaCore; import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.compiler.IProblem;
import org.eclipse.jdt.core.dom.AST; import org.eclipse.jdt.core.dom.AST;
import org.eclipse.jdt.core.dom.ASTParser; import org.eclipse.jdt.core.dom.ASTParser;
import org.eclipse.jdt.core.dom.ASTRequestor; import org.eclipse.jdt.core.dom.ASTRequestor;
@ -61,9 +60,13 @@ import com.ibm.wala.classLoader.JarFileModule;
import com.ibm.wala.classLoader.Module; import com.ibm.wala.classLoader.Module;
import com.ibm.wala.classLoader.ModuleEntry; import com.ibm.wala.classLoader.ModuleEntry;
import com.ibm.wala.ide.classloader.EclipseSourceFileModule; import com.ibm.wala.ide.classloader.EclipseSourceFileModule;
import com.ibm.wala.ide.util.HeadlessUtil;
import com.ibm.wala.ide.util.HeadlessUtil.EclipseCompiler;
import com.ibm.wala.ide.util.HeadlessUtil.Parser;
import com.ibm.wala.ipa.callgraph.AnalysisScope; import com.ibm.wala.ipa.callgraph.AnalysisScope;
import com.ibm.wala.types.ClassLoaderReference; import com.ibm.wala.types.ClassLoaderReference;
import com.ibm.wala.util.debug.Assertions; import com.ibm.wala.util.debug.Assertions;
import com.ibm.wala.util.functions.Function;
/** /**
* A SourceModuleTranslator whose implementation of loadAllSources() uses the PolyglotFrontEnd pseudo-compiler to generate DOMO IR * A SourceModuleTranslator whose implementation of loadAllSources() uses the PolyglotFrontEnd pseudo-compiler to generate DOMO IR
@ -115,54 +118,44 @@ public class JDTSourceModuleTranslator implements SourceModuleTranslator {
public void loadAllSources(Set<ModuleEntry> modules) { public void loadAllSources(Set<ModuleEntry> modules) {
// TODO: we might need one AST (-> "Object" class) for all files. // TODO: we might need one AST (-> "Object" class) for all files.
// TODO: group by project and send 'em in // TODO: group by project and send 'em in
System.out.println(modules); System.out.println(modules);
// sort files into projects HeadlessUtil.parseModules(modules, new EclipseCompiler<ICompilationUnit, CompilationUnit>() {
Map<IProject, Map<ICompilationUnit,EclipseSourceFileModule>> projectsFiles = new HashMap<IProject, Map<ICompilationUnit,EclipseSourceFileModule>>(); @Override
for (ModuleEntry m : modules) { public ICompilationUnit getCompilationUnit(IFile file) {
assert m instanceof EclipseSourceFileModule : "Expecing EclipseSourceFileModule, not " + m.getClass(); return JavaCore.createCompilationUnitFrom(file);
EclipseSourceFileModule entry = (EclipseSourceFileModule) m;
IProject proj = entry.getIFile().getProject();
if (!projectsFiles.containsKey(proj)) {
projectsFiles.put(proj, new HashMap<ICompilationUnit,EclipseSourceFileModule>());
} }
projectsFiles.get(proj).put(JavaCore.createCompilationUnitFrom(entry.getIFile()), entry); @Override
} public Parser<ICompilationUnit, CompilationUnit> getParser() {
return new Parser<ICompilationUnit, CompilationUnit>() {
final ASTParser parser = ASTParser.newParser(AST.JLS3); final ASTParser parser;
{
for (final Map.Entry<IProject,Map<ICompilationUnit,EclipseSourceFileModule>> proj : projectsFiles.entrySet()) { parser = ASTParser.newParser(AST.JLS3);
parser.setProject(JavaCore.create(proj.getKey())); parser.setResolveBindings(true);
parser.setResolveBindings(true);
Set<ICompilationUnit> units = proj.getValue().keySet();
parser.createASTs(units.toArray(new ICompilationUnit[units.size()]), new String[0], new ASTRequestor() {
public void acceptAST(ICompilationUnit source, CompilationUnit ast) {
try {
JDTJava2CAstTranslator jdt2cast = makeCAstTranslator(ast, source.getUnderlyingResource().getLocation().toOSString());
final Java2IRTranslator java2ir = makeIRTranslator();
java2ir.translate(proj.getValue().get(source), jdt2cast.translateToCAst());
} catch (JavaModelException e) {
e.printStackTrace();
} }
@Override
IProblem[] problems = ast.getProblems(); public void setProject(IProject project) {
int length = problems.length; parser.setProject(JavaCore.create(project));
if (length > 0) {
StringBuffer buffer = new StringBuffer();
for (int i = 0; i < length; i++) {
buffer.append(problems[i].getMessage());
buffer.append('\n');
}
if (length != 0)
System.err.println("Unexpected problems in " + source.getElementName() + buffer.toString());
} }
} @Override
}, null); public void processASTs(final Map<ICompilationUnit,EclipseSourceFileModule> files, final Function<Object[], Boolean> errors) {
parser.createASTs(files.keySet().toArray(new ICompilationUnit[files.size()]), new String[0], new ASTRequestor() {
public void acceptAST(ICompilationUnit source, CompilationUnit ast) {
try {
JDTJava2CAstTranslator jdt2cast = makeCAstTranslator(ast, source.getUnderlyingResource().getLocation().toOSString());
final Java2IRTranslator java2ir = makeIRTranslator();
java2ir.translate(files.get(source), jdt2cast.translateToCAst());
} catch (JavaModelException e) {
e.printStackTrace();
}
} errors.apply(ast.getProblems());
}
}, null);
}
};
}
});
} }
protected Java2IRTranslator makeIRTranslator() { protected Java2IRTranslator makeIRTranslator() {

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" path="source"/> <classpathentry kind="src" path="source"/>
<classpathentry kind="lib" path="lib/polyglot.jar"/> <classpathentry exported="true" kind="lib" path="lib/polyglot.jar"/>
<classpathentry kind="lib" path="lib/java_cup.jar"/> <classpathentry exported="true" kind="lib" path="lib/java_cup.jar"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>

View File

@ -11,25 +11,41 @@ Require-Bundle: com.ibm.wala.cast.java,
org.eclipse.core.runtime, org.eclipse.core.runtime,
com.ibm.wala.shrike, com.ibm.wala.shrike,
org.eclipse.jdt.core, org.eclipse.jdt.core,
org.eclipse.core.resources, org.eclipse.core.resources
com.ibm.wala.ide
Bundle-RequiredExecutionEnvironment: J2SE-1.5 Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy Bundle-ActivationPolicy: lazy
Export-Package: com.ibm.wala.cast.java.client.polyglot, Export-Package: com.ibm.wala.cast.java.polyglot;uses:="org.eclipse.core.runtime,org.osgi.framework",
com.ibm.wala.cast.java.polyglot;uses:="org.osgi.framework,org.eclipse.core.runtime",
com.ibm.wala.cast.java.translator.polyglot; com.ibm.wala.cast.java.translator.polyglot;
uses:="com.ibm.wala.types, uses:="polyglot.types,
polyglot.types,
polyglot.util,
polyglot.ast,
com.ibm.wala.ipa.cha,
com.ibm.wala.cast.java.client,
com.ibm.wala.classLoader,
com.ibm.wala.cast.tree, com.ibm.wala.cast.tree,
com.ibm.wala.cast.java.loader, com.ibm.wala.classLoader,
com.ibm.wala.ipa.callgraph.impl, com.ibm.wala.ipa.cha,
com.ibm.wala.ipa.callgraph, com.ibm.wala.cast.java.types,
polyglot.frontend.goals,
com.ibm.wala.cast.tree.impl,
com.ibm.wala.cast.java.translator, com.ibm.wala.cast.java.translator,
com.ibm.wala.cast.java.types" com.ibm.wala.cast.java.client,
com.ibm.wala.types,
polyglot.ast,
polyglot.util,
com.ibm.wala.ipa.callgraph,
polyglot.frontend,
com.ibm.wala.cast.ir.translator,
com.ibm.wala.ipa.callgraph.impl,
com.ibm.wala.cast.java.loader,
com.ibm.wala.cast.tree.impl",
java_cup,
java_cup.runtime,
polyglot.ast,
polyglot.dispatch,
polyglot.frontend,
polyglot.lex,
polyglot.main,
polyglot.parse,
polyglot.qq,
polyglot.types,
polyglot.types.reflect,
polyglot.util,
polyglot.util.typedump,
polyglot.visit
Bundle-ClassPath: lib/java_cup.jar,
lib/polyglot.jar,
.

View File

@ -1,4 +1,6 @@
source.. = source/ source.. = source/
output.. = bin/ output.. = bin/
bin.includes = META-INF/,\ bin.includes = META-INF/,\
. .,\
lib/java_cup.jar,\
lib/polyglot.jar

View File

@ -5,13 +5,12 @@ Bundle-SymbolicName: com.ibm.wala.cast.java.test
Bundle-Version: 1.0.0 Bundle-Version: 1.0.0
Bundle-Activator: com.ibm.wala.cast.java.test.TestPlugin Bundle-Activator: com.ibm.wala.cast.java.test.TestPlugin
Bundle-Vendor: IBM Bundle-Vendor: IBM
Require-Bundle: org.junit4, Require-Bundle: com.ibm.wala.core.tests,
com.ibm.wala.core.tests,
com.ibm.wala.cast.java, com.ibm.wala.cast.java,
com.ibm.wala.cast, com.ibm.wala.cast,
com.ibm.wala.core, com.ibm.wala.core,
com.ibm.wala.shrike, com.ibm.wala.shrike,
org.eclipse.core.runtime org.junit4
Bundle-ActivationPolicy: lazy Bundle-ActivationPolicy: lazy
Export-Package: com.ibm.wala.cast.java.test Export-Package: com.ibm.wala.cast.java.test
Bundle-RequiredExecutionEnvironment: J2SE-1.5 Bundle-RequiredExecutionEnvironment: J2SE-1.5

View File

@ -1,53 +0,0 @@
/******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*****************************************************************************/
package com.ibm.wala.cast.java.test;
import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;
/**
* The main plugin class to be used in the desktop.
*/
public class TestPlugin extends Plugin {
//The shared instance.
private static TestPlugin plugin;
/**
* The constructor.
*/
public TestPlugin() {
plugin = this;
}
/**
* This method is called upon plug-in activation
*/
public void start(BundleContext context) throws Exception {
super.start(context);
}
/**
* This method is called when the plug-in is stopped
*/
public void stop(BundleContext context) throws Exception {
super.stop(context);
plugin = null;
}
/**
* Returns the shared instance.
*/
public static TestPlugin getDefault() {
return plugin;
}
}

View File

@ -3,15 +3,12 @@ Bundle-ManifestVersion: 2
Bundle-Name: Java Source WALA Front End Bundle-Name: Java Source WALA Front End
Bundle-SymbolicName: com.ibm.wala.cast.java Bundle-SymbolicName: com.ibm.wala.cast.java
Bundle-Version: 1.0.0.qualifier Bundle-Version: 1.0.0.qualifier
Bundle-Activator: com.ibm.wala.cast.java.JavaSourcePlugin
Bundle-Vendor: rfuhrer@watson.ibm.com Bundle-Vendor: rfuhrer@watson.ibm.com
Require-Bundle: com.ibm.wala.cast, Require-Bundle: com.ibm.wala.cast,
com.ibm.wala.core, com.ibm.wala.core,
com.ibm.wala.shrike, com.ibm.wala.shrike
org.eclipse.core.runtime
Bundle-ActivationPolicy: lazy Bundle-ActivationPolicy: lazy
Export-Package: com.ibm.wala.cast.java, Export-Package: com.ibm.wala.cast.java.analysis.typeInference,
com.ibm.wala.cast.java.analysis.typeInference,
com.ibm.wala.cast.java.client, com.ibm.wala.cast.java.client,
com.ibm.wala.cast.java.client.impl, com.ibm.wala.cast.java.client.impl,
com.ibm.wala.cast.java.examples.ast, com.ibm.wala.cast.java.examples.ast,

View File

@ -1,53 +0,0 @@
/******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*****************************************************************************/
package com.ibm.wala.cast.java;
import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;
/**
* The main plugin class to be used in the desktop.
*/
public class JavaSourcePlugin extends Plugin {
//The shared instance.
private static JavaSourcePlugin plugin;
/**
* The constructor.
*/
public JavaSourcePlugin() {
plugin = this;
}
/**
* This method is called upon plug-in activation
*/
public void start(BundleContext context) throws Exception {
super.start(context);
}
/**
* This method is called when the plug-in is stopped
*/
public void stop(BundleContext context) throws Exception {
super.stop(context);
plugin = null;
}
/**
* Returns the shared instance.
*/
public static JavaSourcePlugin getDefault() {
return plugin;
}
}

View File

@ -5,16 +5,14 @@ Bundle-SymbolicName: com.ibm.wala.cast.js.rhino.test
Bundle-Version: 1.0.0 Bundle-Version: 1.0.0
Bundle-Activator: com.ibm.wala.cast.js.rhino.test.Activator Bundle-Activator: com.ibm.wala.cast.js.rhino.test.Activator
Bundle-Vendor: IBM Bundle-Vendor: IBM
Require-Bundle: org.eclipse.core.runtime, Require-Bundle: com.ibm.wala.cast.js.rhino;bundle-version="1.0.0",
com.ibm.wala.cast.js.rhino;bundle-version="1.0.0",
com.ibm.wala.cast.js;bundle-version="1.0.0", com.ibm.wala.cast.js;bundle-version="1.0.0",
com.ibm.wala.cast;bundle-version="1.0.0", com.ibm.wala.cast;bundle-version="1.0.0",
com.ibm.wala.core;bundle-version="1.1.3", com.ibm.wala.core;bundle-version="1.1.3",
com.ibm.wala.cast.js.test;bundle-version="1.0.0", com.ibm.wala.cast.js.test;bundle-version="1.0.0",
com.ibm.wala.cast.test;bundle-version="1.0.0", com.ibm.wala.cast.test;bundle-version="1.0.0",
com.ibm.wala.core.tests;bundle-version="1.1.3", com.ibm.wala.core.tests;bundle-version="1.1.3",
org.junit4;bundle-version="4.3.1", org.junit4;bundle-version="4.3.1"
com.ibm.wala.ide;bundle-version="1.1.3"
Bundle-RequiredExecutionEnvironment: J2SE-1.5 Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy Bundle-ActivationPolicy: lazy
Export-Package: com.ibm.wala.cast.js.test Export-Package: com.ibm.wala.cast.js.test

View File

@ -1,50 +0,0 @@
package com.ibm.wala.cast.js.rhino.test;
import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
*/
public class Activator extends Plugin {
// The plug-in ID
public static final String PLUGIN_ID = "com.ibm.wala.cast.js.rhino.test";
// The shared instance
private static Activator plugin;
/**
* The constructor
*/
public Activator() {
}
/*
* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
/*
* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static Activator getDefault() {
return plugin;
}
}

View File

@ -3,10 +3,8 @@ Bundle-ManifestVersion: 2
Bundle-Name: Rhino Plug-in Bundle-Name: Rhino Plug-in
Bundle-SymbolicName: com.ibm.wala.cast.js.rhino Bundle-SymbolicName: com.ibm.wala.cast.js.rhino
Bundle-Version: 1.0.0 Bundle-Version: 1.0.0
Bundle-Activator: com.ibm.wala.js.rhino.Activator
Bundle-Vendor: IBM Bundle-Vendor: IBM
Require-Bundle: org.eclipse.core.runtime, Require-Bundle: com.ibm.wala.cast;bundle-version="1.0.0",
com.ibm.wala.cast;bundle-version="1.0.0",
com.ibm.wala.cast.js;bundle-version="1.0.0", com.ibm.wala.cast.js;bundle-version="1.0.0",
com.ibm.wala.core;bundle-version="1.1.3" com.ibm.wala.core;bundle-version="1.1.3"
Bundle-RequiredExecutionEnvironment: J2SE-1.5 Bundle-RequiredExecutionEnvironment: J2SE-1.5

View File

@ -1,50 +0,0 @@
package com.ibm.wala.js.rhino;
import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
*/
public class Activator extends Plugin {
// The plug-in ID
public static final String PLUGIN_ID = "com.ibm.wala.js.rhino";
// The shared instance
private static Activator plugin;
/**
* The constructor
*/
public Activator() {
}
/*
* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
/*
* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static Activator getDefault() {
return plugin;
}
}

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.ibm.wala.cast.js.test.data</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
<classpathentry kind="output" path=""/>
</classpath>

View File

@ -0,0 +1 @@
org.eclipse.wst.jsdt.launching.baseBrowserLibrary

View File

@ -0,0 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Data
Bundle-SymbolicName: com.ibm.wala.cast.js.test.data;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-ClassPath: examples-src/
Bundle-ActivationPolicy: lazy

View File

@ -0,0 +1,2 @@
bin.includes = META-INF/,\
examples-src/

View File

@ -1,263 +1,258 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> /**
<html> *
<head> */
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title> (function top () {
</head> var c = n.jQuery = n.$ = function dollar (a, d) {
<script> return new c.fn.init(a, d);
(function top () { }
var c = n.jQuery = n.$ = function dollar (a, d) { c.fn = c.prototype = {
return new c.fn.init(a, d) init: function init (a, d) {
} a = a || document;
c.fn = c.prototype = { if (a.nodeType) {
init: function init (a, d) { this[0] = a;
a = a || document; this.length = 1;
if (a.nodeType) { this.context = a;
this[0] = a; return this
this.length = 1; }
this.context = a; if (typeof a === "string") {
return this var f = r.exec(a);
} if (f && (f[1] || !d)) if (f[1]) a = c.clean([f[1]], d);
if (typeof a === "string") { else {
var f = r.exec(a); if ((d = document.getElementById(f[3])) && d.id != f[3]) return c().find(a);
if (f && (f[1] || !d)) if (f[1]) a = c.clean([f[1]], d); f = c(d || []);
else { f.context = document;
if ((d = document.getElementById(f[3])) && d.id != f[3]) return c().find(a); f.selector = a;
f = c(d || []); return f
f.context = document; } else return c(d).find(a)
f.selector = a; } else if (c.isFunction(a)) return c(document).ready(a);
return f if (a.selector && a.context) {
} else return c(d).find(a) this.selector =
} else if (c.isFunction(a)) return c(document).ready(a); a.selector;
if (a.selector && a.context) { this.context = a.context
this.selector = }
a.selector; return this.setArray(c.isArray(a) ? a : c.makeArray(a))
this.context = a.context }
}
return this.setArray(c.isArray(a) ? a : c.makeArray(a)) };
} c.extend = c.fn.extend = function extend () {
var a =
}; arguments[0] || {},
c.extend = c.fn.extend = function extend () { d = 1,
var a = f = arguments.length,
arguments[0] || {}, j = false,
d = 1, q;
f = arguments.length, if (typeof a === "boolean") {
j = false, j = a;
q; a = arguments[1] || {};
if (typeof a === "boolean") { d = 2
j = a; }
a = arguments[1] || {}; if (typeof a !== "object" && !c.isFunction(a)) a = {};
d = 2 if (f == d) {
} a = this;
if (typeof a !== "object" && !c.isFunction(a)) a = {}; --d
if (f == d) { }
a = this; for (; d < f; d++) if ((q = arguments[d]) != null) for (var t in q) {
--d var y = a[t],
} A = q[t];
for (; d < f; d++) if ((q = arguments[d]) != null) for (var t in q) { if (a !== A) if (j && A && typeof A === "object" && !A.nodeType) a[t] = c.extend(j, y || (A.length != null ? [] : {}), A);
var y = a[t], else if (A !== void 0) a[t] = A
A = q[t]; }
if (a !== A) if (j && A && typeof A === "object" && !A.nodeType) a[t] = c.extend(j, y || (A.length != null ? [] : {}), A); return a
else if (A !== void 0) a[t] = A };
} c.extend({
return a noConflict: function noConflict (a) {
}; n.$ =
c.extend({ B;
noConflict: function noConflict (a) { if (a) n.jQuery = w;
n.$ = return c
B; },
if (a) n.jQuery = w; isFunction: 2,
return c each: function each (a, d, f) {
}, var j, q = 0,
isFunction: 2, t = a.length;
each: function each (a, d, f) { if (f) if (t === void 0) for (j in a) {
var j, q = 0, if (d.apply(a[j], f) === false) break;
t = a.length; } else for (; q < t;) {
if (f) if (t === void 0) for (j in a) { if (d.apply(a[q++], f) === false) break;
if (d.apply(a[j], f) === false) break } else if (t === void 0) for (j in a) {
} else for (; q < t;) { if (d.call(a[j], j, a[j]) === false) break;
if (d.apply(a[q++], f) === false) break } else for (f = a[0]; q < t && d.call(f, q, f) !== false; f = a[++q]);
} else if (t === void 0) for (j in a) { return a
if (d.call(a[j], j, a[j]) === false) break },
} else for (f = a[0]; q < t && d.call(f, q, f) !== false; f = a[++q]); className: {
return a add: function add (a, d) {
}, c.each((d || "").split(/\s+/), function (f, j) {
className: { if (a.nodeType == 1 && !c.className.has(a.className, j)) a.className += (a.className ? " " : "") + j
add: function add (a, d) { })
c.each((d || "").split(/\s+/), function (f, j) { },
if (a.nodeType == 1 && !c.className.has(a.className, j)) a.className += (a.className ? " " : "") + j remove: function remove (a, d) {
}) if (a.nodeType == 1) a.className = d !== void 0 ? c.grep(a.className.split(/\s+/), function (f) {
}, return !c.className.has(d, f)
remove: function remove (a, d) { }).join(" ") : ""
if (a.nodeType == 1) a.className = d !== void 0 ? c.grep(a.className.split(/\s+/), function (f) { },
return !c.className.has(d, f) has: function has (a, d) {
}).join(" ") : "" return a && c.inArray(d, (a.className || a).toString().split(/\s+/)) > -1
}, }
has: function has (a, d) { },
return a && c.inArray(d, (a.className || a).toString().split(/\s+/)) > -1 swap: function swap (a, d, f) {
} var j = {};
}, for (var q in d) {
swap: function swap (a, d, f) { j[q] = a.style[q];
var j = {}; a.style[q] = d[q]
for (var q in d) { }
j[q] = a.style[q]; f.call(a);
a.style[q] = d[q] for (q in d) a.style[q] = j[q]
} },
f.call(a); css: function css (a, d, f, j) {
for (q in d) a.style[q] = j[q] if (d == "width" || d == "height") {
}, var q;
css: function css (a, d, f, j) { f = {
if (d == "width" || d == "height") { position: "absolute",
var q; visibility: "hidden",
f = { display: "block"
position: "absolute", };
visibility: "hidden", var t = d == "width" ? ["Left", "Right"] : ["Top", "Bottom"],
display: "block" y = function () {
}; q = d == "width" ? a.offsetWidth : a.offsetHeight;
var t = d == "width" ? ["Left", "Right"] : ["Top", "Bottom"], j !== "border" && c.each(t, function () {
y = function () { j || (q -= parseFloat(c.curCSS(a, "padding" + this, true)) || 0);
q = d == "width" ? a.offsetWidth : a.offsetHeight; if (j === "margin") q += parseFloat(c.curCSS(a, "margin" + this, true)) || 0;
j !== "border" && c.each(t, function () { else q -= parseFloat(c.curCSS(a, "border" + this + "Width", true)) || 0
j || (q -= parseFloat(c.curCSS(a, "padding" + this, true)) || 0); })
if (j === "margin") q += parseFloat(c.curCSS(a, "margin" + this, true)) || 0; };
else q -= parseFloat(c.curCSS(a, "border" + this + "Width", true)) || 0 a.offsetWidth !== 0 ? y() : c.swap(a, f, y);
}) return Math.max(0, Math.round(q))
}; }
a.offsetWidth !== 0 ? y() : c.swap(a, f, y); return c.curCSS(a, d, f)
return Math.max(0, Math.round(q)) },
} curCSS: function curCSS (a, d, f) {
return c.curCSS(a, d, f) var j, q = a.style;
}, if (d == "opacity" && !c.support.opacity) {
curCSS: function curCSS (a, d, f) { j = c.attr(q, "opacity");
var j, q = a.style; return j == "" ? "1" : j
if (d == "opacity" && !c.support.opacity) { }
j = c.attr(q, "opacity"); if (d.match(/float/i)) d = W;
return j == "" ? "1" : j if (!f && q && q[d]) j = q[d];
} else if (F.getComputedStyle) {
if (d.match(/float/i)) d = W; if (d.match(/float/i)) d = "float";
if (!f && q && q[d]) j = q[d]; d = d.replace(/([A-Z])/g, "-$1").toLowerCase();
else if (F.getComputedStyle) { if (a = F.getComputedStyle(a, null)) j = a.getPropertyValue(d);
if (d.match(/float/i)) d = "float"; if (d == "opacity" && j == "") j = "1"
d = d.replace(/([A-Z])/g, "-$1").toLowerCase(); } else if (a.currentStyle) {
if (a = F.getComputedStyle(a, null)) j = a.getPropertyValue(d); j = d.replace(/\-(\w)/g, function (t, y) {
if (d == "opacity" && j == "") j = "1" return y.toUpperCase()
} else if (a.currentStyle) { });
j = d.replace(/\-(\w)/g, function (t, y) { j = a.currentStyle[d] || a.currentStyle[j];
return y.toUpperCase() if (!/^\d+(px)?$/i.test(j) && /^\d/.test(j)) {
}); d = q.left;
j = a.currentStyle[d] || a.currentStyle[j]; f = a.runtimeStyle.left;
if (!/^\d+(px)?$/i.test(j) && /^\d/.test(j)) { a.runtimeStyle.left = a.currentStyle.left;
d = q.left; q.left = j || 0;
f = a.runtimeStyle.left; j = q.pixelLeft + "px";
a.runtimeStyle.left = a.currentStyle.left; q.left = d;
q.left = j || 0; a.runtimeStyle.left = f
j = q.pixelLeft + "px"; }
q.left = d; }
a.runtimeStyle.left = f return j
} },
} clean: function clean (a, d, f) {
return j d = d || document;
}, if (typeof d.createElement === "undefined") d = d.ownerDocument || d[0] && d[0].ownerDocument || document;
clean: function clean (a, d, f) { if (!f && a.length === 1 && typeof a[0] === "string") {
d = d || document; var j = /^<(\w+)\s*\/?>$/.exec(a[0]);
if (typeof d.createElement === "undefined") d = d.ownerDocument || d[0] && d[0].ownerDocument || document; if (j) return [d.createElement(j[1])]
if (!f && a.length === 1 && typeof a[0] === "string") { }
var j = /^<(\w+)\s*\/?>$/.exec(a[0]); c.each(a, function (y, A) {
if (j) return [d.createElement(j[1])] if (typeof A === "number") A += "";
} if (A) {
c.each(a, function (y, A) { if (typeof A === "string") {
if (typeof A === "number") A += ""; A = A.replace(/(<(\w+)[^>]*?)\/>/g, function (M, Q, S) {
if (A) { return S.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ? M : Q + "></" + S + ">"
if (typeof A === "string") { });
A = A.replace(/(<(\w+)[^>]*?)\/>/g, function (M, Q, S) { y = A.replace(/^\s+/, "").substring(0, 10).toLowerCase();
return S.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ? M : Q + "></" + S + ">" var L = !y.indexOf("<opt") && [1, "<select multiple='multiple'>", "</select>"] || !y.indexOf("<leg") && [1, "<fieldset>", "</fieldset>"] || y.match(/^<(thead|tbody|tfoot|colg|cap)/) && [1, "<table>", "</table>"] || !y.indexOf("<tr") && [2, "<table><tbody>", "</tbody></table>"] || (!y.indexOf("<td") || !y.indexOf("<th")) && [3, "<table><tbody><tr>", "</tr></tbody></table>"] || !y.indexOf("<col") && [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"] || !c.support.htmlSerialize && [1, "div<div>", "</div>"] || [0, "", ""];
}); for (t.innerHTML = L[1] + A + L[2]; L[0]--;) t = t.lastChild;
y = A.replace(/^\s+/, "").substring(0, 10).toLowerCase(); if (!c.support.tbody) {
var L = !y.indexOf("<opt") && [1, "<select multiple='multiple'>", "</select>"] || !y.indexOf("<leg") && [1, "<fieldset>", "</fieldset>"] || y.match(/^<(thead|tbody|tfoot|colg|cap)/) && [1, "<table>", "</table>"] || !y.indexOf("<tr") && [2, "<table><tbody>", "</tbody></table>"] || (!y.indexOf("<td") || !y.indexOf("<th")) && [3, "<table><tbody><tr>", "</tr></tbody></table>"] || !y.indexOf("<col") && [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"] || !c.support.htmlSerialize && [1, "div<div>", "</div>"] || [0, "", ""]; var N = /<tbody/i.test(A);
for (t.innerHTML = L[1] + A + L[2]; L[0]--;) t = t.lastChild; y = !y.indexOf("<table") && !N ? t.firstChild && t.firstChild.childNodes : L[1] == "<table>" && !N ? t.childNodes : [];
if (!c.support.tbody) { for (L = y.length - 1; L >= 0; --L) c.nodeName(y[L], "tbody") && !y[L].childNodes.length && y[L].parentNode.removeChild(y[L])
var N = /<tbody/i.test(A); }!c.support.leadingWhitespace && /^\s/.test(A) && t.insertBefore(d.createTextNode(A.match(/^\s*/)[0]), t.firstChild);
y = !y.indexOf("<table") && !N ? t.firstChild && t.firstChild.childNodes : L[1] == "<table>" && !N ? t.childNodes : []; A = c.makeArray(t.childNodes)
for (L = y.length - 1; L >= 0; --L) c.nodeName(y[L], "tbody") && !y[L].childNodes.length && y[L].parentNode.removeChild(y[L]) }
}!c.support.leadingWhitespace && /^\s/.test(A) && t.insertBefore(d.createTextNode(A.match(/^\s*/)[0]), t.firstChild); if (A.nodeType) q.push(A);
A = c.makeArray(t.childNodes) else q = c.merge(q, A)
} }
if (A.nodeType) q.push(A); });
else q = c.merge(q, A) if (f) {
} for (a = 0; q[a]; a++) if (c.nodeName(q[a], "script") && (!q[a].type || q[a].type.toLowerCase() === "text/javascript")) j.push(q[a].parentNode ? q[a].parentNode.removeChild(q[a]) : q[a]);
}); else {
if (f) { q[a].nodeType === 1 && q.splice.apply(q, [a + 1, 0].concat(c.makeArray(q[a].getElementsByTagName("script"))));
for (a = 0; q[a]; a++) if (c.nodeName(q[a], "script") && (!q[a].type || q[a].type.toLowerCase() === "text/javascript")) j.push(q[a].parentNode ? q[a].parentNode.removeChild(q[a]) : q[a]); f.appendChild(q[a])
else { }
q[a].nodeType === 1 && q.splice.apply(q, [a + 1, 0].concat(c.makeArray(q[a].getElementsByTagName("script")))); return j
f.appendChild(q[a]) }
} return q
return j },
} attr: function attr (a, d, f) {
return q if (!(!a || a.nodeType == 3 || a.nodeType == 8)) {
}, var j = !c.isXMLDoc(a),
attr: function attr (a, d, f) { q = f !== void 0;
if (!(!a || a.nodeType == 3 || a.nodeType == 8)) { d = j && c.props[d] || d;
var j = !c.isXMLDoc(a), if (a.tagName) {
q = f !== void 0; var t = /href|src|style/.test(d);
d = j && c.props[d] || d; if (d in a && j && !t) {
if (a.tagName) { if (q) {
var t = /href|src|style/.test(d); if (d == "type" && c.nodeName(a, "input") && a.parentNode) throw "type property can't be changed";
if (d in a && j && !t) { a[d] = f
if (q) { }
if (d == "type" && c.nodeName(a, "input") && a.parentNode) throw "type property can't be changed"; if (c.nodeName(a, "form") && a.getAttributeNode(d)) return a.getAttributeNode(d).nodeValue;
a[d] = f if (d == "tabIndex") return (d = a.getAttributeNode("tabIndex")) && d.specified ? d.value : a.nodeName.match(/(button|input|object|select|textarea)/i) ? 0 : a.nodeName.match(/^(a|area)$/i) && a.href ? 0 : void 0;
} return a[d]
if (c.nodeName(a, "form") && a.getAttributeNode(d)) return a.getAttributeNode(d).nodeValue; }
if (d == "tabIndex") return (d = a.getAttributeNode("tabIndex")) && d.specified ? d.value : a.nodeName.match(/(button|input|object|select|textarea)/i) ? 0 : a.nodeName.match(/^(a|area)$/i) && a.href ? 0 : void 0; if (!c.support.style && j && d == "style") return c.attr(a.style, "cssText", f);
return a[d] q && a.setAttribute(d, "" + f);
} a = !c.support.hrefNormalized && j && t ? a.getAttribute(d, 2) : a.getAttribute(d);
if (!c.support.style && j && d == "style") return c.attr(a.style, "cssText", f); return a === null ? void 0 : a
q && a.setAttribute(d, "" + f); }
a = !c.support.hrefNormalized && j && t ? a.getAttribute(d, 2) : a.getAttribute(d); if (!c.support.opacity && d == "opacity") {
return a === null ? void 0 : a if (q) {
} a.zoom = 1;
if (!c.support.opacity && d == "opacity") { a.filter = (a.filter || "").replace(/alpha\([^)]*\)/, "") + (parseInt(f) + "" == "NaN" ? "" : "alpha(opacity=" + f * 100 + ")")
if (q) { }
a.zoom = 1; return a.filter && a.filter.indexOf("opacity=") >= 0 ? parseFloat(a.filter.match(/opacity=([^)]*)/)[1]) / 100 + "" : ""
a.filter = (a.filter || "").replace(/alpha\([^)]*\)/, "") + (parseInt(f) + "" == "NaN" ? "" : "alpha(opacity=" + f * 100 + ")") }
} d = d.replace(/-([a-z])/ig, function (y, A) {
return a.filter && a.filter.indexOf("opacity=") >= 0 ? parseFloat(a.filter.match(/opacity=([^)]*)/)[1]) / 100 + "" : "" return A.toUpperCase()
} });
d = d.replace(/-([a-z])/ig, function (y, A) { if (q) a[d] = f;
return A.toUpperCase() return a[d]
}); }
if (q) a[d] = f; },
return a[d] makeArray: function makeArray (a) {
} var d = [];
}, if (a != null) {
makeArray: function makeArray (a) { var f = a.length;
var d = []; if (f == null || typeof a === "string" || c.isFunction(a) || a.setInterval) d[0] = a;
if (a != null) { else for (; f;) d[--f] = a[f]
var f = a.length; }
if (f == null || typeof a === "string" || c.isFunction(a) || a.setInterval) d[0] = a; return d
else for (; f;) d[--f] = a[f] },
} inArray: function inArray (a, d) {
return d for (var f = 0, j = d.length; f < j; f++) if (d[f] === a) return f;
}, return -1
inArray: function inArray (a, d) { },
for (var f = 0, j = d.length; f < j; f++) if (d[f] === a) return f; merge: function merge (a, d) {
return -1 var f = 0,
}, j, q = a.length;
merge: function merge (a, d) { if (c.support.getAll) for (;
var f = 0, (j = d[f++]) != null;) a[q++] = j;
j, q = a.length; else for (;
if (c.support.getAll) for (; (j =
(j = d[f++]) != null;) a[q++] = j; d[f++]) != null;) if (j.nodeType != 8) a[q++] = j;
else for (; return a
(j = }
d[f++]) != null;) if (j.nodeType != 8) a[q++] = j;
return a });
},
})();
});
})();
</script>

View File

@ -0,0 +1,8 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<script src="jquery.js">
</script>

Some files were not shown because too many files have changed in this diff Show More